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

柜台缴费:账单详情里添加账户余额

wangli пре 4 година
родитељ
комит
f99fda26d8

+ 2 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dto/pay/payfee/PayfeeDetaileBill.java

@@ -20,4 +20,6 @@ public class PayfeeDetaileBill {
     private Double waterFee;
     @ApiModelProperty(value = "应缴金额")
     private Double receivableFee;
+    @ApiModelProperty(value = "账户余额")
+    private Double remaining;
 }

+ 2 - 2
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/pay/IssueElectronicInvoiceServiceImpl.java

@@ -91,9 +91,9 @@ public class IssueElectronicInvoiceServiceImpl implements IssueElectronicInvoice
         List<PayInvoiceParam> payInvoiceParams = payInvoiceParamService.findList(null, siteId, customerId);
         for (PayInvoiceParam item : payInvoiceParams) {
             if (item.getTaxrate() != null) {
-                BigDecimal taxRate = BigDecimal.valueOf(Long.parseLong(item.getTaxrate())).setScale(2, BigDecimal.ROUND_HALF_UP);
+                BigDecimal taxRate = new BigDecimal(item.getTaxrate()).setScale(2, BigDecimal.ROUND_HALF_UP);
                 ;
-                taxRate = taxRate.divide(BigDecimal.valueOf(100));
+                taxRate = taxRate.divide(BigDecimal.valueOf(100),2,BigDecimal.ROUND_HALF_UP);
                 item.setTaxrate(String.valueOf(taxRate));
             }
             map.put(item.getFeetype(), item);

+ 1 - 0
smart-city-platform/src/main/resources/mapper/pay/payFeeMapper.xml

@@ -145,6 +145,7 @@
             (case when (IFNULL(sum(r.debt),0)-IFNULL(max(remaining ),0)) &lt;=0 then 0
             else (IFNULL(sum(r.debt),0)-IFNULL(max(remaining ),0) )end) as "receivableFee",
             IFNULL(max(remaining),0)-IFNULL(sum(r.debt),0) as "waterFee"
+            IFNULL(max(remaining),0) as "remaining"
         from pay_pay_rechargeaccount a
         left join pay_pay_receivable r on a.account_id=r.account_id
         where a.account_id = #{accountId}