Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dcs-plan
Project
Project
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
INET-TWO
server
dcs-plan
Commits
9b6e9463
Commit
9b6e9463
authored
Sep 27, 2024
by
wangyangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基线:基线计划状态保存到动态属性中
parent
473f60f8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
ExtPlanBaseLineServiceImpl.java
...cs/plan/core/service/impl/ExtPlanBaseLineServiceImpl.java
+17
-4
No files found.
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtPlanBaseLineServiceImpl.java
View file @
9b6e9463
package
com
.
yonde
.
dcs
.
plan
.
core
.
service
.
impl
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.util.ReflectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.yonde.dcs.plan.common.vo.ExtIEDPlanVO
;
import
com.yonde.dcs.plan.common.vo.ExtPlanBaseLineLinkVO
;
import
com.yonde.dcs.plan.core.service.ExtPlanBaseLineLinkService
;
import
com.yonde.dcs.plan.core.util.SearchUtil
;
...
...
@@ -23,7 +25,9 @@ import com.yonde.dcs.plan.entity.po.ExtPlanBaseLine;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @description: ExtPlanBaseLine-ServiceImpl
...
...
@@ -52,17 +56,26 @@ public class ExtPlanBaseLineServiceImpl<V extends ExtPlanBaseLineVO> implements
String
beanName
=
StrUtil
.
lowerFirst
(
baseLineVO
.
getPlanType
())
+
"ServiceImpl"
;
IterationService
iterationService
=
(
IterationService
)
ApplicationContextUtil
.
getBean
(
beanName
);
DxPageImpl
recursion
=
iterationService
.
findRecursion
(
queryCondition
);
ExtIEDPlanVO
iedPlanVO
=
new
ExtIEDPlanVO
();
iedPlanVO
.
getDynamicAttrs
();
if
(
recursion
.
getTotalElements
()
!=
0
)
{
List
<
IdVO
>
result
=
recursion
.
getContent
();
List
<
Id
Only
VO
>
result
=
recursion
.
getContent
();
List
<
ExtPlanBaseLineLinkVO
>
lineLinkVOS
=
new
ArrayList
<>();
result
.
forEach
(
idVO
->
{
idVO
.
setOperator
(
OperatorType
.
ADD
);
idVO
.
setId
(
null
);
ReflectUtil
.
setFieldValue
(
idVO
,
"dxContextId"
,
null
);
ReflectUtil
.
setFieldValue
(
idVO
,
"dxContextEmbeddable"
,
null
);
//TODO 新建的计划状态都是初始状态且计划不会自启流程 这里使用动态baselineState来保存计划状态
String
life
=
StrUtil
.
toString
(
ReflectUtil
.
getFieldValue
(
idVO
,
"dxLifecycleManageBaseEmbeddable"
));
String
state
=
life
.
substring
(
life
.
lastIndexOf
(
"="
)
+
1
,
life
.
lastIndexOf
(
")"
));
Map
<
String
,
Object
>
dynamicAttrs
=
new
HashMap
<>();
if
(
MapUtil
.
isNotEmpty
(
idVO
.
getDynamicAttrs
()))
{
dynamicAttrs
=
idVO
.
getDynamicAttrs
();
}
dynamicAttrs
.
put
(
"baselineState"
,
ReflectUtil
.
getFieldValue
(
idVO
,
state
));
ExtPlanBaseLineLinkVO
lineLinkVO
=
new
ExtPlanBaseLineLinkVO
();
lineLinkVO
.
setOperator
(
OperatorType
.
ADD
);
lineLinkVO
.
setTarget
(
(
IdOnlyVO
)
idVO
);
lineLinkVO
.
setTarget
(
idVO
);
lineLinkVOS
.
add
(
lineLinkVO
);
});
baseLineVO
.
setExtPlanBaseLineLinks
(
lineLinkVOS
);
...
...
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