Commit ddd2798e241277fb5511fdf5d364a5980254b446

Authored by litao
1 parent b0be340a90

报表数据完善

Showing 1 changed file with 26 additions and 1 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ ddd2798
... ... @@ -729,7 +729,15 @@
729 729 for (Map<String, Object> map : userSendInfo) {
730 730 String userId = (String) map.get("user_id");
731 731 if(StringUtils.isNotEmpty(userId)) {
732   - setUserSendInfo(userId, map); /** 设置姓名、居住地、户籍地、电话 */
  732 + if(StringUtils.isNotEmpty(coupon)) {
  733 + List<String> list = CollectionUtils.asList(coupon, String.class);
  734 + if(list.contains(7) || list.contains(8)) {
  735 + setUserSendInfoByBaby(userId, map);
  736 + } else {
  737 + setUserSendInfo(userId, map); /** 设置姓名、居住地、户籍地、电话 */
  738 + }
  739 + }
  740 +
733 741 }
734 742 }
735 743 PageResult pageResult = new PageResult(count, (Integer) param.get("currentPage") ,(Integer) param.get("pageSize"), CollectionUtils.createMap("userSendInfos", userSendInfo));
... ... @@ -738,6 +746,23 @@
738 746  
739 747 }
740 748 return RespBuilder.buildSuccess();
  749 + }
  750 +
  751 + private void setUserSendInfoByBaby(String userId, Map<String, Object> map) {
  752 + BabyModel babyModel = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(userId)), BabyModel.class);
  753 + if(babyModel != null) {
  754 + Patients patients = mongoTemplate.findById(babyModel.getParentId(), Patients.class);
  755 + map.put("username", babyModel.getName());
  756 + if(patients != null) {
  757 + map.put("phone", patients.getPhone());
  758 +
  759 + String residenceAddress = findName(patients.getProvinceRegisterId()) + findName(patients.getCityRegisterId()) + findName(patients.getAreaRegisterId());
  760 + map.put("residenceAddress", residenceAddress.replace("null", "")); /** 居住地 */
  761 +
  762 + String householdAddress = findName(patients.getProvinceId()) + findName(patients.getCityId()) + findName(patients.getAreaId()) + findName(patients.getStreetId()) + findName(patients.getAddress());
  763 + map.put("householdAddress", householdAddress.replace("null", "")); /** 户籍地 */
  764 + }
  765 + }
741 766 }
742 767  
743 768 private void setUserSendInfo(String userId, Map<String, Object> map) {