feat(文档拆分): 增加更改权限校验接口
This commit is contained in:
+15
@@ -134,6 +134,21 @@ public class DocumentSplitController {
|
|||||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更改权限校验
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "标准拆分-更改权限校验")
|
||||||
|
@ApiOperation(value="标准拆分-更改权限校验", notes="标准拆分-更改权限校验")
|
||||||
|
@GetMapping(value = "/updatePermissionsCheck")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
public Result<T> updatePermissionsCheck(String ids) {
|
||||||
|
documentSplitService.updatePermissionsCheck(ids);
|
||||||
|
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拆分
|
* 拆分
|
||||||
*
|
*
|
||||||
|
|||||||
+6
@@ -218,4 +218,10 @@ public interface IDocumentSplitService {
|
|||||||
* @param serialNumber
|
* @param serialNumber
|
||||||
*/
|
*/
|
||||||
void disposeItemVal(String isAsmsImport, String serialNumber);
|
void disposeItemVal(String isAsmsImport, String serialNumber);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档拆分-更改权限校验
|
||||||
|
* @param ids
|
||||||
|
*/
|
||||||
|
void updatePermissionsCheck(String ids);
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-12
@@ -217,18 +217,6 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
|||||||
|
|
||||||
// 水平越权
|
// 水平越权
|
||||||
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());
|
||||||
@@ -1390,6 +1378,24 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatePermissionsCheck(String ids) {
|
||||||
|
DocumentSplitInfo documentSplitInfo = new DocumentSplitInfo();
|
||||||
|
documentSplitInfo.setIds(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!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void manageData(Map<String, Object> resultMap, StringBuilder fieldsBuilder, List<String> valuesList) {
|
private void manageData(Map<String, Object> resultMap, StringBuilder fieldsBuilder, List<String> valuesList) {
|
||||||
// 所有key(字段名)
|
// 所有key(字段名)
|
||||||
resultMap.forEach((k, v) -> {
|
resultMap.forEach((k, v) -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user