‘liusuyi’
2024-01-16 8926d27639d8cb9826941b482926f774bd10dc92
增加引导井关联相机ptz
已添加7个文件
已修改23个文件
已删除1个文件
1530 ■■■■ 文件已修改
ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuideDataDto.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuidePTZ.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuideTask.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueHandler.java 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarFire.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarMove.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarPump.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarmpoints/well/controller/ArdWellGuideCameraController.java 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarmpoints/well/domain/ArdAlarmpointsWell.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarmpoints/well/domain/ArdWellGuideCamera.java 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarmpoints/well/domain/GuideCamera.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarmpoints/well/mapper/ArdWellGuideCameraMapper.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/IArdWellGuideCameraService.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java 395 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdWellGuideCameraServiceImpl.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/device/camera/controller/CameraSdkController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/device/camera/domain/CameraCmd.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/device/camera/service/ICameraSdkService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/device/camera/service/impl/CameraSdkServiceImpl.java 214 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/inspect/service/impl/ArdVideoInspectTaskServiceImpl.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/utils/sdk/dhsdk/service/impl/DahuaSDK.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/utils/sdk/hiksdk/service/impl/HikvisionSDK.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/java/com/ruoyi/utils/tools/ArdTool.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/resources/mapper/alarmpoints/ArdAlarmpointsWellMapper.xml 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ard-work/src/main/resources/mapper/alarmpoints/ArdWellGuideCameraMapper.xml 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
bin/run.bat 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/i18n/messages.properties 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/i18n/messages_en_US.properties 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/i18n/messages_zh_CN.properties 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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);