Commit 8fcf34cc0319abb29f840e321d16da1456f27594

Authored by xp.Huang
2 parents 265ad02d b8c12749

Merge branch '20221202' into 'master'

20221202

See merge request huang/thingsboard3.3.2!146
... ... @@ -59,7 +59,7 @@ public class TkRoleController extends BaseController {
59 59 }
60 60
61 61 @DeleteMapping
62   - @PreAuthorize("@check.checkPermissions({},{'api:yt:role:delete'})")
  62 + @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN','TENANT_ADMIN'},{'api:yt:role:delete'})")
63 63 public void deleteRole(@RequestBody String[] ids) throws ThingsboardException {
64 64 roleService.deleteRole(ids,getCurrentUser().getCurrentTenantId());
65 65 }
... ... @@ -77,7 +77,7 @@ public class TkRoleController extends BaseController {
77 77 }
78 78
79 79 @PostMapping("save_with_menu")
80   - @PreAuthorize("@check.checkPermissions({},{'api:yt:role:saveOrUpdateRoleInfoWithMenu:post','api:yt:role:saveOrUpdateRoleInfoWithMenu:update'})")
  80 + @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN','TENANT_ADMIN'},{'api:yt:role:saveOrUpdateRoleInfoWithMenu:post','api:yt:role:saveOrUpdateRoleInfoWithMenu:update'})")
81 81 public RoleDTO saveOrUpdateRoleInfoWithMenu(@RequestBody RoleReqDTO roleReqDTO) throws ThingsboardException {
82 82 return roleService.saveOrUpdateRoleInfoWithMenu(
83 83 roleReqDTO,
... ...
... ... @@ -16,6 +16,8 @@ public class SelectItemDTO {
16 16
17 17 @ApiModelProperty("下拉选项名")
18 18 private String name;
  19 + @ApiModelProperty("下拉选项别名")
  20 + private String alias;
19 21
20 22 @ApiModelProperty("设备类型")
21 23 private DeviceTypeEnum deviceType;
... ...
... ... @@ -5,6 +5,7 @@
5 5 <resultMap type="org.thingsboard.server.common.data.yunteng.dto.SelectItemDTO" id="listInform">
6 6 <result property="id" column="id"/>
7 7 <result property="name" column="name"/>
  8 + <result property="alias" column="alias"/>
8 9 <result property="deviceType" column="device_type" typeHandler="org.apache.ibatis.type.EnumTypeHandler"/>
9 10 </resultMap>
10 11 <resultMap type="org.thingsboard.server.common.data.yunteng.dto.DeviceDTO" id="deviceMap">
... ... @@ -336,7 +337,7 @@
336 337
337 338 <select id="masterDevices" resultMap="listInform">
338 339 SELECT
339   - base.tb_device_id as id,base.name,base.device_type,base.device_profile_id
  340 + base.tb_device_id as id,base.name,base.alias,base.device_type,base.device_profile_id
340 341 FROM tk_device base
341 342 LEFT JOIN device tde ON tde.ID :: TEXT = base.tb_device_id
342 343 <where>
... ... @@ -361,7 +362,7 @@
361 362
362 363 <select id="slaveDevices" resultMap="listInform">
363 364 SELECT
364   - ide.tb_device_id as id,ide.name,ide.device_type,ide.device_profile_id
  365 + ide.tb_device_id as id,ide.name,base.alias,ide.device_type,ide.device_profile_id
365 366 FROM (select * from relation where relation_type_group = 'COMMON' AND relation_type = 'Created' AND from_type = 'DEVICE' AND to_type = 'DEVICE'
366 367 <if test="masterId !=null and masterId !=''">
367 368 AND from_id :: TEXT = #{masterId}
... ...