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