Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bailuntec-cost
Overview
Overview
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
huluobin
bailuntec-cost
Commits
be6e10a8
Commit
be6e10a8
authored
Jul 16, 2021
by
liyanlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加判空校验
parent
38d65050
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
CostPlanNewController.java
...t/other/module/cost/controller/CostPlanNewController.java
+3
-3
CostPlanServiceFactory.java
...le/cost/service/impl/costplan/CostPlanServiceFactory.java
+9
-1
No files found.
cost-service/src/main/java/com/blt/other/module/cost/controller/CostPlanNewController.java
View file @
be6e10a8
...
...
@@ -155,9 +155,9 @@ public class CostPlanNewController {
if
(
file
!=
null
&&
file
.
getOriginalFilename
().
endsWith
(
".zip"
))
{
try
{
InputStream
is
=
file
.
getResource
().
getInputStream
();
File
rar
=
File
.
createTempFile
(
UidUtils
.
VM_ID
+
"fee-original"
,
".zip"
);
file
.
transferTo
(
rar
);
Map
<
CostPlanService
,
List
<
CostPlanDomain
>>
costPlanServiceListMap
=
CostPlanServiceFactory
.
getCostPlanService
(
rar
,
userCode
);
File
zip
=
File
.
createTempFile
(
UidUtils
.
VM_ID
+
"fee-original"
,
".zip"
);
file
.
transferTo
(
zip
);
Map
<
CostPlanService
,
List
<
CostPlanDomain
>>
costPlanServiceListMap
=
CostPlanServiceFactory
.
getCostPlanService
(
zip
,
userCode
);
costPlanServiceListMap
.
forEach
((
x
,
y
)
->
{
y
.
forEach
(
costPlanDomain
->
{
x
.
save
(
costPlanDomain
);
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costplan/CostPlanServiceFactory.java
View file @
be6e10a8
...
...
@@ -2,6 +2,7 @@ package com.blt.other.module.cost.service.impl.costplan;
import
com.alibaba.fastjson.JSONObject
;
import
com.bailuntec.common.SpringContextUtil
;
import
com.bailuntec.common.exception.BizException
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.database.model.CostCompanyDomain
;
import
com.blt.other.module.cost.dao.CostDao
;
...
...
@@ -177,7 +178,14 @@ public class CostPlanServiceFactory {
JSONObject
jsonObject
=
new
JSONObject
();
for
(
int
j
=
0
;
j
<
firstRow
.
getLastCellNum
();
j
++)
{
String
costPlanField
=
CostPlanEnumVo
.
getCostPlanField
(
sheetName
,
firstRow
.
getCell
(
j
).
toString
());
if
(!
costPlanField
.
equals
(
""
)
&&
row
.
getCell
(
j
)
!=
null
)
{
if
(!
costPlanField
.
equals
(
""
))
{
if
(!
costPlanField
.
equals
(
"costRemark"
)
&&
(
row
.
getCell
(
j
)
==
null
||
row
.
getCell
(
j
).
toString
().
trim
().
equals
(
""
))){
throw
new
BizException
(
"请填写必填项"
);
}
if
(
costPlanField
.
equals
(
"costRemark"
)
&&
sheetName
.
equals
(
"付款"
)
&&
(
row
.
getCell
(
j
)
==
null
||
row
.
getCell
(
j
).
toString
().
trim
().
equals
(
""
)))
{
throw
new
BizException
(
"付款单备注为必填项"
);
}
jsonObject
.
put
(
costPlanField
,
row
.
getCell
(
j
).
toString
());
}
}
...
...
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