Commit 8a11f80bcc8a801c0b25450af869d30c337686b9

Authored by xp.Huang
2 parents 24e391fa 4c241bc0

Merge branch 'master_dev' into 'master'

fix: 执行install时,调整tbClusterService为按需加载

See merge request yunteng/thingskit!415
... ... @@ -3,9 +3,11 @@ package org.thingsboard.server.dao.yunteng.impl;
3 3 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4 4 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5 5 import com.baomidou.mybatisplus.core.metadata.IPage;
  6 +import lombok.Getter;
6 7 import lombok.RequiredArgsConstructor;
7 8 import lombok.extern.slf4j.Slf4j;
8 9 import org.apache.commons.lang3.StringUtils;
  10 +import org.springframework.beans.factory.annotation.Autowired;
9 11 import org.springframework.stereotype.Service;
10 12 import org.springframework.transaction.annotation.Transactional;
11 13 import org.thingsboard.script.api.ScriptType;
... ... @@ -51,10 +53,13 @@ public class TkDeviceScriptServiceImpl
51 53 private final TkDeviceService tkDeviceService;
52 54 private final JsInvokeService jsInvokeService;
53 55 private final TbelInvokeService tbelInvokeService;
54   - private final TbClusterService tbClusterService;
55 56 private final DeviceProfileService deviceProfileService;
56 57 private final TkTenantService tenantService;
57 58
  59 + @Autowired(required = false)
  60 + @Getter
  61 + private TbClusterService tbClusterService;
  62 +
58 63 @Override
59 64 public boolean validateFormdata(TkDeviceScriptDTO scriptDTO, boolean created) {
60 65 String tenantId = scriptDTO.getTenantId();
... ... @@ -226,7 +231,7 @@ public class TkDeviceScriptServiceImpl
226 231 deviceProfileService.findDeviceProfileById(
227 232 TenantId.fromUUID(UUID.fromString(tenantId)), deviceProfileId);
228 233 if (null != deviceProfile) {
229   - tbClusterService.onDeviceProfileChange(deviceProfile, null);
  234 + getTbClusterService().onDeviceProfileChange(deviceProfile, null);
230 235 }
231 236 }
232 237 }
... ...