You've already forked FrameTour-BE
coupon通知字段
This commit is contained in:
@@ -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