|
@@ -2,6 +2,7 @@ package com.fdkankan.ucenter.task;
|
|
|
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.fdkankan.common.util.DateUtil;
|
|
|
import com.fdkankan.common.util.FileUtils;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
@@ -10,6 +11,7 @@ import com.fdkankan.ucenter.common.StatisticsUtil;
|
|
|
import com.fdkankan.ucenter.common.constants.NacosProperty;
|
|
|
import com.fdkankan.ucenter.common.utils.AuthLicenseUtil;
|
|
|
import com.fdkankan.ucenter.constant.QrCodeFilePath;
|
|
|
+import com.fdkankan.ucenter.entity.IncrementAutoOrder;
|
|
|
import com.fdkankan.ucenter.service.*;
|
|
|
import com.fdkankan.ucenter.util.DateUserUtil;
|
|
|
import com.fdkankan.ucenter.vo.response.AuthLicenseEntityVo;
|
|
@@ -20,9 +22,7 @@ import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.io.File;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Objects;
|
|
|
+import java.util.*;
|
|
|
|
|
|
@Component
|
|
|
public class TaskService {
|
|
@@ -184,5 +184,27 @@ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|