From ea4f50f775fcb28da2c821b243b36ef1d99c4b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E4=BA=91=E9=B9=8F?= Date: Fri, 25 Oct 2024 15:46:05 +0800 Subject: [PATCH 01/20] =?UTF-8?q?=E6=B5=8B=E7=82=B9=EF=BC=9A=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=B0=83=E6=95=B4=20=E9=87=8F=E6=B5=8B=EF=BC=9A?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E6=95=B0=E6=8D=AE=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/dasadmin/src/api/backend/node/request.ts | 2 +- .../equipment/equipmentManagement/measurement.vue | 4 +++- ui/dasadmin/src/views/backend/node/univer.vue | 13 +++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ui/dasadmin/src/api/backend/node/request.ts b/ui/dasadmin/src/api/backend/node/request.ts index 2e72ec25..a3b6654d 100644 --- a/ui/dasadmin/src/api/backend/node/request.ts +++ b/ui/dasadmin/src/api/backend/node/request.ts @@ -120,7 +120,7 @@ export const saveMappingListReq = (data: any) => { export const bindDeviceMeasReq = (data: any) => { return createAxios({ - url: '/api/node/link/bindDeviceMeas', + url: '/api/node/link/bindDevices', method: 'post', data: data, }) diff --git a/ui/dasadmin/src/views/backend/equipment/equipmentManagement/measurement.vue b/ui/dasadmin/src/views/backend/equipment/equipmentManagement/measurement.vue index f3122d26..e5115315 100644 --- a/ui/dasadmin/src/views/backend/equipment/equipmentManagement/measurement.vue +++ b/ui/dasadmin/src/views/backend/equipment/equipmentManagement/measurement.vue @@ -155,8 +155,10 @@ const getCompleteData = () => { return getRealValueList({ deviceId: props.deviceId, attributes: codeList }, data) }) .then((realData: any) => { + console.log(realData); + const data = realData.list.map((item: any) => { - const realValItem = realData.realVal[props.deviceId]?.[item.attributeCode] + const realValItem = realData.realVal[props.deviceId]?.[item.attributeCode?.toLowerCase()] return { ...item, realTimeValue: realValItem ? (realValItem % 1 === 0 ? realValItem : realValItem.toFixed(3)) : '-', diff --git a/ui/dasadmin/src/views/backend/node/univer.vue b/ui/dasadmin/src/views/backend/node/univer.vue index 317c2958..3b9f4f7c 100644 --- a/ui/dasadmin/src/views/backend/node/univer.vue +++ b/ui/dasadmin/src/views/backend/node/univer.vue @@ -334,13 +334,14 @@ const okEdit = (data: any) => { const submitcorrectionDevice = () => { const bindDevice = correctionDevice.value.map((item: any, index) => { return { - equipmentId: item.id, + id: item.id, iotAddr: item.iotAddr, - porder: index + 1, + name: item.name, + iotModelId: item.iotModelId, } }) - bindDeviceMeasReq({ equipmentId: bindDevice, linkId: route.query.id }).then((res) => { + bindDeviceMeasReq({ equipmentList: bindDevice, linkId: route.query.id }).then((res) => { ElMessage.success('关联成功!') closecorrectionDevice() resetExcel() @@ -379,10 +380,10 @@ const getBindDeviceTree = () => { if (res.data) { correctionDevice.value = res.data.map((item: any) => { return { - id: item.equipmentId, - name: item.equipmentName, + id: item.id, + name: item.name, iotAddr: item.iotAddr, - porder: item.porder, + iotModelId: item.iotModelId, } }) } From 06bc07bfcddeab67343a510c415f8ed4dcb3694f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E4=BA=91=E9=B9=8F?= Date: Fri, 25 Oct 2024 15:49:54 +0800 Subject: [PATCH 02/20] =?UTF-8?q?=E9=87=8F=E6=B5=8B=EF=BC=9A=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E9=A1=B5=E9=9D=A2=E6=97=B6=E6=B8=85=E9=99=A4=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equipmentManagement/measurement.vue | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/ui/dasadmin/src/views/backend/equipment/equipmentManagement/measurement.vue b/ui/dasadmin/src/views/backend/equipment/equipmentManagement/measurement.vue index e5115315..d5954bab 100644 --- a/ui/dasadmin/src/views/backend/equipment/equipmentManagement/measurement.vue +++ b/ui/dasadmin/src/views/backend/equipment/equipmentManagement/measurement.vue @@ -155,10 +155,10 @@ const getCompleteData = () => { return getRealValueList({ deviceId: props.deviceId, attributes: codeList }, data) }) .then((realData: any) => { - console.log(realData); - + console.log(realData) + const data = realData.list.map((item: any) => { - const realValItem = realData.realVal[props.deviceId]?.[item.attributeCode?.toLowerCase()] + const realValItem = realData.realVal[props.deviceId]?.[item.attributeCode?.toLowerCase()] return { ...item, realTimeValue: realValItem ? (realValItem % 1 === 0 ? realValItem : realValItem.toFixed(3)) : '-', @@ -207,25 +207,30 @@ const openChart = (data: any) => {} watch( () => props.show, (newVal) => { - newVal && getCompleteData() + if (newVal) { + getCompleteData() + } else { + autoUpdateTimer.value && clearInterval(autoUpdateTimer.value) + autoUpdateTimer.value = null + } }, { immediate: true, } ) -let autoUpdateTimer: any = null +const autoUpdateTimer: any = ref(null) watch( () => props.autoUpdate, (newVal) => { if (newVal) { - if (!autoUpdateTimer) { - autoUpdateTimer = setInterval(() => { + if (!autoUpdateTimer.value) { + autoUpdateTimer.value = setInterval(() => { getCompleteData() }, 2000) } } else { - clearInterval(autoUpdateTimer) - autoUpdateTimer = null + clearInterval(autoUpdateTimer.value) + autoUpdateTimer.value = null } } ) From ee9b0fe38b263c9299056111b550294b0734475d Mon Sep 17 00:00:00 2001 From: huguanghan Date: Fri, 25 Oct 2024 16:05:54 +0800 Subject: [PATCH 03/20] =?UTF-8?q?=E7=89=A9=E6=A8=A1=E5=9E=8B=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=AF=BC=E5=85=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SysIotModelServiceImpl.java | 164 +++++++++++------- .../modules/node/service/TDEngineService.java | 4 - 2 files changed, 98 insertions(+), 70 deletions(-) diff --git a/das/src/main/java/com/das/modules/equipment/service/impl/SysIotModelServiceImpl.java b/das/src/main/java/com/das/modules/equipment/service/impl/SysIotModelServiceImpl.java index aa7389d2..b0b65162 100644 --- a/das/src/main/java/com/das/modules/equipment/service/impl/SysIotModelServiceImpl.java +++ b/das/src/main/java/com/das/modules/equipment/service/impl/SysIotModelServiceImpl.java @@ -38,6 +38,7 @@ import org.springframework.web.multipart.MultipartFile; import java.io.InputStream; import java.util.*; +import java.util.stream.Collectors; @Transactional(rollbackFor = Exception.class) @Service @@ -85,13 +86,13 @@ public class SysIotModelServiceImpl implements SysIotModelService { SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY); SysIotModelVo sysIotModelQuery = sysIotModelMapper.selectIotModelByCode(sysIotModelDto.getIotModelCode()); - if (!(sysIotModelQuery == null)){ - if(!(sysIotModelQuery.getId().equals(sysIotModelDto.getId()))){ + if (!(sysIotModelQuery == null)) { + if (!(sysIotModelQuery.getId().equals(sysIotModelDto.getId()))) { throw new ServiceException("物模型code已经存在!"); } } SysIotModel oldSysIotModel = sysIotModelMapper.selectById(sysIotModelDto.getId()); - if(!sysIotModelDto.getIotModelCode().equals(oldSysIotModel.getIotModelCode())) { + if (!sysIotModelDto.getIotModelCode().equals(oldSysIotModel.getIotModelCode())) { throw new ServiceException("物模型code不能修改!"); } sysIotModel.setUpdatedTime(new Date()); @@ -186,19 +187,19 @@ public class SysIotModelServiceImpl implements SysIotModelService { } SysIotModelFieldVo sysIotModelFieldQuery = sysIotModelFieldMapper.selectByAttributeCode(sysIotModelFieldDto.getIotModelId(), sysIotModelFieldDto.getAttributeCode()); if (!(sysIotModelFieldQuery == null)) { - if (!sysIotModelFieldQuery.getId().equals(sysIotModelFieldDto.getId())){ + if (!sysIotModelFieldQuery.getId().equals(sysIotModelFieldDto.getId())) { throw new ServiceException("物模型属性code已经存在"); } } sysIotModelFieldMapper.updateById(sysIotModelField); SysIotModelField oldSysIotField = sysIotModelFieldMapper.selectById(sysIotModelFieldDto.getId()); - if (oldSysIotField == null){ + if (oldSysIotField == null) { throw new ServiceException("未查找到该条记录"); } - if (!oldSysIotField.getAttributeCode().equals(sysIotModelField.getAttributeCode()) && oldSysIotField.getDataType().equals(sysIotModelField.getDataType()) && Objects.equals(oldSysIotField.getHighSpeed(), sysIotModelField.getHighSpeed())){ + if (!oldSysIotField.getAttributeCode().equals(sysIotModelField.getAttributeCode()) && oldSysIotField.getDataType().equals(sysIotModelField.getDataType()) && Objects.equals(oldSysIotField.getHighSpeed(), sysIotModelField.getHighSpeed())) { //更新td表结构 - updateTDStableOrColumn(sysIotModelField,oldSysIotField); + updateTDStableOrColumn(sysIotModelField, oldSysIotField); } SysIotModelFieldVo sysIotModelFieldVo = new SysIotModelFieldVo(); BeanCopyUtils.copy(sysIotModelField, sysIotModelFieldVo); @@ -255,7 +256,7 @@ public class SysIotModelServiceImpl implements SysIotModelService { SysIotModelServiceVo sysIotModelServiceQuery = sysIotModelServiceMapper.selectByServiceCode(sysIotModelServiceDto.getIotModelId(), sysIotModelServiceDto.getServiceCode()); if (!(sysIotModelServiceQuery == null)) { - if(sysIotModelServiceQuery.getId() != sysIotModelServiceDto.getId()){ + if (sysIotModelServiceQuery.getId() != sysIotModelServiceDto.getId()) { throw new ServiceException("物模型动作code已经存在"); } } @@ -295,7 +296,7 @@ public class SysIotModelServiceImpl implements SysIotModelService { exportList.add(sheetDTO); List sysIotModelServiceVoList = sysIotModelMapper.queryServiceByModelId(sysIotModelDto.getId()); - LinkedHashMap map1= new LinkedHashMap<>(); + LinkedHashMap map1 = new LinkedHashMap<>(); SheetInfoBean sheetDTO1 = new SheetInfoBean(); map1.put("tag", "标识"); map1.put("iotModelCode", "所属物模型编码"); @@ -314,7 +315,7 @@ public class SysIotModelServiceImpl implements SysIotModelService { } @Override - public void importSysIotModel(String iotModelId, MultipartFile file){ + public void importSysIotModel(String iotModelId, MultipartFile file) { try { InputStream inputStream = file.getInputStream(); ExcelReader readerAll = ExcelUtil.getReader(inputStream); @@ -327,15 +328,17 @@ public class SysIotModelServiceImpl implements SysIotModelService { List> list = sheetReader.read(1); // 从第二行开始读 if ("物模型属性".equals(sheetName)) { saveIotModelFieldInfo(iotModelId, list); - }else { + } else { saveIotModelServiceInfo(iotModelId, list); } } } catch (Exception e) { log.error("导入物模型异常:" + e.getMessage()); + throw new ServiceException("导入物模型异常:" + e.getMessage()); } } + private void saveIotModelServiceInfo(String iotModelId, List> list) { List sysIotModelServiceList = new ArrayList<>(); List updateSysIotModelServiceList = new ArrayList<>(); @@ -361,7 +364,7 @@ public class SysIotModelServiceImpl implements SysIotModelService { //加入集合 sysIotModelServiceList.add(services); } - }else { + } else { services.setId(sysIotModelServiceQuery.getId()); services.setUpdatedTime(new Date()); services.setUpdatedBy(StpUtil.getLoginIdAsString()); @@ -403,7 +406,7 @@ public class SysIotModelServiceImpl implements SysIotModelService { //加入集合 sysIotModelFieldList.add(field); } - }else { + } else { buildFieldInfo(iotModelId, row, field); field.setId(sysIotModelFieldQuery.getId()); field.setUpdatedTime(new Date()); @@ -417,47 +420,76 @@ public class SysIotModelServiceImpl implements SysIotModelService { } } if (CollectionUtils.isNotEmpty(sysIotModelFieldList)) { + //创建td表结构 + //分为高频低频两个list创建 + List lowCreateList = sysIotModelFieldList.stream().filter(item -> item.getHighSpeed() == 0).collect(Collectors.toList()); + List highCreateList = sysIotModelFieldList.stream().filter(item -> item.getHighSpeed() == 1).collect(Collectors.toList()); + for (int i = 0; i < lowCreateList.size(); i++) { + if (i == 0) { + createTdStableOrColumn(lowCreateList.get(i)); + } else { + SysIotModelField sysIotModelField = lowCreateList.get(i); + //stable已经存在,新增stable列 + SysIotModel sysIotModel = sysIotModelMapper.selectById(sysIotModelField.getIotModelId()); + Map map = new HashMap<>(); + map.put(sysIotModelField.getAttributeCode(), sysIotModelField.getDataType()); + //创建低频超级表 + tdEngineService.addStableColumn(sysIotModel.getIotModelCode(), "l_", map); + + } + } + for (int i = 0; i < highCreateList.size(); i++) { + if (i == 0) { + createTdStableOrColumn(highCreateList.get(i)); + } else { + SysIotModelField sysIotModelField = highCreateList.get(i); + //stable已经存在,新增stable列 + SysIotModel sysIotModel = sysIotModelMapper.selectById(sysIotModelField.getIotModelId()); + Map map = new HashMap<>(); + map.put(sysIotModelField.getAttributeCode(), sysIotModelField.getDataType()); + //创建高频超级表 + tdEngineService.addStableColumn(sysIotModel.getIotModelCode(), "h_", map); + } + + } + //新增pg数据库 sysIotModelFieldMapper.insertBatch(sysIotModelFieldList); -// ListUtil.page(sysIotModelFieldList, COMMIT_COUNT, create -> { -// for (SysIotModelField item : create){ -// createTdStableOrColumn(item); -// } -// }); } if (CollectionUtils.isNotEmpty(updateSysIotModelFieldList)) { -// ListUtil.page(updateSysIotModelFieldList, COMMIT_COUNT, update -> { -// for (SysIotModelField item : update){ -// SysIotModelField oldSysIotField = sysIotModelFieldMapper.selectById(item.getId()); -// if (oldSysIotField != null){ -// if (!oldSysIotField.getAttributeCode().equals(item.getAttributeCode()) && oldSysIotField.getDataType().equals(item.getDataType()) && Objects.equals(oldSysIotField.getHighSpeed(), item.getHighSpeed())){ -// //更新td表结构 -// updateTDStableOrColumn(item,oldSysIotField); -// } -// } -// } -// }); + for (SysIotModelField item : updateSysIotModelFieldList) { + SysIotModelField oldSysIotField = sysIotModelFieldMapper.selectById(item.getId()); + if (oldSysIotField != null) { + if (!oldSysIotField.getAttributeCode().equals(item.getAttributeCode()) && oldSysIotField.getDataType().equals(item.getDataType()) && Objects.equals(oldSysIotField.getHighSpeed(), item.getHighSpeed())) { + //更新td表结构 + updateTDStableOrColumn(item, oldSysIotField); + } + } + } sysIotModelFieldMapper.updateBatchById(updateSysIotModelFieldList); } if (CollectionUtils.isNotEmpty(delSysIotModelFieldList)) { -// ListUtil.page(updateSysIotModelFieldList, COMMIT_COUNT, delete -> { -// for (SysIotModelField item : delete){ -// deleteTDStableOrColumn(item); -// } -// }); - sysIotModelFieldMapper.deleteBatchIds(delSysIotModelFieldList); + //循环删除td表结构 + //分为高频低频两个list创建 + for (SysIotModelField item : delSysIotModelFieldList) { + deleteTDStableOrColumn(item); + sysIotModelFieldMapper.deleteById(item); + } } } private static void buildFieldInfo(String iotModelId, List row, SysIotModelField field) { + if (row.get(3).equals("") || row.get(4).equals("") || row.get(5).equals("") || row.get(7).equals("") || row.get(9).equals("") || row.get(11).equals("")) { + throw new ServiceException("字段不可为空,请检查excel文件{}" + row); + } field.setAttributeCode(row.get(3).toString().toLowerCase()); field.setAttributeName(row.get(4).toString()); field.setAttributeType(Integer.valueOf(row.get(5).toString())); - field.setUnit(row.get(6).toString()); + field.setUnit(row.get(6).equals("") ? null : row.get(6).toString()); field.setPorder(Integer.valueOf(row.get(7).toString())); - field.setSubSystem(row.get(8).toString()); + field.setSubSystem(row.get(8).equals("") ? null : row.get(8).toString()); field.setDataType(row.get(9).toString()); - field.setVisible(Integer.valueOf(row.get(10).toString())); + field.setVisible(row.get(10).equals("") ? null : Integer.valueOf(row.get(10).toString())); field.setHighSpeed(Integer.valueOf(row.get(11).toString())); field.setIotModelId(Long.valueOf(iotModelId)); } @@ -468,69 +500,69 @@ public class SysIotModelServiceImpl implements SysIotModelService { return list; } - public void createTdStableOrColumn(SysIotModelField sysIotModelField){ + public void createTdStableOrColumn(SysIotModelField sysIotModelField) { //如果新增的是第一条记录 创建tdengine超级表 分为高频和低频 QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("iot_model_id",sysIotModelField.getIotModelId()); - queryWrapper.eq("highspeed",sysIotModelField.getHighSpeed()); + queryWrapper.eq("iot_model_id", sysIotModelField.getIotModelId()); + queryWrapper.eq("highspeed", sysIotModelField.getHighSpeed()); List sysIotModelFields = sysIotModelFieldMapper.selectList(queryWrapper); - if (CollectionUtils.isEmpty(sysIotModelFields)){ - if (sysIotModelField.getHighSpeed() == 0){ + if (CollectionUtils.isEmpty(sysIotModelFields)) { + if (sysIotModelField.getHighSpeed() == 0) { SysIotModel sysIotModel = sysIotModelMapper.selectById(sysIotModelField.getIotModelId()); - Map map = new HashMap<>(); + Map map = new HashMap<>(); map.put(sysIotModelField.getAttributeCode(), sysIotModelField.getDataType()); //创建低频超级表 - tdEngineService.createStable(sysIotModel.getIotModelCode(),"l_",map); + tdEngineService.createStable(sysIotModel.getIotModelCode(), "l_", map); } - if (sysIotModelField.getHighSpeed() == 1){ + if (sysIotModelField.getHighSpeed() == 1) { SysIotModel sysIotModel = sysIotModelMapper.selectById(sysIotModelField.getIotModelId()); - Map map = new HashMap<>(); + Map map = new HashMap<>(); map.put(sysIotModelField.getAttributeCode(), sysIotModelField.getDataType()); //创建高频超级表 - tdEngineService.createStable(sysIotModel.getIotModelCode(),"h_",map); + tdEngineService.createStable(sysIotModel.getIotModelCode(), "h_", map); } - }else { + } else { //stable已经存在,新增stable列 - if (sysIotModelField.getHighSpeed() == 0){ + if (sysIotModelField.getHighSpeed() == 0) { SysIotModel sysIotModel = sysIotModelMapper.selectById(sysIotModelField.getIotModelId()); - Map map = new HashMap<>(); + Map map = new HashMap<>(); map.put(sysIotModelField.getAttributeCode(), sysIotModelField.getDataType()); //创建低频超级表 - tdEngineService.addStableColumn(sysIotModel.getIotModelCode(),"l_",map); + tdEngineService.addStableColumn(sysIotModel.getIotModelCode(), "l_", map); } - if (sysIotModelField.getHighSpeed() == 1){ + if (sysIotModelField.getHighSpeed() == 1) { SysIotModel sysIotModel = sysIotModelMapper.selectById(sysIotModelField.getIotModelId()); - Map map = new HashMap<>(); + Map map = new HashMap<>(); map.put(sysIotModelField.getAttributeCode(), sysIotModelField.getDataType()); //创建高频超级表 - tdEngineService.addStableColumn(sysIotModel.getIotModelCode(),"h_",map); + tdEngineService.addStableColumn(sysIotModel.getIotModelCode(), "h_", map); } } } - public void updateTDStableOrColumn(SysIotModelField sysIotModelField,SysIotModelField oldIotModelField){ + public void updateTDStableOrColumn(SysIotModelField sysIotModelField, SysIotModelField oldIotModelField) { deleteTDStableOrColumn(oldIotModelField); createTdStableOrColumn(sysIotModelField); } - public void deleteTDStableOrColumn(SysIotModelField sysIotModelField){ + public void deleteTDStableOrColumn(SysIotModelField sysIotModelField) { String stableName = null; SysIotModel sysIotModel = sysIotModelMapper.selectById(sysIotModelField.getIotModelId()); - if(sysIotModelField.getHighSpeed() == 0) { - stableName = "l_" + sysIotModel.getIotModelCode(); + if (sysIotModelField.getHighSpeed() == 0) { + stableName = "l_" + sysIotModel.getIotModelCode(); } - if(sysIotModelField.getHighSpeed() == 1) { - stableName = "h_" + sysIotModel.getIotModelCode(); + if (sysIotModelField.getHighSpeed() == 1) { + stableName = "h_" + sysIotModel.getIotModelCode(); } QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("iot_model_id",sysIotModelField.getIotModelId()); - queryWrapper.eq("highspeed",sysIotModelField.getHighSpeed()); + queryWrapper.eq("iot_model_id", sysIotModelField.getIotModelId()); + queryWrapper.eq("highspeed", sysIotModelField.getHighSpeed()); List sysIotModelFields = sysIotModelFieldMapper.selectList(queryWrapper); - if (CollectionUtils.isNotEmpty(sysIotModelFields) && sysIotModelFields.size() > 1){ - tdEngineService.deleteColumn(stableName,sysIotModelField.getAttributeCode()); + if (CollectionUtils.isNotEmpty(sysIotModelFields) && sysIotModelFields.size() > 1) { + tdEngineService.deleteColumn(stableName, sysIotModelField.getAttributeCode()); } //物模型属性只剩下最后一个删除表 - if (CollectionUtils.isNotEmpty(sysIotModelFields) && sysIotModelFields.size() == 1){ + if (CollectionUtils.isNotEmpty(sysIotModelFields) && sysIotModelFields.size() == 1) { tdEngineService.deleteStable(stableName); } } diff --git a/das/src/main/java/com/das/modules/node/service/TDEngineService.java b/das/src/main/java/com/das/modules/node/service/TDEngineService.java index 44276b15..d61ae709 100644 --- a/das/src/main/java/com/das/modules/node/service/TDEngineService.java +++ b/das/src/main/java/com/das/modules/node/service/TDEngineService.java @@ -61,7 +61,6 @@ public class TDEngineService { /** * 创建超级表 */ - @Async public void createStable(String iotModelCode, String stableType, Map fieldNameTypeMap) { try (Connection conn = hikariDataSource.getConnection(); Statement pstmt = conn.createStatement()) { @@ -95,7 +94,6 @@ public class TDEngineService { /** * 新增超级表列 */ - @Async public void addStableColumn(String iotModelCode, String stableType, Map fieldNameTypeMap) { try (Connection conn = hikariDataSource.getConnection(); Statement pstmt = conn.createStatement()) { @@ -126,7 +124,6 @@ public class TDEngineService { /** * 删除超级表列 */ - @Async public void deleteColumn(String stableName, String fieldCode) { try (Connection conn = hikariDataSource.getConnection(); Statement pstmt = conn.createStatement()) { @@ -152,7 +149,6 @@ public class TDEngineService { /** * 删除超级表 */ - @Async public void deleteStable(String stableName) { try (Connection conn = hikariDataSource.getConnection(); Statement pstmt = conn.createStatement()) { From f5a978b53787062906273509a513bf956fef5159 Mon Sep 17 00:00:00 2001 From: huguanghan Date: Fri, 25 Oct 2024 16:12:44 +0800 Subject: [PATCH 04/20] =?UTF-8?q?=E9=A3=8E=E6=9C=BA=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- das/src/main/resources/mapper/SysEquipmentMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/das/src/main/resources/mapper/SysEquipmentMapper.xml b/das/src/main/resources/mapper/SysEquipmentMapper.xml index 372d87c3..a61ac316 100644 --- a/das/src/main/resources/mapper/SysEquipmentMapper.xml +++ b/das/src/main/resources/mapper/SysEquipmentMapper.xml @@ -166,7 +166,7 @@ select distinct belong_line as name from sys_equipment t where t.object_type = 10002 and belong_line !=''; From bfdd3129601c06441b62303aaa48d05bd86927ac Mon Sep 17 00:00:00 2001 From: fengrong Date: Fri, 25 Oct 2024 16:15:01 +0800 Subject: [PATCH 05/20] =?UTF-8?q?=E5=8D=95=E9=A3=8E=E6=9C=BA=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/dasadmin/src/views/backend/WindBlower/index.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/dasadmin/src/views/backend/WindBlower/index.vue b/ui/dasadmin/src/views/backend/WindBlower/index.vue index a36fb122..28c5feb0 100644 --- a/ui/dasadmin/src/views/backend/WindBlower/index.vue +++ b/ui/dasadmin/src/views/backend/WindBlower/index.vue @@ -17,7 +17,7 @@ @@ -1013,6 +1013,13 @@ const tabhandleClick = (tabName) => { color: #333333; font-size: 20px; } + .dialog-footer{ + text-align: center; + .el-button{ + width: 120px; + height: 40px; + } + } .homelabel{ font-size: 18px; color: #4E5969; From 74aa49980feb0bdff89ad45bb38ea0ce2388991f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E4=BA=91=E9=B9=8F?= Date: Fri, 25 Oct 2024 16:36:35 +0800 Subject: [PATCH 06/20] =?UTF-8?q?=E9=A3=8E=E6=9C=BA=E5=88=97=E8=A1=A8?= =?UTF-8?q?=EF=BC=9A=E5=91=BD=E4=BB=A4=E8=AF=B7=E6=B1=82=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E5=8D=95=E9=A3=8E=E6=9C=BA=E9=A1=B5=E9=9D=A2=E5=88=87?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/backend/airBlower/request.ts | 2 +- .../backend/equipment/airBlower/index.vue | 26 ++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ui/dasadmin/src/api/backend/airBlower/request.ts b/ui/dasadmin/src/api/backend/airBlower/request.ts index 22125473..18a0ec51 100644 --- a/ui/dasadmin/src/api/backend/airBlower/request.ts +++ b/ui/dasadmin/src/api/backend/airBlower/request.ts @@ -20,7 +20,7 @@ export const runAirBlowerReq = (data: { opValue: 1 | 0 }[]) => { return createAxios({ - url: '/windTurbinesControl', + url: '/api/page/turbines/windTurbinesControl', method: 'post', data: data }) diff --git a/ui/dasadmin/src/views/backend/equipment/airBlower/index.vue b/ui/dasadmin/src/views/backend/equipment/airBlower/index.vue index d8badbf8..968b8e3e 100644 --- a/ui/dasadmin/src/views/backend/equipment/airBlower/index.vue +++ b/ui/dasadmin/src/views/backend/equipment/airBlower/index.vue @@ -101,7 +101,7 @@
{{ scope.row[item.prop] }}
@@ -117,6 +117,9 @@ import { reactive, ref, watch } from 'vue' import { useI18n } from 'vue-i18n' import { getAirBlowerListReq, getBelongLineListReq, runAirBlowerReq } from '/@/api/backend/airBlower/request' import { ElMessage } from 'element-plus' +import { useRouter, useRoute } from 'vue-router' +const router = useRouter() +const route = useRoute() const { t } = useI18n() @@ -394,6 +397,27 @@ watch(autoUpdate, (newVal: boolean) => { } }) +const openWindTurbine = (row: TableDataObjType) => { + if (!router.hasRoute('windTurbine')) { + router.addRoute('admin', { + path: '/windTurbine', + name: 'windTurbine', + component: () => import('/@/views/backend/WindBlower/index.vue'), + meta: { + title: '风机详情', + }, + }) + } + console.log(router.getRoutes()); + + router.push({ + name: 'windTurbine', + query: { + irn: row.irn, + }, + }) +} + getTableData() getBlongLineList() From 5868388b1ae06b99642f0c58a5e430d2affe6840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E4=BA=91=E9=B9=8F?= Date: Fri, 25 Oct 2024 17:13:39 +0800 Subject: [PATCH 07/20] =?UTF-8?q?=E9=A3=8E=E6=9C=BA=E5=88=97=E8=A1=A8?= =?UTF-8?q?=EF=BC=9A=E9=80=80=E5=87=BA=E6=97=B6=E6=B8=85=E9=99=A4=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/equipment/airBlower/index.vue | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/ui/dasadmin/src/views/backend/equipment/airBlower/index.vue b/ui/dasadmin/src/views/backend/equipment/airBlower/index.vue index 968b8e3e..66ec3805 100644 --- a/ui/dasadmin/src/views/backend/equipment/airBlower/index.vue +++ b/ui/dasadmin/src/views/backend/equipment/airBlower/index.vue @@ -47,7 +47,14 @@ - +