新增验证身份证号是否存在
This commit is contained in:
parent
dd41937de8
commit
adfb92693a
@ -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();
|
||||
|
||||
@ -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<>();
|
||||
|
||||
@ -81,6 +81,9 @@ public interface InspectPatientService {
|
||||
|
||||
//根据条码获取患者信息
|
||||
InspectPatientDO getPatientOfMedicalSn(String medicalSn);
|
||||
//验证身份证号是否存在
|
||||
boolean validateIdCardExists(String idCard);
|
||||
|
||||
//根据身份证、姓名、体检编码获取患者信息
|
||||
List<InspectPatientDO> getPatientBySearchKey(String searchKey);
|
||||
|
||||
|
||||
@ -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<>();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user