定时任务开启

This commit is contained in:
张松 2025-10-30 15:39:29 +08:00
parent f9a22f31f2
commit 60ac492f9a
4 changed files with 5 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.annotation.PostConstruct;
@ -18,6 +19,7 @@ import javax.annotation.PostConstruct;
@EnableTransactionManagement
@MapperScan("com.czg.service.market.mapper")
@EnableDubbo
@EnableScheduling
@Slf4j
public class MarketApplication {
public static void main(String[] args) {

View File

@ -17,7 +17,6 @@ public class AAMarketTasks {
// 分销延时发放
//每天0时0分0秒 执行
@Scheduled(fixedRate = 30000)
public void distributionTask() {
distributionTask.deliver();

View File

@ -23,6 +23,7 @@ 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.math.BigDecimal;
@ -56,6 +57,7 @@ public class DistributionTask {
* AAMarketTasks 统一调用位置
*/
// @Scheduled(cron = "0 0 0 * * ?")
@Scheduled(fixedRate = 30000)
public void deliver() {
LocalDateTime localDateTime = DateUtil.date().toLocalDateTime();
distributionFlowService.list(new QueryWrapper()

View File

@ -1066,7 +1066,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
// 分销员升级等级
distributionUserService.costUpgradeLevelBefore(orderInfo.getUserId(), orderInfo.getShopId());
// 分销奖励
distributionUserService.distribute(orderInfo.getId(), payment.getOrderNo(), payment.getAmount(), orderInfo.getUserId(), orderInfo.getShopId(), "order");
distributionUserService.distribute(orderInfo.getId(), orderInfo.getOrderNo(), payment.getAmount(), orderInfo.getUserId(), orderInfo.getShopId(), "order");
} else if ("memberIn".equals(payment.getPayType()) || "free".equals(payment.getPayType())) {
boolean isFree = "free".equals(payment.getPayType());
ShopUser shopUser = shopUserService.getById(payment.getSourceId());