Просмотр исходного кода

fix order

release_toaliyun_real
xiaohanzi 4 лет назад
Родитель
Сommit
6614d68a01
27 измененных файлов: 74 добавлений и 19 удалений
  1. +4
    -0
      mallinkSchedule/src/main/java/com/iformall/ScheduleApplication.java
  2. +11
    -11
      mallinkSchedule/src/main/java/com/iformall/config/SchedulingConfig.java
  3. +3
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/ActivitySchedule.java
  4. +2
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java
  5. +2
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/BillStatusSchedule.java
  6. +4
    -1
      mallinkSchedule/src/main/java/com/iformall/schedule/CashOutSchedule.java
  7. +2
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/ChartDataSchedule.java
  8. +2
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/ContractSchedule.java
  9. +7
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java
  10. +1
    -1
      mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderExpiringSchedule.java
  11. +3
    -1
      mallinkSchedule/src/main/java/com/iformall/schedule/CouponSendSchedule.java
  12. +2
    -1
      mallinkSchedule/src/main/java/com/iformall/schedule/DaliyAmountSchedule.java
  13. +2
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/DeviceHbCheckSchedule.java
  14. +2
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/FloatingLayerSchedule.java
  15. +3
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/InvestSchedule.java
  16. +2
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/LatePayBillActionSchedule.java
  17. +2
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/MsgSendingSchedule.java
  18. +1
    -1
      mallinkSchedule/src/main/java/com/iformall/schedule/OrderExpiringSchedule.java
  19. +2
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/PowerBillAutoBuildSchedule.java
  20. +2
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/SharingOrderRedoSchedule.java
  21. +2
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/SharingOrderRedoScheduletttttttttttttttttttttttttt.java
  22. +2
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/SharingOrderResultSchedule.java
  23. +2
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/SysMonitorSchedule.java
  24. +2
    -1
      mallinkSchedule/src/main/java/com/iformall/schedule/WeChatAccessTokenSchedule.java
  25. +3
    -2
      mallinkSchedule/src/main/java/com/iformall/schedule/WxAppVisitSchedule.java
  26. +2
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/WxCUserTagsSchedule.java
  27. +2
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/WxMsgRecordSchedule.java

+ 4
- 0
mallinkSchedule/src/main/java/com/iformall/ScheduleApplication.java Просмотреть файл

@@ -8,6 +8,8 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

import springfox.documentation.swagger2.annotations.EnableSwagger2;

@@ -21,6 +23,8 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@EnableRocketMQ
@EnableEncryptableProperties
@EnableAspectJAutoProxy(exposeProxy = true)
@EnableScheduling
@EnableAsync
public class ScheduleApplication {

@Value("${fm.exception}")


+ 11
- 11
mallinkSchedule/src/main/java/com/iformall/config/SchedulingConfig.java Просмотреть файл

@@ -6,14 +6,14 @@ import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;

@Configuration
@EnableScheduling
public class SchedulingConfig implements SchedulingConfigurer {
@Override
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
}
}
//@Configuration
//@EnableScheduling
//public class SchedulingConfig implements SchedulingConfigurer {
//
// @Override
// public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
//
//
// }
//
//}

+ 3
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/ActivitySchedule.java Просмотреть файл

