新增验证身份证号是否存在

This commit is contained in:
lxd 2025-03-26 13:03:11 +08:00
parent dd41937de8
commit adfb92693a
4 changed files with 23 additions and 0 deletions

View File

@ -77,6 +77,14 @@ public class CommonResult<T> implements Serializable {
return result;
}
public static <T> CommonResult<T> success(T data,String msg) {
CommonResult<T> result = new CommonResult<>();
result.code = GlobalErrorCodeConstants.SUCCESS.getCode();
result.data = data;
result.msg = msg;
return result;
}
public static <T> CommonResult<T> success(String msg) {
CommonResult<T> result = new CommonResult<>();
result.code = GlobalErrorCodeConstants.SUCCESS.getCode();

View File

@ -307,6 +307,11 @@ public class InspectPatientController {
@Operation(summary = "根据表单创建患者信息和项目信息")
public CommonResult<Boolean> insertPatinetInfo(@Valid @RequestBody InspectPatientSaveReqVO inspectPatientSaveReqVO)
{
//验证身份证
if( patientService.validateIdCardExists(inspectPatientSaveReqVO.getCardId()))
{
return success(false,"身份证号已存在");
}
//检查项目
// List<InspectPatientitemsSaveReqVO> dataList2 = new ArrayList<>();

View File

@ -81,6 +81,9 @@ public interface InspectPatientService {
//根据条码获取患者信息
InspectPatientDO getPatientOfMedicalSn(String medicalSn);
//验证身份证号是否存在
boolean validateIdCardExists(String idCard);
//根据身份证姓名体检编码获取患者信息
List<InspectPatientDO> getPatientBySearchKey(String searchKey);

View File

@ -158,6 +158,13 @@ public class InspectPatientServiceImpl implements InspectPatientService {
lambdaQuery.eq(InspectPatientDO::getMedicalSn, medicalSn);
return patientMapper.selectOne(lambdaQuery);
}
@Override
public boolean validateIdCardExists(String idCard) {
LambdaQueryWrapper<InspectPatientDO> lambdaQuery = new LambdaQueryWrapper<>();
lambdaQuery.eq(InspectPatientDO::getCardId, idCard);
return patientMapper.selectCount(lambdaQuery) > 0;
}
@Override
public List<InspectPatientDO> getPatientBySearchKey(String searchKey) {
LambdaQueryWrapper<InspectPatientDO> lambdaQuery = new LambdaQueryWrapper<>();