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
f3466a3a
Commit
f3466a3a
authored
Jul 04, 2023
by
jianshuqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化导入计划单
parent
d84cd37f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
1 deletion
+40
-1
CostPlanServiceFactory.java
...le/cost/service/impl/costplan/CostPlanServiceFactory.java
+24
-1
CostPlanEnumVo.java
...ain/java/com/blt/other/module/cost/vo/CostPlanEnumVo.java
+16
-0
No files found.
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costplan/CostPlanServiceFactory.java
View file @
f3466a3a
...
...
@@ -5,6 +5,8 @@ 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.database.model.UserDomain
;
import
com.blt.other.module.auth.dao.UserDao
;
import
com.blt.other.module.cost.dao.CostDao
;
import
com.blt.other.module.cost.dao.CostPlanDao
;
import
com.blt.other.module.cost.dao.CostTypeDao
;
...
...
@@ -34,6 +36,8 @@ import javax.annotation.Resource;
import
java.io.*
;
import
java.math.BigDecimal
;
import
java.nio.charset.StandardCharsets
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
static
com
.
blt
.
other
.
common
.
wrapper
.
ThrowingConsumer
.
handlingConsumerWrapper
;
...
...
@@ -108,6 +112,10 @@ public class CostPlanServiceFactory {
return
SpringContextUtil
.
getBean
(
DefaultCostPlanServiceImpl
.
class
);
}
private
static
UserDao
getUserDao
()
{
return
SpringContextUtil
.
getBean
(
UserDao
.
class
);
}
/**
* 根据上传的文件构建
*
...
...
@@ -174,6 +182,7 @@ public class CostPlanServiceFactory {
Map
<
Integer
,
Map
<
CostPlanDomain
,
List
<
AddItemReq
>>>
costPlanAndItemMap
=
new
HashMap
<>();
//公司主体映射
Map
<
String
,
CostCompanyDomain
>
costCompanyDomainMap
=
getCostCompanyService
().
costCompanyMap
();
UserDao
userDao
=
getUserDao
();
for
(
int
i
=
1
;
i
<
sheet
.
getLastRowNum
();
i
++)
{
Row
row
=
sheet
.
getRow
(
i
);
...
...
@@ -187,7 +196,13 @@ public class CostPlanServiceFactory {
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
)
==
null
?
null
:
row
.
getCell
(
j
).
toString
());
String
value
=
row
.
getCell
(
j
)
==
null
?
null
:
row
.
getCell
(
j
).
toString
();
if
(
costPlanField
.
equals
(
"projectDate"
))
{
DateFormat
fmt
=
new
SimpleDateFormat
(
"yyyy-MM"
);
jsonObject
.
put
(
costPlanField
,
fmt
.
parse
(
value
));
}
else
{
jsonObject
.
put
(
costPlanField
,
value
);
}
}
}
CostPlanDomain
costPlanDomain
=
jsonObject
.
toJavaObject
(
CostPlanDomain
.
class
);
...
...
@@ -214,6 +229,14 @@ public class CostPlanServiceFactory {
//设置用户编号
costPlanDomain
.
setCreateUsercode
(
userCode
);
UserDomain
user
=
null
;
if
(
costPlanDomain
.
getCreateUserid
()
==
null
)
{
user
=
userDao
.
select
(
userCode
);
if
(
user
!=
null
)
{
costPlanDomain
.
setCreateUserid
(
user
.
getUserid
());
costPlanDomain
.
setCreateUsername
(
user
.
getUsername
());
}
}
//设置付款/收款主体
CostCompanyDomain
costCompanyDomain
=
costCompanyDomainMap
.
get
(
costPlanDomain
.
getCompanyName
());
...
...
cost-service/src/main/java/com/blt/other/module/cost/vo/CostPlanEnumVo.java
View file @
f3466a3a
...
...
@@ -82,6 +82,22 @@ public enum CostPlanEnumVo {
put
(
"收款"
,
"项目"
);
}
}),
project
(
new
HashMap
<
String
,
String
>()
{
{
put
(
"付款"
,
"所属项目"
);
put
(
"收款"
,
"所属项目"
);
put
(
"借支"
,
"所属项目"
);
put
(
"借还"
,
"所属项目"
);
}
}),
projectDate
(
new
HashMap
<
String
,
String
>()
{
{
put
(
"付款"
,
"所属账期"
);
put
(
"收款"
,
"所属账期"
);
put
(
"借支"
,
"所属账期"
);
put
(
"借还"
,
"所属账期"
);
}
}),
payCounteract
(
new
HashMap
<
String
,
String
>()
{
{
put
(
"借还"
,
"冲销金额"
);
...
...
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