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
ead13b20
Commit
ead13b20
authored
Sep 12, 2024
by
wangqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IED计划导入添加项目id
parent
a4ec1f62
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
11 deletions
+14
-11
ExtIEDPlanController.java
.../yonde/dcs/plan/core/controller/ExtIEDPlanController.java
+2
-2
IEDPlanExcelListenner.java
...m/yonde/dcs/plan/core/listener/IEDPlanExcelListenner.java
+9
-3
PurchasePlanExcelReadListenner.java
...cs/plan/core/listener/PurchasePlanExcelReadListenner.java
+0
-3
ExtIEDPlanService.java
...va/com/yonde/dcs/plan/core/service/ExtIEDPlanService.java
+1
-1
ExtIEDPlanServiceImpl.java
...nde/dcs/plan/core/service/impl/ExtIEDPlanServiceImpl.java
+2
-2
No files found.
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/controller/ExtIEDPlanController.java
View file @
ead13b20
...
...
@@ -40,8 +40,8 @@ public class ExtIEDPlanController<V extends ExtIEDPlanVO, S extends ExtIEDPlanSe
*/
@ApiOperation
(
"导入IED计划"
)
@PostMapping
(
value
=
"/importIEDPlan"
)
public
ApiResult
importPlan
(
@RequestParam
(
"file"
)
MultipartFile
uploadFile
)
throws
IOException
{
return
ApiResult
.
ok
(
extIEDPlanService
.
importIEDPlan
(
uploadFile
.
getInputStream
()),
"IED计划导入成功"
);
public
ApiResult
importPlan
(
@RequestParam
(
"file"
)
MultipartFile
uploadFile
,
@RequestParam
(
"projectId"
)
String
projectId
)
throws
IOException
{
return
ApiResult
.
ok
(
extIEDPlanService
.
importIEDPlan
(
uploadFile
.
getInputStream
()
,
projectId
),
"IED计划导入成功"
);
}
/**
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/listener/IEDPlanExcelListenner.java
View file @
ead13b20
...
...
@@ -56,14 +56,21 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
*/
List
<
StringBuffer
>
errorList
=
new
ArrayList
<>();
/**
* 项目id
*/
private
String
projectId
;
/**
* excel操作符集合
*/
List
<
String
>
operationList
=
Arrays
.
asList
(
Constants
.
EXCEL_ADD
,
Constants
.
EXCEL_UPDATE
,
Constants
.
EXCEL_DELETE
);
public
IEDPlanExcelListenner
()
{}
public
IEDPlanExcelListenner
()
{
public
IEDPlanExcelListenner
(
String
projectId
)
{
this
.
extIEDPlanService
=
ApplicationContextUtil
.
getBean
(
ExtIEDPlanService
.
class
);
this
.
projectId
=
projectId
;
}
@Override
...
...
@@ -74,8 +81,6 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
log
.
info
(
"解析到一条数据:{}"
,
extIEDPlanExcelVO
);
//检查excel数据合法性
checkDataForExcel
(
extIEDPlanExcelVO
);
}
else
{
log
.
info
(
"解析到数据第{}行是空白数据请检查数据!"
,
excelDataRow
);
}
...
...
@@ -188,6 +193,7 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
//获取密级code
String
secretCode
=
CommonUtils
.
searchDictDataByDictCode
(
Constants
.
SECRET_CODE
,
extIEDPlanExcelVO
.
getSecretCode
());
extIEDPlanVO
.
setSecretCode
(
secretCode
);
extIEDPlanVO
.
setDxContextId
(
Long
.
parseLong
(
projectId
));
}
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/listener/PurchasePlanExcelReadListenner.java
View file @
ead13b20
...
...
@@ -65,11 +65,8 @@ public class PurchasePlanExcelReadListenner extends AnalysisEventListener<ExtPuc
log
.
info
(
"解析到一条数据:{}"
,
extPuchasePlanExcelVO
);
if
(!
CommonUtils
.
checkAllPropertiesIsEmpty
(
extPuchasePlanExcelVO
)){
cachedDataList
.
add
(
extPuchasePlanExcelVO
);
}
else
{
log
.
info
(
"解析到数据第{}行是空白数据请检查数据!"
,
excelDataRow
);
}
}
@Override
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/ExtIEDPlanService.java
View file @
ead13b20
...
...
@@ -16,6 +16,6 @@ import java.util.List;
**/
public
interface
ExtIEDPlanService
<
V
extends
ExtIEDPlanVO
>
extends
ExtIEDPlanServiceShadow
<
V
>
{
String
importIEDPlan
(
InputStream
inputStream
);
String
importIEDPlan
(
InputStream
inputStream
,
String
projectId
);
String
exportIEDPlan
(
HttpServletResponse
response
,
List
<
String
>
ids
)
throws
IOException
;
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtIEDPlanServiceImpl.java
View file @
ead13b20
...
...
@@ -63,9 +63,9 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
private
FileManagerFeignService
fileManagerFeignService
;
@Override
public
String
importIEDPlan
(
InputStream
inputStream
)
{
public
String
importIEDPlan
(
InputStream
inputStream
,
String
projectId
)
{
EasyExcel
.
read
(
inputStream
,
ExtIEDPlanExcelVO
.
class
,
new
IEDPlanExcelListenner
())
new
IEDPlanExcelListenner
(
projectId
))
.
sheet
()
.
doRead
();
return
ApiResult
.
SUCCESS
;
...
...
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