From 2366d547bef7ea16a7eb60d9e1f83d063bcb029f Mon Sep 17 00:00:00 2001 From: htjcAdmin Date: Sat, 19 Apr 2025 17:57:09 +0800 Subject: [PATCH] =?UTF-8?q?/*=E7=BA=A2=E5=A4=96=E5=AF=B9=E6=8E=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E7=BB=9F=E4=B8=80=E4=BF=AE=E6=94=B9*/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InfraredController.java | 15 +- .../simulator/domain/Infrared/Coordinate.java | 16 - .../domain/Infrared/InfraPictureInfo.java | 35 + .../domain/basedata/BasedataEqpBook.java | 113 +++ .../basedata/BasedataEqpBookChannel.java | 68 ++ .../mapper/BasedataEqpBookChannelMapper.java | 26 + .../simulator/service/HikVisionService.java | 9 +- .../service/impl/HikVisionServiceImpl.java | 667 +++++++++--------- .../simulator/utils/sftp/SftpClient.java | 2 +- .../metadata/BasedataEqpBookChannelMapper.xml | 192 +++++ 10 files changed, 770 insertions(+), 373 deletions(-) create mode 100644 src/main/java/com/inspect/simulator/domain/Infrared/InfraPictureInfo.java create mode 100644 src/main/java/com/inspect/simulator/domain/basedata/BasedataEqpBook.java create mode 100644 src/main/java/com/inspect/simulator/domain/basedata/BasedataEqpBookChannel.java create mode 100644 src/main/java/com/inspect/simulator/mapper/BasedataEqpBookChannelMapper.java create mode 100644 src/main/resources/mapper/metadata/BasedataEqpBookChannelMapper.xml diff --git a/src/main/java/com/inspect/simulator/controller/InfraredController.java b/src/main/java/com/inspect/simulator/controller/InfraredController.java index 64bed17..86d4195 100644 --- a/src/main/java/com/inspect/simulator/controller/InfraredController.java +++ b/src/main/java/com/inspect/simulator/controller/InfraredController.java @@ -1,9 +1,6 @@ package com.inspect.simulator.controller; -import com.inspect.simulator.domain.Infrared.Camera; -import com.inspect.simulator.domain.Infrared.Coordinate; -import com.inspect.simulator.domain.Infrared.InfraredInfo; -import com.inspect.simulator.domain.Infrared.NvrInfo; +import com.inspect.simulator.domain.Infrared.*; import com.inspect.simulator.service.HikVisionService; import com.inspect.simulator.hikVision.utils.AjaxResult; import org.springframework.beans.factory.annotation.Autowired; @@ -48,16 +45,16 @@ public class InfraredController { //图谱解析 @PostMapping("/ir/capturePicture") @ResponseBody - public AjaxResult capturePicture(@RequestBody Coordinate coordinate) { + public AjaxResult capturePicture(@RequestBody InfraPictureInfo infraPictureInfo) { - return hikVisionService.capturePicture(coordinate); + return hikVisionService.capturePicture(infraPictureInfo); } //图谱解析 - @PostMapping("/ir/calculate/capturePicture") + @PostMapping("/ir/calculatePicture") @ResponseBody - public AjaxResult calculatePicture(@RequestBody Coordinate coordinate) { + public AjaxResult calculatePicture(@RequestBody InfraPictureInfo infraPictureInfo) { - return hikVisionService.calculatePicture(coordinate); + return hikVisionService.calculatePicture(infraPictureInfo); } } diff --git a/src/main/java/com/inspect/simulator/domain/Infrared/Coordinate.java b/src/main/java/com/inspect/simulator/domain/Infrared/Coordinate.java index 6e4b1a4..71590d5 100644 --- a/src/main/java/com/inspect/simulator/domain/Infrared/Coordinate.java +++ b/src/main/java/com/inspect/simulator/domain/Infrared/Coordinate.java @@ -8,25 +8,9 @@ import lombok.NoArgsConstructor; @NoArgsConstructor @AllArgsConstructor public class Coordinate { - private String channelCode; - //点一坐标 private Integer firstX; private Integer firstY; //点二坐标 private Integer secondX; private Integer secondY; - - private String filePath; - - //图片宽 - private Integer imgWidth; - - //图片高 - private Integer imgHeight; - - private Coordinate[] coordinates; - - //红外图片类型 1-NVR;2-IVS;3-无人机 - private Integer imgType; - } diff --git a/src/main/java/com/inspect/simulator/domain/Infrared/InfraPictureInfo.java b/src/main/java/com/inspect/simulator/domain/Infrared/InfraPictureInfo.java new file mode 100644 index 0000000..f19361b --- /dev/null +++ b/src/main/java/com/inspect/simulator/domain/Infrared/InfraPictureInfo.java @@ -0,0 +1,35 @@ +package com.inspect.simulator.domain.Infrared; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class InfraPictureInfo { + private Long channelId; + private String channelCode; + //点一坐标 + private Integer firstX; + private Integer firstY; + //点二坐标 + private Integer secondX; + private Integer secondY; + + private String filePath; + + //图片宽 + private Integer imgWidth; + + //图片高 + private Integer imgHeight; + + private List coordinates; + + //红外图片类型 1-NVR;2-IVS;3-无人机 + private Integer imgType; + +} diff --git a/src/main/java/com/inspect/simulator/domain/basedata/BasedataEqpBook.java b/src/main/java/com/inspect/simulator/domain/basedata/BasedataEqpBook.java new file mode 100644 index 0000000..453e0c2 --- /dev/null +++ b/src/main/java/com/inspect/simulator/domain/basedata/BasedataEqpBook.java @@ -0,0 +1,113 @@ +package com.inspect.simulator.domain.basedata; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import com.inspect.simulator.domain.BaseEntity; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Setter +@Getter +public class BasedataEqpBook extends BaseEntity { + private static final long serialVersionUID = 1L; + + private Long eqpBookId; + + private String stationName; + + private String stationCode; + + private Long areaId; + + private String areaName; + + private String patrolDeviceName; + + private String patrolDeviceCode; + + private String deviceModel; + + private String manufacturer; + + private String useUnit; + + private String deviceSource; + + private String productionDate; + + private String productionCode; + + private String isTransport; + + private String useMode; + + private String videoMode; + + private String place; + + private String positionX; + + private String positionY; + + private String positionZ; + + private String type; + + private String patrolDeviceInfo; + + private String robotsCode; + + private String ipAddr; + + private String port; + + private String user; + + private String password; + private String delFlag; + + private String mainSystemCode; + + private String mapFilePath; + + private String videoNvrCode; + + @Override + public String toString() { + return "BasedataEqpBook{" + + "eqpBookId=" + eqpBookId + + ", stationName='" + stationName + '\'' + + ", stationCode='" + stationCode + '\'' + + ", areaId=" + areaId + + ", areaName='" + areaName + '\'' + + ", patrolDeviceName='" + patrolDeviceName + '\'' + + ", patrolDeviceCode='" + patrolDeviceCode + '\'' + + ", deviceModel='" + deviceModel + '\'' + + ", manufacturer='" + manufacturer + '\'' + + ", useUnit='" + useUnit + '\'' + + ", deviceSource='" + deviceSource + '\'' + + ", productionDate='" + productionDate + '\'' + + ", productionCode='" + productionCode + '\'' + + ", isTransport='" + isTransport + '\'' + + ", useMode='" + useMode + '\'' + + ", videoMode='" + videoMode + '\'' + + ", place='" + place + '\'' + + ", positionX='" + positionX + '\'' + + ", positionY='" + positionY + '\'' + + ", positionZ='" + positionZ + '\'' + + ", type='" + type + '\'' + + ", patrolDeviceInfo='" + patrolDeviceInfo + '\'' + + ", robotsCode='" + robotsCode + '\'' + + ", ipAddr='" + ipAddr + '\'' + + ", port='" + port + '\'' + + ", user='" + user + '\'' + + ", password='" + password + '\'' + + ", delFlag='" + delFlag + '\'' + + ", mainSystemCode='" + mainSystemCode + '\'' + + ", mapFilePath='" + mapFilePath + '\'' + + ", videoNvrCode='" + videoNvrCode + '\'' + + '}'; + } +} diff --git a/src/main/java/com/inspect/simulator/domain/basedata/BasedataEqpBookChannel.java b/src/main/java/com/inspect/simulator/domain/basedata/BasedataEqpBookChannel.java new file mode 100644 index 0000000..e144deb --- /dev/null +++ b/src/main/java/com/inspect/simulator/domain/basedata/BasedataEqpBookChannel.java @@ -0,0 +1,68 @@ +package com.inspect.simulator.domain.basedata; +import com.inspect.simulator.domain.BaseEntity; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class BasedataEqpBookChannel extends BaseEntity { + private static final long serialVersionUID = 1L; + private Long channelId; + private String channelCode; + + private String channelName; + + private String parentChannelId; + + private Long eqpBookId; + + private String eqpBookName; + + private String channelType; + + private String onlineState; + + private String channelContent; + + private String provider; + + private String address; + + private String host; + + private String port; + + private String deleteFlag; + + private String patrolDeviceCode; + + private String username; + + private String password; + + private String deviceSource; + + @Override + public String toString() { + return "BasedataEqpBookChannel{" + + "channelId=" + channelId + + ", channelCode='" + channelCode + '\'' + + ", channelName='" + channelName + '\'' + + ", parentChannelId='" + parentChannelId + '\'' + + ", eqpBookId=" + eqpBookId + + ", eqpBookName='" + eqpBookName + '\'' + + ", channelType='" + channelType + '\'' + + ", onlineState='" + onlineState + '\'' + + ", channelContent='" + channelContent + '\'' + + ", provider='" + provider + '\'' + + ", address='" + address + '\'' + + ", host='" + host + '\'' + + ", port='" + port + '\'' + + ", deleteFlag='" + deleteFlag + '\'' + + ", patrolDeviceCode='" + patrolDeviceCode + '\'' + + ", username='" + username + '\'' + + ", password='" + password + '\'' + + ", deviceSource='" + deviceSource + '\'' + + '}'; + } +} diff --git a/src/main/java/com/inspect/simulator/mapper/BasedataEqpBookChannelMapper.java b/src/main/java/com/inspect/simulator/mapper/BasedataEqpBookChannelMapper.java new file mode 100644 index 0000000..99921d4 --- /dev/null +++ b/src/main/java/com/inspect/simulator/mapper/BasedataEqpBookChannelMapper.java @@ -0,0 +1,26 @@ +package com.inspect.simulator.mapper; + + +import com.inspect.simulator.domain.basedata.BasedataEqpBook; +import com.inspect.simulator.domain.basedata.BasedataEqpBookChannel; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface BasedataEqpBookChannelMapper { + BasedataEqpBookChannel selectBasedataEqpBookChannelByChannelId(Long channelId); + + List selectBasedataEqpBookChannelList(BasedataEqpBookChannel channel); + + int insertBasedataEqpBookChannel(BasedataEqpBookChannel channel); + + int updateBasedataEqpBookChannel(BasedataEqpBookChannel channel); + + int deleteBasedataEqpBookChannelByChannelId(Long channelId); + + int deleteBasedataEqpBookChannelByChannelIds(Long[] channelIds); + + List getChannelByEqpBookCode(BasedataEqpBook eqpBook); + +} diff --git a/src/main/java/com/inspect/simulator/service/HikVisionService.java b/src/main/java/com/inspect/simulator/service/HikVisionService.java index 6d8339c..fced16d 100644 --- a/src/main/java/com/inspect/simulator/service/HikVisionService.java +++ b/src/main/java/com/inspect/simulator/service/HikVisionService.java @@ -1,9 +1,6 @@ package com.inspect.simulator.service; -import com.inspect.simulator.domain.Infrared.Camera; -import com.inspect.simulator.domain.Infrared.Coordinate; -import com.inspect.simulator.domain.Infrared.InfraredInfo; -import com.inspect.simulator.domain.Infrared.NvrInfo; +import com.inspect.simulator.domain.Infrared.*; import com.inspect.simulator.hikVision.utils.AjaxResult; public interface HikVisionService { @@ -15,11 +12,11 @@ public interface HikVisionService { // AjaxResult cameraHongWaiHk(Camera camera) ; //图谱解析 - AjaxResult capturePicture(Coordinate coordinate); + AjaxResult capturePicture(InfraPictureInfo infraPictureInfo); //调用华软无人机获取csv温度 public float[][] UploadFtpImage( String url, String type, String image); //图谱解析 - AjaxResult calculatePicture(Coordinate coordinate); + AjaxResult calculatePicture(InfraPictureInfo infraPictureInfo); } diff --git a/src/main/java/com/inspect/simulator/service/impl/HikVisionServiceImpl.java b/src/main/java/com/inspect/simulator/service/impl/HikVisionServiceImpl.java index 3969c48..4b4c25e 100644 --- a/src/main/java/com/inspect/simulator/service/impl/HikVisionServiceImpl.java +++ b/src/main/java/com/inspect/simulator/service/impl/HikVisionServiceImpl.java @@ -9,14 +9,13 @@ import com.alibaba.fastjson.JSONException; import com.alibaba.fastjson.JSONObject; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.inspect.simulator.domain.Infrared.Camera; -import com.inspect.simulator.domain.Infrared.Coordinate; -import com.inspect.simulator.domain.Infrared.InfraredInfo; -import com.inspect.simulator.domain.Infrared.NvrInfo; +import com.inspect.simulator.domain.Infrared.*; +import com.inspect.simulator.domain.basedata.BasedataEqpBookChannel; import com.inspect.simulator.hikVision.utils.AjaxResult; import com.inspect.simulator.hikVision.utils.StringUtils; import com.inspect.simulator.hikVision.utils.jna.HikVisionUtils; import com.inspect.simulator.hikVision.utils.jna.HCNetSDK; +import com.inspect.simulator.mapper.BasedataEqpBookChannelMapper; import com.inspect.simulator.service.HikVisionService; import com.inspect.simulator.utils.sftp.SftpClient; import com.sun.jna.ptr.IntByReference; @@ -87,6 +86,9 @@ public class HikVisionServiceImpl implements HikVisionService { @Resource private SftpClient sftpClient; + @Resource + private BasedataEqpBookChannelMapper basedataEqpBookChannelMapper; + // @Override // public AjaxResult login(NvrInfo nvrInfo) { // return login_V40(nvrInfo); @@ -294,58 +296,42 @@ public class HikVisionServiceImpl implements HikVisionService { // return AjaxResult.success(infraredInfo); // } @Override - public AjaxResult capturePicture(Coordinate coordinate) { - - InfraredInfo infraredInfo = new InfraredInfo(); - try { - String imagePath = coordinate.getFilePath(); -// String imagePath = "/images/ir_test.jpg"; - InputStream inputStream = downloadFtp(imagePath); - String protocol = hrFtpUrl.substring(0, 6); // "ftp://" - String withoutProtocol = hrFtpUrl.substring(6); // "zthr02:zthr02@123.184.14.138:50021/" - String[] userAndHost = withoutProtocol.split("@"); - if (userAndHost.length != 2) { - throw new IllegalArgumentException("URL 格式错误,缺少 @ 分隔符"); - } - String[] userPass = userAndHost[0].split(":"); - String username = userPass[0]; - String password = userPass[1]; - String hostPort = userAndHost[1].replace("/", ""); // 移除末尾的 "/" - String[] hostAndPort = hostPort.split(":"); - String host = hostAndPort[0]; - int port = Integer.parseInt(hostAndPort[1]); - - String imageName = Paths.get(imagePath).getFileName().toString(); - pic2Ftp(imageName,inputStream,host,port,username,password); - String ftpUrlName = "[\"" + hrFtpUrl + imageName + "\"]"; - - - if (coordinate.getImgType() == 1) { - byte[] imageBytes = Files.readAllBytes(Paths.get(imagePath)); - infraredInfo = readDataHw(imageBytes, coordinate); - } else if (coordinate.getImgType() == 2) { - - String s = ImageOverlaysIvs(coordinate, infraredInfo); - infraredInfo.setOutPath(s); - } else if (coordinate.getImgType() == 3) { - //sdk版本调用x86_32 - //float[][] imageTem = djService.getImageTem(coordinate.getFilePath()); - - //调用华软接口 - float[][] imageTem = UploadFtpImage(hrUavUrl, null, ftpUrlName); - if (imageTem != null && imageTem.length > 0 && imageTem[0].length > 0) { - infraredInfo.setTemperatureMatrix(imageTem); - String s = ImageOverlaysUav(coordinate, infraredInfo); - infraredInfo.setOutPath(s); - } else { - return AjaxResult.error("温度解析错误!"); + public AjaxResult capturePicture(InfraPictureInfo infraPictureInfo) { + log.info("capturePicture, coordinate:{}", infraPictureInfo); + if (infraPictureInfo.getImgType() == 1) { + return AjaxResult.success("设置成功"); + } else if (infraPictureInfo.getImgType() == 2) { + return AjaxResult.success("设置成功"); + } else if (infraPictureInfo.getImgType() == 3) { + Long channelId = infraPictureInfo.getChannelId(); + channelId = 1299L; + BasedataEqpBookChannel basedataEqpBookChannel = basedataEqpBookChannelMapper.selectBasedataEqpBookChannelByChannelId(channelId); + if (basedataEqpBookChannel != null) { + int firstX = 0; + int firstY = 0; + int secondX = 512; + int secondY = 640; + int imgWidth = 640; + int imgHeight = 512; + if(infraPictureInfo.getCoordinates() != null && !infraPictureInfo.getCoordinates().isEmpty()) { + firstX = infraPictureInfo.getCoordinates().get(0).getFirstX(); + firstY = infraPictureInfo.getCoordinates().get(0).getFirstY(); + secondX = infraPictureInfo.getCoordinates().get(0).getSecondX(); + secondY = infraPictureInfo.getCoordinates().get(0).getSecondY(); + imgWidth = infraPictureInfo.getImgHeight(); + imgHeight = infraPictureInfo.getImgWidth(); } + + String channelContent = firstX + "," + firstY + "," + secondX + "," + secondY + "," + imgWidth + "," + imgHeight; + basedataEqpBookChannel.setChannelContent(channelContent); + basedataEqpBookChannelMapper.updateBasedataEqpBookChannel(basedataEqpBookChannel); + return AjaxResult.success("设置成功"); + } else { + return AjaxResult.error("点位不存在"); } - } catch (Exception e) { - e.printStackTrace(); - return AjaxResult.error(); + } else { + return AjaxResult.error("不支持该类型"); } - return AjaxResult.success(infraredInfo); } @@ -466,8 +452,8 @@ public class HikVisionServiceImpl implements HikVisionService { // } //绘制框选标识 if (coordinate != null) { - String s = ImageOverlaysNvr(coordinate, infraredInfo); - infraredInfo.setOutPath(s); + //String s = ImageOverlaysNvr(coordinate, infraredInfo); + //infraredInfo.setOutPath(s); } } else { System.err.println("错误:剩余数据不足以解析环境参数"); @@ -479,30 +465,30 @@ public class HikVisionServiceImpl implements HikVisionService { } //点测温 - public InfraredInfo PointTemperatureShow(Coordinate coordinate, short width, short height, float[][] temperatureMatrix) { - InfraredInfo infraredInfo = new InfraredInfo(); - // 获取指定坐标的温度 - if (ObjectUtil.isNotEmpty(coordinate.getFirstX())) { - if (coordinate.getImgType() != 3) {//无人机不需要对比底图 - //比例缩放像素 获取底图温度值 - double xMultiple = (coordinate.getImgWidth().doubleValue() / width) * 100 / 100.0; - double yMultiple = (coordinate.getImgHeight().doubleValue() / height) * 100 / 100.0; - - int x = (int) (coordinate.getFirstX() / xMultiple); - int y = (int) (coordinate.getFirstY() / yMultiple); - coordinate.setFirstX(x); - coordinate.setFirstY(y); - } - - if (coordinate.getFirstX() >= 0 && coordinate.getFirstX() <= width && coordinate.getFirstY() >= 0 && coordinate.getFirstY() <= height) { - float pointTemperature = temperatureMatrix[coordinate.getFirstY()][coordinate.getFirstX()]; // 注意:y是行,x是列 - infraredInfo.setPointTemperature(pointTemperature); - } else { - System.err.println("错误:坐标超出范围"); - } - } - return infraredInfo; - } +// public InfraredInfo PointTemperatureShow(Coordinate coordinate, short width, short height, float[][] temperatureMatrix) { +// InfraredInfo infraredInfo = new InfraredInfo(); +// // 获取指定坐标的温度 +// if (ObjectUtil.isNotEmpty(coordinate.getFirstX())) { +// if (coordinate.getImgType() != 3) {//无人机不需要对比底图 +// //比例缩放像素 获取底图温度值 +// double xMultiple = (coordinate.getImgWidth().doubleValue() / width) * 100 / 100.0; +// double yMultiple = (coordinate.getImgHeight().doubleValue() / height) * 100 / 100.0; +// +// int x = (int) (coordinate.getFirstX() / xMultiple); +// int y = (int) (coordinate.getFirstY() / yMultiple); +// coordinate.setFirstX(x); +// coordinate.setFirstY(y); +// } +// +// if (coordinate.getFirstX() >= 0 && coordinate.getFirstX() <= width && coordinate.getFirstY() >= 0 && coordinate.getFirstY() <= height) { +// float pointTemperature = temperatureMatrix[coordinate.getFirstY()][coordinate.getFirstX()]; // 注意:y是行,x是列 +// infraredInfo.setPointTemperature(pointTemperature); +// } else { +// System.err.println("错误:坐标超出范围"); +// } +// } +// return infraredInfo; +// } //框选温度值计算 public InfraredInfo matrixTemperatureShow(Coordinate coordinate, short width, short height, float[][] temperatureMatrix) { @@ -510,21 +496,22 @@ public class HikVisionServiceImpl implements HikVisionService { //存储框选矩阵温度值 List values = new ArrayList<>(); if (ObjectUtil.isNotEmpty(coordinate.getFirstX()) && ObjectUtil.isNotEmpty(coordinate.getSecondX())) { - if (coordinate.getImgType() != 3) {//无人机不需要对比底图 - //倍数计算 - double xMultiple = (coordinate.getImgWidth().doubleValue() / width) * 100 / 100.0; - double yMultiple = (coordinate.getImgHeight().doubleValue() / height) * 100 / 100.0; - - //比例缩放像素 获取底图温度值 - int x1 = (int) (coordinate.getFirstX() / xMultiple); - int y1 = (int) (coordinate.getFirstY() / yMultiple); - int x2 = (int) (coordinate.getSecondX() / xMultiple); - int y2 = (int) (coordinate.getSecondY() / yMultiple); - coordinate.setFirstX(x1); - coordinate.setFirstY(y1); - coordinate.setSecondX(x2); - coordinate.setSecondY(y2); - } + //if (coordinate.getImgType() != 3) +// {//无人机不需要对比底图 +// //倍数计算 +// double xMultiple = (coordinate.getImgWidth().doubleValue() / width) * 100 / 100.0; +// double yMultiple = (coordinate.getImgHeight().doubleValue() / height) * 100 / 100.0; +// +// //比例缩放像素 获取底图温度值 +// int x1 = (int) (coordinate.getFirstX() / xMultiple); +// int y1 = (int) (coordinate.getFirstY() / yMultiple); +// int x2 = (int) (coordinate.getSecondX() / xMultiple); +// int y2 = (int) (coordinate.getSecondY() / yMultiple); +// coordinate.setFirstX(x1); +// coordinate.setFirstY(y1); +// coordinate.setSecondX(x2); +// coordinate.setSecondY(y2); +// } if (coordinate.getSecondX() != 0 && coordinate.getSecondY() != 0) { for (int j = coordinate.getFirstY(); j <= coordinate.getSecondY(); j++) { // 列 @@ -608,238 +595,238 @@ public class HikVisionServiceImpl implements HikVisionService { //图片标注__nvr - public String ImageOverlaysNvr(Coordinate coordinate, InfraredInfo infraredInfo) { - - Coordinate[] coordinates = coordinate.getCoordinates(); - - Date date = new Date(); - SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); - String markPicName = sf.format(date); - // 图片路径(请替换为实际路径) - String imagePath = coordinate.getFilePath(); - // 获取文件名(不含扩展名) - File file = new File(imagePath); - String fileName = file.getName(); - String pureName = fileName.substring(0, fileName.lastIndexOf('.')); - String filename = picPath; - String outputPath = picPath + pureName + "_" + markPicName + ".jpg"; - //判断路径是否存在 - File filePath = new File(filename); - if (!filePath.exists()) { - //不存在,创建目录 - filePath.mkdirs(); - } - try { - // 加载原始图片 - BufferedImage originalImage = ImageIO.read(new File(imagePath)); - if (originalImage == null) { - System.err.println("无法加载图片: " + imagePath); - return null; - } - - // 创建可编辑的图片副本 - BufferedImage annotatedImage = new BufferedImage( - originalImage.getWidth(), - originalImage.getHeight(), - BufferedImage.TYPE_INT_RGB - ); - // 绘制原始图片 - Graphics2D g2d = annotatedImage.createGraphics(); - g2d.drawImage(originalImage, 0, 0, null); - - // 设置标注样式 - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - Font font = new Font("微软雅黑", Font.BOLD, 17); - - for (Coordinate c : coordinates) { - - //点标注 - if (c.getFirstX() != null && c.getFirstY() != null && c.getSecondX() == null && c.getSecondY() == null) { - g2d.setFont(font); - // 标注点坐标 - g2d.setColor(Color.GREEN); - int x = c.getFirstX(); - int y = c.getFirstY(); - - // 确保坐标在图片范围内 - if (x >= 0 && x < originalImage.getWidth() && - y >= 0 && y < originalImage.getHeight()) { - // 绘制点(用实心圆表示) - g2d.fillOval(x - 3, y - 3, 6, 6); - coordinate.setFirstX(x); - coordinate.setFirstY(y); - InfraredInfo drawStringPoint = PointTemperatureShow(coordinate, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix()); - // 添加坐标标签 - g2d.drawString("(" + String.format("%.2f", drawStringPoint.getPointTemperature()) + ")", x + 8, y - 8); - } - } - - //矩阵标注 - if (c.getSecondX() != null && c.getSecondY() != null) { - // 标注矩形(每两个点确定一个矩形) - g2d.setColor(Color.RED); - int x1 = c.getFirstX(); - int y1 = c.getFirstY(); - int x2 = c.getSecondX(); - int y2 = c.getSecondY(); - - // 确保坐标在图片范围内 - if (x1 >= 0 && x1 < originalImage.getWidth() && y1 >= 0 && y1 < originalImage.getHeight() && - x2 >= 0 && x2 < originalImage.getWidth() && y2 >= 0 && y2 < originalImage.getHeight()) { - - // 确保x1,y1是左上角,x2,y2是右下角 - int rectX = Math.min(x1, x2); - int rectY = Math.min(y1, y2); - int width = Math.abs(x2 - x1); - int height = Math.abs(y2 - y1); - // 绘制矩形 - g2d.drawRect(rectX, rectY, width, height); - - coordinate.setFirstX(x1); - coordinate.setFirstY(y1); - coordinate.setSecondX(x2); - coordinate.setSecondY(y2); - - InfraredInfo drawStringMatrix = matrixTemperatureShow(coordinate, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix()); - infraredInfo.setFrameMax(Math.round(drawStringMatrix.getFrameMax() * 100) / 100f); - // 添加矩形标签 - g2d.drawString("平均温度:" + String.format("%.2f", drawStringMatrix.getFrameAverage()) + - "最高温度:" + String.format("%.2f", drawStringMatrix.getFrameMax()) + - "最低温度:" + String.format("%.2f", drawStringMatrix.getFrameMin()), rectX + 5, rectY + 15); - - } - } - } - g2d.dispose(); - // 保存标注后的图片 - File outputFile = new File(outputPath); - // 确保输出目录存在 - outputFile.getParentFile().mkdirs(); - - ImageIO.write(annotatedImage, "jpg", outputFile); -// System.out.println("标注后的图片已保存到: " + outputPath); - - } catch (IOException e) { - System.err.println("处理图片时出错: " + e.getMessage()); - e.printStackTrace(); - } - return outputPath; - } +// public String ImageOverlaysNvr(Coordinate coordinate, InfraredInfo infraredInfo) { +// +// Coordinate[] coordinates = coordinate.getCoordinates(); +// +// Date date = new Date(); +// SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); +// String markPicName = sf.format(date); +// // 图片路径(请替换为实际路径) +// String imagePath = coordinate.getFilePath(); +// // 获取文件名(不含扩展名) +// File file = new File(imagePath); +// String fileName = file.getName(); +// String pureName = fileName.substring(0, fileName.lastIndexOf('.')); +// String filename = picPath; +// String outputPath = picPath + pureName + "_" + markPicName + ".jpg"; +// //判断路径是否存在 +// File filePath = new File(filename); +// if (!filePath.exists()) { +// //不存在,创建目录 +// filePath.mkdirs(); +// } +// try { +// // 加载原始图片 +// BufferedImage originalImage = ImageIO.read(new File(imagePath)); +// if (originalImage == null) { +// System.err.println("无法加载图片: " + imagePath); +// return null; +// } +// +// // 创建可编辑的图片副本 +// BufferedImage annotatedImage = new BufferedImage( +// originalImage.getWidth(), +// originalImage.getHeight(), +// BufferedImage.TYPE_INT_RGB +// ); +// // 绘制原始图片 +// Graphics2D g2d = annotatedImage.createGraphics(); +// g2d.drawImage(originalImage, 0, 0, null); +// +// // 设置标注样式 +// g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); +// Font font = new Font("微软雅黑", Font.BOLD, 17); +// +// for (Coordinate c : coordinates) { +// +// //点标注 +// if (c.getFirstX() != null && c.getFirstY() != null && c.getSecondX() == null && c.getSecondY() == null) { +// g2d.setFont(font); +// // 标注点坐标 +// g2d.setColor(Color.GREEN); +// int x = c.getFirstX(); +// int y = c.getFirstY(); +// +// // 确保坐标在图片范围内 +// if (x >= 0 && x < originalImage.getWidth() && +// y >= 0 && y < originalImage.getHeight()) { +// // 绘制点(用实心圆表示) +// g2d.fillOval(x - 3, y - 3, 6, 6); +// coordinate.setFirstX(x); +// coordinate.setFirstY(y); +// InfraredInfo drawStringPoint = PointTemperatureShow(coordinate, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix()); +// // 添加坐标标签 +// g2d.drawString("(" + String.format("%.2f", drawStringPoint.getPointTemperature()) + ")", x + 8, y - 8); +// } +// } +// +// //矩阵标注 +// if (c.getSecondX() != null && c.getSecondY() != null) { +// // 标注矩形(每两个点确定一个矩形) +// g2d.setColor(Color.RED); +// int x1 = c.getFirstX(); +// int y1 = c.getFirstY(); +// int x2 = c.getSecondX(); +// int y2 = c.getSecondY(); +// +// // 确保坐标在图片范围内 +// if (x1 >= 0 && x1 < originalImage.getWidth() && y1 >= 0 && y1 < originalImage.getHeight() && +// x2 >= 0 && x2 < originalImage.getWidth() && y2 >= 0 && y2 < originalImage.getHeight()) { +// +// // 确保x1,y1是左上角,x2,y2是右下角 +// int rectX = Math.min(x1, x2); +// int rectY = Math.min(y1, y2); +// int width = Math.abs(x2 - x1); +// int height = Math.abs(y2 - y1); +// // 绘制矩形 +// g2d.drawRect(rectX, rectY, width, height); +// +// coordinate.setFirstX(x1); +// coordinate.setFirstY(y1); +// coordinate.setSecondX(x2); +// coordinate.setSecondY(y2); +// +// InfraredInfo drawStringMatrix = matrixTemperatureShow(coordinate, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix()); +// infraredInfo.setFrameMax(Math.round(drawStringMatrix.getFrameMax() * 100) / 100f); +// // 添加矩形标签 +// g2d.drawString("平均温度:" + String.format("%.2f", drawStringMatrix.getFrameAverage()) + +// "最高温度:" + String.format("%.2f", drawStringMatrix.getFrameMax()) + +// "最低温度:" + String.format("%.2f", drawStringMatrix.getFrameMin()), rectX + 5, rectY + 15); +// +// } +// } +// } +// g2d.dispose(); +// // 保存标注后的图片 +// File outputFile = new File(outputPath); +// // 确保输出目录存在 +// outputFile.getParentFile().mkdirs(); +// +// ImageIO.write(annotatedImage, "jpg", outputFile); +//// System.out.println("标注后的图片已保存到: " + outputPath); +// +// } catch (IOException e) { +// System.err.println("处理图片时出错: " + e.getMessage()); +// e.printStackTrace(); +// } +// return outputPath; +// } //图片标注_iVS1800 - public String ImageOverlaysIvs(Coordinate coordinate, InfraredInfo infraredInfo) { - - Coordinate[] coordinates = coordinate.getCoordinates(); - - Date date = new Date(); - SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); - String markPicName = sf.format(date); - // 图片路径(请替换为实际路径) - String imagePath = coordinate.getFilePath(); - // 获取文件名(不含扩展名) - File file = new File(imagePath); - String fileName = file.getName(); - String pureName = fileName.substring(0, fileName.lastIndexOf('.')); - String filename = picPath; - String outputPath = picPath + pureName + "_" + markPicName + ".jpg"; - //判断路径是否存在 - File filePath = new File(filename); - if (!filePath.exists()) { - //不存在,创建目录 - filePath.mkdirs(); - } - try { - // 加载原始图片 - BufferedImage originalImage = ImageIO.read(new File(imagePath)); - if (originalImage == null) { - System.err.println("无法加载图片: " + imagePath); - return null; - } - - // 创建可编辑的图片副本 - BufferedImage annotatedImage = new BufferedImage( - originalImage.getWidth(), - originalImage.getHeight(), - BufferedImage.TYPE_INT_RGB - ); - // 绘制原始图片 - Graphics2D g2d = annotatedImage.createGraphics(); - g2d.drawImage(originalImage, 0, 0, null); - - // 设置标注样式 - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - Font font = new Font("微软雅黑", Font.BOLD, 17); - - for (Coordinate c : coordinates) { - g2d.setFont(font); - //矩阵标注 - if (c.getSecondX() != null && c.getSecondY() != null) { - // 标注矩形(每两个点确定一个矩形) - g2d.setColor(Color.WHITE); - int x1 = c.getFirstX(); - int y1 = c.getFirstY(); - int x2 = c.getSecondX(); - int y2 = c.getSecondY(); - - // 确保坐标在图片范围内 - if (x1 >= 0 && x1 < originalImage.getWidth() && y1 >= 0 && y1 < originalImage.getHeight() && - x2 >= 0 && x2 < originalImage.getWidth() && y2 >= 0 && y2 < originalImage.getHeight()) { - - // 确保x1,y1是左上角,x2,y2是右下角 - int rectX = Math.min(x1, x2); - int rectY = Math.min(y1, y2); - int width = Math.abs(x2 - x1); - int height = Math.abs(y2 - y1); - // 绘制矩形 - g2d.drawRect(rectX, rectY, width, height); - - coordinate.setFirstX(x1); - coordinate.setFirstY(y1); - coordinate.setSecondX(x2); - coordinate.setSecondY(y2); - // 添加矩形标签 - //图片路径取值 - String[] dividePath = Paths.get(imagePath).getFileName().toString().replaceAll("(?i)\\.jpg$", "").split("_"); - String max = dividePath[dividePath.length - 3]; // 最大值 - String min = dividePath[dividePath.length - 2]; // 最小值 - String avg = dividePath[dividePath.length - 1]; // 平均值 - infraredInfo.setFrameMax(Float.parseFloat(max)); -// g2d.drawString("平均温度:" +avg + "最高温度:" + max + "最低温度:" + min, rectX + 5, rectY + 15); - - String line1 = "平均温度:" + avg; - String line2 = "最高温度:" + max; - String line3 = "最低温度:" + min; - - g2d.drawString(line1, rectX + 5, rectY + 15); - g2d.drawString(line2, rectX + 5, rectY + 30); - g2d.drawString(line3, rectX + 5, rectY + 45); - } - } - } - g2d.dispose(); - // 保存标注后的图片 - File outputFile = new File(outputPath); - // 确保输出目录存在 - outputFile.getParentFile().mkdirs(); - ImageIO.write(annotatedImage, "jpg", outputFile); - } catch (IOException e) { - System.err.println("处理图片时出错: " + e.getMessage()); - e.printStackTrace(); - } - return outputPath; - } +// public String ImageOverlaysIvs(Coordinate coordinate, InfraredInfo infraredInfo) { +// +// Coordinate[] coordinates = coordinate.getCoordinates(); +// +// Date date = new Date(); +// SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); +// String markPicName = sf.format(date); +// // 图片路径(请替换为实际路径) +// String imagePath = coordinate.getFilePath(); +// // 获取文件名(不含扩展名) +// File file = new File(imagePath); +// String fileName = file.getName(); +// String pureName = fileName.substring(0, fileName.lastIndexOf('.')); +// String filename = picPath; +// String outputPath = picPath + pureName + "_" + markPicName + ".jpg"; +// //判断路径是否存在 +// File filePath = new File(filename); +// if (!filePath.exists()) { +// //不存在,创建目录 +// filePath.mkdirs(); +// } +// try { +// // 加载原始图片 +// BufferedImage originalImage = ImageIO.read(new File(imagePath)); +// if (originalImage == null) { +// System.err.println("无法加载图片: " + imagePath); +// return null; +// } +// +// // 创建可编辑的图片副本 +// BufferedImage annotatedImage = new BufferedImage( +// originalImage.getWidth(), +// originalImage.getHeight(), +// BufferedImage.TYPE_INT_RGB +// ); +// // 绘制原始图片 +// Graphics2D g2d = annotatedImage.createGraphics(); +// g2d.drawImage(originalImage, 0, 0, null); +// +// // 设置标注样式 +// g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); +// Font font = new Font("微软雅黑", Font.BOLD, 17); +// +// for (Coordinate c : coordinates) { +// g2d.setFont(font); +// //矩阵标注 +// if (c.getSecondX() != null && c.getSecondY() != null) { +// // 标注矩形(每两个点确定一个矩形) +// g2d.setColor(Color.WHITE); +// int x1 = c.getFirstX(); +// int y1 = c.getFirstY(); +// int x2 = c.getSecondX(); +// int y2 = c.getSecondY(); +// +// // 确保坐标在图片范围内 +// if (x1 >= 0 && x1 < originalImage.getWidth() && y1 >= 0 && y1 < originalImage.getHeight() && +// x2 >= 0 && x2 < originalImage.getWidth() && y2 >= 0 && y2 < originalImage.getHeight()) { +// +// // 确保x1,y1是左上角,x2,y2是右下角 +// int rectX = Math.min(x1, x2); +// int rectY = Math.min(y1, y2); +// int width = Math.abs(x2 - x1); +// int height = Math.abs(y2 - y1); +// // 绘制矩形 +// g2d.drawRect(rectX, rectY, width, height); +// +// coordinate.setFirstX(x1); +// coordinate.setFirstY(y1); +// coordinate.setSecondX(x2); +// coordinate.setSecondY(y2); +// // 添加矩形标签 +// //图片路径取值 +// String[] dividePath = Paths.get(imagePath).getFileName().toString().replaceAll("(?i)\\.jpg$", "").split("_"); +// String max = dividePath[dividePath.length - 3]; // 最大值 +// String min = dividePath[dividePath.length - 2]; // 最小值 +// String avg = dividePath[dividePath.length - 1]; // 平均值 +// infraredInfo.setFrameMax(Float.parseFloat(max)); +//// g2d.drawString("平均温度:" +avg + "最高温度:" + max + "最低温度:" + min, rectX + 5, rectY + 15); +// +// String line1 = "平均温度:" + avg; +// String line2 = "最高温度:" + max; +// String line3 = "最低温度:" + min; +// +// g2d.drawString(line1, rectX + 5, rectY + 15); +// g2d.drawString(line2, rectX + 5, rectY + 30); +// g2d.drawString(line3, rectX + 5, rectY + 45); +// } +// } +// } +// g2d.dispose(); +// // 保存标注后的图片 +// File outputFile = new File(outputPath); +// // 确保输出目录存在 +// outputFile.getParentFile().mkdirs(); +// ImageIO.write(annotatedImage, "jpg", outputFile); +// } catch (IOException e) { +// System.err.println("处理图片时出错: " + e.getMessage()); +// e.printStackTrace(); +// } +// return outputPath; +// } //图片标注__无人机 - public String ImageOverlaysUav(Coordinate coordinate, InfraredInfo infraredInfo) { + public String ImageOverlaysUav(InfraPictureInfo infraPictureInfo, InfraredInfo infraredInfo) { - Coordinate[] coordinates = coordinate.getCoordinates(); + List coordinates = infraPictureInfo.getCoordinates(); Date date = new Date(); SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); String markPicName = sf.format(date); // 图片路径(请替换为实际路径) - String imagePath = coordinate.getFilePath(); + String imagePath = infraPictureInfo.getFilePath(); // 获取文件名(不含扩展名) File file = new File(imagePath); String fileName = file.getName(); @@ -854,7 +841,7 @@ public class HikVisionServiceImpl implements HikVisionService { } try { InputStream inputStreamPath = downloadFtp(imagePath); - if (inputStreamPath==null){ + if (inputStreamPath == null) { System.out.println("无法加载图片: " + imagePath); } // 加载原始图片 @@ -894,11 +881,11 @@ public class HikVisionServiceImpl implements HikVisionService { y >= 0 && y < originalImage.getHeight()) { // 绘制点(用实心圆表示) g2d.fillOval(x - 3, y - 3, 6, 6); - coordinate.setFirstX(x); - coordinate.setFirstY(y); - InfraredInfo drawStringPoint = PointTemperatureShow(coordinate, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix()); - // 添加坐标标签 - g2d.drawString("(" + String.format("%.2f", drawStringPoint.getPointTemperature()) + ")", x + 8, y - 8); + infraPictureInfo.setFirstX(x); + infraPictureInfo.setFirstY(y); +// InfraredInfo drawStringPoint = PointTemperatureShow(c, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix()); +// // 添加坐标标签 +// g2d.drawString("(" + String.format("%.2f", drawStringPoint.getPointTemperature()) + ")", x + 8, y - 8); } } @@ -922,12 +909,12 @@ public class HikVisionServiceImpl implements HikVisionService { int height = Math.abs(y2 - y1); // 绘制矩形 g2d.drawRect(rectX, rectY, width, height); - coordinate.setFirstX(x1); - coordinate.setFirstY(y1); - coordinate.setSecondX(x2); - coordinate.setSecondY(y2); + infraPictureInfo.setFirstX(x1); + infraPictureInfo.setFirstY(y1); + infraPictureInfo.setSecondX(x2); + infraPictureInfo.setSecondY(y2); - InfraredInfo drawStringMatrix = matrixTemperatureShow(coordinate, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix()); + InfraredInfo drawStringMatrix = matrixTemperatureShow(c, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix()); infraredInfo.setFrameMax(Math.round(drawStringMatrix.getFrameMax() * 100) / 100f); // 添加矩形标签 String line1 = "平均温度:" + String.format("%.2f", drawStringMatrix.getFrameAverage()); @@ -946,7 +933,7 @@ public class HikVisionServiceImpl implements HikVisionService { ImageIO.write(annotatedImage, "jpg", os); InputStream inputStream = new ByteArrayInputStream(os.toByteArray()); - picFtp(outputPath, inputStream,ftpUrlAddress,ftpUrlPort,ftpUrlAccount,ftpUrlPwd); + picFtp(outputPath, inputStream, ftpUrlAddress, ftpUrlPort, ftpUrlAccount, ftpUrlPwd); // // 保存标注后的图片 // File outputFile = new File(outputPath); @@ -1098,7 +1085,7 @@ public class HikVisionServiceImpl implements HikVisionService { } - public void picFtp(String newPath, InputStream originalPath,String ftpUrlAddress,Integer ftpUrlPort,String ftpUrlAccount,String ftpUrlPwd) { + public void picFtp(String newPath, InputStream originalPath, String ftpUrlAddress, Integer ftpUrlPort, String ftpUrlAccount, String ftpUrlPwd) { FTPSClient ftps = null; try { ftps = new FTPSClient(true); @@ -1130,7 +1117,7 @@ public class HikVisionServiceImpl implements HikVisionService { } } - public void pic2Ftp(String newPath, InputStream originalPath,String ftpUrlAddress,Integer ftpUrlPort,String ftpUrlAccount,String ftpUrlPwd) { + public void pic2Ftp(String newPath, InputStream originalPath, String ftpUrlAddress, Integer ftpUrlPort, String ftpUrlAccount, String ftpUrlPwd) { FTPClient ftps = null; try { ftps = new FTPClient(); @@ -1186,14 +1173,12 @@ public class HikVisionServiceImpl implements HikVisionService { } - - @Override - public AjaxResult calculatePicture(Coordinate coordinate) { + public AjaxResult calculatePicture(InfraPictureInfo infraPictureInfo) { InfraredInfo infraredInfo = new InfraredInfo(); try { - String imagePath = coordinate.getFilePath(); + String imagePath = infraPictureInfo.getFilePath(); // String imagePath = "/images/ir_test.jpg"; InputStream inputStream = downloadFtp(imagePath); String protocol = hrFtpUrl.substring(0, 6); // "ftp://" @@ -1209,20 +1194,20 @@ public class HikVisionServiceImpl implements HikVisionService { String[] hostAndPort = hostPort.split(":"); String host = hostAndPort[0]; int port = Integer.parseInt(hostAndPort[1]); - picFtp("/",inputStream,host,port,username,password); + picFtp("/", inputStream, host, port, username, password); String imageName = Paths.get(imagePath).getFileName().toString(); String ftpUrlName = "[\"" + hrFtpUrl + imageName + "\"]"; - if (coordinate.getImgType() == 1) { + if (infraPictureInfo.getImgType() == 1) { byte[] imageBytes = Files.readAllBytes(Paths.get(imagePath)); - infraredInfo = readDataHw(imageBytes, coordinate); - } else if (coordinate.getImgType() == 2) { + infraredInfo = readDataHw(imageBytes, infraPictureInfo.getCoordinates().get(0)); + } else if (infraPictureInfo.getImgType() == 2) { - String s = ImageOverlaysIvs(coordinate, infraredInfo); - infraredInfo.setOutPath(s); - } else if (coordinate.getImgType() == 3) { +// String s = ImageOverlaysIvs(infraPictureInfo.getCoordinates().get(0), infraredInfo); +// infraredInfo.setOutPath(s); + } else if (infraPictureInfo.getImgType() == 3) { //sdk版本调用x86_32 //float[][] imageTem = djService.getImageTem(coordinate.getFilePath()); @@ -1230,7 +1215,7 @@ public class HikVisionServiceImpl implements HikVisionService { float[][] imageTem = UploadFtpImage(hrUavUrl, null, ftpUrlName); if (imageTem != null && imageTem.length > 0 && imageTem[0].length > 0) { infraredInfo.setTemperatureMatrix(imageTem); - String s = ImageOverlaysUav(coordinate, infraredInfo); + String s = ImageOverlaysUav(infraPictureInfo, infraredInfo); infraredInfo.setOutPath(s); } else { return AjaxResult.error("温度解析错误!"); diff --git a/src/main/java/com/inspect/simulator/utils/sftp/SftpClient.java b/src/main/java/com/inspect/simulator/utils/sftp/SftpClient.java index cba960f..81e9344 100644 --- a/src/main/java/com/inspect/simulator/utils/sftp/SftpClient.java +++ b/src/main/java/com/inspect/simulator/utils/sftp/SftpClient.java @@ -185,7 +185,7 @@ public class SftpClient { ftps.setControlEncoding("UTF-8"); ftps.setFileTransferMode(10); ftps.execPROT("P"); - ftps.storeFile("1122234567.jpg", new FileInputStream("E:/1.jpg")); + ftps.storeFile("/1/ir/1122234567.jpg", new FileInputStream("E:/1.jpg")); String fileFullPathTmp = "1122.jpg"; diff --git a/src/main/resources/mapper/metadata/BasedataEqpBookChannelMapper.xml b/src/main/resources/mapper/metadata/BasedataEqpBookChannelMapper.xml new file mode 100644 index 0000000..c395efd --- /dev/null +++ b/src/main/resources/mapper/metadata/BasedataEqpBookChannelMapper.xml @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select channel_id, + channel_code, + channel_name, + parent_channel_id, + eqp_book_id, + channel_type, + online_state, + channel_content, + provider, + address, + host, + port, + create_by, + create_time, + update_by, + update_time, + delete_flag, + patrol_device_code, + username, + password, + device_source + from basedata_eqpbook_channel + + + + + + + + insert into basedata_eqpbook_channel + + channel_code, + channel_name, + parent_channel_id, + eqp_book_id, + channel_type, + online_state, + channel_content, + provider, + address, + host, + port, + create_by, + create_time, + update_by, + update_time, + delete_flag, + patrol_device_code, + username, + password, + device_source, + + + #{channelCode}, + #{channelName}, + #{parentChannelId}, + #{eqpBookId}, + #{channelType}, + #{onlineState}, + #{channelContent}, + #{provider}, + #{address}, + #{host}, + #{port}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{deleteFlag}, + #{patrolDeviceCode}, + #{username}, + #{password}, + #{deviceSource}, + + + + + update basedata_eqpbook_channel + + channel_code = #{channelCode}, + channel_name = #{channelName}, + parent_channel_id = #{parentChannelId}, + eqp_book_id = #{eqpBookId}, + channel_type = #{channelType}, + online_state = #{onlineState}, + channel_content = #{channelContent}, + provider = #{provider}, + address = #{address}, + host = #{host}, + port = #{port}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + delete_flag = #{deleteFlag}, + patrol_device_code = #{patrolDeviceCode}, + username = #{username}, + password = #{password}, + device_source = #{deviceSource}, + + where channel_id = #{channelId} + + + + delete + from basedata_eqpbook_channel + where channel_id = #{channelId} + + + + delete from basedata_eqpbook_channel where channel_id in + + #{channelId} + + + + + \ No newline at end of file