diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/eve/service/impl/SkyeyeClassCodeRuleServiceImpl.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/eve/service/impl/SkyeyeClassCodeRuleServiceImpl.java index 32a8affd..5f63c7d8 100644 --- a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/eve/service/impl/SkyeyeClassCodeRuleServiceImpl.java +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/eve/service/impl/SkyeyeClassCodeRuleServiceImpl.java @@ -79,10 +79,10 @@ public class SkyeyeClassCodeRuleServiceImpl extends ServiceImpl !newKeys.contains(item.getClassName() + item.getGroupName() + item.getServiceName())).collect(Collectors.toList()); if (!CollectionUtils.isEmpty(deleteBeans)) { List classNames = deleteBeans.stream().map(bean -> bean.getClassName()).collect(Collectors.toList()); - QueryWrapper deleteWrapper = new QueryWrapper<>(); + QueryWrapper deleteWrapper = new QueryWrapper<>(); deleteWrapper.eq(MybatisPlusUtil.toColumns(SkyeyeClassCodeRuleMation::getAppId), skyeyeClassCodeRuleApiMation.getAppId()); deleteWrapper.in(MybatisPlusUtil.toColumns(SkyeyeClassCodeRuleMation::getClassName), classNames); - remove(wrapper); + remove(deleteWrapper); } // (新数据 - 旧数据) 添加到数据库 diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/eve/service/impl/SkyeyeClassFlowableServiceImpl.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/eve/service/impl/SkyeyeClassFlowableServiceImpl.java index 4c7ada50..db26d3cc 100644 --- a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/eve/service/impl/SkyeyeClassFlowableServiceImpl.java +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/eve/service/impl/SkyeyeClassFlowableServiceImpl.java @@ -65,22 +65,22 @@ public class SkyeyeClassFlowableServiceImpl extends ServiceImpl newKeys = flowableServiceList.stream().map(bean -> bean.getClassName() + bean.getServiceName() + bean.getListenerClassStr()).collect(Collectors.toList()); - // (新数据 - 旧数据) 添加到数据库 - List addBeans = flowableServiceList.stream() - .filter(item -> !oldKeys.contains(item.getClassName() + item.getServiceName() + item.getListenerClassStr())).collect(Collectors.toList()); - if (!CollectionUtils.isEmpty(addBeans)) { - saveBatch(addBeans); - } - // (旧数据 - 新数据) 从数据库删除 List deleteBeans = oldList.stream() .filter(item -> !newKeys.contains(item.getClassName() + item.getServiceName() + item.getListenerClassStr())).collect(Collectors.toList()); if (!CollectionUtils.isEmpty(deleteBeans)) { List classNames = deleteBeans.stream().map(bean -> bean.getClassName()).collect(Collectors.toList()); - QueryWrapper deleteWrapper = new QueryWrapper<>(); + QueryWrapper deleteWrapper = new QueryWrapper<>(); deleteWrapper.eq(MybatisPlusUtil.toColumns(SkyeyeClassFlowableLinkMation::getAppId), skyeyeClassFlowableLinkApiMation.getAppId()); deleteWrapper.in(MybatisPlusUtil.toColumns(SkyeyeClassFlowableLinkMation::getClassName), classNames); - remove(wrapper); + remove(deleteWrapper); + } + + // (新数据 - 旧数据) 添加到数据库 + List addBeans = flowableServiceList.stream() + .filter(item -> !oldKeys.contains(item.getClassName() + item.getServiceName() + item.getListenerClassStr())).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(addBeans)) { + saveBatch(addBeans); } }