Commit c3d1aa21 by liuyang

2024-08-29 文档库变更

parent 93f6895c
package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.iplat4j.core.ei.*;
......@@ -36,14 +38,26 @@ public class ServiceHGWD001D extends TreeService {
if (StringUtils.isEmpty(accountCode) || CommonConstant.Field.ADMIN.equals(accountCode)) {
map.put("label", "root");
map.put("text", "组织机构");
list.add(map);
} else {
Org org = HGXSTools.XsOrg.get(accountCode);
map.put("label", org == null ? "root" : org.getOrgId());
map.put("text", org == null ? "文档库" : org.getOrgCname());
//Org org = HGXSTools.XsOrg.get(accountCode);
List<HGSC001> hgsc001List = DaoBase.getInstance().query("HGSC001.query", new HashMap<String,String>(){{put("accountCode", accountCode);}}, 0, -999999);
//map.put("label", org == null ? "root" : org.getOrgId());
//map.put("text", org == null ? "文档库" : org.getOrgCname());
for (HGSC001 hgsc001 : hgsc001List) {
HashMap<String,String> hashMap = new HashMap<>();
hashMap.put("label", hgsc001.getProjCode());
hashMap.put("text", hgsc001.getProjName());
hashMap.put("projCode", hgsc001.getProjCode());
hashMap.put("projName", hgsc001.getProjName());
hashMap.put("type", "1");
hashMap.put("leaf", "0");
hashMap.put("leafLevel", "0");
hashMap.put("parentId", "0");
list.add(hashMap);
}
map.put("leaf", "0");
map.put("parent", "0");
list.add(map);
}
return list;
}
......@@ -57,27 +71,17 @@ public class ServiceHGWD001D extends TreeService {
// 非管理员仅查询所属企业用户 added by songx at 2024-01-16
queryMap.put("accountCode", LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())
? null : UserSessionUtils.getAccountCode());
List<Map> ret = new ArrayList<>();
if (parentLabel.indexOf("Q")==0){
queryMap.put("node", parentLabel);
ret = this.dao.query("XSOG01.queryOrganiation", queryMap, 0, -999999);
ret = ret.stream().filter(map -> map.get("type").equals(OrgTypeEnum.COMPANY.getCode())).collect(Collectors.toList());
}else {
queryMap.put("userId", LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())
? null : UserSessionUtils.getUserId());
ret = this.dao.query("HGWD001.queryOrganiation", queryMap, 0, -999999);
}
List<Map> ret = this.dao.query("HGWD001.queryOrganiation", queryMap, 0, -999999);
Map parentOrgMap = new HashMap();
String orgId;
for(int i = 0; i < ret.size(); ++i) {
Map org = (Map)ret.get(i);
if (parentLabel.indexOf("Q")==0){
orgId = (String)org.get("parentOrgId");
}else {
orgId = (String)org.get("parentId");
}
if (parentOrgMap.get(orgId) == null) {
parentOrgMap.put(orgId, new ArrayList());
}
......@@ -86,9 +90,11 @@ public class ServiceHGWD001D extends TreeService {
}
List result = (List)parentOrgMap.get(parentLabel);
if(CollectionUtils.isEmpty(result)){
return result;
}
for(int i = 0; i < result.size(); ++i) {
orgId = (String)((Map)result.get(i)).get("label");
String hasChild = parentOrgMap.get(orgId) != null ? "2" : "1";
......
......@@ -15,14 +15,6 @@ $(function () {
resultGrid.dataSource.page(1);
});
$("#QUERY_1").on("click", function (e) {
result1Grid.dataSource.page(1);
});
// 查询
$("#QUERY_2").on("click", function (e) {
result2Grid.dataSource.page(1);
});
// 分割线组件
(function () {
splitter = $("#splitter").kendoSplitter({
......@@ -137,17 +129,12 @@ $(function () {
// title = title + ' [岗位]';
icon = 'fa fa-user'
break;
case ' ':
case '1':
icon = 'fa fa-folder'
break;
case '10':
icon = 'fa fa-clipboard'
break;
case '20':
icon = 'fa fa-clipboard'
break;
default :
icon = 'fa fa-home'
icon = 'fa fa-clipboard'
//icon = 'fa fa-home'
}
}
return ' <span class="' + icon + '" style="padding-right: 8px"> </span> <span class="titleClass" title="' + item.label + '">' + title + '</span>'
......@@ -214,18 +201,10 @@ $(function () {
let leafLevel = parseInt($("#inqu_status-0-leafLevel").val())+1;
let type = $("#inqu_status-0-type").val();
if (null == parentId || "" === parentId) {
message2("文档库", "请在文档库树选择公司节点后编辑文档库");
message( "请在文档库树选择任意节点后新增文档库");
return
}
if (null == companyCode || "" === companyCode || "root" === companyCode) {
message2("文档库", "请在文档库树选择公司节点后编辑文档库");
return
}
if (leafLevel == 3) {
message2("文档库", "无法在当前节点新增");
return
}
if (type == "company"){
/*if (type == "company"){
let params = "&inqu_status-0-parentId=" + parentId+"&inqu_status-0-companyCode="+companyCode+"" +
"&inqu_status-0-projCode="+projCode+"&inqu_status-0-leafLevel="+leafLevel;
JSColorbox.open({
......@@ -235,8 +214,9 @@ $(function () {
height: "70%",
callbackName: addCallback
});
}else {
let params = "&inqu_status-0-parentId=" + parentId+"&inqu_status-0-companyCode="+companyCode+"" +
}*/
let params = "&inqu_status-0-parentId=" + parentId+ "" +
"&inqu_status-0-companyCode="+companyCode+"" +
"&inqu_status-0-projCode="+projCode+"&inqu_status-0-leafLevel="+leafLevel;
JSColorbox.open({
href: "HGWD001E?methodName=initLoad" + params,
......@@ -245,7 +225,7 @@ $(function () {
height: "70%",
callbackName: addCallback
});
}
})
/**
......@@ -316,27 +296,13 @@ $(function () {
let leafLevel = parseInt($("#inqu_status-0-leafLevel").val())+1;
let type = $("#inqu_status-0-type").val();
if (null == orgId || "" === orgId || "root" === orgId) {
message2("文档库", "请在文档库树选择公司节点后编辑文档库");
return
}
if (null == companyCode || "" === companyCode || "root" === companyCode) {
message2("文档库", "请在文档库树选择公司节点后编辑文档库");
message2("提示", "请在文档库树选择公司节点后编辑文档库");
return
}
if (leafLevel == 1) {
message2("文档库", "无法在当前节点编辑");
if (type == "1"){
message2("提示", "项目无法编辑!");
return
}
if (leafLevel == "2"){
let params = "&inqu_status-0-fileId="+orgId+"&inqu_status-0-companyCode="+companyCode+"&inqu_status-0-projCode="+projCode;
JSColorbox.open({
href: "HGWD001G?methodName=initLoad" + params,
title: "<div style='text-align: center;'>编辑项目</div>",
width: "70%",
height: "70%",
callbackName: addCallback
});
}else if (leafLevel == 3){
let params = "&inqu_status-0-fileId=" + orgId +"&inqu_status-0-companyCode="+companyCode+"&inqu_status-0-projCode="+projCode;
JSColorbox.open({
href: "HGWD001F?methodName=initLoad" + params,
......@@ -345,7 +311,16 @@ $(function () {
height: "70%",
callbackName: editCallback
});
}
/*if (leafLevel == "2"){
let params = "&inqu_status-0-fileId="+orgId+"&inqu_status-0-companyCode="+companyCode+"&inqu_status-0-projCode="+projCode;
JSColorbox.open({
href: "HGWD001G?methodName=initLoad" + params,
title: "<div style='text-align: center;'>编辑项目</div>",
width: "70%",
height: "70%",
callbackName: addCallback
});
}*/
})
......@@ -401,7 +376,7 @@ $(function () {
setTimeout(() => {
this.expandPath(['root']);
}, 1000)
}, 1000);
},
selectTreeNode: {},
// expandLevel:1,
......@@ -830,9 +805,13 @@ function showPreview() {
* @param id
*/
function uploadFile() {
let projCode =$("#inqu_status-0-projCode").val();
if (isBlank(projCode)){
message("请先选择项目!");
let lv = $("#inqu_status-0-leafLevel").val();
if (isBlank(lv)){
message("请选择文件节点!");
return;
}
if (lv === "0"){
message("当前节点不可上传附件!");
return;
}
JSColorbox.open({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment