Commit 35838cde2ee5739dca6c5099e49d8088f3027bd8
1 parent
aa2bd84cae
Exists in
master
and in
6 other branches
出院小结及儿保列表展示
Showing 4 changed files with 87 additions and 46 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/DischargeAbstractController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/DischargeAbstractFacade.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java
View file @
35838cd
| ... | ... | @@ -151,10 +151,19 @@ |
| 151 | 151 | * |
| 152 | 152 | * @param |
| 153 | 153 | */ |
| 154 | - public BaseResponse list(Integer page, Integer limit) { | |
| 155 | - | |
| 156 | - | |
| 157 | - return null; | |
| 154 | + @RequestMapping(value = "/queryBabyCheckAll", method = RequestMethod.GET) | |
| 155 | + @ResponseBody | |
| 156 | + @TokenRequired | |
| 157 | + public BaseResponse list( | |
| 158 | + @RequestParam(value = "checkTime", required = false) String checkTime, | |
| 159 | + @RequestParam(value = "queryNo", required = false) String queryNo, | |
| 160 | + @RequestParam(value = "startCheckMonthAge", required = false) Integer startCheckMonthAge, | |
| 161 | + @RequestParam(value = "endCheckMonthAge", required = false) Integer endCheckMonthAge, | |
| 162 | + @RequestParam(value = "nextDate", required = false) String nextDate, | |
| 163 | + @RequestParam(value = "highRisk", required = false) String highRisk, | |
| 164 | + @RequestParam(value = "waskSon", required = false) String waskSon, | |
| 165 | + Integer page, Integer limit, HttpServletRequest request) { | |
| 166 | + return babyCheckFacade.babyCheckList(checkTime, queryNo, startCheckMonthAge, endCheckMonthAge, nextDate, highRisk, waskSon, limit, page, getUserId(request)); | |
| 158 | 167 | } |
| 159 | 168 | |
| 160 | 169 | |
| ... | ... | @@ -277,7 +286,7 @@ |
| 277 | 286 | * @param request |
| 278 | 287 | * @return |
| 279 | 288 | */ |
| 280 | - @RequestMapping("/currentCheckBabyList") | |
| 289 | + @RequestMapping("/ currentCheckBabyList") | |
| 281 | 290 | @ResponseBody |
| 282 | 291 | @TokenRequired |
| 283 | 292 | public BaseObjectResponse currentCheckBabyList(HttpServletRequest request) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/DischargeAbstractController.java
View file @
35838cd
| ... | ... | @@ -118,9 +118,10 @@ |
| 118 | 118 | @RequestParam(value = "limit") Integer limit, |
| 119 | 119 | @RequestParam(value = "leaveHospitalDate", required = false) String leaveHospitalDate, |
| 120 | 120 | @RequestParam(value = "queryNo", required = false) String queryNo, |
| 121 | - @RequestParam(value = "postpartumDays", required = false) Integer postpartumDays, | |
| 121 | + @RequestParam(value = "startPostpartumDays", required = false) Integer startPostpartumDays, | |
| 122 | + @RequestParam(value = "endPostpartumDays", required = false) Integer endPostpartumDays, | |
| 122 | 123 | @RequestParam(value = "rmDate", required = false) String fmDate) { |
| 123 | - return dischargeAbstractFacade.list(page, limit, getUserId(request), leaveHospitalDate, postpartumDays, fmDate, queryNo); | |
| 124 | + return dischargeAbstractFacade.list(page, limit, getUserId(request), leaveHospitalDate, startPostpartumDays,endPostpartumDays, fmDate, queryNo); | |
| 124 | 125 | } |
| 125 | 126 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
View file @
35838cd
| ... | ... | @@ -756,54 +756,66 @@ |
| 756 | 756 | } |
| 757 | 757 | |
| 758 | 758 | |
| 759 | - public BaseResponse babyCheckList(Integer page, Integer limit, Integer userId) { | |
| 760 | - | |
| 761 | - | |
| 762 | - boolean flag = true; | |
| 759 | + public BaseResponse babyCheckList(String checkTime, String queryNo, Integer checkMonthAge, Integer endCheckMonthAge, String nextDate, String highRisk, String waskSon, Integer page, Integer limit, Integer userId) { | |
| 760 | + boolean flag = false; | |
| 763 | 761 | List<String> hospital = groupsFacade.findGroupHospital(userId, false); |
| 764 | 762 | Criteria criteria = Criteria.where("yn").ne("0").and("hospitalId").in(hospital); |
| 765 | 763 | Criteria pCriteria = Criteria.where("yn").ne("0").and("hospitalId").in(hospital); |
| 766 | - /*if (org.apache.commons.lang.StringUtils.isNotBlank(key)) { | |
| 767 | - pCriteria.orOperator(Criteria.where("phone").regex(key), Criteria.where("userName").regex(key), Criteria.where("cardID").regex(key)); | |
| 764 | + if (org.apache.commons.lang.StringUtils.isNotBlank(queryNo)) { | |
| 765 | + pCriteria.orOperator(Criteria.where("mcertNo").regex(queryNo), Criteria.where("name").regex(queryNo), Criteria.where("fphone").regex(queryNo)); | |
| 768 | 766 | flag = true; |
| 769 | 767 | } |
| 770 | - if (stateWeek != null && endWeek != null) { | |
| 771 | - Date start = DateUtil.getWeekStart(endWeek); | |
| 772 | - Date end = DateUtil.getWeekEnd(stateWeek); | |
| 773 | - pCriteria.and("lastMenses").gt(start).lte(end); | |
| 774 | - flag = true; | |
| 775 | - } | |
| 776 | - if (age != null) { | |
| 777 | - Date start = DateUtil.getBeforeAge(age); | |
| 778 | - Date end = DateUtil.getBeforeAge(age + 1); | |
| 779 | - pCriteria.and("birth").gt(end).lte(start); | |
| 780 | - flag = true; | |
| 781 | - }*/ | |
| 782 | 768 | if (flag) { |
| 783 | - List<BabyCheckModel> babyCheckModelsList = mongoTemplate.find(Query.query(pCriteria), BabyCheckModel.class); | |
| 769 | + List<BabyModel> babykModelsList = mongoTemplate.find(Query.query(pCriteria), BabyModel.class); | |
| 784 | 770 | List<String> ids = new ArrayList<>(); |
| 785 | - if (com.lyms.platform.operate.web.utils.CollectionUtils.isNotEmpty(babyCheckModelsList)) { | |
| 786 | - for (BabyCheckModel babyCheckModel : babyCheckModelsList) { | |
| 787 | - ids.add(babyCheckModel.getId()); | |
| 771 | + if (com.lyms.platform.operate.web.utils.CollectionUtils.isNotEmpty(babykModelsList)) { | |
| 772 | + for (BabyModel babyModel : babykModelsList) { | |
| 773 | + ids.add(babyModel.getId()); | |
| 788 | 774 | } |
| 789 | 775 | } |
| 790 | - criteria.and("_id").in(ids); | |
| 776 | + criteria.and("buildId").in(ids); | |
| 791 | 777 | } |
| 778 | + if (null != checkTime) { | |
| 779 | + try { | |
| 780 | + Date start = (DateUtil.getSNDate(checkTime)[0]); | |
| 781 | + Date end = (DateUtil.getSNDate(checkTime)[1]); | |
| 782 | + criteria.and("checkDate").gte(start).lte(end); | |
| 783 | + } catch (Exception e) { | |
| 784 | + } | |
| 785 | + } | |
| 786 | + if (null != checkTime) { | |
| 787 | + try { | |
| 788 | + Date start = (DateUtil.getSNDate(nextDate)[0]); | |
| 789 | + Date end = (DateUtil.getSNDate(nextDate)[1]); | |
| 790 | + criteria.and("nextDate").gte(start).lte(end); | |
| 791 | + } catch (Exception e) { | |
| 792 | + } | |
| 793 | + } | |
| 794 | + if (StringUtils.isNotEmpty(highRisk)) { | |
| 795 | + criteria.and("highRisk").is(highRisk); | |
| 796 | + } | |
| 797 | + if (StringUtils.isNotEmpty(waskSon)) { | |
| 798 | + criteria.and("waskSon").and(waskSon); | |
| 799 | + } | |
| 792 | 800 | PageResult pageResult = findMongoPage(BabyCheckModel.class, new Query(criteria).with(new Sort(Sort.Direction.DESC, "created")), page, limit); |
| 793 | 801 | List<BabyCheckModel> babyCheckModelList = (List<BabyCheckModel>) pageResult.getGrid(); |
| 794 | - List<Map> list = new ArrayList(); | |
| 802 | + List<Map<String, Object>> list = new ArrayList(); | |
| 795 | 803 | for (BabyCheckModel babyCheckModel : babyCheckModelList) { |
| 796 | 804 | Map<String, Object> map = new HashMap<>(); |
| 797 | 805 | if (StringUtils.isNotEmpty(babyCheckModel.getBuildId())) { |
| 798 | - /*** | |
| 799 | - *儿保列表展示暂未开放 | |
| 800 | - */ | |
| 801 | - | |
| 802 | - | |
| 803 | - | |
| 804 | - | |
| 805 | - | |
| 806 | + BabyModel babyModel = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(babyCheckModel.getBuildId())), BabyModel.class); | |
| 807 | + map.put("babyName", babyModel.getName()); | |
| 808 | + map.put("sex", babyModel.getSex()); | |
| 809 | + map.put("mName", babyModel.getMname()); | |
| 810 | + map.put("mCardNo", babyModel.getCardNo()); | |
| 811 | + map.put("checkMonthAge", DateUtil.getBabyMonthAge(babyModel.getBirth(), babyCheckModel.getCheckDate())); | |
| 806 | 812 | } |
| 813 | + map.put("checkTime", DateUtil.getyyyy_MM_dd(babyCheckModel.getCheckDate())); | |
| 814 | + map.put("nextCheckTime", DateUtil.getyyyy_MM_dd(babyCheckModel.getNextDate())); | |
| 815 | + map.put("highRisk", babyCheckModel.getHighRisk() == 1 ? "高危儿" : "-"); | |
| 816 | + map.put("waskSon", babyCheckModel.getWaskSon() == 1 ? "低弱儿" : "-"); | |
| 817 | + map.put("height", babyCheckModel.getHeight()); | |
| 818 | + map.put("weight", babyCheckModel.getWeight()); | |
| 807 | 819 | list.add(map); |
| 808 | 820 | } |
| 809 | 821 | pageResult.setGrid(list); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/DischargeAbstractFacade.java
View file @
35838cd
| ... | ... | @@ -11,12 +11,14 @@ |
| 11 | 11 | import com.lyms.platform.common.utils.DateUtil; |
| 12 | 12 | import com.lyms.platform.operate.web.request.DischargeAbstractQueryRequest; |
| 13 | 13 | import com.lyms.platform.operate.web.request.DischargeAbstractSaveRequest; |
| 14 | -import com.lyms.platform.operate.web.request.DischargeSummaryRequest; | |
| 15 | 14 | import com.lyms.platform.operate.web.result.*; |
| 16 | 15 | import com.lyms.platform.operate.web.service.impl.BaseServiceImpl; |
| 17 | 16 | import com.lyms.platform.permission.service.CouponService; |
| 18 | 17 | import com.lyms.platform.permission.service.UsersService; |
| 19 | -import com.lyms.platform.pojo.*; | |
| 18 | +import com.lyms.platform.pojo.BabyModel; | |
| 19 | +import com.lyms.platform.pojo.DischargeAbstractBabyModel; | |
| 20 | +import com.lyms.platform.pojo.DischargeAbstractMotherModel; | |
| 21 | +import com.lyms.platform.pojo.Patients; | |
| 20 | 22 | import com.lyms.platform.query.BabyModelQuery; |
| 21 | 23 | import com.lyms.platform.query.DischargeAbstractBabyQuery; |
| 22 | 24 | import com.lyms.platform.query.DischargeAbstractMotherQuery; |
| ... | ... | @@ -396,7 +398,7 @@ |
| 396 | 398 | return new BaseResponse().setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION).setErrorcode(ErrorCodeConstants.SUCCESS); |
| 397 | 399 | } |
| 398 | 400 | |
| 399 | - public BaseResponse list(Integer page, Integer limit, Integer userId, String leaveHospitalDate, Integer postpartumDays, String fmDate, String queryNo) { | |
| 401 | + public BaseResponse list(Integer page, Integer limit, Integer userId, String leaveHospitalDate, Integer postpartumDays, Integer endPostpartumDays, String fmDate, String queryNo) { | |
| 400 | 402 | List<String> hospital = groupsFacade.findGroupHospital(userId, false); |
| 401 | 403 | Criteria criteria = Criteria.where("yn").ne("0").and("hospitalId").in(hospital); |
| 402 | 404 | Criteria pCriteria = Criteria.where("yn").ne("0").and("hospitalId").in(hospital); |
| ... | ... | @@ -407,9 +409,15 @@ |
| 407 | 409 | , Criteria.where("vcCardNo").is(queryNo)); |
| 408 | 410 | flag = true; |
| 409 | 411 | } |
| 410 | - if (StringUtils.isNotEmpty(fmDate) && StringUtils.isNotEmpty(fmDate)) { | |
| 411 | - | |
| 412 | - | |
| 412 | + if (StringUtils.isNotEmpty(fmDate)) { | |
| 413 | + try { | |
| 414 | + Date start = DateUtil.getSNDate(fmDate)[0]; | |
| 415 | + Date end = DateUtil.getSNDate(fmDate)[1]; | |
| 416 | + pCriteria.and("fmDate").gte(start).lte(end); | |
| 417 | + } catch (Exception e) { | |
| 418 | + // 什么都不做,这里是数据传入错误了 | |
| 419 | + } | |
| 420 | + flag = true; | |
| 413 | 421 | } |
| 414 | 422 | if (flag) { |
| 415 | 423 | List<Patients> patients = mongoTemplate.find(Query.query(pCriteria), Patients.class); |
| ... | ... | @@ -419,7 +427,18 @@ |
| 419 | 427 | ids.add(patients1.getId()); |
| 420 | 428 | } |
| 421 | 429 | } |
| 422 | - criteria.and("_id").in(ids); | |
| 430 | + criteria.and("patientId").in(ids); | |
| 431 | + } | |
| 432 | + if (null != postpartumDays && null != endPostpartumDays) { | |
| 433 | + criteria.and("afterMakeBabyDays").gte(postpartumDays).lte(endPostpartumDays); | |
| 434 | + } | |
| 435 | + if (null != leaveHospitalDate) { | |
| 436 | + try { | |
| 437 | + Date startLeave = (DateUtil.getSNDate(leaveHospitalDate)[0]); | |
| 438 | + Date endLeave = (DateUtil.getSNDate(leaveHospitalDate)[1]); | |
| 439 | + criteria.and("leaveHospitalDate").gte(startLeave).lte(endLeave); | |
| 440 | + } catch (Exception e) { | |
| 441 | + } | |
| 423 | 442 | } |
| 424 | 443 | PageResult pageResult = findMongoPage(DischargeAbstractMotherModel.class, new Query(criteria).with(new Sort(Sort.Direction.DESC, "createDate")), page, limit); |
| 425 | 444 | List<DischargeAbstractMotherModel> discharge = (List<DischargeAbstractMotherModel>) pageResult.getGrid(); |