fix(task): 修复任务流程查询中的重复数据问题
- 在 TaskFlowQueryExe 中添加按 step_id 去重逻辑 - 将 eqCurrentStep 字段更改为 eqStepId 以匹配业务逻辑 - 将 eqStatus 和 eqCurrentStep 的数据类型从 int 改为 Integer - 使用 LinkedHashMap 确保去重后的数据顺序保持一致master
parent
cfe6eacc50
commit
929cab9c05
|
|
@ -86,12 +86,16 @@ public class TaskFlowQueryExe {
|
|||
List<Long> taskIds = taskDOs.stream().map(EightworkTaskDO::getId).collect(Collectors.toList());
|
||||
|
||||
List<TaskFlowDO> flows = taskFlowRepository.list(new QueryWrapper<TaskFlowDO>()
|
||||
.select("DISTINCT step_id as step_id")
|
||||
.select("step_name")
|
||||
.select("group_name")
|
||||
.in("task_id", taskIds)
|
||||
.orderByAsc("step_order"));
|
||||
|
||||
// 按 step_id 去重
|
||||
Map<Long, TaskFlowDO> uniqueFlows = new LinkedHashMap<>();
|
||||
for (TaskFlowDO flow : flows) {
|
||||
uniqueFlows.putIfAbsent(flow.getStepId(), flow);
|
||||
}
|
||||
flows = new ArrayList<>(uniqueFlows.values());
|
||||
|
||||
// 转换为 CO
|
||||
List<TaskFlowCO> flowCOs = taskFlowCoConvertor.converDOsToCOs(flows);
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class TaskLogPageQry extends PageQuery {
|
|||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
private String eqWorkType;
|
||||
private int eqStatus;
|
||||
private int eqCurrentStep;
|
||||
private Integer eqStatus;
|
||||
private Integer eqStepId;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue