系统服务注册调整

This commit is contained in:
weizhiqiang 2022-10-16 13:00:00 +08:00
parent e4c3ccb623
commit 5c35597e46
2 changed files with 11 additions and 11 deletions

View file

@ -79,10 +79,10 @@ public class SkyeyeClassCodeRuleServiceImpl extends ServiceImpl<SkyeyeClassCodeR
.filter(item -> !newKeys.contains(item.getClassName() + item.getGroupName() + item.getServiceName())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(deleteBeans)) {
List<String> classNames = deleteBeans.stream().map(bean -> bean.getClassName()).collect(Collectors.toList());
QueryWrapper<SkyeyeClassCodeRuleApiMation> deleteWrapper = new QueryWrapper<>();
QueryWrapper<SkyeyeClassCodeRuleMation> deleteWrapper = new QueryWrapper<>();
deleteWrapper.eq(MybatisPlusUtil.toColumns(SkyeyeClassCodeRuleMation::getAppId), skyeyeClassCodeRuleApiMation.getAppId());
deleteWrapper.in(MybatisPlusUtil.toColumns(SkyeyeClassCodeRuleMation::getClassName), classNames);
remove(wrapper);
remove(deleteWrapper);
}
// (新数据 - 旧数据) 添加到数据库

View file

@ -65,22 +65,22 @@ public class SkyeyeClassFlowableServiceImpl extends ServiceImpl<SkyeyeClassFlowa
}
List<String> newKeys = flowableServiceList.stream().map(bean -> bean.getClassName() + bean.getServiceName() + bean.getListenerClassStr()).collect(Collectors.toList());
// (新数据 - 旧数据) 添加到数据库
List<SkyeyeClassFlowableLinkMation> addBeans = flowableServiceList.stream()
.filter(item -> !oldKeys.contains(item.getClassName() + item.getServiceName() + item.getListenerClassStr())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(addBeans)) {
saveBatch(addBeans);
}
// (旧数据 - 新数据) 从数据库删除
List<SkyeyeClassFlowableLinkMation> deleteBeans = oldList.stream()
.filter(item -> !newKeys.contains(item.getClassName() + item.getServiceName() + item.getListenerClassStr())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(deleteBeans)) {
List<String> classNames = deleteBeans.stream().map(bean -> bean.getClassName()).collect(Collectors.toList());
QueryWrapper<SkyeyeClassFlowableLinkApiMation> deleteWrapper = new QueryWrapper<>();
QueryWrapper<SkyeyeClassFlowableLinkMation> deleteWrapper = new QueryWrapper<>();
deleteWrapper.eq(MybatisPlusUtil.toColumns(SkyeyeClassFlowableLinkMation::getAppId), skyeyeClassFlowableLinkApiMation.getAppId());
deleteWrapper.in(MybatisPlusUtil.toColumns(SkyeyeClassFlowableLinkMation::getClassName), classNames);
remove(wrapper);
remove(deleteWrapper);
}
// (新数据 - 旧数据) 添加到数据库
List<SkyeyeClassFlowableLinkMation> addBeans = flowableServiceList.stream()
.filter(item -> !oldKeys.contains(item.getClassName() + item.getServiceName() + item.getListenerClassStr())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(addBeans)) {
saveBatch(addBeans);
}
}