diff --git a/platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml b/platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml index 5a656ca..d15a349 100644 --- a/platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml +++ b/platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml @@ -425,11 +425,10 @@ select count(1) from ( - select a.user_id, a.create_date, e.name as username, d.name as send_hospital, f.name as doctoer_name + select a.create_hospital_id, a.user_id, a.create_date ,d.name as send_hospital, e.name as doctoer_name from - coupon_info a, coupon_template b, coupon_type c, organization d, users e, users f - where a.coupon_template_id = b.id and b.type_id = c.id - and a.create_hospital_id = d.id and a.user_id = e.id and a.create_user_id = f.id + coupon_info a, coupon_template b, coupon_type c, organization d, users e + where a.coupon_template_id = b.id and b.type_id = c.id and a.create_hospital_id = d.id and a.create_user_id = e.id and a.create_hospital_id in #{hid} 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 f0bb339..e5e3b53 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 @@ -693,6 +693,9 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService if(type == 4) { /** 使用详情统计 */ List> couponInfos = couponMapper.couponInfo(param); + String subTitle = null; + Set subTitleTempSet = new HashSet<>(); + if(CollectionUtils.isNotEmpty(couponInfos)) { for (Map couponInfo : couponInfos) { String desc = (String) couponReportMap.get(couponInfo.get("type") + "_" + couponInfo.get("coupon_order")); @@ -702,6 +705,13 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService .replace("
", "") .replace("
", "") .replace("
", ""); + if(subTitleTempSet.add(s)) { + if(StringUtils.isEmpty(subTitle)) { + subTitle = s; + } else { + subTitle += "/" + s; + } + } couponInfo.put("type_desc", s); } Date useDate = (Date) couponInfo.get("use_date"); @@ -713,7 +723,7 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService } } int count = couponMapper.findCouponInfoCount(param); - PageResult pageResult = new PageResult(count, (Integer) param.get("currentPage") ,(Integer) param.get("pageSize"), CollectionUtils.createMap("couponInfos", couponInfos)); + PageResult pageResult = new PageResult(count, (Integer) param.get("currentPage") ,(Integer) param.get("pageSize"), CollectionUtils.createMap("couponInfos", couponInfos, "subTitle", subTitle)); return RespBuilder.buildSuccess(pageResult); } if(type == 1) { /** 发放人数统计 */ List> userSendInfo = couponMapper.findUserSendInfo(param); @@ -721,7 +731,7 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService for (Map map : userSendInfo) { String userId = (String) map.get("user_id"); if(StringUtils.isNotEmpty(userId)) { - setUserSendInfo(userId, map); /** 设置居住地、户籍地、电话 */ + setUserSendInfo(userId, map); /** 设置姓名、居住地、户籍地、电话 */ } map.put("create_date", DateUtil.getyyyy_MM_dd((Date) map.get("create_date"))); } @@ -733,11 +743,11 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService return RespBuilder.buildSuccess(); } - private void setUserSendInfo(String userId, Map map) { Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(userId)), Patients.class); if(patients != null) { map.put("phone", patients.getPhone()); + map.put("username", patients.getUsername()); String residenceAddress = findName(patients.getProvinceRegisterId()) + findName(patients.getCityRegisterId()) + findName(patients.getAreaRegisterId()); map.put("residenceAddress", residenceAddress.replace("null", "")); /** 居住地 */ @@ -772,12 +782,6 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService checkDate = patients.getCreated(); username = patients.getUsername(); week = DateUtil.getWeekDesc(patients.getLastMenses(), checkDate); - /* List patientsList = mongoTemplate.find(Query.query(Criteria.where("pid").is(patients.getPid())).with(new Sort(Sort.Direction.ASC, "created")), Patients.class); - for(int i = 0; i < patientsList.size(); i++) { - if(patientsList.get(i).getId().equals(patients.getId())) { -// number = ++i; - } - }*/ operatorOrgName = couponMapper.findHospitalNameById(patients.getHospitalId()); phone = patients.getPhone(); } @@ -797,6 +801,11 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService username = findUserNameByPid(antenatal.getPid()); week = antenatal.getCurrentDueDate(); List antExChuModels = mongoTemplate.find(Query.query(Criteria.where("pid").is(antenatal.getPid())).with(new Sort(Sort.Direction.ASC, "created")), AntenatalExaminationModel.class); + List antexcs = mongoTemplate.find(Query.query(Criteria.where("pid").is(antenatal.getPid())), AntExChuModel.class); + if(CollectionUtils.isNotEmpty(antexcs)) { + + } + if(CollectionUtils.isNotEmpty(antExChuModels)) { for(int i = 0; i < antExChuModels.size(); i++) { if(antExChuModels.get(i).getId().equals(antenatal.getId())) { diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/CollectionUtils.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/CollectionUtils.java index 99e347f..54ad190 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/CollectionUtils.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/CollectionUtils.java @@ -141,4 +141,13 @@ public class CollectionUtils extends org.apache.commons.collections.CollectionUt } + public static boolean isNotEmpty(Collection ... collections) { + Assert.notNull(collections, "collections must not be null!"); + for (Collection collection : collections) { + if(isEmpty(collection)) { + return false; + } + } + return true; + } }