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
22f9a5a5
Commit
22f9a5a5
authored
Oct 17, 2024
by
wangqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IED计划导入增加 计划密级的不能高于项目密级
parent
546705a0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
6 deletions
+21
-6
ExtIEDPlanController.java
.../yonde/dcs/plan/core/controller/ExtIEDPlanController.java
+6
-2
IEDPlanExcelListenner.java
...m/yonde/dcs/plan/core/listener/IEDPlanExcelListenner.java
+12
-1
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 @
22f9a5a5
...
...
@@ -40,8 +40,12 @@ public class ExtIEDPlanController<V extends ExtIEDPlanVO, S extends ExtIEDPlanSe
*/
@ApiOperation
(
"导入IED计划"
)
@PostMapping
(
value
=
"/importIEDPlan"
)
public
ApiResult
importPlan
(
@RequestParam
(
"file"
)
MultipartFile
uploadFile
,
@RequestParam
(
"projectId"
)
String
projectId
)
throws
IOException
{
return
ApiResult
.
ok
(
extIEDPlanService
.
importIEDPlan
(
uploadFile
.
getInputStream
(),
projectId
),
"IED计划导入成功"
);
public
ApiResult
importPlan
(
@RequestParam
(
"file"
)
MultipartFile
uploadFile
,
@RequestParam
(
"projectId"
)
String
projectId
,
@RequestParam
(
"projectSecret"
)
String
projectSecret
)
throws
IOException
{
return
ApiResult
.
ok
(
extIEDPlanService
.
importIEDPlan
(
uploadFile
.
getInputStream
(),
projectId
,
projectSecret
),
"IED计划导入成功"
);
}
/**
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/listener/IEDPlanExcelListenner.java
View file @
22f9a5a5
...
...
@@ -72,6 +72,8 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
*/
private
String
projectId
;
private
String
projectSecret
;
/**
* excel操作符集合
*/
...
...
@@ -80,13 +82,14 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
public
IEDPlanExcelListenner
()
{
}
public
IEDPlanExcelListenner
(
String
projectId
)
{
public
IEDPlanExcelListenner
(
String
projectId
,
String
projectSecret
)
{
this
.
extIEDPlanService
=
ApplicationContextUtil
.
getBean
(
ExtIEDPlanService
.
class
);
this
.
extIEDPlanDocLinkService
=
ApplicationContextUtil
.
getBean
(
ExtIEDPlanDocLinkService
.
class
);
this
.
workFlowUtil
=
ApplicationContextUtil
.
getBean
(
WorkFlowUtil
.
class
);
this
.
extDxDocumentServiceFeign
=
ApplicationContextUtil
.
getBean
(
ExtDxDocumentServiceFeign
.
class
);
this
.
userUtils
=
ApplicationContextUtil
.
getBean
(
UserUtils
.
class
);
this
.
projectId
=
projectId
;
this
.
projectSecret
=
projectSecret
;
}
@Override
...
...
@@ -535,6 +538,14 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
extIEDPlanExcelVO
.
setRatifier
(
String
.
valueOf
(
dxUserInfoVO
.
getId
()));
}
}
//校验密级,计划密级不能大于项目密级
if
(!
StringUtils
.
isEmpty
(
extIEDPlanExcelVO
.
getSecretCode
()))
{
if
(!
CommonUtils
.
verifySecretLevel
(
projectSecret
,
extIEDPlanExcelVO
.
getSecretCode
())){
errorString
.
append
(
"解析到数据第"
+
excelDataRow
+
"行文件编号为:"
+
extIEDPlanExcelVO
.
getFileNumber
()
+
"的密级不能大于项目密级!!"
);
errorList
.
add
(
errorString
);
return
;
}
}
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/ExtIEDPlanService.java
View file @
22f9a5a5
...
...
@@ -16,7 +16,7 @@ import java.util.List;
**/
public
interface
ExtIEDPlanService
<
V
extends
ExtIEDPlanVO
>
extends
ExtIEDPlanServiceShadow
<
V
>
{
String
importIEDPlan
(
InputStream
inputStream
,
String
projectId
);
String
importIEDPlan
(
InputStream
inputStream
,
String
projectId
,
String
projectSecret
);
String
exportIEDPlan
(
HttpServletResponse
response
,
List
<
String
>
ids
)
throws
IOException
;
String
createIEDPlanTask
(
ExtIEDPlanVO
extIEDPlanVO
);
String
updatePlanState
(
Long
id
,
String
planState
);
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtIEDPlanServiceImpl.java
View file @
22f9a5a5
...
...
@@ -76,9 +76,9 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
@Override
public
String
importIEDPlan
(
InputStream
inputStream
,
String
projectId
)
{
public
String
importIEDPlan
(
InputStream
inputStream
,
String
projectId
,
String
projectSecret
)
{
EasyExcel
.
read
(
inputStream
,
ExtIEDPlanExcelVO
.
class
,
new
IEDPlanExcelListenner
(
projectId
))
new
IEDPlanExcelListenner
(
projectId
,
projectSecret
))
.
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