Commit 00a625dfe1566937eb39ea42372b65c9fe0ccf67

Authored by litao@lymsh.com
1 parent 22db66f301
Exists in master and in 1 other branch dev

统计

Showing 1 changed file with 13 additions and 11 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ 00a625d
... ... @@ -594,18 +594,20 @@
594 594 if(CollectionUtils.isNotEmpty(hospitalIds)) {
595 595 List<Map<String, Object>> datas = couponMapper.findHospitalInfoByIds(hospitalIds);
596 596 List<Patients> patients = getPatients(hospitalIds, datas, startDate, endDate, provinceId, cityId, areaId, true);
597   - Set<String> userIds = new HashSet<>();
598   - for (Patients patient : patients) {
599   - userIds.add(patient.getPid());
  597 + if(CollectionUtils.isNotEmpty(patients)) {
  598 + Set<String> userIds = new HashSet<>();
  599 + for (Patients patient : patients) {
  600 + userIds.add(patient.getPid());
  601 + }
  602 + Map<String, Object> param = CollectionUtils.createMap("hospitalIds", hospitalIds, "userIds", userIds, "provinceId", provinceId, "cityId", cityId, "areaId", areaId, "page", (page - 1) * limit, "limit", limit);
  603 + List<Map<String, Object>> restList = couponMapper.findUnUsed(param);
  604 + for (Map<String, Object> map : restList) {
  605 + map.put("cityName", findName(map.get("city_id")));
  606 + map.put("areaName", findName(map.get("area_id")));
  607 + }
  608 + Integer count = couponMapper.findUnUsedCount(param);
  609 + return RespBuilder.buildSuccess(new PageResult(count, page, limit, restList));
600 610 }
601   - Map<String, Object> param = CollectionUtils.createMap("hospitalIds", hospitalIds, "userIds", userIds, "provinceId", provinceId, "cityId", cityId, "areaId", areaId, "page", (page - 1) * limit, "limit", limit);
602   - List<Map<String, Object>> restList = couponMapper.findUnUsed(param);
603   - for (Map<String, Object> map : restList) {
604   - map.put("cityName", findName(map.get("city_id")));
605   - map.put("areaName", findName(map.get("area_id")));
606   - }
607   - Integer count = couponMapper.findUnUsedCount(param);
608   - return RespBuilder.buildSuccess(new PageResult(count, page, limit, restList));
609 611 }
610 612 return RespBuilder.buildSuccess(new PageResult(0, page, limit, null));
611 613 }