Merge branch 'dev'

This commit is contained in:
wangliwen 2022-12-05 15:26:22 +08:00
commit b5995b1d26
2 changed files with 47 additions and 12 deletions

View File

@ -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) { // 未进行过催办
LocalDate taskCreateDate = nowTask.get().getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
long between = ChronoUnit.DAYS.between(taskCreateDate, LocalDate.now());
if (between <= interval) {
logger.info("该任务未到允许催办的日期");
index.setAllowReminders(Boolean.FALSE); // 不允许催办
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
index.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数为
} else {
index.setAllowReminders(Boolean.TRUE); // 允许催办 index.setAllowReminders(Boolean.TRUE); // 允许催办
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录 index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
index.setNextRemindersDays(0); // 距离下次催办天数为0 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) { // 间隔天数小于限制天数

View File

@ -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) { // 未进行过催办
LocalDate taskCreateDate = nowTask.get().getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
long between = ChronoUnit.DAYS.between(taskCreateDate, LocalDate.now());
if (between <= interval) {
logger.info("该任务未到允许催办的日期");
index.setAllowReminders(Boolean.FALSE); // 不允许催办
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
index.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数为
} else {
index.setAllowReminders(Boolean.TRUE); // 允许催办 index.setAllowReminders(Boolean.TRUE); // 允许催办
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录 index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
index.setNextRemindersDays(0); // 距离下次催办天数为0 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) { // 最新流程未进行过催办
LocalDate taskCreateDate = nowTask.get().getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
long between = ChronoUnit.DAYS.between(taskCreateDate, LocalDate.now());
if (between <= interval) {
logger.info("该任务未到允许催办的日期");
index_.setAllowReminders(Boolean.FALSE); // 不允许催办
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); allowReminders.set(Boolean.TRUE);
doneReminders.set(Boolean.FALSE); doneReminders.set(Boolean.FALSE);
nextRemindersDays.set(0); nextRemindersDays.set(0);
index_.setAllowReminders(Boolean.TRUE); // 允许催办 index_.setAllowReminders(Boolean.TRUE); // 允许催办
index_.setDoneReminders(Boolean.FALSE); // 不存在催办记录 index_.setDoneReminders(Boolean.FALSE); // 不存在催办记录
index_.setNextRemindersDays(0); // 距离下次催办天数为0 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) { // 间隔天数小于限制天数