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 4fdfb3c..dcd3df7 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 @@ -1610,12 +1610,16 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService executorService.shutdown(); List usedIds = getNeedUsedIds(patients, antExChuModels, antenatalExaminationModels, maternalDeliverModels, deliverModels, postReviewModels); + + Map hospitalNameCache = new HashMap<>(); + Map doctorNameCacheMap = new HashMap<>(); + Map> hospitalInfoCacheMap = new HashMap<>(); + List> restList = new ArrayList<>(); if(CollectionUtils.isNotEmpty(usedIds)) { List list = couponMapper.findUsededId(usedIds); usedIds.removeAll(list); - Map hospitalNameCache = new HashMap<>(); for (String hid : hids) { boolean flag = false; Set unUsedIds = new HashSet<>(); // 未使用优惠券patientid @@ -1636,7 +1640,6 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService } else { map.put("week", DateUtil.getWeekDesc(p.getLastMenses(), new Date())); } - Map doctorNameCacheMap = new HashMap<>(); String doctorName = doctorNameCacheMap.get(p.getBookbuildingDoctor()); if(StringUtils.isEmpty(doctorName)) { doctorName = couponMapper.getUserName(p.getBookbuildingDoctor()); @@ -1656,7 +1659,13 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService } if(flag) { - Map hospitalInfo = couponMapper.findHospitalInfoById(hid); + Map hospitalInfo = hospitalInfoCacheMap.get(hid); + if(MapUtils.isEmpty(hospitalInfo)) { + hospitalInfo = couponMapper.findHospitalInfoById(hid); + hospitalInfoCacheMap.put(hid, hospitalInfo); + } + +// Map hospitalInfo = couponMapper.findHospitalInfoById(hid); hospitalInfo.put("cityName", findName(hospitalInfo.get("city_id"))); hospitalInfo.put("areaName", findName(hospitalInfo.get("area_id"))); hospitalInfo.put("un_used_coupons", un_used_coupons);