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()
|
||||
.filter(detail -> detail != null)
|
||||
.map(detail -> detail.getEmisSettleBill() != null
|
||||
? detail.getEmisSettleBill().getSettleBillName()
|
||||
: null)
|
||||
.map(detail -> {
|
||||
if (detail.getEmisSettleBill() != null
|
||||
&& detail.getEmisSettleBill().getSettleBillName() != null) {
|
||||
return detail.getEmisSettleBill().getSettleBillName();
|
||||
}
|
||||
return null;
|
||||
})
|
||||
.filter(name -> name != null && !name.trim().isEmpty())
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
@ -95,7 +99,7 @@ public class EmisWriteoffApplyController extends EmisBaseController {
|
||||
// 提取账单号列表(去重)
|
||||
List<String> billNos = apply.getDetailList().stream()
|
||||
.filter(detail -> detail != null)
|
||||
.map(detail -> detail.getSettleBillNo())
|
||||
.map(detail -> detail.getSettleBillNo() != null ? detail.getSettleBillNo() : "")
|
||||
.filter(no -> no != null && !no.trim().isEmpty())
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
@ -104,8 +108,13 @@ public class EmisWriteoffApplyController extends EmisBaseController {
|
||||
// 计算账单金额总和
|
||||
BigDecimal totalAmount = apply.getDetailList().stream()
|
||||
.filter(detail -> detail != null)
|
||||
.map(detail -> detail.getEmisSettleBill() != null ? detail.getEmisSettleBill().getRecMoney()
|
||||
: BigDecimal.ZERO)
|
||||
.map(detail -> {
|
||||
if (detail.getEmisSettleBill() != null
|
||||
&& detail.getEmisSettleBill().getRecMoney() != null) {
|
||||
return detail.getEmisSettleBill().getRecMoney();
|
||||
}
|
||||
return BigDecimal.ZERO;
|
||||
})
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
apply.setApplyRecMoney(totalAmount);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user