|
@@ -1,15 +1,10 @@
|
|
|
package com.ruoyi.quartz.task;
|
|
|
|
|
|
-import com.ruoyi.system.domain.SysSecretProject;
|
|
|
-import com.ruoyi.system.domain.dto.SysSecretProjectDTO;
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.system.mapper.SysSecretProjectMapper;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
-import com.ruoyi.common.utils.StringUtils;
|
|
|
-
|
|
|
-import java.time.LocalDate;
|
|
|
-import java.util.List;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -36,27 +31,4 @@ public class RyTask {
|
|
|
System.out.println("执行无参方法");
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 项目授权管理定时任务
|
|
|
- */
|
|
|
- public void projectStatusChange() {
|
|
|
- // 获取当前日期
|
|
|
- LocalDate currentDate = LocalDate.now();
|
|
|
- // 获取当前日期前七天的日期
|
|
|
- LocalDate previousDate = currentDate.minusDays(7);
|
|
|
- List<SysSecretProjectDTO> list = sysSecretProjectMapper.getAllList();
|
|
|
- for (SysSecretProjectDTO var : list) {
|
|
|
- int comparisonResult = var.getOverdueDate().compareTo(currentDate);
|
|
|
- if (comparisonResult > 0) {
|
|
|
- var.setStatus(1L);
|
|
|
- sysSecretProjectMapper.updateSysSecretProject(var);
|
|
|
- } else if (comparisonResult < 0) {
|
|
|
- var.setStatus(2L);
|
|
|
- sysSecretProjectMapper.updateSysSecretProject(var);
|
|
|
- } else if (var.getOverdueDate().isAfter(previousDate) && var.getOverdueDate().isBefore(currentDate)) {
|
|
|
- var.setStatus(3L);
|
|
|
- sysSecretProjectMapper.updateSysSecretProject(var);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
}
|