将事业部相关的代码修改为一级部门可查看

This commit is contained in:
Mr-wang 2023-09-26 11:32:09 +08:00
parent d1f387da69
commit 4dffe51987

View File

@ -34,6 +34,7 @@ import com.alibaba.fastjson.JSONObject;
import com.awspaas.user.apps.yili.reportform.util.GetNodesUtil;
import com.awspaas.user.apps.yili.reportform.util.TreeUtil;
import net.sf.json.JSONArray;
import org.springframework.util.StringUtils;
/**
* @author:Lizj
@ -1085,71 +1086,104 @@ public class DataViewService extends ActionWeb {
nodeRowMaps) {
String post = rowMap.getString("POST");
String role = rowMap.getString("ROLE");
if (role.contains(",")){
String[] split = role.split(",");
for (String rolw:
split) {
if (depaertName.contains(rolw)){
new_nodeRowMaps.add(rowMap);
break;
boolean role_flag = false;
boolean post_flag = false;
if (!StringUtils.isEmpty(role)){
if (role.contains(",")){
String[] split = role.split(",");
for (String rolw:
split) {
if (depaertName.contains(rolw)){
new_nodeRowMaps.add(rowMap);
role_flag = true;
break;
}
}
if (role_flag){
continue;
}
}else {
if (depaertName.contains(role)){
new_nodeRowMaps.add(rowMap);
continue;
}
}
}else {
if (depaertName.contains(role)){
new_nodeRowMaps.add(rowMap);
}
}
if (post.contains(",")){
String[] split = post.split(",");
for (String rolw:
split) {
if (depaertName.contains(rolw)){
new_nodeRowMaps.add(rowMap);
break;
if (!StringUtils.isEmpty(post)){
if (post.contains(",")){
String[] split = post.split(",");
for (String rolw:
split) {
if (depaertName.contains(rolw)){
new_nodeRowMaps.add(rowMap);
post_flag = true;
break;
}
}
if (post_flag){
continue;
}
}else {
if (depaertName.contains(post)){
new_nodeRowMaps.add(rowMap);
continue;
}
}
}else {
if (depaertName.contains(post)){
new_nodeRowMaps.add(rowMap);
}
}
}
System.out.println("new_nodeRowMaps>>>>>>>>>>>>>>>>>"+new_nodeRowMaps.size());
for (RowMap rowMap:
DepartnodeRowMaps) {
String post = rowMap.getString("POST");
String role = rowMap.getString("ROLE");
if (role.contains(",")){
String[] split = role.split(",");
for (String rolw:
split) {
if (depaertName.contains(rolw)){
new_DepartnodeRowMaps.add(rowMap);
break;
boolean role_flag = false;
boolean post_flag = false;
if (!StringUtils.isEmpty(role)){
if (role.contains(",")){
String[] split = role.split(",");
for (String rolw:
split) {
if (depaertName.contains(rolw)){
new_DepartnodeRowMaps.add(rowMap);
role_flag = true;
break;
}
}
if (role_flag){
continue;
}
}else {
if (depaertName.contains(role)){
new_DepartnodeRowMaps.add(rowMap);
continue;
}
}
}else {
if (depaertName.contains(role)){
new_DepartnodeRowMaps.add(rowMap);
}
}
if (post.contains(",")){
String[] split = post.split(",");
for (String rolw:
split) {
if (depaertName.contains(rolw)){
new_DepartnodeRowMaps.add(rowMap);
break;
if (!StringUtils.isEmpty(post)){
if (post.contains(",")){
String[] split = post.split(",");
for (String rolw:
split) {
if (depaertName.contains(rolw)){
new_DepartnodeRowMaps.add(rowMap);
post_flag = true;
break;
}
}
if (post_flag){
continue;
}
}else {
if (depaertName.contains(post)){
new_DepartnodeRowMaps.add(rowMap);
continue;
}
}
}else {
if (depaertName.contains(post)){
new_DepartnodeRowMaps.add(rowMap);
}
}
}
nodeRowMaps = new LinkedList<>();
for (RowMap rowMap:
new_nodeRowMaps) {
@ -1685,6 +1719,8 @@ public class DataViewService extends ActionWeb {
// 正式环境 伊利集团总部id 5c8e2d14-25a8-4baf-aa3a-344064007ef3
if (pathIdOfCache.contains("5c8e2d14-25a8-4baf-aa3a-344064007ef3")) {
ucDeptID = GetNodesUtil.getParentDept(ucDeptID, 2);
}else if (_uc.getDepartmentModel().getPathNameOfCache().contains("事业部")){
ucDeptID = GetNodesUtil.getParentDept(ucDeptID, 2);
}
deptIDList = new ArrayList<String>();
deptIDList = GetNodesUtil.getChildDept(ucDeptID, deptIDList);