From 638f942a9c069a006b2d64da71cb73a668b569ae Mon Sep 17 00:00:00 2001 From: shiyang <316555390@qq.com> Date: Tue, 23 Nov 2021 14:33:08 +0800 Subject: [PATCH] update --- .../operate/web/facade/BabyHealthFacade.java | 37 ++++++++++++++++------ 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyHealthFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyHealthFacade.java index 98ff151..1d5adf7 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyHealthFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyHealthFacade.java @@ -167,7 +167,7 @@ public class BabyHealthFacade extends BaseServiceImpl { String areaId,String streetId) { boolean flag = false; // List hospital = groupsFacade.findGroupHospital(userId, false); - int[] monthArr = {0, 3, 4, 8, 12, 18, 24, 30, 36, 48, 60, 72};//月龄 + int[] monthArr = {1, 3, 6, 8, 12, 18, 24, 30, 36, 48, 60, 72};//月龄 String hospitalId = autoMatchFacade.getHospitalId(userId); Criteria criteria = Criteria.where("yn").ne(0).and("hospitalId").is(hospitalId); if(StringUtils.isNotEmpty(provinceId)){ @@ -226,7 +226,7 @@ public class BabyHealthFacade extends BaseServiceImpl { row.put("feedType", feedType); for (int i = 0; i < monthArr.length; i++) { Map mapAge = new HashMap<>(); - if (monthArr[i] == babyCheckModel.getCheckMonth().intValue()) { + if (monthArr[i] == babyCheckModel.getTcType()) { mapAge.put("height", babyCheckModel.getHeight()); mapAge.put("heightEvaluate", babyCheckModel.getHeightEvaluate()); mapAge.put("weight", babyCheckModel.getWeight()); @@ -1066,21 +1066,40 @@ public class BabyHealthFacade extends BaseServiceImpl { } - public BaseResponse babystatListPrint(String checkTime, String queryNo, Integer startCheckMonthAge, Integer endCheckMonthAge, String nextDate, Integer highRisk, Integer waskSon, String checkDoctorId, Integer page, Integer limit, Integer userId, String level) { + public BaseResponse babystatListPrint(String checkTime, String queryNo, Integer startCheckMonthAge, + Integer endCheckMonthAge, String nextDate, Integer highRisk, + Integer waskSon, String checkDoctorId, Integer page, Integer limit, + Integer userId, String level,Date queryStartBirth, + Date queryEndtBirth,String provinceId,String cityId, + String areaId,String streetId) { boolean flag = false; // List hospital = groupsFacade.findGroupHospital(userId, false); - final int[] monthArr = {0, 3, 4, 8, 12, 18, 24, 30, 36, 48, 60, 72};//月龄 + final int[] monthArr = {1, 3, 6, 8, 12, 18, 24, 30, 36, 48, 60, 72};//月龄 String hospitalId = autoMatchFacade.getHospitalId(userId); Criteria criteria = Criteria.where("yn").ne(0).and("hospitalId").is(hospitalId); - Criteria pCriteria = Criteria.where("yn").ne(0).and("hospitalId").is(hospitalId); + if(StringUtils.isNotEmpty(provinceId)){ + criteria.and("provinceId").is(provinceId); + } + if(StringUtils.isNotEmpty(cityId)){ + criteria.and("cityId").is(cityId); + } + if(StringUtils.isNotEmpty(areaId)){ + criteria.and("areaId").is(areaId); + } + if(StringUtils.isNotEmpty(streetId)){ + criteria.and("streetId").is(streetId); + } + if(null!=queryStartBirth&&null!=queryEndtBirth){ + criteria.and("birth").gte(queryStartBirth).lte(queryEndtBirth); + } if (org.apache.commons.lang.StringUtils.isNotBlank(queryNo)) { - pCriteria.orOperator(Criteria.where("mcertNo").regex(queryNo), Criteria.where("name").regex(queryNo), + criteria.orOperator(Criteria.where("mcertNo").regex(queryNo), Criteria.where("name").regex(queryNo), Criteria.where("fphone").regex(queryNo), Criteria.where("vcCardNo").regex(queryNo), Criteria.where("mname").regex(queryNo)); flag = true; } limit=100; - PageResult pageResult = findMongoPage(BabyModel.class, new Query(pCriteria).with(new Sort(Sort.Direction.DESC, "created")), page, limit); + PageResult pageResult = findMongoPage(BabyModel.class, new Query(criteria).with(new Sort(Sort.Direction.DESC, "created")), page, limit); int lastPage=pageResult.getLastPage(); @@ -1088,7 +1107,7 @@ public class BabyHealthFacade extends BaseServiceImpl { for ( page = 0; page < lastPage; page++) { long ptime=System.currentTimeMillis(); - pageResult = findMongoPage(BabyModel.class, new Query(pCriteria).with(new Sort(Sort.Direction.DESC, "created")), page, limit); + pageResult = findMongoPage(BabyModel.class, new Query(criteria).with(new Sort(Sort.Direction.DESC, "created")), page, limit); List babykModelsList = (List) pageResult.getGrid(); @@ -1129,7 +1148,7 @@ public class BabyHealthFacade extends BaseServiceImpl { row.put("feedType", feedType); for (int i = 0; i < monthArr.length; i++) { Map mapAge = new HashMap<>(); - if (monthArr[i] == babyCheckModel.getCheckMonth().intValue()) { + if (monthArr[i] == babyCheckModel.getTcType()) { mapAge.put("height", babyCheckModel.getHeight()); mapAge.put("heightEvaluate", babyCheckModel.getHeightEvaluate()); mapAge.put("weight", babyCheckModel.getWeight()); -- 1.8.3.1