demand: TMS系统财务销账优化
committer: heyu
This commit is contained in:
parent
7f2f7d8c1d
commit
ec969a10ca
@ -84,9 +84,13 @@ public class EmisWriteoffApplyController extends EmisBaseController {
|
|||||||
// 提取账单名称列表(去重)
|
// 提取账单名称列表(去重)
|
||||||
List<String> billNames = apply.getDetailList().stream()
|
List<String> billNames = apply.getDetailList().stream()
|
||||||
.filter(detail -> detail != null)
|
.filter(detail -> detail != null)
|
||||||
.map(detail -> detail.getEmisSettleBill() != null
|
.map(detail -> {
|
||||||
? detail.getEmisSettleBill().getSettleBillName()
|
if (detail.getEmisSettleBill() != null
|
||||||
: null)
|
&& detail.getEmisSettleBill().getSettleBillName() != null) {
|
||||||
|
return detail.getEmisSettleBill().getSettleBillName();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
})
|
||||||
.filter(name -> name != null && !name.trim().isEmpty())
|
.filter(name -> name != null && !name.trim().isEmpty())
|
||||||
.distinct()
|
.distinct()
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
@ -95,7 +99,7 @@ public class EmisWriteoffApplyController extends EmisBaseController {
|
|||||||
// 提取账单号列表(去重)
|
// 提取账单号列表(去重)
|
||||||
List<String> billNos = apply.getDetailList().stream()
|
List<String> billNos = apply.getDetailList().stream()
|
||||||
.filter(detail -> detail != null)
|
.filter(detail -> detail != null)
|
||||||
.map(detail -> detail.getSettleBillNo())
|
.map(detail -> detail.getSettleBillNo() != null ? detail.getSettleBillNo() : "")
|
||||||
.filter(no -> no != null && !no.trim().isEmpty())
|
.filter(no -> no != null && !no.trim().isEmpty())
|
||||||
.distinct()
|
.distinct()
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
@ -104,8 +108,13 @@ public class EmisWriteoffApplyController extends EmisBaseController {
|
|||||||
// 计算账单金额总和
|
// 计算账单金额总和
|
||||||
BigDecimal totalAmount = apply.getDetailList().stream()
|
BigDecimal totalAmount = apply.getDetailList().stream()
|
||||||
.filter(detail -> detail != null)
|
.filter(detail -> detail != null)
|
||||||
.map(detail -> detail.getEmisSettleBill() != null ? detail.getEmisSettleBill().getRecMoney()
|
.map(detail -> {
|
||||||
: BigDecimal.ZERO)
|
if (detail.getEmisSettleBill() != null
|
||||||
|
&& detail.getEmisSettleBill().getRecMoney() != null) {
|
||||||
|
return detail.getEmisSettleBill().getRecMoney();
|
||||||
|
}
|
||||||
|
return BigDecimal.ZERO;
|
||||||
|
})
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
apply.setApplyRecMoney(totalAmount);
|
apply.setApplyRecMoney(totalAmount);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user