Commit e9a4e90289414d59d3b162883a03b6605a9a50b0
1 parent
585671f6ba
Exists in
master
and in
6 other branches
添加儿童统计-打印,数据量大,优化
Showing 1 changed file with 52 additions and 45 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyHealthFacade.java
View file @
e9a4e90
| ... | ... | @@ -999,7 +999,7 @@ |
| 999 | 999 | 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) { |
| 1000 | 1000 | boolean flag = false; |
| 1001 | 1001 | // List<String> hospital = groupsFacade.findGroupHospital(userId, false); |
| 1002 | - int[] monthArr = {0, 3, 4, 8, 12, 18, 24, 30, 36, 48, 60, 72};//月龄 | |
| 1002 | + final int[] monthArr = {0, 3, 4, 8, 12, 18, 24, 30, 36, 48, 60, 72};//月龄 | |
| 1003 | 1003 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 1004 | 1004 | Criteria criteria = Criteria.where("yn").ne(0).and("hospitalId").is(hospitalId); |
| 1005 | 1005 | Criteria pCriteria = Criteria.where("yn").ne(0).and("hospitalId").is(hospitalId); |
| ... | ... | @@ -1025,8 +1025,8 @@ |
| 1025 | 1025 | List<Future> listFuture = new ArrayList<>(); |
| 1026 | 1026 | |
| 1027 | 1027 | if (com.lyms.platform.operate.web.utils.CollectionUtils.isNotEmpty(babykModelsList)) { |
| 1028 | - for (BabyModel babyModel : babykModelsList) { | |
| 1029 | - Map<String, Object> row = new HashMap<>(); | |
| 1028 | + for (final BabyModel babyModel : babykModelsList) { | |
| 1029 | + final Map<String, Object> row = new HashMap<>(); | |
| 1030 | 1030 | Map<String, Object> babyMap = new HashMap<>(); |
| 1031 | 1031 | babyMap.put("babyName", babyModel.getName()); |
| 1032 | 1032 | babyMap.put("sex", SexEnum.getTextById(babyModel.getSex())); |
| 1033 | 1033 | |
| 1034 | 1034 | |
| 1035 | 1035 | |
| 1036 | 1036 | |
| 1037 | 1037 | |
| ... | ... | @@ -1036,54 +1036,61 @@ |
| 1036 | 1036 | babyMap.put("mphone", babyModel.getMphone()); |
| 1037 | 1037 | row.put("baby", babyMap); |
| 1038 | 1038 | // ids.add(babyModel.getId()); |
| 1039 | - Criteria criteriaCheck = Criteria.where("buildId").in(babyModel.getId()); | |
| 1039 | + | |
| 1040 | 1040 | // pageResult = findMongoPage(BabyCheckModel.class, new Query(criteriaCheck).with(new Sort(Sort.Direction.DESC, "created")), page, limit); |
| 1041 | - List<BabyCheckModel> babyCheckModelList = mongoTemplate.find(new Query(criteriaCheck).with(new Sort(Sort.Direction.DESC, "created")), BabyCheckModel.class); | |
| 1042 | 1041 | |
| 1043 | -// List <BabyCheckModel> babyCheckModelList = (List <BabyCheckModel>) pageResult.getGrid(); | |
| 1042 | + listFuture.add(commonThreadPool.submit(new Callable() { | |
| 1043 | + @Override | |
| 1044 | + public Object call() throws Exception { | |
| 1045 | + Criteria criteriaCheck = Criteria.where("buildId").in(babyModel.getId()); | |
| 1046 | + List<BabyCheckModel> babyCheckModelList = mongoTemplate.find(new Query(criteriaCheck).with(new Sort(Sort.Direction.DESC, "created")), BabyCheckModel.class); | |
| 1044 | 1047 | |
| 1045 | - List<Map<String, Object>> listAge = new ArrayList<>(); | |
| 1046 | - for (BabyCheckModel babyCheckModel : babyCheckModelList) { | |
| 1047 | - long pctime=System.currentTimeMillis(); | |
| 1048 | - Map<String, Object> map = new HashMap<>(); | |
| 1049 | - String feedType = ""; | |
| 1050 | - String feedTypeId = babyCheckModel.getFeedType(); | |
| 1051 | - if (StringUtils.isNotEmpty(feedTypeId)) { | |
| 1052 | - feedType = WyTypeEnums.getNameById(Integer.parseInt(feedTypeId)); | |
| 1053 | - } | |
| 1054 | - row.put("feedType", feedType); | |
| 1055 | - for (int i = 0; i < monthArr.length; i++) { | |
| 1056 | - Map<String, Object> mapAge = new HashMap<>(); | |
| 1057 | - if (monthArr[i] == babyCheckModel.getCheckMonth().intValue()) { | |
| 1058 | - mapAge.put("height", babyCheckModel.getHeight()); | |
| 1059 | - mapAge.put("heightEvaluate", babyCheckModel.getHeightEvaluate()); | |
| 1060 | - mapAge.put("weight", babyCheckModel.getWeight()); | |
| 1061 | - mapAge.put("weightEvaluate", babyCheckModel.getWeightEvaluate()); | |
| 1062 | - mapAge.put("hemoglobin", babyCheckModel.getHemoglobin()); | |
| 1063 | - mapAge.put("wh", babyCheckModel.getWeight()+"/"+babyCheckModel.getHeight()); | |
| 1064 | - mapAge.put("whEva", ifnull(babyCheckModel.getWeightEvaluate())+"/"+ifnull(babyCheckModel.getHeightEvaluate())); | |
| 1065 | - } else { | |
| 1066 | - mapAge.put("height", ""); | |
| 1067 | - mapAge.put("heightEvaluate", ""); | |
| 1068 | - mapAge.put("weight", ""); | |
| 1069 | - mapAge.put("weightEvaluate", ""); | |
| 1070 | - mapAge.put("hemoglobin", ""); | |
| 1071 | - mapAge.put("wh", ""); | |
| 1072 | - mapAge.put("whEva", ""); | |
| 1073 | - } | |
| 1074 | - mapAge.put("age", monthArr[i]); | |
| 1075 | - listAge.add(mapAge); | |
| 1076 | - } | |
| 1048 | + List<Map<String, Object>> listAge = new ArrayList<>(); | |
| 1049 | + for (BabyCheckModel babyCheckModel : babyCheckModelList) { | |
| 1050 | + long pctime=System.currentTimeMillis(); | |
| 1051 | + Map<String, Object> map = new HashMap<>(); | |
| 1052 | + String feedType = ""; | |
| 1053 | + String feedTypeId = babyCheckModel.getFeedType(); | |
| 1054 | + if (StringUtils.isNotEmpty(feedTypeId)) { | |
| 1055 | + feedType = WyTypeEnums.getNameById(Integer.parseInt(feedTypeId)); | |
| 1056 | + } | |
| 1057 | + row.put("feedType", feedType); | |
| 1058 | + for (int i = 0; i < monthArr.length; i++) { | |
| 1059 | + Map<String, Object> mapAge = new HashMap<>(); | |
| 1060 | + if (monthArr[i] == babyCheckModel.getCheckMonth().intValue()) { | |
| 1061 | + mapAge.put("height", babyCheckModel.getHeight()); | |
| 1062 | + mapAge.put("heightEvaluate", babyCheckModel.getHeightEvaluate()); | |
| 1063 | + mapAge.put("weight", babyCheckModel.getWeight()); | |
| 1064 | + mapAge.put("weightEvaluate", babyCheckModel.getWeightEvaluate()); | |
| 1065 | + mapAge.put("hemoglobin", babyCheckModel.getHemoglobin()); | |
| 1066 | + mapAge.put("wh", babyCheckModel.getWeight()+"/"+babyCheckModel.getHeight()); | |
| 1067 | + mapAge.put("whEva", ifnull(babyCheckModel.getWeightEvaluate())+"/"+ifnull(babyCheckModel.getHeightEvaluate())); | |
| 1068 | + } else { | |
| 1069 | + mapAge.put("height", ""); | |
| 1070 | + mapAge.put("heightEvaluate", ""); | |
| 1071 | + mapAge.put("weight", ""); | |
| 1072 | + mapAge.put("weightEvaluate", ""); | |
| 1073 | + mapAge.put("hemoglobin", ""); | |
| 1074 | + mapAge.put("wh", ""); | |
| 1075 | + mapAge.put("whEva", ""); | |
| 1076 | + } | |
| 1077 | + mapAge.put("age", monthArr[i]); | |
| 1078 | + listAge.add(mapAge); | |
| 1079 | + } | |
| 1077 | 1080 | |
| 1078 | 1081 | |
| 1079 | - row.put("monthChk", listAge); | |
| 1082 | + row.put("monthChk", listAge); | |
| 1080 | 1083 | |
| 1081 | - row.put("height", babyCheckModel.getHeight()); | |
| 1082 | - row.put("weight", babyCheckModel.getWeight()); | |
| 1083 | - //秦皇岛需求,查询最后一次检查的高危详情 | |
| 1084 | - row.put("qhdHighRiskInfo", babyCheckModel.getQhdHighRiskInfo()); | |
| 1085 | - System.out.println("pcTime="+(System.currentTimeMillis()-pctime)); | |
| 1086 | - } | |
| 1084 | + row.put("height", babyCheckModel.getHeight()); | |
| 1085 | + row.put("weight", babyCheckModel.getWeight()); | |
| 1086 | + //秦皇岛需求,查询最后一次检查的高危详情 | |
| 1087 | + row.put("qhdHighRiskInfo", babyCheckModel.getQhdHighRiskInfo()); | |
| 1088 | +// System.out.println("pcTime="+(System.currentTimeMillis()-pctime)); | |
| 1089 | + } | |
| 1090 | + return null; | |
| 1091 | + } | |
| 1092 | + })); | |
| 1093 | + | |
| 1087 | 1094 | |
| 1088 | 1095 | // 访视 |
| 1089 | 1096 | List<NewbornVisit> newbornVisits = mongoTemplate.find(Query.query(Criteria.where("babyId").is(babyModel.getId()).and("hospitalId").in(hospitalId).and("yn").ne("0")) |