fix: 81861 企标复审流程--强制撤回后,草稿中数据不正确
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.jero.common.aspect;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@@ -98,6 +99,13 @@ public class TranslationAspect {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动发起流程
|
||||
* 流程发起将数据翻译后保存为json以供强制撤回后使用
|
||||
* @param data
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
public String manualParseDictText(Object data, Object user) {
|
||||
List<SysDictItemCore> listDict = commonAPI.getDictItemAll();
|
||||
if (CollectionUtils.isEmpty(listDict)) {
|
||||
@@ -108,6 +116,40 @@ public class TranslationAspect {
|
||||
return dataJsonObject.toJSONString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动发起流程的
|
||||
* 流程发起将数据翻译后保存为json以供强制撤回后使用
|
||||
* @param data
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
public String autoParseDictText(Object data, Map<String, Object> user) {
|
||||
List<SysDictItemCore> listDict = commonAPI.getDictItemAll();
|
||||
if (CollectionUtils.isEmpty(listDict)) {
|
||||
return "";
|
||||
}
|
||||
JSONObject dataJsonObject = (JSONObject) translateObject(data, listDict);
|
||||
// 对人员进行翻译
|
||||
dataJsonObject.put("personnelObj", this.translateUser(user, listDict));
|
||||
return dataJsonObject.toJSONString();
|
||||
}
|
||||
|
||||
private Object translateUser(Map<String, Object> user, List<SysDictItemCore> listDict) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
for (Map.Entry<String, Object> entry : user.entrySet()) {
|
||||
String value = (String) entry.getValue();
|
||||
if (StrUtil.isBlank(value)) {
|
||||
continue;
|
||||
}
|
||||
String code = "id";
|
||||
String text = "CONCAT(realname, '(', username, ')')";
|
||||
String table = "sys_user";
|
||||
String textValue = translateDictValue(code, text, table, value, listDict);
|
||||
result.put(entry.getKey(), value);
|
||||
result.put(entry.getKey() + CommonConstant.DICT_TEXT_SUFFIX, textValue);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private Object translateObject(Object record, List<SysDictItemCore> listDict) {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
+2
-1
@@ -149,8 +149,9 @@ public class ProcessEsRecheckServiceImpl extends ServiceImpl<ProcessEsRecheckMap
|
||||
processNodeLinkService.saveNodeUserLink(processDefinitionId, processInstanceId, this.getUserMap(variables));
|
||||
// 获取第一个任务的taskId
|
||||
actFlowCommonService.getFirstTaskId(processInstanceId, userId, processDefinitionId);
|
||||
recheckData.setFlowUser(null);
|
||||
// 手动翻译
|
||||
String jsonData = translationAspect.manualParseDictText(recheckData, this.getUserMap(variables));
|
||||
String jsonData = translationAspect.autoParseDictText(recheckData, this.getUserMap(variables));
|
||||
// 强制撤回
|
||||
common.setProcessInstanceId(processInstanceId);
|
||||
actFlowCommonService.saveFirstNodeDraftCustomUserId(common, ProcessTypeEnum.ES_RECHECK, jsonData, userId);
|
||||
|
||||
+1
-1
@@ -130,7 +130,7 @@ public class ESRecheckPlanJob implements Job {
|
||||
Date recheckDate = recheckPlan.getRecheckDate();
|
||||
LocalDate recheckLocalDate = recheckDate.toInstant().atZone(ZoneId.of("Asia/Shanghai")).toLocalDate();
|
||||
LocalDate minusMonths = recheckLocalDate.minusMonths(1);
|
||||
if (recheckPlan.getInProcessFlag().equals(YesOrNoEnum.YES.getValue())) {
|
||||
if (YesOrNoEnum.YES.getValue().equals(recheckPlan.getInProcessFlag())) {
|
||||
// 已经发起过流程,不需要重复发起
|
||||
log.info("企标编号为{}的企标已经达到复审日期前一个月,但是已经发起过复审流程,无需重复发起", es.getStandardNumber());
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user