|
@@ -7,7 +7,9 @@ import com.jeeplus.common.utils.DateUtils;
|
|
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
|
|
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
|
|
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectSignatureOldMessageDisposeService;
|
|
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectSignatureOldMessageDisposeService;
|
|
import com.jeeplus.modules.statement.service.StatementCompanyComprehensiveService;
|
|
import com.jeeplus.modules.statement.service.StatementCompanyComprehensiveService;
|
|
|
|
+import com.jeeplus.modules.sys.entity.User;
|
|
import com.jeeplus.modules.sys.service.UserService;
|
|
import com.jeeplus.modules.sys.service.UserService;
|
|
|
|
+import com.jeeplus.modules.sys.utils.UserUtils;
|
|
import com.jeeplus.modules.workcalendar.entity.WorkCalendar;
|
|
import com.jeeplus.modules.workcalendar.entity.WorkCalendar;
|
|
import com.jeeplus.modules.workinvoice.entity.WorkInvoice;
|
|
import com.jeeplus.modules.workinvoice.entity.WorkInvoice;
|
|
import com.jeeplus.modules.workinvoice.service.WorkInvoiceService;
|
|
import com.jeeplus.modules.workinvoice.service.WorkInvoiceService;
|
|
@@ -19,7 +21,10 @@ import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
|
+import java.time.temporal.ChronoUnit;
|
|
import java.util.Calendar;
|
|
import java.util.Calendar;
|
|
|
|
+import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.Executors;
|
|
import java.util.concurrent.Executors;
|
|
@@ -343,4 +348,36 @@ public class WorkCalendarTaskService {
|
|
logger.info("-----------用户修改密码通知结束------------------");
|
|
logger.info("-----------用户修改密码通知结束------------------");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取项目即将超期还未上报并进行通知
|
|
|
|
+ */
|
|
|
|
+ //设置每日凌晨45分调用通知方法
|
|
|
|
+ @Scheduled(cron= "0 45 0 * * ?")
|
|
|
|
+ @Transactional(readOnly = false)
|
|
|
|
+ public void updateUserActivateType() {
|
|
|
|
+ logger.info("-----------测试员工的激活状态开始调整------------------");
|
|
|
|
+ User user = UserUtils.getByUserName("测试员工");
|
|
|
|
+ if(null != user && "1".equals(user.getLoginFlag()) && null!= user.getActivateDate()) {
|
|
|
|
+
|
|
|
|
+ Date now = new Date();
|
|
|
|
+
|
|
|
|
+ // 当前时间要晚于激活时间
|
|
|
|
+ if (now.after(user.getActivateDate())) {
|
|
|
|
+ // 计算激活时间 + 7 天
|
|
|
|
+ Calendar cal = Calendar.getInstance();
|
|
|
|
+ cal.setTime(user.getActivateDate());
|
|
|
|
+ cal.add(Calendar.DAY_OF_YEAR, 7);
|
|
|
|
+ Date sevenDaysLater = cal.getTime();
|
|
|
|
+
|
|
|
|
+ if (now.after(sevenDaysLater)) {
|
|
|
|
+ // ✅ 已超过 7 天,执行你的处理逻辑
|
|
|
|
+ System.out.println("激活时间已超过 7 天,处理用户:" + user.getUsername());
|
|
|
|
+ userService.updateUserLoginFlag(user.getId());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ logger.info("------------测试员工的激活状态开始调整------------------");
|
|
|
|
+ }
|
|
}
|
|
}
|