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
505ed1f4
Commit
505ed1f4
authored
Oct 21, 2024
by
wangqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改采购计划导出是时间是空,并修改导出的时间格式xxxx/xx/xx;修改IED计划管理系统编码是空的问题
parent
f844b1c0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
32 deletions
+76
-32
ExtPuchasePlanExcelVO.java
...a/com/yonde/dcs/plan/common/vo/ExtPuchasePlanExcelVO.java
+4
-3
IEDPlanExcelListenner.java
...m/yonde/dcs/plan/core/listener/IEDPlanExcelListenner.java
+36
-23
PurchasePlanExcelReadListenner.java
...cs/plan/core/listener/PurchasePlanExcelReadListenner.java
+32
-3
ExtPuchasePlanAttributeServiceImpl.java
...core/service/impl/ExtPuchasePlanAttributeServiceImpl.java
+4
-3
No files found.
dcs-plan-common/src/main/java/com/yonde/dcs/plan/common/vo/ExtPuchasePlanExcelVO.java
View file @
505ed1f4
...
...
@@ -13,6 +13,7 @@ import lombok.NoArgsConstructor;
import
org.apache.poi.ss.usermodel.CellType
;
import
java.io.File
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -48,7 +49,7 @@ public class ExtPuchasePlanExcelVO {
*/
@ExcelProperty
(
value
=
{
"采购计划"
,
"采购技术文件提交时间*"
},
index
=
3
)
@ColumnWidth
(
20
)
private
LocalDateTime
purDesignFileSubmitTime
;
private
String
purDesignFileSubmitTime
;
/**
...
...
@@ -56,7 +57,7 @@ public class ExtPuchasePlanExcelVO {
*/
@ExcelProperty
(
value
=
{
"采购计划"
,
"合同签订时间*"
},
index
=
4
)
@ColumnWidth
(
20
)
private
LocalDateTime
contractActualSigningTime
;
private
String
contractActualSigningTime
;
/**
...
...
@@ -64,7 +65,7 @@ public class ExtPuchasePlanExcelVO {
*/
@ExcelProperty
(
value
=
{
"采购计划"
,
"合同交付时间*"
},
index
=
5
)
@ColumnWidth
(
20
)
private
LocalDateTime
contractActualDeliveryTime
;
private
String
contractActualDeliveryTime
;
/**
* 采购技术文件负责人
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/listener/IEDPlanExcelListenner.java
View file @
505ed1f4
...
...
@@ -268,7 +268,7 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
extIEDPlanVO
.
setPhase
(
extIEDPlanExcelVO
.
getPhase
());
if
(!
ObjectUtils
.
isEmpty
(
extIEDPlanExcelVO
.
getAuditTime
()))
{
try
{
LocalDateTime
auditTime
=
LocalDateTime
.
of
(
LocalDate
.
parse
(
extIEDPlanExcelVO
.
getAuditTime
(),
DateTimeFormatter
.
ofPattern
(
"yyyy
-MM-
dd"
)),
LocalTime
.
MIDNIGHT
);
LocalDateTime
auditTime
=
LocalDateTime
.
of
(
LocalDate
.
parse
(
extIEDPlanExcelVO
.
getAuditTime
(),
DateTimeFormatter
.
ofPattern
(
"yyyy
/MM/
dd"
)),
LocalTime
.
MIDNIGHT
);
extIEDPlanVO
.
setAuditTime
(
auditTime
);
}
catch
(
Exception
e
)
{
throw
new
DxBusinessException
(
"-1"
,
"审核时间格式不正确!"
);
...
...
@@ -277,7 +277,7 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
}
if
(!
ObjectUtils
.
isEmpty
(
extIEDPlanExcelVO
.
getFileSubmitTime
()))
{
try
{
LocalDateTime
submitTime
=
LocalDateTime
.
of
(
LocalDate
.
parse
(
extIEDPlanExcelVO
.
getFileSubmitTime
(),
DateTimeFormatter
.
ofPattern
(
"yyyy
-MM-
dd"
)),
LocalTime
.
MIDNIGHT
);
LocalDateTime
submitTime
=
LocalDateTime
.
of
(
LocalDate
.
parse
(
extIEDPlanExcelVO
.
getFileSubmitTime
(),
DateTimeFormatter
.
ofPattern
(
"yyyy
/MM/
dd"
)),
LocalTime
.
MIDNIGHT
);
extIEDPlanVO
.
setFileSubmitTime
(
submitTime
);
}
catch
(
Exception
e
)
{
throw
new
DxBusinessException
(
"-1"
,
"文件提交时间格式不正确!"
);
...
...
@@ -352,9 +352,22 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
* @return
*/
public
ExtIEDPlanVO
getIEDPlanByFileNumberAndFileCodeAndSystemNumber
(
String
fileNumber
,
String
fileCode
,
String
systemNumber
)
{
SearchQueryCondition
searchQuery
=
null
;
if
(
StringUtils
.
isEmpty
(
systemNumber
)){
searchQuery
=
SearchQueryCondition
.
builder
().
searchItems
(
SearchItems
.
builder
().
child
(
SearchItems
.
builder
()
.
item
(
new
SearchItem
(
"fileNumber"
,
SearchItem
.
Operator
.
EQ
,
fileNumber
,
(
Object
)
null
))
.
item
(
new
SearchItem
(
"fileCode"
,
SearchItem
.
Operator
.
EQ
,
fileCode
,
(
Object
)
null
))
.
operator
(
SearchItems
.
BooleanOperator
.
OR
).
build
())
.
item
(
new
SearchItem
(
"dxContextId"
,
SearchItem
.
Operator
.
EQ
,
projectId
,
(
Object
)
null
))
.
item
(
new
SearchItem
(
"deleted"
,
SearchItem
.
Operator
.
EQ
,
false
,
(
Object
)
null
))
.
operator
(
SearchItems
.
BooleanOperator
.
AND
)
.
build
()
SearchQueryCondition
searchQuery
=
SearchQueryCondition
.
builder
().
).
build
();
}
else
{
searchQuery
=
SearchQueryCondition
.
builder
().
searchItems
(
SearchItems
.
builder
().
child
(
SearchItems
.
builder
()
.
item
(
new
SearchItem
(
"fileNumber"
,
SearchItem
.
Operator
.
EQ
,
fileNumber
,
(
Object
)
null
))
...
...
@@ -367,7 +380,7 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
.
build
()
).
build
();
}
//根据文件编号查询IED计划
// DxPageImpl<ExtIEDPlanVO> IEDPlanPage = extIEDPlanService.findRecursion(SearchUtil.buildQuery("fileNumber", SearchItem.Operator.EQ, fileNumber));
DxPageImpl
<
ExtIEDPlanVO
>
IEDPlanPage
=
extIEDPlanService
.
findRecursion
(
searchQuery
);
...
...
@@ -471,11 +484,11 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
return
;
}
//管理系统编码不能为空
if
(
StringUtils
.
isEmpty
(
extIEDPlanExcelVO
.
getSystemNumber
()))
{
errorString
.
append
(
"解析到数据第"
+
excelDataRow
+
"行文件编号为:"
+
extIEDPlanExcelVO
.
getFileNumber
()
+
"的管理信息系统编码不能为空!!"
);
errorList
.
add
(
errorString
);
return
;
}
//
if (StringUtils.isEmpty(extIEDPlanExcelVO.getSystemNumber())) {
//
errorString.append("解析到数据第" + excelDataRow + "行文件编号为:" + extIEDPlanExcelVO.getFileNumber() + "的管理信息系统编码不能为空!!");
//
errorList.add(errorString);
//
return;
//
}
//文件提交时间不能为空
if
(
StringUtils
.
isEmpty
(
extIEDPlanExcelVO
.
getFileSubmitTime
()))
{
errorString
.
append
(
"解析到数据第"
+
excelDataRow
+
"行文件编号为:"
+
extIEDPlanExcelVO
.
getFileNumber
()
+
"的提交时间不能为空!!"
);
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/listener/PurchasePlanExcelReadListenner.java
View file @
505ed1f4
...
...
@@ -29,6 +29,10 @@ import org.springframework.util.CollectionUtils;
import
org.springframework.util.ObjectUtils
;
import
javax.servlet.ServletContextListener
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.LocalTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -146,9 +150,34 @@ public class PurchasePlanExcelReadListenner extends AnalysisEventListener<ExtPuc
*/
public
ExtPuchasePlanAttributeVO
transformObject
(
ExtPuchasePlanAttributeVO
extPuchasePlanAttributeVO
,
ExtPuchasePlanExcelVO
extPuchasePlanExcelVO
)
{
extPuchasePlanAttributeVO
.
setOutsourceProjectName
(
extPuchasePlanExcelVO
.
getOutsourceProjectName
());
extPuchasePlanAttributeVO
.
setPurDesignFileSubmitTime
(
extPuchasePlanExcelVO
.
getPurDesignFileSubmitTime
());
extPuchasePlanAttributeVO
.
setContractSigningTime
(
extPuchasePlanExcelVO
.
getContractActualSigningTime
());
extPuchasePlanAttributeVO
.
setContractDeliveryTime
(
extPuchasePlanExcelVO
.
getContractActualDeliveryTime
());
if
(!
ObjectUtils
.
isEmpty
(
extPuchasePlanExcelVO
.
getPurDesignFileSubmitTime
()))
{
try
{
LocalDateTime
purDesignFileSubmitTime
=
LocalDateTime
.
of
(
LocalDate
.
parse
(
extPuchasePlanExcelVO
.
getPurDesignFileSubmitTime
(),
DateTimeFormatter
.
ofPattern
(
"yyyy/MM/dd"
)),
LocalTime
.
MIDNIGHT
);
extPuchasePlanAttributeVO
.
setPurDesignFileSubmitTime
(
purDesignFileSubmitTime
);
}
catch
(
Exception
e
)
{
throw
new
DxBusinessException
(
"-1"
,
"采购技术文件提交时间格式不正确!"
);
}
}
if
(!
ObjectUtils
.
isEmpty
(
extPuchasePlanExcelVO
.
getContractActualSigningTime
()))
{
try
{
LocalDateTime
contractActualSigningTime
=
LocalDateTime
.
of
(
LocalDate
.
parse
(
extPuchasePlanExcelVO
.
getContractActualSigningTime
(),
DateTimeFormatter
.
ofPattern
(
"yyyy/MM/dd"
)),
LocalTime
.
MIDNIGHT
);
extPuchasePlanAttributeVO
.
setContractSigningTime
(
contractActualSigningTime
);
}
catch
(
Exception
e
)
{
throw
new
DxBusinessException
(
"-1"
,
"合同签订时间格式不正确!"
);
}
}
if
(!
ObjectUtils
.
isEmpty
(
extPuchasePlanExcelVO
.
getContractActualDeliveryTime
()))
{
try
{
LocalDateTime
contractActualDeliveryTime
=
LocalDateTime
.
of
(
LocalDate
.
parse
(
extPuchasePlanExcelVO
.
getContractActualDeliveryTime
(),
DateTimeFormatter
.
ofPattern
(
"yyyy/MM/dd"
)),
LocalTime
.
MIDNIGHT
);
extPuchasePlanAttributeVO
.
setContractDeliveryTime
(
contractActualDeliveryTime
);
}
catch
(
Exception
e
)
{
throw
new
DxBusinessException
(
"-1"
,
"合同交付时间格式不正确!"
);
}
}
extPuchasePlanAttributeVO
.
setPurDesignFileManager
(
extPuchasePlanExcelVO
.
getPurDesignFileManager
());
extPuchasePlanAttributeVO
.
setPurchaseBudget
(
extPuchasePlanExcelVO
.
getPurchaseBudget
());
//获取密级code
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtPuchasePlanAttributeServiceImpl.java
View file @
505ed1f4
...
...
@@ -41,6 +41,7 @@ import java.io.ByteArrayInputStream;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -177,9 +178,9 @@ public class ExtPuchasePlanAttributeServiceImpl<V extends ExtPuchasePlanAttribut
for
(
V
extPuchasePlanAttribute
:
content
)
{
ExtPuchasePlanExcelVO
extPuchasePlanExcelVO
=
new
ExtPuchasePlanExcelVO
();
extPuchasePlanExcelVO
.
setOutsourceProjectName
(
extPuchasePlanAttribute
.
getOutsourceProjectName
());
extPuchasePlanExcelVO
.
setPurDesignFileSubmitTime
(
extPuchasePlanAttribute
.
getPurDesignFileSubmitTime
());
extPuchasePlanExcelVO
.
setContractActualSigningTime
(
extPuchasePlanAttribute
.
getContract
ActualSigningTime
(
));
extPuchasePlanExcelVO
.
setContractActualDeliveryTime
(
extPuchasePlanAttribute
.
getContract
ActualDeliveryTime
(
));
extPuchasePlanExcelVO
.
setPurDesignFileSubmitTime
(
extPuchasePlanAttribute
.
getPurDesignFileSubmitTime
()
.
toLocalDate
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy/MM/dd"
))
);
extPuchasePlanExcelVO
.
setContractActualSigningTime
(
extPuchasePlanAttribute
.
getContract
SigningTime
().
toLocalDate
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy/MM/dd"
)
));
extPuchasePlanExcelVO
.
setContractActualDeliveryTime
(
extPuchasePlanAttribute
.
getContract
DeliveryTime
().
toLocalDate
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy/MM/dd"
)
));
Object
purDesignFileManager
=
extPuchasePlanAttribute
.
getDynamicAttrs
().
get
(
"userName"
);
extPuchasePlanExcelVO
.
setPurDesignFileManager
(
purDesignFileManager
!=
null
?
purDesignFileManager
.
toString
():
null
);
extPuchasePlanExcelVO
.
setPurchaseBudget
(
extPuchasePlanAttribute
.
getPurchaseBudget
());
...
...
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