java110 лет назад: 4
Родитель
Сommit
c7e75b55da

+ 1 - 1
java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml

@@ -315,7 +315,7 @@
     <select id="queryReportFeeSummary" parameterType="Map" resultType="Map">
         select t.fee_year feeYear,t.fee_month feeMonth,t.create_time createTime,SUM(t.his_owe_amount) hisOweAmount,SUM(t.cur_receivable_amount) curReceivableAmount,
         SUM(t.cur_received_amount) curReceivedAmount,SUM(t.his_owe_received_amount) hisOweReceivedAmount,SUM(t.pre_received_amount) preReceivedAmount,
-        max(t.update_time) updateTime,sum(t.his_owe_amount+t.cur_receivable_amount) receivedAmount,sum(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) receivedAmount
+        max(t.update_time) updateTime,sum(t.his_owe_amount+t.cur_receivable_amount) receivableAmount,sum(t.cur_received_amount+t.his_owe_received_amount+t.pre_received_amount) receivedAmount
         from report_fee_month_statistics t
         left join building_room br on t.obj_id = br.room_id and t.obj_type = '3333' and br.status_cd = '0'
         left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'

+ 14 - 3
service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java

@@ -33,7 +33,12 @@ import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
 import java.text.ParseException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @Service("getReportFeeMonthStatisticsBMOImpl")
 public class GetReportFeeMonthStatisticsBMOImpl implements IGetReportFeeMonthStatisticsBMO {
@@ -93,9 +98,15 @@ public class GetReportFeeMonthStatisticsBMOImpl implements IGetReportFeeMonthSta
                 double receivableAmount = Double.parseDouble(reportFeeMonthStatistics.getReceivableAmount());
                 //获取实收金额
                 double receivedAmount = Double.parseDouble(reportFeeMonthStatistics.getReceivedAmount());
-                double chargeRate = (receivedAmount / receivableAmount) * 100.0;
-                reportFeeMonthStatistics.setChargeRate(String.format("%.2f", chargeRate) + "%");
+                if (receivableAmount != 0) {
+                    double chargeRate = (receivedAmount / receivableAmount) * 100.0;
+                    reportFeeMonthStatistics.setChargeRate(String.format("%.2f", chargeRate) + "%");
+                } else {
+                    reportFeeMonthStatistics.setChargeRate("0%");
+
+                }
                 reportFeeMonthStatisticsDtos.add(reportFeeMonthStatistics);
+
             }
             ReportFeeMonthStatisticsDto tmpReportFeeMonthStatisticsDto = reportFeeMonthStatisticsInnerServiceSMOImpl.queryReportFeeSummaryMajor(reportFeeMonthStatisticsDto);
             if (reportFeeMonthStatisticsList != null && reportFeeMonthStatisticsList.size() > 0) {