@@ -16,6 +16,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -47,6 +48,7 @@ public class ActivitySchedule {
/**
* 每天12点执行
*/
@Async
@Scheduled(cron = "0 0 12 * * ?")
public void sendMsg() {
logger.info("限时活动参与提醒任务启动");
@@ -91,6 +93,7 @@ public class ActivitySchedule {
/**
* 5分钟一次
*/
@Async
@Scheduled(cron = "0 */5 * * * ?")
public void activityExipred() {
logger.info("活动报名结束任务");


+ 2
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java Просмотреть файл

@@ -11,6 +11,7 @@ import org.apache.commons.collections.map.HashedMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -40,6 +41,7 @@ public class BillNotificationSchedule {
/**
* 每天9点执行
*/
@Async
@Scheduled(cron = "0 0 14 * * ?")
public void sendMsgFromBill() {
logger.info("账单通知任务启动");


+ 2
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/BillStatusSchedule.java Просмотреть файл

@@ -8,6 +8,7 @@ import com.iformall.service.WxBillAllService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -30,6 +31,7 @@ public class BillStatusSchedule {
/**
* 每天1点执行
*/
@Async
@Scheduled(cron = "0 0 1 * * ?")
public void updateBillStatus() {
logger.info("账单状态更新开始");


+ 4
- 1
mallinkSchedule/src/main/java/com/iformall/schedule/CashOutSchedule.java Просмотреть файл

@@ -22,6 +22,7 @@ import com.iformall.service.pay.service.cashout.entity.CashOutAdapterResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
@@ -56,7 +57,8 @@ public class CashOutSchedule {
return wxMallMapper.findList(wxMall);
}


@Async
@Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:05
public void merchantCountSchedule() {
List<WxMall> malls = getMalls();
@@ -75,6 +77,7 @@ public class CashOutSchedule {
}
}
@Async
@Scheduled(cron = "0 0 0/6 * * ?") // 执行一次
public void cashOutFailSchedule() {
List<WxMall> malls = getMalls();


+ 2
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/ChartDataSchedule.java Просмотреть файл

@@ -14,6 +14,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -56,6 +57,7 @@ public class ChartDataSchedule {
/**
* 每天7点执行
*/
@Async
@Scheduled(cron = "0 0 7 * * ?")
public void createData() {
createCarData();


+ 2
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/ContractSchedule.java Просмотреть файл

@@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -37,6 +38,7 @@ public class ContractSchedule {
/**
* 凌晨5分
*/
@Async
@Scheduled(cron = "0 5 0 * * ?")
public void updateContractStatus() {
//更新合同状态,正常到期


+ 7
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java Просмотреть файл

@@ -10,6 +10,7 @@ import com.iformall.mapper.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
@@ -46,6 +47,7 @@ public class CouponExpiringSchedule {
return wxMallMapper.findList(wxMall);
}

@Async
@Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:05 作废过期券,商户禁用券
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void couponExpiringSchedule() {
@@ -63,6 +65,7 @@ public class CouponExpiringSchedule {
}
}

@Async
@Scheduled(cron = "0 10 0 * * ?") // 每天凌晨00:10 下架定向发放
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void couponSendExpiringSchedule() {
@@ -76,6 +79,7 @@ public class CouponExpiringSchedule {
}
}

@Async
@Scheduled(cron = "0 10 0 * * ?") // 每天凌晨00:10 下架主动领取
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void couponChannelExpiringSchedule() {
@@ -91,12 +95,14 @@ public class CouponExpiringSchedule {
}
}

@Async
@Scheduled(cron = "0 15 0 * * ?") // 每天凌晨00:15 下架券广告
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void screenAdExpiringSchedule() {
wxScreenAdMapper.offScreeAdByCouponChannelStatus();
}

@Async
@Scheduled(cron = "0 0,1,2,3 0/1 * * ?") // 每小时 0, 1 ,2 ,3 分钟(整点)执行//限时抢购
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void couponChannel2ExpiringSchedule() {
@@ -110,6 +116,7 @@ public class CouponExpiringSchedule {
}
}

@Async
@Scheduled(cron = "0 20 0 * * ?") // 每天凌晨00:20 下架游戏
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void gameExpiringSchedule() {


+ 1
- 1
mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderExpiringSchedule.java Просмотреть файл

@@ -15,6 +15,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.aop.framework.AopContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
@@ -57,7 +58,6 @@ public class CouponOrderExpiringSchedule {
return wxMallMapper.findList(wxMall);
}
@Scheduled(cron = "0 0 5 * * ?") // 每天凌晨00:05
// @Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void couponOrderExpiringSchedule() {


+ 3
- 1
mallinkSchedule/src/main/java/com/iformall/schedule/CouponSendSchedule.java Просмотреть файл

@@ -16,6 +16,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -74,7 +75,7 @@ public class CouponSendSchedule {
@Autowired
private PushLimitService pushLimitService;

@Async
//@Scheduled(cron = "0 0 6 1 * ?") // 每月1号发放会员的权益券
@Scheduled(cron = "0 0 6 * * ?") // 测试每天6点发券
//@Scheduled(cron = "*/30 * * * * ?") // 测试30秒中一次
@@ -219,6 +220,7 @@ public class CouponSendSchedule {
/**
* 生日券发放
*/
@Async
@Scheduled(cron = "0 30 8 * * ?") // 测试每天8:30点发券
public void birthdayCouponSendSchedule() {
logger.info("生日发券: 任务开始");


+ 2
- 1
mallinkSchedule/src/main/java/com/iformall/schedule/DaliyAmountSchedule.java Просмотреть файл

@@ -9,6 +9,7 @@ import com.iformall.service.WxDateAmountRecordService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
@@ -94,7 +95,7 @@ public class DaliyAmountSchedule {

}

@Async
@Scheduled(cron = "0 0 1 * * ?") // 每天凌晨1点盘点前一天的数据
//@Scheduled(cron = "0 0 1 * * ?") // 测试10秒中一次
public void daliyAmountSchedule() {


+ 2
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/DeviceHbCheckSchedule.java Просмотреть файл

@@ -10,6 +10,7 @@ import com.iformall.mapper.WxDeviceMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -32,6 +33,7 @@ public class DeviceHbCheckSchedule {
@Autowired
KwMeterMapper kwMeterMapper;

@Async
@Scheduled(cron = "0 */5 * * * *?") // 每5分钟检查一次
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void offlineCheckSchedule() {


+ 2
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/FloatingLayerSchedule.java Просмотреть файл

@@ -4,6 +4,7 @@ import com.iformall.mapper.WxCuserFloatingLayerMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -22,6 +23,7 @@ public class FloatingLayerSchedule {
/**
* 每天23点执行
*/
@Async
@Scheduled(cron = "0 0 23 * * ?")
public void sendMsg() {
logger.info("删除浮层用户数据开始");


+ 3
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/InvestSchedule.java Просмотреть файл

@@ -19,6 +19,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -59,6 +60,7 @@ public class InvestSchedule {
private static final String TAG_REMIND = "招商定时任务-提醒";


@Async
@Scheduled(cron = "0 0 14 * * ?") // 每天下午两点执行定时任务
//@Scheduled(cron = "0 */30 * * * *?") // 测试,每30分钟执行
public void messageSchedule() {
@@ -70,6 +72,7 @@ public class InvestSchedule {
log.info("{}: 结束", TAG_MESSAGE);
}

@Async
@Scheduled(cron = "0 */5 * * * *?")
public void remindSchedule() {
log.info("{}: 开始", TAG_REMIND);


+ 2
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/LatePayBillActionSchedule.java Просмотреть файл

@@ -5,6 +5,7 @@ import com.iformall.mapper.WxBillRentMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -21,6 +22,7 @@ public class LatePayBillActionSchedule {
/**
* 每天凌晨1点执行
*/
@Async
@Scheduled(cron = "0 0 1 * * ?")
public void updateBillStatus() {
try {


+ 2
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/MsgSendingSchedule.java Просмотреть файл

@@ -14,6 +14,7 @@ import com.iformall.utils.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.List;
@@ -43,6 +44,7 @@ public class MsgSendingSchedule {
/**
* 每小时第一分钟执行
*/
@Async
@Scheduled(cron = "0 1 */1 * * ?")
public void sendmsgschedule() {
logger.info("sendmsg定时任务启动");


+ 1
- 1
mallinkSchedule/src/main/java/com/iformall/schedule/OrderExpiringSchedule.java Просмотреть файл

@@ -11,6 +11,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.aop.framework.AopContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
@@ -95,7 +96,6 @@ public class OrderExpiringSchedule {
return wxMallMapper.findList(wxMall);
}
@Scheduled(cron = "0 */5 * * * *?") // 每5分钟检查一次
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void orderExpireSchedule() {


+ 2
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/PowerBillAutoBuildSchedule.java Просмотреть файл

@@ -17,6 +17,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -60,6 +61,7 @@ public class PowerBillAutoBuildSchedule {
/**
* 每天5点执行
*/
@Async
@Scheduled(cron = "0 0 5 * * ?")
public void powerBillAutoConfigStart() {
logger.info("自动生成电费账单开始....");


+ 2
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/SharingOrderRedoSchedule.java Просмотреть файл

@@ -15,6 +15,7 @@ import com.iformall.service.WxProfitSharingOrderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -40,6 +41,7 @@ public class SharingOrderRedoSchedule {
return wxMallMapper.findList(wxMall);
}
@Async
@Scheduled(cron = "0 0 2 * * ?") // 每天凌晨02:00分账重试
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void sharingOrderResultSchedule() {


+ 2
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/SharingOrderRedoScheduletttttttttttttttttttttttttt.java Просмотреть файл

@@ -15,6 +15,7 @@ import com.iformall.service.WxProfitSharingOrderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -39,6 +40,7 @@ public class SharingOrderRedoScheduletttttttttttttttttttttttttt {
return wxMallMapper.findList(wxMall);
}

@Async
@Scheduled(cron = "0 5 0 * * ?") // 每天凌晨02:00分账重试
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void sharingOrderResultSchedule() {


+ 2
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/SharingOrderResultSchedule.java Просмотреть файл

@@ -9,6 +9,7 @@ import com.iformall.service.WxProfitSharingOrderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -33,6 +34,7 @@ public class SharingOrderResultSchedule {
return wxMallMapper.findList(wxMall);
}
@Async
@Scheduled(cron = "0 15 0 * * ?") // 每天凌晨00:15更新分账结果
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void sharingOrderResultSchedule() {


+ 2
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/SysMonitorSchedule.java Просмотреть файл

@@ -9,6 +9,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -31,6 +32,7 @@ public class SysMonitorSchedule {
@Autowired
private SysMonitorMapper sysMonitorMapper;

@Async
@Scheduled(cron = "0 */5 * * * *?") // 每隔5分钟检查一下各个网址
public void checkUrls() {
if(isFmMonitor) {


+ 2
- 1
mallinkSchedule/src/main/java/com/iformall/schedule/WeChatAccessTokenSchedule.java Просмотреть файл

@@ -8,6 +8,7 @@ import me.chanjar.weixin.common.error.WxErrorException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -28,7 +29,7 @@ public class WeChatAccessTokenSchedule {
@Autowired
MaUtil maUtil;

@Async
@Scheduled(cron = "0 1 * * * ?") // 每小时第一分钟执行
public void getAccessTokens() {



+ 3
- 2
mallinkSchedule/src/main/java/com/iformall/schedule/WxAppVisitSchedule.java Просмотреть файл

@@ -15,6 +15,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -48,7 +49,7 @@ public class WxAppVisitSchedule {
@Autowired
MaUtil maUtil;

@Async
@Scheduled(cron = "0 0 9/1 * * ? ") //早晨9点开始每小时取一次,获取前一日,微信时间为GMT
public void daliyVisitRetrive() {
try {
@@ -80,7 +81,7 @@ public class WxAppVisitSchedule {
}
}

@Async
@Scheduled(cron = "0 0 2 * * ? ") //2点做一次补录
public void completeVisitRetrive() {
try {


+ 2
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/WxCUserTagsSchedule.java Просмотреть файл

@@ -8,6 +8,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -34,6 +35,7 @@ public class WxCUserTagsSchedule {
@Autowired
WxMallService wxMallService;

@Async
// TODO 先不执行打标签操作了, 数据量太大,导致数据库CPU 100%
//@Scheduled(cron = "0 0 0 25 * ?") // 每月25日凌晨01:00对会员列表扫描补录标签
@Scheduled(cron = "0 0 2 * * ?") // 测试1分钟一次


+ 2
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/WxMsgRecordSchedule.java Просмотреть файл

@@ -2,6 +2,7 @@ package com.iformall.schedule;

import com.iformall.service.WxMsgRecordService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@@ -16,6 +17,7 @@ public class WxMsgRecordSchedule {
@Value("${fm.clear_data_before_msg_record}")
private int monthBefore;

@Async
@Scheduled(cron = "0 0 1 1 * ?") // 每月1日凌晨01:00清理过期的wx_msg_record表
public void clearOldData() {
msgRecordService.clearOldData(monthBefore);


Загрузка…
Отмена
Сохранить