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