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