Commit bc3da77b3f5ea2376dc8bb80de242b6c704ead4f

Authored by wangbo
1 parent 3dff3fc38c

修改末次月经

Showing 2 changed files with 23 additions and 11 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SieveController.java View file @ bc3da77
... ... @@ -230,7 +230,7 @@
230 230 * @return
231 231 */
232 232 @ResponseBody
233   - @RequestMapping(value = "/cqsieves",method = RequestMethod.GET)
  233 + @RequestMapping(value = "",method = RequestMethod.GET)
234 234 @TokenRequired
235 235 public BaseResponse queryChanQianSieve(@Valid CqSieveQueryRequest cqSieveQueryRequest,HttpServletRequest request){
236 236 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ bc3da77
... ... @@ -95,6 +95,9 @@
95 95 @Autowired
96 96 private AntenatalExaminationService antenatalExaminationService;
97 97  
  98 + @Autowired
  99 + private AntExRecordService recordService;
  100 +
98 101 /**
99 102 * 最低:0~13 : 0~1.9 13~40 1.9~11.9
100 103 * 最高: 0~2.2 2.2~15.9
101 104  
... ... @@ -800,9 +803,9 @@
800 803 @Override
801 804 public BaseResponse updateLastMenstrual(String lastMenstrual, String pid) {
802 805 if (StringUtils.isEmpty(pid)) {
803   - return RespBuilder.buildSuccess("查询号不能为空!");
  806 + return RespBuilder.buildSuccess(ResponseCode.PATIENT_NOT_FOUND, "查询号不能为空!");
804 807 } else if (StringUtils.isEmpty(lastMenstrual)) {
805   - return RespBuilder.buildSuccess("请填写需要纠正的末次月经!");
  808 + return RespBuilder.buildErro(ResponseCode.DATA_ERROR, "请填写需要纠正的末次月经!");
806 809 }
807 810  
808 811 Date lastMenstrualData = DateUtil.parseYMD(lastMenstrual);
809 812  
810 813  
811 814  
812 815  
813 816  
... ... @@ -811,27 +814,36 @@
811 814 if (CollectionUtils.isNotEmpty(patients)) {
812 815 Patients patients1 = patients.get(0);
813 816 //同时修改初诊的末次月经
  817 + Patients patient = new Patients();
  818 + patient.setLastMenses(lastMenstrualData);
  819 + for (Patients p : patients) {
  820 + patientsService.updatePatientOne(patient, p.getId());
  821 + }
814 822 AntExChuModel antExChuModel = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(patients1.getPid())), AntExChuModel.class);
815 823 if (antExChuModel != null) {
  824 + //修改产检记录表末次月经
  825 + List<AntExRecordModel> antExRecordModels = mongoTemplate.find(Query.query(Criteria.where("pid").is(antExChuModel.getPid())), AntExRecordModel.class);
  826 + if (CollectionUtils.isNotEmpty(antExRecordModels)) {
  827 + for (AntExRecordModel antExRecordModel : antExRecordModels) {
  828 + antExRecordModel.setLastMenses(lastMenstrualData);
  829 + recordService.updateOne(antExRecordModel, antExChuModel.getId());
  830 + }
  831 + }
816 832 antExChuModel.setLastMenses(lastMenstrualData);
817 833 antenatalExaminationService.updateAntExChu(antExChuModel, antExChuModel.getId());
818 834 List<AntenatalExaminationModel> antenatalExaminationModels = mongoTemplate.find(Query.query(Criteria.where("pid").is(pid).and("yn").is(YnEnums.YES.getId())), AntenatalExaminationModel.class);
819 835 if (CollectionUtils.isNotEmpty(antenatalExaminationModels)) {
  836 + //循环修修改初诊的末次月经
820 837 for (AntenatalExaminationModel antenatalList : antenatalExaminationModels) {
821   -
822   - // antenatalExaminationService.updateAntenatalExamination()
  838 + antenatalList.setLastMenses(lastMenstrualData);
  839 + antenatalExaminationService.updateOneAnt(antenatalList, antenatalList.getId());
823 840 }
824 841 }
825 842 }
826 843  
827   - Patients patient = new Patients();
828   - patient.setLastMenses(lastMenstrualData);
829   - for (Patients p : patients) {
830   - patientsService.updatePatientOne(patient, p.getId());
831   - }
832 844 return RespBuilder.buildSuccess("成功!");
833 845 } else {
834   - return RespBuilder.buildSuccess("该孕妇已分娩或未建档!");
  846 + return RespBuilder.buildSuccess(ResponseCode.PATIENT_NOT_FOUND, "该孕妇已分娩或未建档!");
835 847 }
836 848  
837 849 }