Xiaojh преди 4 години
родител
ревизия
2809de1f2d

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

@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.apache.commons.lang3.StringUtils;
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
@@ -79,7 +80,7 @@ public class PayCustomerDto {
     public String[] valveRuleIds;
 
     public String[] getValveRuleIds() {
-        if(this.getValveRuleId() != null){
+        if(StringUtils.isNotBlank(this.getValveRuleId())){
             valveRuleIds = this.getValveRuleId().split(",");
         }
         return valveRuleIds;

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

@@ -645,7 +645,7 @@ public class PayFeeServiceImp implements PayFeeService {
         if(balancetype == 0){
             //如果有找零的记录,则  充值金额=实收金额-购水金额
             transAmount = transAmount.subtract(waterAmount);
-            if(transAmount.compareTo(BigDecimal.ZERO) == 1){
+            if(transAmount.compareTo(BigDecimal.ZERO) == -1){
                 throw new ServiceException(ResultStatus.PAYFEE_TRANAMOUNT_BELOW_ZERO);
             }
 

+ 9 - 4
smart-city-platform/src/main/resources/mapper/PayBaseCustomerandmeterrelaMapper.xml

@@ -406,15 +406,17 @@
         account.accountnumber as "accountnumber",
         account.calculateway as "calculateway",
         account.waterproperty_id as "waterPropertyId",
+        account.address as installAddress,
         device.metercode as "metercode",
         account.name as accountname,
         account.telephone as telephone,
         account.idcardno as idcardno,
         device.water_meter_no as "metereleno"
         from pay_base_account account
-        inner join sc_device device on account.id = device.account_id
+        inner join sc_device device on account.id = device.account_id and device.customer_id =#{customerId}
         <where>
             device.metercode not in(select metercode from pay_base_customerandmeterrela where businessstate = '1')
+            and device.water_meter_no is not null
             <if test="metercode != null">
                 and device.metercode like concat('%',#{metercode},'%')
             </if>
@@ -433,15 +435,17 @@
         account.accountnumber as "accountnumber",
         account.calculateway as "calculateway",
         account.waterproperty_id as "waterPropertyId",
+        account.address as installAddress,
         device.metercode as "metercode",
         account.name as accountname,
         account.telephone as telephone,
         account.idcardno as idcardno,
         device.water_meter_no as "metereleno"
         from pay_base_account account
-        inner join sc_device device on account.id = device.account_id
+        inner join sc_device device on account.id = device.account_id and device.customer_id =#{customerId}
         <where>
             device.id not in(select watermeter_id from pay_base_customerandmeterrela where businessstate = '1')
+            and device.water_meter_no is not null
             <if test="metereleno != null">
                 and device.water_meter_no like concat('%',#{metereleno},'%')
             </if>
@@ -463,9 +467,10 @@
             account.address as installAddress,
             device.water_meter_no as "metereleno"
         from pay_base_account account
-        inner join sc_device device on account.id = device.account_id
+        inner join sc_device device on account.id = device.account_id and device.customer_id =#{customerId}
         <where>
-            and (account.accountnumber not in (select accountnumber from pay_base_customerandmeterrela where businessstate ='1' ))
+            (account.accountnumber not in (select accountnumber from pay_base_customerandmeterrela where businessstate ='1' ))
+            and device.water_meter_no is not null
             <if test="accountnumber != null">
                 and account.accountnumber like concat('%',#{accountnumber},'%')
             </if>