fix: 80482 企业标准-选择标准等级分类,企标级别映射下的部门成员看不到此数据
This commit is contained in:
+1
-1
@@ -479,7 +479,7 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
|
|||||||
private String validProjectType(ProcessEsAnnualReport plan, List<SysDictItemCore> listDict, List<LawsEnterpriseStandard> esList) {
|
private String validProjectType(ProcessEsAnnualReport plan, List<SysDictItemCore> listDict, List<LawsEnterpriseStandard> esList) {
|
||||||
StringBuilder errMsg = new StringBuilder();
|
StringBuilder errMsg = new StringBuilder();
|
||||||
String projectType = plan.getProjectType();
|
String projectType = plan.getProjectType();
|
||||||
String originEnStandardNo = plan.getProjectType();
|
String originEnStandardNo = plan.getOriginEnStandardNo();
|
||||||
String newEnStandardName = plan.getNewEnStandardName();
|
String newEnStandardName = plan.getNewEnStandardName();
|
||||||
if (StrUtil.isBlank(projectType)) {
|
if (StrUtil.isBlank(projectType)) {
|
||||||
return "'制修订类型'不能为空。";
|
return "'制修订类型'不能为空。";
|
||||||
|
|||||||
+42
-43
@@ -44,13 +44,11 @@ import java.util.stream.Collectors;
|
|||||||
/**
|
/**
|
||||||
* @author ThinkBook
|
* @author ThinkBook
|
||||||
* @description 针对表【laws_enterprise_standard_temp_permission(企业标准)】的数据库操作Service实现
|
* @description 针对表【laws_enterprise_standard_temp_permission(企业标准)】的数据库操作Service实现
|
||||||
*
|
* <p>
|
||||||
* 权限这里分为三种权限
|
* 权限这里分为三种权限
|
||||||
* 1. 企标的查看权限 (管理员、创建人、这条企标主起草部门的其他员工、临时授权、授权部门)
|
* 1. 企标的查看权限 (管理员、创建人、这条企标主起草部门的其他员工、临时授权、授权部门)
|
||||||
* 2. 企标的编辑权限 (管理员、创建人)
|
* 2. 企标的编辑权限 (管理员、创建人)
|
||||||
* 3. 企标的删除权限 (管理员可以删除所有试用期的企标、创建人只可以删除自己创建的试用期内的企标)
|
* 3. 企标的删除权限 (管理员可以删除所有试用期的企标、创建人只可以删除自己创建的试用期内的企标)
|
||||||
*
|
|
||||||
*
|
|
||||||
* @createDate 2023-09-07 11:20:30
|
* @createDate 2023-09-07 11:20:30
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@@ -151,7 +149,7 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
|
|||||||
String userName = currentUser.getUsername();
|
String userName = currentUser.getUsername();
|
||||||
// 管理员有所有企标的权限
|
// 管理员有所有企标的权限
|
||||||
List<String> roleList = sysUserRoleService.getRole(currentUser.getUsername());
|
List<String> roleList = sysUserRoleService.getRole(currentUser.getUsername());
|
||||||
if (roleList != null && roleList.stream().anyMatch(adminRoleCodeList :: contains)) {
|
if (roleList != null && roleList.stream().anyMatch(adminRoleCodeList::contains)) {
|
||||||
records.forEach(kv -> kv.put(FieldCommon.DETAIL_FLAG, true));
|
records.forEach(kv -> kv.put(FieldCommon.DETAIL_FLAG, true));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -239,27 +237,26 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
|
|||||||
map.put(FieldCommon.DETAIL_FLAG, true);
|
map.put(FieldCommon.DETAIL_FLAG, true);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
// 企标等级分类级别可查看部门
|
// 企标等级分类级别可查看部门
|
||||||
if ("2".equals(gradeClassification)) {
|
if ("2".equals(gradeClassification)) {
|
||||||
if (levelOneDeptIds.stream().anyMatch(departIds::contains)) {
|
if (levelOneDeptIds.stream().anyMatch(departIds::contains)) {
|
||||||
map.put(FieldCommon.DETAIL_FLAG, true);
|
map.put(FieldCommon.DETAIL_FLAG, true);
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ("3".equals(gradeClassification)) {
|
}
|
||||||
if (levelTwoDeptIds.stream().anyMatch(departIds::contains)) {
|
if ("3".equals(gradeClassification)) {
|
||||||
map.put(FieldCommon.DETAIL_FLAG, true);
|
if (levelTwoDeptIds.stream().anyMatch(departIds::contains)) {
|
||||||
continue;
|
map.put(FieldCommon.DETAIL_FLAG, true);
|
||||||
}
|
continue;
|
||||||
}
|
}
|
||||||
if ("4".equals(gradeClassification)) {
|
}
|
||||||
// 主起草部门有企标的查看权限
|
if ("4".equals(gradeClassification)) {
|
||||||
if (!departNames.isEmpty() && departNames.contains(mainDraftUnit)) {
|
// 主起草部门有企标的查看权限
|
||||||
// 设置为有权限
|
if (!departNames.isEmpty() && departNames.contains(mainDraftUnit)) {
|
||||||
map.put(FieldCommon.DETAIL_FLAG, true);
|
// 设置为有权限
|
||||||
continue;
|
map.put(FieldCommon.DETAIL_FLAG, true);
|
||||||
}
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
map.put(FieldCommon.DETAIL_FLAG, false);
|
map.put(FieldCommon.DETAIL_FLAG, false);
|
||||||
@@ -271,7 +268,7 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
|
|||||||
SysUser currentUser = sysUserService.getById(userId);
|
SysUser currentUser = sysUserService.getById(userId);
|
||||||
// 管理员有所有企标的权限
|
// 管理员有所有企标的权限
|
||||||
List<String> roleList = sysUserRoleService.getRole(currentUser.getUsername());
|
List<String> roleList = sysUserRoleService.getRole(currentUser.getUsername());
|
||||||
if (roleList != null && roleList.stream().anyMatch(adminRoleCodeList :: contains)) {
|
if (roleList != null && roleList.stream().anyMatch(adminRoleCodeList::contains)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,7 +391,7 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
|
|||||||
String username = currentUser.getUsername();
|
String username = currentUser.getUsername();
|
||||||
// 获取当前用户的角色roleCode
|
// 获取当前用户的角色roleCode
|
||||||
List<String> roleList = sysUserRoleService.getRole(currentUser.getUsername());
|
List<String> roleList = sysUserRoleService.getRole(currentUser.getUsername());
|
||||||
if (roleList != null && roleList.stream().anyMatch(adminRoleCodeList :: contains)) {
|
if (roleList != null && roleList.stream().anyMatch(adminRoleCodeList::contains)) {
|
||||||
records.forEach(kv -> kv.put(FieldCommon.EDIT_FLAG, true));
|
records.forEach(kv -> kv.put(FieldCommon.EDIT_FLAG, true));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -431,7 +428,7 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
|
|||||||
// 获取当前用户的角色roleCode
|
// 获取当前用户的角色roleCode
|
||||||
List<String> roleList = sysUserRoleService.getRole(currentUser.getUsername());
|
List<String> roleList = sysUserRoleService.getRole(currentUser.getUsername());
|
||||||
// 管理员能够删除所有试用期的企标
|
// 管理员能够删除所有试用期的企标
|
||||||
if (roleList != null && roleList.stream().anyMatch(adminRoleCodeList :: contains)) {
|
if (roleList != null && roleList.stream().anyMatch(adminRoleCodeList::contains)) {
|
||||||
for (Map<String, Object> map : records) {
|
for (Map<String, Object> map : records) {
|
||||||
String tryFlag = String.valueOf(map.get(FieldCommon.TRY_FLAG));
|
String tryFlag = String.valueOf(map.get(FieldCommon.TRY_FLAG));
|
||||||
if (tryFlag.equals(YesOrNoEnum.NO.getValue())) {
|
if (tryFlag.equals(YesOrNoEnum.NO.getValue())) {
|
||||||
@@ -480,7 +477,7 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
|
|||||||
calendar.add(Calendar.MONTH, trialPeriodMonths); // 将试用周期加到发布日期上
|
calendar.add(Calendar.MONTH, trialPeriodMonths); // 将试用周期加到发布日期上
|
||||||
Date trialEndDate = calendar.getTime(); // 获取试用期结束日期
|
Date trialEndDate = calendar.getTime(); // 获取试用期结束日期
|
||||||
if (username.equals(createBy) && tryFlag.equals(YesOrNoEnum.YES.getValue())
|
if (username.equals(createBy) && tryFlag.equals(YesOrNoEnum.YES.getValue())
|
||||||
&& currentDate.compareTo(trialEndDate) <= 0 ) {
|
&& currentDate.compareTo(trialEndDate) <= 0) {
|
||||||
map.put(FieldCommon.DEL_FLAG, true);
|
map.put(FieldCommon.DEL_FLAG, true);
|
||||||
} else {
|
} else {
|
||||||
map.put(FieldCommon.DEL_FLAG, false);
|
map.put(FieldCommon.DEL_FLAG, false);
|
||||||
@@ -503,7 +500,7 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
|
|||||||
SysUser currentUser = sysUserService.getById(userId);
|
SysUser currentUser = sysUserService.getById(userId);
|
||||||
// 管理员有所有企标的权限
|
// 管理员有所有企标的权限
|
||||||
List<String> roleList = sysUserRoleService.getRole(currentUser.getUsername());
|
List<String> roleList = sysUserRoleService.getRole(currentUser.getUsername());
|
||||||
if (roleList != null && roleList.stream().anyMatch(adminRoleCodeList :: contains)) {
|
if (roleList != null && roleList.stream().anyMatch(adminRoleCodeList::contains)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -588,30 +585,32 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
|
|||||||
// 授权部门
|
// 授权部门
|
||||||
if (!curAuthSet.isEmpty()) {
|
if (!curAuthSet.isEmpty()) {
|
||||||
// 如果授权部门不等于0
|
// 如果授权部门不等于0
|
||||||
return curAuthSet.stream().map(EnterpriseStandardAuthDept::getAuthDept).anyMatch(departIds::contains);
|
if (curAuthSet.stream().map(EnterpriseStandardAuthDept::getAuthDept).anyMatch(departIds::contains)) {
|
||||||
} else {
|
return true;
|
||||||
// 企标等级分类级别可查看部门
|
|
||||||
if ("2".equals(gradeClassification)) {
|
|
||||||
if (levelOneDeptIds.stream().anyMatch(departIds::contains)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ("3".equals(gradeClassification)) {
|
}
|
||||||
if (levelTwoDeptIds.stream().anyMatch(departIds::contains)) {
|
// 企标等级分类级别可查看部门
|
||||||
return true;
|
if ("2".equals(gradeClassification)) {
|
||||||
}
|
if (levelOneDeptIds.stream().anyMatch(departIds::contains)) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
if ("4".equals(gradeClassification)) {
|
}
|
||||||
// 主起草部门有企标的查看权限
|
if ("3".equals(gradeClassification)) {
|
||||||
// 全部设置为有权限
|
if (levelTwoDeptIds.stream().anyMatch(departIds::contains)) {
|
||||||
return !departNames.isEmpty() && departNames.contains(mainDraftUnit);
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ("4".equals(gradeClassification)) {
|
||||||
|
// 主起草部门有企标的查看权限
|
||||||
|
// 全部设置为有权限
|
||||||
|
return !departNames.isEmpty() && departNames.contains(mainDraftUnit);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验用户是否有删除权限
|
* 校验用户是否有删除权限
|
||||||
|
*
|
||||||
* @param ids
|
* @param ids
|
||||||
* @param userId
|
* @param userId
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
Reference in New Issue
Block a user