|
@@ -98,8 +98,9 @@ public class FinCostCalCommonCusHelper {
|
|
});
|
|
});
|
|
|
|
|
|
QFilter noRateFilter = (new QFilter("billstatus", "=", BillStatusEnum.AUDIT.getValue())).and("confirmstatus", "=", ConfirmStatusEnum.YETCONFIRM.getValue()).and("bizdate", "<=", endDateBal);
|
|
QFilter noRateFilter = (new QFilter("billstatus", "=", BillStatusEnum.AUDIT.getValue())).and("confirmstatus", "=", ConfirmStatusEnum.YETCONFIRM.getValue()).and("bizdate", "<=", endDateBal);
|
|
- noRateFilter = noRateFilter.copy().and("loans.e_loanbill", "in", noRateIdList);
|
|
|
|
- DataSet notRateRepaymentDs = QueryServiceHelper.queryDataSet("getRepaymentDs_notsl", "cfm_repaymentbill", "loans.e_loanbill.id loanid, bizdate repaydate, loans.e_repayamount repayamt", new QFilter[]{noRateFilter}, "loans.e_loanbill, bizdate");
|
|
|
|
|
|
+ noRateFilter = noRateFilter.copy().and("loans.e_loanbill.id", "in", noRateIdList);
|
|
|
|
+
|
|
|
|
+ DataSet notRateRepaymentDs = QueryServiceHelper.queryDataSet("getRepaymentDs_notsl", "cfm_repaymentbill", "loans.e_loanbill.id loanid, bizdate repaydate, loans.e_repayamount repayamt", new QFilter[]{noRateFilter}, "loans.e_loanbill.id, bizdate");
|
|
notRateRepaymentDs = noRateDataSet.copy().join(notRateRepaymentDs).on("id", "loanid").select(new String[]{"id as loanid", "drawamount"}, new String[]{"repaydate", "repayamt"}).finish();
|
|
notRateRepaymentDs = noRateDataSet.copy().join(notRateRepaymentDs).on("id", "loanid").select(new String[]{"id as loanid", "drawamount"}, new String[]{"repaydate", "repayamt"}).finish();
|
|
|
|
|
|
DataSet unionDataSet = noRateDataSet.copy().select("id as loanid", "drawamount", "startintdate as repaydate", "0 as repayamt").union(notRateRepaymentDs).orderBy(new String[]{"loanid", "repaydate"});
|
|
DataSet unionDataSet = noRateDataSet.copy().select("id as loanid", "drawamount", "startintdate as repaydate", "0 as repayamt").union(notRateRepaymentDs).orderBy(new String[]{"loanid", "repaydate"});
|
|
@@ -120,22 +121,23 @@ public class FinCostCalCommonCusHelper {
|
|
while(var8.hasNext()) {
|
|
while(var8.hasNext()) {
|
|
Row resultRes = (Row)var8.next();
|
|
Row resultRes = (Row)var8.next();
|
|
Long loanid = resultRes.getLong("loanid");
|
|
Long loanid = resultRes.getLong("loanid");
|
|
- tempEDate = getDateAfterAddDays(resultRes.getDate("repaydate"), -1);
|
|
|
|
- tempAmount = resultRes.getBigDecimal("drawamount");
|
|
|
|
|
|
|
|
if(i > 0) {
|
|
if(i > 0) {
|
|
if (tempId.compareTo(loanid) == 0) {
|
|
if (tempId.compareTo(loanid) == 0) {
|
|
builder.append(new Object[]{tempId, tempSDate, tempEDate, tempAmount.subtract(tempSubAmount), BigDecimal.ZERO});
|
|
builder.append(new Object[]{tempId, tempSDate, tempEDate, tempAmount.subtract(tempSubAmount), BigDecimal.ZERO});
|
|
} else {
|
|
} else {
|
|
builder.append(new Object[]{tempId, tempSDate, getDateAfterAddDays(endDateBal, -1), tempAmount.subtract(tempSubAmount), BigDecimal.ZERO});
|
|
builder.append(new Object[]{tempId, tempSDate, getDateAfterAddDays(endDateBal, -1), tempAmount.subtract(tempSubAmount), BigDecimal.ZERO});
|
|
- tempSubAmount = resultRes.getBigDecimal("repayamt");
|
|
|
|
|
|
+ tempSubAmount = BigDecimal.ZERO;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
i++;
|
|
i++;
|
|
|
|
+
|
|
|
|
+ tempId = loanid;
|
|
tempSDate = resultRes.getDate("repaydate");
|
|
tempSDate = resultRes.getDate("repaydate");
|
|
|
|
+ tempEDate = getDateAfterAddDays(resultRes.getDate("repaydate"), -1);
|
|
tempSubAmount = tempSubAmount.add(resultRes.getBigDecimal("repayamt"));
|
|
tempSubAmount = tempSubAmount.add(resultRes.getBigDecimal("repayamt"));
|
|
- tempId = loanid;
|
|
|
|
|
|
+ tempAmount = resultRes.getBigDecimal("drawamount");
|
|
}
|
|
}
|
|
|
|
|
|
builder.append(new Object[]{tempId, tempSDate, getDateAfterAddDays(endDateBal, -1), tempAmount.subtract(tempSubAmount), BigDecimal.ZERO});
|
|
builder.append(new Object[]{tempId, tempSDate, getDateAfterAddDays(endDateBal, -1), tempAmount.subtract(tempSubAmount), BigDecimal.ZERO});
|