Commit 893b5751965fa65efa0e3d41f5e652cc2ca5c0ea

Authored by xp.Huang
2 parents 572a5fbe 259826ec

Merge remote-tracking branch 'origin/master_dev' into master_dev

  1 +-- **************************
  2 +-- ********表结构升级********
  3 +-- **************************
  4 +
  5 +
  6 +
  7 +
  8 +
  9 +
  10 +
  11 +
  12 +
  13 +
  14 +
  15 +
  16 +
  17 +-- **************************
  18 +-- ********表数据同步********
  19 +-- **************************
  20 +UPDATE "public"."tk_data_view_interface" SET "interface_name" = '实时单属性值(适合自定义文字)', "request_content_type" = 2, "request_origin_url" = 'localhost', "request_http_type" = NULL, "request_url" = '/api/ws/plugins/telemetry', "request_params" = '{"requestSQLContent":{},"Params":[{"key":"deviceProfileId,organizationId,entityId,keys","value":"","mores":null,"editDisabled":true,"required":true}]}', "state" = 1, "creator" = '80808080-8080-8080-8080-808080808080', "create_time" = '2023-07-08 10:27:53.643059', "updater" = '80808080-8080-8080-8080-808080808080', "update_time" = '2023-07-08 10:33:29.088113', "tenant_id" = '13814000-1dd2-11b2-8080-808080808080', "remark" = NULL, "interface_type" = 'SYSTEM', "filter" = 'const {
  21 + data
  22 +} = res
  23 +
  24 +//只有一个属性的脚本编写
  25 +
  26 +//获取服务端返回的keys,比如温度等
  27 +const keys = Object.keys(data)
  28 +
  29 +//把二维数组转化为对象
  30 +const transObj = Object.fromEntries(data[keys[0]])
  31 +
  32 +const key = Object.keys(transObj)
  33 +return new String(transObj[key[0]])' WHERE "id" = '3cf86107-5973-4246-b915-2eda1f3e7cf6';
  34 +
  35 +
  36 +
  37 +
  38 +
  39 +
  40 +
  41 +
  42 +
  43 +-- ****************************
  44 +-- ********业务功能升级********
  45 +-- ****************************
  46 +
  47 +
  48 +
  49 +------------------------------------------------------------------------------------
  50 +---------【租户角色对应菜单同步】---------------------------------------------------------------
  51 +------------------------------------------------------------------------------------
  52 +-- 租户角色不能分配超级管理员的权限
  53 +
  54 +
... ...
... ... @@ -6,6 +6,7 @@ import lombok.RequiredArgsConstructor;
6 6 import org.apache.commons.lang3.StringUtils;
7 7 import org.springframework.http.ResponseEntity;
8 8 import org.springframework.security.access.prepost.PreAuthorize;
  9 +import org.springframework.transaction.annotation.Transactional;
9 10 import org.springframework.util.Assert;
10 11 import org.springframework.validation.annotation.Validated;
11 12 import org.springframework.web.bind.annotation.*;
... ... @@ -157,6 +158,7 @@ public class TkAdminController extends BaseController {
157 158 }
158 159
159 160 @PostMapping("/tenant/adminUser")
  161 + @Transactional
160 162 @PreAuthorize(
161 163 "@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN'},{'api:yt:admin:tenant:adminUser:post'})")
162 164 public ResponseEntity<UserDTO> createTenantAdmin(
... ... @@ -207,6 +209,7 @@ public class TkAdminController extends BaseController {
207 209 }
208 210
209 211 @PostMapping("tenant/updateOrCreateTenant")
  212 + @Transactional
210 213 public TenantDTO updateOrCreateTenant(
211 214 @Validated(UpdateGroup.class) @RequestBody TenantReqDTO tenantReqDTO)
212 215 throws ThingsboardException {
... ...
... ... @@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j;
11 11 import org.apache.commons.lang3.StringUtils;
12 12 import org.springframework.http.ResponseEntity;
13 13 import org.springframework.security.access.prepost.PreAuthorize;
  14 +import org.springframework.transaction.annotation.Transactional;
14 15 import org.springframework.validation.annotation.Validated;
15 16 import org.springframework.web.bind.annotation.*;
16 17 import org.thingsboard.rule.engine.api.msg.DeviceCredentialsUpdateNotificationMsg;
... ... @@ -63,6 +64,7 @@ public class TkDeviceController extends BaseController {
63 64 private final GatewayNotificationsService gatewayNotificationsService;
64 65
65 66 @PostMapping
  67 + @Transactional
66 68 @ApiOperation("创建|编辑")
67 69 @PreAuthorize(
68 70 "@check.checkPermissions({'TENANT_ADMIN'},{'api:yt:device:post','api:yt:device:update'})")
... ...
... ... @@ -7,6 +7,7 @@ import lombok.RequiredArgsConstructor;
7 7 import org.apache.commons.lang3.StringUtils;
8 8 import org.springframework.http.ResponseEntity;
9 9 import org.springframework.security.access.prepost.PreAuthorize;
  10 +import org.springframework.transaction.annotation.Transactional;
10 11 import org.springframework.validation.annotation.Validated;
11 12 import org.springframework.web.bind.annotation.*;
12 13 import org.thingsboard.server.common.data.DeviceProfile;
... ... @@ -50,6 +51,7 @@ public class TkDeviceProfileController extends BaseController {
50 51 private final TkDeviceProfileService tkDeviceProfileService;
51 52
52 53 @PostMapping()
  54 + @Transactional
53 55 @PreAuthorize(
54 56 "@check.checkPermissions({'TENANT_ADMIN'},{'api:yt:deviceProfile:post','api:yt:deviceProfile:update'})")
55 57 @ApiOperation("创建 | 编辑")
... ...
... ... @@ -124,7 +124,7 @@ public class TbSendRPCRequestNode implements TbNode {
124 124 params = JacksonUtil.toString(methodParams);
125 125 }
126 126 ObjectNode additional = JacksonUtil.newObjectNode();
127   - if(StringUtils.isNotBlank(additionalInfo)){
  127 + if(!json.get(DataConstants.ADDITIONAL_INFO).isJsonNull()){
128 128 additional = (ObjectNode) JacksonUtil.toJsonNode(additionalInfo);
129 129 }
130 130 if(!additional.has(FastIotConstants.Rpc.TARGET_ID)){
... ...
... ... @@ -328,7 +328,7 @@ class ReactState {
328 328 TbMsgMetaData metaData = msg.getMetaData();
329 329 metaData.putValue(DataConstants.PERSISTENT, "true");
330 330 metaData.putValue(
331   - FastIotConstants.Rpc.ONEWAY, (callType == CallTypeEnum.SYNC ? true : false) + "");
  331 + FastIotConstants.Rpc.ONEWAY, (callType == CallTypeEnum.SYNC ? false : true) + "");
332 332 for (String id : devices) {
333 333 TbMsg newMsg =
334 334 ctx.newMsg(
... ...