Commit 528a401c7abaf2d22adecd2c93a189cbdc952dc1
1 parent
f67539b2e5
Exists in
master
and in
6 other branches
加subtitle bug修复
Showing 3 changed files with 33 additions and 17 deletions
platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml
View file @
528a401
| ... | ... | @@ -425,11 +425,10 @@ |
| 425 | 425 | </select> |
| 426 | 426 | |
| 427 | 427 | <select id="findUserSendInfo" parameterType="map" resultType="map"> |
| 428 | - select a.user_id, a.create_date, e.name as username, d.name as send_hospital, f.name as doctoer_name | |
| 428 | + select a.create_hospital_id, a.user_id, a.create_date ,d.name as send_hospital, e.name as doctoer_name | |
| 429 | 429 | from |
| 430 | - coupon_info a, coupon_template b, coupon_type c, organization d, users e, users f | |
| 431 | - where a.coupon_template_id = b.id and b.type_id = c.id | |
| 432 | - and a.create_hospital_id = d.id and a.user_id = e.id and a.create_user_id = f.id | |
| 430 | + coupon_info a, coupon_template b, coupon_type c, organization d, users e | |
| 431 | + 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 | |
| 433 | 432 | and a.create_hospital_id in |
| 434 | 433 | <foreach collection="hospitalId" open="(" close=")" separator="," item="hid"> |
| 435 | 434 | #{hid} |
| 436 | 435 | |
| ... | ... | @@ -449,11 +448,10 @@ |
| 449 | 448 | |
| 450 | 449 | <select id="findUserSendInfoCount" parameterType="map" resultType="integer"> |
| 451 | 450 | select count(1) from ( |
| 452 | - select a.user_id, a.create_date, e.name as username, d.name as send_hospital, f.name as doctoer_name | |
| 451 | + select a.create_hospital_id, a.user_id, a.create_date ,d.name as send_hospital, e.name as doctoer_name | |
| 453 | 452 | from |
| 454 | - coupon_info a, coupon_template b, coupon_type c, organization d, users e, users f | |
| 455 | - where a.coupon_template_id = b.id and b.type_id = c.id | |
| 456 | - and a.create_hospital_id = d.id and a.user_id = e.id and a.create_user_id = f.id | |
| 453 | + coupon_info a, coupon_template b, coupon_type c, organization d, users e | |
| 454 | + 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 | |
| 457 | 455 | and a.create_hospital_id in |
| 458 | 456 | <foreach collection="hospitalId" open="(" close=")" separator="," item="hid"> |
| 459 | 457 | #{hid} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
528a401
| ... | ... | @@ -693,6 +693,9 @@ |
| 693 | 693 | |
| 694 | 694 | if(type == 4) { /** 使用详情统计 */ |
| 695 | 695 | List<Map<String, Object>> couponInfos = couponMapper.couponInfo(param); |
| 696 | + String subTitle = null; | |
| 697 | + Set<String> subTitleTempSet = new HashSet<>(); | |
| 698 | + | |
| 696 | 699 | if(CollectionUtils.isNotEmpty(couponInfos)) { |
| 697 | 700 | for (Map<String, Object> couponInfo : couponInfos) { |
| 698 | 701 | String desc = (String) couponReportMap.get(couponInfo.get("type") + "_" + couponInfo.get("coupon_order")); |
| ... | ... | @@ -702,6 +705,13 @@ |
| 702 | 705 | .replace("<div class='ag-double-line'>", "") |
| 703 | 706 | .replace("<div>", "") |
| 704 | 707 | .replace("</div>", ""); |
| 708 | + if(subTitleTempSet.add(s)) { | |
| 709 | + if(StringUtils.isEmpty(subTitle)) { | |
| 710 | + subTitle = s; | |
| 711 | + } else { | |
| 712 | + subTitle += "/" + s; | |
| 713 | + } | |
| 714 | + } | |
| 705 | 715 | couponInfo.put("type_desc", s); |
| 706 | 716 | } |
| 707 | 717 | Date useDate = (Date) couponInfo.get("use_date"); |
| ... | ... | @@ -713,7 +723,7 @@ |
| 713 | 723 | } |
| 714 | 724 | } |
| 715 | 725 | int count = couponMapper.findCouponInfoCount(param); |
| 716 | - PageResult pageResult = new PageResult(count, (Integer) param.get("currentPage") ,(Integer) param.get("pageSize"), CollectionUtils.createMap("couponInfos", couponInfos)); | |
| 726 | + PageResult pageResult = new PageResult(count, (Integer) param.get("currentPage") ,(Integer) param.get("pageSize"), CollectionUtils.createMap("couponInfos", couponInfos, "subTitle", subTitle)); | |
| 717 | 727 | return RespBuilder.buildSuccess(pageResult); |
| 718 | 728 | } if(type == 1) { /** 发放人数统计 */ |
| 719 | 729 | List<Map<String,Object>> userSendInfo = couponMapper.findUserSendInfo(param); |
| ... | ... | @@ -721,7 +731,7 @@ |
| 721 | 731 | for (Map<String, Object> map : userSendInfo) { |
| 722 | 732 | String userId = (String) map.get("user_id"); |
| 723 | 733 | if(StringUtils.isNotEmpty(userId)) { |
| 724 | - setUserSendInfo(userId, map); /** 设置居住地、户籍地、电话 */ | |
| 734 | + setUserSendInfo(userId, map); /** 设置姓名、居住地、户籍地、电话 */ | |
| 725 | 735 | } |
| 726 | 736 | map.put("create_date", DateUtil.getyyyy_MM_dd((Date) map.get("create_date"))); |
| 727 | 737 | } |
| 728 | 738 | |
| ... | ... | @@ -733,11 +743,11 @@ |
| 733 | 743 | return RespBuilder.buildSuccess(); |
| 734 | 744 | } |
| 735 | 745 | |
| 736 | - | |
| 737 | 746 | private void setUserSendInfo(String userId, Map<String, Object> map) { |
| 738 | 747 | Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(userId)), Patients.class); |
| 739 | 748 | if(patients != null) { |
| 740 | 749 | map.put("phone", patients.getPhone()); |
| 750 | + map.put("username", patients.getUsername()); | |
| 741 | 751 | |
| 742 | 752 | String residenceAddress = findName(patients.getProvinceRegisterId()) + findName(patients.getCityRegisterId()) + findName(patients.getAreaRegisterId()); |
| 743 | 753 | map.put("residenceAddress", residenceAddress.replace("null", "")); /** 居住地 */ |
| ... | ... | @@ -772,12 +782,6 @@ |
| 772 | 782 | checkDate = patients.getCreated(); |
| 773 | 783 | username = patients.getUsername(); |
| 774 | 784 | week = DateUtil.getWeekDesc(patients.getLastMenses(), checkDate); |
| 775 | - /* List<Patients> patientsList = mongoTemplate.find(Query.query(Criteria.where("pid").is(patients.getPid())).with(new Sort(Sort.Direction.ASC, "created")), Patients.class); | |
| 776 | - for(int i = 0; i < patientsList.size(); i++) { | |
| 777 | - if(patientsList.get(i).getId().equals(patients.getId())) { | |
| 778 | -// number = ++i; | |
| 779 | - } | |
| 780 | - }*/ | |
| 781 | 785 | operatorOrgName = couponMapper.findHospitalNameById(patients.getHospitalId()); |
| 782 | 786 | phone = patients.getPhone(); |
| 783 | 787 | } |
| ... | ... | @@ -797,6 +801,11 @@ |
| 797 | 801 | username = findUserNameByPid(antenatal.getPid()); |
| 798 | 802 | week = antenatal.getCurrentDueDate(); |
| 799 | 803 | List<AntenatalExaminationModel> antExChuModels = mongoTemplate.find(Query.query(Criteria.where("pid").is(antenatal.getPid())).with(new Sort(Sort.Direction.ASC, "created")), AntenatalExaminationModel.class); |
| 804 | + List<AntExChuModel> antexcs = mongoTemplate.find(Query.query(Criteria.where("pid").is(antenatal.getPid())), AntExChuModel.class); | |
| 805 | + if(CollectionUtils.isNotEmpty(antexcs)) { | |
| 806 | + | |
| 807 | + } | |
| 808 | + | |
| 800 | 809 | if(CollectionUtils.isNotEmpty(antExChuModels)) { |
| 801 | 810 | for(int i = 0; i < antExChuModels.size(); i++) { |
| 802 | 811 | if(antExChuModels.get(i).getId().equals(antenatal.getId())) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/CollectionUtils.java
View file @
528a401
| ... | ... | @@ -141,5 +141,14 @@ |
| 141 | 141 | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | + public static boolean isNotEmpty(Collection ... collections) { | |
| 145 | + Assert.notNull(collections, "collections must not be null!"); | |
| 146 | + for (Collection collection : collections) { | |
| 147 | + if(isEmpty(collection)) { | |
| 148 | + return false; | |
| 149 | + } | |
| 150 | + } | |
| 151 | + return true; | |
| 152 | + } | |
| 144 | 153 | } |