fix: 81549 企标复审流程--试运行结束发起复审、三年定时发起复审,两个定时任务没有自动发起流程

This commit is contained in:
2024-02-04 14:04:42 +08:00
parent 593899f068
commit 1eaa2f788f
4 changed files with 22 additions and 11 deletions
@@ -153,7 +153,7 @@ public class ProcessEsRecheckServiceImpl extends ServiceImpl<ProcessEsRecheckMap
String jsonData = translationAspect.manualParseDictText(recheckData, this.getUserMap(variables));
// 强制撤回
common.setProcessInstanceId(processInstanceId);
actFlowCommonService.saveFirstNodeDraft(common, ProcessTypeEnum.ES_RECHECK, jsonData);
actFlowCommonService.saveFirstNodeDraftCustomUserId(common, ProcessTypeEnum.ES_RECHECK, jsonData, userId);
// 根据流程实例id更新流程总表
String prcName = common.getPrcName();
String prcMes = common.getPrcMes();
@@ -166,7 +166,7 @@ public class ProcessEsRecheckServiceImpl extends ServiceImpl<ProcessEsRecheckMap
Map<String, Object> actVariables = new HashMap<>();
for (Map.Entry<String, Object> entry : flowUser.entrySet()) {
String key = entry.getKey();
actVariables.put(key, entry.getValue());
actFlowCommonService.putIfNotNull(actVariables, key, entry.getValue());
}
return actVariables;
}
@@ -1,13 +1,16 @@
package com.jero.modules.laws.common.util;
import com.jero.common.system.vo.LoginUser;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.UnavailableSecurityManagerException;
/**
* @Author: liao
* @Date: 2023/10/26 16:55
* @Description: 当前用户工具类
*/
@Slf4j
public class CurrentUserUtil {
/**
@@ -75,8 +78,12 @@ public class CurrentUserUtil {
* @return
*/
public static LoginUser getLoginUser() {
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
return loginUser;
try {
return (LoginUser) SecurityUtils.getSubject().getPrincipal();
} catch (UnavailableSecurityManagerException e) {
log.warn("未找到当前登录人");
return null;
}
}
}
@@ -36,6 +36,9 @@ public class ESTrialEndRecheckJob implements Job {
@Resource
private ProcessEsRecheckService recheckService;
@Resource
private EnterpriseStandardRecheckPlanService recheckPlanService;
@Resource
private EnterpriseStandardRecheckPlanService esRecheckPlanService;
@@ -64,19 +67,18 @@ public class ESTrialEndRecheckJob implements Job {
expireStandards.add(es);
}
}
LambdaQueryWrapper<ProcessEsRecheck> recheckWrapper = new LambdaQueryWrapper<>();
recheckWrapper.in(ProcessEsRecheck::getStandardNumber,
LambdaQueryWrapper<EnterpriseStandardRecheckPlan> recheckWrapper = new LambdaQueryWrapper<>();
recheckWrapper.in(EnterpriseStandardRecheckPlan::getStandardNo,
expireStandards.stream().map(LawsEnterpriseStandard::getStandardNumber).collect(Collectors.toList()));
List<ProcessEsRecheck> recheckList = recheckService.list(recheckWrapper);
List<EnterpriseStandardRecheckPlan> recheckList = recheckPlanService.list(recheckWrapper);
if (recheckList != null && !recheckList.isEmpty()) {
// 找到已经发过复审流程的企标
List<String> recheckStandardNumbers = recheckList.stream().map(ProcessEsRecheck::getStandardNumber).collect(Collectors.toList());
// 将已经发过复审流程的企标从超出试用期的企标中移除
// 找到已经存在复审计划的企标
List<String> recheckStandardNumbers = recheckList.stream().map(EnterpriseStandardRecheckPlan::getStandardNo).collect(Collectors.toList());
// 将已经存在的企标从发起集合中移除
expireStandards = expireStandards.stream().filter(es -> !recheckStandardNumbers.contains(es.getStandardNumber())).collect(Collectors.toList());
}
// 发起复审流程
for (LawsEnterpriseStandard es : expireStandards) {
// 企标已经达到35个月,需要重新复审
EnterpriseStandardRecheckPlan recheckPlan = new EnterpriseStandardRecheckPlan();
recheckPlan.setStandardId(es.getId());
recheckPlan.setStandardNo(es.getStandardNumber());
@@ -71,6 +71,8 @@
<if test="param.mainDraftingUnit != null and param.mainDraftingUnit != ''">
AND s.main_drafting_unit = #{param.mainDraftingUnit}
</if>
GROUP BY
s.standard_number, p.create_time
ORDER BY
p.create_time DESC
</select>