Commit a3b3c92089ccd4205da07c584b56f0bb7d6fae38

Authored by liquanyu
1 parent 4dfc4e1d54

update

Showing 3 changed files with 38 additions and 5 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java View file @ a3b3c92
... ... @@ -11,6 +11,7 @@
11 11 import com.lyms.platform.operate.web.request.AntExAddRequest;
12 12 import com.lyms.platform.operate.web.request.AntExManagerQueryRequest;
13 13 import com.lyms.platform.operate.web.request.CjStatisticsQueryRequest;
  14 +import com.lyms.platform.operate.web.request.NutritionInfoRequest;
14 15 import com.lyms.platform.operate.web.result.AntExManagerResult;
15 16 import com.lyms.platform.operate.web.result.CjStatisticsListResult;
16 17 import com.lyms.platform.operate.web.result.CjStatisticsResult;
17 18  
18 19  
19 20  
... ... @@ -1168,20 +1169,35 @@
1168 1169 * 如果是体重测量在后,就通过测量体重时候去修改产检中的体重
1169 1170 * @param hospitalId
1170 1171 * @param pid
1171   - * @param currentWeight
  1172 + * @param nutritionInfoRequest
1172 1173 */
1173   - public void updateAntenatal(String hospitalId,String pid,Double currentWeight)
  1174 + public void updateAntenatal(String hospitalId,String pid,NutritionInfoRequest nutritionInfoRequest)
1174 1175 {
1175 1176 if (!isOpenAutoSaveAntenatal(hospitalId))
1176 1177 {
1177 1178 return;
1178 1179 }
1179   - List<AntenatalExaminationModel> examinationModel = mongoTemplate.find(Query.query(Criteria.where("pid").is(pid)), AntenatalExaminationModel.class);
  1180 +
  1181 + List<AntExChuModel> antExChuModels = mongoTemplate.find(Query.query(Criteria.where("pid").is(pid).and("yn").is(YnEnums.YES.getId())), AntExChuModel.class);
  1182 + if (CollectionUtils.isNotEmpty(antExChuModels)) {
  1183 + for (AntExChuModel model : antExChuModels) {
  1184 + if (StringUtils.isNotEmpty(DateUtil.getyyyy_MM_dd(model.getCheckTime())) &&
  1185 + DateUtil.getyyyy_MM_dd(new Date()).equals(DateUtil.getyyyy_MM_dd(model.getCheckTime()))) {
  1186 + model.setWeight(String.valueOf(Double.parseDouble(nutritionInfoRequest.getCurrentWeight())));
  1187 + model.setHeight(nutritionInfoRequest.getBeforeHeight());
  1188 + model.setYqWeight(nutritionInfoRequest.getBeforeWeight());
  1189 + antenatalExaminationService.updateAntExChu(model, model.getId());
  1190 + break;
  1191 + }
  1192 + }
  1193 + }
  1194 +
  1195 + List<AntenatalExaminationModel> examinationModel = mongoTemplate.find(Query.query(Criteria.where("pid").is(pid).and("yn").is(YnEnums.YES.getId())), AntenatalExaminationModel.class);
1180 1196 if (CollectionUtils.isNotEmpty(examinationModel)) {
1181 1197 for (AntenatalExaminationModel model : examinationModel) {
1182 1198 if (StringUtils.isNotEmpty(DateUtil.getyyyy_MM_dd(model.getCheckDate())) &&
1183 1199 DateUtil.getyyyy_MM_dd(new Date()).equals(DateUtil.getyyyy_MM_dd(model.getCheckDate()))) {
1184   - model.setWeight(currentWeight);
  1200 + model.setWeight(Double.parseDouble(nutritionInfoRequest.getCurrentWeight()));
1185 1201 antenatalExaminationService.updateOneAnt(model, model.getId());
1186 1202 }
1187 1203 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java View file @ a3b3c92
... ... @@ -1087,7 +1087,7 @@
1087 1087 }
1088 1088  
1089 1089 //更新当天产检记录的体重
1090   - antExRecordFacade.updateAntenatal(hospitalId, patients.getPid(), Double.parseDouble(currentWeight));
  1090 + antExRecordFacade.updateAntenatal(hospitalId, patients.getPid(), nutritionInfoRequest);
1091 1091  
1092 1092 MeasureInfoRequest measureInfoRequest = new MeasureInfoRequest();
1093 1093 measureInfoRequest.setCertNo(patients.getCardNo());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ a3b3c92
... ... @@ -289,6 +289,23 @@
289 289 for (PatientWeight patientWeight : patientWeights) {
290 290 Patients p = mongoTemplate.findById(patientWeight.getPatientId(), Patients.class);
291 291 if (p != null) {
  292 +
  293 + if (p.getType() == 3)
  294 + {
  295 +
  296 + PatientsQuery patientsQuery = new PatientsQuery();
  297 + patientsQuery.setExtSource(false);
  298 + patientsQuery.setType(1);
  299 + patientsQuery.setYn(YnEnums.YES.getId());
  300 + patientsQuery.setSort("created");
  301 + patientsQuery.setPid(p.getPid());
  302 + List<Patients> patients = patientsService.queryPatient(patientsQuery);
  303 + if (CollectionUtils.isNotEmpty(patients))
  304 + {
  305 + p = patients.get(0);
  306 + }
  307 + }
  308 +
292 309 Map<String, Object> temp = new LinkedHashMap<>();
293 310 temp.put("id", patientWeight.getId());
294 311 temp.put("username", p.getUsername());