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
717e59fb
Commit
717e59fb
authored
Sep 26, 2024
by
侯彦文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc报错
parent
6ba46bd0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
34 deletions
+24
-34
ExtIEDPlanServiceImpl.java
...nde/dcs/plan/core/service/impl/ExtIEDPlanServiceImpl.java
+22
-33
ExtPlanServiceImpl.java
.../yonde/dcs/plan/core/service/impl/ExtPlanServiceImpl.java
+2
-1
No files found.
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtIEDPlanServiceImpl.java
View file @
717e59fb
...
...
@@ -2,22 +2,17 @@ package com.yonde.dcs.plan.core.service.impl;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.util.StringUtils
;
import
com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy
;
import
com.alibaba.fastjson.JSONPObject
;
import
com.yonde.dcs.document.common.entity.vo.DxDocumentVO
;
import
com.yonde.dcs.document.expand.entity.DxDocumentVOExpand
;
import
com.yonde.dcs.feign.expand.ExtDxDocumentServiceFeign
;
import
com.yonde.dcs.
document.
feign.expand.ExtDxDocumentServiceFeign
;
import
com.yonde.dcs.plan.common.constants.Constants
;
import
com.yonde.dcs.plan.common.vo.ExtIEDPlanDocLinkVO
;
import
com.yonde.dcs.plan.common.vo.ExtIEDPlanExcelVO
;
import
com.yonde.dcs.plan.common.vo.ExtIEDPlanVO
;
import
com.yonde.dcs.plan.common.vo.ExtPuchasePlanExcelVO
;
import
com.yonde.dcs.plan.core.listener.IEDPlanExcelListenner
;
import
com.yonde.dcs.plan.core.listener.PurchasePlanExcelReadListenner
;
import
com.yonde.dcs.plan.core.repository.ExtIEDPlanRepository
;
import
com.yonde.dcs.plan.core.service.ExtIEDPlanDocLinkService
;
import
com.yonde.dcs.plan.core.service.ExtIEDPlanService
;
...
...
@@ -26,10 +21,8 @@ import com.yonde.dcs.plan.core.util.FileUtils;
import
com.yonde.dcs.plan.core.util.ResourceHelper
;
import
com.yonde.dcs.plan.core.util.SearchUtil
;
import
com.yonde.dcs.plan.entity.po.ExtIEDPlan
;
import
com.yonde.dcs.plan.entity.po.ExtIEDPlanDocLink
;
import
com.yonde.dex.basedata.data.search.SearchItem
;
import
com.yonde.dex.basedata.data.search.SearchItems
;
import
com.yonde.dex.basedata.data.search.SearchQueryBuilder
;
import
com.yonde.dex.basedata.data.search.SearchQueryCondition
;
import
com.yonde.dex.basedata.entity.api.ApiResult
;
import
com.yonde.dex.basedata.entity.api.CustomMultipartFile
;
...
...
@@ -38,10 +31,13 @@ import com.yonde.dex.basedata.entity.data.OperatorType;
import
com.yonde.dex.basedata.exception.DxBusinessException
;
import
com.yonde.dex.dfs.feign.FileManagerFeignService
;
import
com.yonde.dex.systemfile.feign.SystemFileFeignService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.ByteArrayInputStream
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
...
...
@@ -52,13 +48,6 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.servlet.http.HttpServletResponse
;
/**
* @description: ExtIEDPlan-ServiceImpl
...
...
@@ -85,7 +74,7 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
private
ExtIEDPlanDocLinkService
extIEDPlanDocLinkService
;
@Override
public
String
importIEDPlan
(
InputStream
inputStream
,
String
projectId
)
{
public
String
importIEDPlan
(
InputStream
inputStream
,
String
projectId
)
{
EasyExcel
.
read
(
inputStream
,
ExtIEDPlanExcelVO
.
class
,
new
IEDPlanExcelListenner
(
projectId
))
.
sheet
()
...
...
@@ -143,7 +132,6 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
}
private
List
<
ExtIEDPlanExcelVO
>
transformationObject
(
List
<
V
>
extIEDPlanList
)
{
List
<
ExtIEDPlanExcelVO
>
extIEDPlanExcelVOList
=
new
ArrayList
<>();
for
(
ExtIEDPlanVO
extIEDPlanVO
:
extIEDPlanList
)
{
...
...
@@ -175,6 +163,7 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
/**
* 创建IED计划任务
*
* @param extIEDPlanVO
* @return
*/
...
...
@@ -187,10 +176,10 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
//文件类型 --文件、图册
//文件分类--需要取英文
//todo 需要取英文动态类型
if
(!
StringUtils
.
isEmpty
(
extIEDPlanVO
.
getFileClassify
()))
{
if
(
extIEDPlanVO
.
getFileClassify
().
contains
(
"技术文件"
))
{
if
(!
StringUtils
.
isEmpty
(
extIEDPlanVO
.
getFileClassify
()))
{
if
(
extIEDPlanVO
.
getFileClassify
().
contains
(
"技术文件"
))
{
dxDocumentVO
.
setSubTypeName
(
"TechnicalFile"
);
}
else
{
}
else
{
//todo wq暂时先不设置其它动态类型
log
.
info
(
"IED计划除技术文件类型的文件还未设置其它类型"
);
}
...
...
@@ -201,11 +190,11 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
Map
<
String
,
Object
>
dynamicAttrs
=
new
HashMap
<>();
//文件代号
dynamicAttrs
.
put
(
"fileNumber"
,
extIEDPlanVO
.
getFileCode
());
dynamicAttrs
.
put
(
"fileNumber"
,
extIEDPlanVO
.
getFileCode
());
//管理信息系统编码
dynamicAttrs
.
put
(
"systemCode"
,
extIEDPlanVO
.
getSystemNumber
());
dynamicAttrs
.
put
(
"systemCode"
,
extIEDPlanVO
.
getSystemNumber
());
//阶段
dynamicAttrs
.
put
(
"phase"
,
extIEDPlanVO
.
getPhase
());
dynamicAttrs
.
put
(
"phase"
,
extIEDPlanVO
.
getPhase
());
//设置动态属性
dxDocumentVO
.
setDynamicAttrs
(
dynamicAttrs
);
//设备号
...
...
@@ -230,13 +219,14 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
/**
* 更新计划状态
*
* @param planState
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
String
updatePlanState
(
Long
id
,
String
planState
)
{
if
(!
StringUtils
.
isEmpty
(
planState
))
{
public
String
updatePlanState
(
Long
id
,
String
planState
)
{
if
(!
StringUtils
.
isEmpty
(
planState
))
{
SearchQueryCondition
queryCondition
=
SearchUtil
.
buildQuery
(
"targetId"
,
SearchItem
.
Operator
.
EQ
,
id
);
// SearchQueryCondition condition = SearchQueryCondition.builder()
// .searchItems(SearchItems.builder()
...
...
@@ -245,20 +235,19 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
// .build();
List
<
ExtIEDPlanDocLinkVO
>
content
=
extIEDPlanDocLinkService
.
findRecursion
(
queryCondition
).
getContent
();
Long
iedPlanId
=
content
.
get
(
0
).
getSourceId
();
if
(!
ObjectUtil
.
isEmpty
(
iedPlanId
))
{
this
.
changeStatus
(
iedPlanId
,
planState
,
true
);
}
else
{
throw
new
DxBusinessException
(
"500"
,
"根据文档id:"
+
id
+
",未查到相关计划"
);
if
(!
ObjectUtil
.
isEmpty
(
iedPlanId
))
{
this
.
changeStatus
(
iedPlanId
,
planState
,
true
);
}
else
{
throw
new
DxBusinessException
(
"500"
,
"根据文档id:"
+
id
+
",未查到相关计划"
);
}
}
else
{
throw
new
DxBusinessException
(
"500"
,
"参数不能为空"
);
}
else
{
throw
new
DxBusinessException
(
"500"
,
"参数不能为空"
);
}
return
ApiResult
.
SUCCESS
;
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtPlanServiceImpl.java
View file @
717e59fb
...
...
@@ -97,6 +97,7 @@ public class ExtPlanServiceImpl<V extends ExtPlanVO> implements ExtPlanService<V
@Autowired
private
ModelDefinitionFeignService
modelDefinitionService
;
@Qualifier
(
"docCenterFeignService"
)
@Autowired
private
DocCenterFeignService
docCenterFeignService
;
...
...
@@ -458,7 +459,7 @@ public class ExtPlanServiceImpl<V extends ExtPlanVO> implements ExtPlanService<V
new
SearchItem
(
"number"
,
SearchItem
.
Operator
.
EQ
,
number
,
null
))
.
operator
(
SearchItems
.
BooleanOperator
.
AND
).
build
()).
build
();
DxPageImpl
<
DxDocumentVO
>
recursion
=
docCenterFeignService
.
findRecursion
(
query
);
if
(
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
recursion
.
getContent
()))
{
if
(
CollectionUtils
.
isEmpty
(
recursion
.
getContent
()))
{
return
null
;
}
return
DxPageUtils
.
getFirst
(
recursion
);
...
...
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