Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-operate-sys-cscec
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
fulixin
dsk-operate-sys-cscec
Commits
8dcf3342
Commit
8dcf3342
authored
Mar 28, 2024
by
chenyuefang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
6b5ce769
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
31 deletions
+36
-31
CbSummaryServiceImpl.java
...java/com/dsk/cscec/service/impl/CbSummaryServiceImpl.java
+29
-29
CbSummaryMapper.xml
...z-api/src/main/resources/mapper/cscec/CbSummaryMapper.xml
+7
-2
No files found.
dsk-module/dsk-biz-api/src/main/java/com/dsk/cscec/service/impl/CbSummaryServiceImpl.java
View file @
8dcf3342
...
...
@@ -330,18 +330,18 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
if
(
ObjectUtil
.
isEmpty
(
cbSummaryActualListVo
))
{
return
list
;
}
//截至本月费用汇总
Map
<
String
,
BigDecimal
>
parentTotal
=
cbSummaryActualMapper
.
getTotal
(
cbSummaryActualListVo
.
getId
(),
bo
.
getExpenseDate
());
cbSummaryActualListVo
.
setTaxExclusiveExpenseTotal
(
parentTotal
.
get
(
"taxExclusiveExpenseTotal"
).
doubleValue
());
cbSummaryActualListVo
.
setTaxInclusiveExpenseTotal
(
parentTotal
.
get
(
"taxInclusiveExpenseTotal"
).
doubleValue
());
//
//截至本月费用汇总
//
Map<String, BigDecimal> parentTotal = cbSummaryActualMapper.getTotal(cbSummaryActualListVo.getId(), bo.getExpenseDate());
//
cbSummaryActualListVo.setTaxExclusiveExpenseTotal(parentTotal.get("taxExclusiveExpenseTotal").doubleValue());
//
cbSummaryActualListVo.setTaxInclusiveExpenseTotal(parentTotal.get("taxInclusiveExpenseTotal").doubleValue());
List
<
CbSummaryActualListVo
>
childrenList
=
baseMapper
.
getByParentId
(
bo
.
getId
(),
bo
.
getExpenseDate
());
//截至本月费用汇总
childrenList
.
parallelStream
().
forEach
(
children
->
{
Map
<
String
,
BigDecimal
>
total
=
cbSummaryActualMapper
.
getTotal
(
children
.
getId
(),
bo
.
getExpenseDate
());
children
.
setTaxExclusiveExpenseTotal
(
total
.
get
(
"taxExclusiveExpenseTotal"
).
doubleValue
());
children
.
setTaxInclusiveExpenseTotal
(
total
.
get
(
"taxInclusiveExpenseTotal"
).
doubleValue
());
});
//
//截至本月费用汇总
//
childrenList.parallelStream().forEach(children -> {
//
Map<String, BigDecimal> total = cbSummaryActualMapper.getTotal(children.getId(), bo.getExpenseDate());
//
children.setTaxExclusiveExpenseTotal(total.get("taxExclusiveExpenseTotal").doubleValue());
//
children.setTaxInclusiveExpenseTotal(total.get("taxInclusiveExpenseTotal").doubleValue());
//
});
if
(
CollectionUtil
.
isNotEmpty
(
childrenList
))
{
cbSummaryActualListVo
.
setHasChildren
(
1
);
}
else
{
...
...
@@ -390,23 +390,23 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
if
(
ObjectUtil
.
isEmpty
(
cbSummaryActualListVo
))
{
return
new
ArrayList
<>();
}
//截至本月费用汇总
Map
<
String
,
BigDecimal
>
parentTotal
=
cbSummaryActualMapper
.
getTotal
(
cbSummaryActualListVo
.
getId
(),
bo
.
getExpenseDate
());
cbSummaryActualListVo
.
setTaxExclusiveExpenseTotal
(
parentTotal
.
get
(
"taxExclusiveExpenseTotal"
).
doubleValue
());
cbSummaryActualListVo
.
setTaxInclusiveExpenseTotal
(
parentTotal
.
get
(
"taxInclusiveExpenseTotal"
).
doubleValue
());
//
//截至本月费用汇总
//
Map<String, BigDecimal> parentTotal = cbSummaryActualMapper.getTotal(cbSummaryActualListVo.getId(), bo.getExpenseDate());
//
cbSummaryActualListVo.setTaxExclusiveExpenseTotal(parentTotal.get("taxExclusiveExpenseTotal").doubleValue());
//
cbSummaryActualListVo.setTaxInclusiveExpenseTotal(parentTotal.get("taxInclusiveExpenseTotal").doubleValue());
List
<
CbSummaryActualListVo
>
childrenList
=
baseMapper
.
getByParentId
(
bo
.
getId
(),
bo
.
getExpenseDate
());
//截至本月费用汇总
childrenList
.
parallelStream
().
forEach
(
children
->
{
Map
<
String
,
BigDecimal
>
total
=
cbSummaryActualMapper
.
getTotal
(
children
.
getId
(),
bo
.
getExpenseDate
());
children
.
setTaxExclusiveExpenseTotal
(
total
.
get
(
"taxExclusiveExpenseTotal"
).
doubleValue
());
children
.
setTaxInclusiveExpenseTotal
(
total
.
get
(
"taxInclusiveExpenseTotal"
).
doubleValue
());
});
if
(
CollectionUtil
.
isNotEmpty
(
childrenList
))
{
cbSummaryActualListVo
.
setHasChildren
(
1
);
}
else
{
cbSummaryActualListVo
.
setHasChildren
(
0
);
}
//
//截至本月费用汇总
//
childrenList.parallelStream().forEach(children -> {
//
Map<String, BigDecimal> total = cbSummaryActualMapper.getTotal(children.getId(), bo.getExpenseDate());
//
children.setTaxExclusiveExpenseTotal(total.get("taxExclusiveExpenseTotal").doubleValue());
//
children.setTaxInclusiveExpenseTotal(total.get("taxInclusiveExpenseTotal").doubleValue());
//
});
//
if (CollectionUtil.isNotEmpty(childrenList)) {
//
cbSummaryActualListVo.setHasChildren(1);
//
} else {
//
cbSummaryActualListVo.setHasChildren(0);
//
}
if
(
0
==
cbSummaryActualListVo
.
getLevel
()
&&
1
==
bo
.
getCbType
())
{
//项目汇总一级列表
...
...
@@ -444,10 +444,10 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
childBo
.
setId
(
children
.
getId
());
childBo
.
setExpenseDate
(
bo
.
getExpenseDate
());
children
.
setChildren
(
getProjectSumList
(
childBo
));
//截至本月费用汇总
Map
<
String
,
BigDecimal
>
total
=
cbSummaryActualMapper
.
getTotal
(
children
.
getId
(),
bo
.
getExpenseDate
());
children
.
setTaxExclusiveExpenseTotal
(
total
.
get
(
"taxExclusiveExpenseTotal"
).
doubleValue
());
children
.
setTaxInclusiveExpenseTotal
(
total
.
get
(
"taxInclusiveExpenseTotal"
).
doubleValue
());
//
//截至本月费用汇总
//
Map<String, BigDecimal> total = cbSummaryActualMapper.getTotal(children.getId(), bo.getExpenseDate());
//
children.setTaxExclusiveExpenseTotal(total.get("taxExclusiveExpenseTotal").doubleValue());
//
children.setTaxInclusiveExpenseTotal(total.get("taxInclusiveExpenseTotal").doubleValue());
});
return
childrenList
;
...
...
dsk-module/dsk-biz-api/src/main/resources/mapper/cscec/CbSummaryMapper.xml
View file @
8dcf3342
...
...
@@ -30,20 +30,25 @@
</sql>
<select
id=
"getByParentId"
resultType=
"com.dsk.cscec.domain.vo.CbSummaryActualListVo"
>
select csu.*,csa.id actualId,csa.tax_inclusive_expense,csa.tax_exclusive_expense,csa.expense_date
select csu.*,csa.id actualId,csa.tax_inclusive_expense,csa.tax_exclusive_expense,csa.expense_date,
ifnull(sum(csa1.tax_inclusive_expense),0) taxInclusiveExpenseTotal,ifnull(sum(csa1.tax_exclusive_expense),0) taxExclusiveExpenseTotal
from cb_summary csu
left join cb_summary_actual csa on csu.id = csa.cb_summary_id and csa.expense_date = #{expenseDate} AND csa.del_flag = 0
left join cb_summary_actual csa1 on csu.id = csa1.cb_summary_id and csa1.expense_date
<
= #{expenseDate} AND csa.del_flag = 0
<where>
csu.parent_id = #{parentId}
and csu.del_flag = 0
</where>
group by csu.id
order by csu.sort
</select>
<select
id=
"getById"
resultType=
"com.dsk.cscec.domain.vo.CbSummaryActualListVo"
>
select csu.*,csa.id actualId,csa.tax_inclusive_expense,csa.tax_exclusive_expense,csa.expense_date
select csu.*,csa.id actualId,csa.tax_inclusive_expense,csa.tax_exclusive_expense,csa.expense_date,
ifnull(sum(csa1.tax_inclusive_expense),0) taxInclusiveExpenseTotal,ifnull(sum(csa1.tax_exclusive_expense),0) taxExclusiveExpenseTotal
from cb_summary csu
left join cb_summary_actual csa on csu.id = csa.cb_summary_id and csa.expense_date = #{expenseDate} AND csa.del_flag = 0
left join cb_summary_actual csa1 on csu.id = csa1.cb_summary_id and csa1.expense_date
<
= #{expenseDate} AND csa.del_flag = 0
<where>
csu.id = #{id}
and csu.del_flag = 0
...
...
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