Commit c3d1aa21 by liuyang

2024-08-29 文档库变更

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