소스 검색

融资加权平均成本总表
1、处理年利率为0的取数bug

wanghaiwu 1 개월 전
부모
커밋
e1ed8703b8
1개의 변경된 파일8개의 추가작업 그리고 6개의 파일을 삭제
  1. 8 6
      main/java/kd/cosmic/jkjt/tmc/cfm/report/data/FinCostCalCommonCusHelper.java

+ 8 - 6
main/java/kd/cosmic/jkjt/tmc/cfm/report/data/FinCostCalCommonCusHelper.java

@@ -98,8 +98,9 @@ public class FinCostCalCommonCusHelper {
         });
 
         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();
 
         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()) {
             Row resultRes = (Row)var8.next();
             Long loanid = resultRes.getLong("loanid");
-            tempEDate = getDateAfterAddDays(resultRes.getDate("repaydate"), -1);
-            tempAmount = resultRes.getBigDecimal("drawamount");
 
             if(i > 0) {
                 if (tempId.compareTo(loanid) == 0) {
                     builder.append(new Object[]{tempId, tempSDate, tempEDate, tempAmount.subtract(tempSubAmount), BigDecimal.ZERO});
                 } else {
                     builder.append(new Object[]{tempId, tempSDate, getDateAfterAddDays(endDateBal, -1), tempAmount.subtract(tempSubAmount), BigDecimal.ZERO});
-                    tempSubAmount = resultRes.getBigDecimal("repayamt");
+                    tempSubAmount = BigDecimal.ZERO;
                 }
             }
 
             i++;
+
+            tempId = loanid;
             tempSDate = resultRes.getDate("repaydate");
+            tempEDate = getDateAfterAddDays(resultRes.getDate("repaydate"), -1);
             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});