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
76dfb7cf
Commit
76dfb7cf
authored
Oct 17, 2024
by
侯彦文
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
95a001c6
22f9a5a5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
11 deletions
+62
-11
ExtIEDPlanController.java
.../yonde/dcs/plan/core/controller/ExtIEDPlanController.java
+6
-2
IEDPlanExcelListenner.java
...m/yonde/dcs/plan/core/listener/IEDPlanExcelListenner.java
+40
-1
ExtIEDPlanService.java
...va/com/yonde/dcs/plan/core/service/ExtIEDPlanService.java
+1
-1
ExtIEDPlanServiceImpl.java
...nde/dcs/plan/core/service/impl/ExtIEDPlanServiceImpl.java
+15
-7
No files found.
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/controller/ExtIEDPlanController.java
View file @
76dfb7cf
...
...
@@ -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 @
76dfb7cf
...
...
@@ -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
...
...
@@ -281,9 +284,22 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
}
}
//编制
extIEDPlanVO
.
setEditor
(
extIEDPlanExcelVO
.
getEditor
());
//校核
extIEDPlanVO
.
setChecker
(
extIEDPlanExcelVO
.
getChecker
());
//审核
extIEDPlanVO
.
setAuditor
(
extIEDPlanExcelVO
.
getAuditor
());
//审定
extIEDPlanVO
.
setInvestigator
(
extIEDPlanExcelVO
.
getInvestigator
());
//批准
extIEDPlanVO
.
setRatifier
(
extIEDPlanExcelVO
.
getRatifier
());
Map
<
String
,
Object
>
dynamicAttrs
=
new
HashMap
<>();
dynamicAttrs
.
put
(
"editorName"
,
userUtils
.
getUserById
(
Long
.
valueOf
(
extIEDPlanExcelVO
.
getEditor
())).
getName
());
dynamicAttrs
.
put
(
"checkerName"
,
userUtils
.
getUserById
(
Long
.
valueOf
(
extIEDPlanExcelVO
.
getChecker
())).
getName
());
dynamicAttrs
.
put
(
"auditorName"
,
userUtils
.
getUserById
(
Long
.
valueOf
(
extIEDPlanExcelVO
.
getAuditor
())).
getName
());
dynamicAttrs
.
put
(
"investigatorName"
,
userUtils
.
getUserById
(
Long
.
valueOf
(
extIEDPlanExcelVO
.
getInvestigator
())).
getName
());
dynamicAttrs
.
put
(
"ratifierName"
,
userUtils
.
getUserById
(
Long
.
valueOf
(
extIEDPlanExcelVO
.
getRatifier
())).
getName
());
extIEDPlanVO
.
setDynamicAttrs
(
dynamicAttrs
);
extIEDPlanVO
.
setChecker
(
extIEDPlanExcelVO
.
getChecker
());
extIEDPlanVO
.
setAuditor
(
extIEDPlanExcelVO
.
getAuditor
());
...
...
@@ -473,6 +489,21 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
extIEDPlanExcelVO
.
setEditor
(
String
.
valueOf
(
dxUserInfoVO
.
getId
()));
}
}
//校核不能为空,判断该用户是否存在,存在的话,将用户id保存
if
(
StringUtils
.
isEmpty
(
extIEDPlanExcelVO
.
getChecker
()))
{
errorString
.
append
(
"解析到数据第"
+
excelDataRow
+
"行文件编号为:"
+
extIEDPlanExcelVO
.
getFileNumber
()
+
"的编写者不能为空!!"
);
errorList
.
add
(
errorString
);
return
;
}
else
{
DxUserInfoVO
dxUserInfoVO
=
userUtils
.
getUserByName
(
extIEDPlanExcelVO
.
getChecker
());
if
(
ObjectUtils
.
isEmpty
(
dxUserInfoVO
))
{
errorString
.
append
(
"解析到数据第"
+
excelDataRow
+
"行文件编号为:"
+
extIEDPlanExcelVO
.
getFileNumber
()
+
"的校核在系统中未查到!!"
);
errorList
.
add
(
errorString
);
return
;
}
else
{
extIEDPlanExcelVO
.
setChecker
(
String
.
valueOf
(
dxUserInfoVO
.
getId
()));
}
}
//审核不是空,判断该用户是否存在,存在的话,将用户id保存
if
(!
StringUtils
.
isEmpty
(
extIEDPlanExcelVO
.
getAuditor
()))
{
DxUserInfoVO
dxUserInfoVO
=
userUtils
.
getUserByName
(
extIEDPlanExcelVO
.
getAuditor
());
...
...
@@ -507,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 @
76dfb7cf
...
...
@@ -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 @
76dfb7cf
...
...
@@ -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
;
...
...
@@ -152,11 +152,11 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
if
(!
ObjectUtil
.
isEmpty
(
extIEDPlanVO
.
getFileSubmitTime
()))
{
extIEDPlanExcelVO
.
setFileSubmitTime
(
extIEDPlanVO
.
getFileSubmitTime
().
format
(
DateTimeFormatter
.
ISO_DATE
));
}
extIEDPlanExcelVO
.
setEditor
(
extIEDPlanVO
.
get
Editor
());
extIEDPlanExcelVO
.
setChecker
(
extIEDPlanVO
.
get
Checker
());
extIEDPlanExcelVO
.
setAuditor
(
extIEDPlanVO
.
get
Auditor
());
extIEDPlanExcelVO
.
setInvestigator
(
extIEDPlanVO
.
get
Investigator
());
extIEDPlanExcelVO
.
setRatifier
(
extIEDPlanVO
.
get
Ratifier
());
extIEDPlanExcelVO
.
setEditor
(
extIEDPlanVO
.
get
DynamicAttrs
().
get
(
"userName"
).
toString
());
extIEDPlanExcelVO
.
setChecker
(
extIEDPlanVO
.
get
DynamicAttrs
().
get
(
"checkerName"
).
toString
());
extIEDPlanExcelVO
.
setAuditor
(
extIEDPlanVO
.
get
DynamicAttrs
().
get
(
"auditorName"
).
toString
());
extIEDPlanExcelVO
.
setInvestigator
(
extIEDPlanVO
.
get
DynamicAttrs
().
get
(
"investigatorName"
).
toString
());
extIEDPlanExcelVO
.
setRatifier
(
extIEDPlanVO
.
get
DynamicAttrs
().
get
(
"ratifierName"
).
toString
());
extIEDPlanExcelVO
.
setNote
(
extIEDPlanVO
.
getNote
());
//获取密级code
String
secretCode
=
CommonUtils
.
searchDictDataValueByDictCode
(
Constants
.
SECRET_CODE
,
extIEDPlanVO
.
getSecretCode
());
...
...
@@ -204,6 +204,14 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
dynamicAttrs
.
put
(
"phase"
,
extIEDPlanVO
.
getPhase
());
//编写者
dynamicAttrs
.
put
(
"editor"
,
extIEDPlanVO
.
getEditor
());
//校核
dynamicAttrs
.
put
(
"checker"
,
extIEDPlanVO
.
getChecker
());
//审核
dynamicAttrs
.
put
(
"auditor"
,
extIEDPlanVO
.
getAuditor
());
//审定
dynamicAttrs
.
put
(
"investigator"
,
extIEDPlanVO
.
getInvestigator
());
//批准
dynamicAttrs
.
put
(
"ratifier"
,
extIEDPlanVO
.
getRatifier
());
//设置动态属性
dxDocumentVO
.
setDynamicAttrs
(
dynamicAttrs
);
//创建时间
...
...
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