db72f82c 张雷

人员定位模拟数据

1 个父辈 03ee6fa8
...@@ -116,7 +116,8 @@ public class ThirdController { ...@@ -116,7 +116,8 @@ public class ThirdController {
116 @GetMapping("/positionByDeviceId") 116 @GetMapping("/positionByDeviceId")
117 public Result<List<HistoryPoint>> getPositionByDeviceId(String deviceId, String startTime, String endTime) { 117 public Result<List<HistoryPoint>> getPositionByDeviceId(String deviceId, String startTime, String endTime) {
118 Result<List<HistoryPoint>> result = new Result<List<HistoryPoint>>(); 118 Result<List<HistoryPoint>> result = new Result<List<HistoryPoint>>();
119 List<HistoryPoint> list = thirdService.getPositionByDeviceId(deviceId, startTime, endTime); 119 // List<HistoryPoint> list = thirdService.getPositionByDeviceId(deviceId, startTime, endTime);
120 List<HistoryPoint> list = thirdService.getPositionByDeviceIdTest(deviceId);//模拟数据
120 result.setSuccess(true); 121 result.setSuccess(true);
121 result.setResult(list); 122 result.setResult(list);
122 return result; 123 return result;
......
...@@ -25,4 +25,6 @@ public interface IThirdService { ...@@ -25,4 +25,6 @@ public interface IThirdService {
25 List<SafeArea> getSafeArea(); 25 List<SafeArea> getSafeArea();
26 26
27 List<SafeArea> getSafeAreaNew(); 27 List<SafeArea> getSafeAreaNew();
28
29 List<HistoryPoint> getPositionByDeviceIdTest(String deviceId);
28 } 30 }
......
...@@ -266,5 +266,25 @@ public class IThirdServiceImpl implements IThirdService { ...@@ -266,5 +266,25 @@ public class IThirdServiceImpl implements IThirdService {
266 return list; 266 return list;
267 } 267 }
268 268
269 @Override
270 public List<HistoryPoint> getPositionByDeviceIdTest(String deviceId) {
271 List<HistoryPoint> list = new ArrayList<>();
272 String historyPointStr = "1500.12,1500.96;1510.01,1560.56;1580.01,1580.56;1800.01,1810.56;1910.01,2010.56;" +
273 "2510.21,2557.56;3510.01,3510.56;5510.01,5515.56;7512.01,7510.56;8514.01,8610.56;";
274 String [] pointHistoryArr = historyPointStr.split(";");
275 for (int i = 0; i < pointHistoryArr.length; i++) {
276 System.out.println(pointHistoryArr[i]);
277 String [] pointArr = pointHistoryArr[i].split(",");
278 HistoryPoint historyPoint = new HistoryPoint();
279 historyPoint.setId(i+1);
280 historyPoint.setBuildingId("10");
281 historyPoint.setDeviceId(deviceId);
282 historyPoint.setX(Double.valueOf(pointArr[0]));
283 historyPoint.setY(Double.valueOf(pointArr[1]));
284 list.add(historyPoint);
285 }
286 return list;
287 }
288
269 289
270 } 290 }
......
...@@ -37,6 +37,6 @@ public interface CommonConstant { ...@@ -37,6 +37,6 @@ public interface CommonConstant {
37 String HISTORY_URL = CMCC_IP + "/api/positionByDeviceId.shtml";//历史轨迹 37 String HISTORY_URL = CMCC_IP + "/api/positionByDeviceId.shtml";//历史轨迹
38 String ALARM_URL = CMCC_IP + "/api/v1/alarmListByCount.shtml";//告警信息 38 String ALARM_URL = CMCC_IP + "/api/v1/alarmListByCount.shtml";//告警信息
39 String WEEK_ALARM_URL = CMCC_IP + "/api/v1/weekAlarmState.shtml";//获取最近7天的告警统计数据 39 String WEEK_ALARM_URL = CMCC_IP + "/api/v1/weekAlarmState.shtml";//获取最近7天的告警统计数据
40 String SAFE_AREA_URL = CMCC_IP + "/riskArea/all.shtml";//安全区域 40 String SAFE_AREA_URL = CMCC_IP + "/client/listMonitoringAreaByBuildingId.shtml";//安全区域
41 41
42 } 42 }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!