修改定时更新

master
杜函宇 1 week ago
parent 49794f8c56
commit fee0e42d53

@ -19,14 +19,9 @@ import com.ruoyi.jjh.ent.entity.JContacts;
import com.ruoyi.jjh.ent.entity.JProject;
import com.ruoyi.jjh.ent.entity.JSmartDeclaration;
import com.ruoyi.jjh.ent.entity.JSmartReminders;
import com.ruoyi.jjh.ent.service.JContactsService;
import com.ruoyi.jjh.ent.service.JProjectService;
import com.ruoyi.jjh.ent.service.JSmartDeclarationService;
import com.ruoyi.jjh.ent.service.JSmartRemindersService;
import com.ruoyi.jjh.ent.service.SmsAlertsService;
import com.ruoyi.jjh.ent.service.*;
import com.ruoyi.quartz.service.ISysJobService;
import com.ruoyi.system.mapper.SysUserMapper;
import liquibase.pro.packaged.S;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
@ -144,20 +139,17 @@ public class TimeChange {
}
public void getTime(BmsTemplateRecord items) {
if (items.getIsTime() == 0) {
LocalDate currentDate = LocalDate.now();
LocalDate startDate = LocalDate.of(items.getStartTime().getYear(), items.getStartTime().getMonth(), items.getStartTime().getDayOfMonth());
LocalDate endDate = LocalDate.of(items.getEndTime().getYear(), items.getEndTime().getMonth(), items.getEndTime().getDayOfMonth());
LocalDate startDate = items.getStartTime();
LocalDate endDate = items.getEndTime();
if (currentDate.isBefore(startDate)) {
items.setStatus(0);
}
if (currentDate.isAfter(endDate)) {
items.setStatus(1);
}
if (currentDate.equals(startDate) || currentDate.equals(endDate)) {
items.setStatus(2);
items.setStatus(0); // 未开始
} else if (currentDate.isAfter(endDate)) {
items.setStatus(1); // 已结束
} else {
items.setStatus(2); // 进行中(包含在区间内和边界值)
}
if (currentDate.isAfter(startDate) && currentDate.isBefore(endDate)) {
items.setStatus(2);
}
}

Loading…
Cancel
Save