Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
platform
hg-smart
Commits
c3d1aa21
Commit
c3d1aa21
authored
Aug 30, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-08-29 文档库变更
parent
93f6895c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
72 deletions
+57
-72
ServiceHGWD001D.java
...java/com/baosight/hggp/hg/wd/service/ServiceHGWD001D.java
+27
-21
HGWD001.js
src/main/webapp/HG/WD/HGWD001.js
+30
-51
No files found.
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD001D.java
View file @
c3d1aa21
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
);
}
queryMap
.
put
(
"userId"
,
LoginUserDetails
.
isUserAdmin
(
UserSessionUtils
.
getLoginName
())
?
null
:
UserSessionUtils
.
getUserId
());
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"
);
}
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"
;
...
...
src/main/webapp/HG/WD/HGWD001.js
View file @
c3d1aa21
...
...
@@ -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
)
{
message
2
(
"文档库"
,
"请在文档库树选择公司节点后编辑
文档库"
);
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,18 +296,22 @@ $(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
:
"HGWD001F?methodName=initLoad"
+
params
,
title
:
"<div style='text-align: center;'>编辑文件</div>"
,
width
:
"70%"
,
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,
...
...
@@ -336,16 +320,7 @@ $(function () {
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
,
title
:
"<div style='text-align: center;'>编辑文件</div>"
,
width
:
"70%"
,
height
:
"70%"
,
callbackName
:
editCallback
});
}
}*/
})
...
...
@@ -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
({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment