Commit 2ce65746cc94f808323840bede6472a5bdef42dc
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 2 changed files
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodPressureServiceImpl.java
View file @
2ce6574
| ... | ... | @@ -133,8 +133,8 @@ |
| 133 | 133 | BloodPressure bloodPressure = mongoTemplate.findById(id, BloodPressure.class); |
| 134 | 134 | List<Map<String, Object>> xyInfos = new ArrayList<>(); |
| 135 | 135 | List<Map<String, List<Object>>> lines = new ArrayList<>(); |
| 136 | - List<Integer> szyMin = Arrays.asList( 60, 60, 60, 60, 60, 60); | |
| 137 | - List<Integer> ssyMax = Arrays.asList(140, 140, 140, 140, 140, 140); | |
| 136 | + List<Integer> szyMin = Arrays.asList( 60, 60, 60, 60, 60, 60, 60); | |
| 137 | + List<Integer> ssyMax = Arrays.asList(140, 140, 140, 140, 140, 140, 140); | |
| 138 | 138 | List<Object> ssy = new ArrayList<>(); |
| 139 | 139 | List<Object> szy = new ArrayList<>(); |
| 140 | 140 | List<Integer> pulse = new ArrayList<>(); |
| ... | ... | @@ -157,7 +157,7 @@ |
| 157 | 157 | } |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - return RespBuilder.buildSuccess("xyInfos", xyInfos, "szyMin", szyMin, "ssyMax", ssyMax, "ssy", ssy, "szy", szy, pulse); | |
| 160 | + return RespBuilder.buildSuccess("xyInfos", xyInfos, "szyMin", szyMin, "ssyMax", ssyMax, "ssy", ssy, "szy", szy, "pulse", pulse); | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | private String getPulseStatus(String ssy, String szy) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
2ce6574
| ... | ... | @@ -220,7 +220,6 @@ |
| 220 | 220 | bar.add((Integer) mappedResult.get("count")); |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | - // 拼装tab数据 | |
| 224 | 223 | titleList.add("医院名称"); |
| 225 | 224 | titleList.add("统计指标(人)"); |
| 226 | 225 | for (Map<String, Date> map : range) { |
| ... | ... | @@ -364,7 +363,7 @@ |
| 364 | 363 | for (Integer num : bar) { |
| 365 | 364 | line.add(MathUtil.getProportion(num, count)); |
| 366 | 365 | } |
| 367 | - } else if(statistType == 2) { | |
| 366 | + }/* else if(statistType == 2) { | |
| 368 | 367 | Date start = null; |
| 369 | 368 | Date end = null; |
| 370 | 369 | Date beforeStart = null; |
| 371 | 370 | |
| ... | ... | @@ -395,14 +394,34 @@ |
| 395 | 394 | beforeEnd = DateUtil.getYear(startDate, -1, 0); |
| 396 | 395 | break; |
| 397 | 396 | } |
| 398 | - List<Map<String, Object>> hospitalInfos = mongoUtil.getHospitals(userId, provinceId, cityId, aredId, streetId); | |
| 399 | - List<String> hospitalIds = CollectionUtils.getListByKey(hospitalInfos, "id"); | |
| 400 | - Criteria c = new Criteria(); | |
| 401 | - c.and("hospitalId").in(hospitalIds).and("yn").ne(0).and("enable").ne("2").and("buildType").ne(1); | |
| 402 | - if(startDate != null && endDate != null) { | |
| 403 | - c.and("bookbuildingDate").gte(startDate).lt(DateUtil.addDay(endDate, 1)); | |
| 397 | + if(start != null && end != null && beforeStart != null && beforeEnd != null) { | |
| 398 | + List<Map<String, Object>> hospitalInfos = mongoUtil.getHospitals(userId, provinceId, cityId, aredId, streetId); | |
| 399 | + List<String> hospitalIds = CollectionUtils.getListByKey(hospitalInfos, "id"); | |
| 400 | + Criteria c = new Criteria(); | |
| 401 | + c.and("hospitalId").in(hospitalIds).and("yn").ne(0).and("enable").ne("2").and("buildType").ne(1); | |
| 402 | + if(startDate != null && endDate != null) { | |
| 403 | + c.and("bookbuildingDate").gte(start).lt(DateUtil.addDay(end, 1)); | |
| 404 | + } | |
| 405 | + | |
| 406 | + | |
| 407 | + Integer nowCount = 0; | |
| 408 | + Integer beforeCount = 0; | |
| 409 | + GroupOperation groupOperation = Aggregation.group("hospitalId").count().as("count"); | |
| 410 | + Aggregation agg = Aggregation.newAggregation(Patients.class, Aggregation.match(c), groupOperation); | |
| 411 | + AggregationResults<Map> results = mongoTemplate.aggregate(agg, Patients.class, Map.class); | |
| 412 | + List<Map> mappedResults = results.getMappedResults(); | |
| 413 | + for (Map mappedResult : mappedResults) { | |
| 414 | + xDatas.add(couponMapper.findHospitalNameById((String) mappedResult.get("_id"))); | |
| 415 | + bar.add((Integer) mappedResult.get("count")); | |
| 416 | + } | |
| 417 | + | |
| 418 | +// titleList.add("医院名称"); | |
| 419 | +// titleList.add("统计指标(人)"); | |
| 420 | +// for (Map<String, Date> map : range) { | |
| 421 | +// titleList.add(DateUtil.getyyyy_mm(map.get("cname"))); | |
| 422 | +// } | |
| 404 | 423 | } |
| 405 | - } | |
| 424 | + }*/ | |
| 406 | 425 | lineMap.put("data", line); |
| 407 | 426 | lineMap.put("type", "line"); |
| 408 | 427 | lineMap.put("name", "建档总数"); |