db72f82c 张雷

人员定位模拟数据

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