|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
|
import com.google.common.base.Joiner; |
|
|
import com.taauav.admin.dto.TauvInspectDriverAssignTaskDTO; |
|
|
import com.taauav.admin.dto.TauvInspectDriverAssignTaskDTO; |
|
|
import com.taauav.admin.vo.TauvEquipmentListVo; |
|
|
import com.taauav.admin.vo.TauvEquipmentListVo; |
|
|
import com.taauav.admin.vo.TauvMountEquipmentListVo; |
|
|
import com.taauav.admin.vo.TauvMountEquipmentListVo; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.File; |
|
|
import java.io.File; |
|
|
import java.math.BigDecimal; |
|
|
import java.math.BigDecimal; |
|
|
import java.math.BigInteger; |
|
|
|
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|
|
|
|
|
|
if (inspectDriver != null && !"".equals(inspectDriver) && inspectDriver.size() > 0) { |
|
|
if (inspectDriver != null && !"".equals(inspectDriver) && inspectDriver.size() > 0) { |
|
|
int i = 1; |
|
|
int i = 1; |
|
|
for (TauvInspectDriver driver : inspectDriver) { |
|
|
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())) { |
|
|
if (!StringUtils.isEmpty(driver.getDriverFile())) { |
|
|
// 如果上传了文件则对文件进行处理 |
|
|
// 如果上传了文件则对文件进行处理 |
|
|
String file = driver.getDriverFile(); |
|
|
String file = driver.getDriverFile(); |
|
|
|
|
|
|
|
|
driver.setDriverLength(bigDecimal); |
|
|
driver.setDriverLength(bigDecimal); |
|
|
driver.setDriverStart(driverInfo.getStartPoint()); |
|
|
driver.setDriverStart(driverInfo.getStartPoint()); |
|
|
driver.setDriverEnd(driverInfo.getEndPoint()); |
|
|
driver.setDriverEnd(driverInfo.getEndPoint()); |
|
|
// driver.setDriverExam(driverInfo.getIsExam()); |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
//抛出异常 |
|
|
//抛出异常 |
|
|
return "河流名称不存在"; |
|
|
return "河流名称不存在"; |
|
|
|
|
|
|
|
|
String inspectTime = "inspectTime"; |
|
|
String inspectTime = "inspectTime"; |
|
|
if (!StringUtils.isEmpty(map.get(inspectTime))) { |
|
|
if (!StringUtils.isEmpty(map.get(inspectTime))) { |
|
|
String startTime = FunctionUtils.formatTime(Integer.valueOf(map.get(inspectTime).toString()), "yyyy-MM-dd") + " 00:00:00"; |
|
|
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)) { |
|
|
if ("list".equals(act)) { |
|
|
map.put("executionTime", startTime); |
|
|
map.put("executionTime", startTime); |
|
|
map.remove("inspectTime"); |
|
|
map.remove("inspectTime"); |
|
|
|
|
|
|
|
|
map.remove("executionTime"); |
|
|
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); |
|
|
map = FunctionUtils.dealArea(map); |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
|
|
|
if (StringUtils.isEmpty(assignTaskDto.getEquipmentId())) { |
|
|
if (StringUtils.isEmpty(assignTaskDto.getEquipmentId())) { |
|
|
return response.failure("无人机设备不能为空"); |
|
|
return response.failure("无人机设备不能为空"); |
|
|
} |
|
|
} |
|
|
// // 挂载设备 |
|
|
|
|
|
// if (StringUtils.isEmpty(assignTaskDto.getMountequipmentId())) { |
|
|
|
|
|
// return response.failure("挂载设备不能为空"); |
|
|
|
|
|
// } |
|
|
|
|
|
// 飞手校验 |
|
|
// 飞手校验 |
|
|
if (StringUtils.isEmpty(assignTaskDto.getInspectHand())) { |
|
|
if (StringUtils.isEmpty(assignTaskDto.getInspectHand())) { |
|
|
return response.failure("飞手不能为空"); |
|
|
return response.failure("飞手不能为空"); |
|
|
|
|
|
|
|
|
return response.failure("任务分配失败"); |
|
|
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; |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 详情 |
|
|
* 详情 |
|
|
* |
|
|
* |
|
|
|
|
|
|
|
|
inspectDriverInfoVo.setMountEquipmentList(mountEquipmentListVoList); |
|
|
inspectDriverInfoVo.setMountEquipmentList(mountEquipmentListVoList); |
|
|
} |
|
|
} |
|
|
return response.success(inspectDriverInfoVo); |
|
|
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; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|
|
|
|
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public Response executeTask(ExecuteTask task) { |
|
|
public Response executeTask(ExecuteTask task) { |
|
|
// String executionTime = task.getExecutionTime(); |
|
|
|
|
|
Integer id = Integer.valueOf(task.getId()); |
|
|
Integer id = Integer.valueOf(task.getId()); |
|
|
Integer adminId = ShiroUtils.getAdminId(); |
|
|
Integer adminId = ShiroUtils.getAdminId(); |
|
|
TauvInspectDriver info = getInfoById(id); |
|
|
TauvInspectDriver info = getInfoById(id); |
|
|
|
|
|
|
|
|
response.failure("只有被分配的小组才有权限"); |
|
|
response.failure("只有被分配的小组才有权限"); |
|
|
} |
|
|
} |
|
|
TauvInspectDriver inspectDriver = new TauvInspectDriver(); |
|
|
TauvInspectDriver inspectDriver = new TauvInspectDriver(); |
|
|
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
|
|
|
|
|
|
inspectDriver.setWeather(StringUtils.isEmpty(task.getWeather()) ? "" : task.getWeather().trim()); |
|
|
inspectDriver.setWeather(StringUtils.isEmpty(task.getWeather()) ? "" : task.getWeather().trim()); |
|
|
inspectDriver.setWind(StringUtils.isEmpty(task.getWind()) ? "" : task.getWind().trim()); |
|
|
inspectDriver.setWind(StringUtils.isEmpty(task.getWind()) ? "" : task.getWind().trim()); |
|
|
inspectDriver.setTemperature(StringUtils.isEmpty(task.getTemperature()) ? "" : task.getTemperature().trim()); |
|
|
inspectDriver.setTemperature(StringUtils.isEmpty(task.getTemperature()) ? "" : task.getTemperature().trim()); |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Response getPrintData(Integer id) { |
|
|
public Response getPrintData(Integer id) { |
|
|
return this.detail(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); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SysAdmin adminInfo = iSysAdminService.getAdminInfo(driver.getCreateUser()); |
|
|
SysAdmin adminInfo = iSysAdminService.getAdminInfo(driver.getCreateUser()); |
|
|
driver.setFormatCreateUser(StringUtils.isEmpty(adminInfo) ? "" : adminInfo.getRealname()); |
|
|
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.setFormatCreateTime(DateUtil.format(driver.getCreateTime(), "yyyy-MM-dd HH:mm:ss")); |
|
|
driver.setFormatInspectTime(DateUtil.format(driver.getInspectTime(), "yyyy-MM-dd")); |
|
|
driver.setFormatInspectTime(DateUtil.format(driver.getInspectTime(), "yyyy-MM-dd")); |
|
|
if (!StringUtils.isEmpty(driver.getExecutionTime())) { |
|
|
if (!StringUtils.isEmpty(driver.getExecutionTime())) { |
|
|
driver.setFormatExecutionTime(DateUtil.format(driver.getExecutionTime(), "yyyy-MM-dd")); |
|
|
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())) { |
|
|
if (!StringUtils.isEmpty(driver.getDriverArea())) { |
|
|
SysCity cityInfo = iSysCityService.getInfoById(driver.getDriverArea()); |
|
|
SysCity cityInfo = iSysCityService.getInfoById(driver.getDriverArea()); |
|
|
driver.setDriverAreaText(StringUtils.isEmpty(cityInfo) ? "" : cityInfo.getName()); |
|
|
driver.setDriverAreaText(StringUtils.isEmpty(cityInfo) ? "" : cityInfo.getName()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取飞手信息 |
|
|
// 获取飞手信息 |
|
|
List<String> inspectHandList = iSysAdminService.getAdminNameByIds(driver.getInspectHand()); |
|
|
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()); |
|
|
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; |
|
|
return driver; |
|
|
} |
|
|
} |
|
|
|
|
|
|