Commit 95952712 by zhouhaibao

fix(strategy): 修正策略触发和任务确认逻辑

- 修正 actionConfirmDesc 的判断条件,从 -1 改为 0 来标识自动执行
- 调整任务确认状态的逻辑,将 actionConfirmType 为 0 时设置为待确认状态
- 在批量处理任务时添加去重逻辑,确保任务ID列表中的唯一性
1 parent cbdf8227
...@@ -170,7 +170,7 @@ public class SopStrategySnapshotCacheService { ...@@ -170,7 +170,7 @@ public class SopStrategySnapshotCacheService {
triggerInfo.put("triggerTime", triggerTime); triggerInfo.put("triggerTime", triggerTime);
triggerInfo.put("triggerTimeDesc", buildTriggerTimeDesc(strategy)); triggerInfo.put("triggerTimeDesc", buildTriggerTimeDesc(strategy));
triggerInfo.put("actionConfirmType", strategy.getActionConfirmType()); triggerInfo.put("actionConfirmType", strategy.getActionConfirmType());
triggerInfo.put("actionConfirmDesc", strategy.getActionConfirmType() == -1 ? "自动执行" : "需驻店人员确认"); triggerInfo.put("actionConfirmDesc", strategy.getActionConfirmType() == 0 ? "自动执行" : "需驻店人员确认");
List<Map<String, Object>> step2ConditionGroupsSnapshot = new ArrayList<>(); List<Map<String, Object>> step2ConditionGroupsSnapshot = new ArrayList<>();
for (SopStrategyConditionGroup group : step2ConditionGroups) { for (SopStrategyConditionGroup group : step2ConditionGroups) {
......
...@@ -157,7 +157,7 @@ public class SopStrategyTriggerService { ...@@ -157,7 +157,7 @@ public class SopStrategyTriggerService {
task.setTriggerTime(triggerTime); task.setTriggerTime(triggerTime);
task.setExecuteStatus(0); task.setExecuteStatus(0);
task.setConfirmStatus( task.setConfirmStatus(
strategy.getActionConfirmType() != null && strategy.getActionConfirmType() == 2 ? 0 : -1); strategy.getActionConfirmType() != null && strategy.getActionConfirmType() == 0 ? -1 : 0);
task.setSnapshotInfo(snapshotInfo); task.setSnapshotInfo(snapshotInfo);
task.setDeletedFlag("N"); task.setDeletedFlag("N");
task.setCreatedDate(new Date()); task.setCreatedDate(new Date());
......
...@@ -380,6 +380,7 @@ public class StrategySopService { ...@@ -380,6 +380,7 @@ public class StrategySopService {
} }
if (CollUtil.isNotEmpty(taskIds)) { if (CollUtil.isNotEmpty(taskIds)) {
taskIds=taskIds.stream().distinct().collect(Collectors.toList());
for (Integer taskId : taskIds) { for (Integer taskId : taskIds) {
confirmAndExecuteTask(taskId, confirmStatus, confirmReason); confirmAndExecuteTask(taskId, confirmStatus, confirmReason);
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!