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