Commit d1ba8736 authored by huyuchen's avatar huyuchen

菜单权限修改

parent 2ee4feb0
......@@ -55,8 +55,9 @@ public class SysUserPermissionVo extends RowIndex implements Serializable {
/**
* 权限类型
*/
@NotBlank(message = "权限类型 不能为空")
@Length(max = 8, message = "权限类型 不能超过8 个字符")
@ExcelAttribute(name = "权限类型", maxLength = 8)
@ExcelAttribute(name = "权限类型", isNotEmpty = true, errorInfo = "权限类型 不能为空", maxLength = 8)
@Schema(description = "权限类型")
@ExcelProperty("权限类型")
private String permissionType;
......
......@@ -67,7 +67,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
.eq(SysUserPermission::getEmpLoginName, user.getUsername())
.eq(SysUserPermission::getCode,sysUserPermission.getCode()).last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(permission)) {
return R.failed("只有自己有权限的权限类型才可新增");
return R.failed("操作人仅可对本账号有权限的数据新增账号");
}
}
if (CommonConstants.SIX_STRING.equals(sysUserPermission.getPermissionType())
......@@ -292,13 +292,24 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
insert.setPermissionType(typeMap.get(excel.getPermissionType()));
}
//部门权限的时候是否含下级必填
if (CommonConstants.EIGHT_STRING.equals(insert.getPermissionType()) && Common.isEmpty(excel.getIsContains())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "权限类型为部门权限时,是否含下级部门必填", excel));
continue;
}
//登录账号+维度+唯一标识唯一
StringBuilder flag = new StringBuilder();
flag.append(excel.getEmpLoginName());
flag.append("_");
flag.append(insert.getPermissionType());
flag.append("_");
if (CommonConstants.SIX_STRING.equals(insert.getPermissionType()) ||
CommonConstants.SEVEN_STRING.equals(insert.getPermissionType())) {
flag.append(excel.getName());
} else {
flag.append(excel.getCode());
}
if (null != uniqueMap.get(flag.toString())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "导表中已经存在该登录名对应的权限类型的名称或者编码!", excel));
continue;
......@@ -356,7 +367,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
.eq(SysUserPermission::getPermissionType, insert.getPermissionType())
.eq(SysUserPermission::getCode, excel.getCode()).last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(permission)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "只有自己有权限的权限类型才可导入", excel));
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "操作人仅可对本账号有权限的数据新增账号", excel));
continue;
}
}
......
......@@ -31,6 +31,12 @@ mybatis-plus:
spring:
application:
name: @artifactId@
servlet:
multipart:
#所有上传文件最大大小
max-request-size: 100MB
#单个文件最大大小
max-file-size: 50MB
#swagger 文档 https://springdoc.org/
### OpenAPI3 注解
# OpenAPI 3 注解位置
......
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 to comment