From cfbd83fc9d638c8d3d66a4f7e27904406752f7c1 Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期五, 20 九月 2024 10:38:40 +0800 Subject: [PATCH] data @DSTransactional --- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/service/impl/ChannelModbusTagServiceImpl.java | 63 ------------------------------- 1 files changed, 0 insertions(+), 63 deletions(-) diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/service/impl/ChannelModbusTagServiceImpl.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/service/impl/ChannelModbusTagServiceImpl.java index 17c6c64..7e80908 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/service/impl/ChannelModbusTagServiceImpl.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/service/impl/ChannelModbusTagServiceImpl.java @@ -82,67 +82,4 @@ baseMapper.delete(new QueryWrapper<ChannelModBusTagEntity>().eq("device", name)); } -// /** -// * 导入Tag -// * -// * @param device -// * @param file -// * @throws Exception -// */ -// @Override -// @Transactional(rollbackFor = Exception.class) -// public void importTag(String device, MultipartFile file) throws Exception { -// try { -// String suffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); -// String fileName = UUID.randomUUID().toString() + suffix; -// String path = uploadDir + fileName; -// file.transferTo(new File(path)); -// -// XSSFWorkbook hssfWorkbook = new XSSFWorkbook(new FileInputStream(path)); -// XSSFSheet sheet = hssfWorkbook.getSheetAt(0); -// int lastRowNum = sheet.getLastRowNum(); -// log.info("最后一行:" + lastRowNum); -// int lastCellNum = 6; -// List<ChannelModBusTagEntity> dangerList = new ArrayList<>(); -// for (int i = 1; i <= lastRowNum; i++) { -// XSSFRow row = sheet.getRow(i); -// for (int j = row.getFirstCellNum(); j < lastCellNum; j++) { -// row.getCell(j).setCellType(CellType.STRING); -// } -// ChannelModBusTagEntity tagEntity = new ChannelModBusTagEntity(); -// tagEntity.setId(UUID.randomUUID().toString()); -// tagEntity.setTagName(row.getCell(1).getStringCellValue()); -// tagEntity.setDataType(row.getCell(2).getStringCellValue()); -// tagEntity.setEnabled(true); -// tagEntity.setFormat(""); -// tagEntity.setDevice(device); -// tagEntity.setSamplingRate(0); -// row.getCell(4).setCellType(CellType.STRING); -// System.out.println(row.getCell(3).getStringCellValue()); -// if(row.getCell(3).getStringCellValue().equals("1")){ -// tagEntity.setAddress(String.format("1%04d",Integer.parseInt(row.getCell(4).getStringCellValue()))); -// }else if(row.getCell(3).getStringCellValue().equals("3")){ -// tagEntity.setAddress(String.format("4%04d",Integer.parseInt(row.getCell(4).getStringCellValue()))); -// } -// tagEntity.setTagDesc(row.getCell(5).getStringCellValue()); -// dangerList.add(tagEntity); -// } -// if (CollectionUtils.isEmpty(dangerList)) { -// return; -// } -// //getBaseMapper().insertList(dangerList); -// dangerList.forEach(item -> { -// try { -// getBaseMapper().insert(item); -// } catch (Exception ex) { -// log.warn("插入异常:" + item.getTagName()); -// } -// }); -// } catch (Exception ex) { -// ex.printStackTrace(); -// log.warn("导入失败!"); -// throw ex; -// } -// } - } -- Gitblit v1.9.3