mirror of
https://github.com/weizhiqiang1995/erp-pro.git
synced 2025-01-19 13:48:31 +08:00
编码规则服务注册修改
This commit is contained in:
parent
d92d297fb0
commit
5939441a73
1 changed files with 5 additions and 0 deletions
|
@ -57,6 +57,8 @@ public class SkyeyeClassCodeRuleServiceImpl extends ServiceImpl<SkyeyeClassCodeR
|
|||
QueryWrapper<SkyeyeClassCodeRuleMation> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq(MybatisPlusUtil.toColumns(SkyeyeClassCodeRuleMation::getAppId), skyeyeClassCodeRuleApiMation.getAppId());
|
||||
List<SkyeyeClassCodeRuleMation> oldList = super.list(wrapper);
|
||||
Map<String, String> classNameToColeRuleId = oldList.stream()
|
||||
.collect(Collectors.toMap(SkyeyeClassCodeRuleMation::getClassName, SkyeyeClassCodeRuleMation::getCodeRuleId));
|
||||
List<String> oldKeys = oldList.stream().map(bean -> bean.getClassName() + bean.getGroupName() + bean.getServiceName()).collect(Collectors.toList());
|
||||
|
||||
// 获取入参的数据
|
||||
|
@ -84,6 +86,9 @@ public class SkyeyeClassCodeRuleServiceImpl extends ServiceImpl<SkyeyeClassCodeR
|
|||
List<SkyeyeClassCodeRuleMation> addBeans = classNameList.stream()
|
||||
.filter(item -> !oldKeys.contains(item.getClassName() + item.getGroupName() + item.getServiceName())).collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(addBeans)) {
|
||||
addBeans.forEach(bean -> {
|
||||
bean.setCodeRuleId(classNameToColeRuleId.get(bean.getClassName()));
|
||||
});
|
||||
saveBatch(addBeans);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue