Преглед изворни кода

欠费用户明细报表修改:只显示欠费用户有欠费的记录统计,欠费金额 = 预存帐户余额 - 实收欠费

oppadmin пре 3 година
родитељ
комит
be9c2bdf6c

+ 2 - 0
smart-city-platform/src/main/java/com/bz/smart_city/commom/util/ReflectionsUtil.java

@@ -70,6 +70,8 @@ public class ReflectionsUtil {
         Object result = null;
         try {
             result = field.get(obj);
+            if(result == null)
+                result = 0;
         } catch (IllegalAccessException e) {
             log.error("不可能抛出的异常{}", e.getMessage());
         }

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/dto/pay/PayArrearagedetailsReportDto.java

@@ -52,7 +52,7 @@ public class PayArrearagedetailsReportDto {
     @ApiModelProperty(value = "欠费合计")
     private BigDecimal debtFee;
 
-    @ApiModelProperty(value = "小计")
+    @ApiModelProperty(value = "欠费金额 = 预存帐户余额 - 欠费")
     private BigDecimal subtotal;
 
     @ApiModelProperty(value = "小区ID",example = "027")

+ 5 - 5
smart-city-platform/src/main/resources/mapper/pay/PayReportMapper.xml

@@ -177,12 +177,14 @@
             sum( CASE WHEN pprb.feetype = 6 THEN pprb.receivablefee ELSE 0 END ) as penltyFee,
             sum( CASE WHEN pprb.feetype = 1 THEN pprb.payamount ELSE 0 END ) payamount,
             sum( CASE WHEN pprb.ladderlevel != 1 THEN pprb.receivablefee ELSE 0 END ) as outLevelFee,
-            sum( CASE WHEN pprb.receivablefee IS NULL THEN 0 ELSE pprb.receivablefee END ) as subtotal,
+            ppr.remaining - sum( CASE WHEN pprb.debt IS NULL THEN 0 ELSE pprb.debt END ) as subtotal,
             sum( CASE WHEN pprb.debt IS NULL THEN 0 ELSE pprb.debt END ) as debtFee
         FROM
             pay_pay_receivable pprb
             LEFT JOIN pay_base_account pba ON pba.id = pprb.account_id
+            LEFT JOIN pay_pay_rechargeaccount ppr on ppr.account_id = pprb.account_id
         <where>
+            pprb.debt > 0
             <if test="customerId != null"> and pprb.customer_id = #{customerId}</if>
             <if test="siteId != null"> and pprb.site_id = #{siteId}</if>
             <if test="officeId != null"> and pprb.office_id = #{officeId}</if>
@@ -192,13 +194,11 @@
         </where>
 
         GROUP BY
-            pba.NAME,
             pba.NAME,
             pba.accountnumber,
             pba.address,
-            pba.mobilephone
-        HAVING
-            sum( CASE WHEN pprb.debt IS NULL THEN 0 ELSE pprb.debt END )> 0
+            pba.mobilephone,
+            ppr.remaining
         ORDER BY accountnumber asc
     </select>