From 5c35597e466a7c525a919440e65e6dd68d2f1deb Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Sun, 16 Oct 2022 13:00:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=9C=8D=E5=8A=A1=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SkyeyeClassCodeRuleServiceImpl.java | 4 ++-- .../impl/SkyeyeClassFlowableServiceImpl.java | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) 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); } }