fix: 77917
新增--新增数据,提示标准编号已存在
This commit is contained in:
+10
-3
@@ -61,6 +61,9 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
|
|||||||
@Resource
|
@Resource
|
||||||
private ISysRoleService sysRoleService;
|
private ISysRoleService sysRoleService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISysUserService sysUserRoleService;
|
||||||
|
|
||||||
// 注入draftDepartName
|
// 注入draftDepartName
|
||||||
@Value("${draftDepartName}")
|
@Value("${draftDepartName}")
|
||||||
private String draftDepartName;
|
private String draftDepartName;
|
||||||
@@ -169,7 +172,9 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
|
|||||||
// 只有创建人和管理员才有维护的权限
|
// 只有创建人和管理员才有维护的权限
|
||||||
String userId = UserUtils.getUserId();
|
String userId = UserUtils.getUserId();
|
||||||
SysUser currentUser = sysUserService.getById(userId);
|
SysUser currentUser = sysUserService.getById(userId);
|
||||||
if (currentUser.getRoleCode().equals(FieldCommon.ROLE_ADMIN)) {
|
// 获取当前用户的角色roleCode
|
||||||
|
List<String> roleList = sysUserRoleService.getRole(currentUser.getUsername());
|
||||||
|
if (roleList != null && roleList.contains(FieldCommon.ROLE_ADMIN)) {
|
||||||
records.forEach(kv -> kv.put(FieldCommon.EDIT_FLAG, true));
|
records.forEach(kv -> kv.put(FieldCommon.EDIT_FLAG, true));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -249,8 +254,10 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
|
|||||||
throw new JeroBootException(ResultCommon.EMPTY_COMMON, "ids不能为空");
|
throw new JeroBootException(ResultCommon.EMPTY_COMMON, "ids不能为空");
|
||||||
}
|
}
|
||||||
// 管理员有所有权限
|
// 管理员有所有权限
|
||||||
SysUser user = sysUserService.getById(userId);
|
SysUser currentUser = sysUserService.getById(userId);
|
||||||
if (user.getRoleCode().equals("admin")) {
|
// 获取当前用户的角色roleCode
|
||||||
|
List<String> roleList = sysUserRoleService.getRole(currentUser.getUsername());
|
||||||
|
if (roleList != null && roleList.contains(FieldCommon.ROLE_ADMIN)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// 创建人可以删除
|
// 创建人可以删除
|
||||||
|
|||||||
+1
-1
@@ -60,7 +60,7 @@ public class EnterpriseStandardUtil {
|
|||||||
.sorted()
|
.sorted()
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
int expectedNumber = 0; // 我们期望的最大序列号初始化为0
|
int expectedNumber = 1;
|
||||||
if (!sortedNumbers.isEmpty()) {
|
if (!sortedNumbers.isEmpty()) {
|
||||||
expectedNumber = sortedNumbers.get(sortedNumbers.size() - 1) + 1; // 获取最大的数字并+1
|
expectedNumber = sortedNumbers.get(sortedNumbers.size() - 1) + 1; // 获取最大的数字并+1
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user