Browse Source

安装计划同步接口修改

zhoujiangyuan 4 năm trước cách đây
mục cha
commit
850135b01f

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

@@ -130,12 +130,13 @@ public class PaySyncDataServiceImpl implements PaySyncDataService {
         //取客户编号
         String customerNo="";
         List<PayBaseConfigDto> payBaseConfigDtos = payBaseConfigService.getPrintInfo("CUSTOMER_NO",loginUser.getSiteId(),loginUser.getCustomerId());
-        for (PayBaseConfigDto item : payBaseConfigDtos){
-            if(item.getName().trim()=="CUSTOMER_NO"){
+        if(payBaseConfigDtos.size() == 1){
+            for (PayBaseConfigDto item : payBaseConfigDtos){
                 customerNo = item.getValue();
                 installPlanInput.setCustomerNo(customerNo);
             }
         }
+
         if(customerNo == "")
             throw new ServiceException(-900,"客户编号参数未配置"); //客户编号对应抄表系统中的customer_id
 
@@ -145,10 +146,11 @@ public class PaySyncDataServiceImpl implements PaySyncDataService {
         String communityAndBuildingAndUnitAddress="";  //小区 楼栋 单元地址
         String floorAddress="";
         String doorAddress="";
-        if (1==1) {
+        if (installPlanInput.getCommunityId() == null) {
             Community community = communityService.findByNameV2(siteId,installPlanInput.getProvince(),installPlanInput.getCity(),installPlanInput.getRegion(), installPlanInput.getCommunityName());
             if (community != null) {
                 installPlanInput.setCommunityId(community.getId());
+                code =String.format("%03d",Integer.valueOf(community.getCode()));
             } else {
                 Community newCommunity = new Community();
                 //获取小区最大值,然后加1
@@ -174,7 +176,12 @@ public class PaySyncDataServiceImpl implements PaySyncDataService {
                 //installPlanInput.setCommunityId(newCommunity.getId());
             }
         }
+        else {
+            Community community = communityService.findById(installPlanInput.getCommunityId());
+            code =String.format("%03d",Integer.valueOf(community.getCode()));
+        }
 
+        //取当前小区最大客户编号
         int maxAccountNumber = payBaseAccountService.getMaxAccountNumber(code);
 
         //楼栋

+ 4 - 0
smart-city-platform/src/main/resources/mapper/DeviceMapper.xml

@@ -39,6 +39,8 @@
         water_meter_file_no,
         customer_id,
         udip_id,
+        metercode,
+        account_id,
         curr_status,
         new_meter_start,
         device_model
@@ -69,6 +71,8 @@
             #{device.waterMeterFileNo,jdbcType=VARCHAR},
             #{device.customerId,jdbcType=INTEGER},
             #{device.udipId,jdbcType=VARCHAR},
+            #{device.metercode,jdbcType=VARCHAR},
+            #{device.accountId,jdbcType=BIGINT},
             #{device.currStatus,jdbcType=INTEGER},
             #{device.newMeterStart,jdbcType=VARCHAR},
             #{device.deviceModel,jdbcType=VARCHAR}