diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/app/saledata/SaleDataApi.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/app/saledata/SaleDataApi.java index dcdebcca2..aab98e525 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/app/saledata/SaleDataApi.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/app/saledata/SaleDataApi.java @@ -143,6 +143,15 @@ public class SaleDataApi { System.out.println(saleDataService.findEventsByYear(year)); 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") // public void testMethod(){ // diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/camera/CameraServiceImpl.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/camera/CameraServiceImpl.java index e3794bdab..7f6f4ff68 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/camera/CameraServiceImpl.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/camera/CameraServiceImpl.java @@ -13,6 +13,7 @@ import cn.iocoder.yudao.module.datacenter.utlis.IntegrationURL; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; @@ -37,15 +38,14 @@ public class CameraServiceImpl implements CameraService { @Resource private CameraMapper cameraMapper; - private ObjectMapper objectMapper; - @Resource - private RedisTemplate redisTemplate; + @Autowired + private RedisTemplate redisTemplate; private static final String ACCESS_TOKEN_KEY = "hikingAPI:access_token"; public String getAccessToken() { // 检查 Redis 中是否有 access_token - String accessToken = (String) redisTemplate.opsForValue().get(ACCESS_TOKEN_KEY); + String accessToken = redisTemplate.opsForValue().get(ACCESS_TOKEN_KEY); if (!StringUtils.isEmpty(accessToken)) { System.out.println("使用缓存的token:" + accessToken); return accessToken; // 如果存在则直接返回 @@ -55,10 +55,10 @@ public class CameraServiceImpl implements CameraService { System.out.println("获取新的token"); String accessTokenUrlResp = IntegrationURL.getAccessTokenURL(); try { - + ObjectMapper objectMapper = new ObjectMapper(); JsonNode jsonNode = objectMapper.readTree(accessTokenUrlResp); accessToken = jsonNode.get("access_token").asText(); - + System.out.println("cameraapi -------------accessToken:" + accessToken); // 将 access_token 存入 Redis,设置过期时间为 11 小时(有效期12小时) redisTemplate.opsForValue().set(ACCESS_TOKEN_KEY, accessToken, 11, TimeUnit.HOURS); } catch (Exception e) { @@ -75,7 +75,7 @@ public class CameraServiceImpl implements CameraService { public Boolean checkToken(String result) { try { - + ObjectMapper objectMapper = new ObjectMapper(); JsonNode jsonNode = objectMapper.readTree(result); String code = jsonNode.path("code").asText(); if ("0x02401007".equals(code)) { diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/saledata/SaleDataService.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/saledata/SaleDataService.java index e3c8b213b..4d488604d 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/saledata/SaleDataService.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/saledata/SaleDataService.java @@ -98,4 +98,6 @@ public interface SaleDataService { * @return java.math.BigDecimal */ BigDecimal findyearJun(List list); + + Integer selectSaleCountByDate(String dateParam); } \ No newline at end of file diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/saledata/SaleDataServiceImpl.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/saledata/SaleDataServiceImpl.java index 31de06628..12dc04b0a 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/saledata/SaleDataServiceImpl.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/saledata/SaleDataServiceImpl.java @@ -445,5 +445,10 @@ public class SaleDataServiceImpl implements SaleDataService { return total; } + @Override + public Integer selectSaleCountByDate(String dateParam) { + return saleDataRepository.countBySddate(dateParam); + } + } \ No newline at end of file diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/utlis/IntegrationURL.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/utlis/IntegrationURL.java index 5671fd404..a78724778 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/utlis/IntegrationURL.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/utlis/IntegrationURL.java @@ -12,9 +12,9 @@ public class IntegrationURL { //设置平台参数,根据实际情况,设置host appKey appSecret 三个参数. static { - ArtemisConfig.host = "127.0.0.1:443"; // 平台的ip端口 - ArtemisConfig.appKey = "29180881"; // 密钥appkey - ArtemisConfig.appSecret = "XO0wCAYGi4KV70ybjznx";// 密钥appSecret + ArtemisConfig.host = "192.168.11.3:443"; // 平台的ip端口 + ArtemisConfig.appKey = "22116579"; // 密钥appkey + ArtemisConfig.appSecret = "AqL0EZSvZ60vzvO3Gqx9";// 密钥appSecret } //设置OpenAPI接口的上下文 @@ -46,7 +46,7 @@ public class IntegrationURL { } //查询区域列表v2 - public static String getRegionListURL(String resourceType,int pageNo,int pageSize,String accessToken) { + 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) { //设置接口的URI地址 @@ -63,8 +63,17 @@ public class IntegrationURL { //组装请求参数 JSONObject jsonBody = new JSONObject(); jsonBody.put("resourceType",resourceType); + jsonBody.put("parentIndexCodes",parentIndexCodes); + jsonBody.put("isSubRegion",isSubRegion); jsonBody.put("pageNo", pageNo); 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(); //请求头添加 access_token认证 @@ -77,7 +86,7 @@ public class IntegrationURL { } // 根据区域编号获取下一级区域列表v2 - public static String getRegionListByParentIndexCodeURL(String parentIndexCode, String resourceType,int pageNo,int pageSize,String accessToken) { + public static String getRegionListByParentIndexCodeURL(String parentIndexCode, String resourceType,String[] authCodes, int pageNo,int pageSize, Integer cascadeFlag, String accessToken) { //设置接口的URI地址 @@ -95,8 +104,10 @@ public class IntegrationURL { JSONObject jsonBody = new JSONObject(); jsonBody.put("parentIndexCode", parentIndexCode); jsonBody.put("resourceType",resourceType); + jsonBody.put("authCodes",authCodes); jsonBody.put("pageNo", pageNo); jsonBody.put("pageSize", pageSize); + jsonBody.put("cascadeFlag",cascadeFlag); String body = jsonBody.toJSONString(); //请求头添加 access_token认证 @@ -166,7 +177,7 @@ public class IntegrationURL { } // 增量获取区域数据 - public static String getRegionTimeRangeURL(String startTime, String pageNo, String pageSize,String accessToken) { + public static String getRegionTimeRangeURL(String startTime, String endTime, String pageNo, String pageSize,String accessToken) { //设置接口的URI地址 final String previewURLsApi = ARTEMIS_PATH + "/api/resource/v1/region/timeRange"; Map path = new HashMap(2) { @@ -181,6 +192,7 @@ public class IntegrationURL { //组装请求参数 JSONObject jsonBody = new JSONObject(); jsonBody.put("startTime", startTime); + jsonBody.put("endTime", endTime); jsonBody.put("pageNo", pageNo); jsonBody.put("pageSize", pageSize); String body = jsonBody.toJSONString(); @@ -195,7 +207,7 @@ public class IntegrationURL { } //查询监控点列表v2 - public static String getCameraListURL(int pageNo,int pageSize,String accessToken) { + public static String getCameraListURL(String name, String[] regionIndexCodes, Boolean isSubRegion, int pageNo,int pageSize, String[] authCodes, Object[] expressions, String orderBy, String orderType, String accessToken) { //设置接口的URI地址 final String previewURLsApi = ARTEMIS_PATH + "/api/resource/v2/camera/search"; @@ -210,8 +222,15 @@ public class IntegrationURL { //组装请求参数 JSONObject jsonBody = new JSONObject(); + jsonBody.put("name", name); + jsonBody.put("regionIndexCodes", regionIndexCodes); + jsonBody.put("isSubRegion", isSubRegion); jsonBody.put("pageNo", pageNo); //当前页码 jsonBody.put("pageSize", pageSize); //分页大小 + jsonBody.put("authCodes", authCodes); + jsonBody.put("expressions", expressions); + jsonBody.put("orderBy", orderBy); + jsonBody.put("orderType", orderType); String body = jsonBody.toJSONString(); //请求头添加 access_token认证 @@ -312,7 +331,7 @@ public class IntegrationURL { } // 增量获取监控点数据 - public static String getCameraTimeRangeURL(String startTime, int pageNo, int pageSize, String accessToken) { + public static String getCameraTimeRangeURL(String startTime, String endTime, int pageNo, int pageSize, String accessToken) { //设置接口的URI地址 final String previewURLsApi = ARTEMIS_PATH + "/api/resource/v1/camera/timeRange"; @@ -328,6 +347,7 @@ public class IntegrationURL { //组装请求参数 JSONObject jsonBody = new JSONObject(); jsonBody.put("startTime", startTime); + jsonBody.put("endTime", endTime); jsonBody.put("pageNo", pageNo); //当前页码 jsonBody.put("pageSize", pageSize); //分页大小 String body = jsonBody.toJSONString(); diff --git a/ludu-module-hiking/ludu-module-hiking-biz/src/main/java/cn/iocoder/yudao/module/hiking/GetCameraInfoUtil.java b/ludu-module-hiking/ludu-module-hiking-biz/src/main/java/cn/iocoder/yudao/module/hiking/GetCameraInfoUtil.java index afb621b10..73840924b 100644 --- a/ludu-module-hiking/ludu-module-hiking-biz/src/main/java/cn/iocoder/yudao/module/hiking/GetCameraInfoUtil.java +++ b/ludu-module-hiking/ludu-module-hiking-biz/src/main/java/cn/iocoder/yudao/module/hiking/GetCameraInfoUtil.java @@ -45,8 +45,8 @@ public class GetCameraInfoUtil { try { ObjectMapper objectMapper = new ObjectMapper(); JsonNode jsonNode = objectMapper.readTree(accessTokenUrlResp); - accessToken = jsonNode.get("access_token").asText(); - + accessToken = jsonNode.path("data").path("access_token").asText(); + System.out.println("getCameraInfo获取到的token--------------------------------------:" + accessToken); // 将 access_token 存入 Redis,设置过期时间为 11 小时(有效期12小时) redisTemplate.opsForValue().set(ACCESS_TOKEN_KEY, accessToken, 11, TimeUnit.HOURS); } catch (Exception e) { @@ -85,73 +85,74 @@ public class GetCameraInfoUtil { JsonNode jsonNode; JsonNode cameraDataList; // 查询有几条记录 -// String cameraListPageURL = IntegrationURL.getCameraResourceURL(1, 1, getAccessToken()); -// if (!checkToken(cameraListPageURL)) { -// cameraListPageURL = IntegrationURL.getCameraResourceURL(1, 1, getAccessToken()); -// } - String cameraListPageURL = " {\n" + - " \"code\": \"0\", \n" + - " \"msg\": \"success\", \n" + - " \"data\": {\n" + - " \"total\": 13, \n" + - " \"pageNo\": 1, \n" + - " \"pageSize\": 1, \n" + - " \"list\": [\n" + - " {\n" + - " \"altitude\": null, \n" + - " \"cameraIndexCode\": \"eddf8458f74d42e9bf4ecfc752dba146\", \n" + - " \"cameraName\": \"3层吉米后厨入口\", \n" + - " \"cameraType\": 0, \n" + - " \"cameraTypeName\": \"枪机\", \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" + - " \"intelligentSet\": null, \n" + - " \"intelligentSetName\": null, \n" + - " \"channelNo\": \"33\", \n" + - " \"channelType\": \"digital\", \n" + - " \"channelTypeName\": \"数字通道\", \n" + - " \"createTime\": \"2018-09-15T11:14:27.812+08:00\", \n" + - " \"encodeDevIndexCode\": \"1d3d5c26e6174cf1aa452f57cac91879\", \n" + - " \"encodeDevResourceType\": null, \n" + - " \"encodeDevResourceTypeName\": null, \n" + - " \"gbIndexCode\": null, \n" + - " \"installLocation\": null, \n" + - " \"keyBoardCode\": null, \n" + - " \"latitude\": null, \n" + - " \"longitude\": null, \n" + - " \"pixel\": null, \n" + - " \"ptz\": null, \n" + - " \"ptzName\": null, \n" + - " \"ptzController\": null, \n" + - " \"ptzControllerName\": null, \n" + - " \"recordLocation\": null, \n" + - " \"recordLocationName\": null, \n" + - " \"regionIndexCode\": \"2feadc43-ffef-464b-a2e2-b146a02de5ba\", \n" + - " \"status\": null, \n" + - " \"statusName\": null, \n" + - " \"transType\": 1, \n" + - " \"transTypeName\": \"TCP\", \n" + - " \"treatyType\": null, \n" + - " \"treatyTypeName\": null, \n" + - " \"viewshed\": null, \n" + - " \"updateTime\": \"2018-09-15T11:19:48.973+08:00\"\n" + - " }\n" + - " ]\n" + - " }\n" + - "}\n"; + String cameraListPageURL = IntegrationURL.getCameraResourceURL(1, 1, getAccessToken()); + if (!checkToken(cameraListPageURL)) { + cameraListPageURL = IntegrationURL.getCameraResourceURL(1, 1, getAccessToken()); + } +// String cameraListPageURL = " {\n" + +// " \"code\": \"0\", \n" + +// " \"msg\": \"success\", \n" + +// " \"data\": {\n" + +// " \"total\": 13, \n" + +// " \"pageNo\": 1, \n" + +// " \"pageSize\": 1, \n" + +// " \"list\": [\n" + +// " {\n" + +// " \"altitude\": null, \n" + +// " \"cameraIndexCode\": \"eddf8458f74d42e9bf4ecfc752dba146\", \n" + +// " \"cameraName\": \"3层吉米后厨入口\", \n" + +// " \"cameraType\": 0, \n" + +// " \"cameraTypeName\": \"枪机\", \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" + +// " \"intelligentSet\": null, \n" + +// " \"intelligentSetName\": null, \n" + +// " \"channelNo\": \"33\", \n" + +// " \"channelType\": \"digital\", \n" + +// " \"channelTypeName\": \"数字通道\", \n" + +// " \"createTime\": \"2018-09-15T11:14:27.812+08:00\", \n" + +// " \"encodeDevIndexCode\": \"1d3d5c26e6174cf1aa452f57cac91879\", \n" + +// " \"encodeDevResourceType\": null, \n" + +// " \"encodeDevResourceTypeName\": null, \n" + +// " \"gbIndexCode\": null, \n" + +// " \"installLocation\": null, \n" + +// " \"keyBoardCode\": null, \n" + +// " \"latitude\": null, \n" + +// " \"longitude\": null, \n" + +// " \"pixel\": null, \n" + +// " \"ptz\": null, \n" + +// " \"ptzName\": null, \n" + +// " \"ptzController\": null, \n" + +// " \"ptzControllerName\": null, \n" + +// " \"recordLocation\": null, \n" + +// " \"recordLocationName\": null, \n" + +// " \"regionIndexCode\": \"2feadc43-ffef-464b-a2e2-b146a02de5ba\", \n" + +// " \"status\": null, \n" + +// " \"statusName\": null, \n" + +// " \"transType\": 1, \n" + +// " \"transTypeName\": \"TCP\", \n" + +// " \"treatyType\": null, \n" + +// " \"treatyTypeName\": null, \n" + +// " \"viewshed\": null, \n" + +// " \"updateTime\": \"2018-09-15T11:19:48.973+08:00\"\n" + +// " }\n" + +// " ]\n" + +// " }\n" + +// "}\n"; ObjectMapper objectMapper = new ObjectMapper(); jsonNode = objectMapper.readTree(cameraListPageURL); -// total = jsonNode.path("data").path("total").asInt(); - total = 1; + total = jsonNode.path("data").path("total").asInt(); + System.out.println("total::::::::::::::::::::::::::::::::::::::" + total); +// total = 1; JsonNode cameraNode; // 查询所有记录的cameraIndexCode并保存 for (int i = 1; i <= (total / 100) + 1; i++) { System.out.println("开始第" + i + "次查询"); -// cameraListPageURL = IntegrationURL.getCameraResourceURL(i, 100, getAccessToken()); + cameraListPageURL = IntegrationURL.getCameraResourceURL(i, 100, getAccessToken()); jsonNode = objectMapper.readTree(cameraListPageURL); cameraDataList = jsonNode.path("data").path("list"); - System.out.println(cameraDataList); + System.out.println("cameraDataList::::::::::::::::::::::::::::::::::::::" + cameraDataList); Iterator elements2 = cameraDataList.elements(); while (elements2.hasNext()) { CameraDO cameraDO = new CameraDO(); diff --git a/ludu-module-hiking/ludu-module-hiking-biz/src/main/java/cn/iocoder/yudao/module/hiking/GetRegionInfoUtil.java b/ludu-module-hiking/ludu-module-hiking-biz/src/main/java/cn/iocoder/yudao/module/hiking/GetRegionInfoUtil.java index 42bd762a3..62fc992cf 100644 --- a/ludu-module-hiking/ludu-module-hiking-biz/src/main/java/cn/iocoder/yudao/module/hiking/GetRegionInfoUtil.java +++ b/ludu-module-hiking/ludu-module-hiking-biz/src/main/java/cn/iocoder/yudao/module/hiking/GetRegionInfoUtil.java @@ -46,7 +46,8 @@ public class GetRegionInfoUtil { try { ObjectMapper objectMapper = new ObjectMapper(); JsonNode jsonNode = objectMapper.readTree(accessTokenUrlResp); - accessToken = jsonNode.get("access_token").asText(); + accessToken = jsonNode.path("data").path("access_token").asText(); + System.out.println("accessToken " + accessToken); // 将 access_token 存入 Redis,设置过期时间为 11 小时(有效期12小时) redisTemplate.opsForValue().set(ACCESS_TOKEN_KEY, accessToken, 11, TimeUnit.HOURS); @@ -80,6 +81,7 @@ public class GetRegionInfoUtil { @GetMapping("/getRegionListToDB") public void getRegionListToDB() { + System.out.println("token:" + getAccessToken()); try { // 总记录数 int total = 0; @@ -91,35 +93,36 @@ public class GetRegionInfoUtil { JsonNode jsonNode; JsonNode regionDataList; // 查询有几条记录 -// String regionListPageURL = IntegrationURL.getRegionListPageURL(1, 1, getAccessToken()); - String regionListPageURL = "{\n" + - " \"code\": \"0\",\n" + - " \"msg\": \"SUCCESS\",\n" + - " \"data\": {\n" + - " \"total\": 18,\n" + - " \"pageNo\": 2,\n" + - " \"pageSize\": 3,\n" + - " \"list\": [\n" + - " {\n" + - " \"indexCode\": \"root000000\",\n" + - " \"name\": \"根节点\",\n" + - " \"parentIndexCode\": \"null\",\n" + - " \"treeCode\": \"0\"\n" + - " }\n" + - " ]\n" + - " }\n" + - "}\n"; -// if (!checkToken(regionListPageURL)) { -// regionListPageURL = IntegrationURL.getRegionListPageURL(1, 1, getAccessToken()); -// } + String regionListPageURL = IntegrationURL.getRegionListPageURL(1, 1, getAccessToken()); +// String regionListPageURL = "{\n" + +// " \"code\": \"0\",\n" + +// " \"msg\": \"SUCCESS\",\n" + +// " \"data\": {\n" + +// " \"total\": 18,\n" + +// " \"pageNo\": 2,\n" + +// " \"pageSize\": 3,\n" + +// " \"list\": [\n" + +// " {\n" + +// " \"indexCode\": \"root000000\",\n" + +// " \"name\": \"根节点\",\n" + +// " \"parentIndexCode\": \"null\",\n" + +// " \"treeCode\": \"0\"\n" + +// " }\n" + +// " ]\n" + +// " }\n" + +// "}\n"; + if (!checkToken(regionListPageURL)) { + regionListPageURL = IntegrationURL.getRegionListPageURL(1, 1, getAccessToken()); + } ObjectMapper objectMapper = new ObjectMapper(); jsonNode = objectMapper.readTree(regionListPageURL); total = jsonNode.path("data").path("total").asInt(); - + System.out.println("共" + total + "条数据"); // 查询所有记录的indexCode并保存 indexCodes = new String[100]; 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(); jsonNode = objectMapper2.readTree(regionListPageURL); regionDataList = jsonNode.path("data").path("list"); @@ -131,32 +134,32 @@ public class GetRegionInfoUtil { } // 保存后使用indexCodes数组查询区域详细信息 -// String regionListPageURL2 = IntegrationURL.getRegionByIndexCodesURL(indexCodes, getAccessToken()); - String regionListPageURL2 = "{\n" + - " \"code\": \"0\",\n" + - " \"msg\": \"SUCCESS\",\n" + - " \"data\": {\n" + - " \"total\": 1,\n" + - " \"list\": [\n" + - " {\n" + - " \"indexCode\": \"root000000\",\n" + - " \"name\": \"根节点123123123123\",\n" + - " \"regionPath\": \"@root000000@\",\n" + - " \"parentIndexCode\": \"-1\",\n" + - " \"available\": true,\n" + - " \"leaf\": false,\n" + - " \"cascadeCode\": \"0\",\n" + - " \"cascadeType\": 0,\n" + - " \"catalogType\": 10,\n" + - " \"externalIndexCode\": \"34\",\n" + - " \"parentExternalIndexCode\": \"34\",\n" + - " \"sort\": 1,\n" + - " \"createTime\": \"2019-08-06T14:01:17.839+0800\",\n" + - " \"updateTime\": \"2019-08-07T14:01:17.839+0800\"\n" + - " }\n" + - " ]\n" + - " }\n" + - "}\n"; + String regionListPageURL2 = IntegrationURL.getRegionByIndexCodesURL(indexCodes, getAccessToken()); +// String regionListPageURL2 = "{\n" + +// " \"code\": \"0\",\n" + +// " \"msg\": \"SUCCESS\",\n" + +// " \"data\": {\n" + +// " \"total\": 1,\n" + +// " \"list\": [\n" + +// " {\n" + +// " \"indexCode\": \"root000000\",\n" + +// " \"name\": \"根节点123123123123\",\n" + +// " \"regionPath\": \"@root000000@\",\n" + +// " \"parentIndexCode\": \"-1\",\n" + +// " \"available\": true,\n" + +// " \"leaf\": false,\n" + +// " \"cascadeCode\": \"0\",\n" + +// " \"cascadeType\": 0,\n" + +// " \"catalogType\": 10,\n" + +// " \"externalIndexCode\": \"34\",\n" + +// " \"parentExternalIndexCode\": \"34\",\n" + +// " \"sort\": 1,\n" + +// " \"createTime\": \"2019-08-06T14:01:17.839+0800\",\n" + +// " \"updateTime\": \"2019-08-07T14:01:17.839+0800\"\n" + +// " }\n" + +// " ]\n" + +// " }\n" + +// "}\n"; jsonNode = objectMapper.readTree(regionListPageURL2); regionDataList = jsonNode.path("data").path("list"); Iterator elements3 = regionDataList.elements(); @@ -172,6 +175,7 @@ public class GetRegionInfoUtil { regionDO.setCatalogType(regionNode.path("catalogType").asInt()); regionDO.setExternalIndexCode(regionNode.path("externalIndexCode").asText()); regionDO.setSort(regionNode.path("sort").asInt()); + regionDO.setLeaf(regionNode.path("leaf").asInt()); System.out.println(regionNode.path("createTime").asText()); regionDO.setCreateTime(dateParse(regionNode.path("createTime").asText())); regionDO.setUpdateTime(dateParse(regionNode.path("updateTime").asText())); diff --git a/ludu-module-hiking/ludu-module-hiking-biz/src/main/java/cn/iocoder/yudao/module/hiking/IntegrationURL.java b/ludu-module-hiking/ludu-module-hiking-biz/src/main/java/cn/iocoder/yudao/module/hiking/IntegrationURL.java index 790bb0291..aa4ba38a2 100644 --- a/ludu-module-hiking/ludu-module-hiking-biz/src/main/java/cn/iocoder/yudao/module/hiking/IntegrationURL.java +++ b/ludu-module-hiking/ludu-module-hiking-biz/src/main/java/cn/iocoder/yudao/module/hiking/IntegrationURL.java @@ -12,9 +12,9 @@ public class IntegrationURL { //设置平台参数,根据实际情况,设置host appKey appSecret 三个参数. static { - ArtemisConfig.host = "127.0.0.1:443"; // 平台的ip端口 - ArtemisConfig.appKey = "29180881"; // 密钥appkey - ArtemisConfig.appSecret = "XO0wCAYGi4KV70ybjznx";// 密钥appSecret + ArtemisConfig.host = "192.168.11.3:443"; // 平台的ip端口 + ArtemisConfig.appKey = "22116579"; // 密钥appkey + ArtemisConfig.appSecret = "AqL0EZSvZ60vzvO3Gqx9";// 密钥appSecret } //设置OpenAPI接口的上下文 @@ -29,9 +29,10 @@ public class IntegrationURL { final String previewURLsApi = ARTEMIS_PATH + "/api/resource/v1/regions/root"; Map path = new HashMap(2) { { - put("https://", previewURLsApi);//根据现场环境部署确认是http还是https + put("http://", previewURLsApi);//根据现场环境部署确认是http还是https } }; + System.out.println(path); //设置参数提交方式 String contentType = "application/json"; diff --git a/ludu-module-hiking/ludu-module-hiking-biz/src/main/java/cn/iocoder/yudao/module/hiking/service/camera/CameraService.java b/ludu-module-hiking/ludu-module-hiking-biz/src/main/java/cn/iocoder/yudao/module/hiking/service/camera/CameraService.java index ad838cd34..b20b15a58 100644 --- a/ludu-module-hiking/ludu-module-hiking-biz/src/main/java/cn/iocoder/yudao/module/hiking/service/camera/CameraService.java +++ b/ludu-module-hiking/ludu-module-hiking-biz/src/main/java/cn/iocoder/yudao/module/hiking/service/camera/CameraService.java @@ -55,8 +55,8 @@ public interface CameraService { CameraDO selectByCameraIndexCode(String cameraIndexCode); - String getPreviewUrl(String cameraIndexCode); - String getPlayBackUrl(String cameraIndexCode, String startTime, String endTime); + String getPreviewUrl(String cameraIndexCode, Integer streamType, String protocol, Integer transmode, String expand, String streamform); + String getPlayBackUrl(String cameraIndexCode, Integer recordLocation, String protocol, Integer transmode, String beginTime, String endTime, String uuid, String expand, String streamform, Integer lockType); void updateCameraCheckByCameraIndexCode(@Valid CameraSaveReqVO cameraSaveReqVO);