从未催办过的任务 判断是否已超过预置天数
This commit is contained in:
parent
9e618c75cc
commit
7e332201c4
|
@ -46,6 +46,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.time.ZoneId;
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
@ -398,9 +399,18 @@ public class ActHistoryService {
|
||||||
if (nowTask.isPresent()) { // 存在正在进行的任务
|
if (nowTask.isPresent()) { // 存在正在进行的任务
|
||||||
LocalDate localDate = tRemindersService.selectRemindersTime(nowTask.get().getId());
|
LocalDate localDate = tRemindersService.selectRemindersTime(nowTask.get().getId());
|
||||||
if (localDate == null) { // 未进行过催办
|
if (localDate == null) { // 未进行过催办
|
||||||
index.setAllowReminders(Boolean.TRUE); // 允许催办
|
LocalDate taskCreateDate = nowTask.get().getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||||
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
|
long between = ChronoUnit.DAYS.between(taskCreateDate, LocalDate.now());
|
||||||
index.setNextRemindersDays(0); // 距离下次催办天数为0
|
if (between <= interval) {
|
||||||
|
logger.info("该任务未到允许催办的日期");
|
||||||
|
index.setAllowReminders(Boolean.FALSE); // 不允许催办
|
||||||
|
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
|
||||||
|
index.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数为
|
||||||
|
} else {
|
||||||
|
index.setAllowReminders(Boolean.TRUE); // 允许催办
|
||||||
|
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
|
||||||
|
index.setNextRemindersDays(0); // 距离下次催办天数为0
|
||||||
|
}
|
||||||
} else { // 进行过催办
|
} else { // 进行过催办
|
||||||
long between = ChronoUnit.DAYS.between(localDate, LocalDate.now()); // 上次催办距离今天已过天数
|
long between = ChronoUnit.DAYS.between(localDate, LocalDate.now()); // 上次催办距离今天已过天数
|
||||||
if (between <= interval) { // 间隔天数小于限制天数
|
if (between <= interval) { // 间隔天数小于限制天数
|
||||||
|
|
|
@ -60,6 +60,7 @@ import java.math.RoundingMode;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
@ -206,9 +207,21 @@ public class TAbilityApplicationController {
|
||||||
if (nowTask.isPresent()) { // 存在正在进行的任务
|
if (nowTask.isPresent()) { // 存在正在进行的任务
|
||||||
LocalDate localDate = tRemindersService.selectRemindersTime(nowTask.get().getId());
|
LocalDate localDate = tRemindersService.selectRemindersTime(nowTask.get().getId());
|
||||||
if (localDate == null) { // 未进行过催办
|
if (localDate == null) { // 未进行过催办
|
||||||
index.setAllowReminders(Boolean.TRUE); // 允许催办
|
LocalDate taskCreateDate = nowTask.get().getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||||
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
|
long between = ChronoUnit.DAYS.between(taskCreateDate, LocalDate.now());
|
||||||
index.setNextRemindersDays(0); // 距离下次催办天数为0
|
if (between <= interval) {
|
||||||
|
logger.info("该任务未到允许催办的日期");
|
||||||
|
index.setAllowReminders(Boolean.FALSE); // 不允许催办
|
||||||
|
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
|
||||||
|
index.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数为
|
||||||
|
} else {
|
||||||
|
index.setAllowReminders(Boolean.TRUE); // 允许催办
|
||||||
|
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
|
||||||
|
index.setNextRemindersDays(0); // 距离下次催办天数为0
|
||||||
|
}
|
||||||
|
// index.setAllowReminders(Boolean.TRUE); // 允许催办
|
||||||
|
// index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
|
||||||
|
// index.setNextRemindersDays(0); // 距离下次催办天数为0
|
||||||
} else { // 进行过催办
|
} else { // 进行过催办
|
||||||
long between = ChronoUnit.DAYS.between(localDate, LocalDate.now()); // 上次催办距离今天已过天数
|
long between = ChronoUnit.DAYS.between(localDate, LocalDate.now()); // 上次催办距离今天已过天数
|
||||||
if (between <= interval) { // 间隔天数小于限制天数
|
if (between <= interval) { // 间隔天数小于限制天数
|
||||||
|
@ -396,12 +409,24 @@ public class TAbilityApplicationController {
|
||||||
logger.info("该流程最新task:" + nowTask.get().getId());
|
logger.info("该流程最新task:" + nowTask.get().getId());
|
||||||
LocalDate localDate = tRemindersService.selectRemindersTime(nowTask.get().getId());
|
LocalDate localDate = tRemindersService.selectRemindersTime(nowTask.get().getId());
|
||||||
if (localDate == null) { // 最新流程未进行过催办
|
if (localDate == null) { // 最新流程未进行过催办
|
||||||
allowReminders.set(Boolean.TRUE);
|
LocalDate taskCreateDate = nowTask.get().getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||||
doneReminders.set(Boolean.FALSE);
|
long between = ChronoUnit.DAYS.between(taskCreateDate, LocalDate.now());
|
||||||
nextRemindersDays.set(0);
|
if (between <= interval) {
|
||||||
index_.setAllowReminders(Boolean.TRUE); // 允许催办
|
logger.info("该任务未到允许催办的日期");
|
||||||
index_.setDoneReminders(Boolean.FALSE); // 不存在催办记录
|
index_.setAllowReminders(Boolean.FALSE); // 不允许催办
|
||||||
index_.setNextRemindersDays(0); // 距离下次催办天数为0
|
index_.setDoneReminders(Boolean.FALSE); // 不存在催办记录
|
||||||
|
index_.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数为
|
||||||
|
allowReminders.set(Boolean.FALSE);
|
||||||
|
doneReminders.set(Boolean.FALSE);
|
||||||
|
nextRemindersDays.set((int) (interval - between));
|
||||||
|
} else {
|
||||||
|
allowReminders.set(Boolean.TRUE);
|
||||||
|
doneReminders.set(Boolean.FALSE);
|
||||||
|
nextRemindersDays.set(0);
|
||||||
|
index_.setAllowReminders(Boolean.TRUE); // 允许催办
|
||||||
|
index_.setDoneReminders(Boolean.FALSE); // 不存在催办记录
|
||||||
|
index_.setNextRemindersDays(0); // 距离下次催办天数为0
|
||||||
|
}
|
||||||
} else { // 进行过催办
|
} else { // 进行过催办
|
||||||
long between = ChronoUnit.DAYS.between(localDate, LocalDate.now()); // 上次催办距离今天已过天数
|
long between = ChronoUnit.DAYS.between(localDate, LocalDate.now()); // 上次催办距离今天已过天数
|
||||||
if (between <= interval) { // 间隔天数小于限制天数
|
if (between <= interval) { // 间隔天数小于限制天数
|
||||||
|
|
Loading…
Reference in New Issue