You've already forked FrameTour-BE
coupon通知字段
This commit is contained in:
@@ -18,13 +18,16 @@ public class CouponEntity {
|
|||||||
|
|
||||||
// 新增优惠券名称字段
|
// 新增优惠券名称字段
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
// 优惠券描述
|
// 优惠券描述
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
// 倒计时字段(仅用于展示)
|
// 倒计时字段(仅用于展示)
|
||||||
private String countdown;
|
private String countdown;
|
||||||
|
|
||||||
|
// 广播字段,仅用于展示
|
||||||
|
private String broadcast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 优惠券类别,0:普通优惠券;1:第一次推送;2:第二次;3:第三次
|
* 优惠券类别,0:普通优惠券;1:第一次推送;2:第二次;3:第三次
|
||||||
*/
|
*/
|
||||||
|
@@ -12,13 +12,16 @@ public class CouponRespVO {
|
|||||||
|
|
||||||
// 新增优惠券名称字段
|
// 新增优惠券名称字段
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
// 优惠券描述
|
// 优惠券描述
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
// 倒计时字段(仅用于展示)
|
// 倒计时字段(仅用于展示)
|
||||||
private String countdown;
|
private String countdown;
|
||||||
|
|
||||||
|
// 通知展示字段,仅用于展示
|
||||||
|
private String broadcast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 优惠券类别,0:普通优惠券;1:第一次推送;2:第二次;3:第三次
|
* 优惠券类别,0:普通优惠券;1:第一次推送;2:第二次;3:第三次
|
||||||
*/
|
*/
|
||||||
|
@@ -1,9 +1,12 @@
|
|||||||
package com.ycwl.basic.task;
|
package com.ycwl.basic.task;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.ycwl.basic.mapper.CouponMapper;
|
||||||
import com.ycwl.basic.mapper.MemberMapper;
|
import com.ycwl.basic.mapper.MemberMapper;
|
||||||
import com.ycwl.basic.mapper.ScenicMapper;
|
import com.ycwl.basic.mapper.ScenicMapper;
|
||||||
import com.ycwl.basic.mapper.VideoMapper;
|
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.member.resp.MemberRespVO;
|
||||||
import com.ycwl.basic.model.pc.mp.MpConfigEntity;
|
import com.ycwl.basic.model.pc.mp.MpConfigEntity;
|
||||||
import com.ycwl.basic.model.pc.scenic.entity.ScenicConfigEntity;
|
import com.ycwl.basic.model.pc.scenic.entity.ScenicConfigEntity;
|
||||||
@@ -47,6 +50,8 @@ public class DownloadNotificationTasker {
|
|||||||
private TemplateRepository templateRepository;
|
private TemplateRepository templateRepository;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ScenicMapper scenicMapper;
|
private ScenicMapper scenicMapper;
|
||||||
|
@Autowired
|
||||||
|
private CouponMapper couponMapper;
|
||||||
|
|
||||||
@Scheduled(cron = "0 0 21 * * *")
|
@Scheduled(cron = "0 0 21 * * *")
|
||||||
public void sendDownloadNotification() {
|
public void sendDownloadNotification() {
|
||||||
@@ -129,7 +134,16 @@ public class DownloadNotificationTasker {
|
|||||||
dateMap.put("value", DateUtil.format(expireDate, "yyyy-MM-dd HH:mm"));
|
dateMap.put("value", DateUtil.format(expireDate, "yyyy-MM-dd HH:mm"));
|
||||||
dataParam.put("time2", dateMap);
|
dataParam.put("time2", dateMap);
|
||||||
Map<String, String> remarkMap = new HashMap<>();
|
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);
|
dataParam.put("thing3", remarkMap);
|
||||||
params.put("data", dataParam);
|
params.put("data", dataParam);
|
||||||
params.put("page", page);
|
params.put("page", page);
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
<select id="selectByQuery" resultType="com.ycwl.basic.model.pc.coupon.resp.CouponRespVO">
|
<select id="selectByQuery" resultType="com.ycwl.basic.model.pc.coupon.resp.CouponRespVO">
|
||||||
SELECT
|
SELECT
|
||||||
c.id, scenic_id AS scenicId, s.name as scenicName,
|
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,
|
config_ids AS configIds, discount_price AS discountPrice,
|
||||||
type, discount_type AS discountType,
|
type, discount_type AS discountType,
|
||||||
c.status, c.create_at
|
c.status, c.create_at
|
||||||
@@ -30,6 +30,8 @@
|
|||||||
ORDER BY create_time DESC
|
ORDER BY create_time DESC
|
||||||
</select>
|
</select>
|
||||||
<select id="getById" resultType="com.ycwl.basic.model.pc.coupon.entity.CouponEntity">
|
<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>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
Reference in New Issue
Block a user