ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuideDataDto.java
@@ -21,5 +21,5 @@ String alarmType; Date receiveTime; double[] targetPosition; GuidePTZ guidePTZ; String wellId; } ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuidePTZ.java
ÎļþÒÑɾ³ý ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuideTask.java
@@ -45,8 +45,4 @@ * å¼å¯¼ç®æ ç»çº¬åº¦ */ double[] targetPosition; /** å¼å¯¼PTZå¼ */ private GuidePTZ guidePTZ; } ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java
@@ -1073,13 +1073,6 @@ Double longitude = well.getLongitude(); Double latitude = well.getLatitude(); String targetId = ardAlarmRadar.getTargetId(); GuidePTZ guidePTZ = new GuidePTZ(); guidePTZ.setP1(well.getGuideP1()); guidePTZ.setT1(well.getGuideT1()); guidePTZ.setZ1(well.getGuideZ1()); guidePTZ.setP2(well.getGuideP2()); guidePTZ.setT2(well.getGuideT2()); guidePTZ.setZ2(well.getGuideZ2()); switch (ardAlarmRadar.getAlarmType()) { case "è¿å¨ç®æ æ£æµ": ArdAlarmRadarMove ardAlarmRadarMove = new ArdAlarmRadarMove(); @@ -1093,8 +1086,6 @@ ardAlarmRadarMove.setLatitude(latitude); ardAlarmRadarMove.setUpdateTime(radarAlarmData.getAlarmTime()); ardAlarmRadarMove.setRadarId(radarId); ardAlarmRadarMove.setGuidePTZ(guidePTZ); // ardAlarmRadarMoveHandler(ardAlarmRadarMove); break; case "çæºæ£æµ": @@ -1107,10 +1098,8 @@ ardAlarmRadarFire.setAlarmType("çæºæ£æµ"); ardAlarmRadarFire.setLongitude(longitude); ardAlarmRadarFire.setLatitude(latitude); ardAlarmRadarFire.setGuidePTZ(guidePTZ); ardAlarmRadarFire.setRadarId(radarId); ardAlarmRadarFire.setUpdateTime(radarAlarmData.getAlarmTime()); // ardAlarmRadarFireHandler(ardAlarmRadarFire); break; case "é·è¾¾æ½æ²¹æºåæº": @@ -1125,8 +1114,6 @@ ardAlarmRadarPump.setUpdateTime(radarAlarmData.getAlarmTime()); ardAlarmRadarPump.setLongitude(well.getLongitude()); ardAlarmRadarPump.setLatitude(well.getLatitude()); ardAlarmRadarPump.setGuidePTZ(guidePTZ); // ardAlarmRadarPumpHandler(ardAlarmRadarPump); break; } @@ -1141,16 +1128,10 @@ //å¤èé²åºåç§°å°±æ¯å ´è¶£ç¹ï¼æ¥å ´è¶£ç¹åæ String defenseName = ardAlarmExternal.getDefenseName(); ArdAlarmpointsWell well = ardAlarmpointsWellMapper.selectArdAlarmpointsWellByWellId(defenseName); GuidePTZ guidePTZ = new GuidePTZ(); if (StringUtils.isNotNull(well)) { ardAlarmExternal.setLongitude(well.getLongitude()); ardAlarmExternal.setLatitude(well.getLatitude()); guidePTZ.setP1(well.getGuideP1()); guidePTZ.setT1(well.getGuideT1()); guidePTZ.setZ1(well.getGuideZ1()); guidePTZ.setP2(well.getGuideP2()); guidePTZ.setT2(well.getGuideT2()); guidePTZ.setZ2(well.getGuideZ2()); } int aae = ardAlarmExternalMapper.insertArdAlarmExternal(ardAlarmExternal); if (aae > 0) { @@ -1168,7 +1149,7 @@ .setAlarmType("sys_external") .setReceiveTime(ardAlarmExternal.getCreateTime()) .setTargetPosition(coordinate) .setGuidePTZ(guidePTZ); .setWellId(well.getId()); messagesEnqueued(guideDataDto); } //endregion @@ -1298,10 +1279,7 @@ return; } guideTask.setPriority(Integer.valueOf(priority)); guideTask.setTargetPosition(guideDataDto.getTargetPosition());//ç®æ ç»çº¬åº¦ if (guideDataDto.getGuidePTZ() != null) { guideTask.setGuidePTZ(guideDataDto.getGuidePTZ());//ç®æ PTZ } guideTask.setTargetPosition(guideDataDto.getTargetPosition());//å¼å¯¼äºID //æ¶æ¯å ¥é queueHandler.addTaskToQueue(cameraId, guideTask); //æå°éå @@ -1370,7 +1348,6 @@ //è·åç¸æºå¼å¯¼å ¥é private void getCameraGuideToQueue(GuideDataDto guideDataDto) { //è·åé·è¾¾æå¨å¡ä¸ç大å çµ ArdCameras cameraWithTower = ardEquipRadarMapper.getCameraByRadar(guideDataDto.getRadarId()); if (StringUtils.isNotNull(cameraWithTower)) { @@ -1402,8 +1379,7 @@ .setAlarmId(ardAlarmRadarMove.getId()) .setAlarmType(ardAlarmRadarMove.getAlarmType()) .setReceiveTime(ardAlarmRadarMove.getCreateTime()) .setTargetPosition(coordinate) .setGuidePTZ(ardAlarmRadarMove.getGuidePTZ()); .setTargetPosition(coordinate); getCameraGuideToQueue(guideDataDto);//è·åç¸æºå ¥é } @@ -1426,8 +1402,7 @@ .setAlarmId(ardAlarmRadarFire.getId()) .setAlarmType(ardAlarmRadarFire.getAlarmType()) .setReceiveTime(ardAlarmRadarFire.getCreateTime()) .setTargetPosition(coordinate) .setGuidePTZ(ardAlarmRadarFire.getGuidePTZ()); .setTargetPosition(coordinate); getCameraGuideToQueue(guideDataDto);//è·åç¸æºå ¥é } @@ -1451,11 +1426,9 @@ .setAlarmId(ardAlarmRadarPump.getId()) .setAlarmType(ardAlarmRadarPump.getAlarmType()) .setReceiveTime(ardAlarmRadarPump.getCreateTime()) .setTargetPosition(coordinate) .setGuidePTZ(ardAlarmRadarPump.getGuidePTZ()); .setTargetPosition(coordinate); getCameraGuideToQueue(guideDataDto);//è·åç¸æºå ¥é } /** * é·è¾¾ç®æ ç§»å¨æ¥è¦å¤ç ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueHandler.java
@@ -15,7 +15,9 @@ import com.ruoyi.alarm.tube.domain.ArdAlarmTube; import com.ruoyi.alarm.tube.service.IArdAlarmTubeService; import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.device.camera.domain.ArdCameras; @@ -58,25 +60,6 @@ } log.debug("æ°ä»»å¡å ¥é:" + task.getAlarmId()); guideTaskQueue.add(task); /*è·åè¯¥ç¸æºçå½åæ§è¡çº¿ç¨-----å¼ç¨*/ //TaskThread currentTaskThread = threadMap.get(cameraId); ////妿éåå½åçº¿ç¨æ£å¨è¿è¡ï¼è¥å ¥éä»»å¡ä¼å 级大äºå½åä»»å¡ä¼å 级ï¼åç»æ¢å½åçº¿ç¨ //if (currentTaskThread != null){ // if (task.getPriority() > currentTaskThread.getCurrentTask().getPriority()) { // currentTaskThread.getThread().interrupt(); // } // if (!currentTaskThread.getThread().isAlive()) { // Thread newThread = createThread(cameraId, guideTaskQueue); // threadMap.put(cameraId, new TaskThread(newThread, task)); // newThread.start(); // } //} ////妿éåå½å没æçº¿ç¨æ£å¨è¿è¡ï¼åå¯å¨æ°çº¿ç¨ //else { // Thread newThread = createThread(cameraId, guideTaskQueue); // threadMap.put(cameraId, new TaskThread(newThread, task)); // newThread.start(); //} } @Async("guideExecutor") @@ -94,7 +77,7 @@ } log.debug("æ§è¡æ°ä»»å¡:ã" + newTask.getAlarmId() + "ã"); log.debug("å©ä½ä»»å¡æ°:ã" + guideTasks.size() + "ã"); // 弿¥å¤çä»»å¡ï¼å¹¶è·åFuture // å¤çä»»å¡ processTask(newTask); } try { @@ -104,7 +87,7 @@ } } } //弿¥å¤çä»»å¡ public void processTask(GuideTask guideTask) { try { if (!IsEnableGuide(guideTask.getCameraId())) { @@ -114,35 +97,15 @@ CameraCmd cmd = new CameraCmd(); cmd.setCameraId(guideTask.getCameraId()); cmd.setChanNo(guideTask.getChanNo()); cmd.setTargetPosition(guideTask.getTargetPosition()); cmd.setOperator(guideTask.getAlarmType()); cmd.setExpired(30); cmd.setRecordBucketName("record"); Map<String, Double> ptzMap = new HashMap<>(); switch (guideTask.getChanNo()) { case 1: ptzMap.put("p", guideTask.getGuidePTZ().getP1()); ptzMap.put("t", guideTask.getGuidePTZ().getT1()); ptzMap.put("z", guideTask.getGuidePTZ().getZ1()); break; case 2: ptzMap.put("p", guideTask.getGuidePTZ().getP2()); ptzMap.put("t", guideTask.getGuidePTZ().getT2()); ptzMap.put("z", guideTask.getGuidePTZ().getZ2()); break; } cmd.setPtzMap(ptzMap); cmd.setRecordObjectName("alarm_" + guideTask.getAlarmId()); cmd.setTargetPosition(guideTask.getTargetPosition()); cmd.setRecordObjectName("alarmGuide/"+ DateUtils.getDateYYYYMMDD()+"/"+guideTask.getAlarmType()+"/"+guideTask.getAlarmId()); ICameraSdkService cameraSdkService = SpringUtils.getBean(ICameraSdkService.class); log.debug("å¼å§å¼å¯¼"); boolean guideRes = false; boolean recordFlag = false; if (cmd.getPtzMap().get("p") != null) { //på¼åå¨ ä¼å å¼å¯¼ptz guideRes = cameraSdkService.setPtz(cmd); } else { guideRes = cameraSdkService.guideTargetPosition(cmd); } boolean guideRes = cameraSdkService.guideTargetPosition(cmd); if (guideRes) { log.debug("å¼å¯¼æå"); cameraSdkService.controlLock(cmd);//ä¸é @@ -236,4 +199,4 @@ } return enabled; } } } ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarFire.java
@@ -2,16 +2,13 @@ import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.alarm.global.domain.GuidePTZ; import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; /** * é·è¾¾é²ç«æ¥è¦å¯¹è±¡ ard_alarm_radar_fire * * * @author ard * @date 2023-09-02 */ @@ -82,9 +79,5 @@ * é·è¾¾ID */ private String radarId; /** å¼å¯¼PTZå¼ */ private GuidePTZ guidePTZ; } ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarMove.java
@@ -2,16 +2,13 @@ import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.alarm.global.domain.GuidePTZ; import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; /** * é·è¾¾ç§»å¨æ¥è¦å¯¹è±¡ ard_alarm_radar_move * * * @author ard * @date 2023-09-02 */ @@ -82,9 +79,5 @@ * é·è¾¾ID */ private String RadarId; /** å¼å¯¼PTZå¼ */ private GuidePTZ guidePTZ; } ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarPump.java
@@ -3,10 +3,7 @@ import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.alarm.global.domain.GuidePTZ; import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; @@ -106,9 +103,6 @@ * é·è¾¾ID */ private String radarId; /** * å¼å¯¼PTZå¼ */ private GuidePTZ guidePTZ; } ard-work/src/main/java/com/ruoyi/alarmpoints/well/controller/ArdWellGuideCameraController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,113 @@ package com.ruoyi.alarmpoints.well.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.alarmpoints.well.domain.ArdWellGuideCamera; import com.ruoyi.alarmpoints.well.service.IArdWellGuideCameraService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * äºå ³èå¼å¯¼ç¸æºController * * @author ard * @date 2024-01-15 */ @Api(tags = "äºå ³èå¼å¯¼ç¸æºæ¥å£") @RestController @RequestMapping("/well/guidecamera") public class ArdWellGuideCameraController extends BaseController { @Autowired private IArdWellGuideCameraService ardWellGuideCameraService; /** * æ¥è¯¢äºå ³èå¼å¯¼ç¸æºå表 */ @ApiOperation("æ¥è¯¢äºå ³èå¼å¯¼ç¸æºå表") @PreAuthorize("@ss.hasPermi('well:guidecamera:list')") @GetMapping("/list") public TableDataInfo list(ArdWellGuideCamera ardWellGuideCamera) { startPage(); List<ArdWellGuideCamera> list = ardWellGuideCameraService.selectArdWellGuideCameraList(ardWellGuideCamera); return getDataTable(list); } /** * 导åºäºå ³èå¼å¯¼ç¸æºå表 */ @PreAuthorize("@ss.hasPermi('well:guidecamera:export')") @Log(title = "äºå ³èå¼å¯¼ç¸æº", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, ArdWellGuideCamera ardWellGuideCamera) { List<ArdWellGuideCamera> list = ardWellGuideCameraService.selectArdWellGuideCameraList(ardWellGuideCamera); ExcelUtil<ArdWellGuideCamera> util = new ExcelUtil<ArdWellGuideCamera>(ArdWellGuideCamera.class); util.exportExcel(response, list, "äºå ³èå¼å¯¼ç¸æºæ°æ®"); } /** * è·åäºå ³èå¼å¯¼ç¸æºè¯¦ç»ä¿¡æ¯ */ @ApiOperation("è·åäºå ³èå¼å¯¼ç¸æºè¯¦ç»ä¿¡æ¯") @PreAuthorize("@ss.hasPermi('well:guidecamera:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { return success(ardWellGuideCameraService.selectArdWellGuideCameraById(id)); } /** * æ°å¢äºå ³èå¼å¯¼ç¸æº */ @ApiOperation("æ°å¢äºå ³èå¼å¯¼ç¸æº") @PreAuthorize("@ss.hasPermi('well:guidecamera:add')") @Log(title = "äºå ³èå¼å¯¼ç¸æº", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody ArdWellGuideCamera ardWellGuideCamera) { return toAjax(ardWellGuideCameraService.insertArdWellGuideCamera(ardWellGuideCamera)); } /** * ä¿®æ¹äºå ³èå¼å¯¼ç¸æº */ @ApiOperation("ä¿®æ¹äºå ³èå¼å¯¼ç¸æº") @PreAuthorize("@ss.hasPermi('well:guidecamera:edit')") @Log(title = "äºå ³èå¼å¯¼ç¸æº", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody ArdWellGuideCamera ardWellGuideCamera) { return toAjax(ardWellGuideCameraService.updateArdWellGuideCamera(ardWellGuideCamera)); } /** * å é¤äºå ³èå¼å¯¼ç¸æº */ @ApiOperation("å é¤äºå ³èå¼å¯¼ç¸æº") @PreAuthorize("@ss.hasPermi('well:guidecamera:remove')") @Log(title = "äºå ³èå¼å¯¼ç¸æº", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) { return toAjax(ardWellGuideCameraService.deleteArdWellGuideCameraByIds(ids)); } } ard-work/src/main/java/com/ruoyi/alarmpoints/well/domain/ArdAlarmpointsWell.java
@@ -1,6 +1,7 @@ package com.ruoyi.alarmpoints.well.domain; import java.util.Date; import java.util.List; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; @@ -14,7 +15,7 @@ /** * äºç®¡ç对象 ard_alarmpoints_well * * * @author åèä¹ * @date 2023-03-07 */ @@ -98,26 +99,11 @@ /** ç¨æ·id */ private String userId; /** å¼å¯¼P1å¼ */ private Double guideP1; /** å¼å¯¼T1å¼ */ private Double guideT1; /** å¼å¯¼Z1å¼ */ private Double guideZ1; /** å¼å¯¼P2å¼ */ private Double guideP2; /** å¼å¯¼T2å¼ */ private Double guideT2; /** å¼å¯¼Z2å¼ */ private Double guideZ2; @TableField(exist = false) private String type; /** å ³èå¼å¯¼ç¸æºå表 */ List<ArdWellGuideCamera> ardWellGuideCameraList; } ard-work/src/main/java/com/ruoyi/alarmpoints/well/domain/ArdWellGuideCamera.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,149 @@ package com.ruoyi.alarmpoints.well.domain; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; /** * äºå ³èå¼å¯¼ç¸æºå¯¹è±¡ ard_well_guide_camera * * @author ard * @date 2024-01-15 */ public class ArdWellGuideCamera extends BaseEntity { private static final long serialVersionUID = 1L; /** ä¸»é® */ private String id; /** ç¸æºID */ @Excel(name = "ç¸æºID") private String cameraId; /** å¯è§å på¼ */ @Excel(name = "å¯è§å på¼") private Double p1; /** å¯è§å tå¼ */ @Excel(name = "å¯è§å tå¼") private Double t1; /** å¯è§å zå¼ */ @Excel(name = "å¯è§å zå¼") private Double z1; /** ç红å¤på¼ */ @Excel(name = "ç红å¤på¼") private Double p2; /** ç红å¤tå¼ */ @Excel(name = "ç红å¤tå¼") private Double t2; /** ç红å¤zå¼ */ @Excel(name = "ç红å¤zå¼") private Double z2; /** äºID */ @Excel(name = "äºID") private String wellId; public void setId(String id) { this.id = id; } public String getId() { return id; } public void setCameraId(String cameraId) { this.cameraId = cameraId; } public String getCameraId() { return cameraId; } public void setP1(Double p1) { this.p1 = p1; } public Double getP1() { return p1; } public void setT1(Double t1) { this.t1 = t1; } public Double getT1() { return t1; } public void setZ1(Double z1) { this.z1 = z1; } public Double getZ1() { return z1; } public void setP2(Double p2) { this.p2 = p2; } public Double getP2() { return p2; } public void setT2(Double t2) { this.t2 = t2; } public Double getT2() { return t2; } public void setZ2(Double z2) { this.z2 = z2; } public Double getZ2() { return z2; } public void setWellId(String wellId) { this.wellId = wellId; } public String getWellId() { return wellId; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) .append("cameraId", getCameraId()) .append("p1", getP1()) .append("t1", getT1()) .append("z1", getZ1()) .append("p2", getP2()) .append("t2", getT2()) .append("z2", getZ2()) .append("wellId", getWellId()) .toString(); } } ard-work/src/main/java/com/ruoyi/alarmpoints/well/domain/GuideCamera.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,26 @@ package com.ruoyi.alarmpoints.well.domain; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; /** * @Description: äºå ³èå¼å¯¼ptzå表 * @ClassName: GuideCamera * @Author: åèä¹ * @Date: 2024å¹´01æ15æ¥15:30:54 **/ @Data @AllArgsConstructor @NoArgsConstructor public class GuideCamera { Long id; String cameraId;//ç¸æº Double p1; Double t1; Double z1; Double p2; Double t2; Double z2; String wellId;//äºid } ard-work/src/main/java/com/ruoyi/alarmpoints/well/mapper/ArdWellGuideCameraMapper.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,61 @@ package com.ruoyi.alarmpoints.well.mapper; import java.util.List; import com.ruoyi.alarmpoints.well.domain.ArdWellGuideCamera; /** * äºå ³èå¼å¯¼ç¸æºMapperæ¥å£ * * @author ard * @date 2024-01-15 */ public interface ArdWellGuideCameraMapper { /** * æ¥è¯¢äºå ³èå¼å¯¼ç¸æº * * @param id äºå ³èå¼å¯¼ç¸æºä¸»é® * @return äºå ³èå¼å¯¼ç¸æº */ public ArdWellGuideCamera selectArdWellGuideCameraById(String id); /** * æ¥è¯¢äºå ³èå¼å¯¼ç¸æºå表 * * @param ardWellGuideCamera äºå ³èå¼å¯¼ç¸æº * @return äºå ³èå¼å¯¼ç¸æºéå */ public List<ArdWellGuideCamera> selectArdWellGuideCameraList(ArdWellGuideCamera ardWellGuideCamera); /** * æ°å¢äºå ³èå¼å¯¼ç¸æº * * @param ardWellGuideCamera äºå ³èå¼å¯¼ç¸æº * @return ç»æ */ public int insertArdWellGuideCamera(ArdWellGuideCamera ardWellGuideCamera); /** * ä¿®æ¹äºå ³èå¼å¯¼ç¸æº * * @param ardWellGuideCamera äºå ³èå¼å¯¼ç¸æº * @return ç»æ */ public int updateArdWellGuideCamera(ArdWellGuideCamera ardWellGuideCamera); /** * å é¤äºå ³èå¼å¯¼ç¸æº * * @param id äºå ³èå¼å¯¼ç¸æºä¸»é® * @return ç»æ */ public int deleteArdWellGuideCameraById(String id); /** * æ¹éå é¤äºå ³èå¼å¯¼ç¸æº * * @param ids éè¦å é¤çæ°æ®ä¸»é®éå * @return ç»æ */ public int deleteArdWellGuideCameraByIds(String[] ids); } ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/IArdWellGuideCameraService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,61 @@ package com.ruoyi.alarmpoints.well.service; import java.util.List; import com.ruoyi.alarmpoints.well.domain.ArdWellGuideCamera; /** * äºå ³èå¼å¯¼ç¸æºServiceæ¥å£ * * @author ard * @date 2024-01-15 */ public interface IArdWellGuideCameraService { /** * æ¥è¯¢äºå ³èå¼å¯¼ç¸æº * * @param id äºå ³èå¼å¯¼ç¸æºä¸»é® * @return äºå ³èå¼å¯¼ç¸æº */ public ArdWellGuideCamera selectArdWellGuideCameraById(String id); /** * æ¥è¯¢äºå ³èå¼å¯¼ç¸æºå表 * * @param ardWellGuideCamera äºå ³èå¼å¯¼ç¸æº * @return äºå ³èå¼å¯¼ç¸æºéå */ public List<ArdWellGuideCamera> selectArdWellGuideCameraList(ArdWellGuideCamera ardWellGuideCamera); /** * æ°å¢äºå ³èå¼å¯¼ç¸æº * * @param ardWellGuideCamera äºå ³èå¼å¯¼ç¸æº * @return ç»æ */ public int insertArdWellGuideCamera(ArdWellGuideCamera ardWellGuideCamera); /** * ä¿®æ¹äºå ³èå¼å¯¼ç¸æº * * @param ardWellGuideCamera äºå ³èå¼å¯¼ç¸æº * @return ç»æ */ public int updateArdWellGuideCamera(ArdWellGuideCamera ardWellGuideCamera); /** * æ¹éå é¤äºå ³èå¼å¯¼ç¸æº * * @param ids éè¦å é¤çäºå ³èå¼å¯¼ç¸æºä¸»é®éå * @return ç»æ */ public int deleteArdWellGuideCameraByIds(String[] ids); /** * å é¤äºå ³èå¼å¯¼ç¸æºä¿¡æ¯ * * @param id äºå ³èå¼å¯¼ç¸æºä¸»é® * @return ç»æ */ public int deleteArdWellGuideCameraById(String id); } ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java
@@ -9,11 +9,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell; import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWellDeptVo; import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWellParam; import com.ruoyi.alarmpoints.well.domain.RTU_DATA_YJ_8; import com.ruoyi.alarmpoints.well.domain.*; import com.ruoyi.alarmpoints.well.mapper.ArdAlarmpointsWellMapper; import com.ruoyi.alarmpoints.well.mapper.ArdWellGuideCameraMapper; import com.ruoyi.alarmpoints.well.service.IArdAlarmpointsWellService; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.core.domain.entity.SysConfig; @@ -50,6 +48,9 @@ private static final Logger log = LoggerFactory.getLogger(ArdAlarmpointsWellServiceImpl.class); @Resource private ArdAlarmpointsWellMapper ardAlarmpointsWellMapper; @Resource private ArdWellGuideCameraMapper ardWellGuideCameraMapper; @Autowired protected Validator validator; @@ -137,6 +138,7 @@ ardAlarmpointsWell.setUpdateTime(DateUtils.getNowDate()); return ardAlarmpointsWellMapper.updateArdAlarmpointsWell(ardAlarmpointsWell); } @Override @Transactional public int updateArdAlarmpointsWellByWellId(ArdAlarmpointsWell ardAlarmpointsWell) { @@ -144,6 +146,7 @@ ardAlarmpointsWell.setUpdateTime(DateUtils.getNowDate()); return ardAlarmpointsWellMapper.updateArdAlarmpointsWellByWellId(ardAlarmpointsWell); } /** * æ¹éå é¤äºç®¡ç * @@ -312,11 +315,11 @@ } @Override public List<ArdAlarmpointsWell> getNearbyWellList(Double longitudeCenter,Double latitudeCenter, Long deptId, Integer range) { public List<ArdAlarmpointsWell> getNearbyWellList(Double longitudeCenter, Double latitudeCenter, Long deptId, Integer range) { List<ArdAlarmpointsWell> nearbyWellList = new ArrayList<>(); try { if (longitudeCenter != null && latitudeCenter != null) { ArdAlarmpointsWell ardAlarmpointsWell=new ArdAlarmpointsWell(); ArdAlarmpointsWell ardAlarmpointsWell = new ArdAlarmpointsWell(); ardAlarmpointsWell.setDeptId(deptId); List<ArdAlarmpointsWell> ardAlarmpointsWells = ardAlarmpointsWellMapper.selectArdAlarmpointsWellList(ardAlarmpointsWell); if (ardAlarmpointsWells.size() > 0) { @@ -341,167 +344,167 @@ @Override public Map<String, Object> getWellDataByWellId(String wellId, List<SysConfig> config) { ArdAlarmpointsWell ardAlarmpointsWell = ardAlarmpointsWellMapper.selectArdAlarmpointsWellByWellId(wellId); Map<String,Object> result = new HashMap(); if(ardAlarmpointsWell.getWellId() != null){ result.put("wellId",ardAlarmpointsWell.getWellId()); }else{ result.put("wellId",""); Map<String, Object> result = new HashMap(); if (ardAlarmpointsWell.getWellId() != null) { result.put("wellId", ardAlarmpointsWell.getWellId()); } else { result.put("wellId", ""); } if(ardAlarmpointsWell.getWellNumber() != null){ result.put("wellNumber",ardAlarmpointsWell.getWellNumber()); }else{ result.put("wellNumber",""); if (ardAlarmpointsWell.getWellNumber() != null) { result.put("wellNumber", ardAlarmpointsWell.getWellNumber()); } else { result.put("wellNumber", ""); } if(ardAlarmpointsWell.getOilProduction() != null){ result.put("oilProduction",ardAlarmpointsWell.getOilProduction()); }else{ result.put("oilProduction",""); if (ardAlarmpointsWell.getOilProduction() != null) { result.put("oilProduction", ardAlarmpointsWell.getOilProduction()); } else { result.put("oilProduction", ""); } if(ardAlarmpointsWell.getWellBlock() != null){ result.put("wellBlock",ardAlarmpointsWell.getWellBlock()); }else{ result.put("wellBlock",""); if (ardAlarmpointsWell.getWellBlock() != null) { result.put("wellBlock", ardAlarmpointsWell.getWellBlock()); } else { result.put("wellBlock", ""); } if(ardAlarmpointsWell.getProductionDate() != null){ result.put("productionDate",ardAlarmpointsWell.getProductionDate()); }else{ result.put("productionDate",""); if (ardAlarmpointsWell.getProductionDate() != null) { result.put("productionDate", ardAlarmpointsWell.getProductionDate()); } else { result.put("productionDate", ""); } if(ardAlarmpointsWell.getDisplacementMode() != null){ result.put("displacementMode",ardAlarmpointsWell.getDisplacementMode()); }else{ result.put("displacementMode",""); if (ardAlarmpointsWell.getDisplacementMode() != null) { result.put("displacementMode", ardAlarmpointsWell.getDisplacementMode()); } else { result.put("displacementMode", ""); } if(ardAlarmpointsWell.getSurroundingEnvironment() != null){ result.put("surroundingEnvironment",ardAlarmpointsWell.getSurroundingEnvironment()); }else{ result.put("surroundingEnvironment",""); if (ardAlarmpointsWell.getSurroundingEnvironment() != null) { result.put("surroundingEnvironment", ardAlarmpointsWell.getSurroundingEnvironment()); } else { result.put("surroundingEnvironment", ""); } if(ardAlarmpointsWell.getWellType() != null){ result.put("wellType",ardAlarmpointsWell.getWellType()); }else{ result.put("wellType",""); if (ardAlarmpointsWell.getWellType() != null) { result.put("wellType", ardAlarmpointsWell.getWellType()); } else { result.put("wellType", ""); } if(ardAlarmpointsWell.getInstalledLoad() != null){ result.put("installedLoad",ardAlarmpointsWell.getInstalledLoad()); }else{ result.put("installedLoad",""); if (ardAlarmpointsWell.getInstalledLoad() != null) { result.put("installedLoad", ardAlarmpointsWell.getInstalledLoad()); } else { result.put("installedLoad", ""); } if(ardAlarmpointsWell.getMeteringStation() != null){ result.put("meteringStation",ardAlarmpointsWell.getMeteringStation()); }else{ result.put("meteringStation",""); if (ardAlarmpointsWell.getMeteringStation() != null) { result.put("meteringStation", ardAlarmpointsWell.getMeteringStation()); } else { result.put("meteringStation", ""); } if(ardAlarmpointsWell.getTransferStation() != null){ result.put("transferStation",ardAlarmpointsWell.getTransferStation()); }else{ result.put("transferStation",""); if (ardAlarmpointsWell.getTransferStation() != null) { result.put("transferStation", ardAlarmpointsWell.getTransferStation()); } else { result.put("transferStation", ""); } if(ardAlarmpointsWell.getDehydrationStation() != null){ result.put("dehydrationStation",ardAlarmpointsWell.getDehydrationStation()); }else{ result.put("dehydrationStation",""); if (ardAlarmpointsWell.getDehydrationStation() != null) { result.put("dehydrationStation", ardAlarmpointsWell.getDehydrationStation()); } else { result.put("dehydrationStation", ""); } if(ardAlarmpointsWell.getRunStatus() != null){ result.put("runStatus",ardAlarmpointsWell.getRunStatus()); }else{ result.put("runStatus",""); if (ardAlarmpointsWell.getRunStatus() != null) { result.put("runStatus", ardAlarmpointsWell.getRunStatus()); } else { result.put("runStatus", ""); } if(ardAlarmpointsWell.getLongitude() != null){ result.put("longitude",ardAlarmpointsWell.getLongitude()); }else{ result.put("longitude",""); if (ardAlarmpointsWell.getLongitude() != null) { result.put("longitude", ardAlarmpointsWell.getLongitude()); } else { result.put("longitude", ""); } if(ardAlarmpointsWell.getLatitude() != null){ result.put("latitude",ardAlarmpointsWell.getLatitude()); }else{ result.put("latitude",""); if (ardAlarmpointsWell.getLatitude() != null) { result.put("latitude", ardAlarmpointsWell.getLatitude()); } else { result.put("latitude", ""); } if(ardAlarmpointsWell.getAltitude() != null){ result.put("altitude",ardAlarmpointsWell.getAltitude()); }else{ result.put("altitude",""); if (ardAlarmpointsWell.getAltitude() != null) { result.put("altitude", ardAlarmpointsWell.getAltitude()); } else { result.put("altitude", ""); } if(ardAlarmpointsWell.getUserId() != null){ result.put("userId",ardAlarmpointsWell.getUserId()); }else{ result.put("userId",""); if (ardAlarmpointsWell.getUserId() != null) { result.put("userId", ardAlarmpointsWell.getUserId()); } else { result.put("userId", ""); } if(ardAlarmpointsWell.getDeptId() != null){ result.put("deptId",ardAlarmpointsWell.getDeptId()); if (ardAlarmpointsWell.getDeptId() != null) { result.put("deptId", ardAlarmpointsWell.getDeptId()); SysDept sysDept = sysDeptMapper.selectDeptById(ardAlarmpointsWell.getDeptId());//æ¥è¯¢å ´è¶£ç¹æå¨é¨é¨ if(sysDept != null){ result.put("deptName",sysDept.getDeptName()); }else{ result.put("deptName",""); if (sysDept != null) { result.put("deptName", sysDept.getDeptName()); } else { result.put("deptName", ""); } }else{ result.put("deptId",""); result.put("deptName",""); } else { result.put("deptId", ""); result.put("deptName", ""); } if(ardAlarmpointsWell.getCreateBy() != null){ result.put("createBy",ardAlarmpointsWell.getCreateBy()); }else{ result.put("createBy",""); if (ardAlarmpointsWell.getCreateBy() != null) { result.put("createBy", ardAlarmpointsWell.getCreateBy()); } else { result.put("createBy", ""); } if(ardAlarmpointsWell.getCreateTime() != null){ result.put("createTime",ardAlarmpointsWell.getCreateTime()); }else{ result.put("createTime",""); if (ardAlarmpointsWell.getCreateTime() != null) { result.put("createTime", ardAlarmpointsWell.getCreateTime()); } else { result.put("createTime", ""); } if(ardAlarmpointsWell.getUpdateBy() != null){ result.put("updateBy",ardAlarmpointsWell.getUpdateBy()); }else{ result.put("updateBy",""); if (ardAlarmpointsWell.getUpdateBy() != null) { result.put("updateBy", ardAlarmpointsWell.getUpdateBy()); } else { result.put("updateBy", ""); } if(ardAlarmpointsWell.getUpdateTime() != null){ result.put("updateTime",ardAlarmpointsWell.getUpdateTime()); }else{ result.put("updateTime",""); if (ardAlarmpointsWell.getUpdateTime() != null) { result.put("updateTime", ardAlarmpointsWell.getUpdateTime()); } else { result.put("updateTime", ""); } if(ardAlarmpointsWell.getGuideP1() != null){ result.put("guideP1",ardAlarmpointsWell.getGuideP1()); }else{ result.put("guideP1",""); } if(ardAlarmpointsWell.getGuideP2() != null){ result.put("guideP2",ardAlarmpointsWell.getGuideP2()); }else{ result.put("guideP2",""); } if(ardAlarmpointsWell.getGuideT1() != null){ result.put("guideT1",ardAlarmpointsWell.getGuideT1()); }else{ result.put("guideT1",""); } if(ardAlarmpointsWell.getGuideT2() != null){ result.put("guideT2",ardAlarmpointsWell.getGuideT2()); }else{ result.put("guideT2",""); } if(ardAlarmpointsWell.getGuideZ1() != null){ result.put("guideZ1",ardAlarmpointsWell.getGuideZ1()); }else{ result.put("guideZ1",""); } if(ardAlarmpointsWell.getGuideZ2() != null){ result.put("guideZ2",ardAlarmpointsWell.getGuideZ2()); }else{ result.put("guideZ2",""); } if(config.size() != 0){ //if(ardAlarmpointsWell.getGuideP1() != null){ // result.put("guideP1",ardAlarmpointsWell.getGuideP1()); //}else{ // result.put("guideP1",""); //} //if(ardAlarmpointsWell.getGuideP2() != null){ // result.put("guideP2",ardAlarmpointsWell.getGuideP2()); //}else{ // result.put("guideP2",""); //} //if(ardAlarmpointsWell.getGuideT1() != null){ // result.put("guideT1",ardAlarmpointsWell.getGuideT1()); //}else{ // result.put("guideT1",""); //} //if(ardAlarmpointsWell.getGuideT2() != null){ // result.put("guideT2",ardAlarmpointsWell.getGuideT2()); //}else{ // result.put("guideT2",""); //} //if(ardAlarmpointsWell.getGuideZ1() != null){ // result.put("guideZ1",ardAlarmpointsWell.getGuideZ1()); //}else{ // result.put("guideZ1",""); //} //if(ardAlarmpointsWell.getGuideZ2() != null){ // result.put("guideZ2",ardAlarmpointsWell.getGuideZ2()); //}else{ // result.put("guideZ2",""); //} if (config.size() != 0) { String oracle = config.get(0).getConfigValue(); String[] oracleArr = oracle.split(";"); if(oracleArr.length == 3){ if (oracleArr.length == 3) { String url = oracle.split(";")[0]; String username = oracle.split(";")[1]; String password = oracle.split(";")[2]; try { int checkMark = checkTable(url,username,password,"\'RTU_DATA_YJ_8\'");//ä¸å表åå¨ if(checkMark == 1){ Map<String,Object> resultRTU = getRtuDataYjByJH(url,username,password,"RTU_DATA_YJ_8","\'" + wellId + "\'"); int checkMark = checkTable(url, username, password, "\'RTU_DATA_YJ_8\'");//ä¸å表åå¨ if (checkMark == 1) { Map<String, Object> resultRTU = getRtuDataYjByJH(url, username, password, "RTU_DATA_YJ_8", "\'" + wellId + "\'"); result.putAll(resultRTU); }else{ } else { result.put("wellRunningState", "n");//æ²¹äºè¿è¡ç¶æ result.put("totalPowerConsumption", "n");//æ»èçµé result.put("communicationMachine", "n");//设å¤é讯 @@ -533,18 +536,18 @@ } catch (Exception e) { e.printStackTrace(); } }else if(oracleArr.length == 4){ } else if (oracleArr.length == 4) { String url = oracle.split(";")[0]; String username = oracle.split(";")[1]; String password = oracle.split(";")[2]; String prod = oracle.split(";")[3]; try { //int checkMark = checkTable(url,username,password,"\'RTU_DATA_YJ_8\'");//ä¸å表åå¨ int checkMark = checkTable(url,username,password,"\'" + prod + ".RTU_DATA_YJ_8\'");//ä¸å表åå¨ if(checkMark == 1){ Map<String,Object> resultRTU = getRtuDataYjByJH(url,username,password,prod + ".RTU_DATA_YJ_8","\'" + wellId + "\'"); int checkMark = checkTable(url, username, password, "\'" + prod + ".RTU_DATA_YJ_8\'");//ä¸å表åå¨ if (checkMark == 1) { Map<String, Object> resultRTU = getRtuDataYjByJH(url, username, password, prod + ".RTU_DATA_YJ_8", "\'" + wellId + "\'"); result.putAll(resultRTU); }else{ } else { result.put("wellRunningState", "n");//æ²¹äºè¿è¡ç¶æ result.put("totalPowerConsumption", "n");//æ»èçµé result.put("communicationMachine", "n");//设å¤é讯 @@ -577,7 +580,7 @@ e.printStackTrace(); } } }else{ } else { result.put("wellRunningState", "n");//æ²¹äºè¿è¡ç¶æ result.put("totalPowerConsumption", "n");//æ»èçµé result.put("communicationMachine", "n");//设å¤é讯 @@ -609,7 +612,7 @@ return result; } public int checkTable(String url,String username,String password,String tableName) throws ClassNotFoundException, SQLException { public int checkTable(String url, String username, String password, String tableName) throws ClassNotFoundException, SQLException { Connection connection = null; Statement updateStatement = null; @@ -618,7 +621,7 @@ try { Class.forName("oracle.jdbc.OracleDriver"); connection = DriverManager.getConnection(url,username,password); connection = DriverManager.getConnection(url, username, password); //Statement 对象 åésql updateStatement = connection.createStatement(); //æ¥è¯¢ @@ -626,7 +629,7 @@ ResultSet resultSet = queryStatement.executeQuery("select count(*) from user_tables where table_name = upper(" + tableName + ")"); int result = 0; while(resultSet.next()){ while (resultSet.next()) { int column = resultSet.getInt(1); result = column; } @@ -635,19 +638,19 @@ e.printStackTrace(); return 0; } finally { if (updateStatement != null){ if (updateStatement != null) { updateStatement.close(); } if (queryStatement != null){ if (queryStatement != null) { queryStatement.close(); } if (connection != null){ if (connection != null) { connection.close(); } } } public Map<String,Object> getRtuDataYjByJH(String url,String username,String password,String tableName,String JH) throws ClassNotFoundException, SQLException{ public Map<String, Object> getRtuDataYjByJH(String url, String username, String password, String tableName, String JH) throws ClassNotFoundException, SQLException { Connection connection = null; Statement updateStatement = null; @@ -656,7 +659,7 @@ try { Class.forName("oracle.jdbc.OracleDriver"); connection = DriverManager.getConnection(url,username,password); connection = DriverManager.getConnection(url, username, password); //Statement 对象 åésql updateStatement = connection.createStatement(); //æ¥è¯¢ @@ -665,8 +668,8 @@ "select rdy.JH,max(rdy.RQ) as RQ from RTU_DATA_YJ_8 rdy group by rdy.JH" + ")t on rdy0.JH = t.JH and rdy0.RQ = t.RQ where rdy0.JH = " + JH); Map<String,Object> result = new HashMap(); while(resultSet.next()){ Map<String, Object> result = new HashMap(); while (resultSet.next()) { result.put("wellRunningState", "n"); result.put("totalPowerConsumption", "n");//æ»èçµé result.put("communicationMachine", "n");//设å¤é讯 @@ -675,108 +678,108 @@ result.put("meteringPlantWaterPressure", "n");//计éé´æºæ°´åå// result.put("torque", "n");//æç© if(resultSet.getString("MAT") != null){//åæ²¹æ¸©åº¦ if (resultSet.getString("MAT") != null) {//åæ²¹æ¸©åº¦ result.put("MAT", resultSet.getString("MAT")); }else{ } else { result.put("MAT", "n"); } if(resultSet.getString("TGP") != null){//äºå£æ²¹å if (resultSet.getString("TGP") != null) {//äºå£æ²¹å result.put("TGP", resultSet.getString("TGP")); }else{ } else { result.put("TGP", "n"); } if(resultSet.getString("CPV") != null){//äºå£å¥å if (resultSet.getString("CPV") != null) {//äºå£å¥å result.put("CPV", resultSet.getString("CPV")); }else{ } else { result.put("CPV", "n"); } if(resultSet.getString("ADL") != null){//Aç¸çµæµ if (resultSet.getString("ADL") != null) {//Aç¸çµæµ result.put("ADL", resultSet.getString("ADL")); }else{ } else { result.put("ADL", "n"); } if(resultSet.getString("ADY") != null){//Aç¸çµå if (resultSet.getString("ADY") != null) {//Aç¸çµå result.put("ADY", resultSet.getString("ADY")); }else{ } else { result.put("ADY", "n"); } if(resultSet.getString("BDL") != null){//Bç¸çµæµ if (resultSet.getString("BDL") != null) {//Bç¸çµæµ result.put("BDL", resultSet.getString("BDL")); }else{ } else { result.put("BDL", "n"); } if(resultSet.getString("BDY") != null){//Bç¸çµå if (resultSet.getString("BDY") != null) {//Bç¸çµå result.put("BDY", resultSet.getString("BDY")); }else{ } else { result.put("BDY", "n"); } if(resultSet.getString("CDL") != null){//Cç¸çµæµ if (resultSet.getString("CDL") != null) {//Cç¸çµæµ result.put("CDL", resultSet.getString("CDL")); }else{ } else { result.put("CDL", "n"); } if(resultSet.getString("CDY") != null){//Cç¸çµå if (resultSet.getString("CDY") != null) {//Cç¸çµå result.put("CDY", resultSet.getString("CDY")); }else{ } else { result.put("CDY", "n"); } if(resultSet.getString("UCV") != null){//ä¸è¡çµæµ if (resultSet.getString("UCV") != null) {//ä¸è¡çµæµ result.put("UCV", resultSet.getString("UCV")); }else{ } else { result.put("UCV", "n"); } if(resultSet.getString("DCV") != null){//ä¸è¡çµæµ if (resultSet.getString("DCV") != null) {//ä¸è¡çµæµ result.put("DCV", resultSet.getString("DCV")); }else{ } else { result.put("DCV", "n"); } if(resultSet.getString("SLV") != null){//å²ç¨ if (resultSet.getString("SLV") != null) {//å²ç¨ result.put("SLV", resultSet.getString("SLV")); }else{ } else { result.put("SLV", "n"); } if(resultSet.getString("CHC") != null){//岿¬¡ if (resultSet.getString("CHC") != null) {//岿¬¡ result.put("CHC", resultSet.getString("CHC")); }else{ } else { result.put("CHC", "n"); } if(resultSet.getString("BPV") != null){//äºå£åå if (resultSet.getString("BPV") != null) {//äºå£åå result.put("BPV", resultSet.getString("BPV")); }else{ } else { result.put("BPV", "n"); } if(resultSet.getString("ZWG") != null){//æ»æ ååç if (resultSet.getString("ZWG") != null) {//æ»æ ååç result.put("ZWG", resultSet.getString("ZWG")); }else{ } else { result.put("ZWG", "n"); } if(resultSet.getString("ZYG") != null){//æ»æååç if (resultSet.getString("ZYG") != null) {//æ»æååç result.put("ZYG", resultSet.getString("ZYG")); }else{ } else { result.put("ZYG", "n"); } if(resultSet.getString("GYS") != null){//åçå æ° if (resultSet.getString("GYS") != null) {//åçå æ° result.put("GYS", resultSet.getString("GYS")); }else{ } else { result.put("GYS", "n"); } if(resultSet.getString("UWL") != null){//æå¤§è½½è· if (resultSet.getString("UWL") != null) {//æå¤§è½½è· result.put("UWL", resultSet.getString("UWL")); }else{ } else { result.put("UWL", "n"); } if(resultSet.getString("DWL") != null){//æå°è½½è· if (resultSet.getString("DWL") != null) {//æå°è½½è· result.put("DWL", resultSet.getString("DWL")); }else{ } else { result.put("DWL", "n"); } if(resultSet.getString("ZHS") != null){//转é if (resultSet.getString("ZHS") != null) {//转é result.put("ZHS", resultSet.getString("ZHS")); }else{ } else { result.put("ZHS", "n"); } } if(result.size() == 0){ if (result.size() == 0) { result.put("wellRunningState", "n");//æ²¹äºè¿è¡ç¶æ result.put("totalPowerConsumption", "n");//æ»èçµé result.put("communicationMachine", "n");//设å¤é讯 @@ -807,13 +810,13 @@ } return result; } finally { if (updateStatement != null){ if (updateStatement != null) { updateStatement.close(); } if (queryStatement != null){ if (queryStatement != null) { queryStatement.close(); } if (connection != null){ if (connection != null) { connection.close(); } } ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdWellGuideCameraServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,92 @@ package com.ruoyi.alarmpoints.well.service.impl; import java.util.List; import com.ruoyi.common.utils.uuid.IdUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.alarmpoints.well.mapper.ArdWellGuideCameraMapper; import com.ruoyi.alarmpoints.well.domain.ArdWellGuideCamera; import com.ruoyi.alarmpoints.well.service.IArdWellGuideCameraService; /** * äºå ³èå¼å¯¼ç¸æºServiceä¸å¡å±å¤ç * * @author ard * @date 2024-01-15 */ @Service public class ArdWellGuideCameraServiceImpl implements IArdWellGuideCameraService { @Autowired private ArdWellGuideCameraMapper ardWellGuideCameraMapper; /** * æ¥è¯¢äºå ³èå¼å¯¼ç¸æº * * @param id äºå ³èå¼å¯¼ç¸æºä¸»é® * @return äºå ³èå¼å¯¼ç¸æº */ @Override public ArdWellGuideCamera selectArdWellGuideCameraById(String id) { return ardWellGuideCameraMapper.selectArdWellGuideCameraById(id); } /** * æ¥è¯¢äºå ³èå¼å¯¼ç¸æºå表 * * @param ardWellGuideCamera äºå ³èå¼å¯¼ç¸æº * @return äºå ³èå¼å¯¼ç¸æº */ @Override public List<ArdWellGuideCamera> selectArdWellGuideCameraList(ArdWellGuideCamera ardWellGuideCamera) { return ardWellGuideCameraMapper.selectArdWellGuideCameraList(ardWellGuideCamera); } /** * æ°å¢äºå ³èå¼å¯¼ç¸æº * * @param ardWellGuideCamera äºå ³èå¼å¯¼ç¸æº * @return ç»æ */ @Override public int insertArdWellGuideCamera(ArdWellGuideCamera ardWellGuideCamera) { ardWellGuideCamera.setId(IdUtils.simpleUUID()); return ardWellGuideCameraMapper.insertArdWellGuideCamera(ardWellGuideCamera); } /** * ä¿®æ¹äºå ³èå¼å¯¼ç¸æº * * @param ardWellGuideCamera äºå ³èå¼å¯¼ç¸æº * @return ç»æ */ @Override public int updateArdWellGuideCamera(ArdWellGuideCamera ardWellGuideCamera) { return ardWellGuideCameraMapper.updateArdWellGuideCamera(ardWellGuideCamera); } /** * æ¹éå é¤äºå ³èå¼å¯¼ç¸æº * * @param ids éè¦å é¤çäºå ³èå¼å¯¼ç¸æºä¸»é® * @return ç»æ */ @Override public int deleteArdWellGuideCameraByIds(String[] ids) { return ardWellGuideCameraMapper.deleteArdWellGuideCameraByIds(ids); } /** * å é¤äºå ³èå¼å¯¼ç¸æºä¿¡æ¯ * * @param id äºå ³èå¼å¯¼ç¸æºä¸»é® * @return ç»æ */ @Override public int deleteArdWellGuideCameraById(String id) { return ardWellGuideCameraMapper.deleteArdWellGuideCameraById(id); } } ard-work/src/main/java/com/ruoyi/device/camera/controller/CameraSdkController.java
@@ -44,8 +44,10 @@ private ICameraSdkService cameraSdkService; @Resource private IArdCamerasService ardCamerasService; @Autowired private IArdCameraNoGuideZoneService ardCameraNoGuideZoneService; @RequestMapping("/preview") private String preview() { @@ -206,6 +208,15 @@ return toAjax(cameraSdkService.guideTargetPosition(cmd)); } @ApiOperation("æåç®æ äº") @PostMapping("/setTargetWell") @Log(title = "æåç®æ äº", businessType = BusinessType.CONTROL) @ApiOperationSupport(includeParameters = {"cmd.wellId"}) public @ResponseBody AjaxResult setTargetWell(@RequestBody CameraCmd cmd) { cmd.setOperator(SecurityUtils.getUserId()); return cameraSdkService.guideTargetWell(cmd); } @ApiOperation("è®¾ç½®é¶æ¹ä½è§") @PostMapping("/setZeroPTZ") ard-work/src/main/java/com/ruoyi/device/camera/domain/CameraCmd.java
@@ -38,6 +38,8 @@ /*ç®æ ç»çº¬åº¦*/ double[] targetPosition; /*ç®æ äº*/ String wellId; /*å½åæä½è */ String operator; ard-work/src/main/java/com/ruoyi/device/camera/service/ICameraSdkService.java
@@ -1,5 +1,6 @@ package com.ruoyi.device.camera.service; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.device.camera.domain.ArdCameras; import com.ruoyi.device.camera.domain.CameraCmd; import org.springframework.scheduling.annotation.Async; @@ -74,6 +75,7 @@ //è·åptzèå´ Map<String, Object> getPtzScope(CameraCmd cmd); //设置ptz boolean setPtz(CameraCmd cmd); //è®¾ç½®é¶æ¹ä½è§ @@ -82,6 +84,9 @@ //å¼å¯¼ç®æ ä½ç½® boolean guideTargetPosition(CameraCmd cmd); //å¼å¯¼ç®æ äº AjaxResult guideTargetWell(CameraCmd cmd); //å½å String record(CameraCmd cmd); ard-work/src/main/java/com/ruoyi/device/camera/service/impl/CameraSdkServiceImpl.java
@@ -1,23 +1,34 @@ package com.ruoyi.device.camera.service.impl; import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell; import com.ruoyi.alarmpoints.well.domain.ArdWellGuideCamera; import com.ruoyi.alarmpoints.well.service.IArdAlarmpointsWellService; import com.ruoyi.common.annotation.SdkOperate; import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.device.camera.domain.ArdCameras; import com.ruoyi.device.camera.domain.CameraCmd; import com.ruoyi.device.camera.service.IArdCamerasService; import com.ruoyi.device.camera.service.ICameraSdkService; import com.ruoyi.device.camera.factory.CameraSDK; import com.ruoyi.device.camera.factory.CameraSDKFactory; import com.ruoyi.device.noguidezone.domain.ArdCameraNoGuideZone; import com.ruoyi.device.noguidezone.service.IArdCameraNoGuideZoneService; import com.ruoyi.utils.gis.GisUtil; import com.ruoyi.utils.gis.Point; import com.ruoyi.utils.sdk.common.GlobalVariable; import com.ruoyi.utils.tools.ArdTool; import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.*; /** @@ -35,6 +46,10 @@ private RedisCache redisCache; @Resource private CameraSDKFactory cameraSDKFactory; @Resource private IArdAlarmpointsWellService ardAlarmpointsWellService; @Resource private IArdCameraNoGuideZoneService ardCameraNoGuideZoneService; /** * å¯å¨çº¿ç¨æ¹æ³ï¼ç¨äºæ§è¡åå§åç»å½ç¸æºçé»è¾ @@ -67,7 +82,7 @@ CameraSDK cameraSDK = cameraSDKFactory.createCameraSDK(factory); //sdkStrategy.login(ardCamera);//忥ç»å½ cameraSDK.asyncLogin(ardCamera);//弿¥ç»å½ result=true; result = true; } } catch (Exception ex) { log.error("ç»å½å¼å¸¸ï¼" + ex.getMessage()); @@ -114,7 +129,6 @@ } //äºå°æ§å¶ @SdkOperate @Override public boolean pTZControl(CameraCmd cmd) { try { @@ -172,7 +186,6 @@ //设置é¢ç½®ä½ @Override @SdkOperate public boolean setPreset(CameraCmd cmd) { boolean result = false; try { @@ -191,7 +204,6 @@ //è°ç¨é¢ç½®ä½ @Override @SdkOperate public boolean gotoPreset(CameraCmd cmd) { boolean result = false; try { @@ -358,7 +370,6 @@ } //æå¾ @SdkOperate @Override public String picCutCate(CameraCmd cmd) { String url = ""; @@ -416,7 +427,6 @@ } //设置ptz @SdkOperate @Override public boolean setPtz(CameraCmd cmd) { boolean result = false; @@ -427,11 +437,10 @@ String factory = ardCamera.getFactory(); CameraSDK cameraSDK = cameraSDKFactory.createCameraSDK(factory); String gdtype = ardCamera.getGdtype(); if(gdtype.equals("1")) { if (gdtype.equals("1")) { //大å çµä½¿ç¨é«ç²¾åº¦ptz设置 result = cameraSDK.setPtz(cmd); }else { } else { result = cameraSDK.setPtz1(cmd); } @@ -443,7 +452,6 @@ } //è®¾ç½®é¶æ¹ä½è§ @SdkOperate @Override public boolean setZeroPtz(CameraCmd cmd) { boolean result = false; @@ -462,7 +470,6 @@ } //å¼å¯¼æåç®æ @SdkOperate @Override public boolean guideTargetPosition(CameraCmd cmd) { boolean result = false; @@ -476,6 +483,181 @@ } } catch (Exception ex) { log.error("å¼å¯¼æåç®æ å¼å¸¸ï¼" + ex.getMessage()); } return result; } //å¼å¯¼æåäº @Override public AjaxResult guideTargetWell(CameraCmd cmd) { //ææ¥å¤åæ¢é ç½®è·åç¸æºéé Integer chanNo = ArdTool.getChannelBydayNightTime(redisCache.getCacheObject("sys_config:dayNightTime")); cmd.setChanNo(chanNo); //è·åäº ArdAlarmpointsWell well = ardAlarmpointsWellService.selectArdAlarmpointsWellById(cmd.getWellId()); if (well == null) { return AjaxResult.error("äºä¸åå¨"); } cmd.setTargetPosition(new double[]{well.getLongitude(), well.getLatitude()}); //è·åäºé ç½®çå¼å¯¼ç¸æºå表 List<ArdWellGuideCamera> ardWellGuideCameraList = well.getArdWellGuideCameraList(); if (ardWellGuideCameraList != null && ardWellGuideCameraList.size() > 0) { //è·åç¸æºåäºçè·ç¦»è¿è¡æåºï¼ååºæè¿çä¸ä¸ªç¸æº Map<String, Double> distanceMap = new HashMap<>(); for (ArdWellGuideCamera ardWellGuideCamera : ardWellGuideCameraList) { ArdCameras cameras = ardCamerasService.selectArdCamerasById(ardWellGuideCamera.getCameraId()); if (cameras == null) { continue; } double[] targetPosition = new double[]{well.getLongitude(), well.getLatitude()}; double[] camPosition = new double[]{cameras.getLongitude(), cameras.getLatitude()}; double distance = GisUtil.getDistance(targetPosition, camPosition); distanceMap.put(ardWellGuideCamera.getCameraId(), distance);//åå ¥ç¼åmap } //ä»ç¼åéååºè·ç¦»æè¿ç¸æºID String cameraId = ArdTool.getKeyByMinValue(distanceMap); cmd.setCameraId(cameraId); //è·åæè¿ç¸æºç对象 Optional<ArdWellGuideCamera> first = ardWellGuideCameraList.stream().filter(s -> s.getCameraId().equals(cameraId)).findFirst(); if(first.isPresent()) { ArdWellGuideCamera ardWellGuideCamera = first.get(); Map<String, Double> ptzMap = null; //éè¿ééè·åé¢ç½®ä½ switch (chanNo) { case 1: if (ardWellGuideCamera.getP1() != null) { ptzMap = new HashMap<>(); ptzMap.put("p", ardWellGuideCamera.getP1()); ptzMap.put("t", ardWellGuideCamera.getT1()); ptzMap.put("z", ardWellGuideCamera.getZ1()); } break; case 2: if (ardWellGuideCamera.getP2() != null) { ptzMap = new HashMap<>(); ptzMap.put("p", ardWellGuideCamera.getP2()); ptzMap.put("t", ardWellGuideCamera.getT2()); ptzMap.put("z", ardWellGuideCamera.getZ2()); } break; } //å¼å¯¼ if (ptzMap != null) { //使ç¨ptzå¼å¯¼ cmd.setPtzMap(ptzMap); boolean res = setPtz(cmd); if (!res) { return AjaxResult.error("ptzå¼å¯¼å¤±è´¥", "cameraId:" + cameraId); } return AjaxResult.success("ptzå¼å¯¼æå", "cameraId:" + cameraId); } } } log.debug("æªæ¾å°ptzå¼å¯¼ç¸æº,æ¥æ¾æè¿ç¸æº"); //ä»éè¿ç¸æºæ¾æè¿çä¸ä¸ªç¸æº String cameraId = getCameraByNear(new double[]{well.getLongitude(), well.getLatitude()}); cmd.setCameraId(cameraId); if ("".equals(cameraId)) { return AjaxResult.error("æªæ¾å°å¼å¯¼ç¸æº"); } //夿ç¦å¼åº if (isInPolygon(cameraId, new Double[]{well.getLongitude(), well.getLatitude()})) { return AjaxResult.error("äºä½ç½®å±äºç¸æºç¦æ¢å¼å¯¼åºå"); } //æäºåæ å¼å§å¼å¯¼ if (!guideTargetPosition(cmd)) { return AjaxResult.error("äºåæ å¼å¯¼å¤±è´¥", "cameraId:" + cameraId); } return AjaxResult.success("äºåæ å¼å¯¼æå", "cameraId:" + cameraId); } /** * è·åæè¿è·ç¦»çå çµ * 1-ç¸æºå¨çº¿ * 2-å¼å¯æ¥è¦å¼å¯¼åè½ * 3-é ç½®äºæå¤§å¯è§è·ç¦» */ private String getCameraByNear(double[] targetPosition) { String minDistanceCameraId = ""; try { //è·åææå¤§å çµ List<Object> Objects = redisCache.getListKey(CacheConstants.CAMERA_LIST_KEY); //ç»è®¡ææå¤§å çµå¯è§èå´å 䏿¥è¦ç¹çè·ç¦» Map<String, Double> distanceMap = new HashMap<>(); for (Object obj : Objects) { ArdCameras camera = (ArdCameras) obj; if (!GlobalVariable.loginMap.containsKey(camera.getId())) { log.debug("该å çµæªç»å½"); continue; } if (camera.getCamMaxVisibleDistance() == null) { log.debug("该å çµæªé ç½®æå¤§å¯è§è·ç¦»"); continue; } if (camera.getCamAlarmGuideEnable().equals(0)) { log.debug("该å çµæªå¼å¯æ¥è¦å¼å¯¼"); continue; } double[] camPosition = new double[]{camera.getLongitude(), camera.getLatitude()}; double distance = GisUtil.getDistance(targetPosition, camPosition); if (distance != 0.0 && distance <= camera.getCamMaxVisibleDistance()) { distanceMap.put(camera.getId(), distance); if (StringUtils.isNull(camera.getCamAlarmGuideEnable())) { camera.setCamAlarmGuideEnable(0); } } } if (distanceMap.size() > 0) { log.debug("å°è¯æ¥æ¾æè¿å çµ"); //è·åè·ç¦»åå ¸ä¸æè¿çä¸ä¸ªç¸æºID minDistanceCameraId = ArdTool.getKeyByMinValue(distanceMap); log.debug("æ¥æ¾å°æè¿å çµ:" + minDistanceCameraId); } } catch (Exception ex) { log.error("è·åéè¿å¼å¯æ¥è¦å¼å¯¼åè½å çµå¼å¸¸:" + ex.getMessage()); } return minDistanceCameraId; } //å¤æç¸æºåå¼å¯¼ä½ç½®æ¯å¦å¨ç¦æ¢å¼å¯¼åºå public boolean isInPolygon(String cameraId, Double[] targetPosition) { boolean result = false; //æ¦æªæå¨å¼å¯¼ ArdCameraNoGuideZone ardCameraNoGuideZone = new ArdCameraNoGuideZone(); ardCameraNoGuideZone.setCameraId(cameraId); ardCameraNoGuideZone.setEnabled("1"); //è·åå½åç¸æºçç¦å¼å¯è§åå表 List<ArdCameraNoGuideZone> ardCameraNoGuideZones = ardCameraNoGuideZoneService.selectArdCameraNoGuideZoneList(ardCameraNoGuideZone); if (ardCameraNoGuideZones.size() > 0) { //è·åå°å½åç¸æºçåæ éå for (ArdCameraNoGuideZone zone : ardCameraNoGuideZones) { String[] parts = zone.getPoi().split(","); List<Point> pointList = new ArrayList<>(); for (int i = 0; i < parts.length; i += 3) { Point point = new Point(); point.setLongitude(Double.valueOf(parts[i])); point.setLatitude(Double.valueOf(parts[i + 1])); pointList.add(point); } double lon = targetPosition[0]; double lat = targetPosition[1]; Point targetPoint = new Point(lon, lat); //夿å¼å¯¼ç®æ æ¯å¦å¨åæ éåç»æçå¤è¾¹å½¢å boolean inPolygon = GisUtil.isInPolygon(targetPoint, pointList); if (inPolygon) { result = inPolygon; } } } return result; } @@ -523,7 +705,6 @@ } return true; } //å½å @SdkOperate @@ -615,6 +796,5 @@ } return map; } } ard-work/src/main/java/com/ruoyi/inspect/service/impl/ArdVideoInspectTaskServiceImpl.java
@@ -457,26 +457,8 @@ cmd.setTargetPosition(targetPositon); cmd.setOperator("sys_patrol_inspect"); cmd.setExpired(step.getRecordingTime() * 60); Map<String, Double> ptzMap = new HashMap<>(); switch (channel) { case 1: ptzMap.put("p", well.getGuideP1()); ptzMap.put("t", well.getGuideT1()); ptzMap.put("z", well.getGuideZ1()); break; case 2: ptzMap.put("p", well.getGuideP2()); ptzMap.put("t", well.getGuideT2()); ptzMap.put("z", well.getGuideZ2()); break; } cmd.setPtzMap(ptzMap); boolean setTargetPosition; if (cmd.getPtzMap().get("p") != null) { setTargetPosition = cameraSdkService.setPtz(cmd); } else { setTargetPosition = cameraSdkService.guideTargetPosition(cmd); } boolean setTargetPosition = cameraSdkService.guideTargetPosition(cmd); if (setTargetPosition) { /*æ§å¶ç¸æºå·¡æ£æåï¼å¼å§å½å*/ cameraSdkService.recordStart(cmd); @@ -533,26 +515,7 @@ cmd.setTargetPosition(targetPositon); cmd.setOperator("sys_patrol_inspect"); cmd.setExpired(step.getRecordingTime() * 60); Map<String, Double> ptzMap = new HashMap<>(); switch (channel) { case 1: ptzMap.put("p", well.getGuideP1()); ptzMap.put("t", well.getGuideT1()); ptzMap.put("z", well.getGuideZ1()); break; case 2: ptzMap.put("p", well.getGuideP2()); ptzMap.put("t", well.getGuideT2()); ptzMap.put("z", well.getGuideZ2()); break; } cmd.setPtzMap(ptzMap); boolean setTargetPosition; if (cmd.getPtzMap().get("p") != null) { setTargetPosition = cameraSdkService.setPtz(cmd); } else { setTargetPosition = cameraSdkService.guideTargetPosition(cmd); } boolean setTargetPosition = cameraSdkService.guideTargetPosition(cmd); if (!setTargetPosition) { /*æ§å¶å¤±è´¥,å½åæ¥éª¤å¯å¨æ¶é´ç½®null*/ ardVideoInspectTask.setCurrentStepStartTime(""); @@ -590,7 +553,7 @@ cmd.setChanNo(channel); cmd.setOperator("sys_patrol_inspect"); cmd.setRecordBucketName("record"); cmd.setRecordObjectName("inspect_" + IdUtils.fastSimpleUUID()); cmd.setRecordObjectName("inspectGuide/" + DateUtils.getDateYYYYMMDD()+"/"+ IdUtils.fastSimpleUUID()); String url = cameraSdkService.recordStopToMinio(cmd); /*æå ¥å·¡æ£è®°å½*/ ArdVideoInspectRecord ardVideoInspectRecord = new ArdVideoInspectRecord(); ard-work/src/main/java/com/ruoyi/utils/sdk/dhsdk/service/impl/DahuaSDK.java
@@ -3,6 +3,7 @@ import com.ruoyi.alarm.global.domain.GuidePriorityQueue; import com.ruoyi.alarm.global.domain.GuideTask; import com.ruoyi.alarm.global.service.impl.QueueHandler; import com.ruoyi.common.annotation.SdkOperate; import com.ruoyi.common.utils.file.FileUtils; import com.ruoyi.common.utils.file.MimeTypeUtils; import com.ruoyi.common.utils.spring.SpringUtils; @@ -315,6 +316,7 @@ * 2023/10/17 8:28:13 */ @Override @SdkOperate public boolean pTZControl(CameraCmd cmd) { String cameraId = cmd.getCameraId(); boolean enable = cmd.isEnable(); @@ -440,6 +442,7 @@ * @ä¿®æ¹äººåå ¶å®ä¿¡æ¯ 注æä¿¯ä»°è§åº¦è´å¼éè¦å ä¸360å¾å°çæ£å¼è¿è¡è®¾ç½® */ @Override @SdkOperate public boolean setPtz(CameraCmd cmd) { String cameraId = cmd.getCameraId(); Integer chanNo = cmd.getChanNo(); @@ -474,6 +477,7 @@ * @ä¿®æ¹äººåå ¶å®ä¿¡æ¯ 注æä¿¯ä»°è§åº¦è´å¼éè¦å ä¸360å¾å°çæ£å¼è¿è¡è®¾ç½® */ @Override @SdkOperate public boolean setZeroPtz(CameraCmd cmd) { String cameraId = cmd.getCameraId(); Integer chanNo = cmd.getChanNo(); ard-work/src/main/java/com/ruoyi/utils/sdk/hiksdk/service/impl/HikvisionSDK.java
@@ -3,6 +3,7 @@ import com.ruoyi.alarm.global.domain.GuidePriorityQueue; import com.ruoyi.alarm.global.domain.GuideTask; import com.ruoyi.alarm.global.service.impl.QueueHandler; import com.ruoyi.common.annotation.SdkOperate; import com.ruoyi.common.utils.file.FileUtils; import com.ruoyi.common.utils.file.MimeTypeUtils; import com.ruoyi.common.utils.spring.SpringUtils; @@ -374,6 +375,7 @@ * @ä¿®æ¹äººåå ¶å®ä¿¡æ¯ */ @Override @SdkOperate public boolean pTZControl(CameraCmd cmd) { String cameraId = cmd.getCameraId(); boolean enable = cmd.isEnable(); @@ -989,6 +991,7 @@ * @ä¿®æ¹äººåå ¶å®ä¿¡æ¯ 注æä¿¯ä»°è§åº¦è´å¼éè¦å ä¸360å¾å°çæ£å¼è¿è¡è®¾ç½® */ @Override @SdkOperate public boolean setPtz1(CameraCmd cmd) { String cameraId = cmd.getCameraId(); Integer channelNum = cmd.getChanNo(); @@ -1029,6 +1032,7 @@ * @ä¿®æ¹äººåå ¶å®ä¿¡æ¯ 注æä¿¯ä»°è§åº¦è´å¼åä¸è´å¼ */ @Override @SdkOperate public boolean setPtz(CameraCmd cmd) { try { String cameraId = cmd.getCameraId(); @@ -1079,9 +1083,10 @@ } @Override @SdkOperate public boolean guideTargetPosition(CameraCmd cmd) { String cameraId = cmd.getCameraId(); Integer channelNum = cmd.getChanNo(); Integer chanNo = cmd.getChanNo(); if (!GlobalVariable.loginMap.containsKey(cameraId)) { return false; } @@ -1101,7 +1106,7 @@ m_ptzPosCurrent.wZoomPos = (short) (Integer.parseInt(z, 16)); Pointer point = m_ptzPosCurrent.getPointer(); m_ptzPosCurrent.write(); boolean bool = hCNetSDK.NET_DVR_SetDVRConfig(userId, NET_DVR_SET_PTZPOS, channelNum, point, m_ptzPosCurrent.size()); boolean bool = hCNetSDK.NET_DVR_SetDVRConfig(userId, NET_DVR_SET_PTZPOS, chanNo, point, m_ptzPosCurrent.size()); if (!bool) { int code = hCNetSDK.NET_DVR_GetLastError(); log.error("设置ptz失败,请ç¨åéè¯" + code); @@ -1153,6 +1158,7 @@ * @ä¿®æ¹äººåå ¶å®ä¿¡æ¯ 注æä¿¯ä»°è§åº¦è´å¼éè¦å ä¸360å¾å°çæ£å¼è¿è¡è®¾ç½® */ @Override @SdkOperate public boolean setZeroPtz(CameraCmd cmd) { String cameraId = cmd.getCameraId(); Integer channelNum = cmd.getChanNo(); ard-work/src/main/java/com/ruoyi/utils/tools/ArdTool.java
@@ -46,7 +46,7 @@ * @return */ public static String getKeyByMinValue(Map<String, Double> map) { if (map == null) return null; if (map == null||map.size()==0) return null; List<Map.Entry<String, Double>> list = new ArrayList(map.entrySet()); Collections.sort(list, (o1, o2) -> (o1.getValue().intValue() - o2.getValue().intValue())); String min = list.get(0).getKey(); ard-work/src/main/resources/mapper/alarmpoints/ArdAlarmpointsWellMapper.xml
@@ -28,13 +28,12 @@ <result property="createTime" column="create_time"/> <result property="updateBy" column="update_by"/> <result property="updateTime" column="update_time"/> <result property="guideP1" column="guide_p1"/> <result property="guideT1" column="guide_t1"/> <result property="guideZ1" column="guide_z1"/> <result property="guideP2" column="guide_p2"/> <result property="guideT2" column="guide_t2"/> <result property="guideZ2" column="guide_z2"/> <!-- åæ¥è¯¢ï¼å ³è ard_well_guide_camera 表 --> <collection property="ardWellGuideCameraList" ofType="java.util.List" select="getArdWellGuideCameraListByWellId" column="id"/> </resultMap> <select id="getArdWellGuideCameraListByWellId" resultType="ArdWellGuideCamera"> SELECT * FROM ard_well_guide_camera WHERE well_id = #{id} </select> <resultMap type="ArdAlarmpointsWell" id="wellResult"> <result property="id" column="id"/> @@ -65,13 +64,7 @@ c.create_by, c.create_time, c.update_by, c.update_time, c.guide_p1, c.guide_t1, c.guide_z1, c.guide_p2, c.guide_t2, c.guide_z2 c.update_time from ard_alarmpoints_well c left join sys_dept d on d.dept_id = c.dept_id left join sys_user u on u.user_id = c.user_id @@ -104,7 +97,7 @@ <select id="selectArdAlarmpointsWellById" parameterType="String" resultMap="ArdAlarmpointsWellResult"> <include refid="selectArdAlarmpointsWellVo"/> where id = #{id} where c.id = #{id} </select> <select id="selectArdAlarmpointsWellByWellId" parameterType="String" resultMap="ArdAlarmpointsWellResult"> <include refid="selectArdAlarmpointsWellVo"/> @@ -257,24 +250,35 @@ </foreach> </delete> <select id="checkWellIdExists" resultType="ArdAlarmpointsWell"> SELECT * FROM ard_alarmpoints_well WHERE well_id = #{wellId} limit 1 SELECT * FROM ard_alarmpoints_well WHERE well_id = #{wellId} limit 1 </select> <select id="wellByPlanId" parameterType="String" resultMap="wellResult"> select ard_app_patrolpoint.alarmpoints_id as id,ard_alarmpoints_well.well_id, ard_app_patrolpoint."type",ard_alarmpoints_well.longitude,ard_alarmpoints_well.latitude from ard_alarmpoints_well LEFT JOIN ard_app_patrolpoint on ard_app_patrolpoint.alarmpoints_id = ard_alarmpoints_well.id where ard_alarmpoints_well.id in (select alarmpoints_id from ard_app_patrolpoint where patrolplan_id = #{id}) GROUP BY ard_app_patrolpoint.alarmpoints_id,ard_alarmpoints_well.well_id,ard_app_patrolpoint."type",ard_alarmpoints_well.longitude,ard_alarmpoints_well.latitude select ard_app_patrolpoint.alarmpoints_id as id, ard_alarmpoints_well.well_id, ard_app_patrolpoint."type", ard_alarmpoints_well.longitude, ard_alarmpoints_well.latitude from ard_alarmpoints_well LEFT JOIN ard_app_patrolpoint on ard_app_patrolpoint.alarmpoints_id = ard_alarmpoints_well.id where ard_alarmpoints_well.id in (select alarmpoints_id from ard_app_patrolpoint where patrolplan_id = #{id}) GROUP BY ard_app_patrolpoint.alarmpoints_id, ard_alarmpoints_well.well_id, ard_app_patrolpoint."type", ard_alarmpoints_well.longitude, ard_alarmpoints_well.latitude </select> <select id="wellListDept" parameterType="List" resultType="com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWellDeptVo"> <select id="wellListDept" parameterType="List" resultType="com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWellDeptVo"> Select well.id,well.well_id,well.well_number,well.oil_production,well.well_block,well.production_date, well.displacement_mode,well.surrounding_environment,well.well_type,well.installed_load,well.metering_station, well.transfer_station,well.dehydration_station,well.run_status,well.longitude,well.latitude,well.altitude,well.dept_id, dept.parent_id,dept.ancestors,dept.dept_name from ard_alarmpoints_well well left join sys_dept dept on well.dept_id = dept.dept_id where well.dept_id in where well.dept_id in <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> #{item} </foreach> </select> </mapper> </mapper> ard-work/src/main/resources/mapper/alarmpoints/ArdWellGuideCameraMapper.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,93 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ruoyi.alarmpoints.well.mapper.ArdWellGuideCameraMapper"> <resultMap type="ArdWellGuideCamera" id="ArdWellGuideCameraResult"> <result property="id" column="id" /> <result property="cameraId" column="camera_id" /> <result property="p1" column="p1" /> <result property="t1" column="t1" /> <result property="z1" column="z1" /> <result property="p2" column="p2" /> <result property="t2" column="t2" /> <result property="z2" column="z2" /> <result property="wellId" column="well_id" /> </resultMap> <sql id="selectArdWellGuideCameraVo"> select id, camera_id, p1, t1, z1, p2, t2, z2, well_id from ard_well_guide_camera </sql> <select id="selectArdWellGuideCameraList" parameterType="ArdWellGuideCamera" resultMap="ArdWellGuideCameraResult"> <include refid="selectArdWellGuideCameraVo"/> <where> <if test="cameraId != null and cameraId != ''"> and camera_id = #{cameraId}</if> <if test="p1 != null "> and p1 = #{p1}</if> <if test="t1 != null "> and t1 = #{t1}</if> <if test="z1 != null "> and z1 = #{z1}</if> <if test="p2 != null "> and p2 = #{p2}</if> <if test="t2 != null "> and t2 = #{t2}</if> <if test="z2 != null "> and z2 = #{z2}</if> <if test="wellId != null and wellId != ''"> and well_id = #{wellId}</if> </where> </select> <select id="selectArdWellGuideCameraById" parameterType="String" resultMap="ArdWellGuideCameraResult"> <include refid="selectArdWellGuideCameraVo"/> where id = #{id} </select> <insert id="insertArdWellGuideCamera" parameterType="ArdWellGuideCamera"> insert into ard_well_guide_camera <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">id,</if> <if test="cameraId != null">camera_id,</if> <if test="p1 != null">p1,</if> <if test="t1 != null">t1,</if> <if test="z1 != null">z1,</if> <if test="p2 != null">p2,</if> <if test="t2 != null">t2,</if> <if test="z2 != null">z2,</if> <if test="wellId != null">well_id,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if> <if test="cameraId != null">#{cameraId},</if> <if test="p1 != null">#{p1},</if> <if test="t1 != null">#{t1},</if> <if test="z1 != null">#{z1},</if> <if test="p2 != null">#{p2},</if> <if test="t2 != null">#{t2},</if> <if test="z2 != null">#{z2},</if> <if test="wellId != null">#{wellId},</if> </trim> </insert> <update id="updateArdWellGuideCamera" parameterType="ArdWellGuideCamera"> update ard_well_guide_camera <trim prefix="SET" suffixOverrides=","> <if test="cameraId != null">camera_id = #{cameraId},</if> <if test="p1 != null">p1 = #{p1},</if> <if test="t1 != null">t1 = #{t1},</if> <if test="z1 != null">z1 = #{z1},</if> <if test="p2 != null">p2 = #{p2},</if> <if test="t2 != null">t2 = #{t2},</if> <if test="z2 != null">z2 = #{z2},</if> <if test="wellId != null">well_id = #{wellId},</if> </trim> where id = #{id} </update> <delete id="deleteArdWellGuideCameraById" parameterType="String"> delete from ard_well_guide_camera where id = #{id} </delete> <delete id="deleteArdWellGuideCameraByIds" parameterType="String"> delete from ard_well_guide_camera where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </delete> </mapper> bin/run.bat
@@ -8,7 +8,7 @@ set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m java -Dloader.path="jarLib/" -jar %JAVA_OPTS% ruoyi-admin.jar java -jar %JAVA_OPTS% ruoyi-admin.jar cd bin pause ruoyi-admin/src/main/resources/i18n/messages.properties
@@ -201,8 +201,7 @@ dic.data.cameras.priority.sys.radar.move=sys_radar_move dic.data.cameras.priority.sys.radar.fire=sys_radar_fire dic.data.cameras.priority.sys.radar.force=sys_radar_force dic.data.cameras.priority.sys.manual.inspection=sys_manual_inspection dic.data.cameras.priority.sys.auto.inspection=sys_auto_inspection dic.data.cameras.priority.sys.patrol.inspection=sys_patrol_inspect dic.data.inspect.mode.auto=\u81EA\u52A8 dic.data.inspect.mode.manual=\u624B\u52A8 @@ -267,4 +266,4 @@ config.dayNightTime=\u5149\u7535\u65E5\u591C\u5207\u6362\u65F6\u95F4 config.rongyun=\u878D\u4E91IP config.RongCloudAppKey=\u878D\u4E91APP\u952E config.syCarPT=\u4E09\u4E00\u5E73\u53F0ip config.syCarPT=\u4E09\u4E00\u5E73\u53F0ip ruoyi-admin/src/main/resources/i18n/messages_en_US.properties
@@ -15,7 +15,7 @@ user.username.not.valid=*Composed of 2 to 20 Chinese characters, letters, numbers, or underscores, and must start with a non numeric character user.password.not.valid=*5-50 characters user.email.not.valid=Email format error user.mobile.phone.number.not.valid=Mobile number format error user.login.success=Login successful @@ -210,8 +210,7 @@ dic.data.cameras.priority.sys.radar.move=sys_radar_move dic.data.cameras.priority.sys.radar.fire=sys_radar_fire dic.data.cameras.priority.sys.radar.force=sys_radar_force dic.data.cameras.priority.sys.manual.inspection=sys_manual_inspection dic.data.cameras.priority.sys.auto.inspection=sys_auto_inspection dic.data.cameras.priority.sys.patrol.inspection=sys_patrol_inspect dic.data.inspect.mode.auto=auto dic.data.inspect.mode.manual=manual ruoyi-admin/src/main/resources/i18n/messages_zh_CN.properties
@@ -15,7 +15,7 @@ user.username.not.valid=* 2\u523020\u4E2A\u6C49\u5B57\u3001\u5B57\u6BCD\u3001\u6570\u5B57\u6216\u4E0B\u5212\u7EBF\u7EC4\u6210\uFF0C\u4E14\u5FC5\u987B\u4EE5\u975E\u6570\u5B57\u5F00\u5934 user.password.not.valid=* 5-50\u4E2A\u5B57\u7B26 user.email.not.valid=\u90AE\u7BB1\u683C\u5F0F\u9519\u8BEF user.mobile.phone.number.not.valid=\u624B\u673A\u53F7\u683C\u5F0F\u9519\u8BEF user.login.success=\u767B\u5F55\u6210\u529F @@ -209,8 +209,7 @@ dic.data.cameras.priority.sys.radar.move=sys_radar_move dic.data.cameras.priority.sys.radar.fire=sys_radar_fire dic.data.cameras.priority.sys.radar.force=sys_radar_force dic.data.cameras.priority.sys.manual.inspection=sys_manual_inspection dic.data.cameras.priority.sys.auto.inspection=sys_auto_inspection dic.data.cameras.priority.sys.patrol.inspection=sys_patrol_inspect dic.data.inspect.mode.auto=\u81EA\u52A8 dic.data.inspect.mode.manual=\u624B\u52A8 @@ -275,4 +274,4 @@ config.dayNightTime=\u5149\u7535\u65E5\u591C\u5207\u6362\u65F6\u95F4 config.rongyun=\u878D\u4E91IP config.RongCloudAppKey=\u878D\u4E91APP\u952E config.syCarPT=\u4E09\u4E00\u5E73\u53F0ip config.syCarPT=\u4E09\u4E00\u5E73\u53F0ip ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java
@@ -27,7 +27,7 @@ public static String YYYY_MM_DD = "yyyy-MM-dd"; public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; public static String YYYYMMDD = "yyyyMMdd"; public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; public static String YYYY_MM_DD_HH_MM_SS_MS = "yyyy-MM-dd HH:mm:ss.SSS"; public static String HH_MM_SS = "HH:mm:ss"; @@ -61,6 +61,10 @@ public static final String dateTimeNow() { return dateTimeNow(YYYYMMDDHHMMSS); } public static final String getDateYYYYMMDD() { return dateTimeNow(YYYYMMDD); } public static final String dateTimeNowMS() { return dateTimeNow(YYYY_MM_DD_HH_MM_SS_MS);