coupon通知字段

This commit is contained in:
2025-07-27 14:18:30 +08:00
parent 4d2a962bc6
commit 0ca7cd694e
4 changed files with 31 additions and 9 deletions

View File

@@ -18,13 +18,16 @@ public class CouponEntity {
// 新增优惠券名称字段
private String name;
// 优惠券描述
private String description;
// 倒计时字段(仅用于展示)
private String countdown;
// 广播字段,仅用于展示
private String broadcast;
/**
* 优惠券类别,0:普通优惠券;1:第一次推送;2:第二次;3:第三次
*/

View File

@@ -12,13 +12,16 @@ public class CouponRespVO {
// 新增优惠券名称字段
private String name;
// 优惠券描述
private String description;
// 倒计时字段(仅用于展示)
private String countdown;
// 通知展示字段,仅用于展示
private String broadcast;
/**
* 优惠券类别,0:普通优惠券;1:第一次推送;2:第二次;3:第三次
*/

View File

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

View File

@@ -11,7 +11,7 @@
<select id="selectByQuery" resultType="com.ycwl.basic.model.pc.coupon.resp.CouponRespVO">
SELECT
c.id, scenic_id AS scenicId, s.name as scenicName,
c.name AS name, c.description AS description, c.countdown AS countdown,
c.name AS name, c.description AS description, c.countdown AS countdown, c.broadcast,
config_ids AS configIds, discount_price AS discountPrice,
type, discount_type AS discountType,
c.status, c.create_at
@@ -30,6 +30,8 @@
ORDER BY create_time DESC
</select>
<select id="getById" resultType="com.ycwl.basic.model.pc.coupon.entity.CouponEntity">
select * from coupon where id = #{id}
SELECT id, scenic_id, name, broadcast, config_ids, discount_price, type, discount_type, status, create_at
FROM coupon
WHERE id = #{id}
</select>
</mapper>