mirror of https://gitee.com/xiaonuobase/snowy
【更新】修复新增资源时code为空的问题
parent
36358d3c0c
commit
a29112f699
|
@ -15,6 +15,7 @@ package vip.xiaonuo.mobile.modular.resource.service.impl;
|
|||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollStreamUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
|
@ -85,7 +86,9 @@ public class MobileButtonServiceImpl extends ServiceImpl<MobileButtonMapper, Mob
|
|||
if(repeatCode) {
|
||||
throw new CommonException("存在重复的移动端按钮,编码为:{}", mobileButton.getCode());
|
||||
}
|
||||
mobileButton.setCategory(MobileResourceCategoryEnum.BUTTON.getValue());
|
||||
if(ObjectUtil.isEmpty(mobileButton.getCode())) {
|
||||
mobileButton.setCode(RandomUtil.randomString(10));
|
||||
}
|
||||
this.save(mobileButton);
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,9 @@ public class MobileMenuServiceImpl extends ServiceImpl<MobileMenuMapper, MobileM
|
|||
throw new CommonException("module与上级菜单不一致");
|
||||
}
|
||||
}
|
||||
mobileMenu.setCode(RandomUtil.randomString(10));
|
||||
if(ObjectUtil.isEmpty(mobileMenu.getCode())) {
|
||||
mobileMenu.setCode(RandomUtil.randomString(10));
|
||||
}
|
||||
mobileMenu.setCategory(MobileResourceCategoryEnum.MENU.getValue());
|
||||
this.save(mobileMenu);
|
||||
}
|
||||
|
|
|
@ -88,7 +88,9 @@ public class MobileModuleServiceImpl extends ServiceImpl<MobileModuleMapper, Mob
|
|||
if(ObjectUtil.isEmpty(mobileModule.getCode())){
|
||||
mobileModule.setCode(RandomUtil.randomString(10));
|
||||
}
|
||||
mobileModule.setCode(RandomUtil.randomString(10));
|
||||
if(ObjectUtil.isEmpty(mobileModule.getCode())) {
|
||||
mobileModule.setCode(RandomUtil.randomString(10));
|
||||
}
|
||||
mobileModule.setCategory(MobileResourceCategoryEnum.MODULE.getValue());
|
||||
this.save(mobileModule);
|
||||
}
|
||||
|
|
|
@ -97,7 +97,9 @@ public class SysButtonServiceImpl extends ServiceImpl<SysButtonMapper, SysButton
|
|||
if(repeatCode) {
|
||||
throw new CommonException("存在重复的按钮,编码为:{}", sysButton.getCode());
|
||||
}
|
||||
sysButton.setCode(RandomUtil.randomString(10));
|
||||
if(ObjectUtil.isEmpty(sysButton.getCode())) {
|
||||
sysButton.setCode(RandomUtil.randomString(10));
|
||||
}
|
||||
sysButton.setCategory(SysResourceCategoryEnum.BUTTON.getValue());
|
||||
this.save(sysButton);
|
||||
|
||||
|
|
|
@ -165,7 +165,9 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||
throw new CommonException("module与上级菜单不一致");
|
||||
}
|
||||
}
|
||||
sysMenu.setCode(RandomUtil.randomString(10));
|
||||
if(ObjectUtil.isEmpty(sysMenu.getCode())) {
|
||||
sysMenu.setCode(RandomUtil.randomString(10));
|
||||
}
|
||||
sysMenu.setCategory(SysResourceCategoryEnum.MENU.getValue());
|
||||
this.save(sysMenu);
|
||||
|
||||
|
|
|
@ -92,7 +92,9 @@ public class SysModuleServiceImpl extends ServiceImpl<SysModuleMapper, SysModule
|
|||
if(repeatTitle) {
|
||||
throw new CommonException("存在重复的模块,名称为:{}", sysModule.getTitle());
|
||||
}
|
||||
sysModule.setCode(RandomUtil.randomString(10));
|
||||
if(ObjectUtil.isEmpty(sysModule.getCode())) {
|
||||
sysModule.setCode(RandomUtil.randomString(10));
|
||||
}
|
||||
sysModule.setCategory(SysResourceCategoryEnum.MODULE.getValue());
|
||||
this.save(sysModule);
|
||||
// 发布增加事件
|
||||
|
|
Loading…
Reference in New Issue