Compare commits
No commits in common. "01e2a51b57039c756898ef45de9ceec25a29602d" and "aebdb97ceea3b910073d55f5dc37bf4a1b767555" have entirely different histories.
01e2a51b57
...
aebdb97cee
@ -1,39 +0,0 @@
|
|||||||
kind: pipeline # 定义对象类型,还有secret和signature两种类型
|
|
||||||
|
|
||||||
type: docker # 定义流水线类型,还有kubernetes、exec、ssh等类型
|
|
||||||
|
|
||||||
name: ludu-hiking-drone # 定义流水线名称
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
steps: # 定义流水线执行步骤,这些步骤将顺序执行
|
|
||||||
|
|
||||||
- name: hiking-build
|
|
||||||
|
|
||||||
image: appleboy/drone-ssh # SSH工具镜像
|
|
||||||
|
|
||||||
settings:
|
|
||||||
|
|
||||||
host: 121.36.203.133 # 远程连接地址
|
|
||||||
|
|
||||||
username: root # 远程连接账号
|
|
||||||
|
|
||||||
password:
|
|
||||||
|
|
||||||
from_secret: ssh_password3 # 从Secret中读取SSH密码
|
|
||||||
|
|
||||||
port: 22 # 远程连接端口
|
|
||||||
|
|
||||||
command_timeout: 20m # 远程执行命令超时时间
|
|
||||||
|
|
||||||
script:
|
|
||||||
- cd /root/ludu-cloud
|
|
||||||
- git fetch origin
|
|
||||||
- git reset --hard origin/master
|
|
||||||
- git clean -fd
|
|
||||||
- /root/apache-maven-3.9.4/bin/mvn package -Dmaven.test.skip=true
|
|
||||||
|
|
||||||
- cd /root/ludu-cloud/ludu-module-hiking/ludu-module-hiking-biz
|
|
||||||
- chmod +x run.sh
|
|
||||||
- ./run.sh || echo "hiking build failed"
|
|
@ -143,15 +143,6 @@ public class SaleDataApi {
|
|||||||
System.out.println(saleDataService.findEventsByYear(year));
|
System.out.println(saleDataService.findEventsByYear(year));
|
||||||
return saleDataService.findEventsByYear(year).size();
|
return saleDataService.findEventsByYear(year).size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/selectSaleCountByDate")
|
|
||||||
@Operation(summary = "查询某年某月某日售票数量")
|
|
||||||
public Integer selectSaleCountByDate(String date) {
|
|
||||||
System.out.println("date: "+date);
|
|
||||||
String dateParam = date.replace("-", "");
|
|
||||||
System.out.println("dateParam: "+dateParam);
|
|
||||||
return saleDataService.selectSaleCountByDate(dateParam);
|
|
||||||
}
|
|
||||||
// @GetMapping("/test")
|
// @GetMapping("/test")
|
||||||
// public void testMethod(){
|
// public void testMethod(){
|
||||||
//
|
//
|
||||||
|
@ -13,7 +13,6 @@ import cn.iocoder.yudao.module.datacenter.utlis.IntegrationURL;
|
|||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
@ -38,14 +37,15 @@ public class CameraServiceImpl implements CameraService {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private CameraMapper cameraMapper;
|
private CameraMapper cameraMapper;
|
||||||
@Autowired
|
private ObjectMapper objectMapper;
|
||||||
private RedisTemplate<String, String> redisTemplate;
|
@Resource
|
||||||
|
private RedisTemplate redisTemplate;
|
||||||
private static final String ACCESS_TOKEN_KEY = "hikingAPI:access_token";
|
private static final String ACCESS_TOKEN_KEY = "hikingAPI:access_token";
|
||||||
|
|
||||||
|
|
||||||
public String getAccessToken() {
|
public String getAccessToken() {
|
||||||
// 检查 Redis 中是否有 access_token
|
// 检查 Redis 中是否有 access_token
|
||||||
String accessToken = redisTemplate.opsForValue().get(ACCESS_TOKEN_KEY);
|
String accessToken = (String) redisTemplate.opsForValue().get(ACCESS_TOKEN_KEY);
|
||||||
if (!StringUtils.isEmpty(accessToken)) {
|
if (!StringUtils.isEmpty(accessToken)) {
|
||||||
System.out.println("使用缓存的token:" + accessToken);
|
System.out.println("使用缓存的token:" + accessToken);
|
||||||
return accessToken; // 如果存在则直接返回
|
return accessToken; // 如果存在则直接返回
|
||||||
@ -55,10 +55,10 @@ public class CameraServiceImpl implements CameraService {
|
|||||||
System.out.println("获取新的token");
|
System.out.println("获取新的token");
|
||||||
String accessTokenUrlResp = IntegrationURL.getAccessTokenURL();
|
String accessTokenUrlResp = IntegrationURL.getAccessTokenURL();
|
||||||
try {
|
try {
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
JsonNode jsonNode = objectMapper.readTree(accessTokenUrlResp);
|
JsonNode jsonNode = objectMapper.readTree(accessTokenUrlResp);
|
||||||
accessToken = jsonNode.get("access_token").asText();
|
accessToken = jsonNode.get("access_token").asText();
|
||||||
System.out.println("cameraapi -------------accessToken:" + accessToken);
|
|
||||||
// 将 access_token 存入 Redis,设置过期时间为 11 小时(有效期12小时)
|
// 将 access_token 存入 Redis,设置过期时间为 11 小时(有效期12小时)
|
||||||
redisTemplate.opsForValue().set(ACCESS_TOKEN_KEY, accessToken, 11, TimeUnit.HOURS);
|
redisTemplate.opsForValue().set(ACCESS_TOKEN_KEY, accessToken, 11, TimeUnit.HOURS);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -75,7 +75,7 @@ public class CameraServiceImpl implements CameraService {
|
|||||||
|
|
||||||
public Boolean checkToken(String result) {
|
public Boolean checkToken(String result) {
|
||||||
try {
|
try {
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
JsonNode jsonNode = objectMapper.readTree(result);
|
JsonNode jsonNode = objectMapper.readTree(result);
|
||||||
String code = jsonNode.path("code").asText();
|
String code = jsonNode.path("code").asText();
|
||||||
if ("0x02401007".equals(code)) {
|
if ("0x02401007".equals(code)) {
|
||||||
|
@ -98,6 +98,4 @@ public interface SaleDataService {
|
|||||||
* @return java.math.BigDecimal
|
* @return java.math.BigDecimal
|
||||||
*/
|
*/
|
||||||
BigDecimal findyearJun(List<SaleData> list);
|
BigDecimal findyearJun(List<SaleData> list);
|
||||||
|
|
||||||
Integer selectSaleCountByDate(String dateParam);
|
|
||||||
}
|
}
|
@ -445,10 +445,5 @@ public class SaleDataServiceImpl implements SaleDataService {
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Integer selectSaleCountByDate(String dateParam) {
|
|
||||||
return saleDataRepository.countBySddate(dateParam);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -12,9 +12,9 @@ public class IntegrationURL {
|
|||||||
|
|
||||||
//设置平台参数,根据实际情况,设置host appKey appSecret 三个参数.
|
//设置平台参数,根据实际情况,设置host appKey appSecret 三个参数.
|
||||||
static {
|
static {
|
||||||
ArtemisConfig.host = "192.168.11.3:443"; // 平台的ip端口
|
ArtemisConfig.host = "127.0.0.1:443"; // 平台的ip端口
|
||||||
ArtemisConfig.appKey = "22116579"; // 密钥appkey
|
ArtemisConfig.appKey = "29180881"; // 密钥appkey
|
||||||
ArtemisConfig.appSecret = "AqL0EZSvZ60vzvO3Gqx9";// 密钥appSecret
|
ArtemisConfig.appSecret = "XO0wCAYGi4KV70ybjznx";// 密钥appSecret
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置OpenAPI接口的上下文
|
//设置OpenAPI接口的上下文
|
||||||
@ -46,7 +46,7 @@ public class IntegrationURL {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//查询区域列表v2
|
//查询区域列表v2
|
||||||
public static String getRegionListURL(String resourceType, String[] parentIndexCodes, Boolean isSubRegion, int pageNo,int pageSize, String[] authCodes, Integer regionType, String regionName, String[] sonOrgIndexCodes, Integer cascadeFlag, String orderBy, String orderType ,String accessToken) {
|
public static String getRegionListURL(String resourceType,int pageNo,int pageSize,String accessToken) {
|
||||||
|
|
||||||
|
|
||||||
//设置接口的URI地址
|
//设置接口的URI地址
|
||||||
@ -63,17 +63,8 @@ public class IntegrationURL {
|
|||||||
//组装请求参数
|
//组装请求参数
|
||||||
JSONObject jsonBody = new JSONObject();
|
JSONObject jsonBody = new JSONObject();
|
||||||
jsonBody.put("resourceType",resourceType);
|
jsonBody.put("resourceType",resourceType);
|
||||||
jsonBody.put("parentIndexCodes",parentIndexCodes);
|
|
||||||
jsonBody.put("isSubRegion",isSubRegion);
|
|
||||||
jsonBody.put("pageNo", pageNo);
|
jsonBody.put("pageNo", pageNo);
|
||||||
jsonBody.put("pageSize", pageSize);
|
jsonBody.put("pageSize", pageSize);
|
||||||
jsonBody.put("authCodes",authCodes);
|
|
||||||
jsonBody.put("regionType",regionType);
|
|
||||||
jsonBody.put("regionName",regionName);
|
|
||||||
jsonBody.put("sonOrgIndexCodes",sonOrgIndexCodes);
|
|
||||||
jsonBody.put("cascadeFlag",cascadeFlag);
|
|
||||||
jsonBody.put("orderBy",orderBy);
|
|
||||||
jsonBody.put("orderType",orderType);
|
|
||||||
String body = jsonBody.toJSONString();
|
String body = jsonBody.toJSONString();
|
||||||
|
|
||||||
//请求头添加 access_token认证
|
//请求头添加 access_token认证
|
||||||
@ -86,7 +77,7 @@ public class IntegrationURL {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 根据区域编号获取下一级区域列表v2
|
// 根据区域编号获取下一级区域列表v2
|
||||||
public static String getRegionListByParentIndexCodeURL(String parentIndexCode, String resourceType,String[] authCodes, int pageNo,int pageSize, Integer cascadeFlag, String accessToken) {
|
public static String getRegionListByParentIndexCodeURL(String parentIndexCode, String resourceType,int pageNo,int pageSize,String accessToken) {
|
||||||
|
|
||||||
|
|
||||||
//设置接口的URI地址
|
//设置接口的URI地址
|
||||||
@ -104,10 +95,8 @@ public class IntegrationURL {
|
|||||||
JSONObject jsonBody = new JSONObject();
|
JSONObject jsonBody = new JSONObject();
|
||||||
jsonBody.put("parentIndexCode", parentIndexCode);
|
jsonBody.put("parentIndexCode", parentIndexCode);
|
||||||
jsonBody.put("resourceType",resourceType);
|
jsonBody.put("resourceType",resourceType);
|
||||||
jsonBody.put("authCodes",authCodes);
|
|
||||||
jsonBody.put("pageNo", pageNo);
|
jsonBody.put("pageNo", pageNo);
|
||||||
jsonBody.put("pageSize", pageSize);
|
jsonBody.put("pageSize", pageSize);
|
||||||
jsonBody.put("cascadeFlag",cascadeFlag);
|
|
||||||
String body = jsonBody.toJSONString();
|
String body = jsonBody.toJSONString();
|
||||||
|
|
||||||
//请求头添加 access_token认证
|
//请求头添加 access_token认证
|
||||||
@ -177,7 +166,7 @@ public class IntegrationURL {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 增量获取区域数据
|
// 增量获取区域数据
|
||||||
public static String getRegionTimeRangeURL(String startTime, String endTime, String pageNo, String pageSize,String accessToken) {
|
public static String getRegionTimeRangeURL(String startTime, String pageNo, String pageSize,String accessToken) {
|
||||||
//设置接口的URI地址
|
//设置接口的URI地址
|
||||||
final String previewURLsApi = ARTEMIS_PATH + "/api/resource/v1/region/timeRange";
|
final String previewURLsApi = ARTEMIS_PATH + "/api/resource/v1/region/timeRange";
|
||||||
Map<String, String> path = new HashMap<String, String>(2) {
|
Map<String, String> path = new HashMap<String, String>(2) {
|
||||||
@ -192,7 +181,6 @@ public class IntegrationURL {
|
|||||||
//组装请求参数
|
//组装请求参数
|
||||||
JSONObject jsonBody = new JSONObject();
|
JSONObject jsonBody = new JSONObject();
|
||||||
jsonBody.put("startTime", startTime);
|
jsonBody.put("startTime", startTime);
|
||||||
jsonBody.put("endTime", endTime);
|
|
||||||
jsonBody.put("pageNo", pageNo);
|
jsonBody.put("pageNo", pageNo);
|
||||||
jsonBody.put("pageSize", pageSize);
|
jsonBody.put("pageSize", pageSize);
|
||||||
String body = jsonBody.toJSONString();
|
String body = jsonBody.toJSONString();
|
||||||
@ -207,7 +195,7 @@ public class IntegrationURL {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//查询监控点列表v2
|
//查询监控点列表v2
|
||||||
public static String getCameraListURL(String name, String[] regionIndexCodes, Boolean isSubRegion, int pageNo,int pageSize, String[] authCodes, Object[] expressions, String orderBy, String orderType, String accessToken) {
|
public static String getCameraListURL(int pageNo,int pageSize,String accessToken) {
|
||||||
|
|
||||||
//设置接口的URI地址
|
//设置接口的URI地址
|
||||||
final String previewURLsApi = ARTEMIS_PATH + "/api/resource/v2/camera/search";
|
final String previewURLsApi = ARTEMIS_PATH + "/api/resource/v2/camera/search";
|
||||||
@ -222,15 +210,8 @@ public class IntegrationURL {
|
|||||||
|
|
||||||
//组装请求参数
|
//组装请求参数
|
||||||
JSONObject jsonBody = new JSONObject();
|
JSONObject jsonBody = new JSONObject();
|
||||||
jsonBody.put("name", name);
|
|
||||||
jsonBody.put("regionIndexCodes", regionIndexCodes);
|
|
||||||
jsonBody.put("isSubRegion", isSubRegion);
|
|
||||||
jsonBody.put("pageNo", pageNo); //当前页码
|
jsonBody.put("pageNo", pageNo); //当前页码
|
||||||
jsonBody.put("pageSize", pageSize); //分页大小
|
jsonBody.put("pageSize", pageSize); //分页大小
|
||||||
jsonBody.put("authCodes", authCodes);
|
|
||||||
jsonBody.put("expressions", expressions);
|
|
||||||
jsonBody.put("orderBy", orderBy);
|
|
||||||
jsonBody.put("orderType", orderType);
|
|
||||||
String body = jsonBody.toJSONString();
|
String body = jsonBody.toJSONString();
|
||||||
|
|
||||||
//请求头添加 access_token认证
|
//请求头添加 access_token认证
|
||||||
@ -331,7 +312,7 @@ public class IntegrationURL {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 增量获取监控点数据
|
// 增量获取监控点数据
|
||||||
public static String getCameraTimeRangeURL(String startTime, String endTime, int pageNo, int pageSize, String accessToken) {
|
public static String getCameraTimeRangeURL(String startTime, int pageNo, int pageSize, String accessToken) {
|
||||||
|
|
||||||
//设置接口的URI地址
|
//设置接口的URI地址
|
||||||
final String previewURLsApi = ARTEMIS_PATH + "/api/resource/v1/camera/timeRange";
|
final String previewURLsApi = ARTEMIS_PATH + "/api/resource/v1/camera/timeRange";
|
||||||
@ -347,7 +328,6 @@ public class IntegrationURL {
|
|||||||
//组装请求参数
|
//组装请求参数
|
||||||
JSONObject jsonBody = new JSONObject();
|
JSONObject jsonBody = new JSONObject();
|
||||||
jsonBody.put("startTime", startTime);
|
jsonBody.put("startTime", startTime);
|
||||||
jsonBody.put("endTime", endTime);
|
|
||||||
jsonBody.put("pageNo", pageNo); //当前页码
|
jsonBody.put("pageNo", pageNo); //当前页码
|
||||||
jsonBody.put("pageSize", pageSize); //分页大小
|
jsonBody.put("pageSize", pageSize); //分页大小
|
||||||
String body = jsonBody.toJSONString();
|
String body = jsonBody.toJSONString();
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
## AdoptOpenJDK 停止发布 OpenJDK 二进制,而 Eclipse Temurin 是它的延伸,提供更好的稳定性
|
|
||||||
## 感谢复旦核博士的建议!灰子哥,牛皮!
|
|
||||||
FROM openjdk:8-jre
|
|
||||||
|
|
||||||
## 创建目录,并使用它作为工作目录
|
|
||||||
RUN mkdir -p /ludu-module-hiking-biz
|
|
||||||
WORKDIR /ludu-module-hiking-biz
|
|
||||||
## 将后端项目的 Jar 文件,复制到镜像中
|
|
||||||
COPY ./target/ludu-module-hiking-biz.jar app.jar
|
|
||||||
|
|
||||||
## 设置 TZ 时区
|
|
||||||
ENV TZ=Asia/Shanghai
|
|
||||||
## 设置 JAVA_OPTS 环境变量,可通过 docker run -e "JAVA_OPTS=" 进行覆盖
|
|
||||||
ENV JAVA_OPTS="-Xms256m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
|
|
||||||
|
|
||||||
## 暴露后端项目的 48090 端口
|
|
||||||
EXPOSE 48094
|
|
||||||
|
|
||||||
## 启动后端项目
|
|
||||||
CMD java ${JAVA_OPTS} -jar app.jar --spring.profiles.active=dev
|
|
@ -1,15 +0,0 @@
|
|||||||
app_name='ludu-module-hiking'
|
|
||||||
# 定义应用版本
|
|
||||||
app_version='1.0.0'
|
|
||||||
# 定义应用环境
|
|
||||||
# 打包编译docker镜像
|
|
||||||
echo '----build image----'
|
|
||||||
docker buildx build -f Dockerfile -t ${app_name}:${app_version} .
|
|
||||||
echo '----stop container----'
|
|
||||||
docker stop ${app_name}
|
|
||||||
echo '----rm container----'
|
|
||||||
docker rm ${app_name}
|
|
||||||
echo '----rmi none image----'
|
|
||||||
docker rmi $(docker images -f "dangling=true" -q)
|
|
||||||
echo '----start container----'
|
|
||||||
docker run -d -p 48094:48094 --name ${app_name} --restart always ${app_name}:${app_version}
|
|
@ -45,8 +45,8 @@ public class GetCameraInfoUtil {
|
|||||||
try {
|
try {
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
JsonNode jsonNode = objectMapper.readTree(accessTokenUrlResp);
|
JsonNode jsonNode = objectMapper.readTree(accessTokenUrlResp);
|
||||||
accessToken = jsonNode.path("data").path("access_token").asText();
|
accessToken = jsonNode.get("access_token").asText();
|
||||||
System.out.println("getCameraInfo获取到的token--------------------------------------:" + accessToken);
|
|
||||||
// 将 access_token 存入 Redis,设置过期时间为 11 小时(有效期12小时)
|
// 将 access_token 存入 Redis,设置过期时间为 11 小时(有效期12小时)
|
||||||
redisTemplate.opsForValue().set(ACCESS_TOKEN_KEY, accessToken, 11, TimeUnit.HOURS);
|
redisTemplate.opsForValue().set(ACCESS_TOKEN_KEY, accessToken, 11, TimeUnit.HOURS);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -85,74 +85,73 @@ public class GetCameraInfoUtil {
|
|||||||
JsonNode jsonNode;
|
JsonNode jsonNode;
|
||||||
JsonNode cameraDataList;
|
JsonNode cameraDataList;
|
||||||
// 查询有几条记录
|
// 查询有几条记录
|
||||||
String cameraListPageURL = IntegrationURL.getCameraResourceURL(1, 1, getAccessToken());
|
// String cameraListPageURL = IntegrationURL.getCameraResourceURL(1, 1, getAccessToken());
|
||||||
if (!checkToken(cameraListPageURL)) {
|
// if (!checkToken(cameraListPageURL)) {
|
||||||
cameraListPageURL = IntegrationURL.getCameraResourceURL(1, 1, getAccessToken());
|
// cameraListPageURL = IntegrationURL.getCameraResourceURL(1, 1, getAccessToken());
|
||||||
}
|
// }
|
||||||
// String cameraListPageURL = " {\n" +
|
String cameraListPageURL = " {\n" +
|
||||||
// " \"code\": \"0\", \n" +
|
" \"code\": \"0\", \n" +
|
||||||
// " \"msg\": \"success\", \n" +
|
" \"msg\": \"success\", \n" +
|
||||||
// " \"data\": {\n" +
|
" \"data\": {\n" +
|
||||||
// " \"total\": 13, \n" +
|
" \"total\": 13, \n" +
|
||||||
// " \"pageNo\": 1, \n" +
|
" \"pageNo\": 1, \n" +
|
||||||
// " \"pageSize\": 1, \n" +
|
" \"pageSize\": 1, \n" +
|
||||||
// " \"list\": [\n" +
|
" \"list\": [\n" +
|
||||||
// " {\n" +
|
" {\n" +
|
||||||
// " \"altitude\": null, \n" +
|
" \"altitude\": null, \n" +
|
||||||
// " \"cameraIndexCode\": \"eddf8458f74d42e9bf4ecfc752dba146\", \n" +
|
" \"cameraIndexCode\": \"eddf8458f74d42e9bf4ecfc752dba146\", \n" +
|
||||||
// " \"cameraName\": \"3层吉米后厨入口\", \n" +
|
" \"cameraName\": \"3层吉米后厨入口\", \n" +
|
||||||
// " \"cameraType\": 0, \n" +
|
" \"cameraType\": 0, \n" +
|
||||||
// " \"cameraTypeName\": \"枪机\", \n" +
|
" \"cameraTypeName\": \"枪机\", \n" +
|
||||||
// " \"capabilitySet\": \"io,event_io,event_ias,event_rule,event_heat,record,net,event_face,vss,ptz,status,maintenance,event_device\", \n" +
|
" \"capabilitySet\": \"io,event_io,event_ias,event_rule,event_heat,record,net,event_face,vss,ptz,status,maintenance,event_device\", \n" +
|
||||||
// " \"capabilitySetName\": null, \n" +
|
" \"capabilitySetName\": null, \n" +
|
||||||
// " \"intelligentSet\": null, \n" +
|
" \"intelligentSet\": null, \n" +
|
||||||
// " \"intelligentSetName\": null, \n" +
|
" \"intelligentSetName\": null, \n" +
|
||||||
// " \"channelNo\": \"33\", \n" +
|
" \"channelNo\": \"33\", \n" +
|
||||||
// " \"channelType\": \"digital\", \n" +
|
" \"channelType\": \"digital\", \n" +
|
||||||
// " \"channelTypeName\": \"数字通道\", \n" +
|
" \"channelTypeName\": \"数字通道\", \n" +
|
||||||
// " \"createTime\": \"2018-09-15T11:14:27.812+08:00\", \n" +
|
" \"createTime\": \"2018-09-15T11:14:27.812+08:00\", \n" +
|
||||||
// " \"encodeDevIndexCode\": \"1d3d5c26e6174cf1aa452f57cac91879\", \n" +
|
" \"encodeDevIndexCode\": \"1d3d5c26e6174cf1aa452f57cac91879\", \n" +
|
||||||
// " \"encodeDevResourceType\": null, \n" +
|
" \"encodeDevResourceType\": null, \n" +
|
||||||
// " \"encodeDevResourceTypeName\": null, \n" +
|
" \"encodeDevResourceTypeName\": null, \n" +
|
||||||
// " \"gbIndexCode\": null, \n" +
|
" \"gbIndexCode\": null, \n" +
|
||||||
// " \"installLocation\": null, \n" +
|
" \"installLocation\": null, \n" +
|
||||||
// " \"keyBoardCode\": null, \n" +
|
" \"keyBoardCode\": null, \n" +
|
||||||
// " \"latitude\": null, \n" +
|
" \"latitude\": null, \n" +
|
||||||
// " \"longitude\": null, \n" +
|
" \"longitude\": null, \n" +
|
||||||
// " \"pixel\": null, \n" +
|
" \"pixel\": null, \n" +
|
||||||
// " \"ptz\": null, \n" +
|
" \"ptz\": null, \n" +
|
||||||
// " \"ptzName\": null, \n" +
|
" \"ptzName\": null, \n" +
|
||||||
// " \"ptzController\": null, \n" +
|
" \"ptzController\": null, \n" +
|
||||||
// " \"ptzControllerName\": null, \n" +
|
" \"ptzControllerName\": null, \n" +
|
||||||
// " \"recordLocation\": null, \n" +
|
" \"recordLocation\": null, \n" +
|
||||||
// " \"recordLocationName\": null, \n" +
|
" \"recordLocationName\": null, \n" +
|
||||||
// " \"regionIndexCode\": \"2feadc43-ffef-464b-a2e2-b146a02de5ba\", \n" +
|
" \"regionIndexCode\": \"2feadc43-ffef-464b-a2e2-b146a02de5ba\", \n" +
|
||||||
// " \"status\": null, \n" +
|
" \"status\": null, \n" +
|
||||||
// " \"statusName\": null, \n" +
|
" \"statusName\": null, \n" +
|
||||||
// " \"transType\": 1, \n" +
|
" \"transType\": 1, \n" +
|
||||||
// " \"transTypeName\": \"TCP\", \n" +
|
" \"transTypeName\": \"TCP\", \n" +
|
||||||
// " \"treatyType\": null, \n" +
|
" \"treatyType\": null, \n" +
|
||||||
// " \"treatyTypeName\": null, \n" +
|
" \"treatyTypeName\": null, \n" +
|
||||||
// " \"viewshed\": null, \n" +
|
" \"viewshed\": null, \n" +
|
||||||
// " \"updateTime\": \"2018-09-15T11:19:48.973+08:00\"\n" +
|
" \"updateTime\": \"2018-09-15T11:19:48.973+08:00\"\n" +
|
||||||
// " }\n" +
|
" }\n" +
|
||||||
// " ]\n" +
|
" ]\n" +
|
||||||
// " }\n" +
|
" }\n" +
|
||||||
// "}\n";
|
"}\n";
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
jsonNode = objectMapper.readTree(cameraListPageURL);
|
jsonNode = objectMapper.readTree(cameraListPageURL);
|
||||||
total = jsonNode.path("data").path("total").asInt();
|
// total = jsonNode.path("data").path("total").asInt();
|
||||||
System.out.println("total::::::::::::::::::::::::::::::::::::::" + total);
|
total = 1;
|
||||||
// total = 1;
|
|
||||||
|
|
||||||
JsonNode cameraNode;
|
JsonNode cameraNode;
|
||||||
// 查询所有记录的cameraIndexCode并保存
|
// 查询所有记录的cameraIndexCode并保存
|
||||||
for (int i = 1; i <= (total / 100) + 1; i++) {
|
for (int i = 1; i <= (total / 100) + 1; i++) {
|
||||||
System.out.println("开始第" + i + "次查询");
|
System.out.println("开始第" + i + "次查询");
|
||||||
cameraListPageURL = IntegrationURL.getCameraResourceURL(i, 100, getAccessToken());
|
// cameraListPageURL = IntegrationURL.getCameraResourceURL(i, 100, getAccessToken());
|
||||||
jsonNode = objectMapper.readTree(cameraListPageURL);
|
jsonNode = objectMapper.readTree(cameraListPageURL);
|
||||||
cameraDataList = jsonNode.path("data").path("list");
|
cameraDataList = jsonNode.path("data").path("list");
|
||||||
System.out.println("cameraDataList::::::::::::::::::::::::::::::::::::::" + cameraDataList);
|
System.out.println(cameraDataList);
|
||||||
Iterator<JsonNode> elements2 = cameraDataList.elements();
|
Iterator<JsonNode> elements2 = cameraDataList.elements();
|
||||||
while (elements2.hasNext()) {
|
while (elements2.hasNext()) {
|
||||||
CameraDO cameraDO = new CameraDO();
|
CameraDO cameraDO = new CameraDO();
|
||||||
|
@ -46,8 +46,7 @@ public class GetRegionInfoUtil {
|
|||||||
try {
|
try {
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
JsonNode jsonNode = objectMapper.readTree(accessTokenUrlResp);
|
JsonNode jsonNode = objectMapper.readTree(accessTokenUrlResp);
|
||||||
accessToken = jsonNode.path("data").path("access_token").asText();
|
accessToken = jsonNode.get("access_token").asText();
|
||||||
System.out.println("accessToken " + accessToken);
|
|
||||||
|
|
||||||
// 将 access_token 存入 Redis,设置过期时间为 11 小时(有效期12小时)
|
// 将 access_token 存入 Redis,设置过期时间为 11 小时(有效期12小时)
|
||||||
redisTemplate.opsForValue().set(ACCESS_TOKEN_KEY, accessToken, 11, TimeUnit.HOURS);
|
redisTemplate.opsForValue().set(ACCESS_TOKEN_KEY, accessToken, 11, TimeUnit.HOURS);
|
||||||
@ -81,7 +80,6 @@ public class GetRegionInfoUtil {
|
|||||||
|
|
||||||
@GetMapping("/getRegionListToDB")
|
@GetMapping("/getRegionListToDB")
|
||||||
public void getRegionListToDB() {
|
public void getRegionListToDB() {
|
||||||
System.out.println("token:" + getAccessToken());
|
|
||||||
try {
|
try {
|
||||||
// 总记录数
|
// 总记录数
|
||||||
int total = 0;
|
int total = 0;
|
||||||
@ -93,36 +91,35 @@ public class GetRegionInfoUtil {
|
|||||||
JsonNode jsonNode;
|
JsonNode jsonNode;
|
||||||
JsonNode regionDataList;
|
JsonNode regionDataList;
|
||||||
// 查询有几条记录
|
// 查询有几条记录
|
||||||
String regionListPageURL = IntegrationURL.getRegionListPageURL(1, 1, getAccessToken());
|
// String regionListPageURL = IntegrationURL.getRegionListPageURL(1, 1, getAccessToken());
|
||||||
// String regionListPageURL = "{\n" +
|
String regionListPageURL = "{\n" +
|
||||||
// " \"code\": \"0\",\n" +
|
" \"code\": \"0\",\n" +
|
||||||
// " \"msg\": \"SUCCESS\",\n" +
|
" \"msg\": \"SUCCESS\",\n" +
|
||||||
// " \"data\": {\n" +
|
" \"data\": {\n" +
|
||||||
// " \"total\": 18,\n" +
|
" \"total\": 18,\n" +
|
||||||
// " \"pageNo\": 2,\n" +
|
" \"pageNo\": 2,\n" +
|
||||||
// " \"pageSize\": 3,\n" +
|
" \"pageSize\": 3,\n" +
|
||||||
// " \"list\": [\n" +
|
" \"list\": [\n" +
|
||||||
// " {\n" +
|
" {\n" +
|
||||||
// " \"indexCode\": \"root000000\",\n" +
|
" \"indexCode\": \"root000000\",\n" +
|
||||||
// " \"name\": \"根节点\",\n" +
|
" \"name\": \"根节点\",\n" +
|
||||||
// " \"parentIndexCode\": \"null\",\n" +
|
" \"parentIndexCode\": \"null\",\n" +
|
||||||
// " \"treeCode\": \"0\"\n" +
|
" \"treeCode\": \"0\"\n" +
|
||||||
// " }\n" +
|
" }\n" +
|
||||||
// " ]\n" +
|
" ]\n" +
|
||||||
// " }\n" +
|
" }\n" +
|
||||||
// "}\n";
|
"}\n";
|
||||||
if (!checkToken(regionListPageURL)) {
|
// if (!checkToken(regionListPageURL)) {
|
||||||
regionListPageURL = IntegrationURL.getRegionListPageURL(1, 1, getAccessToken());
|
// regionListPageURL = IntegrationURL.getRegionListPageURL(1, 1, getAccessToken());
|
||||||
}
|
// }
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
jsonNode = objectMapper.readTree(regionListPageURL);
|
jsonNode = objectMapper.readTree(regionListPageURL);
|
||||||
total = jsonNode.path("data").path("total").asInt();
|
total = jsonNode.path("data").path("total").asInt();
|
||||||
System.out.println("共" + total + "条数据");
|
|
||||||
// 查询所有记录的indexCode并保存
|
// 查询所有记录的indexCode并保存
|
||||||
indexCodes = new String[100];
|
indexCodes = new String[100];
|
||||||
for (int i = 1; i <= (total / 100) + 1; i++) {
|
for (int i = 1; i <= (total / 100) + 1; i++) {
|
||||||
regionListPageURL = IntegrationURL.getRegionListPageURL(i, 100, getAccessToken());
|
// regionListPageURL = IntegrationURL.getRegionListPageURL(i, 100, getAccessToken());
|
||||||
System.out.println("获取的数据:::::::::::::::::"+regionListPageURL);
|
|
||||||
ObjectMapper objectMapper2 = new ObjectMapper();
|
ObjectMapper objectMapper2 = new ObjectMapper();
|
||||||
jsonNode = objectMapper2.readTree(regionListPageURL);
|
jsonNode = objectMapper2.readTree(regionListPageURL);
|
||||||
regionDataList = jsonNode.path("data").path("list");
|
regionDataList = jsonNode.path("data").path("list");
|
||||||
@ -134,32 +131,32 @@ public class GetRegionInfoUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 保存后使用indexCodes数组查询区域详细信息
|
// 保存后使用indexCodes数组查询区域详细信息
|
||||||
String regionListPageURL2 = IntegrationURL.getRegionByIndexCodesURL(indexCodes, getAccessToken());
|
// String regionListPageURL2 = IntegrationURL.getRegionByIndexCodesURL(indexCodes, getAccessToken());
|
||||||
// String regionListPageURL2 = "{\n" +
|
String regionListPageURL2 = "{\n" +
|
||||||
// " \"code\": \"0\",\n" +
|
" \"code\": \"0\",\n" +
|
||||||
// " \"msg\": \"SUCCESS\",\n" +
|
" \"msg\": \"SUCCESS\",\n" +
|
||||||
// " \"data\": {\n" +
|
" \"data\": {\n" +
|
||||||
// " \"total\": 1,\n" +
|
" \"total\": 1,\n" +
|
||||||
// " \"list\": [\n" +
|
" \"list\": [\n" +
|
||||||
// " {\n" +
|
" {\n" +
|
||||||
// " \"indexCode\": \"root000000\",\n" +
|
" \"indexCode\": \"root000000\",\n" +
|
||||||
// " \"name\": \"根节点123123123123\",\n" +
|
" \"name\": \"根节点123123123123\",\n" +
|
||||||
// " \"regionPath\": \"@root000000@\",\n" +
|
" \"regionPath\": \"@root000000@\",\n" +
|
||||||
// " \"parentIndexCode\": \"-1\",\n" +
|
" \"parentIndexCode\": \"-1\",\n" +
|
||||||
// " \"available\": true,\n" +
|
" \"available\": true,\n" +
|
||||||
// " \"leaf\": false,\n" +
|
" \"leaf\": false,\n" +
|
||||||
// " \"cascadeCode\": \"0\",\n" +
|
" \"cascadeCode\": \"0\",\n" +
|
||||||
// " \"cascadeType\": 0,\n" +
|
" \"cascadeType\": 0,\n" +
|
||||||
// " \"catalogType\": 10,\n" +
|
" \"catalogType\": 10,\n" +
|
||||||
// " \"externalIndexCode\": \"34\",\n" +
|
" \"externalIndexCode\": \"34\",\n" +
|
||||||
// " \"parentExternalIndexCode\": \"34\",\n" +
|
" \"parentExternalIndexCode\": \"34\",\n" +
|
||||||
// " \"sort\": 1,\n" +
|
" \"sort\": 1,\n" +
|
||||||
// " \"createTime\": \"2019-08-06T14:01:17.839+0800\",\n" +
|
" \"createTime\": \"2019-08-06T14:01:17.839+0800\",\n" +
|
||||||
// " \"updateTime\": \"2019-08-07T14:01:17.839+0800\"\n" +
|
" \"updateTime\": \"2019-08-07T14:01:17.839+0800\"\n" +
|
||||||
// " }\n" +
|
" }\n" +
|
||||||
// " ]\n" +
|
" ]\n" +
|
||||||
// " }\n" +
|
" }\n" +
|
||||||
// "}\n";
|
"}\n";
|
||||||
jsonNode = objectMapper.readTree(regionListPageURL2);
|
jsonNode = objectMapper.readTree(regionListPageURL2);
|
||||||
regionDataList = jsonNode.path("data").path("list");
|
regionDataList = jsonNode.path("data").path("list");
|
||||||
Iterator<JsonNode> elements3 = regionDataList.elements();
|
Iterator<JsonNode> elements3 = regionDataList.elements();
|
||||||
@ -175,7 +172,6 @@ public class GetRegionInfoUtil {
|
|||||||
regionDO.setCatalogType(regionNode.path("catalogType").asInt());
|
regionDO.setCatalogType(regionNode.path("catalogType").asInt());
|
||||||
regionDO.setExternalIndexCode(regionNode.path("externalIndexCode").asText());
|
regionDO.setExternalIndexCode(regionNode.path("externalIndexCode").asText());
|
||||||
regionDO.setSort(regionNode.path("sort").asInt());
|
regionDO.setSort(regionNode.path("sort").asInt());
|
||||||
regionDO.setLeaf(regionNode.path("leaf").asInt());
|
|
||||||
System.out.println(regionNode.path("createTime").asText());
|
System.out.println(regionNode.path("createTime").asText());
|
||||||
regionDO.setCreateTime(dateParse(regionNode.path("createTime").asText()));
|
regionDO.setCreateTime(dateParse(regionNode.path("createTime").asText()));
|
||||||
regionDO.setUpdateTime(dateParse(regionNode.path("updateTime").asText()));
|
regionDO.setUpdateTime(dateParse(regionNode.path("updateTime").asText()));
|
||||||
|
@ -12,9 +12,9 @@ public class IntegrationURL {
|
|||||||
|
|
||||||
//设置平台参数,根据实际情况,设置host appKey appSecret 三个参数.
|
//设置平台参数,根据实际情况,设置host appKey appSecret 三个参数.
|
||||||
static {
|
static {
|
||||||
ArtemisConfig.host = "192.168.11.3:443"; // 平台的ip端口
|
ArtemisConfig.host = "127.0.0.1:443"; // 平台的ip端口
|
||||||
ArtemisConfig.appKey = "22116579"; // 密钥appkey
|
ArtemisConfig.appKey = "29180881"; // 密钥appkey
|
||||||
ArtemisConfig.appSecret = "AqL0EZSvZ60vzvO3Gqx9";// 密钥appSecret
|
ArtemisConfig.appSecret = "XO0wCAYGi4KV70ybjznx";// 密钥appSecret
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置OpenAPI接口的上下文
|
//设置OpenAPI接口的上下文
|
||||||
@ -29,10 +29,9 @@ public class IntegrationURL {
|
|||||||
final String previewURLsApi = ARTEMIS_PATH + "/api/resource/v1/regions/root";
|
final String previewURLsApi = ARTEMIS_PATH + "/api/resource/v1/regions/root";
|
||||||
Map<String, String> path = new HashMap<String, String>(2) {
|
Map<String, String> path = new HashMap<String, String>(2) {
|
||||||
{
|
{
|
||||||
put("http://", previewURLsApi);//根据现场环境部署确认是http还是https
|
put("https://", previewURLsApi);//根据现场环境部署确认是http还是https
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
System.out.println(path);
|
|
||||||
|
|
||||||
//设置参数提交方式
|
//设置参数提交方式
|
||||||
String contentType = "application/json";
|
String contentType = "application/json";
|
||||||
|
@ -55,8 +55,8 @@ public interface CameraService {
|
|||||||
|
|
||||||
CameraDO selectByCameraIndexCode(String cameraIndexCode);
|
CameraDO selectByCameraIndexCode(String cameraIndexCode);
|
||||||
|
|
||||||
String getPreviewUrl(String cameraIndexCode, Integer streamType, String protocol, Integer transmode, String expand, String streamform);
|
String getPreviewUrl(String cameraIndexCode);
|
||||||
String getPlayBackUrl(String cameraIndexCode, Integer recordLocation, String protocol, Integer transmode, String beginTime, String endTime, String uuid, String expand, String streamform, Integer lockType);
|
String getPlayBackUrl(String cameraIndexCode, String startTime, String endTime);
|
||||||
|
|
||||||
void updateCameraCheckByCameraIndexCode(@Valid CameraSaveReqVO cameraSaveReqVO);
|
void updateCameraCheckByCameraIndexCode(@Valid CameraSaveReqVO cameraSaveReqVO);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user