优化 查询存在欠款的单据接口
This commit is contained in:
@@ -37,6 +37,10 @@ public class DepotHeadVo4List extends DepotHead{
|
||||
|
||||
private BigDecimal finishDeposit;
|
||||
|
||||
private BigDecimal needDebt;
|
||||
|
||||
private BigDecimal debt;
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
@@ -156,4 +160,20 @@ public class DepotHeadVo4List extends DepotHead{
|
||||
public void setFinishDeposit(BigDecimal finishDeposit) {
|
||||
this.finishDeposit = finishDeposit;
|
||||
}
|
||||
|
||||
public BigDecimal getNeedDebt() {
|
||||
return needDebt;
|
||||
}
|
||||
|
||||
public void setNeedDebt(BigDecimal needDebt) {
|
||||
this.needDebt = needDebt;
|
||||
}
|
||||
|
||||
public BigDecimal getDebt() {
|
||||
return debt;
|
||||
}
|
||||
|
||||
public void setDebt(BigDecimal debt) {
|
||||
this.debt = debt;
|
||||
}
|
||||
}
|
||||
@@ -1019,7 +1019,18 @@ public class DepotHeadService {
|
||||
if(dh.getOperTime() != null) {
|
||||
dh.setOperTimeStr(getCenternTime(dh.getOperTime()));
|
||||
}
|
||||
dh.setFinishDebt(accountItemService.getEachAmountByBillId(dh.getId()));
|
||||
BigDecimal discountLastMoney = dh.getDiscountLastMoney()!=null?dh.getDiscountLastMoney():BigDecimal.ZERO;
|
||||
BigDecimal otherMoney = dh.getOtherMoney()!=null?dh.getOtherMoney():BigDecimal.ZERO;
|
||||
BigDecimal deposit = dh.getDeposit()!=null?dh.getDeposit():BigDecimal.ZERO;
|
||||
BigDecimal changeAmount = dh.getChangeAmount()!=null?dh.getChangeAmount():BigDecimal.ZERO;
|
||||
//欠款
|
||||
dh.setNeedDebt(discountLastMoney.add(otherMoney).subtract(deposit.add(changeAmount)));
|
||||
BigDecimal finishDebt = accountItemService.getEachAmountByBillId(dh.getId());
|
||||
finishDebt = finishDebt!=null?finishDebt:BigDecimal.ZERO;
|
||||
//已收欠款
|
||||
dh.setFinishDebt(finishDebt);
|
||||
//待收欠款
|
||||
dh.setDebt(discountLastMoney.add(otherMoney).subtract(deposit.add(changeAmount).add(finishDebt)));
|
||||
dh.setMaterialsList(findMaterialsListByHeaderId(dh.getId()));
|
||||
resList.add(dh);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user