@@ -15,6 +15,7 @@ import org.springframework.util.StringUtils; | |||
import org.springframework.web.bind.annotation.*; | |||
import javax.validation.Valid; | |||
import java.math.BigInteger; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
@@ -44,6 +45,7 @@ public class TauvInspectDriverController { | |||
/** | |||
* 任务列表--未分配 | |||
* | |||
* @param map | |||
* @return | |||
*/ | |||
@@ -60,13 +62,14 @@ public class TauvInspectDriverController { | |||
/** | |||
* 任务列表--已分配 | |||
* | |||
* @param map | |||
* @return | |||
*/ | |||
@PostMapping("/assignedList") | |||
@RequiresPermissions(controllerName + ":assignedList") | |||
public Response assignedList(@RequestBody(required = false) Map<String, Object> map) { | |||
Byte[] st = new Byte[]{2,3,4,5,6}; | |||
Byte[] st = new Byte[]{2, 3, 4, 5, 6}; | |||
if (map == null) { | |||
map = new HashMap<>(); | |||
} | |||
@@ -81,12 +84,13 @@ public class TauvInspectDriverController { | |||
/** | |||
* 任务列表 | |||
* | |||
* @param map | |||
* @return | |||
*/ | |||
@PostMapping("/list") | |||
@RequiresPermissions(controllerName + ":list") | |||
public Response taskList(@RequestBody(required = false) Map<String,Object> map) { | |||
public Response taskList(@RequestBody(required = false) Map<String, Object> map) { | |||
if (map == null) { | |||
map = new HashMap<>(); | |||
} | |||
@@ -94,19 +98,20 @@ public class TauvInspectDriverController { | |||
if (map.containsKey(status) && !"".equals(map.get(status))) { | |||
map.put("status", new Byte[]{Byte.valueOf(map.get(status).toString())}); | |||
} else { | |||
map.put("status", new Byte[]{2,3,4,5,6}); | |||
map.put("status", new Byte[]{2, 3, 4, 5, 6}); | |||
} | |||
return iTauvInspectDriverService.getPageList(map, "list"); | |||
} | |||
/** | |||
* 分配任务 | |||
* | |||
* @param map | |||
* @return | |||
*/ | |||
@RequestMapping("/assignTask") | |||
@RequiresPermissions(controllerName + ":assign") | |||
public Response assignTask(@RequestBody Map<String,String> map) { | |||
public Response assignTask(@RequestBody Map<String, String> map) { | |||
return iTauvInspectDriverService.assignTask(map); | |||
} | |||
@@ -116,7 +121,7 @@ public class TauvInspectDriverController { | |||
@GetMapping("/detail") | |||
@RequiresPermissions(controllerName + ":" + PermissionConstants.VIEW_PERMISSION) | |||
public Response detail(@RequestBody @RequestParam("id") Integer id) { | |||
Map<String,Object> info = iTauvInspectDriverService.detail(id); | |||
Map<String, Object> info = iTauvInspectDriverService.detail(id); | |||
if (StringUtils.isEmpty(info.get("error"))) { | |||
return response.success(info); | |||
} else { | |||
@@ -126,17 +131,19 @@ public class TauvInspectDriverController { | |||
/** | |||
* 取消任务 | |||
* | |||
* @param map | |||
* @return | |||
*/ | |||
@PostMapping("/cancel") | |||
@RequiresPermissions(controllerName + ":cancel") | |||
public Response cancel(@RequestBody Map<String,String> map) { | |||
public Response cancel(@RequestBody Map<String, String> map) { | |||
return iTauvInspectDriverService.cancel(map); | |||
} | |||
/** | |||
* 执行任务 | |||
* | |||
* @return | |||
*/ | |||
@PostMapping("/executeTask") | |||
@@ -147,6 +154,7 @@ public class TauvInspectDriverController { | |||
/** | |||
* 获取打印的数据信息 | |||
* | |||
* @param id | |||
* @return | |||
*/ | |||
@@ -158,6 +166,7 @@ public class TauvInspectDriverController { | |||
/** | |||
* 获取基础数据 | |||
* | |||
* @return | |||
*/ | |||
@GetMapping("/basicData") | |||
@@ -167,16 +176,18 @@ public class TauvInspectDriverController { | |||
//状态数组 | |||
result.put("statusList", tauvInspect.getStatusList()); | |||
//分类数组 | |||
result.put("typeList",tauvInspect.getTypeList()); | |||
result.put("typeList", tauvInspect.getTypeList()); | |||
//区域数组 | |||
result.put("areaList",cityService.getCityListByPidAndAdmin(320100)); | |||
//result.put("areaList",cityService.getCityListByPidAndAdmin(320100)); | |||
result.put("areaList", cityService.getCityList(BigInteger.valueOf(Long.valueOf("320117")), true)); | |||
//飞行小组 | |||
result.put("adminList",adminService.getAdminListByGroupId(6)); | |||
result.put("adminList", adminService.getAdminListByGroupId(6)); | |||
return response.success("操作成功", result); | |||
} | |||
/** | |||
* 判断是否已生成报告 | |||
* | |||
* @param map | |||
* @return | |||
*/ | |||
@@ -190,6 +201,7 @@ public class TauvInspectDriverController { | |||
/** | |||
* 删除任务 | |||
* | |||
* @param map | |||
* @return | |||
*/ | |||
@@ -201,6 +213,7 @@ public class TauvInspectDriverController { | |||
/** | |||
* 重处理任务 | |||
* | |||
* @param map | |||
* @return | |||
*/ |
@@ -3,6 +3,7 @@ package com.taauav.admin.dto; | |||
import com.fasterxml.jackson.annotation.JsonIgnore; | |||
import lombok.Data; | |||
import java.math.BigInteger; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
@@ -45,7 +46,7 @@ public class BaseInspectDriverDTO { | |||
/** | |||
* 河流区域ID | |||
*/ | |||
private Integer driverArea; | |||
private BigInteger driverArea; | |||
/** | |||
* 报告id | |||
@@ -54,17 +55,18 @@ public class BaseInspectDriverDTO { | |||
/** | |||
* 状态类型 | |||
* | |||
* @return | |||
*/ | |||
@JsonIgnore | |||
public Map<Integer,String> getStatusList() { | |||
Map<Integer,String> map = new HashMap<>(); | |||
map.put(1,"待分配"); | |||
map.put(2,"待执行"); | |||
map.put(3,"执行中"); | |||
map.put(4,"已完成"); | |||
map.put(5,"复核中"); | |||
map.put(6,"复核完成"); | |||
public Map<Integer, String> getStatusList() { | |||
Map<Integer, String> map = new HashMap<>(); | |||
map.put(1, "待分配"); | |||
map.put(2, "待执行"); | |||
map.put(3, "执行中"); | |||
map.put(4, "已完成"); | |||
map.put(5, "复核中"); | |||
map.put(6, "复核完成"); | |||
return map; | |||
} | |||
} |
@@ -2,6 +2,7 @@ package com.taauav.admin.dto; | |||
import lombok.Data; | |||
import java.math.BigInteger; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
@@ -24,7 +25,7 @@ public class BaseReportDTO { | |||
private String inspectNo; | |||
private String driverName; | |||
private Integer driverArea; | |||
private BigInteger driverArea; | |||
private String driverAreaText; | |||
@@ -39,14 +40,15 @@ public class BaseReportDTO { | |||
/** | |||
* 状态列表 | |||
* | |||
* @return | |||
*/ | |||
public Map<Integer,String> getStatusList() { | |||
Map<Integer,String> map = new HashMap<>(); | |||
map.put(1,"待生成"); | |||
map.put(2,"审核中"); | |||
map.put(3,"审核通过"); | |||
map.put(4,"审核驳回"); | |||
public Map<Integer, String> getStatusList() { | |||
Map<Integer, String> map = new HashMap<>(); | |||
map.put(1, "待生成"); | |||
map.put(2, "审核中"); | |||
map.put(3, "审核通过"); | |||
map.put(4, "审核驳回"); | |||
return map; | |||
} | |||
} |
@@ -1,14 +1,20 @@ | |||
package com.taauav.admin.dto; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import lombok.Data; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import java.math.BigDecimal; | |||
import java.util.Date; | |||
/** | |||
* 任务信息展示 | |||
* | |||
* @author dyg | |||
* @date 2019/11/22 | |||
*/ | |||
@Data | |||
public class TauvInspectDriverDTO extends BaseInspectDriverDTO{ | |||
public class TauvInspectDriverDTO extends BaseInspectDriverDTO { | |||
/** | |||
* 飞行小组 | |||
*/ | |||
@@ -17,7 +23,9 @@ public class TauvInspectDriverDTO extends BaseInspectDriverDTO{ | |||
/** | |||
* 添加时间 | |||
*/ | |||
private Integer createTime; | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date createTime; | |||
private String formatCreateTime; | |||
/** | |||
* 添加人 | |||
@@ -27,36 +35,32 @@ public class TauvInspectDriverDTO extends BaseInspectDriverDTO{ | |||
/** | |||
* 状态 | |||
*/ | |||
private Byte status; | |||
private Integer status; | |||
private String statusText; | |||
/** | |||
* 任务类型 | |||
*/ | |||
private Byte type; | |||
private Integer type; | |||
private String typeText; | |||
/** | |||
* 期望巡检开始时间 | |||
* 期望巡检时间 | |||
*/ | |||
private Integer inspectStartTime; | |||
private String formatInspectStartTime; | |||
/** | |||
* 期望巡检结束时间 | |||
*/ | |||
private Integer inspectEndTime; | |||
private String formatInspectEndTime; | |||
@DateTimeFormat(pattern = "yyyy-MM-dd") | |||
@JsonFormat(pattern = "yyyy-MM-dd") | |||
private Date inspectTime; | |||
private String formatInspectTime; | |||
/** | |||
* 巡检长度 | |||
*/ | |||
private BigDecimal inspectLength; | |||
/** | |||
* 执行周期(如:每月10号) | |||
*/ | |||
private String executionCycle; | |||
// /** | |||
// * 执行周期(如:每月10号) | |||
// */ | |||
// private String executionCycle; | |||
/** | |||
* 报告创建时间 | |||
@@ -76,13 +80,17 @@ public class TauvInspectDriverDTO extends BaseInspectDriverDTO{ | |||
/** | |||
* 执行开始时间 | |||
*/ | |||
private Integer executionStartTime; | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date executionStartTime; | |||
private String formatExecutionStartTime; | |||
/** | |||
* 执行结束时间 | |||
*/ | |||
private Integer executionEndTime; | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date executionEndTime; | |||
private String formatExecutionEndTime; | |||
/** |
@@ -1,14 +1,17 @@ | |||
package com.taauav.admin.entity; | |||
import java.io.Serializable; | |||
import java.math.BigInteger; | |||
import java.util.Date; | |||
import com.baomidou.mybatisplus.annotation.IdType; | |||
import com.baomidou.mybatisplus.annotation.TableId; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import com.taauav.common.domain.Entity; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import lombok.Data; | |||
import lombok.EqualsAndHashCode; | |||
import lombok.experimental.Accessors; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
/** | |||
* <p> | |||
@@ -22,19 +25,25 @@ import lombok.experimental.Accessors; | |||
@EqualsAndHashCode(callSuper = false) | |||
@Accessors(chain = true) | |||
@TableName("sys_city") | |||
public class SysCity extends Entity { | |||
public class SysCity implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
/** | |||
* 编号 | |||
*/ | |||
@TableId(value = "id", type = IdType.AUTO) | |||
private BigInteger id; | |||
/** | |||
* 父级ID | |||
*/ | |||
private Integer pid; | |||
private BigInteger pid; | |||
/** | |||
* 层级:1省 2市 3区 | |||
*/ | |||
private Boolean level; | |||
private Integer level; | |||
/** | |||
* 省市区名称 | |||
@@ -76,4 +85,38 @@ public class SysCity extends Entity { | |||
*/ | |||
private Integer sort; | |||
/** | |||
* 状态 | |||
*/ | |||
private Integer status; | |||
/** | |||
* 创建人 | |||
*/ | |||
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; | |||
/** | |||
* 有效标识:1有效 0删除 | |||
*/ | |||
private Integer mark; | |||
} |
@@ -1,10 +1,12 @@ | |||
package com.taauav.admin.entity; | |||
import java.io.Serializable; | |||
import java.math.BigInteger; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
import com.baomidou.mybatisplus.annotation.IdType; | |||
import com.baomidou.mybatisplus.annotation.TableField; | |||
import com.baomidou.mybatisplus.annotation.TableId; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import com.taauav.common.domain.Entity; | |||
@@ -50,16 +52,10 @@ public class TauvDriver extends Entity { | |||
private Integer type; | |||
/** | |||
* 河道层级 | |||
* 河道层级:3县/区 4镇 5村 | |||
*/ | |||
private Integer level; | |||
/** | |||
* 河道等级:1省级 2市级 3区/县级 4镇级 5村级 | |||
*/ | |||
@NotNull(message = "请选择河道等级") | |||
private Integer grade; | |||
/** | |||
* 河长 | |||
*/ | |||
@@ -67,12 +63,6 @@ public class TauvDriver extends Entity { | |||
@Length(min = 2, max = 30, message = "河长长度为2-30个字") | |||
private String driverManager; | |||
/** | |||
* 区划ID | |||
*/ | |||
@NotNull(message = "请选择区划") | |||
private Integer agencyId; | |||
/** | |||
* 河道长度(单位:km) | |||
*/ | |||
@@ -91,7 +81,10 @@ public class TauvDriver extends Entity { | |||
@Length(max = 20, message = "终点长度不能超过20个字") | |||
private String endPoint; | |||
private String driverCode; | |||
/** | |||
* 河道编码 | |||
*/ | |||
private BigInteger driverArea; | |||
/** | |||
* 河流类型 | |||
@@ -120,17 +113,15 @@ public class TauvDriver extends Entity { | |||
} | |||
/** | |||
* 河湖等级 | |||
* 河湖层级 | |||
* | |||
* @return | |||
*/ | |||
public Map<Integer, String> getGradeList() { | |||
public Map<Integer, String> getLevelList() { | |||
Map<Integer, String> map = new HashMap<>(3); | |||
map.put(1, "省级"); | |||
map.put(2, "市级"); | |||
map.put(3, "区/县级"); | |||
map.put(4, "镇级"); | |||
map.put(5, "村级"); | |||
map.put(3, "县/区"); | |||
map.put(4, "镇"); | |||
map.put(5, "村"); | |||
return map; | |||
} | |||
} |
@@ -4,14 +4,17 @@ import java.math.BigDecimal; | |||
import com.baomidou.mybatisplus.annotation.TableField; | |||
import java.util.Date; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
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; | |||
import javax.validation.constraints.*; | |||
@@ -36,37 +39,24 @@ public class TauvInspect extends Entity { | |||
private String inspectNo; | |||
/** | |||
* 类型:1日常任务 2周期性任务 | |||
* 类型:1可见光巡检 2多光谱巡检 | |||
*/ | |||
@NotNull(message = "巡检类型不能为空") | |||
private Integer type; | |||
/** | |||
* 巡检目的 | |||
* 巡检时间 | |||
*/ | |||
@NotNull(message = "巡检目的不能为空") | |||
@Size(min = 1, max = 200, message = "巡检目的字数长度为1-200") | |||
private String inspectPurpose; | |||
/** | |||
* 巡检开始时间 | |||
*/ | |||
private Integer inspectStartTime; | |||
/** | |||
* 巡检结束时间 | |||
*/ | |||
private Integer inspectEndTime; | |||
@DateTimeFormat(pattern = "yyyy-MM-dd") | |||
@JsonFormat(pattern = "yyyy-MM-dd") | |||
private Date inspectTime; | |||
/** | |||
* 实际执行时间 | |||
*/ | |||
private Integer executionTime; | |||
/** | |||
* 执行周期(如:每月10号) | |||
*/ | |||
private String executionCycle; | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date executionTime; | |||
/** | |||
* 巡检总长(单位:KM) | |||
@@ -75,9 +65,14 @@ public class TauvInspect extends Entity { | |||
private BigDecimal inspectLength; | |||
/** | |||
* 巡检期望结果 | |||
* 备注 | |||
*/ | |||
private String note; | |||
/** | |||
* 附件地址 | |||
*/ | |||
private String inspectResult; | |||
private String attachment; | |||
/** | |||
* 河道任务 | |||
@@ -92,8 +87,8 @@ public class TauvInspect extends Entity { | |||
*/ | |||
public Map<Integer, String> getTypeList() { | |||
Map<Integer, String> map = new HashMap<>(2); | |||
map.put(1, "日常任务"); | |||
map.put(2, "周期任务"); | |||
map.put(1, "可见光巡检"); | |||
map.put(2, "多光谱巡检"); | |||
return map; | |||
} | |||
@@ -4,6 +4,7 @@ import java.math.BigDecimal; | |||
import java.io.Serializable; | |||
import java.math.BigInteger; | |||
import com.taauav.common.domain.Entity; | |||
import lombok.Data; | |||
@@ -58,7 +59,7 @@ public class TauvInspectDriver extends Entity implements Serializable { | |||
* 河流区域ID | |||
*/ | |||
@NotEmpty(message = "河流区域不能为空") | |||
private Integer driverArea; | |||
private BigInteger driverArea; | |||
/** | |||
* 河流长度(单位:KM) | |||
@@ -88,11 +89,6 @@ public class TauvInspectDriver extends Entity implements Serializable { | |||
*/ | |||
private String driverNote; | |||
/** | |||
* 是否省/国考河道:1是 2否 | |||
*/ | |||
private Integer driverExam; | |||
/** | |||
* 飞行小组 | |||
*/ |
@@ -3,6 +3,7 @@ package com.taauav.admin.entity; | |||
import com.baomidou.mybatisplus.annotation.TableField; | |||
import java.io.Serializable; | |||
import java.math.BigInteger; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
@@ -65,7 +66,7 @@ public class TauvReport extends Entity { | |||
/** | |||
* 河流区域ID | |||
*/ | |||
private Integer driverArea; | |||
private BigInteger driverArea; | |||
@TableField(exist = false) | |||
private String driverAreaText; | |||
/** |
@@ -3,7 +3,7 @@ | |||
<mapper namespace="com.taauav.admin.mapper.TauvInspectDriverMapper"> | |||
<select id="getPageList" parameterType="java.util.Map" resultType="com.taauav.admin.dto.TauvInspectDriverDTO"> | |||
select driver.* ,inspect.type,inspect.inspect_start_time,inspect.inspect_end_time,inspect.execution_cycle,inspect.inspect_length | |||
select driver.* ,inspect.type,inspect.inspect_time,inspect.inspect_length | |||
from tauv_inspect_driver driver left join tauv_inspect inspect on driver.inspect_id=inspect.id | |||
where driver.mark=1 | |||
<if test="param.type != null and param.type >0"> | |||
@@ -21,15 +21,12 @@ | |||
#{driver} | |||
</foreach> | |||
</if> | |||
<if test="param.executionTime != null and param.executionTime != ''"> | |||
and driver.execution_start_time >= #{param.executionTime} | |||
</if> | |||
<if test="param.inspectStartTime != null and param.inspectStartTime != ''"> | |||
and inspect.inspect_start_time >= #{param.inspectStartTime} | |||
</if> | |||
<if test="param.flightGroup != null and param.flightGroup != ''"> | |||
and driver.flight_group = #{param.flightGroup} | |||
<if test="param.inspectTime != null and param.inspectTime != ''"> | |||
and inspect.inspect_time >= #{param.inspectTime} | |||
</if> | |||
<!-- <if test="param.flightGroup != null and param.flightGroup != ''">--> | |||
<!-- and driver.flight_group = #{param.flightGroup}--> | |||
<!-- </if>--> | |||
<if test="param.status != null and param.status != '' "> | |||
and driver.status in | |||
<foreach collection="param.status" item="item" separator="," open="(" close=")"> | |||
@@ -40,9 +37,9 @@ | |||
<if test="param.allocation != null and param.allocation>0"> | |||
and driver.flight_group > 0 | |||
</if> | |||
<if test="param.driverExam != null and param.driverExam > 0"> | |||
and driver.driver_exam = #{param.driverExam} | |||
</if> | |||
<!-- <if test="param.driverExam != null and param.driverExam > 0">--> | |||
<!-- and driver.driver_exam = #{param.driverExam}--> | |||
<!-- </if>--> | |||
order by driver.status asc, driver.inspect_id desc, driver.num asc | |||
</select> | |||
@@ -20,8 +20,8 @@ public class TauvDriverQuery extends BaseQuery { | |||
private Integer type; | |||
/** | |||
* 河道等级 | |||
* 河道层级:3县区 4镇 5村 | |||
*/ | |||
private Integer grade; | |||
private Integer level; | |||
} |
@@ -1,9 +1,11 @@ | |||
package com.taauav.admin.service; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
import com.taauav.common.bean.Response; | |||
import com.taauav.admin.entity.SysCity; | |||
import com.taauav.common.service.IBaseService; | |||
import java.math.BigInteger; | |||
import java.util.List; | |||
import java.util.Map; | |||
@@ -15,7 +17,7 @@ import java.util.Map; | |||
* @author dyg | |||
* @since 2019-11-13 | |||
*/ | |||
public interface ISysCityService extends IBaseService<SysCity> { | |||
public interface ISysCityService extends IService<SysCity> { | |||
/** | |||
* 根据父级编号获取数据 | |||
* | |||
@@ -24,6 +26,15 @@ public interface ISysCityService extends IBaseService<SysCity> { | |||
*/ | |||
List<Map<String, Object>> getCityListByPid(Integer pid); | |||
/** | |||
* 获取城市列表 | |||
* | |||
* @param pid | |||
* @param isTree 是否树结构 | |||
* @return | |||
*/ | |||
List<SysCity> getCityList(BigInteger pid, boolean isTree); | |||
/** | |||
* 根据父级编号和用户信息获取城市列表 | |||
* | |||
@@ -38,7 +49,7 @@ public interface ISysCityService extends IBaseService<SysCity> { | |||
* @param id | |||
* @return | |||
*/ | |||
SysCity getInfoById(Integer id); | |||
SysCity getInfoById(BigInteger id); | |||
/** | |||
* 获取城市各辖区河道信息 |
@@ -1,6 +1,8 @@ | |||
package com.taauav.admin.service.impl; | |||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import com.taauav.admin.vo.TauvAgencyListVo; | |||
import com.taauav.common.bean.Response; | |||
import com.taauav.admin.entity.SysAdmin; | |||
import com.taauav.admin.entity.SysCity; | |||
@@ -11,10 +13,14 @@ import com.taauav.admin.service.ISysCityService; | |||
import com.taauav.common.service.impl.BaseServiceImpl; | |||
import com.taauav.common.util.ShiroUtils; | |||
import com.taauav.common.util.StringUtils; | |||
import io.netty.util.internal.StringUtil; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
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; | |||
@@ -27,7 +33,7 @@ import java.util.Map; | |||
* @since 2019-11-13 | |||
*/ | |||
@Service | |||
public class SysCityServiceImpl extends BaseServiceImpl<SysCityMapper, SysCity> implements ISysCityService { | |||
public class SysCityServiceImpl extends ServiceImpl<SysCityMapper, SysCity> implements ISysCityService { | |||
@Autowired | |||
private SysCityMapper sysCityMapper; | |||
@Autowired | |||
@@ -39,6 +45,7 @@ public class SysCityServiceImpl extends BaseServiceImpl<SysCityMapper, SysCity> | |||
/** | |||
* 根据上级编号获取数据 | |||
* | |||
* @param pid | |||
* @return | |||
*/ | |||
@@ -46,14 +53,62 @@ public class SysCityServiceImpl extends BaseServiceImpl<SysCityMapper, SysCity> | |||
public List<Map<String, Object>> getCityListByPid(Integer pid) { | |||
QueryWrapper<SysCity> queryWrapper = new QueryWrapper<>(); | |||
queryWrapper.eq("pid", pid); | |||
queryWrapper.eq("mark",1); | |||
queryWrapper.eq("mark", 1); | |||
queryWrapper.select("id,pid,name,longitude,latitude"); | |||
List<Map<String,Object>> list = sysCityMapper.selectMaps(queryWrapper); | |||
List<Map<String, Object>> list = sysCityMapper.selectMaps(queryWrapper); | |||
return list; | |||
} | |||
/** | |||
* 获取城市列表 | |||
* | |||
* @param pid 上级ID | |||
* @param isTree 是否树结构 | |||
* @return | |||
*/ | |||
@Override | |||
public List<SysCity> getCityList(BigInteger pid, boolean isTree) { | |||
List<SysCity> cityList = new ArrayList<>(); | |||
if (pid.toString().equals("320117")) { | |||
QueryWrapper<SysCity> queryWrapper2 = new QueryWrapper<>(); | |||
queryWrapper2.eq("id", pid); | |||
queryWrapper2.eq("mark", 1); | |||
queryWrapper2.select("id,pid,name,longitude,latitude"); | |||
SysCity city = sysCityMapper.selectOne(queryWrapper2); | |||
cityList.add(city); | |||
} | |||
QueryWrapper<SysCity> queryWrapper = new QueryWrapper<>(); | |||
queryWrapper.eq("pid", pid); | |||
queryWrapper.eq("mark", 1); | |||
queryWrapper.select("id,pid,name,longitude,latitude"); | |||
List<SysCity> list = sysCityMapper.selectList(queryWrapper); | |||
if (!list.isEmpty()) { | |||
// 获取子级 | |||
list.forEach(item -> { | |||
// 城市名称加层级修饰符 | |||
if (isTree) { | |||
item.setName("|--" + item.getName()); | |||
} | |||
cityList.add(item); | |||
List<SysCity> children = this.getCityList(BigInteger.valueOf(Long.valueOf(item.getId().toString())), isTree); | |||
if (!children.isEmpty()) { | |||
for (SysCity child : children) { | |||
// 城市名称加层级修饰符 | |||
if (isTree) { | |||
child.setName("|--" + child.getName()); | |||
} | |||
cityList.add(child); | |||
} | |||
} | |||
}); | |||
} | |||
return cityList; | |||
} | |||
/** | |||
* 根据父级id和用户城市权限获取城市列表 | |||
* 备注:待完善 | |||
* | |||
* @param pid | |||
* @return | |||
*/ | |||
@@ -70,7 +125,7 @@ public class SysCityServiceImpl extends BaseServiceImpl<SysCityMapper, SysCity> | |||
wrapper.eq("pid", pid); | |||
wrapper.eq("mark", 1); | |||
wrapper.select("id,pid,name,longitude,latitude"); | |||
List<Map<String,Object>> list = sysCityMapper.selectMaps(wrapper); | |||
List<Map<String, Object>> list = sysCityMapper.selectMaps(wrapper); | |||
return list; | |||
} else { | |||
return null; | |||
@@ -78,12 +133,13 @@ public class SysCityServiceImpl extends BaseServiceImpl<SysCityMapper, SysCity> | |||
} | |||
@Override | |||
public SysCity getInfoById(Integer id) { | |||
public SysCity getInfoById(BigInteger id) { | |||
return sysCityMapper.selectById(id); | |||
} | |||
/** | |||
* 获取城市各辖区河道信息 | |||
* | |||
* @param cityId | |||
* @return | |||
*/ |
@@ -4,7 +4,7 @@ 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.query.TauvDriverQuery; | |||
import com.taauav.admin.service.ITauvAgencyService; | |||
import com.taauav.admin.service.ISysCityService; | |||
import com.taauav.common.bean.Response; | |||
import com.taauav.admin.entity.SysAdmin; | |||
import com.taauav.admin.entity.TauvDriver; | |||
@@ -17,7 +17,7 @@ import org.springframework.beans.factory.annotation.Value; | |||
import org.springframework.stereotype.Service; | |||
import org.springframework.util.StringUtils; | |||
import javax.validation.Valid; | |||
import java.math.BigInteger; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
@@ -40,9 +40,9 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau | |||
@Autowired | |||
private ISysAdminService iSysAdminService; | |||
@Autowired | |||
private ITauvAgencyService agencyService; | |||
@Autowired | |||
private TauvDriverMapper driverMapper; | |||
@Autowired | |||
private ISysCityService cityService; | |||
/** | |||
* 获取河道列表 | |||
@@ -58,13 +58,13 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau | |||
if (!StringUtils.isEmpty(query.getName())) { | |||
queryWrapper.like("name", query.getName()); | |||
} | |||
// 河道类型 | |||
// 河道类型 | |||
if (query.getType() != null && query.getType() > 0) { | |||
queryWrapper.eq("type", query.getType()); | |||
} | |||
// 河道等级 | |||
if (query.getGrade() != null && query.getGrade() > 0) { | |||
queryWrapper.eq("grade", query.getGrade()); | |||
// 河道层级 | |||
if (query.getLevel() != null && query.getLevel() > 0) { | |||
queryWrapper.eq("level", query.getLevel()); | |||
} | |||
queryWrapper.eq("mark", 1); | |||
queryWrapper.orderByDesc("id"); | |||
@@ -80,7 +80,7 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau | |||
* @return | |||
*/ | |||
@Override | |||
public Response edit(@Valid TauvDriver driver) { | |||
public Response edit(TauvDriver driver) { | |||
if (driver == null) { | |||
return response.failure("数据不存在"); | |||
} | |||
@@ -88,7 +88,7 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau | |||
if (StringUtils.isEmpty(info)) { | |||
return response.failure("数据不存在"); | |||
} | |||
boolean result = this.editData(driver); | |||
boolean result = editData(driver); | |||
if (!result) { | |||
return response.failure("编辑失败"); | |||
} | |||
@@ -102,7 +102,7 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau | |||
* @return | |||
*/ | |||
@Override | |||
public Response add(@Valid TauvDriver driver) { | |||
public Response add(TauvDriver driver) { | |||
if (driver == null || driver.getId() == 0) { | |||
return response.failure("实体对象不存在"); | |||
} | |||
@@ -149,10 +149,10 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau | |||
map.put("driver_sn", info.getDriverSn()); | |||
map.put("name", info.getName()); | |||
map.put("type", info.getType()); | |||
map.put("geade", info.getGrade()); | |||
map.put("level", info.getLevel()); | |||
map.put("driver_manager", info.getDriverManager()); | |||
map.put("agency_id", info.getAgencyId()); | |||
map.put("agency_list", agencyService.getAgencyList(0)); | |||
map.put("driver_area", info.getDriverArea()); | |||
map.put("area_list", cityService.getCityListByPid(0)); | |||
map.put("length", info.getLength()); | |||
map.put("start_point", info.getStartPoint()); | |||
map.put("end_point", info.getEndPoint()); | |||
@@ -191,8 +191,8 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau | |||
TauvDriver driver = new TauvDriver(); | |||
Map<String, Object> map = new HashMap<>(3); | |||
map.put("type_list", driver.getTypeList()); | |||
map.put("agency_list", agencyService.getAgencyList(0)); | |||
map.put("grade_list", driver.getGradeList()); | |||
map.put("area_list", cityService.getCityList(BigInteger.valueOf(Long.valueOf("320117")), false)); | |||
map.put("level_list", driver.getLevelList()); | |||
return map; | |||
} | |||
@@ -22,6 +22,7 @@ import org.springframework.util.StringUtils; | |||
import java.io.File; | |||
import java.math.BigDecimal; | |||
import java.math.BigInteger; | |||
import java.text.SimpleDateFormat; | |||
import java.util.*; | |||
@@ -104,7 +105,7 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
TauvDriver driverInfo = iTauvDriverService.getInfoById(driverId); | |||
if (driverInfo != null) { | |||
driver.setDriverName(driverInfo.getName()); | |||
// driver.setDriverArea(driverInfo.getDriverArea()); | |||
driver.setDriverArea(driverInfo.getDriverArea()); | |||
BigDecimal bigDecimal = new BigDecimal(driverInfo.getLength()); | |||
driver.setDriverLength(bigDecimal); | |||
driver.setDriverStart(driverInfo.getStartPoint()); | |||
@@ -147,25 +148,25 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
pageSize = Integer.valueOf(map.get("pageSize").toString()); | |||
} | |||
//分配列表:期望巡检时间 任务列表:执行时间 | |||
String inspectStartTime = "inspectStartTime"; | |||
if (!StringUtils.isEmpty(map.get(inspectStartTime)) && Integer.valueOf(map.get(inspectStartTime).toString()) > 0) { | |||
String startTime = FunctionUtils.formatTime(Integer.valueOf(map.get(inspectStartTime).toString()), "yyyy-MM-dd") + " 00:00:00"; | |||
String inspectTime = "inspectTime"; | |||
if (!StringUtils.isEmpty(map.get(inspectTime))) { | |||
String startTime = FunctionUtils.formatTime(Integer.valueOf(map.get(inspectTime).toString()), "yyyy-MM-dd") + " 00:00:00"; | |||
Integer startStamp = FunctionUtils.dateToStamp(startTime); | |||
if ("list".equals(act)) { | |||
map.put("executionTime", startStamp); | |||
map.remove("inspectStartTime"); | |||
map.remove("inspectTime"); | |||
} else { | |||
map.put("inspectStartTime", startStamp); | |||
map.put("inspectTime", startStamp); | |||
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); | |||
} | |||
// //河道类型 | |||
// String driverExam = "driverExam"; | |||
// if (!StringUtils.isEmpty(map.get(driverExam)) && Integer.valueOf(map.get(driverExam).toString()) > 0) { | |||
// map.put("driverExam", Integer.valueOf(map.get(driverExam).toString())); | |||
// } else { | |||
// map.remove(driverExam); | |||
// } | |||
//区属 | |||
map = FunctionUtils.dealArea(map); | |||
} else { | |||
@@ -289,7 +290,7 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
} | |||
TauvInspect inspectInfo = inspectMapper.selectById(inspectId); | |||
Integer driverArea = info.getDriverArea(); | |||
BigInteger driverArea = info.getDriverArea(); | |||
detail.put("id", info.getId()); | |||
detail.put("inspectNo", info.getInspectNo()); | |||
detail.put("num", info.getNum()); | |||
@@ -315,16 +316,19 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
detail.put("flightHeight", info.getFlightHeight()); | |||
detail.put("flightSpeed", info.getFlightSpeed()); | |||
detail.put("flightGroup", info.getFlightGroup()); | |||
detail.put("inspectStartTime", inspectInfo.getInspectStartTime()); | |||
// 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("inspectPurpose", inspectInfo.getInspectPurpose()); | |||
//巡检结果 | |||
detail.put("inspectResult", inspectInfo.getInspectResult()); | |||
// //巡检目的 | |||
// detail.put("inspectPurpose", inspectInfo.getInspectPurpose()); | |||
// //巡检结果 | |||
// detail.put("inspectResult", inspectInfo.getInspectResult()); | |||
// 备注 | |||
detail.put("note", inspectInfo.getNote()); | |||
//执行时间 | |||
detail.put("executionStartTime", info.getExecutionStartTime()); | |||
return detail; | |||
@@ -411,16 +415,16 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
} | |||
Integer groupId = (Integer) info.get("flightGroup"); | |||
Long startTime = new Long(info.get("executionStartTime").toString()); | |||
Long inspectStartTime = new Long(info.get("inspectStartTime").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 (inspectStartTime > 0) { | |||
info.put("formatInspectStartTime", FunctionUtils.formatTime(inspectStartTime.intValue(), "yyyy-MM-dd HH:mm:ss")); | |||
if (inspectTime > 0) { | |||
info.put("formatinspectTime", FunctionUtils.formatTime(inspectTime.intValue(), "yyyy-MM-dd HH:mm:ss")); | |||
} else { | |||
info.put("formatInspectStartTime", ""); | |||
info.put("formatinspectTime", ""); | |||
} | |||
SysAdmin adminInfo = iSysAdminService.getAdminInfo(groupId); | |||
info.put("flightGroupText", StringUtils.isEmpty(adminInfo) ? "" : adminInfo.getRealname()); | |||
@@ -448,11 +452,19 @@ public class TauvInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri | |||
SysAdmin adminInfo = iSysAdminService.getAdminInfo(driver.getCreateUser()); | |||
driver.setFormatCreateUser(StringUtils.isEmpty(adminInfo) ? "" : adminInfo.getRealname()); | |||
driver.setFormatCreateTime(FunctionUtils.formatTime(driver.getCreateTime(), "yyyy-MM-dd HH:mm:ss")); | |||
driver.setFormatInspectStartTime(FunctionUtils.formatTime(driver.getInspectStartTime(), "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(FunctionUtils.formatTime(driver.getCreateTime(), "yyyy-MM-dd HH:mm:ss")); | |||
// driver.setFormatinspectTime(FunctionUtils.formatTime(driver.getinspectTime(), "yyyy-MM-dd HH:mm:ss")); | |||
// driver.setFormatInspectEndTime(FunctionUtils.formatTime(driver.getInspectEndTime(), "yyyy-MM-dd HH:mm:ss")); | |||
// driver.setFormatExecutionStartTime(FunctionUtils.formatTime(driver.getExecutionStartTime(), "yyyy-MM-dd HH:mm:ss")); | |||
// driver.setFormatExecutionEndTime(FunctionUtils.formatTime(driver.getExecutionEndTime(), "yyyy-MM-dd HH:mm:ss")); | |||
driver.setFormatCreateTime(DateUtil.format(driver.getCreateTime(), "yyyy-MM-dd HH:mm:ss")); | |||
driver.setFormatInspectTime(DateUtil.format(driver.getInspectTime(), "yyyy-MM-dd HH:mm:ss")); | |||
if (!StringUtils.isEmpty(driver.getExecutionStartTime())) { | |||
driver.setFormatExecutionStartTime(DateUtil.format(driver.getExecutionStartTime(), "yyyy-MM-dd HH:mm:ss")); | |||
} | |||
if (!StringUtils.isEmpty(driver.getExecutionEndTime())) { | |||
driver.setFormatExecutionEndTime(DateUtil.format(driver.getExecutionEndTime(), "yyyy-MM-dd HH:mm:ss")); | |||
} | |||
if (!StringUtils.isEmpty(driver.getDriverArea())) { | |||
SysCity cityInfo = iSysCityService.getInfoById(driver.getDriverArea()); | |||
driver.setDriverAreaText(StringUtils.isEmpty(cityInfo) ? "" : cityInfo.getName()); |
@@ -746,7 +746,6 @@ public class TauvInspectFileServiceImpl extends BaseServiceImpl<TauvInspectFileM | |||
report.setInspectStartTime(inspectDriver.getExecutionStartTime()); | |||
report.setInspectEndTime(inspectDriver.getExecutionEndTime()); | |||
report.setFlightGroup(inspectDriver.getFlightGroup()); | |||
report.setDriverExam(inspectDriver.getDriverExam()); | |||
report.setCreateTime(DateUtil.now()); | |||
report.setCreateUser(ShiroUtils.getAdminId()); | |||
reportMapper.insert(report); |
@@ -39,19 +39,24 @@ public class TauvInspectServiceImpl extends BaseServiceImpl<TauvInspectMapper, T | |||
*/ | |||
@Override | |||
public Response addTask(TauvInspect inspect) { | |||
Integer type = inspect.getType().intValue(); | |||
if (type.equals(2) && StringUtils.isEmpty(inspect.getExecutionCycle())) { | |||
return response.failure("巡检周期不能为空"); | |||
// 巡检类型校验 | |||
if (inspect.getType() == null || inspect.getType() <= 0) { | |||
return response.failure("请选择巡检类型"); | |||
} | |||
inspect.setCreateTime(DateUtil.now()); | |||
inspect.setCreateUser(ShiroUtils.getAdminId()); | |||
inspectMapper.insert(inspect); | |||
//生成巡检任务单号 | |||
// 创建巡检任务 | |||
boolean result = this.addData(inspect); | |||
if (!result) { | |||
return response.failure("巡检任务创建失败"); | |||
} | |||
// 生成巡检任务单号 | |||
String code = ""; | |||
if (type == 2) { | |||
code = "ZQ" + FunctionUtils.formatTime(FunctionUtils.getCurrentTime(), "yyyyMM"); | |||
} else { | |||
code = "RC" + FunctionUtils.formatTime(FunctionUtils.getCurrentTime(), "yyyyMM"); | |||
if (inspect.getType() == 1) { | |||
// 可见光巡检 | |||
code = "KJG" + FunctionUtils.formatTime(FunctionUtils.getCurrentTime(), "yyyyMM"); | |||
} else if (inspect.getType() == 2) { | |||
// 多光谱巡检 | |||
code = "DGP" + FunctionUtils.formatTime(FunctionUtils.getCurrentTime(), "yyyyMM"); | |||
} | |||
Integer id = inspect.getId(); | |||
String idStr = String.format("%04d", id); |
@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import java.io.*; | |||
import java.math.BigInteger; | |||
import java.util.ArrayList; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
@@ -110,7 +111,7 @@ public class FrontTestController { | |||
String start = jsonObject.getString("start"); | |||
String end = jsonObject.getString("end"); | |||
driver.setName(riverName); | |||
driver.setDriverCode(areaCode); | |||
// driver.setDriverCode(areaCode); | |||
if (riverType.equals("河流")) { | |||
driver.setType(1); | |||
} else if (riverType.equals("水库")) { |