ci: 删除数据后企标报错
This commit is contained in:
+2
-43
@@ -159,7 +159,8 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
|||||||
PartNameService partNameService,
|
PartNameService partNameService,
|
||||||
ILawsLabelDatabaseService lawsLabelDatabaseService,
|
ILawsLabelDatabaseService lawsLabelDatabaseService,
|
||||||
ISysBaseAPI sysBaseAPI,
|
ISysBaseAPI sysBaseAPI,
|
||||||
ISarFileSplitItemsValEOService sarFileSplitItemsValEOService, ISysDepartService sysDepartService) {
|
ISarFileSplitItemsValEOService sarFileSplitItemsValEOService,
|
||||||
|
ISysDepartService sysDepartService) {
|
||||||
this.documentSplitMapper = documentSplitMapper;
|
this.documentSplitMapper = documentSplitMapper;
|
||||||
this.sarFileSplitInfoService = sarFileSplitInfoService;
|
this.sarFileSplitInfoService = sarFileSplitInfoService;
|
||||||
this.lawsCommonMapper = lawsCommonMapper;
|
this.lawsCommonMapper = lawsCommonMapper;
|
||||||
@@ -494,48 +495,6 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
|||||||
// 有权限
|
// 有权限
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 等级分类
|
|
||||||
String gradeClassification = lawsEnterpriseStandard.getGradeClassification();
|
|
||||||
// 创建人可以看
|
|
||||||
if (sysUser.getUsername().equals(lawsEnterpriseStandard.getCreateBy())) {
|
|
||||||
// 有权限
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 全公司可以看
|
|
||||||
if ("1".equals(gradeClassification)) {
|
|
||||||
// 有权限
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 授权部门
|
|
||||||
if (!curAuthSet.isEmpty()) {
|
|
||||||
// 如果授权部门不等于0
|
|
||||||
if (curAuthSet.stream().map(EnterpriseStandardAuthDept::getAuthDept).anyMatch(departIds::contains)) {
|
|
||||||
// 有权限
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 企标等级分类级别可查看部门
|
|
||||||
if ("2".equals(gradeClassification)) {
|
|
||||||
if (levelOneDeptIds.stream().anyMatch(departIds::contains)) {
|
|
||||||
// 有权限
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ("3".equals(gradeClassification)) {
|
|
||||||
if (levelTwoDeptIds.stream().anyMatch(departIds::contains)) {
|
|
||||||
// 有权限
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ("4".equals(gradeClassification)) {
|
|
||||||
// 主起草部门有企标的查看权限
|
|
||||||
if (!departNames.isEmpty() && departNames.contains(lawsEnterpriseStandard.getMainDraftingUnit())) {
|
|
||||||
// 有权限
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 无权限
|
// 无权限
|
||||||
noAccess();
|
noAccess();
|
||||||
}
|
}
|
||||||
|
|||||||
-160
@@ -227,48 +227,12 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
|
|||||||
map.put(FieldCommon.DETAIL_FLAG, true);
|
map.put(FieldCommon.DETAIL_FLAG, true);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 等级分类
|
|
||||||
String gradeClassification = es.getGradeClassification();
|
|
||||||
// 创建人可以看
|
// 创建人可以看
|
||||||
if (userName.equals(creatUser)) {
|
if (userName.equals(creatUser)) {
|
||||||
map.put(FieldCommon.DETAIL_FLAG, true);
|
map.put(FieldCommon.DETAIL_FLAG, true);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 全公司可以看
|
|
||||||
if ("1".equals(gradeClassification)) {
|
|
||||||
map.put(FieldCommon.DETAIL_FLAG, true);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// 授权部门
|
|
||||||
if (!curAuthSet.isEmpty()) {
|
|
||||||
// 如果授权部门不等于0
|
|
||||||
if (curAuthSet.stream().map(EnterpriseStandardAuthDept::getAuthDept).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 ("4".equals(gradeClassification)) {
|
|
||||||
// 主起草部门有企标的查看权限
|
|
||||||
if (!departNames.isEmpty() && departNames.contains(mainDraftUnit)) {
|
|
||||||
// 设置为有权限
|
|
||||||
map.put(FieldCommon.DETAIL_FLAG, true);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
map.put(FieldCommon.DETAIL_FLAG, false);
|
map.put(FieldCommon.DETAIL_FLAG, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -351,42 +315,6 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
|
|||||||
map.put(FieldCommon.DETAIL_FLAG, true);
|
map.put(FieldCommon.DETAIL_FLAG, true);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 等级分类
|
|
||||||
String gradeClassification = es.getGradeClassification();
|
|
||||||
// 全公司可以看
|
|
||||||
if ("1".equals(gradeClassification)) {
|
|
||||||
map.put(FieldCommon.DETAIL_FLAG, true);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// 授权部门
|
|
||||||
if (!curAuthSet.isEmpty()) {
|
|
||||||
// 如果授权部门不等于0
|
|
||||||
if (curAuthSet.stream().map(EnterpriseStandardAuthDept::getAuthDept).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 ("4".equals(gradeClassification)) {
|
|
||||||
// 主起草部门有企标的查看权限
|
|
||||||
if (!departNames.isEmpty() && departNames.contains(mainDraftUnit)) {
|
|
||||||
// 全部设置为有权限
|
|
||||||
map.put(FieldCommon.DETAIL_FLAG, true);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
map.put(FieldCommon.DETAIL_FLAG, false);
|
map.put(FieldCommon.DETAIL_FLAG, false);
|
||||||
}
|
}
|
||||||
@@ -611,94 +539,6 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
|
|||||||
LawsEnterpriseStandard es = enterpriseStandardService.getOne(lambdaQueryWrapper);
|
LawsEnterpriseStandard es = enterpriseStandardService.getOne(lambdaQueryWrapper);
|
||||||
standardId = es.getId();
|
standardId = es.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询临时授权人员
|
|
||||||
Date date = new Date();
|
|
||||||
LambdaQueryWrapper<EnterpriseStandardAuthUser> authUserWrapper = new LambdaQueryWrapper<>();
|
|
||||||
authUserWrapper.eq(EnterpriseStandardAuthUser::getStandardId, standardId);
|
|
||||||
authUserWrapper.eq(EnterpriseStandardAuthUser::getAuthUser, userId);
|
|
||||||
authUserWrapper.ge(EnterpriseStandardAuthUser::getAuthExpireDate, date);
|
|
||||||
List<EnterpriseStandardAuthUser> authUserList = list(authUserWrapper);
|
|
||||||
Set<String> tempAuthStandardIds = authUserList.stream().map(EnterpriseStandardAuthUser::getStandardId).collect(Collectors.toSet());
|
|
||||||
// 查询临时授权部门
|
|
||||||
LambdaQueryWrapper<EnterpriseStandardAuthDept> tempAuthDeptWrapper = new LambdaQueryWrapper<>();
|
|
||||||
tempAuthDeptWrapper.eq(EnterpriseStandardAuthDept::getStandardId, standardId);
|
|
||||||
tempAuthDeptWrapper.in(CollUtil.isNotEmpty(departIds), EnterpriseStandardAuthDept::getAuthDept, departIds);
|
|
||||||
tempAuthDeptWrapper.isNotNull(EnterpriseStandardAuthDept::getAuthExpireDate);
|
|
||||||
tempAuthDeptWrapper.isNotNull(EnterpriseStandardAuthDept::getAuthDept);
|
|
||||||
List<EnterpriseStandardAuthDept> tempAuthDeptList = authDeptService.list(tempAuthDeptWrapper);
|
|
||||||
tempAuthDeptWrapper.ge(EnterpriseStandardAuthDept::getAuthExpireDate, date);
|
|
||||||
tempAuthDeptList.addAll(authDeptService.list(tempAuthDeptWrapper));
|
|
||||||
// 找出授权部门 和 临时授权部门
|
|
||||||
tempAuthStandardIds.addAll(tempAuthDeptList.stream().map(EnterpriseStandardAuthDept::getStandardId).collect(Collectors.toSet()));
|
|
||||||
|
|
||||||
// 查询授权部门
|
|
||||||
LambdaQueryWrapper<EnterpriseStandardAuthDept> authDeptWrapper = new LambdaQueryWrapper<>();
|
|
||||||
authDeptWrapper.eq(EnterpriseStandardAuthDept::getStandardId, standardId);
|
|
||||||
authDeptWrapper.isNull(EnterpriseStandardAuthDept::getAuthExpireDate);
|
|
||||||
List<EnterpriseStandardAuthDept> authDeptList = authDeptService.list(authDeptWrapper);
|
|
||||||
authDeptList.addAll(authDeptService.list(authDeptWrapper));
|
|
||||||
|
|
||||||
// 企标级别授权的部门
|
|
||||||
List<LawsEnterpriseStandardLevel> standardLevelList = standardLevelService.list();
|
|
||||||
List<LawsGrade> gradeList = gradeService.list();
|
|
||||||
Map<Integer, LawsGrade> gradeMap = gradeList.stream().collect(Collectors.toMap(LawsGrade::getLevel, e -> e));
|
|
||||||
|
|
||||||
List<String> levelOneDeptIds = standardLevelList.stream().filter(l -> l.getGradeId().equals(gradeMap.get(1).getId()))
|
|
||||||
.map(LawsEnterpriseStandardLevel::getDeptId).collect(Collectors.toList());
|
|
||||||
List<String> levelTwoDeptIds = standardLevelList.stream().filter(l -> l.getGradeId().equals(gradeMap.get(2).getId()))
|
|
||||||
.map(LawsEnterpriseStandardLevel::getDeptId).collect(Collectors.toList());
|
|
||||||
|
|
||||||
// 获取起草部门的Id
|
|
||||||
String finalStandardId = standardId;
|
|
||||||
LawsEnterpriseStandard es = enterpriseStandardService.getById(standardId);
|
|
||||||
String mainDraftUnit = es.getMainDraftingUnit();
|
|
||||||
Set<EnterpriseStandardAuthDept> curAuthSet = authDeptList.stream()
|
|
||||||
.filter(e -> e.getAuthDept() != null)
|
|
||||||
.filter(e -> StrUtil.isNotEmpty(e.getAuthDept()))
|
|
||||||
.filter(e -> e.getStandardId().equals(finalStandardId))
|
|
||||||
.filter(e -> !e.getAuthDept().equals(mainDraftUnit))
|
|
||||||
.collect(Collectors.toSet());
|
|
||||||
|
|
||||||
// 临时权限
|
|
||||||
if (tempAuthStandardIds.contains(standardId)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
// 等级分类
|
|
||||||
String gradeClassification = es.getGradeClassification();
|
|
||||||
String userName = currentUser.getUsername();
|
|
||||||
String creatUser = es.getCreateBy();
|
|
||||||
// 创建人可以看
|
|
||||||
if (userName.equals(creatUser)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
// 全公司可以看
|
|
||||||
if ("1".equals(gradeClassification)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
// 授权部门
|
|
||||||
if (!curAuthSet.isEmpty()) {
|
|
||||||
// 如果授权部门不等于0
|
|
||||||
if (curAuthSet.stream().map(EnterpriseStandardAuthDept::getAuthDept).anyMatch(departIds::contains)) {
|
|
||||||
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 ("4".equals(gradeClassification)) {
|
|
||||||
// 主起草部门有企标的查看权限
|
|
||||||
// 全部设置为有权限
|
|
||||||
return !departNames.isEmpty() && departNames.contains(mainDraftUnit);
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-7
@@ -114,13 +114,6 @@ public class LawsEnterpriseStandard implements Serializable {
|
|||||||
@ApiModelProperty(value = "企标英文名称")
|
@ApiModelProperty(value = "企标英文名称")
|
||||||
private String standardEnglishName;
|
private String standardEnglishName;
|
||||||
|
|
||||||
/**
|
|
||||||
* 标准等级分类
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "标准等级分类")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String gradeClassification;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发布日期
|
* 发布日期
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user