From a0a4ff75b2daff5f42c1c2477dd09455652d02f6 Mon Sep 17 00:00:00 2001 From: xins Date: Wed, 3 Jan 2024 17:48:11 +0800 Subject: [PATCH] =?UTF-8?q?1.2.3=20ems=20=E5=A2=9E=E5=8A=A0=E8=AE=A1?= =?UTF-8?q?=E9=87=8F=E8=AE=BE=E5=A4=87=E6=97=B6=E5=9C=A8=E5=88=9B=E5=BB=BA?= =?UTF-8?q?tdengine=E5=AD=90=E8=A1=A8=E6=97=B6=E5=A6=82=E6=9E=9C=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E6=8A=9B=E5=87=BA=E5=9B=9E=E6=BB=9A=E4=BA=8B=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/service/impl/BaseMonitorInfo1ServiceImpl.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/BaseMonitorInfo1ServiceImpl.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/BaseMonitorInfo1ServiceImpl.java index b24d99b..61ac188 100644 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/BaseMonitorInfo1ServiceImpl.java +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/BaseMonitorInfo1ServiceImpl.java @@ -113,6 +113,8 @@ public class BaseMonitorInfo1ServiceImpl implements IBaseMonitorInfo1Service { //创建TDEngine子表 this.createEmsTbale(baseMonitorInfo.getMonitorId(), baseMonitorInfo.getBuildId(), baseMonitorInfo.getMonitorName(), baseMonitorInfo.getObjid()); + + return result; } catch (Exception e) { System.out.println("新增计量设备信息异常1111:" + e.getMessage()); @@ -149,8 +151,10 @@ public class BaseMonitorInfo1ServiceImpl implements IBaseMonitorInfo1Service { fields.add(field3); fields.add(field4); tableVo.setTagsFieldValues(fields); - remoteTdEngineService.createTable(tableVo, SecurityConstants.INNER); - + R tdReturnMsg = remoteTdEngineService.createTable(tableVo, SecurityConstants.INNER); + if (tdReturnMsg.getCode() != Constants.SUCCESS) {//抛出异常,回滚事务 + throw new RuntimeException(tdReturnMsg.getMsg()); + } } /** @@ -289,7 +293,7 @@ public class BaseMonitorInfo1ServiceImpl implements IBaseMonitorInfo1Service { alterTagVo.setDatabaseName(databaseName); alterTagVo.setTableName(tableName); alterTagVo.setTagName(TdEngineConstants.ST_TAG_EMS_BUILDID); - alterTagVo.setTagValue("'" +baseMonitorInfo.getBuildId()+ "'"); + alterTagVo.setTagValue("'" + baseMonitorInfo.getBuildId() + "'"); alterTagVos.add(alterTagVo); }