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
ad8034bf
Commit
ad8034bf
authored
Sep 18, 2024
by
wangqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ICM计划导入、导出功能开发(已测试)
parent
a8cacbfb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
11 deletions
+25
-11
ICMPlanExcelListenner.java
...m/yonde/dcs/plan/core/listener/ICMPlanExcelListenner.java
+24
-10
IEDPlanExcelListenner.java
...m/yonde/dcs/plan/core/listener/IEDPlanExcelListenner.java
+1
-1
No files found.
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/listener/ICMPlanExcelListenner.java
View file @
ad8034bf
...
...
@@ -10,10 +10,7 @@ import com.yonde.dcs.plan.common.constants.Constants;
import
com.yonde.dcs.plan.common.utils.SearchUtil
;
import
com.yonde.dcs.plan.common.vo.ExtICMExternalInterfacePlanVO
;
import
com.yonde.dcs.plan.common.vo.ExtICMPlanExcelVO
;
import
com.yonde.dcs.plan.common.vo.ExtIEDPlanExcelVO
;
import
com.yonde.dcs.plan.common.vo.ExtIEDPlanVO
;
import
com.yonde.dcs.plan.core.service.ExtICMExternalInterfacePlanService
;
import
com.yonde.dcs.plan.core.service.ExtIEDPlanService
;
import
com.yonde.dcs.plan.core.util.CommonUtils
;
import
com.yonde.dex.basedata.data.search.SearchItem
;
import
com.yonde.dex.basedata.data.search.SearchItems
;
...
...
@@ -95,21 +92,21 @@ public class ICMPlanExcelListenner extends AnalysisEventListener<ExtICMPlanExcel
// 收尾工作,处理剩下的缓存数据。。。
log
.
info
(
"sheet={} 所有数据解析完成!"
,
analysisContext
.
readSheetHolder
().
getSheetName
());
if
(
errorList
.
size
()
>
0
)
{
throw
new
DxBusinessException
(
"-1"
,
"I
ED
计划数据有误!!"
+
errorList
.
toString
());
throw
new
DxBusinessException
(
"-1"
,
"I
CM
计划数据有误!!"
+
errorList
.
toString
());
}
//处理全部检查通过的数据
for
(
ExtICMPlanExcelVO
extICMPlanExcelVO
:
cachedDataList
)
{
ExtICMExternalInterfacePlanVO
extICMPlanVO
=
new
ExtICMExternalInterfacePlanVO
();
extICMPlanVO
.
setDxContextId
(
Long
.
parseLong
(
projectId
));
if
(
Constants
.
EXCEL_ADD
.
equals
(
extICMPlanExcelVO
.
getOperation
()))
{
//新增
//将excel对象转换为po对象
BeanUtil
.
copyProperties
(
extICMPlanExcelVO
,
extICMPlanVO
);
if
(
Constants
.
EXCEL_ADD
.
equals
(
extICMPlanExcelVO
.
getOperation
()))
{
//新增
extICMPlanVO
.
setOperator
(
OperatorType
.
ADD
);
extICMExternalInterfacePlanService
.
saveRecursion
(
extICMPlanVO
);
}
else
if
(
Constants
.
EXCEL_UPDATE
.
equals
(
extICMPlanExcelVO
.
getOperation
()))
{
//更新
extICMPlanVO
.
setOperator
(
OperatorType
.
MODIFY
);
ExtICMExternalInterfacePlanVO
extICMPlanVOForDB
=
getICMPlanByPlanNumber
(
extICMPlanExcelVO
.
getPlanNumber
());
BeanUtil
.
copyProperties
(
extICMPlanExcelVO
,
extICMPlanVOForDB
);
extICMPlanVOForDB
.
setOperator
(
OperatorType
.
MODIFY
);
transitionObject
(
extICMPlanVOForDB
,
extICMPlanExcelVO
);
extICMExternalInterfacePlanService
.
saveRecursion
(
extICMPlanVOForDB
);
}
else
{
//删除
ExtICMExternalInterfacePlanVO
extICMPlanVOForDB
=
getICMPlanByPlanNumber
(
extICMPlanExcelVO
.
getPlanNumber
());
...
...
@@ -174,7 +171,7 @@ public class ICMPlanExcelListenner extends AnalysisEventListener<ExtICMPlanExcel
public
ExtICMExternalInterfacePlanVO
getICMPlanByPlanNumber
(
String
planNumber
)
{
//根据文件编号查询I
ED
计划
//根据文件编号查询I
CM
计划
DxPageImpl
<
ExtICMExternalInterfacePlanVO
>
ICMPlanPage
=
extICMExternalInterfacePlanService
.
findRecursion
(
SearchUtil
.
buildQuery
(
"planNumber"
,
SearchItem
.
Operator
.
EQ
,
planNumber
));
if
(!
CollectionUtils
.
isEmpty
(
ICMPlanPage
.
getContent
()))
{
ExtICMExternalInterfacePlanVO
extICMPlanVOForDB
=
DxPageUtils
.
getFirst
(
ICMPlanPage
);
...
...
@@ -199,7 +196,7 @@ public class ICMPlanExcelListenner extends AnalysisEventListener<ExtICMPlanExcel
.
build
())
.
build
();
//根据文件编号查询I
ED
计划
//根据文件编号查询I
CM
计划
DxPageImpl
<
ExtICMExternalInterfacePlanVO
>
ICMPlanPage
=
extICMExternalInterfacePlanService
.
findRecursion
(
condition
);
if
(!
CollectionUtils
.
isEmpty
(
ICMPlanPage
.
getContent
()))
{
ExtICMExternalInterfacePlanVO
extICMPlanVOForDB
=
DxPageUtils
.
getFirst
(
ICMPlanPage
);
...
...
@@ -210,4 +207,21 @@ public class ICMPlanExcelListenner extends AnalysisEventListener<ExtICMPlanExcel
return
null
;
}
/**
* 转换数据,将EXCEL对象转换为PO对象
*/
private
void
transitionObject
(
ExtICMExternalInterfacePlanVO
extICMExternalInterfacePlanVO
,
ExtICMPlanExcelVO
extICMPlanExcelVO
)
{
extICMExternalInterfacePlanVO
.
setPlanNumber
(
extICMPlanExcelVO
.
getPlanNumber
());
extICMExternalInterfacePlanVO
.
setPublisher
(
extICMPlanExcelVO
.
getPublisher
());
extICMExternalInterfacePlanVO
.
setAcceptor
(
extICMPlanExcelVO
.
getAcceptor
());
extICMExternalInterfacePlanVO
.
setKeyInterface
(
extICMPlanExcelVO
.
getKeyInterface
());
extICMExternalInterfacePlanVO
.
setMilestoneInterface
(
extICMPlanExcelVO
.
getMilestoneInterface
());
extICMExternalInterfacePlanVO
.
setInterfaceType
(
extICMPlanExcelVO
.
getInterfaceType
());
extICMExternalInterfacePlanVO
.
setPlanOpenDate
(
extICMPlanExcelVO
.
getPlanOpenDate
());
extICMExternalInterfacePlanVO
.
setPlanCloseDate
(
extICMPlanExcelVO
.
getPlanCloseDate
());
extICMExternalInterfacePlanVO
.
setResponsibilityPerson
(
extICMPlanExcelVO
.
getResponsibilityPerson
());
extICMExternalInterfacePlanVO
.
setResponsibilityUnit
(
extICMPlanExcelVO
.
getResponsibilityUnit
());
extICMExternalInterfacePlanVO
.
setInterfaceNote
(
extICMPlanExcelVO
.
getInterfaceNote
());
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/listener/IEDPlanExcelListenner.java
View file @
ad8034bf
...
...
@@ -103,8 +103,8 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
extIEDPlanVO
.
setOperator
(
OperatorType
.
ADD
);
extIEDPlanService
.
saveRecursion
(
extIEDPlanVO
);
}
else
if
(
Constants
.
EXCEL_UPDATE
.
equals
(
extIEDPlanExcelVO
.
getOperation
()))
{
//更新
extIEDPlanVO
.
setOperator
(
OperatorType
.
MODIFY
);
ExtIEDPlanVO
extIEDPlanVOForDB
=
getIEDPlanByFileNumber
(
extIEDPlanExcelVO
.
getFileNumber
());
extIEDPlanVOForDB
.
setOperator
(
OperatorType
.
MODIFY
);
transitionObject
(
extIEDPlanVOForDB
,
extIEDPlanExcelVO
);
extIEDPlanService
.
saveRecursion
(
extIEDPlanVOForDB
);
}
else
{
//删除
...
...
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