From 00a625dfe1566937eb39ea42372b65c9fe0ccf67 Mon Sep 17 00:00:00 2001 From: "litao@lymsh.com" Date: Mon, 30 Oct 2017 20:27:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/service/impl/ReportServiceImpl.java | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java index 1378587..769204c 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java @@ -594,18 +594,20 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService if(CollectionUtils.isNotEmpty(hospitalIds)) { List> datas = couponMapper.findHospitalInfoByIds(hospitalIds); List patients = getPatients(hospitalIds, datas, startDate, endDate, provinceId, cityId, areaId, true); - Set userIds = new HashSet<>(); - for (Patients patient : patients) { - userIds.add(patient.getPid()); - } - Map param = CollectionUtils.createMap("hospitalIds", hospitalIds, "userIds", userIds, "provinceId", provinceId, "cityId", cityId, "areaId", areaId, "page", (page - 1) * limit, "limit", limit); - List> restList = couponMapper.findUnUsed(param); - for (Map map : restList) { - map.put("cityName", findName(map.get("city_id"))); - map.put("areaName", findName(map.get("area_id"))); + if(CollectionUtils.isNotEmpty(patients)) { + Set userIds = new HashSet<>(); + for (Patients patient : patients) { + userIds.add(patient.getPid()); + } + Map param = CollectionUtils.createMap("hospitalIds", hospitalIds, "userIds", userIds, "provinceId", provinceId, "cityId", cityId, "areaId", areaId, "page", (page - 1) * limit, "limit", limit); + List> restList = couponMapper.findUnUsed(param); + for (Map map : restList) { + map.put("cityName", findName(map.get("city_id"))); + map.put("areaName", findName(map.get("area_id"))); + } + Integer count = couponMapper.findUnUsedCount(param); + return RespBuilder.buildSuccess(new PageResult(count, page, limit, restList)); } - Integer count = couponMapper.findUnUsedCount(param); - return RespBuilder.buildSuccess(new PageResult(count, page, limit, restList)); } return RespBuilder.buildSuccess(new PageResult(0, page, limit, null)); } -- 1.8.3.1