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 6e4abf45..8101a1f 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 @@ -729,7 +729,15 @@ 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); /** 设置姓名、居住地、户籍地、电话 */ + if(StringUtils.isNotEmpty(coupon)) { + List list = CollectionUtils.asList(coupon, String.class); + if(list.contains(7) || list.contains(8)) { + setUserSendInfoByBaby(userId, map); + } else { + setUserSendInfo(userId, map); /** 设置姓名、居住地、户籍地、电话 */ + } + } + } } PageResult pageResult = new PageResult(count, (Integer) param.get("currentPage") ,(Integer) param.get("pageSize"), CollectionUtils.createMap("userSendInfos", userSendInfo)); @@ -740,6 +748,23 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService return RespBuilder.buildSuccess(); } + private void setUserSendInfoByBaby(String userId, Map map) { + BabyModel babyModel = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(userId)), BabyModel.class); + if(babyModel != null) { + Patients patients = mongoTemplate.findById(babyModel.getParentId(), Patients.class); + map.put("username", babyModel.getName()); + if(patients != null) { + map.put("phone", patients.getPhone()); + + String residenceAddress = findName(patients.getProvinceRegisterId()) + findName(patients.getCityRegisterId()) + findName(patients.getAreaRegisterId()); + map.put("residenceAddress", residenceAddress.replace("null", "")); /** 居住地 */ + + String householdAddress = findName(patients.getProvinceId()) + findName(patients.getCityId()) + findName(patients.getAreaId()) + findName(patients.getStreetId()) + findName(patients.getAddress()); + map.put("householdAddress", householdAddress.replace("null", "")); /** 户籍地 */ + } + } + } + private void setUserSendInfo(String userId, Map map) { Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(userId)), Patients.class); if(patients != null) {