wangli 4 سال پیش
والد
کامیت
3a3d9d5f2c

+ 0 - 11
smart-city-platform/src/main/java/com/bz/smart_city/controller/pay/AmountWaterUsedAmountController.java

@@ -122,17 +122,6 @@ public class AmountWaterUsedAmountController {
         return ajaxMessage;
     }
 
-    //换表接口
 
-    @ResponseBody
-    @PostMapping("/synDeviceReplaceRecord")
-    @ApiOperation(value = "换表记录同步接口")
-    public AjaxMessage synDeviceReplaceRecord(
-            @ApiParam(value = "换表记录")@RequestBody(required = true) DeviceReplaceRecordDto deviceReplaceRecordDto
-     ){
-        amountWaterUsedAmountService.saveDeviceReplaceRecord(deviceReplaceRecordDto);
-
-        return new AjaxMessage<>(ResultStatus.OK);
-    }
 
 }

+ 25 - 10
smart-city-platform/src/main/java/com/bz/smart_city/controller/pay/PaySyncDataController.java

@@ -5,9 +5,11 @@ import com.bz.smart_city.commom.model.ResultStatus;
 import com.bz.smart_city.dto.AreaDto;
 import com.bz.smart_city.dto.CommunityDto;
 import com.bz.smart_city.dto.DeviceTypeDto;
+import com.bz.smart_city.dto.pay.DeviceReplaceRecordDto;
 import com.bz.smart_city.dto.pay.InstallPlanInputDTO;
 import com.bz.smart_city.entity.Community;
 import com.bz.smart_city.entity.WaterMeterReplaceLog;
