You've already forked FrameTour-BE
coupon通知字段
This commit is contained in:
@@ -18,13 +18,16 @@ public class CouponEntity {
|
||||
|
||||
// 新增优惠券名称字段
|
||||
private String name;
|
||||
|
||||
|
||||
// 优惠券描述
|
||||
private String description;
|
||||
|
||||
|
||||
// 倒计时字段(仅用于展示)
|
||||
private String countdown;
|
||||
|
||||
|
||||
// 广播字段,仅用于展示
|
||||
private String broadcast;
|
||||
|
||||
/**
|
||||
* 优惠券类别,0:普通优惠券;1:第一次推送;2:第二次;3:第三次
|
||||
*/
|
||||
|
@@ -12,13 +12,16 @@ public class CouponRespVO {
|
||||
|
||||
// 新增优惠券名称字段
|
||||
private String name;
|
||||
|
||||
|
||||
// 优惠券描述
|
||||
private String description;
|
||||
|
||||
|
||||
// 倒计时字段(仅用于展示)
|
||||
private String countdown;
|
||||
|
||||
|
||||
// 通知展示字段,仅用于展示
|
||||
private String broadcast;
|
||||
|
||||
/**
|
||||
* 优惠券类别,0:普通优惠券;1:第一次推送;2:第二次;3:第三次
|
||||
*/
|
||||
|
@@ -1,9 +1,12 @@
|
||||
package com.ycwl.basic.task;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.ycwl.basic.mapper.CouponMapper;
|
||||
import com.ycwl.basic.mapper.MemberMapper;
|
||||
import com.ycwl.basic.mapper.ScenicMapper;
|
||||
import com.ycwl.basic.mapper.VideoMapper;
|
||||
import com.ycwl.basic.model.pc.coupon.req.CouponQueryReq;
|
||||
import com.ycwl.basic.model.pc.coupon.resp.CouponRespVO;
|
||||
import com.ycwl.basic.model.pc.member.resp.MemberRespVO;
|
||||
import com.ycwl.basic.model.pc.mp.MpConfigEntity;
|
||||
import com.ycwl.basic.model.pc.scenic.entity.ScenicConfigEntity;
|
||||
@@ -47,6 +50,8 @@ public class DownloadNotificationTasker {
|
||||
private TemplateRepository templateRepository;
|
||||
@Autowired
|
||||
private ScenicMapper scenicMapper;
|
||||
@Autowired
|
||||
private CouponMapper couponMapper;
|
||||
|
||||
@Scheduled(cron = "0 0 21 * * *")
|
||||
public void sendDownloadNotification() {
|
||||
@@ -129,7 +134,16 @@ public class DownloadNotificationTasker {
|
||||
dateMap.put("value", DateUtil.format(expireDate, "yyyy-MM-dd HH:mm"));
|
||||
dataParam.put("time2", dateMap);
|
||||
Map<String, String> remarkMap = new HashMap<>();
|
||||
remarkMap.put("value", "视频即将删除,花点小钱买下回忆");
|
||||
// 查询是否有优惠券可用,如果有,则显示优惠券配置的内容
|
||||
CouponQueryReq query = new CouponQueryReq();
|
||||
query.setScenicId(item.getScenicId());
|
||||
query.setType(3);
|
||||
List<CouponRespVO> coupons = couponMapper.selectByQuery(query);
|
||||
if (coupons.isEmpty()) {
|
||||
remarkMap.put("value", "视频即将删除,花点小钱买下回忆");
|
||||
} else {
|
||||
remarkMap.put("value", coupons.getFirst().getBroadcast());
|
||||
}
|
||||
dataParam.put("thing3", remarkMap);
|
||||
params.put("data", dataParam);
|
||||
params.put("page", page);
|
||||
|
Reference in New Issue
Block a user