Quellcode durchsuchen

支持水表安装地址修改,修改5个接口

oppadmin vor 4 Jahren
Ursprung
Commit
c6ecc69cc4

+ 4 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dao/pay/PayBaseAccountMapper.java

@@ -53,4 +53,8 @@ public interface PayBaseAccountMapper {
     List<PayMeter>findMeterInfo(@Param("queryInfo") String queryInfo, @Param("address") String address,@Param("state") String state,  @Param("sortColumn") String sortColumn,@Param("sortOrder") String sortOrder, @Param("siteId") BigInteger siteId, @Param("customerId") BigInteger customerId,@Param("year") Integer year,@Param("month") Integer month,@Param("programItemList") List<ProgramItem> programItemList);
 
     void updateAccountName(@Param("type")Integer type,@Param("accountname")String accountname,@Param("accountId")BigInteger accountId);
+
+    int updateAccountAddr(@Param("accountId")BigInteger accountId,@Param("siteId") Integer siteId, @Param("customerId") Integer customerId,@Param("address") String address);
+
+    int updateDeviceAddr(@Param("accountId")BigInteger accountId,@Param("siteId") Integer siteId, @Param("customerId") Integer customerId,@Param("address") String address);
 }

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

@@ -45,4 +45,6 @@ public class PaySaveCustomerDto extends PayBaseCustomerandmeterrela {
     private String email;
     @ApiModelProperty(value = "公司税号", position = 13)
     private String vatno;
+    @ApiModelProperty(value = "设备安装地址", position = 14)
+    private String installAddress;
 }

+ 3 - 0
smart-city-platform/src/main/java/com/bz/smart_city/entity/pay/archives/CustomerListInfo.java

@@ -31,4 +31,7 @@ public class CustomerListInfo {
     private String idcardno;
     @ApiModelProperty(value = "水表电子号",position = 7)
     private String metereleno;
+
+    @ApiModelProperty(value = "水表安装地址", position =8 )
+    public String installAddress;
 }

+ 2 - 0
smart-city-platform/src/main/java/com/bz/smart_city/entity/pay/archives/PayAccountInfo.java

@@ -30,4 +30,6 @@ public class PayAccountInfo {
     @ApiModelProperty(value = "水表电子号", position =8 )
     public String metereleno;
 
+    @ApiModelProperty(value = "水表安装地址", position =9 )
+    public String installAddress;
 }

+ 10 - 0
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/pay/PayBaseAccountServiceImpl.java

@@ -405,5 +405,15 @@ public class PayBaseAccountServiceImpl implements PayBaseAccountService {
         return accountNumber;
     }
 
+    @Override
+    public int updateAddrs(BigInteger custoemrId,String newAddress){
+        LoginUser loginUser = getLoginUser();
+
+        payBaseAccountMapper.updateDeviceAddr(custoemrId,loginUser.getSiteId(),
+                loginUser.getCustomerId(),newAddress);
+        return payBaseAccountMapper.updateAccountAddr(custoemrId,loginUser.getSiteId(),
+                loginUser.getCustomerId(),newAddress);
+
+    }
 
 }

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

@@ -39,4 +39,6 @@ public interface PayBaseAccountService {
     //根据安装计划ID删除用户信息
     int delByPlanId(BigInteger planId);
 
+    int updateAddrs(BigInteger custoemrId,String newAddress);
+
 }

+ 10 - 0
smart-city-platform/src/main/java/com/bz/smart_city/service/pay/archives/impl/PayBaseCustomerandmeterrelaServiceImpl.java

@@ -437,6 +437,7 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
         saveAccount.setUpdateBy(new BigInteger(String.valueOf(loginUser.getId())));
         saveAccount.setUpdateDate(LocalDateTime.now());
         saveAccount.setEmail(paySaveCustomerDto.getEmail()); //邮箱
+        saveAccount.setAddress(paySaveCustomerDto.getInstallAddress());
         payBaseAccountService.edit(saveAccount);
 
         //修改预存账户名称
@@ -449,6 +450,10 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
         rechargeaccountDto.setCustomerId(new BigInteger(String.valueOf(loginUser.getCustomerId())));
         payRechargeaccountMapper.update(rechargeaccountDto);
 
+        //修改设备安装地址
+        payBaseAccountMapper.updateDeviceAddr(accounts.getId(),loginUser.getSiteId(),loginUser.getCustomerId(),
+                paySaveCustomerDto.getInstallAddress());
+
         //修改水表安装信息为已开户
         payBaseCustomerandmeterrelaMapper.updateMeterInstallOpen(2,loginUser.getUpdateBy(),LocalDateTime.now(),device.getId());
         if (customerList.size() > 0) {
@@ -718,6 +723,7 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
             saveAccount.setUpdateDate(LocalDateTime.now());
             saveAccount.setEmail(payBaseCustomerandmeterrela.getEmail()); //邮箱
             saveAccount.setWaterpropertyId(newWaterPropertyId);
+            saveAccount.setAddress(payBaseCustomerandmeterrela.getInstallAddress());
             payBaseAccountService.edit(saveAccount);
 
             //修改预存账户名称
@@ -754,6 +760,10 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
             //编辑开户修改其它地方客户名称
             this.updateAccountnameInfo(payBaseCustomerandmeterrela.getAccountname(),accounts.getId());
 
+            //修改地址
+            payBaseAccountMapper.updateDeviceAddr(accounts.getId(),loginUser.getSiteId(),loginUser.getCustomerId(),
+                    payBaseCustomerandmeterrela.getInstallAddress());
+
             return "修改成功";
         }else{
             throw new ServiceException(-900, "客户信息有误");

+ 3 - 0
smart-city-platform/src/main/resources/mapper/PayBaseCustomerandmeterrelaMapper.xml

@@ -397,6 +397,7 @@
             account.accountnumber as "accountnumber",
             account.calculateway as "calculateway",
             account.waterproperty_id as "waterPropertyId",
+            account.address as installAddress,
             device.metercode as "metercode",
             sil.user_name as accountname,
             sil.user_phone as telephone,
@@ -425,6 +426,7 @@
             account.accountnumber as "accountnumber",
             account.calculateway as "calculateway",
             account.waterproperty_id as "waterPropertyId",
+            account.address as installAddress,
             device.metercode as "metercode",
             sil.user_name as accountname,
             sil.user_phone as telephone,
@@ -452,6 +454,7 @@
         select
             accountnumber as "accountnumber",
             calculateway as "calculateway" ,
+            account.address as installAddress,
             waterproperty_id as "waterPropertyId",
             device.water_meter_no as "metereleno"
         from pay_base_account account

+ 13 - 0
smart-city-platform/src/main/resources/mapper/pay/PayBaseAccountMapper.xml

@@ -626,4 +626,17 @@
             update pay_pay_messagesendrecord set accountname =#{accountname} where account_id =#{accountId}
         </if>
     </update>
+
+    <update id="updateAccountAddr">
+        update pay_base_account set address = #{address}
+        where  id = #{accountId}
+        <if test="siteId != null "> and site_id = #{siteId}</if>
+         <if test="customerId != null"> and customer_id = #{customerId}</if>
+    </update>
+
+    <update id="updateDeviceAddr">
+        update sc_device set loc_desc = #{address}
+        where  account_id = #{accountId}
+        <if test="customerId != null"> and customer_id = #{customerId}</if>
+    </update>
 </mapper>