|
|
@@ -111,7 +111,7 @@ public class ProcessInstanceServiceImpl implements ProcessInstanceService {
|
|
|
@Override
|
|
|
public PageResult<ProcessInstanceDTO> list(Long applicantId, Integer status, String definitionName, String currentNodeName, String applicantName, Integer pageNum, Integer pageSize) {
|
|
|
Page<ProcessInstance> page = new Page<>(pageNum, pageSize);
|
|
|
- this.processInstanceMapper.selectInstanceList(page, applicantId, status, definitionName, currentNodeName, applicantName);
|
|
|
+ this.processInstanceMapper.selectInstanceList(page, applicantId, status, definitionName, currentNodeName, applicantName, null);
|
|
|
List<ProcessInstanceDTO> records = this.enrichInstanceDtos(page.getRecords());
|
|
|
if (currentNodeName != null && !currentNodeName.isBlank()) {
|
|
|
records = records.stream()
|
|
|
@@ -595,10 +595,7 @@ public class ProcessInstanceServiceImpl implements ProcessInstanceService {
|
|
|
ProcessDefinition oldDef = this.processDefinitionMapper.selectById(oldDefinitionId);
|
|
|
ProcessDefinition newDef = this.processDefinitionMapper.selectById(targetDefinitionId);
|
|
|
if (oldDef == null || newDef == null) throw new BusinessException("流程定义不存在");
|
|
|
- if (!Objects.equals(oldDef.getProcessCode(), newDef.getProcessCode())) {
|
|
|
- throw new BusinessException("只能迁移到同一流程编码的不同版本");
|
|
|
- }
|
|
|
- // 匹配当前节点在新定义中的位置(按节点名称)
|
|
|
+ // 按节点名称匹配(不限制 process_code)
|
|
|
FlowModel oldModel = this.flowEngineService.parseModel(oldDef.getModelJson());
|
|
|
FlowModel newModel = this.flowEngineService.parseModel(newDef.getModelJson());
|
|
|
String currentNodeId = instance.getCurrentNodeId();
|
|
|
@@ -637,9 +634,6 @@ public class ProcessInstanceServiceImpl implements ProcessInstanceService {
|
|
|
ProcessDefinition oldDef = this.processDefinitionMapper.selectById(fromDefinitionId);
|
|
|
ProcessDefinition newDef = this.processDefinitionMapper.selectById(toDefinitionId);
|
|
|
if (oldDef == null || newDef == null) throw new BusinessException("流程定义不存在");
|
|
|
- if (!Objects.equals(oldDef.getProcessCode(), newDef.getProcessCode())) {
|
|
|
- throw new BusinessException("只能迁移到同一流程编码的不同版本");
|
|
|
- }
|
|
|
FlowModel oldModel = this.flowEngineService.parseModel(oldDef.getModelJson());
|
|
|
FlowModel newModel = this.flowEngineService.parseModel(newDef.getModelJson());
|
|
|
// 构建旧节点名 → 新节点ID映射
|