Commit 9536944449c149c681a90896e19b1533d1d9673b

Authored by shiyang
1 parent fa3d96cada

update

Showing 2 changed files with 11 additions and 9 deletions

platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml View file @ 9536944
... ... @@ -563,7 +563,7 @@
563 563 </select>
564 564 <select id="findHospitalUsedInfo2Ids" parameterType="map" resultType="string">
565 565 SELECT
566   - distinct(user_id)
  566 + user_id
567 567 FROM
568 568 (
569 569 SELECT
... ... @@ -768,7 +768,7 @@
768 768 <select id="findHospitalSendInfo2Ids" parameterType="map" resultType="string">
769 769  
770 770 SELECT
771   - distinct(user_id)
  771 + user_id
772 772 FROM
773 773 (
774 774 SELECT
... ... @@ -866,7 +866,7 @@
866 866  
867 867 <select id="couponInfo2" parameterType="map" resultType="map">
868 868 select a.used_hospital_id, c.type, b.coupon_order, a.sequence_id, d.name as send_hospital, a.use_date,
869   - a.used_id, a.operator_use_id
  869 + a.used_id,a.user_id, a.operator_use_id
870 870 from coupon_info a, coupon_template b, coupon_type c, organization d
871 871 where a.coupon_template_id = b.id and b.type_id = c.id and a.create_hospital_id = d.id
872 872 and a.status = 2
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ 9536944
... ... @@ -2607,7 +2607,6 @@
2607 2607 for (String hid : hospitalIds) {
2608 2608 queryParam.put("hid", hid);
2609 2609 Map<String, Object> usedInfo = couponMapper.findHospitalUsedInfo2(queryParam);
2610   -
2611 2610 //秦皇岛年龄筛选 <35 岁(大于等于35需要减1次)
2612 2611 if(null!=queryParam.get("age") && MapUtils.isNotEmpty(usedInfo) && usedInfo.get("id") != null) {
2613 2612 List<String> usedInfoId = couponMapper.findHospitalUsedInfo2Ids(queryParam);
2614 2613  
2615 2614  
... ... @@ -3143,17 +3142,20 @@
3143 3142 Iterator<Map<String, Object>> iterator = couponInfo2.iterator();
3144 3143 while (iterator .hasNext()) {
3145 3144 Map<String, Object> map= iterator.next();
3146   - if(MapUtils.isNotEmpty(map) && null!=map.get("used_id")) {
3147   - Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("id").is(map.get("used_id").toString())), Patients.class);
3148   - if (null != patients) {
3149   - Integer age = DateUtil.getAge(patients.getBirth());
  3145 + if(MapUtils.isNotEmpty(map) && null!=map.get("user_id")) {
  3146 + PersonModel personModel = mongoTemplate.findOne(Query.query(Criteria.where("id").is(map.get("user_id").toString())), PersonModel.class);
  3147 + if (null != personModel) {
  3148 + Integer age = DateUtil.getAge(personModel.getBirth());
3150 3149 if (age >= 35) {
3151 3150 iterator.remove();
3152 3151 }
  3152 + if(age<35){
  3153 + System.out.println(personModel.getId());
  3154 + }
3153 3155 }
3154 3156 }
3155 3157 }
3156   - couponInfos = CollectionUtils.getPageIds(couponInfo2, (Integer) param.get("currentPage"), (Integer) param.get("pageSize"));
  3158 + couponInfos = CollectionUtils.getPageIds(couponInfo2, (Integer) param.get("currentPage2"), (Integer) param.get("pageSize"));
3157 3159 }
3158 3160 String subTitle = null;
3159 3161 Set<String> subTitleTempSet = new HashSet<>();