fix(bug): 临时提交

This commit is contained in:
yjz
2024-01-29 18:22:46 +08:00
parent 0ef4abeeee
commit 3d577f1fbe
2 changed files with 41 additions and 8 deletions
@@ -1,11 +1,7 @@
package com.jero.modules.activiti.process.esinspectrectify.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.modules.activiti.entity.ProcessAll;
import com.jero.modules.activiti.process.esinspectrectify.entity.ProcessEsInspectRectify;
import com.jero.modules.activiti.process.esinspectrectify.service.IProcessEsInspectRectifyService;
import com.jero.modules.activiti.service.WorkCenterService;
import com.jero.modules.activiti.util.SpringContextUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -27,10 +23,11 @@ public class EsInspectRectifyFlow implements WorkCenterService {
*/
@Override
public void changeToDraft(ProcessAll processAll) {
IProcessEsInspectRectifyService processEsInspectRectifyService = SpringContextUtil.getBean(IProcessEsInspectRectifyService.class);
// 删除业务表数据
processEsInspectRectifyService.remove(
new LambdaQueryWrapper<ProcessEsInspectRectify>()
.eq(ProcessEsInspectRectify::getProjectId, processAll.getProjectId()));
/** IProcessEsInspectRectifyService processEsInspectRectifyService = SpringContextUtil.getBean(IProcessEsInspectRectifyService.class);
* processEsInspectRectifyService.remove(
* new LambdaQueryWrapper<ProcessEsInspectRectify>()
* .eq(ProcessEsInspectRectify::getProjectId, processAll.getProjectId()));
*/
}
}
@@ -124,6 +124,42 @@ public class EsInspectRectifyFlowServiceImpl implements IEsInspectRectifyFlowSer
// 新增流程实例节点关联用户表
processNodeLinkService.saveNodeUserLink(processInstance.getProcessDefinitionId(), processInstance.getId(), listToString(map));
// 保存新草稿(强制撤回用)
saveDraft(esInspectReportFlowVO, processAll, processApprovalRecord);
}
private void saveDraft(EsInspectRectifyFlowVO esInspectReportFlowVO, ProcessAll processAll, ProcessApprovalRecord processApprovalRecord) {
ProcessDraft processDraft = new ProcessDraft();
// 属性拷贝
BeanUtils.copyProperties(processAll, processDraft);
processDraft.setCreateBy("");
processDraft.setId("");
processDraft.setUpdateBy("");
Date dateNow = new Date();
processDraft.setCreateTime(dateNow);
processDraft.setUpdateBy("");
processDraft.setUpdateTime(dateNow);
// 保存草稿表
if (StringUtils.isNotBlank(processApprovalRecord.getCommitFile())){
processDraft.setHandleFile(processApprovalRecord.getCommitFile());
}
if (StringUtils.isNotBlank(processApprovalRecord.getCommitText())){
processDraft.setHandleText(processApprovalRecord.getCommitText());
}
if (!Objects.isNull(processAll.getDueTime())){
processDraft.setProcessDueDate(processAll.getDueTime());
}
if (StringUtils.isNotBlank(processAll.getPrcMes())){
processDraft.setProcessDescription(processAll.getPrcMes());
}
if (StringUtils.isNotBlank(esInspectReportFlowVO.getInfoJsonStr())){
processDraft.setInfoJsonStr(esInspectReportFlowVO.getInfoJsonStr());
}
processDraft.setUserId(processApprovalRecord.getUserId());
processDraft.setId(String.valueOf(SnowflakeUtils.snowflake()).replaceFirst("\\{", "{\"revocation\": true,"));
processDraft.setSaveSource("3");
processDraftService.save(processDraft);
}
private void handleBusinessData(EsInspectRectifyFlowVO esInspectReportFlowVO) {