From 8d289919e1234a36f75bd8a964c56429f7215931 Mon Sep 17 00:00:00 2001 From: Burce Date: Tue, 27 Aug 2019 15:38:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=97=A5=E7=A7=AF=E5=88=86=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/domain/vo/WxCouponSendVo.java | 3 +++ .../service/impl/MarkingDataReportServiceImpl.java | 14 ++++++++++++++ .../resources/mapper/WxCouponActionLogMapper.xml | 6 +++--- .../main/resources/mapper/WxCouponSendMapper.xml | 8 ++++---- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponSendVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponSendVo.java index 53b5e491a..2cab48668 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponSendVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponSendVo.java @@ -35,4 +35,7 @@ public class WxCouponSendVo extends WxCouponSend implements Serializable{ private String merchantName; private Date sendDate ; + + @io.swagger.annotations.ApiModelProperty(value="自领取之日几日有效",name="validDays") + private Integer validDays ; } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java index b08cd6879..a4576e10c 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java @@ -514,6 +514,20 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { } result.put("micropayHistory",historyMap); + //商户发券 + markingCouponDataReportDto.setChannelType(EnumCouponSendSendType.MERCHANT.getCode()); + List merchantList = wxCouponActionLogMapper.sceneDataList(markingCouponDataReportDto); + countMap = merchantList.stream().collect(Collectors.toMap(MarkingSceneDataVo::getXtime, p -> p.getSendCount())); + historyMap = new TreeMap<>(); + for (String date:days) { + historyMap.put(date.substring(5).replace("-","/"),"0"); + } + for (String key : countMap.keySet()) { + String keySub = key.substring(5).replace("-","/"); + historyMap.put(keySub,countMap.get(key)); + } + result.put("merchantHistory",historyMap); + return result; } diff --git a/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml index 74cd57456..a7f2caa38 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml @@ -226,14 +226,14 @@ LEFT JOIN wx_coupon_order co ON cal.coupon_order_id = co.id LEFT JOIN wx_coupon c ON cal.coupon_id = c.id LEFT JOIN wx_c_user cu ON cu.id = co.c_user_id - LEFT JOIN wx_merchant_b_user mbu ON co.b_user_id = mbu.id + LEFT JOIN wx_merchant_b_user mbu ON concat(mbu.merchant_id,'') = JSON_EXTRACT(cs.conditions , '$.id') WHERE cal.channel_type = #{channelType} AND cs.conditions -> '$.id' = concat(#{merchantId},'') - and cal.create_time >= #{beginDate} + AND cal.create_time >= #{beginDate} - and cal.create_time < #{endDate} + AND cal.create_time < #{endDate} diff --git a/mallinkService/src/main/resources/mapper/WxCouponSendMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponSendMapper.xml index 66a0b4c32..bdcf52f57 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponSendMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponSendMapper.xml @@ -18,13 +18,13 @@ - - + + - cs.id,cs.tenant_id,cs.coupon_id,cs.title,cs.send_type,cs.conditions,cs.status,cs.create_date,cs.update_date,JSON_EXTRACT(cs.conditions,'$.merchantLnventory') as merchantLnventory, + cs.id,cs.tenant_id,cs.coupon_id,cs.title,cs.send_type,cs.conditions,cs.status,cs.create_date,cs.update_date, (case when (select count(*) from wx_coupon_merchant xcm where xcm.product_id = cs.coupon_id and xcm.status = 0)=1 then @@ -32,7 +32,7 @@ else '[多商户通用]' end) as merchant_name, - c.remain_inventory, c.use_limit_quantity, c.inventory, c.valid_start_date, c.valid_end_date,c.valid_type,cs.send_sms + c.remain_inventory, c.use_limit_quantity, c.inventory, c.valid_start_date, c.valid_end_date,c.valid_type,cs.send_sms,c.valid_days