Commit dd30e768 by 李小龙

fix: 租户标识旧数据

parent 0c79878f
...@@ -54,6 +54,7 @@ public class PlatTenantDTOVO extends BaseIdDTO { ...@@ -54,6 +54,7 @@ public class PlatTenantDTOVO extends BaseIdDTO {
@ApiModelProperty(value = "菜单id集合") @ApiModelProperty(value = "菜单id集合")
private List<String> menuIdList; private List<String> menuIdList;
@Size(max = 20, message = "租户标识最长为20字符")
@ApiModelProperty(value = "租户标识") @ApiModelProperty(value = "租户标识")
private String code; private String code;
......
...@@ -431,15 +431,17 @@ public class PlatTenantServiceImpl extends ServiceImpl<PlatTenantMapper, PlatTen ...@@ -431,15 +431,17 @@ public class PlatTenantServiceImpl extends ServiceImpl<PlatTenantMapper, PlatTen
private void checkCode(PlatTenantDTOVO dto) { private void checkCode(PlatTenantDTOVO dto) {
PlatTenant tntTenant = getOne( List<PlatTenant> list = list(
new QueryWrapper<PlatTenant>().lambda() new QueryWrapper<PlatTenant>().lambda()
.eq(PlatTenant::getCode, dto.getCode()) .eq(PlatTenant::getCode, dto.getCode())
.ne(StringUtils.isNotBlank(dto.getId()), PlatTenant::getId, dto.getId()) .ne(StringUtils.isNotBlank(dto.getId()), PlatTenant::getId, dto.getId())
); );
for (PlatTenant platTenant : list) {
if (tntTenant != null && !tntTenant.getId().equals(dto.getId())) { if (platTenant != null && !platTenant.getId().equals(dto.getId())) {
throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR_TENANT_CODE_DUPLICATE); throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR_TENANT_CODE_DUPLICATE);
}
} }
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment