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
55456451
Commit
55456451
authored
Nov 14, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.备件制造图状态调整
parent
190897f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
29 deletions
+20
-29
ServiceHGWD001D.java
...java/com/baosight/hggp/hg/wd/service/ServiceHGWD001D.java
+17
-25
HgWdUtils.java
src/main/java/com/baosight/hggp/hg/wd/utils/HgWdUtils.java
+3
-4
No files found.
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD001D.java
View file @
55456451
...
...
@@ -7,7 +7,6 @@ import com.baosight.hggp.core.tools.CodeValueTools;
import
com.baosight.hggp.hg.constant.HGConstant
;
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
;
...
...
@@ -294,36 +293,31 @@ public class ServiceHGWD001D extends TreeService {
// SPARE:备件制造图不限制;非管理员仅查询自己有权限的项目
String
userId
=
UserSessionUtils
.
getLoginName
();
boolean
isManager
=
HgWdUtils
.
HgWd009
.
isManager
(
userId
);
boolean
isS
ourceAuth
=
!
ProjectSourceEnum
.
SPARE
.
getCode
().
equals
(
parentId
);
boolean
isS
pare
=
HgWdUtils
.
HgWd001
.
isSpare
(
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
);
if
(
isSourceAuth
&&
!
isManager
)
{
if
(
!
isSpare
&&
!
isManager
)
{
queryMap
.
put
(
"userId"
,
userId
);
}
List
<
HGSC001
>
dbSc001s
=
dao
.
query
(
"HGSC101.query"
,
queryMap
);
if
(
CollectionUtils
.
isEmpty
(
dbSc001s
))
{
return
results
;
}
//List<String> projCodes = dbSc001s.stream().map(HGSC001::getProjCode).distinct().collect(Collectors.toList());
//List<HGWD003> hgwd003s = HGWDTools.HgWd003.list(projCodes);
for
(
HGSC001
dbSc001
:
dbSc001s
)
{
String
text
=
dbSc001
.
getProjName
()
+
"("
+
dbSc001
.
getProjCode
()
+
")"
;
Map
leafMap
=
buildLeaf
(
parentId
,
dbSc001
.
getProjCode
(),
text
,
HgWdConstant
.
LeafType
.
P
);
int
count
=
getChildCount
(
dbSc001
.
getProjCode
(),
isManager
,
isSourceAuth
,
null
);
//Long count = hgwd003s.stream().filter(hgwd003 -> hgwd003.getFileId().equals(dbSc001.getProjCode())).count();
int
count
=
getChildCount
(
dbSc001
.
getProjCode
(),
isManager
,
isSpare
,
null
);
leafMap
.
put
(
"projCode"
,
dbSc001
.
getProjCode
());
leafMap
.
put
(
"projName"
,
dbSc001
.
getProjName
());
leafMap
.
put
(
"ename"
,
dbSc001
.
getProjCode
());
leafMap
.
put
(
"type"
,
"1"
);
leafMap
.
put
(
"leafLevel"
,
"0"
);
leafMap
.
put
(
"count"
,
count
);
leafMap
.
put
(
"isAuth"
,
isS
ourceAuth
?
"1"
:
"0
"
);
leafMap
.
put
(
"filePath"
,
ProjectSourceEnum
.
getByCode
(
parentId
).
getName
()
+
"/"
+
text
);
leafMap
.
put
(
"isAuth"
,
isS
pare
?
"0"
:
"1
"
);
leafMap
.
put
(
"filePath"
,
ProjectSourceEnum
.
getByCode
(
parentId
).
getName
()
+
"/"
+
text
);
results
.
add
(
leafMap
);
}
// 设置叶子节点
...
...
@@ -342,17 +336,15 @@ public class ServiceHGWD001D extends TreeService {
public
List
queryChildNode
(
String
projCode
,
String
parentId
,
String
ename
,
String
pageCode
)
{
List
<
Map
>
results
=
new
ArrayList
();
String
userId
=
UserSessionUtils
.
getLoginName
();
// 查询项目来源
HGSC001
dbSc001
=
HGSCTools
.
Hgsc001
.
getByCode
(
projCode
);
// 备件制造图不需要授权,true:需要权限
boolean
isSourceAuth
=
!
ProjectSourceEnum
.
SPARE
.
getCode
().
equals
(
dbSc001
.
getProjectSource
());
// 查询项目来源,备件制造图不需要授权
boolean
isSpare
=
HgWdUtils
.
HgWd001
.
isSpare
(
parentId
,
projCode
);
// 是否文档管理员
boolean
isManager
=
HgWdUtils
.
HgWd009
.
isManager
();
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"parentId"
,
parentId
);
queryMap
.
put
(
"ename"
,
ename
);
// 递归查询有权限的文件夹,管理员和备件制造图不限制
if
(!
isManager
&&
isSourceAuth
)
{
if
(!
isManager
&&
!
isSpare
)
{
queryMap
.
put
(
"treeUserId"
,
userId
);
}
List
<
HGWD001
>
dbWd001s
=
dao
.
query
(
HGWD001
.
QUERY
,
queryMap
);
...
...
@@ -364,7 +356,7 @@ public class ServiceHGWD001D extends TreeService {
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
(),
isManager
,
isS
ourceAuth
,
pageCode
);
int
count
=
getChildCount
(
dbWd001
.
getFileId
(),
isManager
,
isS
pare
,
pageCode
);
leafMap
.
put
(
"projCode"
,
dbWd001
.
getProjCode
());
leafMap
.
put
(
"projName"
,
dbWd001
.
getProjName
());
leafMap
.
put
(
"ename"
,
dbWd001
.
getProjCode
());
...
...
@@ -375,7 +367,7 @@ public class ServiceHGWD001D extends TreeService {
if
(
"HGWD002"
.
equals
(
pageCode
)
&&
count
==
0
)
{
continue
;
}
if
(!
isManager
&&
isSourceAuth
)
{
if
(!
isManager
&&
!
isSpare
)
{
leafMap
.
put
(
"isAuth"
,
"1"
);
// 从已授权的信息中查找出自己
HGWD003
dbWd003
=
dbWd003s
==
null
?
null
:
dbWd003s
.
stream
().
filter
(
item
...
...
@@ -434,11 +426,11 @@ public class ServiceHGWD001D extends TreeService {
/**
* 获取子级节点数量
* @param fileId 目录ID
* @param isS
ourceAuth true:需要权限
* @param isS
pare true:备件制造图
* @return 节点数量
*/
public
int
getChildCount
(
String
fileId
,
boolean
isManager
,
boolean
isS
ourceAuth
,
String
pageCode
)
{
List
<
HGWD001
>
hgwd001List
=
HgWdUtils
.
HgWd001
.
queryChildren
(
fileId
,
isManager
,
isS
ourceAuth
);
//查询子级目录
public
int
getChildCount
(
String
fileId
,
boolean
isManager
,
boolean
isS
pare
,
String
pageCode
)
{
List
<
HGWD001
>
hgwd001List
=
HgWdUtils
.
HgWd001
.
queryChildren
(
fileId
,
isManager
,
isS
pare
);
//查询子级目录
List
<
String
>
childIds
=
Optional
.
ofNullable
(
hgwd001List
).
orElse
(
new
ArrayList
<>()).
stream
()
.
map
(
HGWD001:
:
getFileId
).
collect
(
Collectors
.
toList
());
// 已授权人员信息
...
...
@@ -446,13 +438,13 @@ public class ServiceHGWD001D extends TreeService {
List
<
HGWD099
>
fWd099s
=
HGWDTools
.
HgWd099
.
queryByBiz
(
"WD"
,
childIds
,
pageCode
);
int
dbWd099s
=
fWd099s
==
null
?
0
:
fWd099s
.
size
();
int
count
=
0
;
if
(
"HGWD002"
.
equals
(
pageCode
)
&&
dbWd099s
==
0
){
if
(
"HGWD002"
.
equals
(
pageCode
)
&&
dbWd099s
==
0
)
{
return
0
;
}
else
if
(
dbWd003List
!=
null
&&
dbWd003List
.
size
()
>
0
&&
dbWd099s
>
0
)
{
}
else
if
(
dbWd003List
!=
null
&&
!
dbWd003List
.
isEmpty
()
&&
dbWd099s
>
0
)
{
count
=
3
;
}
else
if
(
dbWd003List
!=
null
&&
dbWd003List
.
size
()
>
0
)
{
}
else
if
(
dbWd003List
!=
null
&&
!
dbWd003List
.
isEmpty
())
{
count
=
2
;
}
else
if
(
dbWd099s
>
0
)
{
}
else
if
(
dbWd099s
>
0
)
{
count
=
1
;
}
return
count
;
...
...
src/main/java/com/baosight/hggp/hg/wd/utils/HgWdUtils.java
View file @
55456451
...
...
@@ -94,12 +94,12 @@ public class HgWdUtils {
*
* @param parentId
* @param isManager true:管理员
* @param isS
ourceAuth true:需要权限
* @param isS
pare true:备件制造图
* @return
*/
public
static
List
<
HGWD001
>
queryChildren
(
String
parentId
,
boolean
isManager
,
boolean
isS
ourceAuth
)
{
public
static
List
<
HGWD001
>
queryChildren
(
String
parentId
,
boolean
isManager
,
boolean
isS
pare
)
{
// 管理员或者备件制造图查询所有子节点;其余查询当前节点有权限的子节点
if
(
isManager
||
!
isSourceAuth
)
{
if
(
isManager
||
isSpare
)
{
return
HGWDTools
.
HgWd001
.
queryChildren
(
parentId
);
}
else
{
return
HGWDTools
.
HgWd001
.
queryChildrenByUser
(
parentId
);
...
...
@@ -107,7 +107,6 @@ public class HgWdUtils {
}
}
/**
* @author:songx
* @date:2024/8/19,14:57
...
...
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