From 2650913fc9a812ccf228ccb7418e3b716ef18334 Mon Sep 17 00:00:00 2001 From: wtt Date: Wed, 22 Jul 2020 10:37:30 +0800 Subject: [PATCH] update --- .../web/controller/BabyEyeCheckController.java | 15 ++++ .../operate/web/facade/BabyCheckFacade.java | 24 +++++- .../operate/web/result/BabyBasicResult.java | 20 +++++ .../operate/web/service/BabyEyeCheckService.java | 1 + .../web/service/impl/BabyEyeCheckServiceImpl.java | 96 +++++++++++++++------- 5 files changed, 124 insertions(+), 32 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyEyeCheckController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyEyeCheckController.java index fa84907..ea901df 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyEyeCheckController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyEyeCheckController.java @@ -54,6 +54,21 @@ public class BabyEyeCheckController extends BaseController { public BaseResponse queryQhd(@PathVariable String id, HttpServletRequest request) { return babyEyeCheckService.queryQhd(getUserId(request), id); } + + /** + * 儿保检查获取眼保健检查结果信息 + * + * @param babyId + * @param request + * @Author: 武涛涛 + * @Date: 2020/7/22 9:31 + */ + @ResponseBody + @TokenRequired + @RequestMapping(value = "/queryShowQhd/{babyId}", method = RequestMethod.GET) + public BaseResponse queryShowQhd(@PathVariable String babyId, HttpServletRequest request) { + return babyEyeCheckService.queryShowQhd(babyId); + } /** * 保存之后查看的数据 * diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java index 17090b9..5bc5c30 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java @@ -1106,7 +1106,20 @@ public class BabyCheckFacade extends BaseServiceImpl { } } - + private String getBasicConfig(String id) { + try { + if (StringUtils.isEmpty(id)) { + return ""; + } + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(id); + if (null != basicConfig) { + return basicConfig.getName(); + } + } catch (Exception e) { + e.printStackTrace(); + } + return ""; + } public BabyModel getBabyModel(String id, BabyBasicResult base) { BabyModel model = null; if (!StringUtils.isEmpty(id)) { @@ -1118,6 +1131,15 @@ public class BabyCheckFacade extends BaseServiceImpl { List models = babyBookbuildingService.queryBabyBuildByCond(babyQuery); if (models != null && models.size() > 0) { model = models.get(0); + /** + * start + * 秦皇岛眼保健打印使用 + * @Author: 武涛涛 + * @Date: 2020/7/22 10:08 + */ + base.setEncoded(model.getEncoded()); + base.setBnationId(model.getBnationId() == null ? "" : getBasicConfig(model.getBnationId())); + /*end*/ base.setYn(model.getYn()); base.setDataStatus(model.getDataStatus()); base.setmHighRiskReason(mongoUtil.findColor(model.getmHighRiskReason())); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyBasicResult.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyBasicResult.java index 22aeb1c..77f83ae 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyBasicResult.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyBasicResult.java @@ -17,6 +17,10 @@ public class BabyBasicResult { public void setmHighRiskReason(List> mHighRiskReason) { this.mHighRiskReason = mHighRiskReason; } + // 编码唯一,通过编码获取档案信息,编码格式20200721001 + private String encoded; + //新生儿民族Id + private String bnationId; private String id; @@ -90,6 +94,22 @@ public class BabyBasicResult { return babyHeight; } + public String getEncoded() { + return encoded; + } + + public void setEncoded(String encoded) { + this.encoded = encoded; + } + + public String getBnationId() { + return bnationId; + } + + public void setBnationId(String bnationId) { + this.bnationId = bnationId; + } + public void setBabyHeight(String babyHeight) { this.babyHeight = babyHeight; } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/BabyEyeCheckService.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/BabyEyeCheckService.java index 3d5e817..d3485e9 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/BabyEyeCheckService.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/BabyEyeCheckService.java @@ -31,6 +31,7 @@ public interface BabyEyeCheckService extends IBaseService { BaseResponse query(Integer userId, String babyId); BaseResponse queryQhd(Integer userId, String babyId); + BaseResponse queryShowQhd( String babyId); BaseResponse listInit(Integer userId); 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 a97eda7..093b3db 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 @@ -1,5 +1,6 @@ package com.lyms.platform.operate.web.service.impl; +import com.lyms.platform.biz.service.BabyBookbuildingService; import com.lyms.platform.biz.service.BasicConfigService; import com.lyms.platform.biz.service.YunBookbuildingService; import com.lyms.platform.common.dao.BaseQuery; @@ -21,6 +22,7 @@ import com.lyms.platform.operate.web.utils.ResponseUtil; import com.lyms.platform.permission.dao.master.BabyEyeCheckMapper; import com.lyms.platform.permission.dao.master.CouponMapper; import com.lyms.platform.pojo.*; +import com.lyms.platform.query.BabyModelQuery; import org.apache.commons.collections.map.HashedMap; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Sort; @@ -44,7 +46,10 @@ import static com.lyms.platform.operate.web.service.BabyAfterVisitService.*; public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeCheckService { @Autowired private BabyEyeCheckMapper babyEyeCheckMapper; - + @Autowired + private OrganizationGroupsFacade groupsFacade; + @Autowired + private BabyBookbuildingService babyBookbuildingService; @Autowired private AutoMatchFacade autoMatchFacade; @@ -409,6 +414,7 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeC CollectionUtils.removeNullValue(map); return RespBuilder.buildSuccess(map); } + /** * 秦皇岛(定制)保存之后查看的数据 * @@ -539,11 +545,11 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeC map.put("riskFactorId", riskFactorNames); //处理老数据 - if("0".equals(babyEyeCheck.getCheckMonthId())){ + if ("0".equals(babyEyeCheck.getCheckMonthId())) { babyEyeCheck.setCheckMonthId("1"); - }else if("9".equals(babyEyeCheck.getCheckMonthId())){ + } else if ("9".equals(babyEyeCheck.getCheckMonthId())) { babyEyeCheck.setCheckMonthId("12"); - }else if("18".equals(babyEyeCheck.getCheckMonthId())){ + } else if ("18".equals(babyEyeCheck.getCheckMonthId())) { babyEyeCheck.setCheckMonthId("24"); } map.put("checkMonthId", CheckMonthQhdEnums.getName(babyEyeCheck.getCheckMonthId())); @@ -641,6 +647,7 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeC } return RespBuilder.buildSuccess(map); } + @Override public BaseResponse editQhd(String id) { BabyEyeCheck babyEyeCheck = mongoTemplate.findById(id, BabyEyeCheck.class); @@ -649,11 +656,11 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeC map.put("uncooperative", babyEyeCheck.isUncooperative()); if (StringUtils.isNotEmpty(babyEyeCheck.getCheckMonthId())) { //处理老数据 - if("0".equals(babyEyeCheck.getCheckMonthId())){ + if ("0".equals(babyEyeCheck.getCheckMonthId())) { babyEyeCheck.setCheckMonthId("1"); - }else if("9".equals(babyEyeCheck.getCheckMonthId())){ + } else if ("9".equals(babyEyeCheck.getCheckMonthId())) { babyEyeCheck.setCheckMonthId("12"); - }else if("18".equals(babyEyeCheck.getCheckMonthId())){ + } else if ("18".equals(babyEyeCheck.getCheckMonthId())) { babyEyeCheck.setCheckMonthId("24"); } map.put("checkMonthId", babyEyeCheck.getCheckMonthId() + ""); @@ -697,7 +704,7 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeC public BaseResponse list(Integer userId, Date startDate, Date endDate, String doctor, String key, Integer currentMonthStart, Integer currentMonthEnd, String chechMonth, boolean positive, String positiveIds, Integer page, Integer limit, Date bookStartDate, Date bookEndDate, - String apparatusPositive, String doctorPositive, String yin,String noPassIds) { + String apparatusPositive, String doctorPositive, String yin, String noPassIds) { boolean b = true; String hospitalId = autoMatchFacade.getHospitalId(userId); Criteria criteria = Criteria.where("yn").ne("0").and("hospitalId").is(hospitalId); @@ -711,12 +718,12 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeC criteria.and("doctor").is(doctor); } - if(b && StringUtils.isNotEmpty(chechMonth)){ - if("0".equals(chechMonth)){ + if (b && StringUtils.isNotEmpty(chechMonth)) { + if ("0".equals(chechMonth)) { chechMonth = "1"; - }else if("9".equals(chechMonth)){ + } else if ("9".equals(chechMonth)) { chechMonth = "12"; - }else if("18".equals(chechMonth)){ + } else if ("18".equals(chechMonth)) { chechMonth = "24"; } } @@ -754,21 +761,21 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeC if (StringUtils.isNotEmpty(noPassIds)) { List ids = CollectionUtils.asList(noPassIds, String.class); for (String id : ids) { - if("eyeAppearance".equals(id)){ + if ("eyeAppearance".equals(id)) { criteria.and("eyeAppearance").is("2"); - }else if("redReflexQhd".equals(id)){ + } else if ("redReflexQhd".equals(id)) { criteria.and("redReflexQhd").is("2"); - }else if("blinkReflex".equals(id)){ + } else if ("blinkReflex".equals(id)) { criteria.and("blinkReflex").is("2"); - }else if("redBallTest".equals(id)){ + } else if ("redBallTest".equals(id)) { criteria.and("redBallTest").is("2"); - }else if("behaviorObservation".equals(id)){ + } else if ("behaviorObservation".equals(id)) { criteria.and("behaviorObservation").is("2"); - }else if("refractiveScreening".equals(id)){ + } else if ("refractiveScreening".equals(id)) { criteria.and("refractiveScreening").is("2"); - }else if("eyePositionExamination".equals(id)){ + } else if ("eyePositionExamination".equals(id)) { criteria.and("eyePositionExamination").is("2"); - }else if("eyeMovement".equals(id)){ + } else if ("eyeMovement".equals(id)) { criteria.and("eyeMovement").is("2"); } } @@ -852,17 +859,17 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeC temp.put("birth", DateUtil.getYyyyMmDd(babyModel.getBirth())); } if (StringUtils.isNotEmpty(babyEyeCheck.getCheckMonthId())) { - if(StringUtils.isNotEmpty(babyEyeCheck.getEdition())){ + if (StringUtils.isNotEmpty(babyEyeCheck.getEdition())) { //处理老数据 - if("0".equals(babyEyeCheck.getCheckMonthId())){ + if ("0".equals(babyEyeCheck.getCheckMonthId())) { babyEyeCheck.setCheckMonthId("1"); - }else if("9".equals(babyEyeCheck.getCheckMonthId())){ + } else if ("9".equals(babyEyeCheck.getCheckMonthId())) { babyEyeCheck.setCheckMonthId("12"); - }else if("18".equals(babyEyeCheck.getCheckMonthId())){ + } else if ("18".equals(babyEyeCheck.getCheckMonthId())) { babyEyeCheck.setCheckMonthId("24"); } temp.put("checkMonth", CheckMonthQhdEnums.getName(babyEyeCheck.getCheckMonthId())); - }else { + } else { temp.put("checkMonth", CheckMonthEnums.getName(babyEyeCheck.getCheckMonthId())); /** 检查月龄 */; } } @@ -1043,6 +1050,7 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeC } return RespBuilder.buildSuccess(rest); } + @Override public BaseResponse queryQhd(Integer userId, String babyId) { List hospitalIds = organizationGroupsFacade.findGroupHospital(userId, false); @@ -1058,17 +1066,17 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeC temp.put("hospitalId", babyEyeCheck.getHospitalId()); temp.put("edition", babyEyeCheck.getEdition()); temp.put("pid", babyEyeCheck.getPid()); - if(StringUtils.isNotEmpty(babyEyeCheck.getEdition())){ + if (StringUtils.isNotEmpty(babyEyeCheck.getEdition())) { //处理老数据 - if("0".equals(babyEyeCheck.getCheckMonthId())){ + if ("0".equals(babyEyeCheck.getCheckMonthId())) { babyEyeCheck.setCheckMonthId("1"); - }else if("9".equals(babyEyeCheck.getCheckMonthId())){ + } else if ("9".equals(babyEyeCheck.getCheckMonthId())) { babyEyeCheck.setCheckMonthId("12"); - }else if("18".equals(babyEyeCheck.getCheckMonthId())){ + } else if ("18".equals(babyEyeCheck.getCheckMonthId())) { babyEyeCheck.setCheckMonthId("24"); } temp.put("checkMonth", CheckMonthQhdEnums.getName(babyEyeCheck.getCheckMonthId())); - }else { + } else { temp.put("checkMonth", CheckMonthEnums.getName(babyEyeCheck.getCheckMonthId())); } BabyModel babyModel = mongoTemplate.findById(babyEyeCheck.getBabyId(), BabyModel.class); @@ -1086,6 +1094,32 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeC } @Override + public BaseResponse queryShowQhd( String babyId) { + Date firstSecond = DateUtil.getDayFirstSecond(new Date()); + Date dayLastSecond = DateUtil.getDayLastSecond(new Date()); + Map temp = new HashMap<>(); + List babyEyeChecks = mongoTemplate.find(Query.query(Criteria.where("babyId").is(babyId) + .and("yn").ne("0").and("checkTime").gte(firstSecond).lte(dayLastSecond)) + .with(new Sort(Sort.Direction.DESC, "created")), BabyEyeCheck.class); + + if (CollectionUtils.isNotEmpty(babyEyeChecks)) { + BabyEyeCheck babyEyeCheck = babyEyeChecks.get(0); + temp.put("id", babyEyeCheck.getId()); + temp.put("hospitalId", babyEyeCheck.getHospitalId()); + temp.put("edition", babyEyeCheck.getEdition()); + temp.put("pid", babyEyeCheck.getPid()); + temp.put("checkTime", babyEyeCheck.getCheckTime() == null ? null : DateUtil.getYyyyMmDd(babyEyeCheck.getCheckTime())); + temp.put("uncooperative", babyEyeCheck.isUncooperative()); // false不合作 + temp.put("eyeAppearance", babyEyeCheck.getEyeAppearance()); // 眼外观 + temp.put("redReflexQhd", babyEyeCheck.getRedReflexQhd());//红光反射 + temp.put("refractiveScreening", babyEyeCheck.getRefractiveScreening());//屈光筛查 + temp.put("guidanceOpinions", babyEyeCheck.getGuidanceOpinions());//指导意见 + } + + return RespBuilder.buildSuccess(temp); + } + + @Override public BaseResponse listInit(Integer userId) { String hospitalId = autoMatchFacade.getHospitalId(userId); @@ -1283,7 +1317,7 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEyeC @Override public void export(Integer userId, Date startDate, Date endDate, String doctor, String key, Integer currentMonthStart, Integer currentMonthEnd, String chechMonth, boolean positive, String positiveIds, HttpServletResponse response, Date bookStartDate, Date bookEndDate, String apparatusPositive, String doctorPositive, String yin) { - BaseResponse rest = list(userId, startDate, endDate, doctor, key, currentMonthStart, currentMonthEnd, chechMonth, positive, positiveIds, 1, Integer.MAX_VALUE, bookStartDate, bookEndDate, apparatusPositive, doctorPositive, yin,null); + BaseResponse rest = list(userId, startDate, endDate, doctor, key, currentMonthStart, currentMonthEnd, chechMonth, positive, positiveIds, 1, Integer.MAX_VALUE, bookStartDate, bookEndDate, apparatusPositive, doctorPositive, yin, null); PageResult pageResult = (PageResult) rest.getObject(); List> datas = (List>) pageResult.getGrid(); Map cnames = new LinkedHashMap<>(); -- 1.8.3.1