Commit 1c417dfa authored by 季圣华's avatar 季圣华
Browse files

优化 查询存在欠款的单据接口

parent d117bd30
......@@ -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;
}
}
\ No newline at end of file
......@@ -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);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment