Procházet zdrojové kódy

优化费用统计表

Your Name před 2 roky
rodič
revize
112acc0fe5

+ 7 - 1
service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthImpl.java

@@ -125,6 +125,7 @@ public class PayFeeMonthImpl implements IPayFeeMonth {
         //todo 生成 月离散数据
         PayFeeDetailMonthPo tmpPayFeeDetailMonthPo;
         List<PayFeeDetailMonthPo> payFeeDetailMonthPos = new ArrayList<>();
+        double receivableAmount = 0.0;
         for (int month = 0; month < maxMonth; month++) {
             Calendar calendar = Calendar.getInstance();
             calendar.setTime(startTime);
@@ -136,7 +137,12 @@ public class PayFeeMonthImpl implements IPayFeeMonth {
             tmpPayFeeDetailMonthPo.setDetailId(payFeeMonthHelp.getFeeDetailId(feeDetailDtos, calendar.getTime()));
             tmpPayFeeDetailMonthPo.setDetailYear(calendar.get(Calendar.YEAR) + "");
             tmpPayFeeDetailMonthPo.setDetailMonth((calendar.get(Calendar.MONTH) + 1) + "");
-            tmpPayFeeDetailMonthPo.setReceivableAmount(payFeeMonthHelp.getReceivableAmount(feeDetailDtos, feePrice, calendar.getTime(), feeDto) + "");
+            receivableAmount = payFeeMonthHelp.getReceivableAmount(feeDetailDtos, feePrice, calendar.getTime(), feeDto);
+            //todo 应收小于等于0 不统计
+            if(receivableAmount <=0){
+                continue;
+            }
+            tmpPayFeeDetailMonthPo.setReceivableAmount( receivableAmount + "");
             tmpPayFeeDetailMonthPo.setReceivedAmount(payFeeMonthHelp.getReceivedAmount(feeDetailDtos, feePrice, calendar.getTime(), feeDto) + "");
             tmpPayFeeDetailMonthPo.setDiscountAmount(
                     payFeeMonthHelp.getDiscountAmount(Double.parseDouble(tmpPayFeeDetailMonthPo.getReceivableAmount()),