@@ -17,19 +17,19 @@ public class TauvInspectDriverAssignTaskDTO { | |||
List<TauvInspectDriver> inspectDrivers; | |||
/** | |||
* 飞手ID | |||
* 巡检任务飞手 | |||
*/ | |||
private Integer adminId; | |||
private String inspectHand; | |||
/** | |||
* 无人机设备ID | |||
*/ | |||
private Integer equipmentId; | |||
private String equipmentId; | |||
/** | |||
* 挂载设备ID | |||
*/ | |||
private Integer mountequipmentId; | |||
private String mountequipmentId; | |||
/** | |||
* 执行时间 |
@@ -15,11 +15,22 @@ import java.util.Date; | |||
*/ | |||
@Data | |||
public class TauvInspectDriverDTO extends BaseInspectDriverDTO { | |||
// /** | |||
// * 飞手 | |||
// */ | |||
// private String flightHand; | |||
// private String flightHandText; | |||
/** | |||
* 飞手 | |||
*/ | |||
private String flightHand; | |||
private String flightHandText; | |||
private String inspectHand; | |||
/** | |||
* 飞手名称 | |||
*/ | |||
private String inspectHandName; | |||
/** | |||
* 添加时间 | |||
*/ | |||
@@ -94,4 +105,14 @@ public class TauvInspectDriverDTO extends BaseInspectDriverDTO { | |||
* 河道长度 | |||
*/ | |||
private BigDecimal driverLength; | |||
/** | |||
* 航线文件名 | |||
*/ | |||
private String driverFilename; | |||
/** | |||
* 航线文件 | |||
*/ | |||
private String driverFile; | |||
} |
@@ -105,18 +105,23 @@ public class TauvInspectDriver extends Entity { | |||
/** | |||
* 飞行设备ID | |||
*/ | |||
private Integer equipmentId; | |||
private String equipmentId; | |||
/** | |||
* 挂载设备ID | |||
*/ | |||
private Integer mountequipmentId; | |||
private String mountequipmentId; | |||
/** | |||
* 飞手ID | |||
*/ | |||
private Integer flightHand; | |||
/** | |||
* 巡检任务飞手 | |||
*/ | |||
private String inspectHand; | |||
/** | |||
* 执行时间 | |||
*/ |
@@ -163,8 +163,8 @@ public class TauvReport extends Entity { | |||
/** | |||
* 报告描述 | |||
*/ | |||
@TableField(value = "`desc`") | |||
private String desc; | |||
@TableField(value = "`description`") | |||
private String description; | |||
/** | |||
* 创建人 |
@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.service.IService; | |||
import com.taauav.admin.query.LsAdminQuery; | |||
import com.taauav.common.service.IBaseService; | |||
import javax.validation.constraints.Max; | |||
import java.util.List; | |||
import java.util.Map; | |||
/** |
@@ -104,4 +104,12 @@ public interface ISysAdminService extends IBaseService<SysAdmin> { | |||
String getRealNameById(Integer id); | |||
List<Map<String,Object>> getAdminListByGroupId(Integer groupId); | |||
/** | |||
* 根据ID获取人员名称 | |||
* | |||
* @param adminIds | |||
* @return | |||
*/ | |||
List<String> getAdminNameByIds(String adminIds); | |||
} |
@@ -124,4 +124,5 @@ public interface ITauvInspectDriverService extends IBaseService<TauvInspectDrive | |||
* @return | |||
*/ | |||
Response reProcess(Map<String, Object> map); | |||
} |
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.taauav.admin.entity.LsAuthGroup; | |||
import com.taauav.common.bean.CacheUser; | |||
import com.taauav.common.bean.Response; | |||
import com.taauav.common.constant.SysAdminConstant; | |||
@@ -532,4 +533,34 @@ public class SysAdminServiceImpl extends BaseServiceImpl<SysAdminMapper, SysAdmi | |||
} | |||
return response.success("操作成功", list); | |||
} | |||
/** | |||
* 根据ID获取人员名称 | |||
* | |||
* @param adminIds 人员ID(多个逗号分隔) | |||
* @return | |||
*/ | |||
@Override | |||
public List<String> getAdminNameByIds(String adminIds) { | |||
// 查询条件 | |||
QueryWrapper<SysAdmin> queryWrapper = new QueryWrapper<>(); | |||
// 待分配任务 | |||
String arr[] = adminIds.split(","); | |||
ArrayList arrayList = new ArrayList(); | |||
for (String s : arr) { | |||
arrayList.add(s); | |||
} | |||
queryWrapper.in("id", arrayList); | |||
queryWrapper.eq("mark", 1); | |||
// 查询数据 | |||
List<SysAdmin> adminList = sysAdminMapper.selectList(queryWrapper); | |||
List<String> stringList = new ArrayList<>(); | |||
if (!adminList.isEmpty()) { | |||
adminList.forEach(item -> { | |||
stringList.add(item.getRealname()); | |||
}); | |||
} | |||
return stringList; | |||
} | |||
} |
@@ -14,6 +14,7 @@ import com.taauav.admin.mapper.TauvDriverMapper; | |||
import com.taauav.admin.service.ISysAdminService; | |||
import com.taauav.admin.service.ITauvDriverService; | |||
import com.taauav.common.service.impl.BaseServiceImpl; | |||
import org.springframework.beans.BeanUtils; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.beans.factory.annotation.Value; | |||
import org.springframework.stereotype.Service; | |||
@@ -248,6 +249,28 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau | |||
Integer pageSize = 10; | |||
IPage<TauvDriver> page = new Page<>(pageIndex, pageSize); | |||
IPage<TauvDriver> data = driverMapper.selectPage(page, queryWrapper); | |||
return response.success("操作成功", data); | |||
List<TauvDriver> driverList = data.getRecords(); | |||
List<TauvDriverListVo> driverListVoList = new ArrayList<>(); | |||
if (!driverList.isEmpty()) { | |||
driverList.forEach(item -> { | |||
TauvDriverListVo driverListVo = new TauvDriverListVo(); | |||
// 拷贝属性 | |||
BeanUtils.copyProperties(item, driverListVo); | |||
// 河流ID | |||
driverListVo.setDriverId(item.getId()); | |||
// 区划描述 | |||
String cityName = cityService.getCityName(item.getDriverArea()); | |||
driverListVo.setDriverAreaName(cityName); | |||
driverListVoList.add(driverListVo); | |||
}); | |||
} | |||
// 返回结果 | |||
Map<String, Object> result = new HashMap<>(); | |||
result.put("total", data.getTotal()); | |||
result.put("size", data.getSize()); | |||
result.put("current", data.getCurrent()); | |||
result.put("pages", data.getPages()); | |||
result.put("records", driverListVoList); | |||
return response.success(result); | |||
} | |||
} |
@@ -126,7 +126,7 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
destFile = destFile.replace(uploadFolder, ""); | |||
driver.setDriverFile(destFile + fileName); | |||
} else { | |||
return "图片保存失败了!"; | |||
return "文件保存失败了!"; | |||
} | |||
} | |||
} | |||
@@ -144,6 +144,7 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
//抛出异常 | |||
return "河流名称不存在"; | |||
} | |||
driver.setId(0); | |||
driver.setInspectId(inspectId); | |||
driver.setInspectNo(inspect.getInspectNo()); | |||
driver.setCreateTime(DateUtil.now()); | |||
@@ -296,15 +297,15 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
return response.failure("执行时间不能为空"); | |||
} | |||
// 无人机设备校验 | |||
if (assignTaskDto.getEquipmentId() == null || assignTaskDto.getEquipmentId() <= 0) { | |||
if (StringUtils.isEmpty(assignTaskDto.getEquipmentId())) { | |||
return response.failure("无人机设备不能为空"); | |||
} | |||
// 挂载设备 | |||
if (assignTaskDto.getMountequipmentId() == null || assignTaskDto.getMountequipmentId() <= 0) { | |||
if (StringUtils.isEmpty(assignTaskDto.getMountequipmentId())) { | |||
return response.failure("挂载设备不能为空"); | |||
} | |||
// 飞手校验 | |||
if (assignTaskDto.getAdminId() == null || assignTaskDto.getAdminId() <= 0) { | |||
if (StringUtils.isEmpty(assignTaskDto.getInspectHand())) { | |||
return response.failure("飞手不能为空"); | |||
} | |||
// 循环遍历河流信息 | |||
@@ -320,7 +321,7 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
// 挂载设备 | |||
inspectDriver.setMountequipmentId(assignTaskDto.getMountequipmentId()); | |||
// 飞手 | |||
inspectDriver.setFlightHand(assignTaskDto.getAdminId()); | |||
inspectDriver.setInspectHand(assignTaskDto.getInspectHand()); | |||
// 设置已分配状态 | |||
inspectDriver.setStatus(2); | |||
// 更新巡检河流信息 | |||
@@ -453,7 +454,8 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
detail.put("flightTime", info.getFlightTime()); | |||
detail.put("flightHeight", info.getFlightHeight()); | |||
detail.put("flightSpeed", info.getFlightSpeed()); | |||
detail.put("flightGroup", info.getFlightHand()); | |||
detail.put("flightHand", info.getFlightHand()); | |||
detail.put("inspectHand", info.getInspectHand()); | |||
// 巡检时间 | |||
String inspectTime = ""; | |||
if (!StringUtils.isEmpty(inspectInfo.getInspectTime())) { | |||
@@ -524,8 +526,8 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
if (StringUtils.isEmpty(info)) { | |||
return response.failure("数据不存在"); | |||
} | |||
Integer fligGroup = info.getFlightHand(); | |||
if (!fligGroup.equals(adminId) && !fligGroup.equals(1)) { | |||
Integer flightHand = info.getFlightHand(); | |||
if (!flightHand.equals(adminId) && !flightHand.equals(1)) { | |||
response.failure("只有被分配的小组才有权限"); | |||
} | |||
TauvInspectDriver inspectDriver = new TauvInspectDriver(); | |||
@@ -558,21 +560,28 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
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", FunctionUtils.formatTime(startTime.intValue(), "yyyy-MM-dd HH:mm:ss")); | |||
} else { | |||
info.put("executionTime", ""); | |||
} | |||
if (inspectTime > 0) { | |||
info.put("formatInspectTime", FunctionUtils.formatTime(inspectTime.intValue(), "yyyy-MM-dd HH:mm:ss")); | |||
} else { | |||
info.put("formatInspectTime", ""); | |||
} | |||
SysAdmin adminInfo = iSysAdminService.getAdminInfo(groupId); | |||
info.put("flightGroupText", StringUtils.isEmpty(adminInfo) ? "" : adminInfo.getRealname()); | |||
// 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", ""); | |||
// } | |||
info.put("executionTime", info.get("executionTime").toString()); | |||
info.put("formatInspectTime", info.get("inspectTime").toString()); | |||
// 巡检飞手 | |||
String inspectHand = info.get("inspectHand").toString(); | |||
// 获取飞手名称 | |||
List<String> stringList = iSysAdminService.getAdminNameByIds(inspectHand); | |||
info.put("inspectHandName", org.apache.commons.lang3.StringUtils.join(stringList.toArray(), ",")); | |||
return response.success(info); | |||
} | |||
@@ -626,6 +635,10 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
driver.setReportId(report.getId()); | |||
} | |||
} | |||
// 获取飞行消息 | |||
List<String> inspectHandList = iSysAdminService.getAdminNameByIds(driver.getInspectHand()); | |||
driver.setInspectHandName(org.apache.commons.lang3.StringUtils.join(inspectHandList.toArray(), ",")); | |||
return driver; | |||
} | |||
@@ -112,7 +112,7 @@ public class TauvInspectFileServiceImpl extends BaseServiceImpl<TauvInspectFileM | |||
Integer adminId = ShiroUtils.getAdminId(); | |||
boolean hasAccess = getAccess(); | |||
if (hasAccess) { | |||
map.put("flightGroup", adminId); | |||
map.put("flightHand", adminId); | |||
} | |||
List<TauvInspectDriverPicDTO> list = inspectDriverMapper.getFilePageList(page, map); | |||
if (list != null) { |
@@ -95,7 +95,7 @@ public class TauvInspectServiceImpl extends BaseServiceImpl<TauvInspectMapper, T | |||
destFile = destFile.replace(uploadFolder, ""); | |||
inspect.setAttachment(destFile + fileName); | |||
} else { | |||
return response.failure("图片保存失败了"); | |||
return response.failure("文件保存失败了"); | |||
} | |||
} | |||
} |
@@ -337,7 +337,7 @@ public class TauvReportServiceImpl extends BaseServiceImpl<TauvReportMapper, Tau | |||
data.put("totalExamineScore", reportInfo.getTotalExamineScore()); | |||
data.put("totalCheckScore", reportInfo.getTotalCheckScore()); | |||
data.put("status", reportInfo.getStatus()); | |||
data.put("desc", reportInfo.getDesc()); | |||
data.put("desc", reportInfo.getDescription()); | |||
if (!StringUtils.isEmpty(reportInfo.getDriverArea())) { | |||
SysCity cityInfo = iSysCityService.getInfoById(reportInfo.getDriverArea()); | |||
data.put("driverArea", StringUtils.isEmpty(cityInfo) ? "" : cityInfo.getName()); | |||
@@ -515,7 +515,7 @@ public class TauvReportServiceImpl extends BaseServiceImpl<TauvReportMapper, Tau | |||
if (desc.length() > 200) { | |||
return response.failure("报告描述不能超过200字"); | |||
} | |||
tauvReport.setDesc(desc); | |||
tauvReport.setDescription(desc); | |||
} | |||
if (StringUtils.isEmpty(info.getReportNo())) { | |||
String num = String.format("%04d", info.getId()); |
@@ -18,6 +18,11 @@ public class TauvDriverListVo { | |||
*/ | |||
private Integer id; | |||
/** | |||
* 河流ID | |||
*/ | |||
private Integer driverId; | |||
/** | |||
* 河道编码 | |||
*/ |
@@ -35,7 +35,7 @@ public class CodeGeneratorUtil { | |||
private static final String AUTHOR = "dyg"; | |||
private static final String HOST = "127.0.0.1"; | |||
private static final String DRIVER_CLASS_NAME = "com.mysql.cj.jdbc.Driver"; | |||
private static final String DATABASE_NAME = "lishui.com"; | |||
private static final String DATABASE_NAME = "taauav_lishui"; | |||
private static final String DATABASE_USERNAME = "root"; | |||
private static final String DATABASE_PASSWORD = ""; | |||
private static final String PARENT_PACKAGE = "com.taauav"; |
@@ -0,0 +1,47 @@ | |||
package com.taauav.front.controller; | |||
import com.taauav.common.bean.Response; | |||
import com.taauav.front.query.LSReportQuery; | |||
import com.taauav.front.service.ILSReportService; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.*; | |||
/** | |||
* <p> | |||
* 巡检报告表 前端控制器 | |||
* </p> | |||
* | |||
* @author dyg | |||
* @since 2020-04-10 | |||
*/ | |||
@RestController | |||
@RequestMapping("/front/report") | |||
public class LSReportController { | |||
@Autowired | |||
private ILSReportService reportService; | |||
/** | |||
* 获取报告列表 | |||
* | |||
* @param query 查询条件 | |||
* @return | |||
*/ | |||
@PostMapping("/index") | |||
public Response index(@RequestBody(required = false) LSReportQuery query) { | |||
return reportService.getList(query); | |||
} | |||
/** | |||
* 获取报告详情 | |||
* | |||
* @param id 报告ID | |||
* @return | |||
*/ | |||
@GetMapping("/detail") | |||
public Response detail(Integer id) { | |||
return reportService.detail(id); | |||
} | |||
} |
@@ -0,0 +1,16 @@ | |||
package com.taauav.front.mapper; | |||
import com.taauav.admin.entity.TauvReport; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
/** | |||
* <p> | |||
* 巡检报告表 Mapper 接口 | |||
* </p> | |||
* | |||
* @author dyg | |||
* @since 2020-04-10 | |||
*/ | |||
public interface LSReportMapper extends BaseMapper<TauvReport> { | |||
} |
@@ -0,0 +1,5 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.taauav.front.mapper.LSReportMapper"> | |||
</mapper> |
@@ -0,0 +1,39 @@ | |||
package com.taauav.front.query; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import com.taauav.common.core.mps.BaseQuery; | |||
import lombok.Data; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import java.math.BigInteger; | |||
import java.util.Date; | |||
/** | |||
* 报告查询对象 | |||
*/ | |||
@Data | |||
public class LSReportQuery extends BaseQuery { | |||
/** | |||
* 报告单号 | |||
*/ | |||
private String reportNo; | |||
/** | |||
* 河湖名称 | |||
*/ | |||
private String driverName; | |||
/** | |||
* 巡检时间 | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd") | |||
@JsonFormat(pattern = "yyyy-MM-dd") | |||
private Date inspectTime; | |||
/** | |||
* 区划ID | |||
*/ | |||
private BigInteger driverArea; | |||
} |
@@ -0,0 +1,34 @@ | |||
package com.taauav.front.service; | |||
import com.taauav.admin.entity.TauvReport; | |||
import com.taauav.common.bean.Response; | |||
import com.taauav.common.service.IBaseService; | |||
import com.taauav.front.query.LSReportQuery; | |||
/** | |||
* <p> | |||
* 巡检报告表 服务类 | |||
* </p> | |||
* | |||
* @author dyg | |||
* @since 2020-04-10 | |||
*/ | |||
public interface ILSReportService extends IBaseService<TauvReport> { | |||
/** | |||
* 获取报告列表 | |||
* | |||
* @param query 查询条件 | |||
* @return | |||
*/ | |||
Response getList(LSReportQuery query); | |||
/** | |||
* 获取报告详情 | |||
* | |||
* @param id 报告ID | |||
* @return | |||
*/ | |||
Response detail(Integer id); | |||
} |
@@ -0,0 +1,231 @@ | |||
package com.taauav.front.service.impl; | |||
import com.alibaba.fastjson.JSON; | |||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.taauav.admin.entity.TauvInspectDriver; | |||
import com.taauav.admin.entity.TauvQuestionOptions; | |||
import com.taauav.admin.entity.TauvReport; | |||
import com.taauav.admin.entity.TauvReportRemark; | |||
import com.taauav.admin.mapper.TauvInspectDriverMapper; | |||
import com.taauav.admin.service.*; | |||
import com.taauav.common.bean.Response; | |||
import com.taauav.common.service.impl.BaseServiceImpl; | |||
import com.taauav.common.util.DateUtil; | |||
import com.taauav.common.util.StringUtils; | |||
import com.taauav.front.mapper.LSReportMapper; | |||
import com.taauav.front.query.LSReportQuery; | |||
import com.taauav.front.service.ILSReportService; | |||
import com.taauav.front.vo.LSReportInfoVo; | |||
import com.taauav.front.vo.LSReportListVo; | |||
import com.taauav.front.vo.LSReportQuestionFileListVo; | |||
import com.taauav.front.vo.LSReportQuestionListVo; | |||
import org.springframework.beans.BeanUtils; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.beans.factory.annotation.Value; | |||
import org.springframework.stereotype.Service; | |||
import java.util.*; | |||
/** | |||
* <p> | |||
* 巡检报告表 服务实现类 | |||
* </p> | |||
* | |||
* @author dyg | |||
* @since 2020-04-10 | |||
*/ | |||
@Service | |||
public class LSReportServiceImpl extends BaseServiceImpl<LSReportMapper, TauvReport> implements ILSReportService { | |||
@Value("${server.UPLOAD_URL}") | |||
private String uploadUrl; | |||
@Autowired | |||
private LSReportMapper reportMapper; | |||
@Autowired | |||
private Response response; | |||
@Autowired | |||
private ISysCityService cityService; | |||
@Autowired | |||
private TauvInspectDriverMapper inspectDriverMapper; | |||
@Autowired | |||
private ITauvQuestionOptionsService questionOptionsService; | |||
@Autowired | |||
private ITauvInspectFileService inspectFileService; | |||
@Autowired | |||
private ITauvReportRemarkService reportRemarkService; | |||
@Autowired | |||
private ITauvReportEvaluationService reportEvaluationService; | |||
/** | |||
* 获取报告列表 | |||
* | |||
* @param query 查询条件 | |||
* @return | |||
*/ | |||
@Override | |||
public Response getList(LSReportQuery query) { | |||
// 查询条件 | |||
QueryWrapper<TauvReport> queryWrapper = new QueryWrapper<>(); | |||
// 报告编号 | |||
if (!StringUtils.isEmpty(query.getReportNo())) { | |||
queryWrapper.like("report_no", query.getReportNo()); | |||
} | |||
// 河湖名称 | |||
if (!StringUtils.isEmpty(query.getDriverName())) { | |||
queryWrapper.like("driver_name", query.getDriverName()); | |||
} | |||
// 巡检日期 | |||
if (query.getInspectTime() != null) { | |||
String inspectTime = DateUtil.format(query.getInspectTime(), "yyyy-MM-dd"); | |||
Date startTime = DateUtil.parse(inspectTime + " 0:00:00", "yyyy-MM-dd HH:mm:ss"); | |||
Date endTime = DateUtil.parse(inspectTime + " 23:59:59", "yyyy-MM-dd HH:mm:ss"); | |||
} | |||
// 区划ID | |||
if (query.getDriverArea() != null) { | |||
queryWrapper.eq("driver_area", query.getDriverArea()); | |||
} | |||
queryWrapper.eq("mark", 1); | |||
// 查询数据 | |||
IPage<TauvReport> page = new Page<>(query.getPage(), query.getPageSize()); | |||
IPage<TauvReport> data = reportMapper.selectPage(page, queryWrapper); | |||
List<TauvReport> reportList = data.getRecords(); | |||
List<LSReportListVo> reportListVoList = new ArrayList<>(); | |||
if (!reportList.isEmpty()) { | |||
reportList.forEach(item -> { | |||
LSReportListVo reportListVo = new LSReportListVo(); | |||
// 拷贝属性 | |||
BeanUtils.copyProperties(item, reportListVo); | |||
// 区划 | |||
String cityName = cityService.getCityName(item.getDriverArea()); | |||
reportListVo.setDriverAreaName(cityName); | |||
// 状态描述 | |||
reportListVo.setStatusName(item.getStatusList().get(item.getStatus())); | |||
reportListVoList.add(reportListVo); | |||
}); | |||
} | |||
// 返回结果 | |||
Map<String, Object> result = new HashMap<>(); | |||
result.put("total", data.getTotal()); | |||
result.put("size", data.getSize()); | |||
result.put("current", data.getCurrent()); | |||
result.put("pages", data.getPages()); | |||
result.put("records", reportListVoList); | |||
return response.success(result); | |||
} | |||
/** | |||
* 获取报告详情 | |||
* | |||
* @param id 报告ID | |||
* @return | |||
*/ | |||
@Override | |||
public Response detail(Integer id) { | |||
if (id == null || id <= 0) { | |||
return response.failure("报告ID不能为空"); | |||
} | |||
// 获取报告信息 | |||
TauvReport report = reportMapper.selectById(id); | |||
if (report == null) { | |||
return response.failure("报告信息不存在"); | |||
} | |||
// 拷贝属性 | |||
LSReportInfoVo reportInfoVo = new LSReportInfoVo(); | |||
BeanUtils.copyProperties(report, reportInfoVo); | |||
// 区划描述 | |||
String cityName = cityService.getCityName(reportInfoVo.getDriverArea()); | |||
reportInfoVo.setDriverAreaName(cityName); | |||
// 报告状态描述 | |||
reportInfoVo.setStatusName(report.getStatusList().get(report.getStatus())); | |||
// 获取巡检信息 | |||
TauvInspectDriver inspectDriver = inspectDriverMapper.selectById(report.getInspectDriverId()); | |||
if (inspectDriver != null) { | |||
reportInfoVo.setWeather(inspectDriver.getWeather()); | |||
reportInfoVo.setWind(inspectDriver.getWind()); | |||
reportInfoVo.setTemperature(inspectDriver.getTemperature()); | |||
reportInfoVo.setFlightSpeed(inspectDriver.getFlightSpeed().toString()); | |||
reportInfoVo.setFlightHeight(inspectDriver.getFlightHeight().toString()); | |||
reportInfoVo.setFlightTime(inspectDriver.getFlightTime().toString()); | |||
} | |||
TauvQuestionOptions question = new TauvQuestionOptions(); | |||
// 分类列表 | |||
Map<Integer, String> categoryList = question.getCategoryList(); | |||
// 类型列表 | |||
Map<Integer, String> typeList = question.getTypeList(); | |||
// 获取问题列表 | |||
List<TauvQuestionOptions> questionData = questionOptionsService.getDataList(); | |||
List<LSReportQuestionListVo> reportQuestionListVoList = new ArrayList<>(); | |||
if (!questionData.isEmpty()) { | |||
questionData.forEach(item -> { | |||
// 问题数量 | |||
Integer questionNum = inspectFileService.getReviewNumByInspectDriverId(item.getId(), report.getInspectDriverId()); | |||
// 报告备注 | |||
TauvReportRemark remarkInfo = reportRemarkService.getInfoByReportIdAndQuestionId(report.getId(), report.getId()); | |||
if (remarkInfo != null) { | |||
LSReportQuestionListVo reportQuestionListVo = new LSReportQuestionListVo(); | |||
reportQuestionListVo.setId(item.getId()); | |||
reportQuestionListVo.setCategory(item.getCategory()); | |||
reportQuestionListVo.setCategoryName(categoryList.get(item.getCategory())); | |||
reportQuestionListVo.setType(item.getType()); | |||
reportQuestionListVo.setTypeName(typeList.get(item.getType())); | |||
reportQuestionListVo.setQuestionNum(questionNum); | |||
reportQuestionListVo.setRemark(remarkInfo.getRemark()); | |||
reportQuestionListVo.setContent(item.getContent()); | |||
reportQuestionListVo.setNote(item.getNote()); | |||
reportQuestionListVo.setExamineScore(remarkInfo.getExamineScore()); | |||
reportQuestionListVo.setCheckScore(remarkInfo.getCheckScore()); | |||
reportQuestionListVoList.add(reportQuestionListVo); | |||
} | |||
}); | |||
} | |||
// 加入报告 | |||
reportInfoVo.setQuestionList(reportQuestionListVoList); | |||
// 报告描述 | |||
List<Map<String, Object>> reportDescList = reportEvaluationService.getDataByStatus(1); | |||
reportInfoVo.setReportDescList(reportDescList); | |||
// 获取问题清单 | |||
List<Map<String, Object>> questionFileList = inspectFileService.getReviewDataByInspectDriverId(report.getInspectDriverId()); | |||
List<LSReportQuestionFileListVo> questionFileListVoList = new ArrayList<>(); | |||
if (!questionFileList.isEmpty()) { | |||
questionFileList.forEach(item -> { | |||
// Map转对象 | |||
LSReportQuestionFileListVo questionFileListVo = JSON.parseObject(JSON.toJSONString(item), LSReportQuestionFileListVo.class); | |||
if (questionFileListVo.getStatus() == 1) { | |||
Integer questionId = questionFileListVo.getQuestionId(); | |||
if (questionId != null && questionId > 0) { | |||
TauvQuestionOptions questionOptions = questionOptionsService.getInfoById(Integer.valueOf(questionId)); | |||
questionFileListVo.setQuestionContent(questionOptions.getContent()); | |||
} | |||
} | |||
// 图片地址 | |||
if (!StringUtils.isEmpty(item.get("src").toString())) { | |||
questionFileListVo.setFormatSrc(uploadUrl + item.get("src")); | |||
} | |||
// 原始图片 | |||
if (!StringUtils.isEmpty(item.get("original_img").toString())) { | |||
questionFileListVo.setFormatOriginalImg(uploadUrl + item.get("original_img").toString()); | |||
} | |||
questionFileListVoList.add(questionFileListVo); | |||
}); | |||
} | |||
// 设置问题清单 | |||
reportInfoVo.setQuestionFileList(questionFileListVoList); | |||
return response.success(reportInfoVo); | |||
} | |||
} |
@@ -0,0 +1,166 @@ | |||
package com.taauav.front.vo; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import lombok.Data; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import java.math.BigInteger; | |||
import java.util.ArrayList; | |||
import java.util.Date; | |||
import java.util.List; | |||
import java.util.Map; | |||
/** | |||
* 报告详情Vo | |||
*/ | |||
@Data | |||
public class LSReportInfoVo { | |||
/** | |||
* 报告ID | |||
*/ | |||
private Integer id; | |||
/** | |||
* 报告编号 | |||
*/ | |||
private String reportNo; | |||
/** | |||
* 河流名称 | |||
*/ | |||
private String driverName; | |||
/** | |||
* 巡检时间 | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date inspectTime; | |||
/** | |||
* 巡检长度 | |||
*/ | |||
private String inspectLength; | |||
/** | |||
* 群中满意度(校核分) | |||
*/ | |||
private Integer manyiCheckScore; | |||
/** | |||
* 群中满意度(校核分) | |||
*/ | |||
private Integer manyiExamineScore; | |||
/** | |||
* 知晓率得分(考核分) | |||
*/ | |||
private Integer awareExamineScore; | |||
/** | |||
* 知晓率得分(校核分) | |||
*/ | |||
private Integer awareCheckScore; | |||
/** | |||
* 考核总分 | |||
*/ | |||
private Integer totalExamineScore; | |||
/** | |||
* 校核总分 | |||
*/ | |||
private Integer totalCheckScore; | |||
/** | |||
* 状态:1待生成 2审核中 3审核通过 4审核驳回 | |||
*/ | |||
private Integer status; | |||
/** | |||
* 状态描述 | |||
*/ | |||
private String statusName; | |||
/** | |||
* 报告描述 | |||
*/ | |||
private String description; | |||
/** | |||
* 区划ID | |||
*/ | |||
private BigInteger driverArea; | |||
/** | |||
* 区划描述 | |||
*/ | |||
private String driverAreaName; | |||
/** | |||
* 河流起点 | |||
*/ | |||
private String driverStart; | |||
/** | |||
* 河流终点 | |||
*/ | |||
private String driverEnd; | |||
/** | |||
* 视频地址 | |||
*/ | |||
private String videoUrl; | |||
/** | |||
* 图片地址 | |||
*/ | |||
private String imageUrl; | |||
/** | |||
* 天气 | |||
*/ | |||
private String weather; | |||
/** | |||
* 风速 | |||
*/ | |||
private String wind; | |||
/** | |||
* 温度 | |||
*/ | |||
private String temperature; | |||
/** | |||
* 飞行速度 | |||
*/ | |||
private String flightSpeed; | |||
/** | |||
* 飞行高度 | |||
*/ | |||
private String flightHeight; | |||
/** | |||
* 飞行时间 | |||
*/ | |||
private String flightTime; | |||
/** | |||
* 报告问题 | |||
*/ | |||
private List<LSReportQuestionListVo> questionList; | |||
/** | |||
* 报告描述列表 | |||
*/ | |||
private List<Map<String, Object>> reportDescList; | |||
/** | |||
* 问题清单列表 | |||
*/ | |||
private List<LSReportQuestionFileListVo> questionFileList; | |||
} |
@@ -0,0 +1,107 @@ | |||
package com.taauav.front.vo; | |||
import com.baomidou.mybatisplus.annotation.IdType; | |||
import com.baomidou.mybatisplus.annotation.TableId; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import lombok.Data; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import java.math.BigInteger; | |||
import java.util.Date; | |||
/** | |||
* 报告列表Vo | |||
*/ | |||
@Data | |||
public class LSReportListVo { | |||
/** | |||
* ID | |||
*/ | |||
@TableId(value = "id", type = IdType.AUTO) | |||
private Integer id; | |||
/** | |||
* 报告编号 | |||
*/ | |||
private String reportNo; | |||
/** | |||
* 河流名称 | |||
*/ | |||
private String driverName; | |||
/** | |||
* 河流区域ID | |||
*/ | |||
private BigInteger driverArea; | |||
/** | |||
* 区划描述 | |||
*/ | |||
private String driverAreaName; | |||
/** | |||
* 河流起点 | |||
*/ | |||
private String driverStart; | |||
/** | |||
* 河流终点 | |||
*/ | |||
private String driverEnd; | |||
/** | |||
* 巡检总长 | |||
*/ | |||
private String inspectLength; | |||
/** | |||
* 巡检时间 | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date inspectTime; | |||
/** | |||
* 执行时间 | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date executionTime; | |||
/** | |||
* 巡检任务状态:1待生成 2审核中 3审核通过 4审核驳回 | |||
*/ | |||
private Integer status; | |||
/** | |||
* 状态描述 | |||
*/ | |||
private String statusName; | |||
/** | |||
* 创建人 | |||
*/ | |||
private Integer createUser; | |||
/** | |||
* 创建时间 | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date createTime; | |||
/** | |||
* 更新人 | |||
*/ | |||
private Integer updateUser; | |||
/** | |||
* 更新时间 | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date updateTime; | |||
} |
@@ -0,0 +1,102 @@ | |||
package com.taauav.front.vo; | |||
import com.baomidou.mybatisplus.annotation.TableField; | |||
import lombok.Data; | |||
/** | |||
* 报告问题文件列表Vo | |||
*/ | |||
@Data | |||
public class LSReportQuestionFileListVo { | |||
/** | |||
* 问题文件ID | |||
*/ | |||
private Integer id; | |||
/** | |||
* 经度(地里坐标) | |||
*/ | |||
private String latitude; | |||
/** | |||
* 纬度(地里坐标) | |||
*/ | |||
private String longitude; | |||
/** | |||
* 详细描述 | |||
*/ | |||
private String description; | |||
/** | |||
* 附件地址 | |||
*/ | |||
private String src; | |||
/** | |||
* 原图 | |||
*/ | |||
private String originalImg; | |||
/** | |||
* 问题类型ID | |||
*/ | |||
private Integer questionId; | |||
/** | |||
* 状态 | |||
*/ | |||
private Integer status; | |||
/** | |||
* 文件归类 | |||
*/ | |||
private String fileDocument; | |||
/** | |||
* 百度经度 | |||
*/ | |||
private String baiduLatitude; | |||
/** | |||
* 百度纬度 | |||
*/ | |||
private String baiduLongitude; | |||
/** | |||
* 百度地址 | |||
*/ | |||
private String baiduAddress; | |||
/** | |||
* 高德经度 | |||
*/ | |||
private String gaodeLatitude; | |||
/** | |||
* 高德纬度 | |||
*/ | |||
private String gaodeLongitude; | |||
/** | |||
* 高德地址 | |||
*/ | |||
private String gaodeAddress; | |||
/** | |||
* 问题内容 | |||
*/ | |||
private String questionContent; | |||
/** | |||
* 图片地址 | |||
*/ | |||
private String formatSrc; | |||
/** | |||
* 原始图片地址 | |||
*/ | |||
private String formatOriginalImg; | |||
} |
@@ -0,0 +1,66 @@ | |||
package com.taauav.front.vo; | |||
import lombok.Data; | |||
/** | |||
* 问题列表Vo | |||
*/ | |||
@Data | |||
public class LSReportQuestionListVo { | |||
/** | |||
* 问题ID | |||
*/ | |||
private Integer id; | |||
/** | |||
* 分类:1水面 2岸线 3排口 4水质 | |||
*/ | |||
private Integer category; | |||
/** | |||
* 分类描述 | |||
*/ | |||
private String categoryName; | |||
/** | |||
* 类型:1日常监测 2重点核查 | |||
*/ | |||
private Integer type; | |||
/** | |||
* 问题描述 | |||
*/ | |||
private String typeName; | |||
/** | |||
* 问题数量 | |||
*/ | |||
private Integer questionNum; | |||
/** | |||
* 报告描述 | |||
*/ | |||
private String remark; | |||
/** | |||
* 问题选项 | |||
*/ | |||
private String content; | |||
/** | |||
* 备注 | |||
*/ | |||
private String note; | |||
/** | |||
* 考核分 | |||
*/ | |||
private Integer examineScore; | |||
/** | |||
* 校核分 | |||
*/ | |||
private Integer checkScore; | |||
} |
@@ -1,7 +1,7 @@ | |||
server: | |||
port: 8010 | |||
UPLOAD_URL: http://upload.manufacturecloud.com/ | |||
AVATAR_URL: /data/webroot/taauav/public/uploads/ | |||
AVATAR_URL: /data/java/lishui/public/upload/ | |||
IMAGE_URL: http://img.manufacturecloud.com/ | |||
servlet: | |||
context-path: / |