Commit 7c8796791a14497efd1a6ab2bf4907b08e94d851

Authored by shiyang
1 parent 8f41d26d65

update

Showing 3 changed files with 21 additions and 29 deletions

platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml View file @ 7c87967
... ... @@ -970,8 +970,9 @@
970 970 </select>
971 971 <select id="findCouponInfoCount2Ids" parameterType="map" resultType="string">
972 972  
973   - select
974   - a.used_id
  973 + select a.used_id from (
  974 + select a.used_hospital_id, c.type, b.coupon_order, a.sequence_id, d.name as send_hospital, a.use_date,
  975 + a.used_id, a.operator_use_id
975 976 from coupon_info a, coupon_template b, coupon_type c, organization d
976 977 where a.coupon_template_id = b.id and b.type_id = c.id and a.create_hospital_id = d.id
977 978 and a.status = 2
... ... @@ -1004,6 +1005,7 @@
1004 1005 and a.use_date <![CDATA[ < ]]> #{endDate}
1005 1006 </if>
1006 1007  
  1008 + ) a
1007 1009  
1008 1010 </select>
1009 1011  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java View file @ 7c87967
... ... @@ -464,11 +464,11 @@
464 464 @TokenRequired
465 465 @RequestMapping(value = "/coupon/info/export", method = RequestMethod.GET)
466 466 public void couponInfoExport(HttpServletRequest request, HttpServletResponse response, Date startDate, Date endDate, Integer type,
467   - String provinceId, String cityId, String areaId, String hospitalId, String tempId, String couponType, Integer exportType) {
  467 + String provinceId, String cityId, String areaId, String hospitalId, String tempId, String couponType, Integer exportType,Integer age) {
468 468 // Map<String, Object> param = CollectionUtils.createMap("userId", "1000000185", "startDate", startDate,
469 469 Map<String, Object> param = CollectionUtils.createMap("userId", getUserId(request), "startDate", startDate,
470 470 "endDate", endDate != null ? DateUtil.addDay(endDate, 1) : endDate, "hospitalId", CollectionUtils.asList(hospitalId), "provinceId", provinceId, "cityId", cityId, "areaId", areaId, "type", type,
471   - "tempId", tempId, "couponType",couponType, "exportType", exportType);
  471 + "tempId", tempId, "couponType",couponType, "exportType", exportType,"age",age);
472 472 reportService.exportCouponInfo(param, response);
473 473 }
474 474  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ 7c87967
... ... @@ -3134,22 +3134,7 @@
3134 3134 if (type == 4) { /** 使用详情统计 */
3135 3135 // List<Map<String, Object>> couponInfos = couponMapper.couponInfo(param);
3136 3136 List<Map<String, Object>> couponInfos = couponMapper.couponInfo2(param);
3137   - //秦皇岛年龄筛选 <35 岁(大于等于35需要移除)
3138   - if(null!=param.get("age")) {
3139   - Iterator<Map<String, Object>> iterator = couponInfos.iterator();
3140   - while (iterator .hasNext()) {
3141   - Map<String, Object> map= iterator.next();
3142   - if(MapUtils.isNotEmpty(map) && null!=map.get("used_id")) {
3143   - Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("id").is(map.get("used_id").toString())), Patients.class);
3144   - if (null != patients) {
3145   - Integer age = DateUtil.getAge(patients.getBirth());
3146   - if (age >= 35) {
3147   - iterator.remove();
3148   - }
3149   - }
3150   - }
3151   - }
3152   - }
  3137 +
3153 3138 String subTitle = null;
3154 3139 Set<String> subTitleTempSet = new HashSet<>();
3155 3140  
3156 3141  
3157 3142  
... ... @@ -3181,21 +3166,26 @@
3181 3166 }
3182 3167 // int count = couponMapper.findCouponInfoCount(param);
3183 3168 int count = couponMapper.findCouponInfoCount2(param);
3184   - //秦皇岛年龄筛选 <35 岁(大于等于35需要减1)
  3169 + //秦皇岛年龄筛选 <35 岁(大于等于35需要移除,count,需要减1)
3185 3170 if(null!=param.get("age")) {
3186   - List<String> countIds = couponMapper.findCouponInfoCount2Ids(param);
3187   - for (String countId : countIds) {
3188   - Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("id").is(countId)), Patients.class);
3189   - if (null != patients) {
3190   - Integer age = DateUtil.getAge(patients.getBirth());
3191   - if (age >= 35) {
3192   - if(0!=count){
3193   - --count;
  3171 + Iterator<Map<String, Object>> iterator = couponInfos.iterator();
  3172 + while (iterator .hasNext()) {
  3173 + Map<String, Object> map= iterator.next();
  3174 + if(MapUtils.isNotEmpty(map) && null!=map.get("used_id")) {
  3175 + Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("id").is(map.get("used_id").toString())), Patients.class);
  3176 + if (null != patients) {
  3177 + Integer age = DateUtil.getAge(patients.getBirth());
  3178 + if (age >= 35) {
  3179 + iterator.remove();
  3180 + if(0!=count){
  3181 + count--;
  3182 + }
3194 3183 }
3195 3184 }
3196 3185 }
3197 3186 }
3198 3187 }
  3188 +
3199 3189 PageResult pageResult = new PageResult(count, currentPage, (Integer) param.get("pageSize"), CollectionUtils.createMap("couponInfos", couponInfos, "subTitle", subTitle));
3200 3190 return RespBuilder.buildSuccess(pageResult);
3201 3191 }