部门视图查询默认职能部门优化,文件四级部门及以上优化
This commit is contained in:
parent
f1d2e47a93
commit
6bac744265
@ -266,6 +266,8 @@
|
|||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.treelist = this.$refs.tree.getCheckedKeys()
|
this.treelist = this.$refs.tree.getCheckedKeys()
|
||||||
this.treeListNodes = this.$refs.tree.getCheckedNodes();
|
this.treeListNodes = this.$refs.tree.getCheckedNodes();
|
||||||
|
this.selectdept = JSON.stringify(this.treelist)
|
||||||
|
this.leftTreedatabind();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -332,7 +334,6 @@
|
|||||||
created() {
|
created() {
|
||||||
this.rightTreedatabind();
|
this.rightTreedatabind();
|
||||||
this.setDefault();
|
this.setDefault();
|
||||||
this.leftTreedatabind();
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
filtertreeText(val){
|
filtertreeText(val){
|
||||||
|
|||||||
@ -1614,8 +1614,6 @@ public class DataViewService
|
|||||||
|
|
||||||
public String queryTermsDept(UserContext uc, RequestParams params) {
|
public String queryTermsDept(UserContext uc, RequestParams params) {
|
||||||
ResponseObject ro = ResponseObject.newOkResponse();
|
ResponseObject ro = ResponseObject.newOkResponse();
|
||||||
|
|
||||||
|
|
||||||
ArrayList<Map> currentLoginMaps = new ArrayList<>();
|
ArrayList<Map> currentLoginMaps = new ArrayList<>();
|
||||||
LinkedHashMap<String, Object> currentLoginMap = new LinkedHashMap<>();
|
LinkedHashMap<String, Object> currentLoginMap = new LinkedHashMap<>();
|
||||||
currentLoginMap = new LinkedHashMap<>();
|
currentLoginMap = new LinkedHashMap<>();
|
||||||
@ -1637,7 +1635,11 @@ public class DataViewService
|
|||||||
ro.put("personInfos", currentLoginMaps);
|
ro.put("personInfos", currentLoginMaps);
|
||||||
System.out.println("SDK.getPortalAPI().getUserPhoto(uc, uc.getUID()) = " + SDK.getPortalAPI().getUserPhoto(uc, uc.getUID()));
|
System.out.println("SDK.getPortalAPI().getUserPhoto(uc, uc.getUID()) = " + SDK.getPortalAPI().getUserPhoto(uc, uc.getUID()));
|
||||||
ro.put("userPhoto",SDK.getPortalAPI().getUserPhoto(uc, uc.getUID()));
|
ro.put("userPhoto",SDK.getPortalAPI().getUserPhoto(uc, uc.getUID()));
|
||||||
ro.put("departmentId",uc.getDepartmentModel().getId());
|
//获取前端默认查询部门ID,这里改成过去事业部ID或者职能部门(总部下二级部门)
|
||||||
|
DepartmentModel departmentModel = uc.getDepartmentModel();
|
||||||
|
String divisionDepartmentId = getDivisionDepartment(departmentModel);
|
||||||
|
System.out.println(">>>>>>>>>>>>getDivisionDepartment(departmentModel) = " + divisionDepartmentId);
|
||||||
|
ro.put("departmentId",divisionDepartmentId);
|
||||||
List<RowMap> deptMaps = DBSql.getMaps("SELECT ID,PARENTDEPARTMENTID,DEPARTMENTNAME,LAYER,ORDERINDEX FROM ORGDEPARTMENT WHERE COMPANYID='8911e732-b42a-4556-853f-ad32761bcbee' AND CLOSED='0' AND DEPARTMENTNAME NOT IN ('澳优','系统管理','项目开发人员部门','奶酪事业部','离退人员部门','集团领导')", new Object[0]);
|
List<RowMap> deptMaps = DBSql.getMaps("SELECT ID,PARENTDEPARTMENTID,DEPARTMENTNAME,LAYER,ORDERINDEX FROM ORGDEPARTMENT WHERE COMPANYID='8911e732-b42a-4556-853f-ad32761bcbee' AND CLOSED='0' AND DEPARTMENTNAME NOT IN ('澳优','系统管理','项目开发人员部门','奶酪事业部','离退人员部门','集团领导')", new Object[0]);
|
||||||
|
|
||||||
String nodeType = null;
|
String nodeType = null;
|
||||||
@ -2419,7 +2421,9 @@ public class DataViewService
|
|||||||
publishN.set("PUBLISTHTYPE", "N");
|
publishN.set("PUBLISTHTYPE", "N");
|
||||||
publishN.set("PUBLISHFILENAME", model.getName());
|
publishN.set("PUBLISHFILENAME", model.getName());
|
||||||
publishN.set("PUBLISHFILEID", plId);
|
publishN.set("PUBLISHFILEID", plId);
|
||||||
ProcessInstance processInstance = SDK.getProcessAPI().createProcessInstance("obj_a228b4816a7b4f58a862b9612299948c", "admin", "");
|
//获取发布流程组中运行中的流程
|
||||||
|
String processDefId = SDK.getRepositoryAPI().getProcessDefIdOfRelease("obj_fb1c7a54b98b412187388c8bab407362");
|
||||||
|
ProcessInstance processInstance = SDK.getProcessAPI().createProcessInstance(processDefId, "admin", "");
|
||||||
SDK.getBOAPI().create("BO_ACT_COE_PUBLISH_N", publishN, processInstance, me);
|
SDK.getBOAPI().create("BO_ACT_COE_PUBLISH_N", publishN, processInstance, me);
|
||||||
|
|
||||||
|
|
||||||
@ -2619,15 +2623,68 @@ public class DataViewService
|
|||||||
// 4. 部门过滤
|
// 4. 部门过滤
|
||||||
//没有查询文件名时,才过滤部门
|
//没有查询文件名时,才过滤部门
|
||||||
if(UtilString.isEmpty(filterTreeText)){
|
if(UtilString.isEmpty(filterTreeText)){
|
||||||
if(UtilString.isEmpty(deptString)){
|
if(UtilString.isEmpty(deptString) || deptString.equals("[]")){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
String[] deptArray = model.getExt6().split(",");
|
/*String[] deptArray = model.getExt6().split(",");
|
||||||
if (Arrays.stream(deptArray).noneMatch(deptString::contains)) {
|
if (Arrays.stream(deptArray).noneMatch(deptString::contains)) {
|
||||||
return false;
|
return false;
|
||||||
|
}*/
|
||||||
|
String[] deptArray = model.getExt6().split(",");
|
||||||
|
boolean flag = false;
|
||||||
|
for (String deptId : deptArray) {
|
||||||
|
DepartmentModel departmentModel = SDK.getORGAPI().getDepartmentById(deptId);
|
||||||
|
if(null != departmentModel){
|
||||||
|
deptId = getThirdLevelAndAboveDepartment(departmentModel);
|
||||||
|
System.out.println(">>>>>>>>>>>deptId = " + deptId);
|
||||||
|
if(deptString.contains(deptId)){
|
||||||
|
flag= true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return flag;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取事业部部门或者总部下二级部门(职能部门)
|
||||||
|
* @param departmentModel
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getDivisionDepartment(DepartmentModel departmentModel){
|
||||||
|
//先判断部门当前部门层级是不是一级,如果是一级事业部则返回,如果是二级总部下的也返回
|
||||||
|
int layer = departmentModel.getLayer();
|
||||||
|
String parentDepartmentId = departmentModel.getParentDepartmentId();
|
||||||
|
if(layer==1){//如果是一级,则直接返回
|
||||||
|
return departmentModel.getId();
|
||||||
|
}else if(layer==2){//如果是二级,先判断是否是总部下的二级部门
|
||||||
|
String headquartersDepartmentId = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.reportform", "headquartersDepartmentId");
|
||||||
|
if(parentDepartmentId.equals(headquartersDepartmentId)){
|
||||||
|
return departmentModel.getId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DepartmentModel parentDepartment = SDK.getORGAPI().getDepartmentById(parentDepartmentId);
|
||||||
|
return getDivisionDepartment(parentDepartment);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定部门到三级部门以下
|
||||||
|
* @param departmentModel
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getThirdLevelAndAboveDepartment(DepartmentModel departmentModel){
|
||||||
|
int layer = departmentModel.getLayer();
|
||||||
|
if(layer<=3){//如果部门层级小于等于3
|
||||||
|
return departmentModel.getId();
|
||||||
|
}else{//如果是三级以上,则获取父部门
|
||||||
|
String parentDepartmentId = departmentModel.getParentDepartmentId();
|
||||||
|
DepartmentModel parentDepartmentModel = SDK.getORGAPI().getDepartmentById(parentDepartmentId);
|
||||||
|
if(null!= parentDepartmentModel){
|
||||||
|
return getThirdLevelAndAboveDepartment(parentDepartmentModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return departmentModel.getId();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user