Commit 02c35f2812a7c45f49f8dcef81605e04070d99a0
Merge branch '20221203' into 'master'
fix: 创建产品,解析脚本禁用时,默认输出原生数据 See merge request huang/thingsboard3.3.2!147
Showing
2 changed files
with
3 additions
and
2 deletions
... | ... | @@ -32,6 +32,7 @@ import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; |
32 | 32 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
33 | 33 | import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; |
34 | 34 | import org.thingsboard.server.common.msg.queue.ServiceQueue; |
35 | +import org.thingsboard.server.common.yunteng.script.YtScriptFactory; | |
35 | 36 | import org.thingsboard.server.controller.BaseController; |
36 | 37 | import org.thingsboard.server.dao.yunteng.service.TkDeviceScriptService; |
37 | 38 | import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService; |
... | ... | @@ -302,7 +303,7 @@ public class TkDeviceProfileController extends BaseController { |
302 | 303 | } |
303 | 304 | |
304 | 305 | tbDeviceProfile.setProfileData( |
305 | - buildDeviceProfileData(transportType, deviceProfileDTO.getProfileData(), scriptText)); | |
306 | + buildDeviceProfileData(transportType, deviceProfileDTO.getProfileData(), scriptText == null? YtScriptFactory.INCLUD_ORIGINAL_DATA:scriptText)); | |
306 | 307 | return tbDeviceProfile; |
307 | 308 | } |
308 | 309 | } | ... | ... |
... | ... | @@ -105,7 +105,7 @@ public class TkDeviceScriptServiceImpl |
105 | 105 | .eq(TkDeviceScriptEntity::getTenantId, tenantId) |
106 | 106 | .eq(TkDeviceScriptEntity::getId, scriptId); |
107 | 107 | TkDeviceScriptEntity result = baseMapper.selectOne(queryWrapper); |
108 | - return result == null ? null : result.getConvertJs(); | |
108 | + return (result == null || result.getStatus() == 0) ? null : result.getConvertJs(); | |
109 | 109 | } |
110 | 110 | |
111 | 111 | @Override | ... | ... |