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
8f6dbc4e
Commit
8f6dbc4e
authored
Nov 11, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fixBug-sx' of
http://129.211.46.84:8800/platform/hg-smart
into dev
parents
27e7deb4
e864d2a4
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
186 additions
and
69 deletions
+186
-69
ProjectSourceEnum.java
...java/com/baosight/hggp/hg/sc/enums/ProjectSourceEnum.java
+1
-1
HgWdSqlConstant.java
...ava/com/baosight/hggp/hg/wd/constant/HgWdSqlConstant.java
+4
-0
ServiceHGWD001D.java
...java/com/baosight/hggp/hg/wd/service/ServiceHGWD001D.java
+54
-21
ServiceHGWD003B.java
...java/com/baosight/hggp/hg/wd/service/ServiceHGWD003B.java
+1
-1
ServiceHGWD099.java
.../java/com/baosight/hggp/hg/wd/service/ServiceHGWD099.java
+13
-9
HGWD001.xml
src/main/java/com/baosight/hggp/hg/wd/sql/HGWD001.xml
+36
-32
HGWDTools.java
src/main/java/com/baosight/hggp/hg/wd/tools/HGWDTools.java
+28
-0
HgWdUtils.java
src/main/java/com/baosight/hggp/hg/wd/utils/HgWdUtils.java
+48
-4
HGWD001.js
src/main/webapp/HG/WD/HGWD001.js
+1
-1
No files found.
src/main/java/com/baosight/hggp/hg/sc/enums/ProjectSourceEnum.java
View file @
8f6dbc4e
...
...
@@ -7,7 +7,7 @@ package com.baosight.hggp.hg.sc.enums;
public
enum
ProjectSourceEnum
{
ENGINEERING
(
"engineering"
,
"工程设计图"
),
FOREIGN
(
"foreign"
,
"
生产
制造图"
),
FOREIGN
(
"foreign"
,
"
工程
制造图"
),
SPARE
(
"spare"
,
"备件制造图"
),
OTHER
(
"other"
,
"其他"
),
;
...
...
src/main/java/com/baosight/hggp/hg/wd/constant/HgWdSqlConstant.java
View file @
8f6dbc4e
...
...
@@ -26,6 +26,10 @@ public class HgWdSqlConstant {
public
static
final
String
QUERY_ALL
=
"HGWD001.queryAll"
;
// 查询子节点
public
static
final
String
QUERY_FILE_CHILD
=
"HGWD001.queryFileChild"
;
// 查询子节点
public
static
final
String
QUERY_CHILDREN
=
"HGWD001.queryChildren"
;
// 查询项目来源
public
static
final
String
QUERY_PROJECT_SOURCE
=
"HGWD001.queryProjectSource"
;
public
static
final
String
UPDATE_FILE_PATH
=
"HGWD001.updateFilePath"
;
}
...
...
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD001D.java
View file @
8f6dbc4e
...
...
@@ -9,6 +9,7 @@ import com.baosight.hggp.hg.sc.domain.HGSC001;
import
com.baosight.hggp.hg.sc.enums.ProjectSourceEnum
;
import
com.baosight.hggp.hg.sc.tools.HGSCTools
;
import
com.baosight.hggp.hg.wd.constant.HgWdConstant
;
import
com.baosight.hggp.hg.wd.constant.HgWdSqlConstant
;
import
com.baosight.hggp.hg.wd.domain.HGWD001
;
import
com.baosight.hggp.hg.wd.domain.HGWD003
;
import
com.baosight.hggp.hg.wd.domain.HGWD099
;
...
...
@@ -30,7 +31,12 @@ import com.baosight.xservices.xs.util.LoginUserDetails;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.util.CollectionUtils
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -237,25 +243,46 @@ public class ServiceHGWD001D extends TreeService {
*/
public
List
queryTopNode
(
String
parentId
)
{
List
<
Map
>
results
=
new
ArrayList
();
// 管理员不做限制
boolean
isManager
=
HgWdUtils
.
HgWd009
.
isManager
();
List
<
String
>
projectSources
=
isManager
?
null
:
listTopNode
();
// 项目来源小代码
List
<
Map
>
codesetMaps
=
CodeValueTools
.
getCodeValues
(
"app.sc.projectSource"
);
if
(
CollectionUtils
.
isEmpty
(
codesetMaps
))
{
return
results
;
}
for
(
Map
codesetMap
:
codesetMaps
)
{
String
label
=
MapUtils
.
getString
(
codesetMap
,
"value"
);
String
id
=
MapUtils
.
getString
(
codesetMap
,
"value"
);
String
text
=
MapUtils
.
getString
(
codesetMap
,
"label"
);
Map
leafMap
=
buildLeaf
(
parentId
,
label
,
text
,
HgWdConstant
.
LeafType
.
P
);
// 不是管理员,且不存在,且不是备件制造图就不显示
if
(!
isManager
&&
!
projectSources
.
contains
(
id
)
&&
!
ProjectSourceEnum
.
SPARE
.
getCode
().
equals
(
id
))
{
continue
;
}
Map
leafMap
=
buildLeaf
(
parentId
,
id
,
text
,
HgWdConstant
.
LeafType
.
P
);
leafMap
.
put
(
"type"
,
"-1"
);
leafMap
.
put
(
"leafLevel"
,
"-1"
);
leafMap
.
put
(
"filePath"
,
text
);
leafMap
.
put
(
"leaf"
,
0
);
results
.
add
(
leafMap
);
}
// 设置叶子节点
setTreeNodeLeaf
(
results
,
true
);
return
results
;
}
/**
* 查询顶级节点
*
* @return
*/
private
List
<
String
>
listTopNode
()
{
// 查询有权限的顶级目录,管理员不做要求,并且项目是审核通过
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"userId"
,
UserSessionUtils
.
getUserId
());
queryMap
.
put
(
"projectStatusYs"
,
HGConstant
.
ApprovalStatus
.
YS
);
List
<
HGWD001
>
dbWd001s
=
dao
.
query
(
HgWdSqlConstant
.
HgWd001
.
QUERY_PROJECT_SOURCE
,
queryMap
);
if
(
CollectionUtils
.
isEmpty
(
dbWd001s
))
{
return
new
ArrayList
<>();
}
return
dbWd001s
.
stream
().
map
(
HGWD001:
:
getProjectSource
).
collect
(
Collectors
.
toList
());
}
/**
* 查询一级节点
*
* @param parentId
...
...
@@ -263,15 +290,16 @@ public class ServiceHGWD001D extends TreeService {
* @return
*/
public
List
queryFirstNode
(
String
parentId
,
String
ename
)
{
boolean
isAuth
=
!
ProjectSourceEnum
.
SPARE
.
getCode
().
equals
(
parentId
);
// SPARE:备件制造图不限制;非管理员仅查询自己有权限的项目
String
userId
=
UserSessionUtils
.
getLoginName
();
boolean
isManager
=
HgWdUtils
.
HgWd009
.
isManager
(
userId
);
boolean
isSourceAuth
=
!
ProjectSourceEnum
.
SPARE
.
getCode
().
equals
(
parentId
);
List
<
Map
>
results
=
new
ArrayList
();
Map
queryMap
=
new
HashMap
<>();
queryMap
.
put
(
"ename"
,
ename
);
queryMap
.
put
(
HGSC001
.
FIELD_project_source
,
parentId
);
queryMap
.
put
(
HGSC001
.
FIELD_approval_status
,
HGConstant
.
ApprovalStatus
.
YS
);
// 非管理员仅查询自己有权限的项目
String
userId
=
UserSessionUtils
.
getLoginName
();
if
(
isAuth
&&
!
HgWdUtils
.
HgWd009
.
isManager
(
userId
))
{
if
(
isSourceAuth
&&
!
isManager
)
{
queryMap
.
put
(
"userId"
,
userId
);
}
List
<
HGSC001
>
dbSc001s
=
dao
.
query
(
"HGSC101.query"
,
queryMap
);
...
...
@@ -284,7 +312,7 @@ public class ServiceHGWD001D extends TreeService {
String
text
=
dbSc001
.
getProjName
()
+
"("
+
dbSc001
.
getProjCode
()
+
")"
;
Map
leafMap
=
buildLeaf
(
parentId
,
dbSc001
.
getProjCode
(),
text
,
HgWdConstant
.
LeafType
.
P
);
int
count
=
getChildCount
(
dbSc001
.
getProjCode
());
int
count
=
getChildCount
(
dbSc001
.
getProjCode
()
,
isManager
,
isSourceAuth
);
//Long count = hgwd003s.stream().filter(hgwd003 -> hgwd003.getFileId().equals(dbSc001.getProjCode())).count();
leafMap
.
put
(
"projCode"
,
dbSc001
.
getProjCode
());
...
...
@@ -293,7 +321,7 @@ public class ServiceHGWD001D extends TreeService {
leafMap
.
put
(
"type"
,
"1"
);
leafMap
.
put
(
"leafLevel"
,
"0"
);
leafMap
.
put
(
"count"
,
count
);
leafMap
.
put
(
"isAuth"
,
isAuth
?
"1"
:
"0"
);
leafMap
.
put
(
"isAuth"
,
is
Source
Auth
?
"1"
:
"0"
);
leafMap
.
put
(
"filePath"
,
ProjectSourceEnum
.
getByCode
(
parentId
).
getName
()+
"/"
+
text
);
results
.
add
(
leafMap
);
}
...
...
@@ -315,24 +343,28 @@ public class ServiceHGWD001D extends TreeService {
String
userId
=
UserSessionUtils
.
getLoginName
();
// 查询项目来源
HGSC001
dbSc001
=
HGSCTools
.
Hgsc001
.
getByCode
(
projCode
);
// true:需要权限
//
备件制造图不需要授权,
true:需要权限
boolean
isSourceAuth
=
!
ProjectSourceEnum
.
SPARE
.
getCode
().
equals
(
dbSc001
.
getProjectSource
());
// 是否文档管理员
boolean
isManager
=
HgWdUtils
.
HgWd009
.
isManager
();
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"parentId"
,
parentId
);
queryMap
.
put
(
"ename"
,
ename
);
// 递归查询有权限的文件夹,管理员和备件制造图不限制
if
(!
isManager
&&
isSourceAuth
)
{
queryMap
.
put
(
"treeUserId"
,
userId
);
}
List
<
HGWD001
>
dbWd001s
=
dao
.
query
(
HGWD001
.
QUERY
,
queryMap
);
if
(
CollectionUtils
.
isEmpty
(
dbWd001s
))
{
return
results
;
}
// 是否文档管理员
boolean
isManager
=
HgWdUtils
.
HgWd009
.
isManager
();
List
<
String
>
fileIds
=
dbWd001s
.
stream
().
map
(
HGWD001:
:
getFileId
).
distinct
().
collect
(
Collectors
.
toList
());
// 查询目录授权人数
List
<
HGWD003
>
dbWd003s
=
HGWDTools
.
HgWd003
.
list
(
fileIds
);
for
(
HGWD001
dbWd001
:
dbWd001s
)
{
Map
leafMap
=
buildLeaf
(
parentId
,
dbWd001
.
getFileId
(),
dbWd001
.
getFileName
(),
HgWdConstant
.
LeafType
.
C
);
int
count
=
getChildCount
(
dbWd001
.
getFileId
());
int
count
=
getChildCount
(
dbWd001
.
getFileId
()
,
isManager
,
isSourceAuth
);
leafMap
.
put
(
"projCode"
,
dbWd001
.
getProjCode
());
leafMap
.
put
(
"projName"
,
dbWd001
.
getProjName
());
leafMap
.
put
(
"ename"
,
dbWd001
.
getProjCode
());
...
...
@@ -401,9 +433,10 @@ public class ServiceHGWD001D extends TreeService {
* @param fileId 目录ID
* @return 节点数量
*/
public
int
getChildCount
(
String
fileId
){
List
<
Map
>
hgwd001List
=
HGWDTools
.
HgWd001
.
queryFileChild
(
fileId
);
//查询子级目录
List
<
String
>
childIds
=
Optional
.
ofNullable
(
hgwd001List
).
orElse
(
new
ArrayList
<>()).
stream
().
map
(
o
->
o
.
get
(
"fileId"
).
toString
()).
collect
(
Collectors
.
toList
());
public
int
getChildCount
(
String
fileId
,
boolean
isManager
,
boolean
isSourceAuth
)
{
List
<
HGWD001
>
hgwd001List
=
HgWdUtils
.
HgWd001
.
queryChildren
(
fileId
,
isManager
,
isSourceAuth
);
//查询子级目录
List
<
String
>
childIds
=
Optional
.
ofNullable
(
hgwd001List
).
orElse
(
new
ArrayList
<>()).
stream
()
.
map
(
HGWD001:
:
getFileId
).
collect
(
Collectors
.
toList
());
// 已授权人员信息
List
<
HGWD003
>
dbWd003List
=
HGWDTools
.
HgWd003
.
list
(
childIds
);
List
<
HGWD099
>
fWd099s
=
HGWDTools
.
HgWd099
.
queryByBiz
(
"WD"
,
childIds
);
...
...
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD003B.java
View file @
8f6dbc4e
...
...
@@ -60,7 +60,7 @@ public class ServiceHGWD003B extends ServiceEPBase {
// 仅查询自己是项目经理的目录
String
userId
=
UserSessionUtils
.
getLoginName
();
if
(!
HgWdUtils
.
HgWd009
.
isManager
(
userId
))
{
queryMap
.
put
(
"
m
anagerUserId"
,
userId
);
queryMap
.
put
(
"
projectM
anagerUserId"
,
userId
);
}
inInfo
=
super
.
query
(
inInfo
,
HGWD001
.
QUERY
,
new
HGWD001
());
}
catch
(
Exception
e
)
{
...
...
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD099.java
View file @
8f6dbc4e
...
...
@@ -11,10 +11,12 @@ import com.baosight.hggp.hg.wd.domain.HGWD001A;
import
com.baosight.hggp.hg.wd.domain.HGWD003
;
import
com.baosight.hggp.hg.wd.domain.HGWD099
;
import
com.baosight.hggp.hg.wd.tools.HGWDTools
;
import
com.baosight.hggp.hg.wd.utils.HgWdUtils
;
import
com.baosight.hggp.util.EiInfoUtils
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.MapUtils
;
import
com.baosight.hggp.util.ObjectUtils
;
import
com.baosight.hggp.util.StringUtils
;
import
com.baosight.hggp.util.contants.ACConstants
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
...
...
@@ -22,10 +24,8 @@ import com.baosight.iplat4j.core.exception.PlatException;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
org.apache.commons.collections.CollectionUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -62,18 +62,22 @@ public class ServiceHGWD099 extends ServiceEPBase {
@Override
public
EiInfo
query
(
EiInfo
inInfo
)
{
try
{
Map
queryRow
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
if
(
ObjectUtils
.
isNotBlank
(
queryRow
.
get
(
HGWD001
.
FIELD_PARENT_ID
))){
List
<
Map
>
childList
=
HGWDTools
.
HgWd001
.
queryFileChild
(
queryRow
.
get
(
HGWD001
.
FIELD_PARENT_ID
).
toString
()
);
if
(
childList
==
null
)
{
Map
queryRow
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
parentId
=
MapUtils
.
getString
(
queryRow
,
HGWD001
.
FIELD_PARENT_ID
);
String
projCode
=
MapUtils
.
getString
(
queryRow
,
HGWD001
.
FIELD_PROJ_CODE
);
if
(
StringUtils
.
isBlank
(
parentId
))
{
return
inInfo
;
}
List
<
String
>
childFileIdList
=
Optional
.
of
(
childList
).
orElse
(
new
ArrayList
<>()).
stream
().
map
(
map
->
map
.
get
(
HGWD001
.
FIELD_FILE_ID
).
toString
()).
collect
(
Collectors
.
toList
());
queryRow
.
put
(
"bizIds"
,
childFileIdList
);
// 查询子节点
List
<
HGWD001
>
children
=
HgWdUtils
.
HgWd001
.
queryChildren
(
parentId
,
projCode
);
if
(
CollectionUtils
.
isEmpty
(
children
))
{
return
inInfo
;
}
// 需要包含自身
queryRow
.
put
(
"bizIds"
,
children
.
stream
().
map
(
HGWD001:
:
getFileId
).
collect
(
Collectors
.
toList
()));
queryRow
.
remove
(
HGWD099
.
FIELD_BIZ_ID
);
inInfo
.
getBlock
(
EiConstant
.
queryBlock
).
getRow
(
ACConstants
.
ROW_CODE_0
).
remove
(
HGWD001
.
FIELD_PARENT_ID
);
inInfo
=
super
.
query
(
inInfo
,
HGWD099
.
QUERY
,
new
HGWD099
());
}
}
catch
(
Throwable
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
...
...
src/main/java/com/baosight/hggp/hg/wd/sql/HGWD001.xml
View file @
8f6dbc4e
...
...
@@ -32,29 +32,12 @@
<sql
id=
"condition"
>
AND DELETE_FLAG = 0
<!-- 仅查询审批通过的项目 -->
<include
refid=
"HGXSDataAuth.authCondition"
/>
<include
refid=
"customCondition"
/>
<isNotEmpty
prepend=
" AND "
property=
"id"
>
ID = #id#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"createdBy"
>
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"createdName"
>
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"createdTime"
>
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"updatedBy"
>
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"updatedName"
>
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"updatedTime"
>
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"companyCode"
>
COMPANY_CODE = #companyCode#
</isNotEmpty>
...
...
@@ -82,18 +65,9 @@
<isNotEmpty
prepend=
" AND "
property=
"fileName"
>
FILE_NAME LIKE CONCAT('%', #fileName#, '%')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"docVersion"
>
DOC_VERSION = #docVersion#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"status"
>
STATUS = #status#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"remark"
>
REMARK = #remark#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"releaseDate"
>
RELEASE_DATE = #releaseDate#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"filePath"
>
FILE_PATH = #filePath#
</isNotEmpty>
...
...
@@ -106,17 +80,27 @@
<isNotEmpty
prepend=
" AND "
property=
"parentIds"
>
PARENT_ID IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"parentIds"
>
#parentIds[]#
</iterate>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"
m
anagerUserId"
>
EXISTS (SELECT FILE_ID FROM ${hggpSchema}.HGWD003 M WHERE
T.FILE_ID = M.FILE_ID
AND
M.USER_ID = #m
anagerUserId#
<isNotEmpty
prepend=
" AND "
property=
"
projectM
anagerUserId"
>
EXISTS (SELECT FILE_ID FROM ${hggpSchema}.HGWD003 M WHERE
M.DELETE_FLAG = 0
AND
T.FILE_ID = M.FILE_ID AND M.USER_ID = #projectM
anagerUserId#
AND M.IS_PROJECT_MANAGER = 1
)
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"userId"
open=
"("
close=
")"
>
EXISTS (SELECT FILE_ID FROM ${hggpSchema}.HGWD003 M WHERE
T.FILE_ID = M.FILE_ID
AND M.USER_ID = #userId#
EXISTS (SELECT FILE_ID FROM ${hggpSchema}.HGWD003 M WHERE
M.DELETE_FLAG = 0
AND T.FILE_ID = M.FILE_ID
AND M.USER_ID = #userId#
) OR PROJECT_SOURCE = 'spare'
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"treeUserId"
>
EXISTS (SELECT FILE_ID FROM ${hggpSchema}.HGWD003 M WHERE M.DELETE_FLAG = 0
AND M.USER_ID = #treeUserId#
AND FIND_IN_SET(M.FILE_ID, (SELECT ${hggpSchema}.queryWdTreeInfo(T.FILE_ID)))
)
</isNotEmpty>
<!-- 项目状态,2-审核通过 -->
<isNotEmpty
prepend=
" AND "
property=
"projectStatusYs"
>
EXISTS (SELECT * FROM ${hggpSchema}.HGSC001 M WHERE T.PROJ_CODE = M.PROJ_CODE AND M.APPROVAL_STATUS = 2)
</isNotEmpty>
</sql>
<sql
id=
"orderBy"
>
...
...
@@ -145,6 +129,14 @@
<include
refid=
"condition"
/>
</select>
<select
id=
"queryProjectSource"
resultClass=
"com.baosight.hggp.hg.wd.domain.HGWD001"
>
SELECT
DISTINCT PROJECT_SOURCE as "projectSource"
FROM ${hggpSchema}.HGWD001 T
WHERE 1=1
<include
refid=
"condition"
/>
</select>
<!-- 更具父级节点统计 -->
<select
id=
"countByParent"
resultClass=
"java.util.HashMap"
>
SELECT PARENT_ID, COUNT(1) AS CNT
...
...
@@ -344,6 +336,18 @@
order by CREATED_TIME asc
</select>
<!-- 查询字节点,包含自身 -->
<select
id=
"queryChildren"
resultClass=
"com.baosight.hggp.hg.wd.domain.HGWD001"
>
SELECT
<include
refid=
"column"
/>
FROM ${hggpSchema}.HGWD001 T WHERE DELETE_FLAG = 0
AND FIND_IN_SET(FILE_ID, (SELECT ${hggpSchema}.queryWdTreeInfo(#parentId#)))
<isNotEmpty
prepend=
" AND "
property=
"userId"
>
EXISTS (SELECT FILE_ID FROM ${hggpSchema}.HGWD003 M WHERE M.DELETE_FLAG = 0
AND M.FILE_ID = T.FILE_ID AND M.USER_ID = #userId#
)
</isNotEmpty>
</select>
<!--档库所有子节点树查询-->
<select
id=
"queryFileChild"
resultClass=
"java.util.HashMap"
>
SELECT
...
...
src/main/java/com/baosight/hggp/hg/wd/tools/HGWDTools.java
View file @
8f6dbc4e
...
...
@@ -229,6 +229,34 @@ public class HGWDTools {
List
<
Map
>
results
=
DaoBase
.
getInstance
().
query
(
HgWdSqlConstant
.
HgWd001
.
QUERY_FILE_CHILD
,
queryMap
);
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
;
}
/**
* 查询有权限的子节点
*
* @param parentId
* @return
*/
public
static
List
<
HGWD001
>
queryChildrenByUser
(
String
parentId
)
{
AssertUtils
.
isEmpty
(
parentId
,
"文件ID不能为空"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"parentId"
,
parentId
);
queryMap
.
put
(
"userId"
,
UserSessionUtils
.
getUserId
());
return
DaoBase
.
getInstance
().
query
(
HgWdSqlConstant
.
HgWd001
.
QUERY_CHILDREN
,
queryMap
);
}
/**
* 查询所有的子节点
*
* @param parentId
* @return
*/
public
static
List
<
HGWD001
>
queryChildren
(
String
parentId
)
{
AssertUtils
.
isEmpty
(
parentId
,
"文件ID不能为空"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"parentId"
,
parentId
);
return
DaoBase
.
getInstance
().
query
(
HgWdSqlConstant
.
HgWd001
.
QUERY_CHILDREN
,
queryMap
);
}
}
...
...
src/main/java/com/baosight/hggp/hg/wd/utils/HgWdUtils.java
View file @
8f6dbc4e
...
...
@@ -9,6 +9,8 @@ import com.baosight.hggp.hg.wd.domain.HGWD003;
import
com.baosight.hggp.hg.wd.tools.HGWDTools
;
import
com.baosight.hggp.util.StringUtils
;
import
java.util.List
;
/**
* @author:songx
* @date:2024/9/23,14:57
...
...
@@ -27,14 +29,21 @@ public class HgWdUtils {
/**
* 是否备件制造图
*
* @param
fil
eId
* @param
tre
eId
* @return
*/
public
static
boolean
isSpare
(
String
fileId
)
{
if
(
StringUtils
.
isBlank
(
fileId
))
{
public
static
boolean
isSpare
(
String
treeId
)
{
if
(
ProjectSourceEnum
.
SPARE
.
getCode
().
equals
(
treeId
))
{
return
true
;
}
HGSC001
dbSc001
=
HGSCTools
.
Hgsc001
.
getByCode
(
treeId
);
if
(
dbSc001
!=
null
)
{
if
(
StringUtils
.
isBlank
(
dbSc001
.
getProjectSource
()))
{
return
false
;
}
HGWD001
dbWd001
=
HGWDTools
.
HgWd001
.
get
(
fileId
);
return
ProjectSourceEnum
.
SPARE
.
getCode
().
equals
(
dbSc001
.
getProjectSource
());
}
HGWD001
dbWd001
=
HGWDTools
.
HgWd001
.
get
(
treeId
);
if
(
dbWd001
==
null
||
StringUtils
.
isBlank
(
dbWd001
.
getProjectSource
()))
{
return
false
;
}
...
...
@@ -61,6 +70,41 @@ public class HgWdUtils {
}
return
ProjectSourceEnum
.
SPARE
.
getCode
().
equals
(
dbSc001
.
getProjectSource
());
}
/**
* 查询子节点
*
* @param parentId
* @param projCode
* @return
*/
public
static
List
<
HGWD001
>
queryChildren
(
String
parentId
,
String
projCode
)
{
// 管理员或者备件制造图查询所有子节点;其余查询当前节点有权限的子节点
boolean
isManager
=
HgWdUtils
.
HgWd009
.
isManager
();
boolean
isSpare
=
HgWdUtils
.
HgWd001
.
isSpare
(
parentId
,
projCode
);
if
(
isManager
||
isSpare
)
{
return
HGWDTools
.
HgWd001
.
queryChildren
(
parentId
);
}
else
{
return
HGWDTools
.
HgWd001
.
queryChildrenByUser
(
parentId
);
}
}
/**
* 查询子节点
*
* @param parentId
* @param isManager
* @param isSpare
* @return
*/
public
static
List
<
HGWD001
>
queryChildren
(
String
parentId
,
boolean
isManager
,
boolean
isSpare
)
{
// 管理员或者备件制造图查询所有子节点;其余查询当前节点有权限的子节点
if
(
isManager
||
isSpare
)
{
return
HGWDTools
.
HgWd001
.
queryChildren
(
parentId
);
}
else
{
return
HGWDTools
.
HgWd001
.
queryChildrenByUser
(
parentId
);
}
}
}
...
...
src/main/webapp/HG/WD/HGWD001.js
View file @
8f6dbc4e
...
...
@@ -903,7 +903,7 @@ let showAuthButton = function () {
return
}
// 0:不授权
if
(
isAuth
===
0
)
{
if
(
isAuth
===
"0"
)
{
notAuthShowButton
();
}
else
{
isProjectManager
(
parentId
);
...
...
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