Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yanxuan-qc-change-system
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
yx-qc-change-flow
yanxuan-qc-change-system
Commits
348b8f2c
Commit
348b8f2c
authored
Dec 02, 2025
by
王志超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 抽取方法,简化主工单代码
parent
ebd408b3
Pipeline
#86394
passed with stages
in 1 minute 21 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
35 deletions
+48
-35
ChangeFlowBiz.java
...om/netease/mail/yanxuan/change/biz/biz/ChangeFlowBiz.java
+48
-35
No files found.
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/biz/ChangeFlowBiz.java
View file @
348b8f2c
...
@@ -1003,7 +1003,6 @@ public class ChangeFlowBiz {
...
@@ -1003,7 +1003,6 @@ public class ChangeFlowBiz {
// 设置供应商名称
// 设置供应商名称
String
changeSupplierName
=
this
.
buildChangeSupplierName
(
changeRecord
.
getChangeSupplier
());
String
changeSupplierName
=
this
.
buildChangeSupplierName
(
changeRecord
.
getChangeSupplier
());
changeFlowVO
.
setChangeSupplierName
(
changeSupplierName
);
changeFlowVO
.
setChangeSupplierName
(
changeSupplierName
);
// 获取附件
// 获取附件
List
<
ChangeFlowFile
>
changeFileList
=
changeFileService
.
getChangeFileList
(
changeRecord
.
getId
());
List
<
ChangeFlowFile
>
changeFileList
=
changeFileService
.
getChangeFileList
(
changeRecord
.
getId
());
changeFlowVO
.
setFiles
(
changeFileList
);
changeFlowVO
.
setFiles
(
changeFileList
);
...
@@ -1017,40 +1016,8 @@ public class ChangeFlowBiz {
...
@@ -1017,40 +1016,8 @@ public class ChangeFlowBiz {
this
.
fillChangeExecUserName
(
changeFlowExecRecord
);
this
.
fillChangeExecUserName
(
changeFlowExecRecord
);
changeFlowVO
.
setChangeExecProjectList
(
changeFlowExecRecord
);
changeFlowVO
.
setChangeExecProjectList
(
changeFlowExecRecord
);
changeFlowVO
.
setTopoId
(
ChangeFlowEnum
.
NEW_CHANGE_FLOW
.
getTopoId
());
changeFlowVO
.
setTopoId
(
ChangeFlowEnum
.
NEW_CHANGE_FLOW
.
getTopoId
());
try
{
// 设置负责人和创建人视图
Set
<
String
>
commanderList
=
new
HashSet
<>();
this
.
buildCommanderAndCreatorView
(
changeRecord
,
changeFlowVO
);
commanderList
.
add
(
changeRecord
.
getChangeCommander
());
commanderList
.
add
(
changeRecord
.
getCreator
());
IusDepartmentReq
iusDepartmentReq
=
new
IusDepartmentReq
();
iusDepartmentReq
.
setUids
(
new
ArrayList
<>(
commanderList
));
iusDepartmentReq
.
setIcac
(
true
);
HashMap
<
String
,
List
<
SecondaryDepartments
>>
orgMap
=
iusService
.
queryDepartment
(
iusDepartmentReq
);
List
<
SecondaryDepartments
>
commander
=
orgMap
.
get
(
changeRecord
.
getChangeCommander
());
List
<
SecondaryDepartments
>
creator
=
orgMap
.
get
(
changeRecord
.
getCreator
());
if
(!
CollectionUtils
.
isEmpty
(
commander
))
{
Optional
<
SecondaryDepartments
>
anyOrg
=
commander
.
stream
().
filter
(
o
->
o
.
getOrgPosLevel
()
==
97
).
findAny
();
String
orgName
=
"无三级部门"
;
if
(
anyOrg
.
isPresent
())
{
orgName
=
anyOrg
.
get
().
getOrgPosName
();
}
changeFlowVO
.
setChangeCommanderView
(
commander
.
get
(
0
).
getUserName
()
+
"("
+
orgName
+
")"
);
}
// 非同舟端展示人名及三级部门名称
if
(!
CreateSourceEnum
.
TONG_ZHOU
.
getType
().
equals
(
changeRecord
.
getCreateSource
())
&&
!
CollectionUtils
.
isEmpty
(
creator
))
{
Optional
<
SecondaryDepartments
>
anyOrg
=
creator
.
stream
().
filter
(
o
->
o
.
getOrgPosLevel
()
==
97
).
findAny
();
String
orgName
=
"无三级部门"
;
if
(
anyOrg
.
isPresent
())
{
orgName
=
anyOrg
.
get
().
getOrgPosName
();
}
changeFlowVO
.
setChangeCreatorView
(
creator
.
get
(
0
).
getUserName
()
+
"("
+
orgName
+
")"
);
}
// 同舟端发起变更,发起人展示供应商id
if
(
CreateSourceEnum
.
TONG_ZHOU
.
getType
().
equals
(
changeRecord
.
getCreateSource
()))
{
changeFlowVO
.
setChangeCreatorView
(
changeRecord
.
getCreateSupplier
());
}
}
catch
(
Exception
ex
)
{
log
.
error
(
"add org has ex"
,
ex
);
}
return
changeFlowVO
;
return
changeFlowVO
;
}
}
...
@@ -1179,6 +1146,52 @@ public class ChangeFlowBiz {
...
@@ -1179,6 +1146,52 @@ public class ChangeFlowBiz {
}
}
/**
/**
* 构建负责人和创建人视图
*
* @param changeRecord 变更记录
* @param changeFlowVO 变更工单视图对象
*/
private
void
buildCommanderAndCreatorView
(
ChangeRecord
changeRecord
,
ChangeFlowVO
changeFlowVO
)
{
try
{
Set
<
String
>
commanderList
=
new
HashSet
<>();
commanderList
.
add
(
changeRecord
.
getChangeCommander
());
commanderList
.
add
(
changeRecord
.
getCreator
());
IusDepartmentReq
iusDepartmentReq
=
new
IusDepartmentReq
();
iusDepartmentReq
.
setUids
(
new
ArrayList
<>(
commanderList
));
iusDepartmentReq
.
setIcac
(
true
);
HashMap
<
String
,
List
<
SecondaryDepartments
>>
orgMap
=
iusService
.
queryDepartment
(
iusDepartmentReq
);
List
<
SecondaryDepartments
>
commander
=
orgMap
.
get
(
changeRecord
.
getChangeCommander
());
List
<
SecondaryDepartments
>
creator
=
orgMap
.
get
(
changeRecord
.
getCreator
());
// 设置负责人视图:姓名(三级部门名称)
if
(!
CollectionUtils
.
isEmpty
(
commander
))
{
Optional
<
SecondaryDepartments
>
anyOrg
=
commander
.
stream
()
.
filter
(
o
->
o
.
getOrgPosLevel
()
==
97
)
.
findAny
();
String
orgName
=
anyOrg
.
isPresent
()
?
anyOrg
.
get
().
getOrgPosName
()
:
"无三级部门"
;
changeFlowVO
.
setChangeCommanderView
(
commander
.
get
(
0
).
getUserName
()
+
"("
+
orgName
+
")"
);
}
// 设置创建人视图
if
(
CreateSourceEnum
.
TONG_ZHOU
.
getType
().
equals
(
changeRecord
.
getCreateSource
()))
{
// 同舟端发起变更,发起人展示供应商id
changeFlowVO
.
setChangeCreatorView
(
changeRecord
.
getCreateSupplier
());
}
else
if
(!
CollectionUtils
.
isEmpty
(
creator
))
{
// 非同舟端展示人名及三级部门名称
Optional
<
SecondaryDepartments
>
anyOrg
=
creator
.
stream
()
.
filter
(
o
->
o
.
getOrgPosLevel
()
==
97
)
.
findAny
();
String
orgName
=
anyOrg
.
isPresent
()
?
anyOrg
.
get
().
getOrgPosName
()
:
"无三级部门"
;
changeFlowVO
.
setChangeCreatorView
(
creator
.
get
(
0
).
getUserName
()
+
"("
+
orgName
+
")"
);
}
}
catch
(
Exception
ex
)
{
log
.
error
(
"add org has ex"
,
ex
);
}
}
/**
* 填充变更行动人姓名
* 填充变更行动人姓名
*
*
* @param changeFlowExecRecord 变更行动方案列表
* @param changeFlowExecRecord 变更行动方案列表
...
...
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