| @@ -35,4 +35,7 @@ public class WxCouponSendVo extends WxCouponSend implements Serializable{ | |||||
| private String merchantName; | private String merchantName; | ||||
| private Date sendDate ; | private Date sendDate ; | ||||
| @io.swagger.annotations.ApiModelProperty(value="自领取之日几日有效",name="validDays") | |||||
| private Integer validDays ; | |||||
| } | } | ||||
| @@ -514,6 +514,20 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| } | } | ||||
| result.put("micropayHistory",historyMap); | result.put("micropayHistory",historyMap); | ||||
| //商户发券 | |||||
| markingCouponDataReportDto.setChannelType(EnumCouponSendSendType.MERCHANT.getCode()); | |||||
| List<MarkingSceneDataVo> 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; | return result; | ||||
| } | } | ||||
| @@ -226,14 +226,14 @@ | |||||
| LEFT JOIN wx_coupon_order co ON cal.coupon_order_id = co.id | 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_coupon c ON cal.coupon_id = c.id | ||||
| LEFT JOIN wx_c_user cu ON cu.id = co.c_user_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} | WHERE cal.channel_type = #{channelType} | ||||
| AND cs.conditions -> '$.id' = concat(#{merchantId},'') | AND cs.conditions -> '$.id' = concat(#{merchantId},'') | ||||
| <if test=" null != beginDate "> | <if test=" null != beginDate "> | ||||
| and cal.create_time >= #{beginDate} | |||||
| AND cal.create_time >= #{beginDate} | |||||
| </if> | </if> | ||||
| <if test=" null != endDate "> | <if test=" null != endDate "> | ||||
| and cal.create_time < #{endDate} | |||||
| AND cal.create_time < #{endDate} | |||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| @@ -18,13 +18,13 @@ | |||||
| <result column="use_limit_quantity" jdbcType="INTEGER" property="useLimitQuantity"/> | <result column="use_limit_quantity" jdbcType="INTEGER" property="useLimitQuantity"/> | ||||
| <result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate"/> | <result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate"/> | ||||
| <result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate"/> | <result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate"/> | ||||
| <result column="send_sms" jdbcType="INTEGER" property="sendSms"/> | <result column="send_sms" jdbcType="INTEGER" property="sendSms"/> | ||||
| <result column="valid_days" jdbcType="INTEGER" property="validDays"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| 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 | (case when | ||||
| (select count(*) from wx_coupon_merchant xcm where xcm.product_id = cs.coupon_id and xcm.status = 0)=1 | (select count(*) from wx_coupon_merchant xcm where xcm.product_id = cs.coupon_id and xcm.status = 0)=1 | ||||
| then | then | ||||
| @@ -32,7 +32,7 @@ | |||||
| else | else | ||||
| '[多商户通用]' | '[多商户通用]' | ||||
| end) as merchant_name, | 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 | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||