Sfoglia il codice sorgente

恢复定时任务

qrs 1 mese fa
parent
commit
73ffb601c0

+ 7 - 6
alien-store/src/main/java/shop/alien/store/job/DeliciousFoodJob.java

@@ -3,6 +3,7 @@ package shop.alien.store.job;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 import shop.alien.entity.store.*;
 import shop.alien.mapper.*;
@@ -60,7 +61,7 @@ public class DeliciousFoodJob {
     /**
      * 美食筛选标签定时存储数据
      */
-//    @Scheduled(cron = "0 0 0/2 * * ?")
+    @Scheduled(cron = "0 0 0/2 * * ?")
     public void deliciousFoodJob() {
         // 获取所有美食筛选
         List<EssentialModuleInformation> essentialModuleInformations = informationMapper.selectList(
@@ -485,7 +486,7 @@ public class DeliciousFoodJob {
     /**
      * 酒店和民宿筛选标签定时存储数据
      */
-//    @Scheduled(cron = "0 0 0/2 * * ?")
+    @Scheduled(cron = "0 0 0/2 * * ?")
     public void hotelAndHomestayJob() {
         // 获取所有酒店民宿筛选
         List<EssentialModuleInformation> essentialModuleInformations = informationMapper.selectList(
@@ -1032,7 +1033,7 @@ public class DeliciousFoodJob {
     /**
      * 汗蒸洗浴筛选标签定时存储数据
      */
-//    @Scheduled(cron = "0 0 0/2 * * ?")
+    @Scheduled(cron = "0 0 0/2 * * ?")
     public void takeABathAndSaunaJob() {
         // 获取所有洗浴汗蒸筛选
         List<EssentialModuleInformation> essentialModuleInformations = informationMapper.selectList(
@@ -1283,7 +1284,7 @@ public class DeliciousFoodJob {
     /**
      * 丽人美发筛选标签定时存储数据
      */
-//    @Scheduled(cron = "0 0 0/2 * * ?")
+    @Scheduled(cron = "0 0 0/2 * * ?")
     public void lirenHairdressingJob() {
         // 获取所有丽人筛选
         List<EssentialModuleInformation> essentialModuleInformations = informationMapper.selectList(
@@ -1298,7 +1299,7 @@ public class DeliciousFoodJob {
     /**
      * 运动健身筛选标签定时存储数据
      */
-//    @Scheduled(cron = "0 0 0/2 * * ?")
+    @Scheduled(cron = "0 0 0/2 * * ?")
     public void sportsAndFitnessJob() {
         // 获取所有的运动健身1级菜单
         List<EssentialModuleInformation> moduleInformations = informationMapper.selectList(
@@ -1384,7 +1385,7 @@ public class DeliciousFoodJob {
     /**
      * 医美医疗筛选标签定时存储数据
      */
-//    @Scheduled(cron = "0 0 0/2 * * ?")
+    @Scheduled(cron = "0 0 0/2 * * ?")
     public void medicalAestheticsJob() {
         // 获取所有医美医疗筛选标签
         List<EssentialModuleInformation> essentialModuleInformations = informationMapper.selectList(

+ 2 - 1
alien-store/src/main/java/shop/alien/store/job/KTVJob.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 import shop.alien.entity.store.*;
 import shop.alien.store.config.BaseRedisService;
@@ -36,7 +37,7 @@ public class KTVJob {
 
     private final StoreLabelTypeMapper storeLabelTypeMapper;
 
-    //    @Scheduled(cron = "0 0 0/2 * * ?")
+    @Scheduled(cron = "0 0 0/2 * * ?")
     public void ktvJob() {
 
         // 获取所有的商家信息

+ 2 - 1
alien-store/src/main/java/shop/alien/store/job/MassageFootBathJob.java

@@ -3,6 +3,7 @@ package shop.alien.store.job;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 import shop.alien.entity.store.EssentialModuleInformation;
 import shop.alien.entity.store.LifeCoupon;
@@ -48,7 +49,7 @@ public class MassageFootBathJob {
 
     private final StoreLabelTypeMapper storeLabelTypeMapper;
 
-//    @Scheduled(cron = "0 0 0/2 * * ?")
+    @Scheduled(cron = "0 0 0/2 * * ?")
     public void MassageFootBathJob() {
 
         // 获取所有足浴按摩筛选

+ 3 - 2
alien-store/src/main/java/shop/alien/store/job/StoreMembershipCardJob.java

@@ -3,6 +3,7 @@ package shop.alien.store.job;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 import shop.alien.entity.store.*;
 import shop.alien.store.config.BaseRedisService;
@@ -60,7 +61,7 @@ public class StoreMembershipCardJob {
     /**
      * 会员卡状态及会员卡订单状态变更任务
      */
-//    @Scheduled(cron = "0 0 2 * * ?")
+    @Scheduled(cron = "0 0 2 * * ?")
 //    @Scheduled(cron = "0/10 * * * * ?")
     public void storeMembershipCardStatusJob() {
         log.info("会员卡状态及会员卡订单状态变更任务执行: " + new Date());
@@ -119,7 +120,7 @@ public class StoreMembershipCardJob {
     /**
      * 定时清理已申请注销超过7天的商家与用户
      */
-//    @Scheduled(cron = "0 0 0 * * ?")
+    @Scheduled(cron = "0 0 0 * * ?")
     public void cancellationOfBusinessJob() {
         log.info("删除已申请注销超过7天的商家与用户: " + new Date());
 

+ 5 - 4
alien-store/src/main/java/shop/alien/store/task/ScheduledTask.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 import shop.alien.entity.store.*;
 import shop.alien.mapper.LifeCouponMapper;
@@ -44,13 +45,13 @@ public class ScheduledTask {
 
     private final LifeUserService lifeUserService;
 
-//    @Scheduled(cron = "0 */10 * * * ?")
+    @Scheduled(cron = "0 */10 * * * ?")
     public void sendDiscountCouponRemind() {
         //查询
 
     }
 
-//    @Scheduled(cron = "0 */10 * * * ?")
+    @Scheduled(cron = "0 */10 * * * ?")
     // 该方法用于定时更新生活优惠券(LifeCoupon)的状态
     public void quanStatusUpdateTask() {
         //执行修改代金券状态
@@ -135,7 +136,7 @@ public class ScheduledTask {
         }
     }
 
-//    @Scheduled(cron = "0 */10 * * * ?")
+    @Scheduled(cron = "0 */10 * * * ?")
     public void orderStatusUpdateTask() {
         Date now = new Date();
         Calendar calendar = Calendar.getInstance();
@@ -243,7 +244,7 @@ public class ScheduledTask {
     /**
      * 反向团购订单自动退款
      */
-//    @Scheduled(cron = "0 * * * * ?")
+    @Scheduled(cron = "0 * * * * ?")
     public void reverseGroupOrder() {
         LambdaQueryWrapper<LifeReverseGroupBuying> wrapper = new LambdaQueryWrapper<>();
         //状态, 0:待审核, 1:未通过, 2:已通过, 3:待接单, 4:未接单(已截止), 5:待使用, 6:已完成, 7:已退款