|
@@ -69,7 +69,6 @@ public class TaskService {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
private void updateSceneViewCount() {
|
|
|
String redisKey = RedisKeyUtil.V4_SCENE_VISIT_CNT;
|
|
|
Map<String,String> hmget = redisUtil.hmget(redisKey);
|
|
@@ -98,74 +97,6 @@ public class TaskService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
- IUserIncrementService userIncrementService;
|
|
|
-
|
|
|
- @Scheduled(cron = "${task.cron.increment_sendMsg:0 0 12 * * ?}")
|
|
|
- public void job11() {
|
|
|
- if("local".equals(NacosProperty.uploadType)){
|
|
|
- return;
|
|
|
- }
|
|
|
- log.info("每天12:00开始执行定时任务:短信提醒增值权益准备到期");
|
|
|
- try {
|
|
|
- userIncrementService.incrementExpireSendSms();
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- log.error(e.getMessage());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- @Scheduled(cron = "${task.cron.update_order_status:0 0 0 * * ?}")
|
|
|
- public void checkIncrementExpire() {
|
|
|
- if("local".equals(NacosProperty.uploadType)){
|
|
|
- return;
|
|
|
- }
|
|
|
- log.info("每天00:00开始执行定时任务:增值权益到期检查");
|
|
|
- try {
|
|
|
- userIncrementService.incrementExpire();
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- log.error(e.getMessage());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Autowired
|
|
|
- IOrderService orderService;
|
|
|
-
|
|
|
- @Scheduled(cron = "${task.cron.update_order_status:0 0 1 * * ?}")
|
|
|
- public void updateOrderStatus() {
|
|
|
- if("local".equals(NacosProperty.uploadType)){
|
|
|
- return;
|
|
|
- }
|
|
|
- log.info("每天01:00开始执行定时任务:更新收货状态");
|
|
|
- try {
|
|
|
- //更新收货状态,发货后15天,默认用户已经收到货物
|
|
|
- orderService.autoUpdateOrderStatus();
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- log.error(e.getMessage());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Autowired
|
|
|
- ISceneStatisticsService sceneStatisticsService;
|
|
|
- @Scheduled(cron = "${task.cron.add_baidu_data:0 0 2 * * ?}")
|
|
|
- public void addBaiduData() {
|
|
|
- if("local".equals(NacosProperty.uploadType)){
|
|
|
- return;
|
|
|
- }
|
|
|
- log.info("每天02:00开始执行定时任务:获取百度统计的数据入库");
|
|
|
- try {
|
|
|
- String dateStr = DateUtil.date2String(DateUtil.daysCalculate(new Date(), -1), DateUtil.YYYYMMDD_DATA_FORMAT);
|
|
|
- Map<String, Map<String, Double>> map = StatisticsUtil.findStatisticsData(dateStr);
|
|
|
- sceneStatisticsService.addData(map, dateStr);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- log.error(e.getMessage());
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 清理场景nas资源
|
|
@@ -184,27 +115,4 @@ public class TaskService {
|
|
|
log.info("清除场景计算目录任务执行完成");
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 清除订阅信息
|
|
|
- */
|
|
|
- @Autowired
|
|
|
- IIncrementAutoOrderService incrementAutoOrderService;
|
|
|
-
|
|
|
- @Scheduled(cron = "${task.cron.del_subscription:0 */1 * * * ?}")
|
|
|
- public void delSub(){
|
|
|
- LambdaQueryWrapper<IncrementAutoOrder> wrapper = new LambdaQueryWrapper<>();
|
|
|
- wrapper.isNull(IncrementAutoOrder::getSubscriptionId);
|
|
|
- List<IncrementAutoOrder> list = incrementAutoOrderService.list(wrapper);
|
|
|
- List<Integer> delList = new ArrayList<>();
|
|
|
- for (IncrementAutoOrder autoOrder : list) {
|
|
|
- Long time = autoOrder.getCreateTime().getTime() + 1000 * 60 * 10;
|
|
|
- if(new Date().getTime() > time){
|
|
|
- delList.add(autoOrder.getId());
|
|
|
- }
|
|
|
- }
|
|
|
- if(delList.size() >0){
|
|
|
- log.info("超过十分钟未付款删除订阅信息:{}",delList.size());
|
|
|
- incrementAutoOrderService.removeByIds(delList);
|
|
|
- }
|
|
|
- }
|
|
|
}
|