Commit 51a69e98872353ebe409f39c6b2f62f32305c63b

Authored by zhangchao
1 parent 9c110a89c1
Exists in dev

#fix:优化体重添加修改逻辑

Showing 1 changed file with 32 additions and 30 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ 51a69e9
... ... @@ -186,20 +186,21 @@
186 186 boolean flag = true;
187 187 if (CollectionUtils.isNotEmpty(pw.getDayWeights2())) {
188 188 dayWeights2 = pw.getDayWeights2();
189   - }
190   - for (Map<String, Object> map : dayWeights2) {
191   - if (map.get("date").equals(ymdDate)) {
192   - flag = false;
193   - map.put("hospitalId", hospitalId);
194   - map.put("hospitalName", couponMapper.getHospitalName(hospitalId));
195   - map.put("date", ymdDate);
196   - map.put("nowWeight", nowWeight);
197   - if ("2100002419".equals(hospitalId)){
198   - map.put("riskFactorId", CollectionUtils.isNotEmpty(patients.getRiskFactorId())?patients.getRiskFactorId():null);
199   - map.put("week", patientWeight.getWeek());
  189 + for (Map<String, Object> map : dayWeights2) {
  190 + if (map.get("date").equals(ymdDate)) {
  191 + flag = false;
  192 + map.put("hospitalId", hospitalId);
  193 + map.put("hospitalName", couponMapper.getHospitalName(hospitalId));
  194 + map.put("date", ymdDate);
  195 + map.put("nowWeight", nowWeight);
  196 + if ("2100002419".equals(hospitalId)){
  197 + map.put("riskFactorId", CollectionUtils.isNotEmpty(patients.getRiskFactorId())?patients.getRiskFactorId():null);
  198 + map.put("week", patientWeight.getWeek());
  199 + }
200 200 }
201 201 }
202 202 }
  203 +
203 204 if (flag) {
204 205 Map<String, Object> m = new HashMap<>();
205 206 m.put("hospitalId", hospitalId);
... ... @@ -1451,7 +1452,7 @@
1451 1452 params.put("height",com.lyms.platform.common.utils.StringUtils.isNotEmpty(chuModel.getHeight()) ? chuModel.getHeight() : "");
1452 1453 }
1453 1454 params.put("list",list);
1454   - return RespBuilder.buildSuccess(params);
  1455 + return RespBuilder.buildSuccess(params);
1455 1456 }
1456 1457  
1457 1458 @Override
1458 1459  
1459 1460  
1460 1461  
... ... @@ -1481,30 +1482,31 @@
1481 1482 dayWeights.put(DateUtil.getyyyy_MM_dd(new Date()), nowWeight);
1482 1483 pw.setNowWeight(nowWeight);
1483 1484 pw.setDayWeights(dayWeights);
1484   -
  1485 + boolean flag = true;
1485 1486 if (CollectionUtils.isNotEmpty(pw.getDayWeights2())) {
1486 1487 dayWeights2 = pw.getDayWeights2();
1487   - }
1488   - boolean flag = true;
1489   - for (Map<String, Object> map : dayWeights2) {
1490   - if (map.get("date").equals(ymdDate)) {
1491   - flag = false;
1492   - if (hospitalId.equals(map.get("hospitalId") + "")) {
1493   - map.put("hospitalId", hospitalId);
1494   - map.put("hospitalName", couponMapper.getHospitalName(hospitalId));
1495   - map.put("date", ymdDate);
1496   - map.put("nowWeight", nowWeight);
1497   - //如果是大同添加当前患者高危因素
1498   - if ("2100002419".equals(hospitalId)){
1499   - map.put("riskFactorId", CollectionUtils.isNotEmpty(patients.getRiskFactorId())?patients.getRiskFactorId():null);
1500   - map.put("week", patientWeight.getWeek());
  1488 + for (Map<String, Object> map : dayWeights2) {
  1489 + if (map.get("date").equals(ymdDate)) {
  1490 + flag = false;
  1491 + if (hospitalId.equals(map.get("hospitalId") + "")) {
  1492 + map.put("hospitalId", hospitalId);
  1493 + map.put("hospitalName", couponMapper.getHospitalName(hospitalId));
  1494 + map.put("date", ymdDate);
  1495 + map.put("nowWeight", nowWeight);
  1496 + //如果是大同添加当前患者高危因素
  1497 + if ("2100002419".equals(hospitalId)){
  1498 + map.put("riskFactorId", CollectionUtils.isNotEmpty(patients.getRiskFactorId())?patients.getRiskFactorId():null);
  1499 + map.put("week", patientWeight.getWeek());
  1500 + }
  1501 + } else {
  1502 + map.put("hospitalId2", hospitalId);
  1503 + map.put("nowWeight2", nowWeight);
1501 1504 }
1502   - } else {
1503   - map.put("hospitalId2", hospitalId);
1504   - map.put("nowWeight2", nowWeight);
1505 1505 }
1506 1506 }
1507 1507 }
  1508 +
  1509 +
1508 1510 if (flag) {
1509 1511 Map<String, Object> m = new HashMap<>();
1510 1512 m.put("hospitalId", hospitalId);