Kaynağa Gözat

'实时视频、巡检轨迹'

master
daixiantong 4 yıl önce
ebeveyn
işleme
17efffecd8
7 değiştirilmiş dosya ile 63 ekleme ve 322 silme
  1. +23
    -13
      src/main/java/com/taauav/admin/controller/TauvInspectDriverController.java
  2. +7
    -10
      src/main/java/com/taauav/admin/dto/TauvInspectDriverDTO.java
  3. +5
    -0
      src/main/java/com/taauav/admin/entity/TauvEquipment.java
  4. +5
    -0
      src/main/java/com/taauav/admin/service/ITauvDriverPointService.java
  5. +2
    -4
      src/main/java/com/taauav/admin/service/impl/TauvEquipmentServiceImpl.java
  6. +17
    -295
      src/main/java/com/taauav/admin/service/impl/TauvInspectDriverServiceImpl.java
  7. +4
    -0
      src/main/java/com/taauav/admin/vo/TauvEquipmentListVo.java

+ 23
- 13
src/main/java/com/taauav/admin/controller/TauvInspectDriverController.java Dosyayı Görüntüle

@@ -2,14 +2,12 @@ package com.taauav.admin.controller;


import com.taauav.admin.dto.TauvInspectDriverAssignTaskDTO;
import com.taauav.admin.entity.TauvDriverPoint;
import com.taauav.admin.entity.TauvEquipment;
import com.taauav.admin.service.*;
import com.taauav.common.bean.Response;
import com.taauav.common.constant.PermissionConstants;
import com.taauav.admin.entity.TauvInspect;
import com.taauav.admin.service.ISysAdminService;
import com.taauav.admin.service.ISysAuthGroupService;
import com.taauav.admin.service.ISysCityService;
import com.taauav.admin.service.ITauvInspectDriverService;
import com.taauav.admin.validate.ExecuteTask;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
@@ -17,8 +15,10 @@ import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.awt.*;
import java.math.BigInteger;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
@@ -41,7 +41,7 @@ public class TauvInspectDriverController {
@Autowired
private ISysAdminService adminService;
@Autowired
private ISysAuthGroupService authGroupService;
private ITauvDriverPointService driverPointService;

private static final String controllerName = "inspectDriver";

@@ -91,14 +91,15 @@ public class TauvInspectDriverController {
* @return
*/
@PostMapping("/list")
@RequiresPermissions(controllerName + ":list")
// @RequiresPermissions(controllerName + ":list")
public Response taskList(@RequestBody(required = false) Map<String, Object> map) {
if (map == null) {
map = new HashMap<>();
}
String status = "status";
if (map.containsKey(status) && !"".equals(map.get(status))) {
map.put("status", Integer.valueOf(map.get(status).toString()));
Integer[] statusArray = new Integer[]{Integer.valueOf(map.get(status).toString())};
map.put("status", statusArray);
} else {
map.put("status", new Integer[]{2, 3, 4, 5, 6});
}
@@ -135,12 +136,6 @@ public class TauvInspectDriverController {
@RequiresPermissions(controllerName + ":" + PermissionConstants.VIEW_PERMISSION)
public Response detail(@RequestBody @RequestParam("id") Integer id) {
return iTauvInspectDriverService.detail(id);
// Map<String, Object> info = iTauvInspectDriverService.detail(id);
// if (StringUtils.isEmpty(info.get("error"))) {
// return response.success(info);
// } else {
// return response.failure(info.get("error"));
// }
}

/**
@@ -238,4 +233,19 @@ public class TauvInspectDriverController {
public Response reProcess(@RequestBody Map<String, Object> map) {
return iTauvInspectDriverService.reProcess(map);
}

/**
* 获取河道飞行轨迹坐标点
* @param driverId
* @return
*/
@GetMapping("/point")
@RequiresPermissions(controllerName + ":point")
public Response getDriverPointList(Integer driverId) {
if (driverId == null || driverId <= 0) {
return response.failure("河湖id不能为空");
}
List<TauvDriverPoint> pointList = driverPointService.getListByDriverId(driverId);
return response.success(pointList);
}
}

+ 7
- 10
src/main/java/com/taauav/admin/dto/TauvInspectDriverDTO.java Dosyayı Görüntüle

@@ -1,5 +1,6 @@
package com.taauav.admin.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
@@ -15,11 +16,6 @@ import java.util.Date;
*/
@Data
public class TauvInspectDriverDTO extends BaseInspectDriverDTO {
// /**
// * 飞手
// */
// private String flightHand;
// private String flightHandText;

/**
* 飞手
@@ -88,11 +84,6 @@ public class TauvInspectDriverDTO extends BaseInspectDriverDTO {
*/
private BigDecimal inspectLength;

// /**
// * 执行周期(如:每月10号)
// */
// private String executionCycle;

/**
* 报告创建时间
*/
@@ -140,4 +131,10 @@ public class TauvInspectDriverDTO extends BaseInspectDriverDTO {
* 巡检任务来源
*/
private Integer source;

/**
* 直播地址
*/
@TableField(exist = false)
private String liveUrl;
}

+ 5
- 0
src/main/java/com/taauav/admin/entity/TauvEquipment.java Dosyayı Görüntüle

@@ -87,6 +87,11 @@ public class TauvEquipment extends Entity {
@JsonFormat(pattern = "yyyy-MM-dd")
private Date registerTime;

/**
* 直播地址
*/
private String liveUrl;

public Map<Integer, String> getStatusList() {
Map<Integer, String> map = new HashMap<>();
map.put(1, "正常");

+ 5
- 0
src/main/java/com/taauav/admin/service/ITauvDriverPointService.java Dosyayı Görüntüle

@@ -13,6 +13,11 @@ import java.util.Map;
*/
public interface ITauvDriverPointService extends IBaseService<TauvDriverPoint> {
/**
* 根据河湖id获取河湖对应坐标点
* @param driverId
* @return
*/
List<TauvDriverPoint> getListByDriverId(int driverId);
/**

+ 2
- 4
src/main/java/com/taauav/admin/service/impl/TauvEquipmentServiceImpl.java Dosyayı Görüntüle

@@ -291,8 +291,7 @@ public class TauvEquipmentServiceImpl extends BaseServiceImpl<TauvEquipmentMappe
public List<String> getEquipmentNameByIds(String equipmentIds) {
// 查询条件
QueryWrapper<TauvEquipment> queryWrapper = new QueryWrapper<>();
// 待分配任务
String arr[] = equipmentIds.split(",");
String[] arr = equipmentIds.split(",");
ArrayList arrayList = new ArrayList();
for (String s : arr) {
arrayList.add(s);
@@ -321,8 +320,7 @@ public class TauvEquipmentServiceImpl extends BaseServiceImpl<TauvEquipmentMappe
public List<TauvEquipmentListVo> getEquipmentListByIds(String equipmentIds) {
// 查询条件
QueryWrapper<TauvEquipment> queryWrapper = new QueryWrapper<>();
// 待分配任务
String arr[] = equipmentIds.split(",");
String[] arr = equipmentIds.split(",");
ArrayList arrayList = new ArrayList();
for (String s : arr) {
arrayList.add(s);

+ 17
- 295
src/main/java/com/taauav/admin/service/impl/TauvInspectDriverServiceImpl.java Dosyayı Görüntüle

@@ -2,6 +2,7 @@ package com.taauav.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.base.Joiner;
import com.taauav.admin.dto.TauvInspectDriverAssignTaskDTO;
import com.taauav.admin.vo.TauvEquipmentListVo;
import com.taauav.admin.vo.TauvMountEquipmentListVo;
@@ -28,7 +29,6 @@ import org.springframework.util.StringUtils;

import java.io.File;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;

/**
@@ -85,34 +85,6 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri
if (inspectDriver != null && !"".equals(inspectDriver) && inspectDriver.size() > 0) {
int i = 1;
for (TauvInspectDriver driver : inspectDriver) {
// if (!StringUtils.isEmpty(driver.getDriverImage())) {
// //如果上传了图片 对图片做处理
// String img = driver.getDriverImage();
// if (img.contains("temp")) {
// img = img.replace(uploadUrl, uploadFolder);
// File oldFile = new File(img);
// if (!oldFile.exists()) {
// return "图片不存在";
// }
// String fileName = oldFile.getName();
// if (fileName.contains("thumbnail")) {
// fileName = fileName.replace("-thumbnail", "");
// }
// //把文件移动到正式目录下
// Calendar date = Calendar.getInstance();
// String year = String.valueOf(date.get(Calendar.YEAR));
// String month = String.valueOf(date.get(Calendar.MONTH) + 1);
// String day = String.valueOf(date.get(Calendar.DATE));
// String destImg = uploadFolder + "file/file/" + year + "/" + month + "/" + day + "/";
// boolean flag = FileUtil.cutGeneralFile(img, destImg);
// if (flag) {
// destImg = destImg.replace(uploadFolder, "");
// driver.setDriverImage(destImg + fileName);
// } else {
// return "图片保存失败了!";
// }
// }
// }
if (!StringUtils.isEmpty(driver.getDriverFile())) {
// 如果上传了文件则对文件进行处理
String file = driver.getDriverFile();
@@ -148,7 +120,6 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri
driver.setDriverLength(bigDecimal);
driver.setDriverStart(driverInfo.getStartPoint());
driver.setDriverEnd(driverInfo.getEndPoint());
// driver.setDriverExam(driverInfo.getIsExam());
} else {
//抛出异常
return "河流名称不存在";
@@ -192,7 +163,6 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri
String inspectTime = "inspectTime";
if (!StringUtils.isEmpty(map.get(inspectTime))) {
String startTime = FunctionUtils.formatTime(Integer.valueOf(map.get(inspectTime).toString()), "yyyy-MM-dd") + " 00:00:00";
// Integer startStamp = FunctionUtils.dateToStamp(startTime);
if ("list".equals(act)) {
map.put("executionTime", startTime);
map.remove("inspectTime");
@@ -201,13 +171,6 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri
map.remove("executionTime");
}
}
// //河道类型
// String driverExam = "driverExam";
// if (!StringUtils.isEmpty(map.get(driverExam)) && Integer.valueOf(map.get(driverExam).toString()) > 0) {
// map.put("driverExam", Integer.valueOf(map.get(driverExam).toString()));
// } else {
// map.remove(driverExam);
// }
//区属
map = FunctionUtils.dealArea(map);
} else {
@@ -311,10 +274,6 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri
if (StringUtils.isEmpty(assignTaskDto.getEquipmentId())) {
return response.failure("无人机设备不能为空");
}
// // 挂载设备
// if (StringUtils.isEmpty(assignTaskDto.getMountequipmentId())) {
// return response.failure("挂载设备不能为空");
// }
// 飞手校验
if (StringUtils.isEmpty(assignTaskDto.getInspectHand())) {
return response.failure("飞手不能为空");
@@ -378,75 +337,6 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri
return response.failure("任务分配失败");
}

// /**
// * 分配任务
// *
// * @param map
// * @return
// */
//
// @Override
// public Response assignTask(Map<String, String> map) {
// if (StringUtils.isEmpty(map)) {
// return response.failure("请求参数不能为空");
// }
// String adminIdStr = map.getOrDefault("adminId", "");
// if (StringUtils.isEmpty(adminIdStr)) {
// return response.failure("请选择分配的飞行小组");
// }
// String ids = map.getOrDefault("ids", "");
// if (StringUtils.isEmpty(ids)) {
// return response.failure("请选择要分配的任务");
// }
// Integer adminId = Integer.valueOf(adminIdStr);
// SysAdmin adminInfo = iSysAdminService.getAdminInfo(adminId);
// if (StringUtils.isEmpty(adminInfo)) {
// return response.failure("飞行小组不存在");
// }
// String[] idsArr = ids.split(",");
// String msg = "";
// for (String idStr : idsArr) {
// Integer id = Integer.valueOf(idStr);
// TauvInspectDriver info = getInfoById(id);
// if (StringUtils.isEmpty(info)) {
// msg = "编号" + id + "数据不存在";
// break;
// }
//
// Boolean f = assignFlightGroup(id, adminId);
// if (!f) {
// msg = "分配失败";
// break;
// }
// }
// if (StringUtils.isEmpty(msg)) {
// return response.success("操作成功");
// } else {
// return response.failure("操作失败");
// }
// }

// /**
// * 分配飞行小组
// *
// * @param id
// * @param flightGroupId
// * @return
// */
// @Override
// public boolean assignFlightGroup(Integer id, Integer flightGroupId) {
// TauvInspectDriver inspectDriver = new TauvInspectDriver();
// inspectDriver.setId(id);
// inspectDriver.setFlightHand(flightGroupId);
// inspectDriver.setStatus(Integer.valueOf("2"));
// Integer res = inspectDriverMapper.updateById(inspectDriver);
// if (res > 0) {
// return true;
// } else {
// return false;
// }
// }

/**
* 详情
*
@@ -494,76 +384,6 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri
inspectDriverInfoVo.setMountEquipmentList(mountEquipmentListVoList);
}
return response.success(inspectDriverInfoVo);


// Map<String, Object> detail = new HashMap<>();
// if (StringUtils.isEmpty(id)) {
// detail.put("error", "参数不存在");
// return detail;
// }
// TauvInspectDriver info = getInfoById(id);
// if (StringUtils.isEmpty(info)) {
// detail.put("error", "数据不存在");
// return detail;
// }
// Integer inspectId = info.getInspectId();
// if (StringUtils.isEmpty(inspectId)) {
// detail.put("error", "任务编号不存在");
// return detail;
// }
// TauvInspect inspectInfo = inspectMapper.selectById(inspectId);
//
// BigInteger driverArea = info.getDriverArea();
// detail.put("id", info.getId());
// detail.put("inspectNo", info.getInspectNo());
// detail.put("num", info.getNum());
// detail.put("driverName", info.getDriverName());
// if (StringUtils.isEmpty(driverArea)) {
// detail.put("driverArea", "");
// } else {
//// SysCity cityInfo = iSysCityService.getInfoById(driverArea);
//// detail.put("driverArea", StringUtils.isEmpty(cityInfo) ? "" : cityInfo.getName());
// String cityName = iSysCityService.getCityName(driverArea);
// detail.put("driverArea", cityName);
// }
//
//// detail.put("executionTime", executionTime);
// detail.put("driverStart", info.getDriverStart());
// detail.put("driverEnd", info.getDriverEnd());
// detail.put("driverLength", info.getDriverLength());
// detail.put("weather", info.getWeather());
// detail.put("wind", info.getWind());
// detail.put("temperature", info.getTemperature());
// detail.put("flightTime", info.getFlightTime());
// detail.put("flightHeight", info.getFlightHeight());
// detail.put("flightSpeed", info.getFlightSpeed());
// detail.put("flightHand", info.getFlightHand());
// detail.put("inspectHand", info.getInspectHand());
// // 巡检时间
// String inspectTime = "";
// if (!StringUtils.isEmpty(inspectInfo.getInspectTime())) {
// inspectTime = DateUtil.format(inspectInfo.getInspectTime(), "yyyy-MM-dd");
// }
// detail.put("inspectTime", inspectTime);
//// detail.put("inspectTime", inspectInfo.getInspectTime());
//// //图片位置信息
//// if (!"".equals(info.getDriverImage())) {
//// info.setDriverImage(uploadUrl + info.getDriverImage());
//// }
//// detail.put("driverImage", info.getDriverImage());
//// //巡检目的
//// detail.put("inspectPurpose", inspectInfo.getInspectPurpose());
//// //巡检结果
//// detail.put("inspectResult", inspectInfo.getInspectResult());
// // 备注
// detail.put("note", inspectInfo.getNote());
// //执行时间
// String executionTime = "";
// if (info.getExecutionTime() != null) {
// executionTime = DateUtil.format(info.getExecutionTime(), "yyyy-MM-dd");
// }
// detail.put("executionTime", executionTime);
// return detail;
}

/**
@@ -602,7 +422,6 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri
*/
@Override
public Response executeTask(ExecuteTask task) {
// String executionTime = task.getExecutionTime();
Integer id = Integer.valueOf(task.getId());
Integer adminId = ShiroUtils.getAdminId();
TauvInspectDriver info = getInfoById(id);
@@ -614,8 +433,6 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri
response.failure("只有被分配的小组才有权限");
}
TauvInspectDriver inspectDriver = new TauvInspectDriver();
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

inspectDriver.setWeather(StringUtils.isEmpty(task.getWeather()) ? "" : task.getWeather().trim());
inspectDriver.setWind(StringUtils.isEmpty(task.getWind()) ? "" : task.getWind().trim());
inspectDriver.setTemperature(StringUtils.isEmpty(task.getTemperature()) ? "" : task.getTemperature().trim());
@@ -646,104 +463,6 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri
@Override
public Response getPrintData(Integer id) {
return this.detail(id);

// Map<String, Object> detail = new HashMap<>();
// if (StringUtils.isEmpty(id)) {
// detail.put("error", "参数不存在");
// return response.failure("参数不存在");
// }
// TauvInspectDriver info = getInfoById(id);
// if (StringUtils.isEmpty(info)) {
// detail.put("error", "数据不存在");
// return response.failure("数据不存在");
// }
// Integer inspectId = info.getInspectId();
// if (StringUtils.isEmpty(inspectId)) {
// detail.put("error", "任务编号不存在");
// return response.failure("任务编号不存在");
// }
// TauvInspect inspectInfo = inspectMapper.selectById(inspectId);
//
// BigInteger driverArea = info.getDriverArea();
// detail.put("id", info.getId());
// detail.put("inspectNo", info.getInspectNo());
// detail.put("num", info.getNum());
// detail.put("driverName", info.getDriverName());
// if (StringUtils.isEmpty(driverArea)) {
// detail.put("driverArea", "");
// } else {
//// SysCity cityInfo = iSysCityService.getInfoById(driverArea);
//// detail.put("driverArea", StringUtils.isEmpty(cityInfo) ? "" : cityInfo.getName());
// String cityName = iSysCityService.getCityName(driverArea);
// detail.put("driverArea", cityName);
// }
//
//// detail.put("executionTime", executionTime);
// detail.put("driverStart", info.getDriverStart());
// detail.put("driverEnd", info.getDriverEnd());
// detail.put("driverLength", info.getDriverLength());
// detail.put("weather", info.getWeather());
// detail.put("wind", info.getWind());
// detail.put("temperature", info.getTemperature());
// detail.put("flightTime", info.getFlightTime());
// detail.put("flightHeight", info.getFlightHeight());
// detail.put("flightSpeed", info.getFlightSpeed());
// detail.put("flightHand", info.getFlightHand());
// detail.put("inspectHand", info.getInspectHand());
// // 巡检时间
// String inspectTime = "";
// if (!StringUtils.isEmpty(inspectInfo.getInspectTime())) {
// inspectTime = DateUtil.format(inspectInfo.getInspectTime(), "yyyy-MM-dd");
// }
// detail.put("inspectTime", inspectTime);
//// detail.put("inspectTime", inspectInfo.getInspectTime());
//// //图片位置信息
//// if (!"".equals(info.getDriverImage())) {
//// info.setDriverImage(uploadUrl + info.getDriverImage());
//// }
//// detail.put("driverImage", info.getDriverImage());
//// //巡检目的
//// detail.put("inspectPurpose", inspectInfo.getInspectPurpose());
//// //巡检结果
//// detail.put("inspectResult", inspectInfo.getInspectResult());
// // 备注
// detail.put("note", inspectInfo.getNote());
// //执行时间
// String executionTime = "";
// if (info.getExecutionTime() != null) {
// executionTime = DateUtil.format(info.getExecutionTime(), "yyyy-MM-dd");
// }
// detail.put("executionTime", executionTime);
//
//// Map<String, Object> info = detail(id);
//// if (!StringUtils.isEmpty(info.get("error"))) {
//// return response.failure(info.get("error"));
//// }
//
//
//// Integer groupId = (Integer) info.get("flightGroup");
//// Long startTime = new Long(info.get("executionTime").toString());
//// Long inspectTime = new Long(info.get("inspectTime").toString());
//// if (startTime > 0) {
//// info.put("executionTime", info.get("executionTime").toString());
//// } else {
//// info.put("executionTime", "");
//// }
//// if (inspectTime > 0) {
//// info.put("formatInspectTime", info.get("inspectTime").toString());
//// } else {
//// info.put("formatInspectTime", "");
//// }
// detail.put("executionTime", detail.get("executionTime").toString());
// detail.put("formatInspectTime", detail.get("inspectTime").toString());
//
// // 巡检飞手
// String inspectHand = detail.get("inspectHand").toString();
//
// // 获取飞手名称
// List<String> stringList = iSysAdminService.getAdminNameByIds(inspectHand);
// detail.put("inspectHandName", org.apache.commons.lang3.StringUtils.join(stringList.toArray(), ","));
// return response.success(info);
}

/**
@@ -767,19 +486,11 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri

SysAdmin adminInfo = iSysAdminService.getAdminInfo(driver.getCreateUser());
driver.setFormatCreateUser(StringUtils.isEmpty(adminInfo) ? "" : adminInfo.getRealname());
// driver.setFormatCreateTime(FunctionUtils.formatTime(driver.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
// driver.setFormatinspectTime(FunctionUtils.formatTime(driver.getinspectTime(), "yyyy-MM-dd HH:mm:ss"));
// driver.setFormatInspectEndTime(FunctionUtils.formatTime(driver.getInspectEndTime(), "yyyy-MM-dd HH:mm:ss"));
// driver.setFormatExecutionStartTime(FunctionUtils.formatTime(driver.getExecutionStartTime(), "yyyy-MM-dd HH:mm:ss"));
// driver.setFormatExecutionEndTime(FunctionUtils.formatTime(driver.getExecutionEndTime(), "yyyy-MM-dd HH:mm:ss"));
driver.setFormatCreateTime(DateUtil.format(driver.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
driver.setFormatInspectTime(DateUtil.format(driver.getInspectTime(), "yyyy-MM-dd"));
if (!StringUtils.isEmpty(driver.getExecutionTime())) {
driver.setFormatExecutionTime(DateUtil.format(driver.getExecutionTime(), "yyyy-MM-dd"));
}
// if (!StringUtils.isEmpty(driver.getExecutionEndTime())) {
// driver.setFormatExecutionEndTime(DateUtil.format(driver.getExecutionEndTime(), "yyyy-MM-dd HH:mm:ss"));
// }
if (!StringUtils.isEmpty(driver.getDriverArea())) {
SysCity cityInfo = iSysCityService.getInfoById(driver.getDriverArea());
driver.setDriverAreaText(StringUtils.isEmpty(cityInfo) ? "" : cityInfo.getName());
@@ -800,13 +511,24 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri

// 获取飞手信息
List<String> inspectHandList = iSysAdminService.getAdminNameByIds(driver.getInspectHand());
driver.setInspectHandName(org.apache.commons.lang3.StringUtils.join(inspectHandList.toArray(), ","));
// 获取无人机设备名称
List<String> equipmentNameList = equipmentService.getEquipmentNameByIds(driver.getEquipmentId());
driver.setEquipmentName(org.apache.commons.lang3.StringUtils.join(equipmentNameList.toArray(), ","));
driver.setInspectHandName(Joiner.on(",").join(inspectHandList.toArray()));
// 获取无人机设备名称、直播地址
List<TauvEquipmentListVo> equipmentListVoList = equipmentService.getEquipmentListByIds(driver.getEquipmentId());
if (equipmentListVoList.size() > 0) {
List<String> equipmentNameList = new ArrayList<>();
String liveUrl = "";
for (TauvEquipmentListVo item : equipmentListVoList) {
equipmentNameList.add(item.getName());
if (!StringUtils.isEmpty(item.getLiveUrl())) {
liveUrl = item.getLiveUrl();
}
}
driver.setEquipmentName(Joiner.on(",").join(equipmentNameList.toArray()));
driver.setLiveUrl(liveUrl);
}
// 获取挂载设备名称
List<String> mountEquipmentNameList = mountEquipmentService.getMountEquipmentNameByIds(driver.getMountequipmentId());
driver.setMountequipmentName(org.apache.commons.lang3.StringUtils.join(mountEquipmentNameList.toArray(), ","));
driver.setMountequipmentName(Joiner.on(",").join(mountEquipmentNameList.toArray()));
return driver;
}


+ 4
- 0
src/main/java/com/taauav/admin/vo/TauvEquipmentListVo.java Dosyayı Görüntüle

@@ -114,4 +114,8 @@ public class TauvEquipmentListVo {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;

/**
* 直播地址
*/
private String liveUrl;
}

Yükleniyor…
İptal
Kaydet