Commit 949378003137be535780188dff0de454ee61a4d3
1 parent
5e23c6e568
Exists in
master
and in
6 other branches
修复bug
Showing 1 changed file with 16 additions and 4 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyAfterVisitServiceImpl.java
View file @
9493780
| ... | ... | @@ -154,16 +154,18 @@ |
| 154 | 154 | public BaseResponse syncInitStatistics(String babyId, String startTime, String endTime, String hospitalId) throws ExecutionException, InterruptedException { |
| 155 | 155 | BaseResponse response = new BaseResponse(); |
| 156 | 156 | BabyAfterVisitRequest afterVisitQuery = new BabyAfterVisitRequest(); |
| 157 | - afterVisitQuery.setLimit(500); | |
| 157 | + afterVisitQuery.setLimit(7000); | |
| 158 | 158 | Date startDate = DateUtil.parseYMD(startTime); |
| 159 | 159 | Date endDate = DateUtil.parseYMD(endTime); |
| 160 | 160 | |
| 161 | - Map<String, Integer> map = new HashMap<>(16); | |
| 161 | + Map<String, Integer> map = new HashMap<>(); | |
| 162 | 162 | |
| 163 | 163 | // 访视概况 |
| 164 | 164 | Integer statisticsModelsSize = getStatisticsModelsSize(babyId, afterVisitQuery, startDate, endDate, hospitalId); |
| 165 | 165 | map.put("statisticsModelsSize", statisticsModelsSize); |
| 166 | 166 | |
| 167 | + | |
| 168 | + | |
| 167 | 169 | // 档案转正 |
| 168 | 170 | List<BabyAfterVisitInfoModel> infoModels = new ArrayList<>(); |
| 169 | 171 | setSyncAfterVisitInfoList(null, infoModels, afterVisitQuery, TYPE_BUILD, startDate, endDate, hospitalId); |
| ... | ... | @@ -176,7 +178,7 @@ |
| 176 | 178 | |
| 177 | 179 | Query query = new Query(); |
| 178 | 180 | query.addCriteria(Criteria.where("created").gte(startDate).lt(endDate)); |
| 179 | - query.addCriteria(Criteria.where("yn").ne(0).and("dataStatus").ne(1)); | |
| 181 | + query.addCriteria(Criteria.where("yn").is(1)); | |
| 180 | 182 | query.addCriteria(Criteria.where("nextDate").exists(false).and("weakSon").exists(false).and("highRisk").exists(false)); |
| 181 | 183 | List<BabyModel> babyModels = mongoTemplate.find(query, BabyModel.class); |
| 182 | 184 | for (BabyModel model : babyModels) { |
| ... | ... | @@ -204,6 +206,11 @@ |
| 204 | 206 | } |
| 205 | 207 | } |
| 206 | 208 | } |
| 209 | + | |
| 210 | + List<BabyModel> models = mongoTemplate.find(Query.query(Criteria.where("_id").nin(ids).and("hospitalId").is(hospitalId).and("yn").is(1)), BabyModel.class); | |
| 211 | + if (models != null) { | |
| 212 | + ids.add(models.get(0).getId()); | |
| 213 | + } | |
| 207 | 214 | setSyncAfterVisitInfoList(ids, infoCheckModels, afterVisitQuery, TYPE_CHECK, startDate, endDate, hospitalId); |
| 208 | 215 | mongoTemplate.insert(infoCheckModels, BabyAfterVisitInfoModel.class); |
| 209 | 216 | map.put("infoModels-check-size", infoCheckModels.size()); |
| ... | ... | @@ -212,7 +219,7 @@ |
| 212 | 219 | List<BabyAfterVisitInfoModel> infoEyeCheckModels = new ArrayList<>(); |
| 213 | 220 | Query eyeQuery = new Query(); |
| 214 | 221 | eyeQuery.addCriteria(Criteria.where("created").gte(startDate).lt(endDate)); |
| 215 | - eyeQuery.addCriteria(Criteria.where("yn").ne(0).and("dataStatus").ne(1)); | |
| 222 | + eyeQuery.addCriteria(Criteria.where("yn").is(1)); | |
| 216 | 223 | List<BabyModel> eyeBabyModels = mongoTemplate.find(eyeQuery, BabyModel.class); |
| 217 | 224 | List<String> babyIds = new ArrayList<>(); |
| 218 | 225 | for (BabyModel babyModel : eyeBabyModels) { |
| ... | ... | @@ -240,6 +247,11 @@ |
| 240 | 247 | babyIds.add(eyeCheckBabyId); |
| 241 | 248 | } |
| 242 | 249 | } |
| 250 | + } | |
| 251 | + | |
| 252 | + List<BabyModel> modelsEye = mongoTemplate.find(Query.query(Criteria.where("_id").nin(babyIds).and("hospitalId").is(hospitalId).and("yn").is(1)), BabyModel.class); | |
| 253 | + if (models != null) { | |
| 254 | + babyIds.add(modelsEye.get(0).getId()); | |
| 243 | 255 | } |
| 244 | 256 | |
| 245 | 257 | setSyncAfterVisitInfoList(babyIds, infoEyeCheckModels, afterVisitQuery, TYPE_EYE_CHECK, startDate, endDate, hospitalId); |