生日有礼定时奖励
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package com.czg.task;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.czg.account.entity.ShopUser;
|
||||
import com.czg.account.service.ShopUserService;
|
||||
import com.czg.constant.TableValueConstant;
|
||||
import com.czg.market.service.MkBirthdayGiftService;
|
||||
import com.czg.market.service.TbMemberConfigService;
|
||||
import com.czg.order.service.OrderInfoService;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生日有礼奖励发放
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class BirthdayGiftTask {
|
||||
@Resource
|
||||
private MkBirthdayGiftService birthdayGiftService;
|
||||
|
||||
/**
|
||||
* 生日有礼奖励发放
|
||||
*/
|
||||
@Scheduled(cron = "0 0 12 * * ?")
|
||||
public void deliver() {
|
||||
birthdayGiftService.deliver();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,7 +18,7 @@ import org.springframework.stereotype.Component;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单定时任务
|
||||
* 会员奖励发放
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
@@ -35,13 +35,12 @@ public class MemberTask {
|
||||
private TbMemberConfigService memberConfigService;
|
||||
|
||||
/**
|
||||
* order 过期
|
||||
* 奖励发放
|
||||
*/
|
||||
// @Scheduled(cron = "0 0 1 * * ? ")
|
||||
@Scheduled(cron = "0 0 1 * * ? ")
|
||||
public void deliver() {
|
||||
shopUserService.list(new QueryWrapper().eq(ShopUser::getIsVip, 1).lt(ShopUser::getNextDeliverTime, DateUtil.date().toLocalDateTime())).forEach(item -> {
|
||||
memberConfigService.deliver(item.getSourceShopId(), item.getUserId(), TableValueConstant.MemberExpFlow.Type.MEMBER_TASK, null, null, null);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user