Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/20210716' into 20210716

hym 3 anni fa
parent
commit
56afd231c7

+ 5 - 4
zoniot-rmcp/zoniot-rmcp-alarm/src/test/java/com/bz/rmcp/alarm/AlarmTests.java

@@ -1,5 +1,7 @@
 package com.bz.rmcp.alarm;
 import java.util.Date;
+
+import com.alibaba.fastjson.JSON;
 import com.google.common.collect.Maps;
 
 import com.bz.rmcp.alarm.service.impl.DeviceAlarmServiceImpl;
@@ -33,12 +35,11 @@ public class AlarmTests {
 
     @Test
     public void alarm(){
-        Map<String,Object> map = new HashMap<>();
-        map.put("WSV",90);
-        map.put("VALVE","01");
+        String json = "{\"VOL\":3.56,\"ALARM\":\"0\",\"VOL_STATUS\":\"0\",\"VALVE\":\"01\",\"WSV\":110,\"FORCED\":\"1\",\"DISTURB\":\"1\",\"OVERDRAFT\":\"1\"}";
+        Map<String,Object> map  = JSON.parseObject(json, HashMap.class);
 
         MeasureDataDto measureDataDto = new MeasureDataDto();
-        measureDataDto.setDeviceId(870001919702208512L);
+        measureDataDto.setDeviceId(880829562492162048L);
         measureDataDto.setReceiveDate(new Date());
         measureDataDto.setMeasureMap(map);
 

+ 2 - 2
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/MeterReadRecordMapper.xml

@@ -254,7 +254,7 @@
             dept_org_id,
             community_id,
             count(distinct id) as device_count, -- 设备总数
-            count(distinct id) as device_count,   -- 应抄总数
+            count(distinct id) as read_times,   -- 应抄总数
             0 as real_read_times, -- 实抄总数
             count(distinct id) as un_read_times,   -- 未抄总数
             0 as read_rate ,-- 抄表率
@@ -343,7 +343,7 @@
     set real_read_times = real_read_times + 1 ,
         un_read_times = un_read_times - 1,
         read_rate = FORMAT(real_read_times / read_times*100, 2)
-    WHERE stat_day = DATE_FORMAT( #{readDate}, '%Y%m%d' ) and tenant_id = #{device.tenantId} and category_id = #{device.tenantId}
+    WHERE stat_day = DATE_FORMAT( #{readDate}, '%Y%m%d' ) and tenant_id = #{device.tenantId} and category_id = #{device.categoryId}
     and company_org_id = #{device.companyOrgId} and dept_org_id = #{device.deptOrgId} and community_id = #{device.communityId}
   </insert>
 </mapper>

+ 1 - 1
zoniot-rmcp/zoniot-rmcp-dap/src/main/java/com/bz/rmcp/dap/service/impl/DeviceDataServiceImpl.java

@@ -234,7 +234,7 @@ public class DeviceDataServiceImpl implements DeviceDataService {
         readRecord.setDeviceNo(vo.getDeviceNo());
         readRecord.setLocation(vo.getDeviceNo());
         readRecord.setProductId(vo.getProductId());
-        readRecord.setDeviceModel(vo.getProductModel());
+        readRecord.setDeviceModel(vo.getManufacturerName()+"/"+vo.getProductName()+"/"+vo.getProductModel());
         readRecord.setMeterNo(vo.getMeterNo());
         readRecord.setFileNo(vo.getFileNo());
         readRecord.setCreateTime(new Date());

+ 10 - 4
zoniot-rmcp/zoniot-rmcp-dap/src/test/java/com/bz/rmcp/dap/DeviceDataServiceTests.java

@@ -45,10 +45,16 @@ public class DeviceDataServiceTests {
 
 
 
+        //{"VOL":3.56,"ALARM":"0","VOL_STATUS":"0","VALVE":"01","WSV":110,"FORCED":"0","DISTURB":"0","OVERDRAFT":"0"}
         Map<String,Object> param = new HashMap<>();
-        param.put("currentQuantity",107.4);
-        param.put("valveState","1");
-        param.put("temp","0");
+        param.put("VOL",3.56);
+        param.put("ALARM","0");
+        param.put("VOL_STATUS","0");
+        param.put("VALVE","01");
+        param.put("WSV",110);
+        param.put("FORCED","0");
+        param.put("DISTURB","0");
+        param.put("OVERDRAFT","0");
 
         Map<Date,String> map = new HashMap<>();
         map.put(new Date(),JSON.toJSONString(param));
@@ -56,7 +62,7 @@ public class DeviceDataServiceTests {
         DeviceOrigDataDTO dto = new DeviceOrigDataDTO();
         dto.setId(1L);
         dto.setAgentIdentifier("");
-        dto.setDeviceNo("11111111111");
+        dto.setDeviceNo("4321554356234");
         dto.setMode("");
         dto.setType("");
         dto.setManufacturer("");

BIN
zoniot-rmcp/zoniot-rmcp-web/src/main/resources/excel/deviceTemplate_V2.1.xlsx