Bladeren bron

iotProductId

lin 3 jaren geleden
bovenliggende
commit
c831347879

+ 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());