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
44a72871
Commit
44a72871
authored
Oct 09, 2024
by
侯彦文
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
2cf5852b
7231d9e7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
7 deletions
+23
-7
Constants.java
...n/java/com/yonde/dcs/plan/common/constants/Constants.java
+1
-1
ICMPlanExcelListenner.java
...m/yonde/dcs/plan/core/listener/ICMPlanExcelListenner.java
+15
-2
ExtICMExternalInterfacePlanServiceImpl.java
.../service/impl/ExtICMExternalInterfacePlanServiceImpl.java
+5
-2
ExtIEDPlanServiceImpl.java
...nde/dcs/plan/core/service/impl/ExtIEDPlanServiceImpl.java
+1
-1
ExtPuchasePlanAttributeServiceImpl.java
...core/service/impl/ExtPuchasePlanAttributeServiceImpl.java
+1
-1
No files found.
dcs-plan-common/src/main/java/com/yonde/dcs/plan/common/constants/Constants.java
View file @
44a72871
...
...
@@ -149,7 +149,7 @@ public class Constants {
/**
* 已发布
*/
public
static
final
String
PBULISHED
=
"
published
"
;
public
static
final
String
PBULISHED
=
"
release
"
;
/**
* 已发布
*/
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/listener/ICMPlanExcelListenner.java
View file @
44a72871
...
...
@@ -22,6 +22,7 @@ import com.yonde.dex.dao.service.util.ApplicationContextUtil;
import
com.yonde.dex.dao.service.util.DxPageUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
...
...
@@ -87,6 +88,7 @@ public class ICMPlanExcelListenner extends AnalysisEventListener<ExtICMPlanExcel
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
doAfterAllAnalysed
(
AnalysisContext
analysisContext
)
{
// 收尾工作,处理剩下的缓存数据。。。
...
...
@@ -107,7 +109,10 @@ public class ICMPlanExcelListenner extends AnalysisEventListener<ExtICMPlanExcel
ExtICMExternalInterfacePlanVO
extICMPlanVOForDB
=
getICMPlanByPlanNumber
(
extICMPlanExcelVO
.
getPlanNumber
());
extICMPlanVOForDB
.
setOperator
(
OperatorType
.
MODIFY
);
transitionObject
(
extICMPlanVOForDB
,
extICMPlanExcelVO
);
extICMExternalInterfacePlanService
.
saveRecursion
(
extICMPlanVOForDB
);
//更新,大版本升级
extICMExternalInterfacePlanService
.
newVersion
(
extICMPlanVOForDB
);
//将旧版本设置为作废
extICMExternalInterfacePlanService
.
changeStatus
(
extICMPlanVOForDB
.
getId
(),
Constants
.
OBSOLETE
,
true
);
}
else
{
//删除
ExtICMExternalInterfacePlanVO
extICMPlanVOForDB
=
getICMPlanByPlanNumber
(
extICMPlanExcelVO
.
getPlanNumber
());
extICMExternalInterfacePlanService
.
remove
(
extICMPlanVOForDB
.
getId
());
...
...
@@ -154,7 +159,15 @@ public class ICMPlanExcelListenner extends AnalysisEventListener<ExtICMPlanExcel
errorString
.
append
(
"解析到数据第"
+
excelDataRow
+
"行,新增ICM计划编号:"
+
extICMPlanExcelVO
.
getPlanNumber
()
+
"已存在,不能重复添加!"
);
errorList
.
add
(
errorString
);
}
}
else
{
}
else
if
(
Constants
.
EXCEL_UPDATE
.
equals
(
extICMPlanExcelVO
.
getOperation
()))
{
ExtICMExternalInterfacePlanVO
extICMPlanForDB
=
getICMPlanByPlanNumber
(
extICMPlanExcelVO
.
getPlanNumber
());
String
icmState
=
extICMPlanForDB
.
getState
();
//如果计划不是已发布不能进行升版本 -->release已发布
if
(!
icmState
.
equals
(
Constants
.
RELEASE
)){
errorString
.
append
(
"解析到数据第"
+
excelDataRow
+
"行,更新ICM计划编号:"
+
extICMPlanExcelVO
.
getPlanNumber
()
+
"的状态是"
+
icmState
+
",不能进行更新操作!"
);
errorList
.
add
(
errorString
);
}
}
else
{
ExtICMExternalInterfacePlanVO
extICMPlanVO
=
getICMPlanByFileNumberAndDeleted
(
extICMPlanExcelVO
.
getPlanNumber
());
if
(!
ObjectUtils
.
isEmpty
(
extICMPlanVO
)
&&
1
==
extICMPlanVO
.
getDeleted
())
{
errorString
.
append
(
"解析到数据第"
+
excelDataRow
+
"行,ICM计划编号:"
+
extICMPlanExcelVO
.
getPlanNumber
()
+
"已被删除,更新或删除失败!"
);
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtICMExternalInterfacePlanServiceImpl.java
View file @
44a72871
...
...
@@ -21,6 +21,7 @@ import com.yonde.dex.basedata.entity.api.ApiResult;
import
com.yonde.dex.basedata.entity.api.CustomMultipartFile
;
import
com.yonde.dex.basedata.entity.data.DxPageImpl
;
import
com.yonde.dex.basedata.exception.DxBusinessException
;
import
com.yonde.dex.dao.business.events.DaoPluginBusinessEvent
;
import
com.yonde.dex.dfs.feign.FileManagerFeignService
;
import
com.yonde.dex.systemfile.feign.SystemFileFeignService
;
import
org.apache.commons.collections.CollectionUtils
;
...
...
@@ -38,6 +39,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
import
org.springframework.beans.factory.annotation.Autowired
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.*
;
import
com.yonde.dcs.plan.core.service.ExtICMExternalInterfacePlanService
;
import
com.yonde.dcs.plan.core.repository.ExtICMExternalInterfacePlanRepository
;
...
...
@@ -53,7 +55,7 @@ import javax.servlet.http.HttpServletResponse;
**/
@Slf4j
@Service
(
ExtICMExternalInterfacePlanServiceImpl
.
BEAN_NAME
)
public
class
ExtICMExternalInterfacePlanServiceImpl
<
V
extends
ExtICMExternalInterfacePlanVO
>
implements
ExtICMExternalInterfacePlanService
<
V
>{
public
class
ExtICMExternalInterfacePlanServiceImpl
<
V
extends
ExtICMExternalInterfacePlanVO
>
implements
ExtICMExternalInterfacePlanService
<
V
>
{
public
static
final
String
BEAN_NAME
=
"extICMExternalInterfacePlanServiceImpl"
;
...
...
@@ -119,7 +121,7 @@ public class ExtICMExternalInterfacePlanServiceImpl<V extends ExtICMExternalInte
.
registerWriteHandler
(
new
LongestMatchColumnWidthStyleStrategy
())
.
sheet
(
"ICM计划列表"
).
doWrite
(
extICMPlanExcelVOList
);
//导出数据
FileUtils
.
exportFile
(
response
,
new
FileInputStream
(
filePath
),
"application/vnd.ms-excel;charset=utf-8"
,
"ICM计划.xlsx"
);
FileUtils
.
exportFile
(
response
,
new
FileInputStream
(
filePath
),
"application/vnd.ms-excel;charset=utf-8"
,
"ICM计划
模板(内部)
.xlsx"
);
FileUtil
.
del
(
dir
);
}
else
{
...
...
@@ -169,6 +171,7 @@ public class ExtICMExternalInterfacePlanServiceImpl<V extends ExtICMExternalInte
return
ApiResult
.
SUCCESS
;
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtIEDPlanServiceImpl.java
View file @
44a72871
...
...
@@ -121,7 +121,7 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
.
registerWriteHandler
(
new
LongestMatchColumnWidthStyleStrategy
())
.
sheet
(
"IED计划列表"
).
doWrite
(
extIEDPlanExcelVOList
);
//导出数据
FileUtils
.
exportFile
(
response
,
new
FileInputStream
(
filePath
),
"application/vnd.ms-excel;charset=utf-8"
,
"
采购计划
.xlsx"
);
FileUtils
.
exportFile
(
response
,
new
FileInputStream
(
filePath
),
"application/vnd.ms-excel;charset=utf-8"
,
"
IED计划模板(内部)
.xlsx"
);
FileUtil
.
del
(
dir
);
}
else
{
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtPuchasePlanAttributeServiceImpl.java
View file @
44a72871
...
...
@@ -116,7 +116,7 @@ public class ExtPuchasePlanAttributeServiceImpl<V extends ExtPuchasePlanAttribut
.
registerWriteHandler
(
new
LongestMatchColumnWidthStyleStrategy
())
.
sheet
(
"采购计划列表"
).
doWrite
(
extPuchasePlanExcelVOList
);
//导出数据
FileUtils
.
exportFile
(
response
,
new
FileInputStream
(
filePath
),
"application/vnd.ms-excel;charset=utf-8"
,
"采购计划.xlsx"
);
FileUtils
.
exportFile
(
response
,
new
FileInputStream
(
filePath
),
"application/vnd.ms-excel;charset=utf-8"
,
"采购计划
模板(内部)
.xlsx"
);
FileUtil
.
del
(
dir
);
}
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