修改对外报告管理

This commit is contained in:
gaosong
2022-07-29 11:22:45 +08:00
parent bee93d3caa
commit c4dc1c8f9f
5 changed files with 68 additions and 29 deletions
@@ -46,12 +46,12 @@ public class ERFTreeData implements Comparable<ERFTreeData> {
/**
* 查看权限人员
*/
private String authView = "";
private String authViewIdsName = "";
/**
* 管理权限人员
*/
private String authManage = "";
private String authManageIdsName = "";
/**
* 查看权限人员id
@@ -135,20 +135,20 @@ public class ERFTreeData implements Comparable<ERFTreeData> {
this.folderName = folderName;
}
public String getAuthView() {
return authView;
public String getAuthViewIdsName() {
return authViewIdsName;
}
public void setAuthView(String authView) {
this.authView = authView;
public void setAuthViewIdsName(String authViewIdsName) {
this.authViewIdsName = authViewIdsName;
}
public String getAuthManage() {
return authManage;
public String getAuthManageIdsName() {
return authManageIdsName;
}
public void setAuthManage(String authManage) {
this.authManage = authManage;
public void setAuthManageIdsName(String authManageIdsName) {
this.authManageIdsName = authManageIdsName;
}
public String getAuthViewIds() {
@@ -76,12 +76,12 @@ public class ExtRepoFolder implements Serializable {
/**查看权限人员*/
@Excel(name = "查看权限人员", width = 15)
@ApiModelProperty(value = "查看权限人员")
private String authView;
private String authViewIdsName;
/**管理权限人员*/
@Excel(name = "管理权限人员", width = 15)
@ApiModelProperty(value = "管理权限人员")
private String authManage;
private String authManageIdsName;
/**查看权限人员id*/
@Excel(name = "查看权限人员id", width = 15)
@@ -11,9 +11,9 @@
<result column="folder_name" property="folderName" />
<result column="order_id" property="orderId" />
<result column="sup_folder" property="supFolder" />
<result column="auth_view" property="authView" />
<result column="auth_manage" property="authManage" />
<result column="auth_view_ids" property="authViewIds" />
<result column="auth_manage_ids" property="authManageIds" />
<result column="auth_view_ids_name" property="authViewIdsName" />
<result column="auth_manage_ids_name" property="authManageIdsName" />
<result column="auth_view_ids" property="authViewIdsName" />
<result column="auth_manage_ids" property="authManageIdsName" />
</resultMap>
</mapper>
@@ -53,9 +53,11 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
Date now = new Date();
extRepoFolder.setCreateTime(now);
extRepoFolder.setUpdateTime(now);
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
extRepoFolder.setAuthManage(extRepoFolder.getAuthManage() + "," + sysUser.getUsername());
extRepoFolder.setAuthManageIds(extRepoFolder.getAuthManageIds() + "," + sysUser.getId());
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// extRepoFolder.setAuthManageName(extRepoFolder.getAuthManageName() + "," + sysUser.getUsername());
// extRepoFolder.setAuthManageIds(extRepoFolder.getAuthManageIds() + "," + sysUser.getId());
extRepoFolder.setAuthManageIdsName(extRepoFolder.getAuthManageIdsName());
extRepoFolder.setAuthManageIds(extRepoFolder.getAuthManageIds());
save(extRepoFolder);
editOrderId(extRepoFolder);
} else {
@@ -120,16 +122,16 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
*/
private void editAuth(ExtRepoFolder erf_orig, ExtRepoFolder erf_new) throws Exception {
//管理权限
Map<String, String> authManage_orig = getAuthMap(erf_orig.getAuthManage(), erf_orig.getAuthManageIds());
Map<String, String> authManage_new = getAuthMap(erf_new.getAuthManage(), erf_new.getAuthManageIds());
Map<String, String> authManage_orig = getAuthMap(erf_orig.getAuthManageIdsName(), erf_orig.getAuthManageIds());
Map<String, String> authManage_new = getAuthMap(erf_new.getAuthManageIdsName(), erf_new.getAuthManageIds());
//增加管理权限的人
Map<String, String> addManageRole = getDefMap(authManage_new, authManage_orig);
//删除管理权限的人
Map<String, String> delManageRole = getDefMap(authManage_orig, authManage_new);
//查看权限
Map<String, String> authView_orig = getAuthMap(erf_orig.getAuthView(), erf_orig.getAuthViewIds());
Map<String, String> authView_new = getAuthMap(erf_new.getAuthView(), erf_new.getAuthViewIds());
Map<String, String> authView_orig = getAuthMap(erf_orig.getAuthViewIdsName(), erf_orig.getAuthViewIds());
Map<String, String> authView_new = getAuthMap(erf_new.getAuthViewIdsName(), erf_new.getAuthViewIds());
//增加查看权限的人
Map<String, String> addViewRole = getDefMap(authView_new, authView_orig);
//删除查看权限的人
@@ -140,8 +142,8 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
List<ExtRepoFolder> updateFolder = new ArrayList<ExtRepoFolder>();
for (ExtRepoFolder erf : allSubFolder) {
boolean isChange = false;
Map<String, String> authManage_erf = getAuthMap(erf.getAuthManage(), erf.getAuthManageIds());
Map<String, String> authView_erf = getAuthMap(erf.getAuthView(), erf.getAuthViewIds());
Map<String, String> authManage_erf = getAuthMap(erf.getAuthManageIdsName(), erf.getAuthManageIds());
Map<String, String> authView_erf = getAuthMap(erf.getAuthViewIdsName(), erf.getAuthViewIds());
for (String add : addManageRole.keySet()) {
if (!authManage_erf.keySet().contains(add)) {
authManage_erf.put(add, addManageRole.get(add));
@@ -169,9 +171,9 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
isChange = true;
}
}
erf.setAuthManage(StringUtils.join(authManage_erf.keySet(), ","));
erf.setAuthManageIdsName(StringUtils.join(authManage_erf.keySet(), ","));
erf.setAuthManageIds(StringUtils.join(authManage_erf.values(), ","));
erf.setAuthView(StringUtils.join(authView_erf.keySet(), ","));
erf.setAuthViewIdsName(StringUtils.join(authView_erf.keySet(), ","));
erf.setAuthViewIds(StringUtils.join(authView_erf.values(), ","));
if (isChange) {
updateFolder.add(erf);
@@ -291,9 +293,9 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
//检查有没有权限查看
date.setDisplay(haveViewAuth(erf.getSupFolder()));
int childLevel = date.getLevel() + 1;
date.setAuthManage(erf.getAuthManage());
date.setAuthManageIdsName(erf.getAuthManageIdsName());
date.setAuthManageIds(erf.getAuthManageIds());
date.setAuthView(erf.getAuthManage());
date.setAuthViewIdsName(erf.getAuthViewIdsName());
date.setAuthViewIds(erf.getAuthViewIds());
date.setChildren(getSubFolder(erf.getId(), list, childLevel));
date.sortChildren();