Browse Source

生日积分定时任务

release_toaliyun_real
Burce 6 years ago
parent
commit
8d289919e1
4 changed files with 24 additions and 7 deletions
  1. +3
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxCouponSendVo.java
  2. +14
    -0
      mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java
  3. +3
    -3
      mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml
  4. +4
    -4
      mallinkService/src/main/resources/mapper/WxCouponSendMapper.xml

+ 3
- 0
mallinkService/src/main/java/com/iformall/domain/vo/WxCouponSendVo.java View File

@@ -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 ;
} }

+ 14
- 0
mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java View File

@@ -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;
} }




+ 3
- 3
mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml View File

@@ -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 &gt;= #{beginDate}
AND cal.create_time &gt;= #{beginDate}
</if> </if>
<if test=" null != endDate "> <if test=" null != endDate ">
and cal.create_time &lt; #{endDate}
AND cal.create_time &lt; #{endDate}
</if> </if>
</select> </select>




+ 4
- 4
mallinkService/src/main/resources/mapper/WxCouponSendMapper.xml View File

@@ -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">


Loading…
Cancel
Save