fix: 立项变更流程中保存到草稿报错
This commit is contained in:
+11
@@ -404,4 +404,15 @@ public class ActFlowCommonService {
|
||||
}
|
||||
return commonVO;
|
||||
}
|
||||
|
||||
public void removeDraft(CommonVO commonVO) {
|
||||
String userId = UserUtils.getUserId();
|
||||
String taskId = commonVO.getTaskId();
|
||||
String processInstanceId = commonVO.getProcessInstanceId();
|
||||
LambdaQueryWrapper<ProcessDraft> draftWrapper = new LambdaQueryWrapper<>();
|
||||
draftWrapper.eq(ProcessDraft::getUserId, userId);
|
||||
draftWrapper.eq(ProcessDraft::getTaskId, taskId);
|
||||
draftWrapper.eq(ProcessDraft::getProcessInstanceId, processInstanceId);
|
||||
processDraftService.remove(draftWrapper);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -98,7 +98,7 @@ public class ProcessESInitChangeController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存到待办
|
||||
* 草稿办理
|
||||
* @param draftId
|
||||
* @param projectId
|
||||
*/
|
||||
|
||||
+6
-4
@@ -204,6 +204,8 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
||||
actFlowCommonService.updateApprovalInfo(commonVO, taskId, pass);
|
||||
// 审批节点
|
||||
actFlowCommonService.completeTask(taskId, userId);
|
||||
// 删除草稿
|
||||
actFlowCommonService.removeDraft(commonVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -217,15 +219,15 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
||||
if (existDraft != null) {
|
||||
// 根据原来的businessId删除业务主表数据
|
||||
String businessId = existDraft.getProjectId();
|
||||
LambdaUpdateWrapper<ProcessEsInitChange> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(ProcessEsInitChange::getBusinessId, businessId);
|
||||
updateWrapper.set(ProcessEsInitChange::getDelFlag, YesOrNoEnum.YES.getValue());
|
||||
update(updateWrapper);
|
||||
LambdaQueryWrapper<ProcessEsInitChange> qWrapper = new LambdaQueryWrapper<>();
|
||||
qWrapper.eq(ProcessEsInitChange::getBusinessId, businessId);
|
||||
remove(qWrapper);
|
||||
}
|
||||
// 生成唯一的businessId
|
||||
String newBusinessId = actFlowCommonService.getNewBusinessId();
|
||||
// 新增业务表数据
|
||||
dataList.forEach(e -> e.setBusinessId(newBusinessId));
|
||||
dataList.forEach(e -> e.setId(null));
|
||||
saveBatch(dataList);
|
||||
// 新增草稿表数据
|
||||
actFlowCommonService.addDraft(commonVO, ProcessTypeEnum.ES_INIT_CHANGE, newBusinessId);
|
||||
|
||||
Reference in New Issue
Block a user