fix(87352): 文档拆分--更改权限应该增加数据权限
This commit is contained in:
+1
-1
@@ -85,7 +85,7 @@ public class DocumentSplitInfo extends BaseEntity {
|
|||||||
private String cut;
|
private String cut;
|
||||||
|
|
||||||
/**ids 搜索用*/
|
/**ids 搜索用*/
|
||||||
@ApiModelProperty(value = "标ids 搜索用")
|
@ApiModelProperty(value = "ids 搜索用")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String ids;
|
private String ids;
|
||||||
|
|
||||||
|
|||||||
+17
-6
@@ -227,15 +227,22 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
|||||||
LambdaUpdateWrapper<SarFileSplitInfoEO> updateWrapper = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<SarFileSplitInfoEO> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
List<String> ids;
|
List<String> ids;
|
||||||
// 获取id集合
|
// 获取id集合
|
||||||
if (StringUtils.isNotBlank(documentSplitInfo.getIds())){
|
ids = Arrays.asList(documentSplitInfo.getIds().split(","));
|
||||||
ids = Arrays.asList(documentSplitInfo.getIds().split(","));
|
|
||||||
}else {
|
|
||||||
List<DocumentSplitInfo> documentSplitInfos = queryByList(documentSplitInfo);
|
|
||||||
ids = documentSplitInfos.stream().map(DocumentSplitInfo::getId).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
// 水平越权
|
// 水平越权
|
||||||
isHorizontalOverstep(String.join(",", ids));
|
isHorizontalOverstep(String.join(",", ids));
|
||||||
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
if (!loginUser.getRoleIds().contains("admin")){
|
||||||
|
List<DocumentSplitInfo> documentSplitInfos = queryByList(documentSplitInfo);
|
||||||
|
long count = documentSplitInfos.stream().filter(v -> !loginUser.getId().equals(v.getAuthor())).count();
|
||||||
|
if (count > 0){
|
||||||
|
if(LanguageEnum.CN.equals(MessageUtils.getLanguage())) {
|
||||||
|
throw new JeroBootException("无权限!");
|
||||||
|
}else{
|
||||||
|
throw new JeroBootException("No access!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
updateWrapper.in(SarFileSplitInfoEO::getId, ids);
|
updateWrapper.in(SarFileSplitInfoEO::getId, ids);
|
||||||
SysUser sysUser = sysUserService.getById(documentSplitInfo.getCreateBy());
|
SysUser sysUser = sysUserService.getById(documentSplitInfo.getCreateBy());
|
||||||
@@ -1666,6 +1673,10 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
|||||||
private static QueryWrapper<SarFileSplitInfoEO> getSarFileSplitInfoEOQueryWrapper(DocumentSplitInfo documentSplitInfo) {
|
private static QueryWrapper<SarFileSplitInfoEO> getSarFileSplitInfoEOQueryWrapper(DocumentSplitInfo documentSplitInfo) {
|
||||||
QueryWrapper<SarFileSplitInfoEO> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<SarFileSplitInfoEO> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq(StringUtils.isNotBlank(documentSplitInfo.getId()), "id", documentSplitInfo.getId());
|
queryWrapper.eq(StringUtils.isNotBlank(documentSplitInfo.getId()), "id", documentSplitInfo.getId());
|
||||||
|
if (StringUtils.isNotBlank(documentSplitInfo.getIds())){
|
||||||
|
String[] ids = documentSplitInfo.getIds().split(",");
|
||||||
|
queryWrapper.in(StringUtils.isNotBlank(documentSplitInfo.getIds()), "id", Arrays.asList(ids));
|
||||||
|
}
|
||||||
// 标准编号/标准名称
|
// 标准编号/标准名称
|
||||||
if (StringUtils.isNotBlank(documentSplitInfo.getSerialNumberOrName())){
|
if (StringUtils.isNotBlank(documentSplitInfo.getSerialNumberOrName())){
|
||||||
queryWrapper.and(qw -> qw
|
queryWrapper.and(qw -> qw
|
||||||
|
|||||||
Reference in New Issue
Block a user