Pārlūkot izejas kodu

fix:透传设备属性改为bool,初始化数据添加

tangfudong 1 gadu atpakaļ
vecāks
revīzija
6e5de54e6e

+ 8 - 0
data/init/product.json

@@ -6,6 +6,7 @@
     "category": "light",
     "nodeType": 1,
     "isOpenLocate": true,
+    "transparent": false,
     "locateUpdateType": "manual",
     "uid": "1",
     "createAt": 1650174777304
@@ -18,6 +19,7 @@
     "category": "fan",
     "nodeType": 1,
     "isOpenLocate": false,
+    "transparent": false,
     "uid": "1",
     "createAt": 1646571291131
   },
@@ -78,6 +80,7 @@
     "uid": "1",
     "img": "null",
     "isOpenLocate": false,
+    "transparent": false,
     "createAt": 1650190400357
   },
   {
@@ -123,6 +126,7 @@
     "nodeType": 1,
     "uid": "1",
     "isOpenLocate": false,
+    "transparent": false,
     "createAt": 1650187781637
   },
   {
@@ -145,6 +149,7 @@
     "nodeType": 1,
     "uid": "1",
     "isOpenLocate": false,
+    "transparent": false,
     "createAt": 1649653149339
   },
   {
@@ -155,6 +160,7 @@
     "nodeType": 1,
     "uid": "1",
     "isOpenLocate": false,
+    "transparent": false,
     "createAt": 1649653149339
   },
   {
@@ -165,6 +171,7 @@
     "nodeType": 0,
     "uid": "1",
     "isOpenLocate": false,
+    "transparent": false,
     "createAt": 1649653149339
   },
   {
@@ -175,6 +182,7 @@
     "nodeType": 1,
     "uid": "1",
     "isOpenLocate": false,
+    "transparent": false,
     "createAt": 1649653149339
   }
 ]

+ 14 - 0
iot-common/iot-common-dao/iot-common-model/src/main/java/cc/iotkit/model/product/Product.java

@@ -22,6 +22,10 @@ import java.io.Serializable;
 @AllArgsConstructor
 public class Product extends TenantModel implements Id<Long>, Serializable {
 
+    //定位更新方式,手动/设备上报
+    public static final String LOCATE_MANUAL = "manual";
+    public static final String LOCATE_DEVICE = "device";
+
     private Long id;
 
     private String productKey;
@@ -46,6 +50,16 @@ public class Product extends TenantModel implements Id<Long>, Serializable {
      */
     private Boolean transparent;
 
+    /**
+     * 是否开启定位
+     */
+    private Boolean isOpenLocate;
+
+    /**
+     * 定位更新方式
+     */
+    private String locateUpdateType;
+
     private Long createAt;
 
     public boolean isTransparent() {

+ 7 - 4
iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/model/TbProduct.java

@@ -58,11 +58,14 @@ public class TbProduct {
     @ApiModelProperty(value = "图片")
     private String img;
 
-    /**
-     * 是否透传,true/false
-     */
     @ApiModelProperty(value = "是否透传,true/false")
-    private String transparent;
+    private Boolean transparent;
+
+    @ApiModelProperty(value="是否开启设备定位,true/false")
+    private Boolean isOpenLocate;
+
+    @ApiModelProperty(value="定位更新方式")
+    private String locateUpdateType;
 
     @ApiModelProperty(value = "创建时间")
     private Long createAt;

+ 7 - 1
iot-module/iot-manager/src/main/java/cc/iotkit/manager/dto/bo/product/ProductBo.java

@@ -43,7 +43,13 @@ public class ProductBo extends BaseDto  {
 
     	@ApiModelProperty(value="是否透传,true/false")
 	@Size(max = 255, message = "是否透传,true/false长度不正确")
-    	private String transparent;
+    	private Boolean transparent;
+
+	@ApiModelProperty(value="是否开启设备定位,true/false")
+	private Boolean isOpenLocate;
+
+	@ApiModelProperty(value="定位更新方式")
+	private String locateUpdateType;
 
     	@ApiModelProperty(value="用户ID")
 	@Size(max = 255, message = "用户ID长度不正确")

+ 9 - 1
iot-module/iot-manager/src/main/java/cc/iotkit/manager/dto/vo/product/ProductVo.java

@@ -54,7 +54,15 @@ public class ProductVo implements Serializable  {
 
 	@ApiModelProperty(value="是否透传,true/false")
     @ExcelProperty(value = "是否透传,true/false")
-		private String transparent;
+		private Boolean transparent;
+
+	@ApiModelProperty(value="是否开启设备定位,true/false")
+	@ExcelProperty(value = "是否开启设备定位,true/false")
+	private Boolean isOpenLocate;
+
+	@ApiModelProperty(value="定位更新方式")
+	@ExcelProperty(value = "定位更新方式")
+	private String locateUpdateType;
 
 	@ApiModelProperty(value="用户ID")
     @ExcelProperty(value = "用户ID")