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
bada4c4a
Commit
bada4c4a
authored
Apr 04, 2023
by
jianshuqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改借支单业务
parent
9b9f1d9c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
5 deletions
+73
-5
AbstractCostService.java
...er/module/cost/service/impl/cost/AbstractCostService.java
+10
-0
CostPlanNewLend1ServiceImpl.java
...st/service/impl/costplan/CostPlanNewLend1ServiceImpl.java
+59
-1
application-dev.yml
cost-service/src/main/resources/application-dev.yml
+2
-2
application-test.yml
cost-service/src/main/resources/application-test.yml
+2
-2
No files found.
cost-service/src/main/java/com/blt/other/module/cost/service/impl/cost/AbstractCostService.java
View file @
bada4c4a
...
...
@@ -39,6 +39,7 @@ import com.blt.other.module.netsuite.dao.NetsuiteLogDao;
import
com.blt.other.module.netsuite.dto.NetsuiCostinfoDto
;
import
com.blt.other.module.netsuite.dto.NetsuiteDataDto
;
import
com.blt.other.module.netsuite.model.NetsuiteLogDomain
;
import
com.blt.other.module.sys.model.CostReviewer
;
import
com.blt.other.module.sys.service.UserService
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
...
...
@@ -195,6 +196,15 @@ public abstract class AbstractCostService implements CostService {
Integer
update
=
costDao
.
update
(
costDomain
,
new
LambdaQueryWrapper
<
CostDomain
>()
.
eq
(
CostDomain:
:
getCostNo
,
costDomain
.
getCostNo
()));
//费用单明细
if
(
costDomain
.
getCostDetailDomainList
()
!=
null
&&
costDomain
.
getCostDetailDomainList
().
size
()
>
0
)
{
for
(
CostDetailDomain
costDetailDomain:
costDomain
.
getCostDetailDomainList
())
{
// costReviewerMapper.delete(new LambdaQueryWrapper<CostReviewer>()
// .eq(CostReviewer::getType, CostReviewer.finalReviewer)
// .eq(CostReviewer::getReferId, costCompanyDomain.getId()));
// baseMapper.updateById(costDetailDomain);
}
}
resp
.
setMsg
(
"success"
);
resp
.
setResult
(
this
.
getCostByCostNo
(
costDomain
.
getCostNo
()));
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costplan/CostPlanNewLend1ServiceImpl.java
View file @
bada4c4a
...
...
@@ -5,13 +5,19 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.common.util.CurUtils
;
import
com.blt.other.database.model.CostPlanDomain
;
import
com.blt.other.database.model.CostPlanTempDomain
;
import
com.blt.other.database.model.CostTypeDomain
;
import
com.blt.other.module.cost.model.CostDetailDomain
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.service.CostPlanService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.stream.Collectors
;
/**
* <p>
...
...
@@ -29,6 +35,8 @@ public class CostPlanNewLend1ServiceImpl extends AbstractCostPlanService impleme
public
void
save
(
CostPlanDomain
planDomain
)
{
this
.
doSaveFinanceRecord
(
planDomain
);
this
.
completedCostPlan
(
planDomain
);
//子项目和借支总金额
planDomain
.
setPlanAmount
(
this
.
SaveCostPlanTemp
(
planDomain
));
planDomain
.
setCostPlanStatus
(
0
);
planDomain
.
setLendStatus
(
1
);
...
...
@@ -50,7 +58,8 @@ public class CostPlanNewLend1ServiceImpl extends AbstractCostPlanService impleme
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNo
(
planDomain
.
getTypeNo
());
planDomain
.
setTypeId
(
costTypeDomain
.
getId
());
//子项目和借支总金额
planDomain
.
setPlanAmount
(
this
.
SaveCostPlanTemp
(
planDomain
));
costPlanDao
.
update
(
planDomain
,
new
LambdaQueryWrapper
<
CostPlanDomain
>()
.
eq
(
CostPlanDomain:
:
getCostPlanNo
,
planDomain
.
getCostPlanNo
()));
}
...
...
@@ -81,7 +90,56 @@ public class CostPlanNewLend1ServiceImpl extends AbstractCostPlanService impleme
}
int
insert
=
costDao
.
insert
(
costDomain
);
//增加借支明细
List
<
CostPlanTempDomain
>
costPlanTempDomains
=
costPlanTempDao
.
selectListByPlanNo
(
costDomain
.
getCostPlanNo
());
if
(
costPlanTempDomains
!=
null
&&
costPlanTempDomains
.
size
()
>
0
)
{
AtomicInteger
index
=
new
AtomicInteger
(
1
);
List
<
CostDetailDomain
>
listCostDetail
=
costPlanTempDomains
.
stream
()
.
map
(
costPlanTempDomain
->
{
CostDetailDomain
costDetailDomain
=
this
.
tempToDetail
(
costPlanTempDomain
,
costPlanDomain
,
index
.
getAndIncrement
());
BeanUtils
.
copyProperties
(
costDomain
,
costDetailDomain
);
costDetailDomain
.
setAmount
(
costPlanTempDomain
.
getAmount
());
costDetailDomain
.
setProject
(
costPlanTempDomain
.
getProject
());
return
costDetailDomain
;
}).
collect
(
Collectors
.
toList
());
for
(
CostDetailDomain
costDetail
:
listCostDetail
)
{
if
(
StringUtils
.
isBlank
(
costDomain
.
getDic
())){
costDetail
.
setDic
(
"CNY"
);
}
if
(
StringUtils
.
isNotBlank
(
costDomain
.
getCategoryName
())){
costDetail
.
setCategoryName
(
costDomain
.
getCategoryName
());
}
else
{
costDetail
.
setCategoryName
((
StringUtils
.
isNotBlank
(
costDetail
.
getProject
())
&&
costDetail
.
getProject
().
equals
(
"集团"
)
?
"管理成本"
:
"日常费用"
));
}
// 生成付款费用详情
costDetailDao
.
insert
(
costDetail
);
}
}
costLogService
.
save
(
costDomain
.
getCostNo
(),
costDomain
.
getCreateUserid
(),
"由费用计划:"
+
costDomain
.
getCostPlanNo
()
+
" 生成借支单"
);
return
insert
;
}
private
BigDecimal
SaveCostPlanTemp
(
CostPlanDomain
planDomain
){
//子项目和借支总金额
BigDecimal
amount
=
BigDecimal
.
ZERO
;
if
(
planDomain
.
getCostPlanTempDomainList
()
!=
null
&&
planDomain
.
getCostPlanTempDomainList
().
size
()
>
0
)
{
costPlanTempDao
.
deletedByPlanNoAndTempNo
(
planDomain
.
getCostPlanNo
(),
planDomain
.
getCostPlanNo
());
for
(
CostPlanTempDomain
item:
planDomain
.
getCostPlanTempDomainList
())
{
BigDecimal
itemAmount
=
item
.
getAmount
();
String
itemProject
=
item
.
getProject
();
BeanUtils
.
copyProperties
(
planDomain
,
item
);
CostPlanTempDomain
costPlanTempDomain
=
new
CostPlanTempDomain
();
costPlanTempDomain
.
setCostPlanNo
(
planDomain
.
getCostPlanNo
());
costPlanTempDomain
.
setTempNo
(
planDomain
.
getCostPlanNo
());
costPlanTempDomain
.
setAmount
(
itemAmount
);
costPlanTempDomain
.
setProject
(
itemProject
);
costPlanTempDomain
.
setAccountingSubjectNo
(
""
);
//新增付款子项目
costPlanTempDao
.
insert
(
costPlanTempDomain
);
amount
=
amount
.
add
(
item
.
getAmount
());
}
planDomain
.
setPlanAmount
(
amount
);
}
return
amount
;
}
}
cost-service/src/main/resources/application-dev.yml
View file @
bada4c4a
...
...
@@ -2,9 +2,9 @@ spring:
# 数据源配置
datasource
:
driver-class-name
:
com.mysql.jdbc.Driver
url
:
jdbc:mysql://
cdb-aanqm573.gz.tencentcdb.com:10120/bailun_other?useUnicode=true&characterEncoding=utf-8&useSSL=false&zeroDateTimeBehavior=convertToNull
&rewriteBatchedStatements=true
url
:
jdbc:mysql://
gz-cdb-lnrmt5zh.sql.tencentcdb.com:61369/bailun_other?useUnicode=true&characterEncoding=UTF-8&useSSL=false
&rewriteBatchedStatements=true
username
:
root
password
:
'
Aarob2020#'
password
:
"
#7kfnymAM$Y9-Ntf"
# url: jdbc:mysql://gz-cdb-lnrmt5zh.sql.tencentcdb.com:61369/bailun_other?useUnicode=true&characterEncoding=UTF-8&useSSL=false&rewriteBatchedStatements=true
# username: root
# password: "#7kfnymAM$Y9-Ntf"
...
...
cost-service/src/main/resources/application-test.yml
View file @
bada4c4a
...
...
@@ -2,9 +2,9 @@ spring:
# 数据源配置
datasource
:
driver-class-name
:
com.mysql.jdbc.Driver
url
:
jdbc:mysql://
cdb-aanqm573.gz.tencentcdb.com:10120/bailun_other_pre?useUnicode=true&characterEncoding=utf-8&useSSL=false&zeroDateTimeBehavior=convertToNull
&rewriteBatchedStatements=true
url
:
jdbc:mysql://
gz-cdb-lnrmt5zh.sql.tencentcdb.com:61369/bailun_other?useUnicode=true&characterEncoding=UTF-8&useSSL=false
&rewriteBatchedStatements=true
username
:
root
password
:
'
Aarob2020#'
password
:
"
#7kfnymAM$Y9-Ntf"
hikari
:
maximum-pool-size
:
200
minimum-idle
:
10
...
...
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