Commit af30179f26b83c0b72f8d8875e11ecb400fd3abf

Authored by wtt
1 parent 4a9fb927c8

update

Showing 1 changed file with 63 additions and 58 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java View file @ af30179
... ... @@ -663,26 +663,28 @@
663 663 public BaseResponse edit(String id) {
664 664 BabyEyeCheck babyEyeCheck = mongoTemplate.findById(id, BabyEyeCheck.class);
665 665 Map<String, Object> map = ReflectionUtils.beanToMap(babyEyeCheck);
666   - map.put("checkTime", DateUtil.getYyyyMmDd(babyEyeCheck.getCheckTime()));
667   - if (StringUtils.isNotEmpty(babyEyeCheck.getCheckMonthId())) {
668   - map.put("checkMonthId", babyEyeCheck.getCheckMonthId() + "");
669   - }
  666 + if (babyEyeCheck!=null) {
  667 + map.put("checkTime", DateUtil.getYyyyMmDd(babyEyeCheck.getCheckTime()));
  668 + if (StringUtils.isNotEmpty(babyEyeCheck.getCheckMonthId())) {
  669 + map.put("checkMonthId", babyEyeCheck.getCheckMonthId() + "");
  670 + }
670 671  
671   - FilePathModel filePath = yunBookbuildingService.findFilePathByBabyId(babyEyeCheck.getId());
672   - map.put("filePath", filePath);
  672 + FilePathModel filePath = yunBookbuildingService.findFilePathByBabyId(babyEyeCheck.getId());
  673 + map.put("filePath", filePath);
673 674  
674   - map.put("nextCheckTime", DateUtil.getYyyyMmDd(babyEyeCheck.getNextCheckTime()));
675   - if (babyEyeCheck.getRiskFactorId() != null) {
676   - List<String> riskFactorId = babyEyeCheck.getRiskFactorId();
677   - List<Map<String, Object>> rest = new ArrayList<>();
678   - for (String s : riskFactorId) {
679   - EyeHighRiskEnums eyeHighRiskEnums = EyeHighRiskEnums.get(Integer.parseInt(s));
680   - Map<String, Object> tempMap = new HashedMap();
681   - tempMap.put("id", eyeHighRiskEnums.getId() + "");
682   - tempMap.put("name", eyeHighRiskEnums.getName());
683   - rest.add(tempMap);
  675 + map.put("nextCheckTime", DateUtil.getYyyyMmDd(babyEyeCheck.getNextCheckTime()));
  676 + if (babyEyeCheck.getRiskFactorId() != null) {
  677 + List<String> riskFactorId = babyEyeCheck.getRiskFactorId();
  678 + List<Map<String, Object>> rest = new ArrayList<>();
  679 + for (String s : riskFactorId) {
  680 + EyeHighRiskEnums eyeHighRiskEnums = EyeHighRiskEnums.get(Integer.parseInt(s));
  681 + Map<String, Object> tempMap = new HashedMap();
  682 + tempMap.put("id", eyeHighRiskEnums.getId() + "");
  683 + tempMap.put("name", eyeHighRiskEnums.getName());
  684 + rest.add(tempMap);
  685 + }
  686 + map.put("riskFactorId", rest);
684 687 }
685   - map.put("riskFactorId", rest);
686 688 }
687 689 return RespBuilder.buildSuccess(map);
688 690 }
689 691  
690 692  
691 693  
692 694  
... ... @@ -691,36 +693,39 @@
691 693 public BaseResponse editQhd(String id) {
692 694 BabyEyeCheck babyEyeCheck = mongoTemplate.findById(id, BabyEyeCheck.class);
693 695 Map<String, Object> map = ReflectionUtils.beanToMap(babyEyeCheck);
694   - map.put("checkTime", DateUtil.getYyyyMmDd(babyEyeCheck.getCheckTime()));
695   - map.put("uncooperative", babyEyeCheck.isUncooperative());
696   - map.put("checkMonthAge", babyEyeCheck.getCheckMonthAge());
697   - if (StringUtils.isNotEmpty(babyEyeCheck.getCheckMonthId())) {
698   - //处理老数据
699   - if ("0".equals(babyEyeCheck.getCheckMonthId())) {
700   - babyEyeCheck.setCheckMonthId("1");
701   - } else if ("9".equals(babyEyeCheck.getCheckMonthId())) {
702   - babyEyeCheck.setCheckMonthId("12");
703   - } else if ("18".equals(babyEyeCheck.getCheckMonthId())) {
704   - babyEyeCheck.setCheckMonthId("24");
  696 + if (babyEyeCheck != null) {
  697 + map.put("checkTime", DateUtil.getYyyyMmDd(babyEyeCheck.getCheckTime()));
  698 + map.put("uncooperative", babyEyeCheck.isUncooperative());
  699 + map.put("checkMonthAge", babyEyeCheck.getCheckMonthAge());
  700 + if (StringUtils.isNotEmpty(babyEyeCheck.getCheckMonthId())) {
  701 + //处理老数据
  702 + if ("0".equals(babyEyeCheck.getCheckMonthId())) {
  703 + babyEyeCheck.setCheckMonthId("1");
  704 + } else if ("9".equals(babyEyeCheck.getCheckMonthId())) {
  705 + babyEyeCheck.setCheckMonthId("12");
  706 + } else if ("18".equals(babyEyeCheck.getCheckMonthId())) {
  707 + babyEyeCheck.setCheckMonthId("24");
  708 + }
  709 + map.put("checkMonthId", babyEyeCheck.getCheckMonthId() + "");
705 710 }
706   - map.put("checkMonthId", babyEyeCheck.getCheckMonthId() + "");
707   - }
708 711  
709   - FilePathModel filePath = yunBookbuildingService.findFilePathByBabyId(babyEyeCheck.getId());
710   - map.put("filePath", filePath);
  712 + FilePathModel filePath = yunBookbuildingService.findFilePathByBabyId(babyEyeCheck.getId());
  713 + map.put("filePath", filePath);
711 714  
712   - map.put("nextCheckTime", DateUtil.getYyyyMmDd(babyEyeCheck.getNextCheckTime()));
713   - if (babyEyeCheck.getRiskFactorId() != null) {
714   - List<String> riskFactorId = babyEyeCheck.getRiskFactorId();
715   - List<Map<String, Object>> rest = new ArrayList<>();
716   - for (String s : riskFactorId) {
717   - EyeHighRiskEnums eyeHighRiskEnums = EyeHighRiskEnums.get(Integer.parseInt(s));
718   - Map<String, Object> tempMap = new HashedMap();
719   - tempMap.put("id", eyeHighRiskEnums.getId() + "");
720   - tempMap.put("name", eyeHighRiskEnums.getName());
721   - rest.add(tempMap);
  715 + map.put("nextCheckTime", DateUtil.getYyyyMmDd(babyEyeCheck.getNextCheckTime()));
  716 + if (babyEyeCheck.getRiskFactorId() != null) {
  717 + List<String> riskFactorId = babyEyeCheck.getRiskFactorId();
  718 + List<Map<String, Object>> rest = new ArrayList<>();
  719 + for (String s : riskFactorId) {
  720 + EyeHighRiskEnums eyeHighRiskEnums = EyeHighRiskEnums.get(Integer.parseInt(s));
  721 + Map<String, Object> tempMap = new HashedMap();
  722 + tempMap.put("id", eyeHighRiskEnums.getId() + "");
  723 + tempMap.put("name", eyeHighRiskEnums.getName());
  724 + rest.add(tempMap);
  725 + }
  726 + map.put("riskFactorId", rest);
722 727 }
723   - map.put("riskFactorId", rest);
  728 +
724 729 }
725 730 return RespBuilder.buildSuccess(map);
726 731 }
... ... @@ -960,7 +965,7 @@
960 965 //没有查询条件,展示建档没有检查,和建档检查的,档案。
961 966 if (startBuildDate == null && endBuildDate == null && startDate == null && endDate == null && doctor == null
962 967 && StringUtils.isEmpty(key) && currentMonthStart == null && currentMonthEnd == null && chechMonth == null
963   - && StringUtils.isEmpty(yin) && bookEndDate==null && bookStartDate==null) {
  968 + && StringUtils.isEmpty(yin) && bookEndDate == null && bookStartDate == null) {
964 969 //获取在眼保健新增的新档案,历史不回去。
965 970 Criteria c = Criteria.where("yn").ne("0").and("hospitalId").is(hospitalId).and("displayState").is("1");
966 971 List<BabyModel> babyModels = mongoUtil.findField(BabyModel.class, c, "id");
... ... @@ -988,7 +993,7 @@
988 993 //有档案 有检查。1取两个都满足的。2不满足就是null。3 不符合条件false就是只是建档查询。
989 994 if (startBuildDate != null && endBuildDate != null && ((startDate != null && endDate != null) || doctor != null || StringUtils.isNotEmpty(key) ||
990 995 (currentMonthStart != null || currentMonthEnd != null) || chechMonth != null || StringUtils.isNotEmpty(yin)
991   - ||((bookEndDate != null && bookStartDate != null)))) {
  996 + || ((bookEndDate != null && bookStartDate != null)))) {
992 997 jdbabyModelsStr.retainAll(babyIdBabyEyeCheck);
993 998 babyIds = jdbabyModelsStr;
994 999 }
995 1000  
996 1001  
997 1002  
998 1003  
999 1004  
1000 1005  
1001 1006  
1002 1007  
1003 1008  
1004 1009  
... ... @@ -1075,27 +1080,27 @@
1075 1080 criteria.and("pupillaryRightReflex").is("yang");
1076 1081 } else if ("pupillaryLeftReflex".equals(id)) {
1077 1082 criteria.and("pupillaryLeftReflex").is("yang");
1078   - }else if ("redRightReflex".equals(id)) {
  1083 + } else if ("redRightReflex".equals(id)) {
1079 1084 criteria.and("redRightReflex").is("yang");
1080   - }else if ("redLeftReflex".equals(id)) {
  1085 + } else if ("redLeftReflex".equals(id)) {
1081 1086 criteria.and("redLeftReflex").is("yang");
1082   - }else if ("redReflex".equals(id)) {
  1087 + } else if ("redReflex".equals(id)) {
1083 1088 criteria.and("redReflex").is("yang");
1084   - }else if ("conjunctiva".equals(id)) {
  1089 + } else if ("conjunctiva".equals(id)) {
1085 1090 criteria.and("conjunctiva").is("yang");
1086   - }else if ("corneal".equals(id)) {
  1091 + } else if ("corneal".equals(id)) {
1087 1092 criteria.and("corneal").is("yang");
1088   - }else if ("lacrimalApparatus".equals(id)) {
  1093 + } else if ("lacrimalApparatus".equals(id)) {
1089 1094 criteria.and("lacrimalApparatus").is("yang");
1090   - }else if ("eyePositionId2".equals(id)) {
  1095 + } else if ("eyePositionId2".equals(id)) {
1091 1096 criteria.and("eyePositionId2").is("yang");
1092   - }else if ("redLeft2".equals(id)) {
  1097 + } else if ("redLeft2".equals(id)) {
1093 1098 criteria.and("redLeft2").is("yang");
1094   - }else if ("vision2".equals(id)) {
  1099 + } else if ("vision2".equals(id)) {
1095 1100 criteria.and("vision2").is("yang");
1096   - }else if ("y2".equals(id)) {
  1101 + } else if ("y2".equals(id)) {
1097 1102 criteria.and("y2").is("yang");
1098   - }else if ("refraction2".equals(id)) {
  1103 + } else if ("refraction2".equals(id)) {
1099 1104 criteria.and("ss").is("refraction2");
1100 1105 }
1101 1106