Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -109,12 +109,11 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
|
||||
|
||||
@Override
|
||||
public Boolean add(Long shopId, ShopUserAddDTO shopUserAddDTO) {
|
||||
long userCount = userInfoService.queryChain().eq(UserInfo::getId, shopUserAddDTO.getUserId()).count();
|
||||
if (userCount == 0) {
|
||||
throw new ApiNotPrintException("用户信息不存在");
|
||||
}
|
||||
long count = queryChain().eq(ShopUser::getShopId, shopId).eq(ShopUser::getUserId, shopUserAddDTO.getUserId()).count();
|
||||
if (count > 0) {
|
||||
UserInfo userInfo = userInfoService.queryChain().eq(UserInfo::getPhone, shopUserAddDTO.getPhone()).one();
|
||||
if (userInfo == null) {
|
||||
userInfo = BeanUtil.copyProperties(shopUserAddDTO, UserInfo.class);
|
||||
userInfoService.save(userInfo);
|
||||
}else {
|
||||
throw new ApiNotPrintException("此用户已存在");
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,15 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> imp
|
||||
return page(new Page<>(pageDTO.page(), pageDTO.size()), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getRoleMenu(long userId, Integer id) {
|
||||
SysRole role = queryChain().eq(SysRole::getId, id).eq(SysRole::getCreateUserId, userId).one();
|
||||
if (role == null) {
|
||||
throw new ApiNotPrintException("角色不存在");
|
||||
}
|
||||
return sysRolesMenusService.queryChain().eq(SysRolesMenus::getRoleId, id).list().stream().map(SysRolesMenus::getMenuId).toList();
|
||||
}
|
||||
|
||||
public boolean addMenu(Long roleId, List<Long> menuIds) {
|
||||
long count = sysMenuService.queryChain().in(SysMenu::getMenuId, menuIds).count();
|
||||
if (count != menuIds.size()) {
|
||||
|
||||
@@ -23,13 +23,15 @@ public class Main {
|
||||
// packageName 指定生成代码项目
|
||||
// tableName 指定需要生成的表
|
||||
|
||||
// String servicePackageName = "system";
|
||||
// String servicePackageName = "account";
|
||||
// String servicePackageName = "product";
|
||||
// String packageName = "system";
|
||||
String packageName = "account";
|
||||
// String packageName = "product";
|
||||
// String packageName = "order";
|
||||
|
||||
String tableName = "tb_shop_table";
|
||||
String author = "zs";
|
||||
String tableName = "tb_shop_coupon_product";
|
||||
String author = "ww";
|
||||
//是否生成DTO实体 默认生成
|
||||
boolean isGenerateDto = true;
|
||||
|
||||
//配置数据源
|
||||
HikariDataSource dataSource = new HikariDataSource();
|
||||
@@ -53,11 +55,13 @@ public class Main {
|
||||
serviceGenerator.generate();
|
||||
|
||||
//默认生成全参数DTO
|
||||
GlobalConfig dtoConfig = createDtoGlobalConfig(currentWorkingDirectory + "/cash-common/cash-common-service",
|
||||
basePackage + packageName, "tb", tableName);
|
||||
Generator dtoGenerator = new Generator(dataSource, dtoConfig);
|
||||
dtoConfig.setAuthor(author);
|
||||
dtoGenerator.generate();
|
||||
if(isGenerateDto){
|
||||
GlobalConfig dtoConfig = createDtoGlobalConfig(currentWorkingDirectory + "/cash-common/cash-common-service",
|
||||
basePackage + packageName, "tb", tableName);
|
||||
Generator dtoGenerator = new Generator(dataSource, dtoConfig);
|
||||
dtoConfig.setAuthor(author);
|
||||
dtoGenerator.generate();
|
||||
}
|
||||
}
|
||||
|
||||
public static GlobalConfig createGlobalConfigUseStyle(String projectPath, String packageName, String tablePrefix, String... tableNames) {
|
||||
|
||||
Reference in New Issue
Block a user