Commit 7c254a1c6fd9ec4c35f598bc42ae73276caf0f13

Authored by xp.Huang
2 parents 4f7107ab 21e83eaa

Merge branch '20220722' into 'master'

feat: 设备新增字段“设备厂商”

See merge request huang/thingsboard3.3.2!120
@@ -1143,10 +1143,10 @@ file: @@ -1143,10 +1143,10 @@ file:
1143 staticUrl: /oss/files/** #oss静态访问路径 只有type = local需要 1143 staticUrl: /oss/files/** #oss静态访问路径 只有type = local需要
1144 randomFileName: ${file.storage.randomFileName} 1144 randomFileName: ${file.storage.randomFileName}
1145 minio: 1145 minio:
1146 - minioUrl: https://dev.thingskit.com:9000 #minio储存地址 1146 + minioUrl: ${MINIO_URL:https://dev.thingskit.com:9000} #minio储存地址
1147 # minioUrl: https://demo.thingskit.com:9000 #minio储存地址 1147 # minioUrl: https://demo.thingskit.com:9000 #minio储存地址
1148 - minioName: YunTeng #minio账户  
1149 - minioPass: YunTeng123456 #minio访问密码 1148 + minioName: ${MINIO_NAME:YunTeng} #minio账户
  1149 + minioPass: ${MINIO_PWD:YunTeng123456} #minio访问密码
1150 bucketName: yunteng #minio储存桶名称 1150 bucketName: yunteng #minio储存桶名称
1151 randomFileName: ${file.storage.randomFileName} 1151 randomFileName: ${file.storage.randomFileName}
1152 account: 1152 account:
@@ -22,9 +22,15 @@ public class ConfigurationCenterDTO extends TenantDTO { @@ -22,9 +22,15 @@ public class ConfigurationCenterDTO extends TenantDTO {
22 22
23 @ApiModelProperty(value = "组织ID", required = true) 23 @ApiModelProperty(value = "组织ID", required = true)
24 @NotEmpty( 24 @NotEmpty(
25 - message = "组织ID不能为空或空字符串",  
26 - groups = {UpdateGroup.class, AddGroup.class}) 25 + message = "组织ID不能为空或空字符串",
  26 + groups = {UpdateGroup.class, AddGroup.class})
27 private String organizationId; 27 private String organizationId;
28 28
  29 + @ApiModelProperty(value = "终端类型", required = true)
  30 + @NotEmpty(
  31 + message = "终端类型不能为空或空字符串",
  32 + groups = {UpdateGroup.class, AddGroup.class})
  33 + private String platform;
  34 +
29 private OrganizationDTO organizationDTO; 35 private OrganizationDTO organizationDTO;
30 } 36 }
@@ -45,7 +45,8 @@ public class DeviceDTO extends TenantDTO { @@ -45,7 +45,8 @@ public class DeviceDTO extends TenantDTO {
45 private YtCredentialsDto deviceToken; 45 private YtCredentialsDto deviceToken;
46 46
47 private String tbDeviceId; 47 private String tbDeviceId;
48 - private String deviceTypeId; 48 + @ApiModelProperty(value = "设备厂商")
  49 + private String brand;
49 50
50 @NotEmpty( 51 @NotEmpty(
51 message = "设备编号不能为空", 52 message = "设备编号不能为空",
@@ -3,8 +3,11 @@ package org.thingsboard.server.common.data.yunteng.dto.request; @@ -3,8 +3,11 @@ package org.thingsboard.server.common.data.yunteng.dto.request;
3 import io.swagger.annotations.ApiModel; 3 import io.swagger.annotations.ApiModel;
4 import io.swagger.annotations.ApiModelProperty; 4 import io.swagger.annotations.ApiModelProperty;
5 import lombok.Data; 5 import lombok.Data;
  6 +import org.thingsboard.server.common.data.yunteng.common.AddGroup;
  7 +import org.thingsboard.server.common.data.yunteng.common.UpdateGroup;
6 import org.thingsboard.server.common.data.yunteng.dto.ConfigurationContentDTO; 8 import org.thingsboard.server.common.data.yunteng.dto.ConfigurationContentDTO;
7 9
  10 +import javax.validation.constraints.NotEmpty;
8 import java.util.List; 11 import java.util.List;
9 @Data 12 @Data
10 @ApiModel(value = "组态编辑") 13 @ApiModel(value = "组态编辑")
@@ -13,6 +16,8 @@ public class ConfigurationContentInfoDTO { @@ -13,6 +16,8 @@ public class ConfigurationContentInfoDTO {
13 private String configurationId; 16 private String configurationId;
14 @ApiModelProperty(value = "组态中心名称") 17 @ApiModelProperty(value = "组态中心名称")
15 private String configurationName; 18 private String configurationName;
  19 + @ApiModelProperty(value = "终端类型", required = true)
  20 + private String platform;
16 @ApiModelProperty(value = "组态内容",required = true) 21 @ApiModelProperty(value = "组态内容",required = true)
17 private List<ConfigurationContentDTO> configurationContentList; 22 private List<ConfigurationContentDTO> configurationContentList;
18 } 23 }
@@ -5,5 +5,6 @@ public enum ActTypeEnum { @@ -5,5 +5,6 @@ public enum ActTypeEnum {
5 FLASH, 5 FLASH,
6 ROTATE, 6 ROTATE,
7 DISPLAY, 7 DISPLAY,
8 - IMAGE 8 + IMAGE,
  9 + SWITCH
9 } 10 }
@@ -13,4 +13,5 @@ public class ConfigurationCenter extends TenantBaseEntity { @@ -13,4 +13,5 @@ public class ConfigurationCenter extends TenantBaseEntity {
13 private String name; 13 private String name;
14 private String remark; 14 private String remark;
15 private String organizationId; 15 private String organizationId;
  16 + private String platform;
16 } 17 }
@@ -25,7 +25,7 @@ public class YtDevice extends TenantBaseEntity { @@ -25,7 +25,7 @@ public class YtDevice extends TenantBaseEntity {
25 private String profileId; 25 private String profileId;
26 private String tbDeviceId; 26 private String tbDeviceId;
27 private String gatewayId; 27 private String gatewayId;
28 - private String deviceTypeId; 28 + private String brand;
29 private String label; 29 private String label;
30 @TableField(typeHandler = EnumTypeHandler.class) 30 @TableField(typeHandler = EnumTypeHandler.class)
31 private DeviceTypeEnum deviceType; 31 private DeviceTypeEnum deviceType;
@@ -66,6 +66,7 @@ public class YtConfigurationCenterServiceImpl @@ -66,6 +66,7 @@ public class YtConfigurationCenterServiceImpl
66 contentDTO.setType(FastIotConstants.PC_TYPE); 66 contentDTO.setType(FastIotConstants.PC_TYPE);
67 contentDTO.setName(FastIotConstants.FIRST_PAGE_NAME); 67 contentDTO.setName(FastIotConstants.FIRST_PAGE_NAME);
68 contentDTO.setConfigurationId(configurationCenter.getId()); 68 contentDTO.setConfigurationId(configurationCenter.getId());
  69 + contentDTO.setContent("<mxGraphModel><root><mxCell id=\"0\"/><mxCell id=\"1\" parent=\"0\"/></root></mxGraphModel>");
69 ytConfigurationContentService.saveConfigurationContent(contentDTO); 70 ytConfigurationContentService.saveConfigurationContent(contentDTO);
70 return configurationCenterDTO; 71 return configurationCenterDTO;
71 } 72 }
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 <resultMap id="configurationCenterMap" type="org.thingsboard.server.common.data.yunteng.dto.ConfigurationCenterDTO"> 5 <resultMap id="configurationCenterMap" type="org.thingsboard.server.common.data.yunteng.dto.ConfigurationCenterDTO">
6 <result property="id" column="id"/> 6 <result property="id" column="id"/>
7 <result property="name" column="name"/> 7 <result property="name" column="name"/>
  8 + <result property="platform" column="platform"/>
8 <result property="organizationId" column="organization_id"/> 9 <result property="organizationId" column="organization_id"/>
9 <result property="remark" column="remark"/> 10 <result property="remark" column="remark"/>
10 <result property="updateTime" column="update_time"/> 11 <result property="updateTime" column="update_time"/>
@@ -20,6 +21,7 @@ @@ -20,6 +21,7 @@
20 <resultMap id="configurationInfoMap" type="org.thingsboard.server.common.data.yunteng.dto.request.ConfigurationContentInfoDTO"> 21 <resultMap id="configurationInfoMap" type="org.thingsboard.server.common.data.yunteng.dto.request.ConfigurationContentInfoDTO">
21 <result property="configurationId" column="id"/> 22 <result property="configurationId" column="id"/>
22 <result property="configurationName" column="name"/> 23 <result property="configurationName" column="name"/>
  24 + <result property="platform" column="platform"/>
23 <collection property="configurationContentList" ofType="org.thingsboard.server.common.data.yunteng.dto.ConfigurationContentDTO"> 25 <collection property="configurationContentList" ofType="org.thingsboard.server.common.data.yunteng.dto.ConfigurationContentDTO">
24 <result property="id" column="content_id"/> 26 <result property="id" column="content_id"/>
25 <result property="content" column="content"/> 27 <result property="content" column="content"/>
@@ -27,7 +29,7 @@ @@ -27,7 +29,7 @@
27 </resultMap> 29 </resultMap>
28 30
29 <sql id="columns"> 31 <sql id="columns">
30 - a.id,a.name,a.organization_id,a.remark,a.update_time,a.create_time,a.creator,a.tenant_id,a.updater,io.name AS organization_name 32 + a.id,a.name,a.platform,a.organization_id,a.remark,a.update_time,a.create_time,a.creator,a.tenant_id,a.updater,io.name AS organization_name
31 </sql> 33 </sql>
32 <select id="getConfigurationCenterPage" resultMap="configurationCenterMap"> 34 <select id="getConfigurationCenterPage" resultMap="configurationCenterMap">
33 SELECT 35 SELECT
@@ -51,7 +53,7 @@ @@ -51,7 +53,7 @@
51 </select> 53 </select>
52 54
53 <select id="getConfigurationInfoById" resultMap="configurationInfoMap"> 55 <select id="getConfigurationInfoById" resultMap="configurationInfoMap">
54 - SELECT icc.id,icc.name,icct.id AS content_id,icct.content FROM iotfs_configuration_center icc LEFT JOIN 56 + SELECT icc.id,icc.name,icc.platform,icct.id AS content_id,icct.content FROM iotfs_configuration_center icc LEFT JOIN
55 iotfs_configuration_content icct ON icc.id = icct.configuration_id 57 iotfs_configuration_content icct ON icc.id = icct.configuration_id
56 WHERE icc.id = #{id} AND icc.tenant_id = #{tenantId} 58 WHERE icc.id = #{id} AND icc.tenant_id = #{tenantId}
57 </select> 59 </select>
@@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
15 <result property="profileId" column="profile_id"/> 15 <result property="profileId" column="profile_id"/>
16 <result property="activeTime" column="active_time"/> 16 <result property="activeTime" column="active_time"/>
17 <result property="deviceType" column="device_type" typeHandler="org.apache.ibatis.type.EnumTypeHandler"/> 17 <result property="deviceType" column="device_type" typeHandler="org.apache.ibatis.type.EnumTypeHandler"/>
  18 + <result property="brand" column="brand" />
18 <result property="sn" column="sn"/> 19 <result property="sn" column="sn"/>
19 <result property="tenantId" column="tenant_id"/> 20 <result property="tenantId" column="tenant_id"/>
20 <result property="tbDeviceId" column="tb_device_id"/> 21 <result property="tbDeviceId" column="tb_device_id"/>
@@ -62,7 +63,7 @@ @@ -62,7 +63,7 @@
62 ifd 63 ifd
63 . 64 .
64 id 65 id
65 - ,ifd.sn,ifd.name,ifd.device_info,ifd.profile_id,ifd.active_time,ifd.tenant_id,ifd.description 66 + ,ifd.sn,ifd.brand,ifd.name,ifd.device_info,ifd.profile_id,ifd.active_time,ifd.tenant_id,ifd.description
66 ,ifd.tb_device_id,ifd.label,ifd.last_connect_time,ifd.device_type,ifd.device_state,ifd.create_time,ifd.update_time,ifd.creator, 67 ,ifd.tb_device_id,ifd.label,ifd.last_connect_time,ifd.device_type,ifd.device_state,ifd.create_time,ifd.update_time,ifd.creator,
67 ifd.updater,ifd.organization_id,ifd.alarm_status 68 ifd.updater,ifd.organization_id,ifd.alarm_status
68 </sql> 69 </sql>