|
@@ -49,7 +49,8 @@ public class JobServiceImpl implements JobService {
|
|
@Transactional
|
|
@Transactional
|
|
public void flowTaskRemindTask() {
|
|
public void flowTaskRemindTask() {
|
|
log.info("flowTaskRemindTask is come in");
|
|
log.info("flowTaskRemindTask is come in");
|
|
- List<TSJobRemind> tsJobRemindList = tsJobRemindService.list(new QueryWrapper<TSJobRemind>().lambda().isNull(TSJobRemind::getExecTime));
|
|
|
|
|
|
+// List<TSJobRemind> tsJobRemindList = tsJobRemindService.list(new QueryWrapper<TSJobRemind>().lambda().isNull(TSJobRemind::getExecTime).last("limit 0,100"));
|
|
|
|
+ List<TSJobRemind> tsJobRemindList = tsJobRemindService.list(new QueryWrapper<TSJobRemind>().lambda().isNull(TSJobRemind::getExecTime).last("limit 0,100"));
|
|
if (!CollectionUtils.isEmpty(tsJobRemindList)) {
|
|
if (!CollectionUtils.isEmpty(tsJobRemindList)) {
|
|
List<TSJobRemind> tsJobRemindUpdateList = new ArrayList<>(tsJobRemindList.size());
|
|
List<TSJobRemind> tsJobRemindUpdateList = new ArrayList<>(tsJobRemindList.size());
|
|
List<Long> tsJobRemindIdList = new ArrayList<>(tsJobRemindList.size());
|
|
List<Long> tsJobRemindIdList = new ArrayList<>(tsJobRemindList.size());
|
|
@@ -59,7 +60,7 @@ public class JobServiceImpl implements JobService {
|
|
switch (t.getRemindType()) {
|
|
switch (t.getRemindType()) {
|
|
case BEFORE://提前提醒
|
|
case BEFORE://提前提醒
|
|
SysConfig sysConfigBefore = commonCacheService.addSysConfigCache(SystemConstant.FLOW_JOB_BEFORE_TIME);
|
|
SysConfig sysConfigBefore = commonCacheService.addSysConfigCache(SystemConstant.FLOW_JOB_BEFORE_TIME);
|
|
- Optional.ofNullable(sysConfigBefore).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("提前提醒任务时间未设置"));
|
|
|
|
|
|
+ Optional.ofNullable(sysConfigBefore).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程提前提醒任务时间未设置"));
|
|
Long execTime = SystemConstant.processMiniuteMinus(t.getCreateTime(), Duration.ofMinutes(Long.parseLong(sysConfigBefore.getConfigValue())));
|
|
Long execTime = SystemConstant.processMiniuteMinus(t.getCreateTime(), Duration.ofMinutes(Long.parseLong(sysConfigBefore.getConfigValue())));
|
|
if (Objects.nonNull(execTime) && execTime.longValue() < System.currentTimeMillis()) {
|
|
if (Objects.nonNull(execTime) && execTime.longValue() < System.currentTimeMillis()) {
|
|
t.setExecTime(execTime);
|
|
t.setExecTime(execTime);
|
|
@@ -69,7 +70,7 @@ public class JobServiceImpl implements JobService {
|
|
break;
|
|
break;
|
|
case AFTER://超时提醒
|
|
case AFTER://超时提醒
|
|
SysConfig sysConfigAfter = commonCacheService.addSysConfigCache(SystemConstant.FLOW_JOB_AFTER_TIME);
|
|
SysConfig sysConfigAfter = commonCacheService.addSysConfigCache(SystemConstant.FLOW_JOB_AFTER_TIME);
|
|
- Optional.ofNullable(sysConfigAfter).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("超时提醒任务时间未设置"));
|
|
|
|
|
|
+ Optional.ofNullable(sysConfigAfter).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程超时提醒任务时间未设置"));
|
|
execTime = SystemConstant.processMiniutePlus(t.getCreateTime(), Duration.ofMinutes(Long.parseLong(sysConfigAfter.getConfigValue())));
|
|
execTime = SystemConstant.processMiniutePlus(t.getCreateTime(), Duration.ofMinutes(Long.parseLong(sysConfigAfter.getConfigValue())));
|
|
if (Objects.nonNull(execTime) && execTime.longValue() > System.currentTimeMillis()) {
|
|
if (Objects.nonNull(execTime) && execTime.longValue() > System.currentTimeMillis()) {
|
|
t.setExecTime(execTime);
|
|
t.setExecTime(execTime);
|
|
@@ -81,7 +82,20 @@ public class JobServiceImpl implements JobService {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
} else if (t.getType() == JobQuartzTypeEnum.FLOW) {//通告
|
|
} else if (t.getType() == JobQuartzTypeEnum.FLOW) {//通告
|
|
-
|
|
|
|
|
|
+ switch(t.getRemindType()){
|
|
|
|
+ case AFTER://超时提醒
|
|
|
|
+ SysConfig sysConfigAfter = commonCacheService.addSysConfigCache(SystemConstant.NOTICE_JOB_AFTER_TIME);
|
|
|
|
+ Optional.ofNullable(sysConfigAfter).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("公告超时提醒任务时间未设置"));
|
|
|
|
+ Long execTime = SystemConstant.processMiniutePlus(t.getCreateTime(), Duration.ofMinutes(Long.parseLong(sysConfigAfter.getConfigValue())));
|
|
|
|
+ if (Objects.nonNull(execTime) && execTime.longValue() > System.currentTimeMillis()) {
|
|
|
|
+ t.setExecTime(execTime);
|
|
|
|
+ this.setJobTime(execTime, t.getId().toString(), t, RemindTaskJob.class, JobEnum.REMIND_QUARTZ_JOB_GROUP);
|
|
|
|
+ tsJobRemindUpdateList.add(t);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} else if (Objects.nonNull(t.getEnable()) && !t.getEnable()) {
|
|
} else if (Objects.nonNull(t.getEnable()) && !t.getEnable()) {
|
|
//禁用需删除定时任务
|
|
//禁用需删除定时任务
|