Prechádzať zdrojové kódy

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

hym 3 rokov pred
rodič
commit
8a70a47261

+ 3 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/entity/Product.java

@@ -18,6 +18,9 @@ public class Product implements Serializable {
     @ApiModelProperty(value="")
     private Integer id;
 
+    @ApiModelProperty(value="物联网产品id")
+    private Integer iotProductId;
+
     @ApiModelProperty(value="产品分类id")
     private Integer productCategoryId;
 

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

@@ -5,6 +5,7 @@
     <!--@mbg.generated-->
     <!--@Table rmcp_product-->
     <id column="id" property="id" />
+    <result column="iot_product_id" property="iotProductId" />
     <result column="product_category_id" property="productCategoryId" />
     <result column="manufacturer_id" property="manufacturerId" />
     <result column="product_name" property="productName" />
@@ -21,7 +22,7 @@
   </resultMap>
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
-    id, product_category_id, manufacturer_id, product_name, product_model, product_desc, 
+    id, iot_product_id, product_category_id, manufacturer_id, product_name, product_model, product_desc,
     `status`, create_date, create_by, update_date, update_by, is_support_valve, valve_measuring_code, 
     reading_measuring_code
   </sql>

+ 2 - 1
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/impl/DeviceServiceImpl.java

@@ -185,8 +185,9 @@ public class DeviceServiceImpl implements DeviceService{
     }
 
     private DeviceDTO covertDeviceDTO(DeviceInputDto dto,Product product, Long customerId) {
+
         DeviceDTO deviceDTO = new DeviceDTO();
-        deviceDTO.setProductId(Long.valueOf(product.getId()));
+        deviceDTO.setProductId(Long.valueOf(product.getIotProductId()));
         deviceDTO.setCustomerId(customerId);
         deviceDTO.setDeviceName(dto.getDeviceNo());
         deviceDTO.setLongitude(dto.getLng());

+ 3 - 5
zoniot-water/zoniot-water-core/src/main/java/com/bz/zoneiot/water/core/mapper/AlarmDetailMapper.xml

@@ -698,9 +698,8 @@
             ,ad.ALARM_TYPE as "alarmType"
             ,d.DEVICE_NAME as "deviceName"
             ,da.NAME as "attributeName"
-            ,CONCAT(asr.operator,asr.value) as "alarmContent"
+            ,(select GROUP_CONCAT(t12.relation , ' ',t12.operator,' ',t12.value, ' ' SEPARATOR '') as `alarm_range` from sms_alarm_rule t12 where t12.alarm_type_id = ast.id) alarmContent
             ,da.UNIT as "unit"
-
             ,d.id as "deviceId"
             ,d.TENANT_ID as "tenantId"
             ,d.COMPANY_ORG_ID as "companyOrgId"
@@ -713,9 +712,8 @@
         left join sms_device d on ad.DEVICE_ID =d.ID
         left join sms_device_attribute da on ad.ATTRIBUTE_ID =da.id
         left join sms_alarm_type ast on ast.id=ad.ALARM_ID
-        left join sms_alarm_rule asr on ast.id= asr.alarm_type_id
-        where  ad.OP_STATE=1 and ad.STATE=1 and ad.is_send_message = 0 and d.status = 1 and d.ENABLE_STATE = 1
-        and timestampdiff(MINUTE,ad.ALARM_START_TIME,now())>10
+        where  ad.OP_STATE = 1 and ad.STATE=1 and ad.is_send_message = 0 and d.status = 1 and d.ENABLE_STATE = 2
+        and timestampdiff(MINUTE,ad.ALARM_START_TIME,now()) > 10
     </select>
 
     <update id="updateAlarmSendMessageState" >