Commit bb70b3c9d4c0660dc734fbc6dc56ea4a50c408b7

Authored by 盛长浩
1 parent 8c139af7

设备管理类型功能调整

... ... @@ -394,6 +394,7 @@ CREATE TABLE "public"."qg_brain_device_category" (
394 394 "name" varchar(100),
395 395 "code" varchar(100),
396 396 "status" varchar(50),
  397 +"tenant_id" varchar(36),
397 398 "notes" varchar(500),
398 399 "create_time" timestamp(6),
399 400 "creator" varchar(36),
... ...
... ... @@ -6,7 +6,7 @@ import lombok.EqualsAndHashCode;
6 6
7 7 @EqualsAndHashCode(callSuper = true)
8 8 @Data
9   -public class BrainDeviceCategoryDTO extends BaseDTO {
  9 +public class BrainDeviceCategoryDTO extends TenantDTO {
10 10
11 11 @ApiModelProperty(value = "设备类型名称")
12 12 private String name;
... ... @@ -16,4 +16,6 @@ public class BrainDeviceCategoryDTO extends BaseDTO {
16 16 private String status;
17 17 @ApiModelProperty(value = "备注")
18 18 private String notes;
  19 + @ApiModelProperty(value = "创建用户名称")
  20 + private String creatorName;
19 21 }
... ...
1   -package org.thingsboard.server.dao.yunteng.entities;
2   -
3   -import com.baomidou.mybatisplus.annotation.FieldFill;
4   -import com.baomidou.mybatisplus.annotation.TableField;
5   -import lombok.Getter;
6   -import lombok.Setter;
7   -
8   -import java.time.LocalDateTime;
9   -
10   -@Getter
11   -@Setter
12   -public class BrainBaseEntity extends BaseEntity {
13   -
14   - private static final long serialVersionUID = -4315734960161684909L;
15   -
16   - @TableField(fill = FieldFill.INSERT)
17   - private String creator;
18   -
19   - @TableField(fill = FieldFill.UPDATE)
20   - private String updater;
21   -
22   - @TableField(fill = FieldFill.INSERT)
23   - private LocalDateTime createTime;
24   -
25   - @TableField(fill = FieldFill.UPDATE)
26   - private LocalDateTime updateTime;
27   -
28   -}
... ... @@ -11,7 +11,7 @@ import org.thingsboard.server.dao.model.ModelConstants;
11 11 @Data
12 12 @EqualsAndHashCode(callSuper = true)
13 13 @TableName(value = ModelConstants.BRAINDEVICECAGEGORY_TABLE_NAME, autoResultMap = true)
14   -public class BrainDeviceCategoryEntity extends BrainBaseEntity {
  14 +public class BrainDeviceCategoryEntity extends TenantBaseEntity {
15 15 /**
16 16 * 设备类型名称
17 17 */
... ...
... ... @@ -11,6 +11,7 @@ import org.springframework.stereotype.Service;
11 11 import org.thingsboard.server.common.data.exception.ThingsboardException;
12 12 import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException;
13 13 import org.thingsboard.server.common.data.yunteng.dto.BrainDeviceCategoryDTO;
  14 +import org.thingsboard.server.common.data.yunteng.utils.SpringBeanUtils;
14 15 import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData;
15 16 import org.thingsboard.server.dao.yunteng.entities.BrainDeviceCategoryEntity;
16 17 import org.thingsboard.server.dao.yunteng.mapper.BrainDeviceCategoryMapper;
... ... @@ -29,6 +30,7 @@ public class BrainDeviceCategoryServiceImpl extends AbstractBaseService<BrainDev
29 30
30 31 @Override
31 32 public TkPageData<BrainDeviceCategoryDTO> page(Map<String, Object> params) throws ThingsboardException {
  33 + params.put("tenantId", SpringBeanUtils.getTenantId().getId().toString());
32 34 TkPageData<BrainDeviceCategoryDTO> result = new TkPageData<>();
33 35 IPage<BrainDeviceCategoryEntity> page =
34 36 getPage(params, "create_time", false);
... ...
... ... @@ -8,6 +8,7 @@
8 8 <result property="code" column="code"/>
9 9 <result property="status" column="status"/>
10 10 <result property="notes" column="notes"/>
  11 + <result property="tenantId" column="tenant_id"/>
11 12 <result property="createTime" column="create_time"/>
12 13 <result property="updater" column="updater"/>
13 14 <result property="updateTime" column="update_time"/>
... ... @@ -18,6 +19,9 @@
18 19 o.id,o.name,o.code,o.status,o.notes,o.create_time,o.updater,o.update_time,o.creator
19 20 from qg_brain_device_category o
20 21 <where>
  22 + <if test="queryMap.tenantId !=null and queryMap.tenantId !=''">
  23 + AND o.tenant_id = #{queryMap.tenantId}
  24 + </if>
21 25 <if test="queryMap.code !=null and queryMap.code !=''">
22 26 AND o.code ILIKE concat('%',#{queryMap.code}::TEXT,'%')
23 27 </if>
... ...