Commit 29171a9e by zhouhaibao

feat(strategy): 添加策略条件组序号功能

- 为策略条件组添加 groupSeq 字段用于排序
- 在创建策略条件组时自动生成递增序号
- 确保条件组按创建顺序进行编号管理
1 parent a4174677
...@@ -224,10 +224,12 @@ public class StrategySopService { ...@@ -224,10 +224,12 @@ public class StrategySopService {
if (CollUtil.isEmpty(conditionGroups)) { if (CollUtil.isEmpty(conditionGroups)) {
return; return;
} }
int groupNo = 1;
for (SopConditionGroupReqDTO groupReq : conditionGroups) { for (SopConditionGroupReqDTO groupReq : conditionGroups) {
SopStrategyConditionGroup group = BeanUtil.copyProperties(groupReq, SopStrategyConditionGroup.class); SopStrategyConditionGroup group = BeanUtil.copyProperties(groupReq, SopStrategyConditionGroup.class);
group.setStrategyId(strategyId); group.setStrategyId(strategyId);
group.setBranchId(null); group.setBranchId(null);
group.setGroupSeq(groupNo);
group.setStep(2); group.setStep(2);
group.setDeletedFlag(DeleteFlagEnum.N.getValue()); group.setDeletedFlag(DeleteFlagEnum.N.getValue());
group.setCreatedBy(createdBy); group.setCreatedBy(createdBy);
...@@ -236,6 +238,7 @@ public class StrategySopService { ...@@ -236,6 +238,7 @@ public class StrategySopService {
Integer groupId = group.getId(); Integer groupId = group.getId();
saveConditions(strategyId, null, groupId, groupReq.getConditions(), createdBy); saveConditions(strategyId, null, groupId, groupReq.getConditions(), createdBy);
groupNo++ ;
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!