From 2a88e5f26338343f0d1f20e4da80c7da44ed9e3a Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期二, 08 八月 2023 16:24:53 +0800
Subject: [PATCH] 增加mybatisplus代码生成工具 修复日志打印缺少操作内容的问题 修复app任务空指针问题 优化海康sdk日志打印
---
ard-work/pom.xml | 30 +++++-
ard-work/src/main/java/com/ruoyi/app/task/service/impl/ArdAppTaskServiceImpl.java | 5
ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java | 3
ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java | 78 +++++++-------
ard-work/src/main/java/com/ruoyi/utils/generator/CodeGeneration.java | 118 +++++++++++++++++++++++
ard-work/src/main/java/com/ruoyi/inspect/service/impl/ArdVideoInspectTaskServiceImpl.java | 18 ++-
6 files changed, 200 insertions(+), 52 deletions(-)
diff --git a/ard-work/pom.xml b/ard-work/pom.xml
index 0eeefb3..18bb4f8 100644
--- a/ard-work/pom.xml
+++ b/ard-work/pom.xml
@@ -31,10 +31,6 @@
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
- <!-- <dependency>-->
- <!-- <groupId>org.projectlombok</groupId>-->
- <!-- <artifactId>lombok</artifactId>-->
- <!-- </dependency>-->
<!--娴峰悍褰曞儚鏈轰簩娆″紑鍙戜緷璧杍ar鍖�-->
<dependency>
@@ -165,7 +161,7 @@
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
- <version>3.2.0</version>
+ <version>3.5.1</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
@@ -173,6 +169,30 @@
<version>3.0.3</version>
<scope>compile</scope>
</dependency>
+ <!--MP浠g爜鐢熸垚鍣ㄤ緷璧�-->
+ <dependency>
+ <groupId>com.baomidou</groupId>
+ <artifactId>mybatis-plus-generator</artifactId>
+ <version>3.5.3.1</version>
+ </dependency>
+ <!--velocity妯℃澘寮曟搸-->
+ <dependency>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>velocity-engine-core</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <!--postgresql鏁版嵁搴撲緷璧�-->
+ <dependency>
+ <groupId>org.postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+<!-- <!–mybatis-plus渚濊禆–>-->
+<!-- <dependency>-->
+<!-- <groupId>com.baomidou</groupId>-->
+<!-- <artifactId>mybatis-plus-boot-starter</artifactId>-->
+<!-- <version>3.5.1</version>-->
+<!-- </dependency>-->
</dependencies>
diff --git a/ard-work/src/main/java/com/ruoyi/app/task/service/impl/ArdAppTaskServiceImpl.java b/ard-work/src/main/java/com/ruoyi/app/task/service/impl/ArdAppTaskServiceImpl.java
index 0832eee..d6ab9f7 100644
--- a/ard-work/src/main/java/com/ruoyi/app/task/service/impl/ArdAppTaskServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/app/task/service/impl/ArdAppTaskServiceImpl.java
@@ -55,7 +55,10 @@
@Override
public ArdAppTask selectArdAppTaskById(String id) {
ArdAppTask ardAppTask = ardAppTaskMapper.selectArdAppTaskById(id);
-
+ if(StringUtils.isNull(ardAppTask))
+ {
+ return null;
+ }
List<ArdAppTaskDetail> ardAppTaskDetailList = ardAppTask.getArdAppTaskDetailList();
if(ardAppTaskDetailList.size()>0)
{
diff --git a/ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java b/ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java
index cfc76bf..60c0b26 100644
--- a/ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java
@@ -179,7 +179,7 @@
int i = hCNetSDK.NET_DVR_Login_V40(m_strLoginInfo, m_strDeviceInfo);
if (i < 0) {
int errorCode = hCNetSDK.NET_DVR_GetLastError();
- log.info("鐧诲綍寮傚父锛�" + errorCode);
+ log.error("鐧诲綍寮傚父锛�" + errorCode);
}
}
@@ -328,7 +328,7 @@
boolean bool = hCNetSDK.NET_DVR_PTZControlWithSpeed_Other(userId, channelNum, dwPTZCommand, dwStop, speed);
if (!bool) {
int errorCode = hCNetSDK.NET_DVR_GetLastError();
- log.info("鎺у埗澶辫触,璇风◢鍚庨噸璇�" + errorCode);
+ log.error("鎺у埗澶辫触,璇风◢鍚庨噸璇�" + errorCode);
}
return bool;
}
@@ -356,7 +356,7 @@
boolean bool = hCNetSDK.NET_DVR_GetDVRConfig(userId, NET_DVR_GET_FOCUSMODECFG, channelNum, point, focusmodeCfg.size(), ibrBytesReturned);
if (!bool) {
int code = hCNetSDK.NET_DVR_GetLastError();
- log.info("璁剧疆鑱氱劍鍊煎け璐�,璇风◢鍚庨噸璇�" + code);
+ log.error("璁剧疆鑱氱劍鍊煎け璐�,璇风◢鍚庨噸璇�" + code);
}
return bool;
}
@@ -389,7 +389,7 @@
return map;
} else {
int code = hCNetSDK.NET_DVR_GetLastError();
- log.info("鑾峰彇鑱氱劍鍊煎け璐�,璇风◢鍚庨噸璇�" + code);
+ log.debug("鑾峰彇鑱氱劍鍊煎け璐�,璇风◢鍚庨噸璇�" + code);
return new HashMap<>();
}
}
@@ -412,7 +412,7 @@
boolean bool = hCNetSDK.NET_DVR_PTZPreset_Other(userId, channelNum, SET_PRESET, PresetIndex);
if (!bool) {
int code = hCNetSDK.NET_DVR_GetLastError();
- log.info("棰勭疆鐐硅缃け璐�,璇风◢鍚庨噸璇�" + code);
+ log.error("棰勭疆鐐硅缃け璐�,璇风◢鍚庨噸璇�" + code);
}
return bool;
}
@@ -435,7 +435,7 @@
boolean bool = hCNetSDK.NET_DVR_PTZPreset_Other(userId, channelNum, GOTO_PRESET, PresetIndex);
if (!bool) {
int code = hCNetSDK.NET_DVR_GetLastError();
- log.info("棰勭疆鐐硅缃け璐�,璇风◢鍚庨噸璇�" + code);
+ log.error("棰勭疆鐐硅缃け璐�,璇风◢鍚庨噸璇�" + code);
}
return bool;
}
@@ -537,7 +537,7 @@
}
} else {
int code = hCNetSDK.NET_DVR_GetLastError();
- System.out.println("鎺у埗澶辫触,璇风◢鍚庨噸璇�" + code);
+ log.error("鎺у埗澶辫触,璇风◢鍚庨噸璇�" + code);
}
} catch (Exception ex) {
log.error(ex.getMessage());
@@ -589,7 +589,7 @@
return ptzMap;
} else {
int code = hCNetSDK.NET_DVR_GetLastError();
- log.info("鎺у埗澶辫触,璇风◢鍚庨噸璇�" + code);
+ log.error("鎺у埗澶辫触,璇风◢鍚庨噸璇�" + code);
return new HashMap<>();
}
@@ -627,7 +627,7 @@
boolean bool = hCNetSDK.NET_DVR_SetDVRConfig(userId, NET_DVR_SET_PTZPOS, channelNum, point, m_ptzPosCurrent.size());
if (!bool) {
int code = hCNetSDK.NET_DVR_GetLastError();
- log.info("璁剧疆ptz澶辫触,璇风◢鍚庨噸璇�" + code);
+ log.error("璁剧疆ptz澶辫触,璇风◢鍚庨噸璇�" + code);
}
return bool;
} catch (Exception ex) {
@@ -663,7 +663,7 @@
boolean bool = hCNetSDK.NET_DVR_SetDVRConfig(userId, NET_DVR_SET_PTZPOS, channelNum, point, m_ptzPosCurrent.size());
if (!bool) {
int code = hCNetSDK.NET_DVR_GetLastError();
- log.info("璁剧疆ptz澶辫触,璇风◢鍚庨噸璇�" + code);
+ log.error("璁剧疆ptz澶辫触,璇风◢鍚庨噸璇�" + code);
}
return bool;
} catch (Exception ex) {
@@ -739,7 +739,7 @@
boolean bool = hCNetSDK.NET_DVR_GetDVRConfig(userId, NET_DVR_GET_PTZLOCKCFG, channelNum, point, netDvrPtzLockcfg.size(), ibrBytesReturned);
if (!bool) {
int code = hCNetSDK.NET_DVR_GetLastError();
- log.info("鑾峰彇ptz閿佸畾淇℃伅澶辫触,璇风◢鍚庨噸璇�" + code);
+ log.error("鑾峰彇ptz閿佸畾淇℃伅澶辫触,璇风◢鍚庨噸璇�" + code);
return -1;
} else {
netDvrPtzLockcfg.read();
@@ -803,7 +803,7 @@
boolean bool = hCNetSDK.NET_DVR_GetDVRConfig(userId, NET_DVR_GET_PTZSCOPE, channelNum, point, m_ptzPosCurrent.size(), ibrBytesReturned);
if (!bool) {
int code = hCNetSDK.NET_DVR_GetLastError();
- log.info("璁剧疆ptz澶辫触,璇风◢鍚庨噸璇�" + code);
+ log.error("璁剧疆ptz澶辫触,璇风◢鍚庨噸璇�" + code);
return new HashMap<>();
} else {
m_ptzPosCurrent.read();
@@ -853,7 +853,7 @@
log.error("鑾峰彇鍓嶇鍙傛暟澶辫触锛岄敊璇爜锛�" + hCNetSDK.NET_DVR_GetLastError());
}
struCameraParam.read();
- log.info("鏄惁寮�鍚�忛浘锛�" + struCameraParam.struDefogCfg.byMode);
+ log.debug("鏄惁寮�鍚�忛浘锛�" + struCameraParam.struDefogCfg.byMode);
NET_DVR_DEFOGCFG defogcfg = new NET_DVR_DEFOGCFG();
if (enable) {
@@ -867,9 +867,9 @@
boolean bool = hCNetSDK.NET_DVR_SetDVRConfig(userId, NET_DVR_SET_CCDPARAMCFG_EX, channelNum, point, struCameraParam.size());
if (!bool) {
int code = hCNetSDK.NET_DVR_GetLastError();
- log.info("璁剧疆閫忛浘澶辫触,璇风◢鍚庨噸璇�" + code);
+ log.error("璁剧疆閫忛浘澶辫触,璇风◢鍚庨噸璇�" + code);
}
- log.info("璁剧疆閫忛浘鎴愬姛");
+ log.debug("璁剧疆閫忛浘鎴愬姛");
return bool;
}
@@ -899,7 +899,7 @@
log.error("鑾峰彇鍓嶇鍙傛暟澶辫触锛岄敊璇爜锛�" + hCNetSDK.NET_DVR_GetLastError());
}
struDayNigh.read();
- log.info("鏄惁寮�鍚瑙嗭細" + struDayNigh.struDayNight.byDayNightFilterType);
+ log.debug("鏄惁寮�鍚瑙嗭細" + struDayNigh.struDayNight.byDayNightFilterType);
NET_DVR_DAYNIGHT daynight = new NET_DVR_DAYNIGHT();
if (enable) {
@@ -915,9 +915,9 @@
boolean bool = hCNetSDK.NET_DVR_SetDVRConfig(userId, NET_DVR_SET_CCDPARAMCFG_EX, channelNum, point, struDayNigh.size());
if (!bool) {
int code = hCNetSDK.NET_DVR_GetLastError();
- log.info("璁剧疆澶滆澶辫触,璇风◢鍚庨噸璇�" + code);
+ log.error("璁剧疆澶滆澶辫触,璇风◢鍚庨噸璇�" + code);
}
- log.info("璁剧疆澶滆鎴愬姛");
+ log.debug("璁剧疆澶滆鎴愬姛");
return bool;
}
@@ -944,10 +944,10 @@
IntByReference ibrBytesReturned = new IntByReference(0);
boolean b_GetCameraParam = hCNetSDK.NET_DVR_GetDVRConfig(userId, NET_DVR_GET_FOCUSMODECFG, channelNum, point, struFocusMode.size(), ibrBytesReturned);
if (!b_GetCameraParam) {
- System.out.println("鑾峰彇鍓嶇鍙傛暟澶辫触锛岄敊璇爜锛�" + hCNetSDK.NET_DVR_GetLastError());
+ log.error("鑾峰彇鍓嶇鍙傛暟澶辫触锛岄敊璇爜锛�" + hCNetSDK.NET_DVR_GetLastError());
}
struFocusMode.read();
- log.info("褰撳墠鑱氱劍妯″紡锛�" + struFocusMode.byFocusMode);
+ log.debug("褰撳墠鑱氱劍妯″紡锛�" + struFocusMode.byFocusMode);
if (enable) {
struFocusMode.byFocusMode = 1;//鎵嬪姩鑱氱劍
@@ -961,9 +961,9 @@
boolean bool = hCNetSDK.NET_DVR_SetDVRConfig(userId, NET_DVR_SET_FOCUSMODECFG, channelNum, point, struFocusMode.size());
if (!bool) {
int code = hCNetSDK.NET_DVR_GetLastError();
- log.info("璁剧疆鑱氱劍妯″紡澶辫触,璇风◢鍚庨噸璇�" + code);
+ log.error("璁剧疆鑱氱劍妯″紡澶辫触,璇风◢鍚庨噸璇�" + code);
}
- log.info("璁剧疆鑱氱劍妯″紡鎴愬姛");
+ log.debug("璁剧疆鑱氱劍妯″紡鎴愬姛");
return bool;
}
@@ -979,10 +979,10 @@
IntByReference ibrBytesReturned = new IntByReference(0);
boolean b_GetCameraParam = hCNetSDK.NET_DVR_GetDVRConfig(userId, NET_DVR_GET_FOCUSMODECFG, channelNum, point, struFocusMode.size(), ibrBytesReturned);
if (!b_GetCameraParam) {
- System.out.println("鑾峰彇鍓嶇鍙傛暟澶辫触锛岄敊璇爜锛�" + hCNetSDK.NET_DVR_GetLastError());
+ log.error("鑾峰彇鍓嶇鍙傛暟澶辫触锛岄敊璇爜锛�" + hCNetSDK.NET_DVR_GetLastError());
}
struFocusMode.read();
- log.info("褰撳墠鑱氱劍妯″紡锛�" + struFocusMode.byFocusMode);
+ log.debug("褰撳墠鑱氱劍妯″紡锛�" + struFocusMode.byFocusMode);
return String.valueOf(struFocusMode.byFocusMode);
}
@@ -1013,9 +1013,9 @@
boolean bool = hCNetSDK.NET_DVR_PTZControl_Other(userId, channelNum, HEATER_PWRON, dwStop);
if (!bool) {
int code = hCNetSDK.NET_DVR_GetLastError();
- log.info("璁剧疆浜戝彴鍔犵儹澶辫触,璇风◢鍚庨噸璇�" + code);
+ log.error("璁剧疆浜戝彴鍔犵儹澶辫触,璇风◢鍚庨噸璇�" + code);
}
- log.info("璁剧疆浜戝彴鍔犵儹鎴愬姛");
+ log.debug("璁剧疆浜戝彴鍔犵儹鎴愬姛");
return bool;
}
@@ -1045,7 +1045,7 @@
log.error("鑾峰彇鍓嶇鍙傛暟澶辫触锛岄敊璇爜锛�" + hCNetSDK.NET_DVR_GetLastError());
}
struDeicing.read();
- log.info("鏄惁寮�鍚櫎鍐帮細" + struDeicing.byEnableDeicing);
+ log.debug("鏄惁寮�鍚櫎鍐帮細" + struDeicing.byEnableDeicing);
if (enable) {
struDeicing.byEnableDeicing = 1;//寮�鍚�
@@ -1056,9 +1056,9 @@
boolean bool = hCNetSDK.NET_DVR_SetDVRConfig(userId, NET_DVR_SET_DEVSERVER_CFG, channelNum, point, struDeicing.size());
if (!bool) {
int code = hCNetSDK.NET_DVR_GetLastError();
- log.info("璁剧疆闀滃ご闄ゅ啺澶辫触,璇风◢鍚庨噸璇�" + code);
+ log.error("璁剧疆闀滃ご闄ゅ啺澶辫触,璇风◢鍚庨噸璇�" + code);
}
- log.info("璁剧疆闀滃ご闄ゅ啺鎴愬姛");
+ log.debug("璁剧疆闀滃ご闄ゅ啺鎴愬姛");
return bool;
}
@@ -1090,13 +1090,13 @@
ByteBuffer jpegBuffer = ByteBuffer.allocate(1024 * 1024);
// 鎶撳浘鍒板唴瀛橈紝鍗曞抚鏁版嵁鎹曡幏骞朵繚瀛樻垚JPEG瀛樻斁鍦ㄦ寚瀹氱殑鍐呭瓨绌洪棿涓�
boolean is = hCNetSDK.NET_DVR_CaptureJPEGPicture_NEW(userId, channelNum, jpeg, jpegBuffer, 1024 * 1024, a);
- log.info("-----------杩欓噷寮�濮嬪浘鐗囧瓨鍏ュ唴瀛�----------" + is);
+ log.debug("-----------杩欓噷寮�濮嬪浘鐗囧瓨鍏ュ唴瀛�----------" + is);
Base64.Encoder decoder = Base64.getEncoder();
// BASE64Encoder encoder = new BASE64Encoder();
String png_base64 = decoder.encodeToString(jpegBuffer.array());//杞崲鎴恇ase64涓�
png_base64 = png_base64.replaceAll("\n", "").replaceAll("\r", "");//鍒犻櫎 \r\n
- log.info("-----------澶勭悊瀹屾垚鎴浘鏁版嵁----------");
+ log.debug("-----------澶勭悊瀹屾垚鎴浘鏁版嵁----------");
return png_base64;
}
@@ -1134,11 +1134,11 @@
//璁剧疆鍥剧墖澶у皬
ByteBuffer jpegBuffer = ByteBuffer.allocate(1024 * 1024);
// 鎶撳浘鍒板唴瀛橈紝鍗曞抚鏁版嵁鎹曡幏骞朵繚瀛樻垚JPEG瀛樻斁鍦ㄦ寚瀹氱殑鍐呭瓨绌洪棿涓�
- log.info("-----------杩欓噷寮�濮嬪皝瑁� NET_DVR_CaptureJPEGPicture_NEW---------");
+ log.debug("-----------杩欓噷寮�濮嬪皝瑁� NET_DVR_CaptureJPEGPicture_NEW---------");
boolean is = hCNetSDK.NET_DVR_CaptureJPEGPicture_NEW(userId, channelNum, jpeg, jpegBuffer, 1024 * 1024, a);
- log.info("-----------杩欓噷寮�濮嬪浘鐗囧瓨鍏ュ唴瀛�----------" + is);
+ log.debug("-----------杩欓噷寮�濮嬪浘鐗囧瓨鍏ュ唴瀛�----------" + is);
if (is) {
- log.info("hksdk(鎶撳浘)-缁撴灉鐘舵�佸��(0琛ㄧず鎴愬姛):" + hCNetSDK.NET_DVR_GetLastError());
+ log.debug("hksdk(鎶撳浘)-缁撴灉鐘舵�佸��(0琛ㄧず鎴愬姛):" + hCNetSDK.NET_DVR_GetLastError());
byte[] array = jpegBuffer.array();
//瀛樺偍鍒癿inio
String BucketName = "pic";
@@ -1152,7 +1152,7 @@
boolean b = MinioUtils.uploadObject(BucketName, ObjectName, input, input.available(), ContentType);
if (b) {
url = MinioUtils.getBucketObjectUrl(BucketName, ObjectName);
- log.info("涓婁紶鏂囦欢鎴愬姛!" + url);
+ log.debug("涓婁紶鏂囦欢鎴愬姛!" + url);
}
} catch (IOException ex) {
log.error("涓婁紶鏂囦欢寮傚父锛�" + ex.getMessage());
@@ -1160,7 +1160,7 @@
return url;
} else {
int code = hCNetSDK.NET_DVR_GetLastError();
- log.info("鎶撳浘澶辫触,璇风◢鍚庨噸璇�" + code);
+ log.error("鎶撳浘澶辫触,璇风◢鍚庨噸璇�" + code);
return "";
}
}
@@ -1212,21 +1212,21 @@
log.error("鍙栨祦澶辫触" + hCNetSDK.NET_DVR_GetLastError());
return "";
}
- log.info("鍙栨祦鎴愬姛");
+ log.debug("鍙栨祦鎴愬姛");
GlobalVariable.previewMap.put(cameraId, lRealHandle);
}
if (!hCNetSDK.NET_DVR_SaveRealData_V30(GlobalVariable.previewMap.get(cameraId), 2, path)) {
log.error("淇濆瓨瑙嗛鏂囦欢鍒颁复鏃舵枃浠跺す澶辫触 閿欒鐮佷负: " + hCNetSDK.NET_DVR_GetLastError());
return "";
}
- log.info("褰曞儚寮�濮�");
+ log.debug("褰曞儚寮�濮�");
} else {
if (GlobalVariable.previewMap.containsKey(cameraId)) {
Integer lRealHandle = GlobalVariable.previewMap.get(cameraId);
hCNetSDK.NET_DVR_StopRealPlay(lRealHandle);
GlobalVariable.previewMap.remove(cameraId);
}
- log.info("褰曞儚鍋滄");
+ log.debug("褰曞儚鍋滄");
}
return url;
} catch (Exception ex) {
diff --git a/ard-work/src/main/java/com/ruoyi/inspect/service/impl/ArdVideoInspectTaskServiceImpl.java b/ard-work/src/main/java/com/ruoyi/inspect/service/impl/ArdVideoInspectTaskServiceImpl.java
index a13a827..66f6a26 100644
--- a/ard-work/src/main/java/com/ruoyi/inspect/service/impl/ArdVideoInspectTaskServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/inspect/service/impl/ArdVideoInspectTaskServiceImpl.java
@@ -1,8 +1,6 @@
package com.ruoyi.inspect.service.impl;
-import java.text.SimpleDateFormat;
import java.util.*;
-
import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell;
import com.ruoyi.alarmpoints.well.mapper.ArdAlarmpointsWellMapper;
import com.ruoyi.common.utils.DateUtils;
@@ -10,7 +8,6 @@
import com.ruoyi.device.camera.domain.ArdCameras;
import com.ruoyi.device.camera.domain.CameraCmd;
import com.ruoyi.device.camera.mapper.ArdCamerasMapper;
-import com.ruoyi.device.hiksdk.config.MinioClientSingleton;
import com.ruoyi.device.hiksdk.service.IHikClientService;
import com.ruoyi.inspect.domain.ArdVideoInspectRecord;
import com.ruoyi.inspect.mapper.ArdVideoInspectRecordMapper;
@@ -24,7 +21,6 @@
import com.ruoyi.inspect.mapper.ArdVideoInspectTaskMapper;
import com.ruoyi.inspect.domain.ArdVideoInspectTask;
import com.ruoyi.inspect.service.IArdVideoInspectTaskService;
-
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
@@ -417,7 +413,7 @@
try {
String currentStepId = ardVideoInspectTask.getCurrentStepId();
if (StringUtils.isNull(currentStepId)) {
- log.info("褰撳墠寮�濮嬪贰妫�姝ラid涓虹┖");
+ log.debug("褰撳墠寮�濮嬪贰妫�姝ラid涓虹┖");
return;
}
log.debug("宸℃姝ラ锛�" + currentStepId + "灏濊瘯寮�濮�");
@@ -442,6 +438,11 @@
targetPositon[2] = ardAlarmpointsWell.getAltitude();
/*鑾峰彇鐩告満鍧愭爣*/
ArdCameras cameras = ardCamerasMapper.selectArdCamerasById(cameraId);
+ if(StringUtils.isNull(cameras))
+ {
+ log.debug("鎵句笉鍒扮浉鏈�:"+cameraId);
+ return;
+ }
double[] cameraPositon = new double[3];
cameraPositon[0] = cameras.getLongitude();
cameraPositon[1] = cameras.getLatitude();
@@ -474,7 +475,7 @@
try {
String currentStepId = ardVideoInspectTask.getCurrentStepId();
if (StringUtils.isNull(currentStepId)) {
- log.info("褰撳墠寮�濮嬪贰妫�姝ラid涓虹┖");
+ log.debug("褰撳墠寮�濮嬪贰妫�姝ラid涓虹┖");
return;
}
log.debug("宸℃姝e父锛屽皾璇曞紩瀵硷細" + currentStepId);
@@ -495,6 +496,11 @@
targetPositon[2] = ardAlarmpointsWell.getAltitude();
/*鑾峰彇鐩告満鍧愭爣*/
ArdCameras cameras = ardCamerasMapper.selectArdCamerasById(cameraId);
+ if(StringUtils.isNull(cameras))
+ {
+ log.debug("鎵句笉鍒扮浉鏈�:"+cameraId);
+ return;
+ }
double[] cameraPositon = new double[3];
cameraPositon[0] = cameras.getLongitude();
cameraPositon[1] = cameras.getLatitude();
diff --git a/ard-work/src/main/java/com/ruoyi/utils/generator/CodeGeneration.java b/ard-work/src/main/java/com/ruoyi/utils/generator/CodeGeneration.java
new file mode 100644
index 0000000..049a5e6
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/utils/generator/CodeGeneration.java
@@ -0,0 +1,118 @@
+package com.ruoyi.utils.generator;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.generator.AutoGenerator;
+import com.baomidou.mybatisplus.generator.config.*;
+import com.baomidou.mybatisplus.generator.config.querys.PostgreSqlQuery;
+import com.baomidou.mybatisplus.generator.config.rules.DateType;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+
+import java.util.Collections;
+
+/**
+ * @ClassName: CodeGeneration
+ * @Description: mybatisPlus 浠g爜鐢熸垚宸ュ叿
+ * @Author: Administrator
+ * @Date: 2023骞�03鏈�25鏃� 14:49
+ * @Version: 1.0
+ **/
+public class CodeGeneration {
+ public static void main(String[] args) {
+ /**
+ * 鍏堥厤缃暟鎹簮
+ */
+ PostgreSqlQuery postgreSqlQuery = new PostgreSqlQuery() {
+ @Override
+ public String[] fieldCustom() {
+ return new String[]{"Default"};
+ }
+ };
+
+ DataSourceConfig dsc = new DataSourceConfig.Builder("jdbc:postgresql://192.168.1.15:5432/ry-vue?stringtype=unspecified","postgres","postgres")
+ .dbQuery(postgreSqlQuery).build();
+ //閫氳繃datasourceConfig鍒涘缓AutoGenerator
+ AutoGenerator generator = new AutoGenerator(dsc);
+
+ /**
+ * 鍏ㄥ眬閰嶇疆
+ */
+ String projectPath = System.getProperty("user.dir"); //鑾峰彇椤圭洰璺緞
+ String filePath = projectPath + "/ard-work/src/main/java"; //java涓嬬殑鏂囦欢璺緞
+ GlobalConfig global = new GlobalConfig.Builder()
+ .outputDir(filePath)//鐢熸垚鐨勮緭鍑鸿矾寰�
+ .author("鍒樿嫃涔�")//鐢熸垚鐨勪綔鑰呭悕瀛�
+ //.enableSwagger()寮�鍚痵wagger锛岄渶瑕佹坊鍔爏wagger渚濊禆骞堕厤缃�
+ .dateType(DateType.TIME_PACK)//鏃堕棿绛栫暐
+ .commentDate("yyyy骞碝M鏈坉d鏃�")//鏍煎紡鍖栨椂闂存牸寮�
+ .disableOpenDir()//绂佹鎵撳紑杈撳嚭鐩綍锛岄粯璁alse
+ .fileOverride()//瑕嗙洊鐢熸垚鏂囦欢
+ .build();
+
+ /**
+ * 鍖呴厤缃�
+ */
+ PackageConfig packages = new PackageConfig.Builder()
+ .entity("domian")//瀹炰綋绫诲寘鍚�
+ .parent("com.ruoyi.test")//鐖跺寘鍚嶃�傚鏋滀负绌猴紝灏嗕笅闈㈠瓙鍖呭悕蹇呴』鍐欏叏閮紝 鍚﹀垯灏卞彧闇�鍐欏瓙鍖呭悕
+ .controller("controller")//鎺у埗灞傚寘鍚�
+ .mapper("mapper")//mapper灞傚寘鍚�
+ .xml("mapper.xml")//鏁版嵁璁块棶灞倄ml鍖呭悕
+ .service("service")//service灞傚寘鍚�
+ .serviceImpl("service.impl")//service瀹炵幇绫诲寘鍚�
+ .pathInfo(Collections.singletonMap(OutputFile.xml, projectPath + "/ard-work/src/main/resources/mapper"))
+ .build();
+
+ /**
+ * 绛栫暐閰嶇疆寮�濮�
+ */
+ StrategyConfig strategyConfig = new StrategyConfig.Builder()
+ .enableCapitalMode()//寮�鍚叏灞�澶у啓鍛藉悕
+ //.likeTable()妯$硦琛ㄥ尮閰�
+ .addInclude("school")//娣诲姞琛ㄥ尮閰嶏紝鎸囧畾瑕佺敓鎴愮殑鏁版嵁琛ㄥ悕锛屼笉鍐欓粯璁ら�夊畾鏁版嵁搴撴墍鏈夎〃
+ //.disableSqlFilter()绂佺敤sql杩囨护:榛樿(涓嶄娇鐢ㄨ鏂规硶锛塼rue
+ //.enableSchema()鍚敤schema:榛樿false
+
+ .entityBuilder() //瀹炰綋绛栫暐閰嶇疆
+ //.disableSerialVersionUID()绂佺敤鐢熸垚SerialVersionUID锛氶粯璁rue
+ .enableChainModel()//寮�鍚摼寮忔ā鍨�
+ .enableLombok()//寮�鍚痩ombok
+ .enableRemoveIsPrefix()//寮�鍚� Boolean 绫诲瀷瀛楁绉婚櫎 is 鍓嶇紑
+ .enableTableFieldAnnotation()//寮�鍚敓鎴愬疄浣撴椂鐢熸垚瀛楁娉ㄨВ
+ //.addTableFills()娣诲姞琛ㄥ瓧娈靛~鍏�
+ .naming(NamingStrategy.underline_to_camel)//鏁版嵁琛ㄦ槧灏勫疄浣撳懡鍚嶇瓥鐣ワ細榛樿涓嬪垝绾胯浆椹煎嘲underline_to_camel
+ .columnNaming(NamingStrategy.underline_to_camel)//琛ㄥ瓧娈垫槧灏勫疄浣撳睘鎬у懡鍚嶈鍒欙細榛樿null锛屼笉鎸囧畾鎸夌収naming鎵ц
+ .idType(IdType.AUTO)//娣诲姞鍏ㄥ眬涓婚敭绫诲瀷
+ .formatFileName("%s")//鏍煎紡鍖栧疄浣撳悕绉帮紝%s鍙栨秷棣栧瓧姣岻
+ .build()
+
+ .mapperBuilder()//mapper鏂囦欢绛栫暐
+ .enableMapperAnnotation()//寮�鍚痬apper娉ㄨВ
+ .enableBaseResultMap()//鍚敤xml鏂囦欢涓殑BaseResultMap 鐢熸垚
+ .enableBaseColumnList()//鍚敤xml鏂囦欢涓殑BaseColumnList
+ //.cache(缂撳瓨绫�.class)璁剧疆缂撳瓨瀹炵幇绫�
+ .formatMapperFileName("%sMapper")//鏍煎紡鍖朌ao绫诲悕绉�
+ .formatXmlFileName("%sMapper")//鏍煎紡鍖杧ml鏂囦欢鍚嶇О
+ .build()
+
+ .serviceBuilder()//service鏂囦欢绛栫暐
+ .formatServiceFileName("%sService")//鏍煎紡鍖� service 鎺ュ彛鏂囦欢鍚嶇О
+ .formatServiceImplFileName("%sServiceImpl")//鏍煎紡鍖� service 鎺ュ彛鏂囦欢鍚嶇О
+ .build()
+
+ .controllerBuilder()//鎺у埗灞傜瓥鐣�
+ //.enableHyphenStyle()寮�鍚┘宄拌浆杩炲瓧绗︼紝榛樿锛歠alse
+ .enableRestStyle()//寮�鍚敓鎴怈RestController
+ .formatFileName("%sController")//鏍煎紡鍖栨枃浠跺悕绉�
+ .build();
+ /*鑷虫锛岀瓥鐣ラ厤缃墠绠楀熀鏈畬鎴愶紒*/
+
+ /**
+ * 灏嗘墍鏈夐厤缃」鏁村悎鍒癆utoGenerator涓繘琛屾墽琛�
+ */
+ generator.global(global)
+ .packageInfo(packages)
+ .strategy(strategyConfig)
+ .execute();
+ }
+}
+
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java
index 8b572b6..812dcc1 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java
@@ -61,8 +61,9 @@
* 娴嬭瘯
*/
TEST,
+
/**
* 鎺у埗
*/
- CONTROL,
+ CONTROL
}
--
Gitblit v1.9.3