人员定位系统对接开发
正在显示
15 个修改的文件
包含
492 行增加
和
9 行删除
1 | package com.skua.modules.location; | ||
2 | |||
3 | import com.skua.core.context.SpringContextUtils; | ||
4 | import com.skua.modules.location.service.ILocationService; | ||
5 | |||
6 | public class UserLocationFactory { | ||
7 | |||
8 | public UserLocationFactory() { | ||
9 | } | ||
10 | |||
11 | public static ILocationService getLocationService(String locationType) { | ||
12 | ILocationService locationService = null; | ||
13 | if (locationType.equals("BKYH")) { | ||
14 | locationService = (ILocationService) SpringContextUtils.getBean("BkyhLocationService"); | ||
15 | } else if (locationType.equals("YW")) { | ||
16 | locationService = (ILocationService)SpringContextUtils.getBean("YwLocationService"); | ||
17 | } | ||
18 | return locationService; | ||
19 | } | ||
20 | } |
fm-product/src/main/java/com/skua/modules/location/controller/UserLocationController.java
0 → 100644
1 | package com.skua.modules.location.controller; | ||
2 | |||
3 | import com.skua.core.api.vo.Result; | ||
4 | import com.skua.core.aspect.annotation.AutoLog; | ||
5 | import com.skua.modules.location.UserLocationFactory; | ||
6 | import com.skua.modules.location.entity.UserLocation; | ||
7 | import com.skua.modules.location.service.ILocationService; | ||
8 | import io.swagger.annotations.Api; | ||
9 | import io.swagger.annotations.ApiOperation; | ||
10 | import lombok.extern.slf4j.Slf4j; | ||
11 | import org.springframework.web.bind.annotation.GetMapping; | ||
12 | import org.springframework.web.bind.annotation.RequestMapping; | ||
13 | import org.springframework.web.bind.annotation.RestController; | ||
14 | |||
15 | import java.util.ArrayList; | ||
16 | import java.util.List; | ||
17 | |||
18 | @Slf4j | ||
19 | @Api(tags="人员定位系统对接") | ||
20 | @RestController | ||
21 | @RequestMapping("/userLocation") | ||
22 | public class UserLocationController { | ||
23 | |||
24 | //*****************************************义乌人员定位**********************************************// | ||
25 | @AutoLog(value = "义乌人员定位-获取所有人员实时定位数据") | ||
26 | @ApiOperation(value="义乌人员定位-获取所有人员实时定位数据", notes="义乌人员定位-获取所有人员实时定位数据") | ||
27 | @GetMapping(value = "/getAllUserGPS") | ||
28 | public Result<List<UserLocation>> getAllUserGPS() { | ||
29 | Result<List<UserLocation>> result = new Result<List<UserLocation>>(); | ||
30 | List<UserLocation> list = new ArrayList<>(); | ||
31 | ILocationService locationService = UserLocationFactory.getLocationService("YW"); | ||
32 | list = locationService.getAllUserGPS(); | ||
33 | result.setResult(list); | ||
34 | result.setSuccess(true); | ||
35 | return result; | ||
36 | } | ||
37 | |||
38 | @AutoLog(value = "义乌人员定位-获取人员历史轨迹") | ||
39 | @ApiOperation(value="义乌人员定位-获取人员历史轨迹", notes="义乌人员定位-获取人员历史轨迹") | ||
40 | @GetMapping(value = "/getUserHistory") | ||
41 | public Result<List<UserLocation>> getUserHistory(String deviceCode,String startTime,String endTime) { | ||
42 | Result<List<UserLocation>> result = new Result<List<UserLocation>>(); | ||
43 | List<UserLocation> list = new ArrayList<>(); | ||
44 | ILocationService locationService = UserLocationFactory.getLocationService("YW"); | ||
45 | list = locationService.getUserHistory(deviceCode, startTime, endTime); | ||
46 | result.setResult(list); | ||
47 | result.setSuccess(true); | ||
48 | return result; | ||
49 | } | ||
50 | //***********************************************************************************************// | ||
51 | } |
1 | package com.skua.modules.location.entity; | ||
2 | |||
3 | import lombok.Data; | ||
4 | |||
5 | /** | ||
6 | * 人员定位数据 | ||
7 | */ | ||
8 | @Data | ||
9 | public class UserLocation { | ||
10 | |||
11 | /**设备编码*/ | ||
12 | private String deviceCode; | ||
13 | /**人员名称*/ | ||
14 | private String userName; | ||
15 | /**X坐标*/ | ||
16 | private Double x; | ||
17 | /**Y坐标*/ | ||
18 | private Double y; | ||
19 | /**楼层*/ | ||
20 | private String floor; | ||
21 | /**时间*/ | ||
22 | private String dateTime; | ||
23 | |||
24 | } |
fm-product/src/main/java/com/skua/modules/location/entity/UserLocationHistoryYwResult.java
0 → 100644
1 | package com.skua.modules.location.entity; | ||
2 | |||
3 | import lombok.Data; | ||
4 | |||
5 | /** | ||
6 | * 人员定位数据 | ||
7 | */ | ||
8 | @Data | ||
9 | public class UserLocationHistoryYwResult { | ||
10 | |||
11 | /**人员名称*/ | ||
12 | private String name; | ||
13 | /**X坐标*/ | ||
14 | private String x; | ||
15 | /**Y坐标*/ | ||
16 | private String y; | ||
17 | /**经度*/ | ||
18 | private Double lon; | ||
19 | /**纬度*/ | ||
20 | private Double lat; | ||
21 | /**时间*/ | ||
22 | private String time; | ||
23 | |||
24 | } |
1 | package com.skua.modules.location.entity; | ||
2 | |||
3 | import lombok.Data; | ||
4 | |||
5 | /** | ||
6 | * 人员定位数据 | ||
7 | */ | ||
8 | @Data | ||
9 | public class UserLocationYwResult { | ||
10 | |||
11 | /**设备编码*/ | ||
12 | private String deviceNo; | ||
13 | /**人员名称*/ | ||
14 | private String empName; | ||
15 | /**员工工号*/ | ||
16 | private String empNo; | ||
17 | /**X坐标*/ | ||
18 | private Double crossX; | ||
19 | /**Y坐标*/ | ||
20 | private Double crossY; | ||
21 | /**经度*/ | ||
22 | private Double longitude; | ||
23 | /**纬度*/ | ||
24 | private Double latitude; | ||
25 | /**楼层*/ | ||
26 | private String layer; | ||
27 | /**时间*/ | ||
28 | private String dateTime; | ||
29 | /**区域*/ | ||
30 | private String area; | ||
31 | /**人员卡类型 0:员工,1:访客,2:承包商,3:物品,4:车辆,5:司机*/ | ||
32 | private String specifictype; | ||
33 | |||
34 | } |
1 | package com.skua.modules.location.service; | ||
2 | |||
3 | import com.skua.modules.location.entity.UserLocation; | ||
4 | |||
5 | import java.util.List; | ||
6 | |||
7 | public interface ILocationService { | ||
8 | |||
9 | List<UserLocation> getAllUserGPS(); | ||
10 | |||
11 | List<UserLocation> getUserHistory(String deviceCode, String startTime, String endTime); | ||
12 | } |
fm-product/src/main/java/com/skua/modules/location/service/impl/BkyhLocationServiceImpl.java
0 → 100644
1 | package com.skua.modules.location.service.impl; | ||
2 | |||
3 | import com.skua.modules.location.entity.UserLocation; | ||
4 | import com.skua.modules.location.service.ILocationService; | ||
5 | import org.springframework.stereotype.Service; | ||
6 | |||
7 | import java.util.ArrayList; | ||
8 | import java.util.HashMap; | ||
9 | import java.util.List; | ||
10 | import java.util.Map; | ||
11 | |||
12 | @Service("BkyhLocationService") | ||
13 | public class BkyhLocationServiceImpl implements ILocationService { | ||
14 | |||
15 | //**********************联通坐标*************************** | ||
16 | private static final Double DW_B1_X = 42.8238;//定位系统B1层X坐标 | ||
17 | private static final Double DW_B1_Y = 325.8339;//定位系统B1层Y坐标 | ||
18 | private static final Double DW_B2_X = 22.4297;//定位系统B2层X坐标 | ||
19 | private static final Double DW_B2_Y = 330.5528;//定位系统B2层Y坐标 | ||
20 | |||
21 | //**********************三维坐标*************************** | ||
22 | private static final Double SW_B1_X = -9850.00;//三维B1层X坐标 | ||
23 | private static final Double SW_B1_Y = -7400.00;//三维B1层Y坐标 | ||
24 | private static final Double SW_B2_X = -9850.00;//三维B2层X坐标 | ||
25 | private static final Double SW_B2_Y = -7430.00;//三维B2层Y坐标 | ||
26 | |||
27 | //**********************比例尺*************************** | ||
28 | private static final Double BLC_X = 43.7;//X比例尺 | ||
29 | private static final Double BLC_Y = 43.58;//Y比例尺 | ||
30 | //**********************旋转角度*************************** | ||
31 | private static final Double XZJD = 64.7989;//旋转角度 | ||
32 | |||
33 | private static final Map<String, Double> locationBasicInfo = new HashMap<>(); | ||
34 | |||
35 | /** | ||
36 | * 坐标转换基础信息 | ||
37 | */ | ||
38 | public void getLocationBasicInfo() { | ||
39 | locationBasicInfo.put("DW_B1_X",DW_B1_X); | ||
40 | locationBasicInfo.put("DW_B1_Y",DW_B1_Y); | ||
41 | locationBasicInfo.put("DW_B2_X",DW_B2_X); | ||
42 | locationBasicInfo.put("DW_B2_Y",DW_B2_Y); | ||
43 | locationBasicInfo.put("SW_B1_X",SW_B1_X); | ||
44 | locationBasicInfo.put("SW_B1_Y",SW_B1_Y); | ||
45 | locationBasicInfo.put("SW_B2_X",SW_B2_X); | ||
46 | locationBasicInfo.put("SW_B2_Y",SW_B2_Y); | ||
47 | locationBasicInfo.put("BLC_X",BLC_X); | ||
48 | locationBasicInfo.put("BLC_Y",BLC_Y); | ||
49 | locationBasicInfo.put("XZJD",XZJD); | ||
50 | } | ||
51 | |||
52 | @Override | ||
53 | public List<UserLocation> getAllUserGPS() { | ||
54 | List<UserLocation> list = new ArrayList<>(); | ||
55 | return list; | ||
56 | } | ||
57 | |||
58 | @Override | ||
59 | public List<UserLocation> getUserHistory(String deviceCode, String startTime, String endTime) { | ||
60 | List<UserLocation> list = new ArrayList<>(); | ||
61 | return list; | ||
62 | } | ||
63 | |||
64 | |||
65 | } |
fm-product/src/main/java/com/skua/modules/location/service/impl/YwLocationServiceImpl.java
0 → 100644
1 | package com.skua.modules.location.service.impl; | ||
2 | |||
3 | import com.alibaba.fastjson.JSONObject; | ||
4 | import com.skua.modules.location.entity.UserLocation; | ||
5 | import com.skua.modules.location.entity.UserLocationYwResult; | ||
6 | import com.skua.modules.location.entity.UserLocationHistoryYwResult; | ||
7 | import com.skua.modules.location.service.ILocationService; | ||
8 | import com.skua.modules.location.util.ChangeLocationUtils; | ||
9 | import org.springframework.stereotype.Service; | ||
10 | |||
11 | import java.util.ArrayList; | ||
12 | import java.util.HashMap; | ||
13 | import java.util.List; | ||
14 | import java.util.Map; | ||
15 | |||
16 | @Service("YwLocationService") | ||
17 | public class YwLocationServiceImpl implements ILocationService { | ||
18 | |||
19 | private static final String username = "admin";//人员定位账号 | ||
20 | private static final String password = "admin";//人员定位密码 | ||
21 | |||
22 | //**********************联通坐标*************************** | ||
23 | private static final Double DW_B1_X = 42.8238;//定位系统B1层X坐标 | ||
24 | private static final Double DW_B1_Y = 325.8339;//定位系统B1层Y坐标 | ||
25 | private static final Double DW_B2_X = 22.4297;//定位系统B2层X坐标 | ||
26 | private static final Double DW_B2_Y = 330.5528;//定位系统B2层Y坐标 | ||
27 | |||
28 | //**********************三维坐标*************************** | ||
29 | private static final Double SW_B1_X = -9850.00;//三维B1层X坐标 | ||
30 | private static final Double SW_B1_Y = -7400.00;//三维B1层Y坐标 | ||
31 | private static final Double SW_B2_X = -9850.00;//三维B2层X坐标 | ||
32 | private static final Double SW_B2_Y = -7430.00;//三维B2层Y坐标 | ||
33 | |||
34 | //**********************比例尺*************************** | ||
35 | private static final Double BLC_X = 43.7;//X比例尺 | ||
36 | private static final Double BLC_Y = 43.58;//Y比例尺 | ||
37 | //**********************旋转角度*************************** | ||
38 | private static final Double XZJD = 34.7989;//旋转角度 | ||
39 | |||
40 | private static final Map<String, Double> locationBasicInfo = new HashMap<>(); | ||
41 | |||
42 | /** | ||
43 | * 坐标转换基础信息 | ||
44 | */ | ||
45 | public void getLocationBasicInfo() { | ||
46 | locationBasicInfo.put("DW_B1_X",DW_B1_X); | ||
47 | locationBasicInfo.put("DW_B1_Y",DW_B1_Y); | ||
48 | locationBasicInfo.put("DW_B2_X",DW_B2_X); | ||
49 | locationBasicInfo.put("DW_B2_Y",DW_B2_Y); | ||
50 | locationBasicInfo.put("SW_B1_X",SW_B1_X); | ||
51 | locationBasicInfo.put("SW_B1_Y",SW_B1_Y); | ||
52 | locationBasicInfo.put("SW_B2_X",SW_B2_X); | ||
53 | locationBasicInfo.put("SW_B2_Y",SW_B2_Y); | ||
54 | locationBasicInfo.put("BLC_X",BLC_X); | ||
55 | locationBasicInfo.put("BLC_Y",BLC_Y); | ||
56 | locationBasicInfo.put("XZJD",XZJD); | ||
57 | } | ||
58 | |||
59 | @Override | ||
60 | public List<UserLocation> getAllUserGPS() { | ||
61 | List<UserLocation> list = new ArrayList<>(); | ||
62 | String get = "{\n" + | ||
63 | "\"data\":\n" + | ||
64 | "[{\n" + | ||
65 | "\"empName\":\"张小凡\",\n" + | ||
66 | "\"area\":\"2\",\n" + | ||
67 | "\"deviceNo\":\"f1843311\",\n" + | ||
68 | "\"crossY\":\"1100\",\n" + | ||
69 | "\"crossX\":\"2670\",\n" + | ||
70 | "\"longitude\":104.04438600000114,\n" + | ||
71 | "\"latitude\":30.630693000000115,\n" + | ||
72 | "\"dateTime\":\"2019-05-05 11:35:52\",\n" + | ||
73 | "\"layer\":\"1\",\n" + | ||
74 | "\"empNo\":\"12123\",\n" + | ||
75 | "\"specifictype\":\"0\"\n" + | ||
76 | "},\n" + | ||
77 | "{\n" + | ||
78 | "\"empName\":\"张大凡\",\n" + | ||
79 | "\"area\":\"2\",\n" + | ||
80 | "\"deviceNo\":\"f1843310\",\n" + | ||
81 | "\"crossY\":\"1111\",\n" + | ||
82 | "\"crossX\":\"2666\",\n" + | ||
83 | "\"longitude\":124.04438600000114,\n" + | ||
84 | "\"latitude\":31.630693000000115,\n" + | ||
85 | "\"dateTime\":\"2019-05-05 11:35:52\",\n" + | ||
86 | "\"layer\":\"1\",\n" + | ||
87 | "\"empNo\":\"12121\",\n" + | ||
88 | "\"specifictype\":\"0\"\n" + | ||
89 | "}],\n" + | ||
90 | "\"status\":0,\n" + | ||
91 | "\"msginfo\":\"接口调用成功!\"\n" + | ||
92 | "}"; | ||
93 | JSONObject json = JSONObject.parseObject(get); | ||
94 | List<UserLocationYwResult> getList = JSONObject.parseArray(json.get("data").toString(), UserLocationYwResult.class); | ||
95 | getLocationBasicInfo();//坐标转换基础信息 | ||
96 | for (UserLocationYwResult userLocationYwResult : getList) { | ||
97 | UserLocation userLocation = new UserLocation(); | ||
98 | userLocation.setFloor(userLocationYwResult.getLayer()); | ||
99 | userLocation.setDeviceCode(userLocationYwResult.getDeviceNo()); | ||
100 | userLocation.setUserName(userLocationYwResult.getEmpName()); | ||
101 | Map<String,Object> map = ChangeLocationUtils.changeUserLocation(userLocationYwResult.getLayer(), String.valueOf(userLocationYwResult.getCrossX()), | ||
102 | String.valueOf(userLocationYwResult.getCrossY()), locationBasicInfo); | ||
103 | userLocation.setX(Double.valueOf(map.get("x").toString())); | ||
104 | userLocation.setY(Double.valueOf(map.get("y").toString())); | ||
105 | userLocation.setDateTime(userLocationYwResult.getDateTime()); | ||
106 | list.add(userLocation); | ||
107 | } | ||
108 | return list; | ||
109 | } | ||
110 | |||
111 | @Override | ||
112 | public List<UserLocation> getUserHistory(String deviceCode, String startTime, String endTime) { | ||
113 | List<UserLocation> list = new ArrayList<>(); | ||
114 | String get = "{\n" + | ||
115 | "\"data\":[\n" + | ||
116 | "{\n" + | ||
117 | "\"name\":\"何小龙\",\n" + | ||
118 | "\"time\":\"2020-04-20 00:02:35\",\n" + | ||
119 | "\"x\":\"3539.05\",\n" + | ||
120 | "\"y\":\"2711.93\",\n" + | ||
121 | "\"lat\":32.54224453987491,\n" + | ||
122 | "\"lon\":121.05223514735032\n" + | ||
123 | "},\n" + | ||
124 | "{\n" + | ||
125 | "\"name\":\"何小龙\",\n" + | ||
126 | "\"time\":\"2020-04-20 00:02:45\",\n" + | ||
127 | "\"x\":\"3536.05\",\n" + | ||
128 | "\"y\":\"2611.93\",\n" + | ||
129 | "\"lat\":32.54212353987491,\n" + | ||
130 | "\"lon\":121.05123514735032\n" + | ||
131 | "}\n" + | ||
132 | "],\n" + | ||
133 | "\"msginfo\":\"成功!\",\n" + | ||
134 | "\"status\":0\n" + | ||
135 | "}"; | ||
136 | JSONObject json = JSONObject.parseObject(get); | ||
137 | List<UserLocationHistoryYwResult> getList = JSONObject.parseArray(json.get("data").toString(), UserLocationHistoryYwResult.class); | ||
138 | getLocationBasicInfo();//坐标转换基础信息 | ||
139 | for (UserLocationHistoryYwResult userLocationHistoryYwResult : getList) { | ||
140 | UserLocation userLocation = new UserLocation(); | ||
141 | userLocation.setUserName(userLocationHistoryYwResult.getName()); | ||
142 | Map<String,Object> map = ChangeLocationUtils.changeUserLocation("", String.valueOf(userLocationHistoryYwResult.getX()), | ||
143 | String.valueOf(userLocationHistoryYwResult.getY()), locationBasicInfo); | ||
144 | userLocation.setX(Double.valueOf(map.get("x").toString())); | ||
145 | userLocation.setY(Double.valueOf(map.get("y").toString())); | ||
146 | userLocation.setDateTime(userLocationHistoryYwResult.getTime()); | ||
147 | list.add(userLocation); | ||
148 | } | ||
149 | return list; | ||
150 | } | ||
151 | } |
1 | package com.skua.modules.location.util; | ||
2 | |||
3 | import java.util.*; | ||
4 | |||
5 | public class ChangeLocationUtils{ | ||
6 | |||
7 | /** | ||
8 | * 转换坐标 | ||
9 | * @param floor 楼层 | ||
10 | * @param x1 X坐标 | ||
11 | * @param y1 Y坐标 | ||
12 | * @param locationBasicInfo 基础信息 | ||
13 | * @return | ||
14 | */ | ||
15 | public static Map<String,Object> changeUserLocation(String floor, String x1, String y1, Map<String, Double> locationBasicInfo) { | ||
16 | |||
17 | double DW_B1_X = locationBasicInfo.get("DW_B1_X");//定位系统B1层X坐标 | ||
18 | double DW_B1_Y = locationBasicInfo.get("DW_B1_Y");//定位系统B1层Y坐标 | ||
19 | double DW_B2_X = locationBasicInfo.get("DW_B2_X");//定位系统B2层X坐标 | ||
20 | double DW_B2_Y = locationBasicInfo.get("DW_B2_Y");//定位系统B2层Y坐标 | ||
21 | double SW_B1_X = locationBasicInfo.get("SW_B1_X");//三维B1层X坐标 | ||
22 | double SW_B1_Y = locationBasicInfo.get("SW_B1_Y");//三维B1层Y坐标 | ||
23 | double SW_B2_X = locationBasicInfo.get("SW_B2_X");//三维B2层X坐标 | ||
24 | double SW_B2_Y = locationBasicInfo.get("SW_B2_Y");//三维B2层Y坐标 | ||
25 | double BLC_X = locationBasicInfo.get("BLC_X");//X比例尺 | ||
26 | double BLC_Y = locationBasicInfo.get("BLC_Y");//Y比例尺 | ||
27 | double XZJD = locationBasicInfo.get("XZJD");//旋转角度 | ||
28 | |||
29 | Map<String,Object> map = new HashMap<>();//初始化 | ||
30 | map.put("x", 0.00); | ||
31 | map.put("y", 0.00); | ||
32 | double py_x = 0.00; | ||
33 | double py_y = 0.00; | ||
34 | double sin = Math.sin(XZJD); | ||
35 | double cos = Math.cos(XZJD); | ||
36 | if("B2".equals(floor)){ | ||
37 | //平移到原点 | ||
38 | double x0 = Double.valueOf(x1) - DW_B2_X; | ||
39 | double y0 = Double.valueOf(y1) - DW_B2_Y; | ||
40 | //旋转坐标 | ||
41 | double x = x0*sin + y0*cos; | ||
42 | double y = y0*sin - x0*cos; | ||
43 | //平移后的坐标 | ||
44 | py_x = x + SW_B2_X / BLC_X; | ||
45 | py_y = y + SW_B2_Y / BLC_Y; | ||
46 | }else if("B1".equals(floor)){ | ||
47 | //平移到原点 | ||
48 | double x0 = Double.valueOf(x1) - DW_B1_X; | ||
49 | double y0 = Double.valueOf(y1) - DW_B1_Y; | ||
50 | //旋转坐标 | ||
51 | double x = x0*sin + y0*cos; | ||
52 | double y = y0*sin - x0*cos; | ||
53 | //平移后的坐标 | ||
54 | py_x = x + SW_B1_X / BLC_X; | ||
55 | py_y = y + SW_B1_Y / BLC_Y; | ||
56 | }else{//位置跟B1相同 | ||
57 | //平移到原点 | ||
58 | double x0 = Double.valueOf(x1) - DW_B1_X; | ||
59 | double y0 = Double.valueOf(y1) - DW_B1_Y; | ||
60 | //旋转坐标 | ||
61 | double x = x0*sin + y0*cos; | ||
62 | double y = y0*sin - x0*cos; | ||
63 | //平移后的坐标 | ||
64 | py_x = x + SW_B1_X / BLC_X; | ||
65 | py_y = y + SW_B1_Y / BLC_Y; | ||
66 | } | ||
67 | //放大后的坐标 | ||
68 | double fd_x = BLC_X * py_x; | ||
69 | double fd_y = BLC_Y * py_y; | ||
70 | map.put("x",fd_x); | ||
71 | map.put("y",fd_y); | ||
72 | return map; | ||
73 | } | ||
74 | |||
75 | |||
76 | } |
... | @@ -2,7 +2,9 @@ package com.skua.modules.video.controller; | ... | @@ -2,7 +2,9 @@ package com.skua.modules.video.controller; |
2 | 2 | ||
3 | import com.skua.core.api.vo.Result; | 3 | import com.skua.core.api.vo.Result; |
4 | import com.skua.core.aspect.annotation.AutoLog; | 4 | import com.skua.core.aspect.annotation.AutoLog; |
5 | import com.skua.modules.video.entity.CameraInfo; | ||
5 | import com.skua.modules.video.service.ITVideoService; | 6 | import com.skua.modules.video.service.ITVideoService; |
7 | import com.skua.modules.video.service.VideoSteamService; | ||
6 | import com.skua.modules.video.vo.VideoIntegrateVO; | 8 | import com.skua.modules.video.vo.VideoIntegrateVO; |
7 | import io.swagger.annotations.Api; | 9 | import io.swagger.annotations.Api; |
8 | import io.swagger.annotations.ApiOperation; | 10 | import io.swagger.annotations.ApiOperation; |
... | @@ -24,6 +26,8 @@ public class VideoIntegrateController { | ... | @@ -24,6 +26,8 @@ public class VideoIntegrateController { |
24 | 26 | ||
25 | @Autowired | 27 | @Autowired |
26 | private ITVideoService itVideoService; | 28 | private ITVideoService itVideoService; |
29 | @Autowired | ||
30 | private VideoSteamService videoSteamService; | ||
27 | 31 | ||
28 | /** | 32 | /** |
29 | * 获取三方视频连接配置数据 | 33 | * 获取三方视频连接配置数据 |
... | @@ -69,4 +73,20 @@ public class VideoIntegrateController { | ... | @@ -69,4 +73,20 @@ public class VideoIntegrateController { |
69 | result.setResult(rtsp); | 73 | result.setResult(rtsp); |
70 | return result; | 74 | return result; |
71 | } | 75 | } |
76 | |||
77 | @AutoLog(value = "获取Flv视频流") | ||
78 | @ApiOperation(value="获取Flv视频流", notes="获取Flv视频流") | ||
79 | @GetMapping(value = "/getFlv") | ||
80 | public Result<String> getFlv(String cameraIndexCode) { | ||
81 | Result<String> result = new Result<>(); | ||
82 | try { | ||
83 | String rtsp = itVideoService.getRtsp(cameraIndexCode); | ||
84 | CameraInfo openCamera = videoSteamService.openCamera(rtsp, cameraIndexCode); | ||
85 | result.setSuccess(true); | ||
86 | result.setResult(openCamera.getFlv()); | ||
87 | } catch (Exception e) { | ||
88 | result.error500("获取视频流失败"); | ||
89 | } | ||
90 | return result; | ||
91 | } | ||
72 | } | 92 | } | ... | ... |
... | @@ -5,6 +5,7 @@ import java.util.Map; | ... | @@ -5,6 +5,7 @@ import java.util.Map; |
5 | import java.util.concurrent.ExecutionException; | 5 | import java.util.concurrent.ExecutionException; |
6 | 6 | ||
7 | public interface VideoSteamService { | 7 | public interface VideoSteamService { |
8 | |||
8 | CameraInfo openCamera(String rtsp, String token) throws ExecutionException, InterruptedException; | 9 | CameraInfo openCamera(String rtsp, String token) throws ExecutionException, InterruptedException; |
9 | 10 | ||
10 | String closeCamera(String token); | 11 | String closeCamera(String token); | ... | ... |
... | @@ -84,6 +84,7 @@ public class ShiroConfig { | ... | @@ -84,6 +84,7 @@ public class ShiroConfig { |
84 | 84 | ||
85 | //鸣启3D接口 | 85 | //鸣启3D接口 |
86 | filterChainDefinitionMap.put("/3d/**", "anon"); | 86 | filterChainDefinitionMap.put("/3d/**", "anon"); |
87 | filterChainDefinitionMap.put("/userLocation/**", "anon"); | ||
87 | //暂时放开表维护的shiro权限 | 88 | //暂时放开表维护的shiro权限 |
88 | filterChainDefinitionMap.put("/v1/expert/expertInitConfig/**", "anon"); | 89 | filterChainDefinitionMap.put("/v1/expert/expertInitConfig/**", "anon"); |
89 | filterChainDefinitionMap.put("/sys/sysGeneralProcess/**", "anon"); | 90 | filterChainDefinitionMap.put("/sys/sysGeneralProcess/**", "anon"); |
... | @@ -100,6 +101,7 @@ public class ShiroConfig { | ... | @@ -100,6 +101,7 @@ public class ShiroConfig { |
100 | //视频对接获取视频三方配置接口,认证放开 | 101 | //视频对接获取视频三方配置接口,认证放开 |
101 | filterChainDefinitionMap.put("/v1/sys/video/getVideoIntegrateInfo", "anon"); | 102 | filterChainDefinitionMap.put("/v1/sys/video/getVideoIntegrateInfo", "anon"); |
102 | filterChainDefinitionMap.put("/sys/video/getRtsp", "anon"); | 103 | filterChainDefinitionMap.put("/sys/video/getRtsp", "anon"); |
104 | filterChainDefinitionMap.put("/sys/video/getFlv", "anon"); | ||
103 | //三维系统对接设备台账档案请求权限放行 | 105 | //三维系统对接设备台账档案请求权限放行 |
104 | filterChainDefinitionMap.put("/sys/sysCustomField/listModel", "anon"); | 106 | filterChainDefinitionMap.put("/sys/sysCustomField/listModel", "anon"); |
105 | filterChainDefinitionMap.put("/sys/sysCustomField/listHead", "anon"); | 107 | filterChainDefinitionMap.put("/sys/sysCustomField/listHead", "anon"); | ... | ... |
... | @@ -100,7 +100,7 @@ spring: | ... | @@ -100,7 +100,7 @@ spring: |
100 | pg-db: | 100 | pg-db: |
101 | url: jdbc:postgresql://120.24.205.69:10086/postgres?useUnicode=true&characterEncoding=UTF8 | 101 | url: jdbc:postgresql://120.24.205.69:10086/postgres?useUnicode=true&characterEncoding=UTF8 |
102 | username: postgres | 102 | username: postgres |
103 | password: server_2021_%Jksc | 103 | password: Sever@3202_Jksc$ |
104 | driver-class-name: org.postgresql.Driver | 104 | driver-class-name: org.postgresql.Driver |
105 | #redis 配置 | 105 | #redis 配置 |
106 | redis: | 106 | redis: |
... | @@ -157,13 +157,14 @@ skua : | ... | @@ -157,13 +157,14 @@ skua : |
157 | collectionFrequency: 10 | 157 | collectionFrequency: 10 |
158 | #视频对接相关配置 | 158 | #视频对接相关配置 |
159 | video: | 159 | video: |
160 | ip: 222.222.110.90 | 160 | ip: 120.25.102.53 |
161 | port: 8899 | 161 | port: 8667 |
162 | username: jk | 162 | username: admin |
163 | password: 1qaz@WSX | 163 | password: xrjkauto@123 |
164 | #海康威视需要填写密钥 | 164 | #海康威视需要填写密钥 |
165 | appkey: 23259573 | 165 | appkey: 22650577 |
166 | secretkey: 0zoBqIJeudIhgCysCe0r | 166 | secretkey: yKovn09uAsl2NTfebzqA |
167 | streamMediaIp: 120.25.102.53 | ||
167 | #消息推送 | 168 | #消息推送 |
168 | push: | 169 | push: |
169 | #是否开启流程消息推送 | 170 | #是否开启流程消息推送 | ... | ... |
... | @@ -164,6 +164,7 @@ skua : | ... | @@ -164,6 +164,7 @@ skua : |
164 | #海康威视需要填写密钥 | 164 | #海康威视需要填写密钥 |
165 | appkey: 22650577 | 165 | appkey: 22650577 |
166 | secretkey: yKovn09uAsl2NTfebzqA | 166 | secretkey: yKovn09uAsl2NTfebzqA |
167 | streamMediaIp: 120.25.102.53 | ||
167 | #消息推送 | 168 | #消息推送 |
168 | push: | 169 | push: |
169 | #是否开启流程消息推送 | 170 | #是否开启流程消息推送 | ... | ... |
... | @@ -159,11 +159,12 @@ skua : | ... | @@ -159,11 +159,12 @@ skua : |
159 | video: | 159 | video: |
160 | ip: 10.0.210.204 | 160 | ip: 10.0.210.204 |
161 | port: 8667 | 161 | port: 8667 |
162 | username: root | 162 | username: admin |
163 | password: Jkauto@123yw | 163 | password: jkauto@123yw |
164 | #海康威视需要填写密钥 | 164 | #海康威视需要填写密钥 |
165 | appkey: 21969915 | 165 | appkey: 21969915 |
166 | secretkey: lQFFEBvmiMg5qeJbQenw | 166 | secretkey: lQFFEBvmiMg5qeJbQenw |
167 | streamMediaIp: 10.0.210.110 | ||
167 | #消息推送 | 168 | #消息推送 |
168 | push: | 169 | push: |
169 | #是否开启流程消息推送 | 170 | #是否开启流程消息推送 | ... | ... |
-
请 注册 或 登录 后发表评论