@@ -38,6 +38,7 @@ SysAdminController { | |||
/** | |||
* 管理员列表接口 | |||
* | |||
* @param map | |||
* @return | |||
*/ | |||
@@ -49,13 +50,14 @@ SysAdminController { | |||
/** | |||
* 编辑-提交接口 | |||
* | |||
* @param map | |||
* @return | |||
*/ | |||
@PostMapping(value = "/edit") | |||
@RequiresPermissions(controllerName + ":" + PermissionConstants.EDIT_PERMISSION) | |||
public Response edit(@RequestBody @Valid SysAdmin map, BindingResult bindingResult) { | |||
if(bindingResult.hasErrors()){ | |||
if (bindingResult.hasErrors()) { | |||
String msg = bindingResult.getFieldError().getDefaultMessage(); | |||
return response.failure(msg); | |||
} | |||
@@ -64,6 +66,7 @@ SysAdminController { | |||
/** | |||
* 编辑-获取原数据接口 | |||
* | |||
* @param id | |||
* @return | |||
*/ | |||
@@ -79,13 +82,14 @@ SysAdminController { | |||
/** | |||
* 添加管理员 | |||
* | |||
* @param map | |||
* @return | |||
*/ | |||
@PostMapping("/add") | |||
@RequiresPermissions(controllerName + ":" + PermissionConstants.ADD_PERMISSION) | |||
public Response add(@RequestBody @Valid SysAdmin map, BindingResult bindingResult) { | |||
if(bindingResult.hasErrors()){ | |||
if (bindingResult.hasErrors()) { | |||
String msg = bindingResult.getFieldError().getDefaultMessage(); | |||
return response.failure(msg); | |||
} | |||
@@ -94,6 +98,7 @@ SysAdminController { | |||
/** | |||
* 删除管理员账号 | |||
* | |||
* @param map | |||
* @return | |||
*/ | |||
@@ -106,6 +111,7 @@ SysAdminController { | |||
/** | |||
* 重置密码接口 | |||
* | |||
* @param map | |||
* @return | |||
*/ | |||
@@ -118,6 +124,7 @@ SysAdminController { | |||
/** | |||
* 修改账户状态接口 | |||
* | |||
* @param map | |||
* @return | |||
*/ | |||
@@ -130,17 +137,19 @@ SysAdminController { | |||
/** | |||
* 设置账户权限接口 | |||
* | |||
* @param map | |||
* @return | |||
*/ | |||
@PostMapping("/setPermit") | |||
@RequiresPermissions("admin:setPermit") | |||
public Response setPermit(@RequestBody (required = false) Map<String,String> map) { | |||
public Response setPermit(@RequestBody(required = false) Map<String, String> map) { | |||
return iSysAdminService.setPermit(map); | |||
} | |||
/** | |||
* 获取所有管理员(组装option用) | |||
* | |||
* @return | |||
*/ | |||
@PostMapping("/getAdminList") | |||
@@ -150,6 +159,7 @@ SysAdminController { | |||
/** | |||
* 获取角色数组 | |||
* | |||
* @return | |||
*/ | |||
@PostMapping("/authList") | |||
@@ -159,6 +169,7 @@ SysAdminController { | |||
/** | |||
* 获取城市数组 | |||
* | |||
* @return | |||
*/ | |||
@GetMapping("/getCityList") | |||
@@ -171,4 +182,14 @@ SysAdminController { | |||
List<Map<String, Object>> cityList = cityService.listMaps(wrapper); | |||
return response.success("操作成功", cityList); | |||
} | |||
/** | |||
* 获取飞手列表【分配任务时使用】 | |||
* | |||
* @return | |||
*/ | |||
@PostMapping("/getFlyHandList") | |||
public Response getFlyHandList() { | |||
return response.success(iSysAdminService.getAdminListByGroupId(6)); | |||
} | |||
} |
@@ -6,7 +6,9 @@ import com.taauav.common.bean.Response; | |||
import com.taauav.common.constant.PermissionConstants; | |||
import com.taauav.admin.entity.TauvEquipment; | |||
import com.taauav.admin.service.ITauvEquipmentService; | |||
import com.taauav.common.util.DateUtil; | |||
import com.taauav.common.util.FunctionUtils; | |||
import org.apache.commons.lang3.time.DateUtils; | |||
import org.apache.shiro.authz.annotation.RequiresPermissions; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.util.StringUtils; | |||
@@ -76,7 +78,7 @@ public class TauvEquipmentController { | |||
return response.failure("数据不存在"); | |||
} | |||
Map<String, Object> info = FunctionUtils.transBean2Map(equipment); | |||
info.put("format_register_time", FunctionUtils.formatTime(equipment.getRegisterTime(), "yyyy-MM-dd HH:mm:ss")); | |||
info.put("format_register_time", DateUtil.format(equipment.getRegisterTime(), "yyyy-MM-dd HH:mm:ss")); | |||
info.put("typeList", equipment.getTypeList()); | |||
info.put("statusList", equipment.getStatusList()); | |||
return response.success(info); | |||
@@ -119,4 +121,14 @@ public class TauvEquipmentController { | |||
public Response getBaseData() { | |||
return response.success(iTauvEquipmentService.getBaseData()); | |||
} | |||
/** | |||
* 获取无人机设备列表 | |||
* | |||
* @return | |||
*/ | |||
@PostMapping("/getEquipmentList") | |||
public Response getEquipmentList(@RequestBody EquipmentQuery query) { | |||
return iTauvEquipmentService.getEquipmentList(query); | |||
} | |||
} |
@@ -1,6 +1,7 @@ | |||
package com.taauav.admin.controller; | |||
import com.taauav.admin.dto.TauvInspectDriverAssignTaskDTO; | |||
import com.taauav.common.bean.Response; | |||
import com.taauav.common.constant.PermissionConstants; | |||
import com.taauav.admin.entity.TauvInspect; | |||
@@ -96,7 +97,7 @@ public class TauvInspectDriverController { | |||
} | |||
String status = "status"; | |||
if (map.containsKey(status) && !"".equals(map.get(status))) { | |||
map.put("status", new Byte[]{Byte.valueOf(map.get(status).toString())}); | |||
map.put("status", Integer.valueOf(map.get(status).toString())); | |||
} else { | |||
map.put("status", new Byte[]{2, 3, 4, 5, 6}); | |||
} | |||
@@ -104,15 +105,26 @@ public class TauvInspectDriverController { | |||
} | |||
/** | |||
* 分配任务 | |||
* 获取待分类任务列表 | |||
* | |||
* @param map | |||
* @param inspectDriverIds 待分配任务ID集合 | |||
* @return | |||
*/ | |||
@GetMapping("/getAssignTaskList") | |||
public Response getAssignTaskList(String inspectDriverIds) { | |||
return iTauvInspectDriverService.getAssignTaskList(inspectDriverIds); | |||
} | |||
/** | |||
* 分配 | |||
* | |||
* @param inspectDriverAssignTaskDTO | |||
* @return | |||
*/ | |||
@RequestMapping("/assignTask") | |||
@RequiresPermissions(controllerName + ":assign") | |||
public Response assignTask(@RequestBody Map<String, String> map) { | |||
return iTauvInspectDriverService.assignTask(map); | |||
public Response assignTask(@RequestBody TauvInspectDriverAssignTaskDTO inspectDriverAssignTaskDTO) { | |||
return iTauvInspectDriverService.assignTask(inspectDriverAssignTaskDTO); | |||
} | |||
/** |
@@ -126,4 +126,15 @@ public class TauvMountEquipmentController extends BaseController { | |||
return tauvMountEquipmentService.getParamsList(); | |||
} | |||
/** | |||
* 获取挂载设备列表 | |||
* | |||
* @param query 查询条件 | |||
* @return | |||
*/ | |||
@PostMapping("/getMountEquipmentList") | |||
public Response getMountEquipmentList(@RequestBody MountEquipmentQuery query) { | |||
return tauvMountEquipmentService.getMountEquipmentList(query); | |||
} | |||
} |
@@ -0,0 +1,41 @@ | |||
package com.taauav.admin.dto; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import com.taauav.admin.entity.TauvInspectDriver; | |||
import lombok.Data; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import java.util.Date; | |||
import java.util.List; | |||
@Data | |||
public class TauvInspectDriverAssignTaskDTO { | |||
/** | |||
* 分配河流列表 | |||
*/ | |||
List<TauvInspectDriver> inspectDrivers; | |||
/** | |||
* 飞手ID | |||
*/ | |||
private Integer adminId; | |||
/** | |||
* 无人机设备ID | |||
*/ | |||
private Integer equipmentId; | |||
/** | |||
* 挂载设备ID | |||
*/ | |||
private Integer mountequipmentId; | |||
/** | |||
* 执行时间 | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date executionTime; | |||
} |
@@ -1,6 +1,10 @@ | |||
package com.taauav.admin.dto; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import lombok.Data; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import java.util.Date; | |||
/** | |||
* 分区统计 | |||
@@ -24,7 +28,9 @@ public class TauvReportDriverDTO extends BaseReportDTO { | |||
/** | |||
* 巡检时间 | |||
*/ | |||
private Integer inspectTime; | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date inspectTime; | |||
/** | |||
* 格式化巡检时间 |
@@ -1,16 +1,19 @@ | |||
package com.taauav.admin.entity; | |||
import java.io.Serializable; | |||
import java.util.Date; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
import com.baomidou.mybatisplus.annotation.IdType; | |||
import com.baomidou.mybatisplus.annotation.TableId; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import com.taauav.common.domain.Entity; | |||
import lombok.Data; | |||
import lombok.EqualsAndHashCode; | |||
import lombok.experimental.Accessors; | |||
import org.hibernate.validator.constraints.Length; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import javax.validation.constraints.NotEmpty; | |||
@@ -78,7 +81,9 @@ public class TauvEquipment extends Entity { | |||
/** | |||
* 注册时间 | |||
*/ | |||
private Integer registerTime; | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date registerTime; | |||
public Map<Integer, String> getStatusList() { | |||
Map<Integer, String> map = new HashMap<>(); |
@@ -5,11 +5,14 @@ import java.math.BigDecimal; | |||
import java.io.Serializable; | |||
import java.math.BigInteger; | |||
import java.util.Date; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import com.taauav.common.domain.Entity; | |||
import lombok.Data; | |||
import lombok.EqualsAndHashCode; | |||
import lombok.experimental.Accessors; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import javax.validation.constraints.NotEmpty; | |||
@@ -24,7 +27,7 @@ import javax.validation.constraints.NotEmpty; | |||
@Data | |||
@EqualsAndHashCode(callSuper = false) | |||
@Accessors(chain = true) | |||
public class TauvInspectDriver extends Entity implements Serializable { | |||
public class TauvInspectDriver extends Entity { | |||
private static final long serialVersionUID = 1L; | |||
@@ -80,29 +83,46 @@ public class TauvInspectDriver extends Entity implements Serializable { | |||
private String driverEnd; | |||
/** | |||
* 河流位置 | |||
* 河流图片 | |||
*/ | |||
private String driverImage; | |||
/** | |||
* 航线文件名 | |||
*/ | |||
private String driverFilename; | |||
/** | |||
* 航线文件 | |||
*/ | |||
private String driverFile; | |||
/** | |||
* 河流备注 | |||
*/ | |||
private String driverNote; | |||
/** | |||
* 飞行小组 | |||
* 飞行设备ID | |||
*/ | |||
private Integer equipmentId; | |||
/** | |||
* 挂载设备ID | |||
*/ | |||
private Integer flightGroup; | |||
private Integer mountequipmentId; | |||
/** | |||
* 执行开始时间 | |||
* 飞手ID | |||
*/ | |||
private Integer executionStartTime; | |||
private Integer flightHand; | |||
/** | |||
* 执行结束时间 | |||
* 执行时间 | |||
*/ | |||
private Integer executionEndTime; | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date executionTime; | |||
/** | |||
* 天气 | |||
@@ -146,6 +166,8 @@ public class TauvInspectDriver extends Entity implements Serializable { | |||
/** | |||
* 复核时间 | |||
*/ | |||
private Integer reviewTime; | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date reviewTime; | |||
} |
@@ -4,13 +4,16 @@ import com.baomidou.mybatisplus.annotation.TableField; | |||
import java.io.Serializable; | |||
import java.math.BigInteger; | |||
import java.util.Date; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import com.taauav.common.domain.Entity; | |||
import lombok.Data; | |||
import lombok.EqualsAndHashCode; | |||
import lombok.experimental.Accessors; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
/** | |||
* <p> | |||
@@ -92,7 +95,9 @@ public class TauvReport extends Entity { | |||
/** | |||
* 巡检开始时间 | |||
*/ | |||
private Integer inspectStartTime; | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date inspectStartTime; | |||
@TableField(exist = false) | |||
private String formatInspectStartTime; | |||
/** |
@@ -24,4 +24,9 @@ public class EquipmentQuery extends BaseQuery { | |||
*/ | |||
private Integer type; | |||
/** | |||
* 设备型号 | |||
*/ | |||
private String model; | |||
} |
@@ -24,4 +24,9 @@ public class MountEquipmentQuery extends BaseQuery { | |||
*/ | |||
private Integer type; | |||
/** | |||
* 设备型号 | |||
*/ | |||
private String model; | |||
} |
@@ -58,4 +58,12 @@ public interface ISysCityService extends IService<SysCity> { | |||
* @return | |||
*/ | |||
Response getCityDriverList(Integer cityId); | |||
/** | |||
* 根据城市ID获取城市名称 | |||
* | |||
* @param cityId | |||
* @return | |||
*/ | |||
String getCityName(BigInteger cityId); | |||
} |
@@ -62,4 +62,12 @@ public interface ITauvEquipmentService extends IBaseService<TauvEquipment> { | |||
* @return | |||
*/ | |||
Map<String, Object> getBaseData(); | |||
/** | |||
* 获取无人机列表 | |||
* | |||
* @param query 查询条件 | |||
* @return | |||
*/ | |||
Response getEquipmentList(EquipmentQuery query); | |||
} |
@@ -1,5 +1,6 @@ | |||
package com.taauav.admin.service; | |||
import com.taauav.admin.dto.TauvInspectDriverAssignTaskDTO; | |||
import com.taauav.common.bean.Response; | |||
import com.taauav.admin.entity.TauvInspect; | |||
import com.taauav.admin.entity.TauvInspectDriver; | |||
@@ -20,6 +21,7 @@ public interface ITauvInspectDriverService extends IBaseService<TauvInspectDrive | |||
/** | |||
* 添加任务对应数据 | |||
* | |||
* @param inspect | |||
* @return | |||
*/ | |||
@@ -27,50 +29,65 @@ public interface ITauvInspectDriverService extends IBaseService<TauvInspectDrive | |||
/** | |||
* 获取分页数据 | |||
* | |||
* @param map | |||
* @param act | |||
* @return | |||
*/ | |||
Response getPageList(Map<String,Object> map, String act); | |||
Response getPageList(Map<String, Object> map, String act); | |||
/** | |||
* 根据id获取数据 | |||
* | |||
* @param id | |||
* @return | |||
*/ | |||
TauvInspectDriver getInfoById(Integer id); | |||
/** | |||
* 批量分配任务 | |||
* @param map | |||
* 待分类任务ID集合 | |||
* | |||
* @param inspectDriverIds | |||
* @return | |||
*/ | |||
Response assignTask(Map<String,String> map); | |||
Response getAssignTaskList(String inspectDriverIds); | |||
/** | |||
* 分配任务 | |||
* @param id | |||
* @param flightGroupId | |||
* 批量分配任务 | |||
* | |||
* @param inspectDriverAssignTaskDTO | |||
* @return | |||
*/ | |||
boolean assignFlightGroup(Integer id,Integer flightGroupId); | |||
Response assignTask(TauvInspectDriverAssignTaskDTO inspectDriverAssignTaskDTO); | |||
// /** | |||
// * 分配任务 | |||
// * | |||
// * @param id | |||
// * @param flightGroupId | |||
// * @return | |||
// */ | |||
// boolean assignFlightGroup(Integer id, Integer flightGroupId); | |||
/** | |||
* 任务详情 | |||
* | |||
* @param id | |||
* @return | |||
*/ | |||
Map<String,Object> detail(Integer id); | |||
Map<String, Object> detail(Integer id); | |||
/** | |||
* 取消任务 | |||
* | |||
* @param map | |||
* @return | |||
*/ | |||
Response cancel(Map<String,String> map); | |||
Response cancel(Map<String, String> map); | |||
/** | |||
* 执行任务 | |||
* | |||
* @param executeTask | |||
* @return | |||
*/ | |||
@@ -78,6 +95,7 @@ public interface ITauvInspectDriverService extends IBaseService<TauvInspectDrive | |||
/** | |||
* 获取打印数据 | |||
* | |||
* @param id | |||
* @return | |||
*/ | |||
@@ -85,6 +103,7 @@ public interface ITauvInspectDriverService extends IBaseService<TauvInspectDrive | |||
/** | |||
* 判断是否已生成报告 | |||
* | |||
* @param map | |||
* @return | |||
*/ | |||
@@ -92,6 +111,7 @@ public interface ITauvInspectDriverService extends IBaseService<TauvInspectDrive | |||
/** | |||
* 删除任务 | |||
* | |||
* @param map | |||
* @return | |||
*/ | |||
@@ -99,6 +119,7 @@ public interface ITauvInspectDriverService extends IBaseService<TauvInspectDrive | |||
/** | |||
* 重处理任务 | |||
* | |||
* @param map | |||
* @return | |||
*/ |
@@ -71,4 +71,12 @@ public interface ITauvMountEquipmentService extends IBaseService<TauvMountEquipm | |||
*/ | |||
Response getParamsList(); | |||
/** | |||
* 获取挂载设备列表 | |||
* | |||
* @param query 查询条件 | |||
* @return | |||
*/ | |||
Response getMountEquipmentList(MountEquipmentQuery query); | |||
} |
@@ -12,6 +12,7 @@ import com.taauav.admin.service.IStatisticsService; | |||
import com.taauav.admin.service.ISysCityService; | |||
import com.taauav.admin.service.ITauvInspectFileService; | |||
import com.taauav.admin.service.ITauvReportService; | |||
import com.taauav.common.util.DateUtil; | |||
import com.taauav.common.util.FunctionUtils; | |||
import com.taauav.common.util.ShiroUtils; | |||
import lombok.extern.slf4j.Slf4j; | |||
@@ -132,7 +133,7 @@ public class StatisticsServiceImpl implements IStatisticsService { | |||
info.setDriverName(report.getDriverName()); | |||
info.setInspectTime(report.getInspectStartTime()); | |||
if (!StringUtils.isEmpty(report.getInspectStartTime())) { | |||
info.setFormatInspectStartTime(FunctionUtils.formatTime(report.getInspectStartTime(),"yyyy-MM-dd HH:mm:ss")); | |||
info.setFormatInspectStartTime(DateUtil.format(report.getInspectStartTime(),"yyyy-MM-dd HH:mm:ss")); | |||
} | |||
info.setTotalExamineScore(report.getTotalExamineScore()); | |||
List<Map<String,Object>> fileDocumentNums = iTauvInspectFileService.getNumByFileDocument(cityId, report.getInspectDriverId(), driverExam, startTime, endTime); |
@@ -19,10 +19,7 @@ import org.springframework.stereotype.Service; | |||
import javax.annotation.Resource; | |||
import java.math.BigInteger; | |||
import java.util.ArrayList; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.*; | |||
/** | |||
* <p> | |||
@@ -158,4 +155,27 @@ public class SysCityServiceImpl extends ServiceImpl<SysCityMapper, SysCity> impl | |||
} | |||
return response.success(cityList); | |||
} | |||
/** | |||
* 根据城市ID获取城市名称 | |||
* | |||
* @param cityId 城市ID | |||
* @return | |||
*/ | |||
@Override | |||
public String getCityName(BigInteger cityId) { | |||
List<String> nameList = new ArrayList<>(); | |||
while (cityId != null && cityId.compareTo(BigInteger.valueOf(320117)) >= 0) { | |||
SysCity cateInfo = sysCityMapper.selectById(cityId); | |||
if (cateInfo != null) { | |||
nameList.add(cateInfo.getName()); | |||
cityId = cateInfo.getPid(); | |||
} else { | |||
cityId = null; | |||
} | |||
} | |||
// 使用集合工具实现数组翻转 | |||
Collections.reverse(nameList); | |||
return org.apache.commons.lang3.StringUtils.join(nameList.toArray(), ">>"); | |||
} | |||
} |
@@ -191,4 +191,46 @@ public class TauvEquipmentServiceImpl extends BaseServiceImpl<TauvEquipmentMappe | |||
map.put("status_list", equipment.getStatusList()); | |||
return map; | |||
} | |||
/** | |||
* 获取无人机列表 | |||
* | |||
* @param query 查询条件 | |||
* @return | |||
*/ | |||
@Override | |||
public Response getEquipmentList(EquipmentQuery query) { | |||
// 查询条件 | |||
QueryWrapper<TauvEquipment> queryWrapper = new QueryWrapper<>(); | |||
// 无人机类型 | |||
if (query.getType() != null && query.getType() > 0) { | |||
queryWrapper.eq("type", query.getType()); | |||
} | |||
// 无人机型号 | |||
if (!StringUtils.isEmpty(query.getModel())) { | |||
queryWrapper.like("model", query.getModel()); | |||
} | |||
queryWrapper.eq("status", 1); | |||
queryWrapper.eq("mark", 1); | |||
queryWrapper.orderByDesc("id"); | |||
// 查询列表 | |||
List<TauvEquipment> equipmentList = equipmentMapper.selectList(queryWrapper); | |||
List<TauvEquipmentListVo> equipmentListVoList = new ArrayList<>(); | |||
if (!equipmentList.isEmpty()) { | |||
equipmentList.forEach(item -> { | |||
TauvEquipmentListVo equipmentListVo = new TauvEquipmentListVo(); | |||
// 拷贝属性 | |||
BeanUtils.copyProperties(item, equipmentListVo); | |||
// 设备类型 | |||
equipmentListVo.setTypeName(item.getTypeList().get(item.getType())); | |||
// 任务类型 | |||
equipmentListVo.setTaskTypeName(item.getTaskTypeList().get(item.getTaskType())); | |||
// 状态名称 | |||
equipmentListVo.setStatusName(item.getStatusList().get(item.getStatus())); | |||
equipmentListVoList.add(equipmentListVo); | |||
}); | |||
} | |||
return response.success(equipmentListVoList); | |||
} | |||
} |
@@ -2,6 +2,8 @@ package com.taauav.admin.service.impl; | |||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.taauav.admin.dto.TauvInspectDriverAssignTaskDTO; | |||
import com.taauav.admin.vo.TauvInspectDriverListVo; | |||
import com.taauav.common.bean.Response; | |||
import com.taauav.admin.dto.TauvInspectDriverDTO; | |||
import com.taauav.admin.entity.*; | |||
@@ -15,6 +17,7 @@ import com.taauav.common.util.FunctionUtils; | |||
import com.taauav.common.util.ShiroUtils; | |||
import com.taauav.admin.validate.ExecuteTask; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.BeanUtils; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.beans.factory.annotation.Value; | |||
import org.springframework.stereotype.Service; | |||
@@ -73,29 +76,55 @@ 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 (!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(); | |||
if (file.contains("temp")) { | |||
file = file.replace(uploadUrl, uploadFolder); | |||
File oldFile = new File(file); | |||
if (!oldFile.exists()) { | |||
return "图片不存在"; | |||
} | |||
String fileName = oldFile.getName(); | |||
if (fileName.contains("thumbnail")) { | |||
fileName = fileName.replace("-thumbnail", ""); | |||
return "文件不存在"; | |||
} | |||
//把文件移动到正式目录下 | |||
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); | |||
String destFile = uploadFolder + "file/file/" + year + "/" + month + "/" + day + "/"; | |||
boolean flag = FileUtil.cutGeneralFile(file, destFile); | |||
if (flag) { | |||
destImg = destImg.replace(uploadFolder, ""); | |||
driver.setDriverImage(destImg + fileName); | |||
// 文件名 | |||
String fileName = oldFile.getName(); | |||
destFile = destFile.replace(uploadFolder, ""); | |||
driver.setDriverFile(destFile + fileName); | |||
} else { | |||
return "图片保存失败了!"; | |||
} | |||
@@ -198,73 +227,183 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
} | |||
/** | |||
* 分配任务 | |||
* 获取待分配任务ID集合 | |||
* | |||
* @param map | |||
* @param inspectDriverIds 待分配任务ID(多个逗号","分隔) | |||
* @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; | |||
} | |||
public Response getAssignTaskList(String inspectDriverIds) { | |||
// 查询条件 | |||
QueryWrapper<TauvInspectDriver> queryWrapper = new QueryWrapper<>(); | |||
// 待分配任务 | |||
String arr[] = inspectDriverIds.split(","); | |||
ArrayList arrayList = new ArrayList(); | |||
for (String s : arr) { | |||
arrayList.add(s); | |||
} | |||
queryWrapper.in("id", arrayList); | |||
queryWrapper.eq("mark", 1); | |||
Boolean f = assignFlightGroup(id, adminId); | |||
if (!f) { | |||
msg = "分配失败"; | |||
break; | |||
} | |||
} | |||
if (StringUtils.isEmpty(msg)) { | |||
return response.success("操作成功"); | |||
} else { | |||
return response.failure("操作失败"); | |||
// 查询数据 | |||
List<TauvInspectDriver> inspectDriverList = inspectDriverMapper.selectList(queryWrapper); | |||
List<TauvInspectDriverListVo> inspectDriverListVoList = new ArrayList<>(); | |||
List<String> inspectTypeList = new ArrayList<>(); | |||
if (!inspectDriverList.isEmpty()) { | |||
inspectDriverList.forEach(item -> { | |||
TauvInspectDriverListVo inspectDriverListVo = new TauvInspectDriverListVo(); | |||
// 拷贝属性 | |||
BeanUtils.copyProperties(item, inspectDriverListVo); | |||
// 区划 | |||
String cityName = iSysCityService.getCityName(item.getDriverArea()); | |||
inspectDriverListVo.setDriverAreaName(cityName); | |||
// 图片地址 | |||
inspectDriverListVo.setDriverFile(uploadUrl + inspectDriverListVo.getDriverFile()); | |||
// 巡检时间 | |||
TauvInspect inspectInfo = inspectMapper.selectById(item.getInspectId()); | |||
if (inspectInfo != null) { | |||
inspectDriverListVo.setInspectTime(inspectInfo.getInspectTime()); | |||
String inspectType = inspectInfo.getTypeList().get(inspectInfo.getType()); | |||
if (!inspectTypeList.contains(inspectType)) { | |||
inspectTypeList.add(inspectType); | |||
} | |||
} | |||
inspectDriverListVoList.add(inspectDriverListVo); | |||
}); | |||
} | |||
// 返回结果 | |||
Map<String, Object> result = new HashMap<>(); | |||
result.put("inspectTypeList", inspectTypeList); | |||
result.put("inspectDriverList", inspectDriverListVoList); | |||
return response.success(result); | |||
} | |||
/** | |||
* 分配飞行小组 | |||
* 分配任务 | |||
* | |||
* @param id | |||
* @param flightGroupId | |||
* @param assignTaskDto | |||
* @return | |||
*/ | |||
@Override | |||
public boolean assignFlightGroup(Integer id, Integer flightGroupId) { | |||
TauvInspectDriver inspectDriver = new TauvInspectDriver(); | |||
inspectDriver.setId(id); | |||
inspectDriver.setFlightGroup(flightGroupId); | |||
inspectDriver.setStatus(Integer.valueOf("2")); | |||
Integer res = inspectDriverMapper.updateById(inspectDriver); | |||
if (res > 0) { | |||
return true; | |||
} else { | |||
return false; | |||
public Response assignTask(TauvInspectDriverAssignTaskDTO assignTaskDto) { | |||
// 验证河流是否为空 | |||
if (assignTaskDto.getInspectDrivers() == null) { | |||
return response.failure("河流信息不存在"); | |||
} | |||
// 执行时间 | |||
if (assignTaskDto.getExecutionTime() == null) { | |||
return response.failure("执行时间不能为空"); | |||
} | |||
// 无人机设备校验 | |||
if (assignTaskDto.getEquipmentId() == null || assignTaskDto.getEquipmentId() <= 0) { | |||
return response.failure("无人机设备不能为空"); | |||
} | |||
// 挂载设备 | |||
if (assignTaskDto.getMountequipmentId() == null || assignTaskDto.getMountequipmentId() <= 0) { | |||
return response.failure("挂载设备不能为空"); | |||
} | |||
// 飞手校验 | |||
if (assignTaskDto.getAdminId() == null || assignTaskDto.getAdminId() <= 0) { | |||
return response.failure("飞手不能为空"); | |||
} | |||
// 循环遍历河流信息 | |||
Integer totalNum = 0; | |||
for (TauvInspectDriver inspectDriver : assignTaskDto.getInspectDrivers()) { | |||
if (inspectDriver.getId() == null || inspectDriver.getId() <= 0) { | |||
continue; | |||
} | |||
// 执行时间 | |||
inspectDriver.setExecutionTime(assignTaskDto.getExecutionTime()); | |||
// 无人机设备 | |||
inspectDriver.setEquipmentId(assignTaskDto.getEquipmentId()); | |||
// 挂载设备 | |||
inspectDriver.setMountequipmentId(assignTaskDto.getMountequipmentId()); | |||
// 飞手 | |||
inspectDriver.setFlightHand(assignTaskDto.getAdminId()); | |||
// 设置已分配状态 | |||
inspectDriver.setStatus(2); | |||
// 更新巡检河流信息 | |||
boolean result = this.editData(inspectDriver); | |||
if (result) { | |||
totalNum++; | |||
} | |||
} | |||
if (totalNum == assignTaskDto.getInspectDrivers().size()) { | |||
return response.success("任务分配成功"); | |||
} | |||
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; | |||
// } | |||
// } | |||
/** | |||
* 详情 | |||
* | |||
@@ -298,14 +437,13 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
if (StringUtils.isEmpty(driverArea)) { | |||
detail.put("driverArea", ""); | |||
} else { | |||
SysCity cityInfo = iSysCityService.getInfoById(driverArea); | |||
detail.put("driverArea", StringUtils.isEmpty(cityInfo) ? "" : cityInfo.getName()); | |||
// SysCity cityInfo = iSysCityService.getInfoById(driverArea); | |||
// detail.put("driverArea", StringUtils.isEmpty(cityInfo) ? "" : cityInfo.getName()); | |||
String cityName = iSysCityService.getCityName(driverArea); | |||
detail.put("driverArea", cityName); | |||
} | |||
String executionTime = ""; | |||
if (info.getExecutionStartTime() > 0) { | |||
executionTime = FunctionUtils.formatTime(info.getExecutionStartTime(), "yyyy-MM-dd HH:mm:ss"); | |||
} | |||
detail.put("executionTime", executionTime); | |||
// detail.put("executionTime", executionTime); | |||
detail.put("driverStart", info.getDriverStart()); | |||
detail.put("driverEnd", info.getDriverEnd()); | |||
detail.put("driverLength", info.getDriverLength()); | |||
@@ -315,14 +453,19 @@ 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.getFlightGroup()); | |||
// detail.put("inspectTime", inspectInfo.getinspectTime()); | |||
detail.put("inspectTime", inspectInfo.getInspectTime()); | |||
//图片位置信息 | |||
if (!"".equals(info.getDriverImage())) { | |||
info.setDriverImage(uploadUrl + info.getDriverImage()); | |||
} | |||
detail.put("driverImage", info.getDriverImage()); | |||
detail.put("flightGroup", info.getFlightHand()); | |||
// 巡检时间 | |||
String inspectTime = ""; | |||
if (!StringUtils.isEmpty(inspectInfo.getInspectTime())) { | |||
inspectTime = DateUtil.format(inspectInfo.getInspectTime(), "yyyy-MM-dd HH:mm:ss"); | |||
} | |||
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()); | |||
// //巡检结果 | |||
@@ -330,7 +473,11 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
// 备注 | |||
detail.put("note", inspectInfo.getNote()); | |||
//执行时间 | |||
detail.put("executionStartTime", info.getExecutionStartTime()); | |||
String executionTime = ""; | |||
if (info.getExecutionTime() != null) { | |||
executionTime = DateUtil.format(info.getExecutionTime(), "yyyy-MM-dd HH:mm:ss"); | |||
} | |||
detail.put("executionTime", executionTime); | |||
return detail; | |||
} | |||
@@ -370,20 +517,19 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
*/ | |||
@Override | |||
public Response executeTask(ExecuteTask task) { | |||
String executionStartTime = task.getExecutionStartTime(); | |||
String executionEndTime = task.getExecutionEndTime(); | |||
// String executionTime = task.getExecutionTime(); | |||
Integer id = Integer.valueOf(task.getId()); | |||
Integer adminId = ShiroUtils.getAdminId(); | |||
TauvInspectDriver info = getInfoById(id); | |||
if (StringUtils.isEmpty(info)) { | |||
return response.failure("数据不存在"); | |||
} | |||
Integer fligGroup = info.getFlightGroup(); | |||
Integer fligGroup = info.getFlightHand(); | |||
if (!fligGroup.equals(adminId) && !fligGroup.equals(1)) { | |||
response.failure("只有被分配的小组才有权限"); | |||
} | |||
TauvInspectDriver inspectDriver = new TauvInspectDriver(); | |||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |||
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |||
inspectDriver.setWeather(task.getWeather()); | |||
inspectDriver.setWind(task.getWind()); | |||
@@ -392,10 +538,9 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
inspectDriver.setFlightSpeed(new BigDecimal(task.getFlightSpeed())); | |||
inspectDriver.setFlightTime(new BigDecimal(task.getFlightTime())); | |||
inspectDriver.setRemark(task.getRemark()); | |||
inspectDriver.setStatus(Integer.valueOf("3")); | |||
inspectDriver.setFlightGroup(adminId); | |||
inspectDriver.setExecutionStartTime(Integer.valueOf(executionStartTime)); | |||
inspectDriver.setExecutionEndTime(Integer.valueOf(executionEndTime)); | |||
inspectDriver.setStatus(3); | |||
inspectDriver.setFlightHand(adminId); | |||
inspectDriver.setExecutionTime(task.getExecutionTime()); | |||
inspectDriver.setId(id); | |||
inspectDriverMapper.updateById(inspectDriver); | |||
return response.success("执行成功"); |
@@ -16,6 +16,7 @@ import com.taauav.common.service.impl.BaseServiceImpl; | |||
import com.taauav.common.util.*; | |||
import org.apache.commons.beanutils.ConvertUtils; | |||
import org.apache.commons.codec.digest.DigestUtils; | |||
import org.apache.commons.lang3.time.DateUtils; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.beans.factory.annotation.Value; | |||
import org.springframework.stereotype.Service; | |||
@@ -699,7 +700,7 @@ public class TauvInspectFileServiceImpl extends BaseServiceImpl<TauvInspectFileM | |||
driver.setId(inspectDriverId); | |||
driver.setStatus(Integer.valueOf("5")); | |||
driver.setReviewUser(ShiroUtils.getAdminId()); | |||
driver.setReviewTime(FunctionUtils.getCurrentTime()); | |||
driver.setReviewTime(DateUtil.now()); | |||
inspectDriverMapper.updateById(driver); | |||
return response.success("复核成功"); | |||
} | |||
@@ -720,7 +721,7 @@ public class TauvInspectFileServiceImpl extends BaseServiceImpl<TauvInspectFileM | |||
return response.failure("数据不存在"); | |||
} | |||
info.setStatus(Integer.valueOf("6")); | |||
info.setReviewTime(FunctionUtils.getCurrentTime()); | |||
info.setReviewTime(DateUtil.now()); | |||
info.setReviewUser(ShiroUtils.getAdminId()); | |||
inspectDriverMapper.updateById(info); | |||
@@ -743,9 +744,8 @@ public class TauvInspectFileServiceImpl extends BaseServiceImpl<TauvInspectFileM | |||
report.setDriverStart(inspectDriver.getDriverStart()); | |||
report.setDriverEnd(inspectDriver.getDriverEnd()); | |||
report.setInspectLength(inspectDriver.getDriverLength().toString()); | |||
report.setInspectStartTime(inspectDriver.getExecutionStartTime()); | |||
report.setInspectEndTime(inspectDriver.getExecutionEndTime()); | |||
report.setFlightGroup(inspectDriver.getFlightGroup()); | |||
report.setInspectStartTime(inspectDriver.getExecutionTime()); | |||
report.setFlightGroup(inspectDriver.getFlightHand()); | |||
report.setCreateTime(DateUtil.now()); | |||
report.setCreateUser(ShiroUtils.getAdminId()); | |||
reportMapper.insert(report); |
@@ -7,12 +7,17 @@ import com.taauav.admin.service.ITauvInspectDriverService; | |||
import com.taauav.admin.service.ITauvInspectService; | |||
import com.taauav.common.service.impl.BaseServiceImpl; | |||
import com.taauav.common.util.DateUtil; | |||
import com.taauav.common.util.FileUtil; | |||
import com.taauav.common.util.FunctionUtils; | |||
import com.taauav.common.util.ShiroUtils; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.beans.factory.annotation.Value; | |||
import org.springframework.stereotype.Service; | |||
import org.springframework.util.StringUtils; | |||
import java.io.File; | |||
import java.util.Calendar; | |||
/** | |||
* <p> | |||
@@ -30,6 +35,10 @@ public class TauvInspectServiceImpl extends BaseServiceImpl<TauvInspectMapper, T | |||
private TauvInspectMapper inspectMapper; | |||
@Autowired | |||
private ITauvInspectDriverService iTauvInspectDriverService; | |||
@Value("${server.UPLOAD_URL}") | |||
private String uploadUrl; | |||
@Value("${file.uploadFolder}") | |||
private String uploadFolder; | |||
/** | |||
* 添加任务 | |||
@@ -62,6 +71,34 @@ public class TauvInspectServiceImpl extends BaseServiceImpl<TauvInspectMapper, T | |||
String idStr = String.format("%04d", id); | |||
inspect.setId(id); | |||
inspect.setInspectNo(code + idStr); | |||
// 图片处理 | |||
if (!StringUtils.isEmpty(inspect.getAttachment())) { | |||
// 如果上传了文件则对文件进行处理 | |||
String file = inspect.getAttachment(); | |||
if (file.contains("temp")) { | |||
file = file.replace(uploadUrl, uploadFolder); | |||
File oldFile = new File(file); | |||
if (!oldFile.exists()) { | |||
return response.failure("文件不存在"); | |||
} | |||
//把文件移动到正式目录下 | |||
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 destFile = uploadFolder + "file/file/" + year + "/" + month + "/" + day + "/"; | |||
boolean flag = FileUtil.cutGeneralFile(file, destFile); | |||
if (flag) { | |||
// 文件名 | |||
String fileName = oldFile.getName(); | |||
destFile = destFile.replace(uploadFolder, ""); | |||
inspect.setAttachment(destFile + fileName); | |||
} else { | |||
return response.failure("图片保存失败了"); | |||
} | |||
} | |||
} | |||
saveOrUpdate(inspect); | |||
String msg = iTauvInspectDriverService.batchAddData(inspect); | |||
if (!"".equals(msg)) { |
@@ -203,4 +203,44 @@ public class TauvMountEquipmentServiceImpl extends BaseServiceImpl<TauvMountEqui | |||
result.put("type_list", CommonConstant.MOUNT_EQUIPMENT_TYPE_LIST); | |||
return response.success(result); | |||
} | |||
/** | |||
* 获取挂载设备列表 | |||
* | |||
* @param query 查询条件 | |||
* @return | |||
*/ | |||
@Override | |||
public Response getMountEquipmentList(MountEquipmentQuery query) { | |||
// 查询条件 | |||
QueryWrapper<TauvMountEquipment> queryWrapper = new QueryWrapper<>(); | |||
// 设备类型 | |||
if (query.getType() != null && query.getType() > 0) { | |||
queryWrapper.eq("type", 1); | |||
} | |||
// 设备型号 | |||
if (!StringUtils.isEmpty(query.getModel())) { | |||
queryWrapper.like("model", query.getModel()); | |||
} | |||
queryWrapper.eq("status", 1); | |||
queryWrapper.eq("mark", 1); | |||
queryWrapper.orderByDesc("id"); | |||
// 查询数据 | |||
List<TauvMountEquipment> mountEquipmentList = mountEquipmentMapper.selectList(queryWrapper); | |||
List<TauvMountEquipmentListVo> mountEquipmentListVoList = new ArrayList<>(); | |||
if (!mountEquipmentList.isEmpty()) { | |||
mountEquipmentList.forEach(item -> { | |||
TauvMountEquipmentListVo mountEquipmentListVo = new TauvMountEquipmentListVo(); | |||
// 拷贝属性 | |||
BeanUtils.copyProperties(item, mountEquipmentListVo); | |||
// 类型描述 | |||
mountEquipmentListVo.setTypeName(CommonConstant.MOUNT_EQUIPMENT_TYPE_LIST.get(item.getType())); | |||
// 状态描述 | |||
mountEquipmentListVo.setStatusName(CommonConstant.MOUNT_EQUIPMENT_STATUS_LIST.get(item.getStatus())); | |||
mountEquipmentListVoList.add(mountEquipmentListVo); | |||
}); | |||
} | |||
return response.success(mountEquipmentListVoList); | |||
} | |||
} |
@@ -469,7 +469,7 @@ public class TauvReportServiceImpl extends BaseServiceImpl<TauvReportMapper, Tau | |||
} | |||
data.put("questionFileList", questionFileList); | |||
String format = "yyyy-MM-dd HH:mm:ss"; | |||
data.put("inspectStartTime", StringUtils.isEmpty(reportInfo.getInspectStartTime()) ? "" : FunctionUtils.formatTime(reportInfo.getInspectStartTime(), format)); | |||
data.put("inspectStartTime", StringUtils.isEmpty(reportInfo.getInspectStartTime()) ? "" : DateUtil.format(reportInfo.getInspectStartTime(), format)); | |||
data.put("driverStart", reportInfo.getDriverStart()); | |||
data.put("driverEnd", reportInfo.getDriverEnd()); | |||
data.put("inspectLength", reportInfo.getInspectLength()); | |||
@@ -664,7 +664,7 @@ public class TauvReportServiceImpl extends BaseServiceImpl<TauvReportMapper, Tau | |||
* @param remark | |||
* @return | |||
*/ | |||
private void checkSub(Integer reportId, Integer inspectDriverId, String remark,Integer status) { | |||
private void checkSub(Integer reportId, Integer inspectDriverId, String remark, Integer status) { | |||
TauvInspectDriver inspectDriver = new TauvInspectDriver(); | |||
inspectDriver.setId(inspectDriverId); | |||
inspectDriver.setStatus(Integer.valueOf("4")); | |||
@@ -702,7 +702,7 @@ public class TauvReportServiceImpl extends BaseServiceImpl<TauvReportMapper, Tau | |||
} else { | |||
info.setDriverAreaText(""); | |||
} | |||
info.setFormatInspectStartTime(StringUtils.isEmpty(info.getInspectStartTime()) ? "" : FunctionUtils.formatTime(info.getInspectStartTime(), "yyyy-MM-dd HH:mm:ss")); | |||
info.setFormatInspectStartTime(StringUtils.isEmpty(info.getInspectStartTime()) ? "" : DateUtil.format(info.getInspectStartTime(), "yyyy-MM-dd HH:mm:ss")); | |||
} | |||
return info; | |||
} |
@@ -1,10 +1,14 @@ | |||
package com.taauav.admin.validate; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import lombok.Data; | |||
import org.hibernate.validator.constraints.Length; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import javax.validation.constraints.DecimalMin; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
import java.util.Date; | |||
/** | |||
* @author dyg | |||
@@ -16,9 +20,13 @@ public class ExecuteTask { | |||
@NotNull(message = "任务编号不能为空") | |||
private Integer id; | |||
private String executionStartTime; | |||
/** | |||
* 执行时间 | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date executionTime; | |||
private String executionEndTime; | |||
@Length(min = 1, max = 20, message = "天气为1-20个字符") | |||
@NotBlank(message = "天气不能为空") | |||
private String weather; | |||
@@ -45,7 +53,7 @@ public class ExecuteTask { | |||
@DecimalMin(value = "0", message = "飞行时间只能输入合理的数字") | |||
@NotBlank(message = "飞行时间不能为空") | |||
private String flightTime; | |||
@Length(max = 200, message = "备注不能超过200个字符") | |||
private String remark; | |||
} |
@@ -9,6 +9,7 @@ import org.hibernate.validator.constraints.Length; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import javax.validation.constraints.NotEmpty; | |||
import java.util.Date; | |||
/** | |||
* 飞行设备列表Vo | |||
@@ -55,7 +56,7 @@ public class TauvEquipmentListVo { | |||
/** | |||
* 类型:1多旋翼 2固定翼 | |||
*/ | |||
private Byte type; | |||
private Integer type; | |||
/** | |||
* 类型名称 | |||
@@ -67,17 +68,22 @@ public class TauvEquipmentListVo { | |||
*/ | |||
private Integer taskType; | |||
/** | |||
* 任务类型描述 | |||
*/ | |||
private String taskTypeName; | |||
/** | |||
* 注册时间 | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Integer registerTime; | |||
private Date registerTime; | |||
/** | |||
* 状态:1正常 2停用 | |||
*/ | |||
private Byte status; | |||
private Integer status; | |||
/** | |||
* 状态描述 | |||
@@ -97,11 +103,15 @@ public class TauvEquipmentListVo { | |||
/** | |||
* 创建时间 | |||
*/ | |||
private Integer createTime; | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date createTime; | |||
/** | |||
* 更新时间 | |||
*/ | |||
private Integer updateTime; | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date updateTime; | |||
} |
@@ -0,0 +1,95 @@ | |||
package com.taauav.admin.vo; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import lombok.Data; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import javax.validation.constraints.NotEmpty; | |||
import java.math.BigDecimal; | |||
import java.math.BigInteger; | |||
import java.util.Date; | |||
/** | |||
* 巡检河流列表Vo | |||
*/ | |||
@Data | |||
public class TauvInspectDriverListVo { | |||
/** | |||
* 巡检河流ID | |||
*/ | |||
private Integer id; | |||
/** | |||
* 巡检任务ID | |||
*/ | |||
private Integer inspectId; | |||
/** | |||
* 巡检时间 | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd") | |||
@JsonFormat(pattern = "yyyy-MM-dd") | |||
private Date inspectTime; | |||
/** | |||
* 行号(以10的倍数递增) | |||
*/ | |||
private Integer num; | |||
/** | |||
* 巡检任务单号对应的河流子编号 | |||
*/ | |||
private String inspectNo; | |||
/** | |||
* 河道ID | |||
*/ | |||
private Integer driverId; | |||
/** | |||
* 河流名称 | |||
*/ | |||
private String driverName; | |||
/** | |||
* 区划ID | |||
*/ | |||
private BigInteger driverArea; | |||
/** | |||
* 区划名称 | |||
*/ | |||
private String driverAreaName; | |||
/** | |||
* 河流长度(单位:KM) | |||
*/ | |||
private BigDecimal driverLength; | |||
/** | |||
* 河流起点 | |||
*/ | |||
private String driverStart; | |||
/** | |||
* 河流终点 | |||
*/ | |||
private String driverEnd; | |||
/** | |||
* 航线文件名 | |||
*/ | |||
private String driverFilename; | |||
/** | |||
* 航线文件 | |||
*/ | |||
private String driverFile; | |||
/** | |||
* 河流备注 | |||
*/ | |||
private String driverNote; | |||
} |
@@ -2,7 +2,11 @@ package com.taauav.admin.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.util.Date; | |||
/** | |||
* 挂载设备列表Vo | |||
@@ -69,11 +73,15 @@ public class TauvMountEquipmentListVo { | |||
/** | |||
* 创建时间 | |||
*/ | |||
private Integer createTime; | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date createTime; | |||
/** | |||
* 更新时间 | |||
*/ | |||
private Integer updateTime; | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date updateTime; | |||
} |