diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java index b229cf9..bc5ef4d 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java @@ -87,6 +87,9 @@ public class PatientController { @Autowired private LymsPushVisitRecordService lymsPushVisitRecordService; + @Autowired + private LymsHisInfoService lymsHisInfoService; + /** * 获取患者列表 * @@ -997,6 +1000,27 @@ public class PatientController { boolean f = lymsPatientService.save(patient); baseResponse.setErrorcode(f?0:1); baseResponse.setErrormsg(f?"注册成功!":"注册失败!"); + try{ + QueryWrapper query=new QueryWrapper(); + query.eq("name",patient.getPname()); + query.eq("phone",patient.getEnrolmentPhone()); + query.isNull("idCard"); + List list = lymsHisInfoService.list(query); + if(CollectionUtils.isNotEmpty(list)){ + for(LymsHisInfo hisInfo: list){ + LymsHisInfo info = new LymsHisInfo(); + info.setId(hisInfo.getId()); + info.setIdcard(patient.getIdno()); + lymsHisInfoService.updateById(info); + log.info("根据姓名和手机号更新his患者身份证号信息成功,{}",hisInfo); + } + } + + }catch (Exception e){ + log.error("更新his患者身份证号信息失败"); + } + + }else { baseResponse.setErrorcode(2); baseResponse.setErrormsg("身份证已注册!"); diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsHisInfoServiceImpl.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsHisInfoServiceImpl.java index 740825d..3aeea89 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsHisInfoServiceImpl.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsHisInfoServiceImpl.java @@ -195,7 +195,8 @@ public class LymsHisInfoServiceImpl extends ServiceImpl