mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2026-05-01 01:21:28 +08:00
update 优化 以逗号拼接元素
This commit is contained in:
@@ -38,7 +38,7 @@ public class SysTenantPackageBo extends BaseEntity {
|
||||
/**
|
||||
* 关联菜单id
|
||||
*/
|
||||
@AutoMapping(target = "menuIds", expression = "java(org.dromara.common.core.utils.StringUtils.join(source.getMenuIds(), \",\"))")
|
||||
@AutoMapping(target = "menuIds", expression = "java(org.dromara.common.core.utils.StringUtils.joinComma(source.getMenuIds()))")
|
||||
private Long[] menuIds;
|
||||
|
||||
/**
|
||||
|
||||
@@ -111,7 +111,7 @@ public class SysClientServiceImpl implements ISysClientService {
|
||||
@Override
|
||||
public Boolean updateByBo(SysClientBo bo) {
|
||||
SysClient update = MapstructUtils.convert(bo, SysClient.class);
|
||||
update.setGrantType(String.join(",", bo.getGrantTypeList()));
|
||||
update.setGrantType(StringUtils.joinComma(bo.getGrantTypeList()));
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
||||
list.add(vo.getDeptName());
|
||||
}
|
||||
}
|
||||
return String.join(StringUtils.SEPARATOR, list);
|
||||
return StringUtils.joinComma(list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -88,11 +88,7 @@ public class SysTenantPackageServiceImpl implements ISysTenantPackageService {
|
||||
SysTenantPackage add = MapstructUtils.convert(bo, SysTenantPackage.class);
|
||||
// 保存菜单id
|
||||
List<Long> menuIds = Arrays.asList(bo.getMenuIds());
|
||||
if (CollUtil.isNotEmpty(menuIds)) {
|
||||
add.setMenuIds(StringUtils.join(menuIds, ", "));
|
||||
} else {
|
||||
add.setMenuIds("");
|
||||
}
|
||||
add.setMenuIds(CollUtil.isNotEmpty(menuIds) ? StringUtils.joinComma(menuIds) : "");
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setPackageId(add.getPackageId());
|
||||
@@ -109,11 +105,7 @@ public class SysTenantPackageServiceImpl implements ISysTenantPackageService {
|
||||
SysTenantPackage update = MapstructUtils.convert(bo, SysTenantPackage.class);
|
||||
// 保存菜单id
|
||||
List<Long> menuIds = Arrays.asList(bo.getMenuIds());
|
||||
if (CollUtil.isNotEmpty(menuIds)) {
|
||||
update.setMenuIds(StringUtils.join(menuIds, ", "));
|
||||
} else {
|
||||
update.setMenuIds("");
|
||||
}
|
||||
update.setMenuIds(CollUtil.isNotEmpty(menuIds) ? StringUtils.joinComma(menuIds) : "");
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -622,7 +622,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||
list.add(nickname);
|
||||
}
|
||||
}
|
||||
return String.join(StringUtils.SEPARATOR, list);
|
||||
return StringUtils.joinComma(list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user