+import com.bz.smart_city.service.pay.AmountWaterUsedAmountService;
 import com.bz.smart_city.service.pay.PaySyncDataService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -29,6 +31,8 @@ public class PaySyncDataController {
 
     @Autowired
     private PaySyncDataService paySyncDataService;
+    @Autowired
+    private AmountWaterUsedAmountService amountWaterUsedAmountService;
 
     @PostMapping("installPlan/addJF")
     @PreAuthorize("hasAuthority('sys:installPlan:add')")
@@ -77,17 +81,28 @@ public class PaySyncDataController {
         return paySyncDataService.queryWaterMeterType(parentId);
     }
 
+//    @PostMapping("/amount/synDeviceReplaceRecord")
+//    @ApiOperation(value = "同步换表信息")
+//    public AjaxMessage syncReplaceRecord(
+//            @ApiParam(value = "同步换表信息", required = true) @RequestBody(required = true) WaterMeterReplaceLog waterMeterReplaceLog
+//    ) {
+//
+//        int result = paySyncDataService.addReplaceRecord(waterMeterReplaceLog);
+//        if(result > 0)
+//            return new AjaxMessage(ResultStatus.OK);
+//        else
+//            return new AjaxMessage(ResultStatus.ERROR);
+//    }
+    //换表接口
+
+    @ResponseBody
     @PostMapping("/amount/synDeviceReplaceRecord")
-    @ApiOperation(value = "同步换表信息")
-    public AjaxMessage syncReplaceRecord(
-            @ApiParam(value = "同步换表信息", required = true) @RequestBody(required = true) WaterMeterReplaceLog waterMeterReplaceLog
-    ) {
+    @ApiOperation(value = "换表记录同步接口")
+    public AjaxMessage synDeviceReplaceRecord(
+            @ApiParam(value = "换表记录")@RequestBody(required = true) DeviceReplaceRecordDto deviceReplaceRecordDto
+    ){
+        amountWaterUsedAmountService.saveDeviceReplaceRecord(deviceReplaceRecordDto);
 
-        int result = paySyncDataService.addReplaceRecord(waterMeterReplaceLog);
-        if(result > 0)
-            return new AjaxMessage(ResultStatus.OK);
-        else
-            return new AjaxMessage(ResultStatus.ERROR);
+        return new AjaxMessage<>(ResultStatus.OK);
     }
-
 }

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

@@ -73,6 +73,7 @@ public interface AmountWaterUsedAmountMapper {
 
     //插入换表信息
     Integer insertReplaceRecord( @Param("deviceReplaceRecord") DeviceReplaceRecord deviceReplaceRecord);
+
     //根据水表编码查询水表信息
     BaseWatermeterDto getWatermeterInfoByMetercode(@Param("metercode") String metercode, @Param("siteId") Integer siteId, @Param("customerId") Integer customerId );
 
@@ -93,8 +94,4 @@ public interface AmountWaterUsedAmountMapper {
     @MapKey("deviceId")
     HashMap<BigInteger, ReplaceMeterCountDto> getRepalceRecordCount(@Param("stTime")LocalDateTime stTime, @Param("etTime")LocalDateTime etTime, @Param("list")List<BigInteger> list,@Param("siteId")Integer siteId,@Param("customerId")Integer customerId);
 
-    AmountWaterUsedAmount getLastReadrecord(@Param("metercode") String metercode, @Param("siteId") Integer siteId,@Param("customerId")Integer customerId);
-
-    void insertReplaceRecord( @Param("deviceReplaceRecord") DeviceReplaceRecord deviceReplaceRecord);
-
 }

+ 7 - 0
smart-city-platform/src/main/java/com/bz/smart_city/quartz/service/AmountSynByDayService.java

@@ -0,0 +1,7 @@
+package com.bz.smart_city.quartz.service;
+
+public interface AmountSynByDayService {
+    void saveQrtzTask();
+    void amountUpdateByDay(Integer siteId, Integer customerId);
+    void start();
+}

+ 1 - 0
smart-city-platform/src/main/java/com/bz/smart_city/quartz/service/impl/AmountSynServiceImpl.java

@@ -131,6 +131,7 @@ public class AmountSynServiceImpl implements AmountSynService {
             }
         }
         Map<String ,AmountSynRespDto> map = lists.stream().collect(Collectors.toMap(AmountSynRespDto::getFileNo, Function.identity(), (key1, key2) -> key2));
+
         //换表记录
         HashMap<BigInteger, ReplaceMeterCountDto> replaceMap = new HashMap<>();
         LocalDateTime stTime = LocalDateTime.ofInstant(baseClosingAccountInfoDto.getStartTime().toInstant(), ZoneId.systemDefault());

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

@@ -6,6 +6,7 @@ import com.bz.smart_city.dto.pay.*;
 import com.bz.smart_city.entity.pay.PayBaseAccount;
 import com.bz.smart_city.entity.pay.PayMeter;
 
+import java.math.BigInteger;
 import java.util.List;
 
 
@@ -35,7 +36,7 @@ public interface PayBaseAccountService {
 
     Pagination<PayMeter>findMeter(String queryInfo, String state, Integer pageNum, Integer pageSize);
 
-    //根据安装计划ID删除用户信息
+	//根据安装计划ID删除用户信息
     int delByPlanId(BigInteger planId);
 
     int getMaxAccountNumber(String CommunityCode);

+ 2 - 1
smart-city-platform/src/main/resources/application-dev.properties

@@ -106,4 +106,5 @@ service.domain=http:/127.0.0.1
 invoice.print.url=http://nnfpbox.nuonuocs.cn/shop/buyer/allow/cxfKp/cxfServerKpOrderSync.action
 invoice.query.url=http://nnfpbox.nuonuocs.cn/shop/buyer/allow/ecOd/queryElectricKp.action
 
-
+#抄表数据同步接口
+Sync.Data.Url=http://114.135.61.188:58080

+ 2 - 2
smart-city-platform/src/main/resources/application-prd.properties

@@ -167,5 +167,5 @@ udip.unit.url=http://47.112.15.78:8322
 #发票请求打印接口
 invoice.print.url=http://nnfpbox.nuonuocs.cn/shop/buyer/allow/cxfKp/cxfServerKpOrderSync.action
 invoice.query.url=http://nnfpbox.nuonuocs.cn/shop/buyer/allow/ecOd/queryElectricKp.action
-#光电直读agent url
-gd.agent.url=http://10.0.0.160:6377
+#抄表数据同步接口
+Sync.Data.Url=http://114.135.61.188:58080

+ 0 - 26
smart-city-platform/src/main/resources/mapper/pay/AmountWaterUsedAmountMapper.xml

@@ -385,32 +385,6 @@
 		limit 500
 	</insert>
 
-	<resultMap id="MeterReadRecordResultMap" type="com.bz.smart_city.dto.pay.MeterReadRecordDto">
-		<result column="device_id" property="deviceId" />
-		<result column="read_time" property="readTime" />
-		<result column="read_data" property="readData" />
-	</resultMap>
-
-	<select id ="getMeterReadRecord" resultMap="MeterReadRecordResultMap">
-		select
-		a.device_id,
-		a.read_data,
-		a.read_time
-		from sc_meter_read_record a
-		<where>
-
-			a.read_date=DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 day) ,'%Y%m%d')
-
-				and  a.device_id in
-
-				<foreach collection="list" item="listItem" open="(" close=")" separator=",">
-					<if test="listItem != null and listItem != ''">
-						#{listItem}
-					</if>
-				</foreach>
-
-		</where>
-	</select>
 
 	<update id="updateByDate">