From af30179f26b83c0b72f8d8875e11ecb400fd3abf Mon Sep 17 00:00:00 2001 From: wtt Date: Thu, 6 Aug 2020 15:20:05 +0800 Subject: [PATCH] update --- .../web/service/impl/BabyEyeCheckServiceImpl.java | 121 +++++++++++---------- 1 file changed, 63 insertions(+), 58 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java index d7d76de..a01f8d1 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java @@ -663,26 +663,28 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeC public BaseResponse edit(String id) { BabyEyeCheck babyEyeCheck = mongoTemplate.findById(id, BabyEyeCheck.class); Map map = ReflectionUtils.beanToMap(babyEyeCheck); - map.put("checkTime", DateUtil.getYyyyMmDd(babyEyeCheck.getCheckTime())); - if (StringUtils.isNotEmpty(babyEyeCheck.getCheckMonthId())) { - map.put("checkMonthId", babyEyeCheck.getCheckMonthId() + ""); - } - - FilePathModel filePath = yunBookbuildingService.findFilePathByBabyId(babyEyeCheck.getId()); - map.put("filePath", filePath); + if (babyEyeCheck!=null) { + map.put("checkTime", DateUtil.getYyyyMmDd(babyEyeCheck.getCheckTime())); + if (StringUtils.isNotEmpty(babyEyeCheck.getCheckMonthId())) { + map.put("checkMonthId", babyEyeCheck.getCheckMonthId() + ""); + } - map.put("nextCheckTime", DateUtil.getYyyyMmDd(babyEyeCheck.getNextCheckTime())); - if (babyEyeCheck.getRiskFactorId() != null) { - List riskFactorId = babyEyeCheck.getRiskFactorId(); - List> rest = new ArrayList<>(); - for (String s : riskFactorId) { - EyeHighRiskEnums eyeHighRiskEnums = EyeHighRiskEnums.get(Integer.parseInt(s)); - Map tempMap = new HashedMap(); - tempMap.put("id", eyeHighRiskEnums.getId() + ""); - tempMap.put("name", eyeHighRiskEnums.getName()); - rest.add(tempMap); + FilePathModel filePath = yunBookbuildingService.findFilePathByBabyId(babyEyeCheck.getId()); + map.put("filePath", filePath); + + map.put("nextCheckTime", DateUtil.getYyyyMmDd(babyEyeCheck.getNextCheckTime())); + if (babyEyeCheck.getRiskFactorId() != null) { + List riskFactorId = babyEyeCheck.getRiskFactorId(); + List> rest = new ArrayList<>(); + for (String s : riskFactorId) { + EyeHighRiskEnums eyeHighRiskEnums = EyeHighRiskEnums.get(Integer.parseInt(s)); + Map tempMap = new HashedMap(); + tempMap.put("id", eyeHighRiskEnums.getId() + ""); + tempMap.put("name", eyeHighRiskEnums.getName()); + rest.add(tempMap); + } + map.put("riskFactorId", rest); } - map.put("riskFactorId", rest); } return RespBuilder.buildSuccess(map); } @@ -691,36 +693,39 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeC public BaseResponse editQhd(String id) { BabyEyeCheck babyEyeCheck = mongoTemplate.findById(id, BabyEyeCheck.class); Map map = ReflectionUtils.beanToMap(babyEyeCheck); - map.put("checkTime", DateUtil.getYyyyMmDd(babyEyeCheck.getCheckTime())); - map.put("uncooperative", babyEyeCheck.isUncooperative()); - map.put("checkMonthAge", babyEyeCheck.getCheckMonthAge()); - if (StringUtils.isNotEmpty(babyEyeCheck.getCheckMonthId())) { - //处理老数据 - if ("0".equals(babyEyeCheck.getCheckMonthId())) { - babyEyeCheck.setCheckMonthId("1"); - } else if ("9".equals(babyEyeCheck.getCheckMonthId())) { - babyEyeCheck.setCheckMonthId("12"); - } else if ("18".equals(babyEyeCheck.getCheckMonthId())) { - babyEyeCheck.setCheckMonthId("24"); + if (babyEyeCheck != null) { + map.put("checkTime", DateUtil.getYyyyMmDd(babyEyeCheck.getCheckTime())); + map.put("uncooperative", babyEyeCheck.isUncooperative()); + map.put("checkMonthAge", babyEyeCheck.getCheckMonthAge()); + if (StringUtils.isNotEmpty(babyEyeCheck.getCheckMonthId())) { + //处理老数据 + if ("0".equals(babyEyeCheck.getCheckMonthId())) { + babyEyeCheck.setCheckMonthId("1"); + } else if ("9".equals(babyEyeCheck.getCheckMonthId())) { + babyEyeCheck.setCheckMonthId("12"); + } else if ("18".equals(babyEyeCheck.getCheckMonthId())) { + babyEyeCheck.setCheckMonthId("24"); + } + map.put("checkMonthId", babyEyeCheck.getCheckMonthId() + ""); } - map.put("checkMonthId", babyEyeCheck.getCheckMonthId() + ""); - } - FilePathModel filePath = yunBookbuildingService.findFilePathByBabyId(babyEyeCheck.getId()); - map.put("filePath", filePath); - - map.put("nextCheckTime", DateUtil.getYyyyMmDd(babyEyeCheck.getNextCheckTime())); - if (babyEyeCheck.getRiskFactorId() != null) { - List riskFactorId = babyEyeCheck.getRiskFactorId(); - List> rest = new ArrayList<>(); - for (String s : riskFactorId) { - EyeHighRiskEnums eyeHighRiskEnums = EyeHighRiskEnums.get(Integer.parseInt(s)); - Map tempMap = new HashedMap(); - tempMap.put("id", eyeHighRiskEnums.getId() + ""); - tempMap.put("name", eyeHighRiskEnums.getName()); - rest.add(tempMap); + FilePathModel filePath = yunBookbuildingService.findFilePathByBabyId(babyEyeCheck.getId()); + map.put("filePath", filePath); + + map.put("nextCheckTime", DateUtil.getYyyyMmDd(babyEyeCheck.getNextCheckTime())); + if (babyEyeCheck.getRiskFactorId() != null) { + List riskFactorId = babyEyeCheck.getRiskFactorId(); + List> rest = new ArrayList<>(); + for (String s : riskFactorId) { + EyeHighRiskEnums eyeHighRiskEnums = EyeHighRiskEnums.get(Integer.parseInt(s)); + Map tempMap = new HashedMap(); + tempMap.put("id", eyeHighRiskEnums.getId() + ""); + tempMap.put("name", eyeHighRiskEnums.getName()); + rest.add(tempMap); + } + map.put("riskFactorId", rest); } - map.put("riskFactorId", rest); + } return RespBuilder.buildSuccess(map); } @@ -960,7 +965,7 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeC //没有查询条件,展示建档没有检查,和建档检查的,档案。 if (startBuildDate == null && endBuildDate == null && startDate == null && endDate == null && doctor == null && StringUtils.isEmpty(key) && currentMonthStart == null && currentMonthEnd == null && chechMonth == null - && StringUtils.isEmpty(yin) && bookEndDate==null && bookStartDate==null) { + && StringUtils.isEmpty(yin) && bookEndDate == null && bookStartDate == null) { //获取在眼保健新增的新档案,历史不回去。 Criteria c = Criteria.where("yn").ne("0").and("hospitalId").is(hospitalId).and("displayState").is("1"); List babyModels = mongoUtil.findField(BabyModel.class, c, "id"); @@ -988,7 +993,7 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeC //有档案 有检查。1取两个都满足的。2不满足就是null。3 不符合条件false就是只是建档查询。 if (startBuildDate != null && endBuildDate != null && ((startDate != null && endDate != null) || doctor != null || StringUtils.isNotEmpty(key) || (currentMonthStart != null || currentMonthEnd != null) || chechMonth != null || StringUtils.isNotEmpty(yin) - ||((bookEndDate != null && bookStartDate != null)))) { + || ((bookEndDate != null && bookStartDate != null)))) { jdbabyModelsStr.retainAll(babyIdBabyEyeCheck); babyIds = jdbabyModelsStr; } @@ -1075,27 +1080,27 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeC criteria.and("pupillaryRightReflex").is("yang"); } else if ("pupillaryLeftReflex".equals(id)) { criteria.and("pupillaryLeftReflex").is("yang"); - }else if ("redRightReflex".equals(id)) { + } else if ("redRightReflex".equals(id)) { criteria.and("redRightReflex").is("yang"); - }else if ("redLeftReflex".equals(id)) { + } else if ("redLeftReflex".equals(id)) { criteria.and("redLeftReflex").is("yang"); - }else if ("redReflex".equals(id)) { + } else if ("redReflex".equals(id)) { criteria.and("redReflex").is("yang"); - }else if ("conjunctiva".equals(id)) { + } else if ("conjunctiva".equals(id)) { criteria.and("conjunctiva").is("yang"); - }else if ("corneal".equals(id)) { + } else if ("corneal".equals(id)) { criteria.and("corneal").is("yang"); - }else if ("lacrimalApparatus".equals(id)) { + } else if ("lacrimalApparatus".equals(id)) { criteria.and("lacrimalApparatus").is("yang"); - }else if ("eyePositionId2".equals(id)) { + } else if ("eyePositionId2".equals(id)) { criteria.and("eyePositionId2").is("yang"); - }else if ("redLeft2".equals(id)) { + } else if ("redLeft2".equals(id)) { criteria.and("redLeft2").is("yang"); - }else if ("vision2".equals(id)) { + } else if ("vision2".equals(id)) { criteria.and("vision2").is("yang"); - }else if ("y2".equals(id)) { + } else if ("y2".equals(id)) { criteria.and("y2").is("yang"); - }else if ("refraction2".equals(id)) { + } else if ("refraction2".equals(id)) { criteria.and("ss").is("refraction2"); } -- 1.8.3.1