Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

caozj 2 лет назад
Родитель
Сommit
68fa9ac11d

+ 1 - 1
hx-flow/src/main/java/com/fjhx/flow/service/flow/impl/FlowExampleServiceImpl.java

@@ -233,7 +233,7 @@ public class FlowExampleServiceImpl extends ServiceImpl<FlowExampleMapper, FlowE
 
         // 父节点id map
         Map<Long, FlowDefinitionNode> flowDefinitionNodeMap = flowDefinitionNodeList.stream()
-                .collect(Collectors.toMap(FlowDefinitionNode::getParentId, Function.identity()));
+                .collect(Collectors.toMap(FlowDefinitionNode::getParentId, Function.identity(), (t1, t2) -> t2));
 
         FlowDefinitionNode nextNode = flowDefinitionNodeMap.get(definitionNodeId);
 

+ 9 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/service/BaseService.java

@@ -110,4 +110,13 @@ public interface BaseService<T extends BaseIdPo> extends IService<T> {
                 .stream().map(column).filter(Objects::nonNull).distinct().collect(Collectors.toList());
     }
 
+    /**
+     * 编辑关联表
+     */
+    default void editLinked(List<T> list, SFunction<T, Long> getMasterIdFun, Long masterId) {
+        List<Long> idList = list.stream().map(BaseIdPo::getId).filter(Objects::nonNull).collect(Collectors.toList());
+        remove(q -> q.eq(getMasterIdFun, masterId).notIn(ObjectUtil.isNotEmpty(idList), BaseIdPo::getId, idList));
+        saveOrUpdateBatch(list);
+    }
+
 }