@@ -0,0 +1,80 @@ | |||
package com.taauav.admin.controller; | |||
import com.taauav.admin.controller.BaseController; | |||
import com.taauav.admin.dto.TauvInspectPhotoDTO; | |||
import com.taauav.common.bean.Response; | |||
import org.apache.shiro.authz.annotation.RequiresPermissions; | |||
import com.taauav.common.core.mps.BaseQuery; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.GetMapping; | |||
import org.springframework.web.bind.annotation.PostMapping; | |||
import org.springframework.web.bind.annotation.PutMapping; | |||
import org.springframework.web.bind.annotation.DeleteMapping; | |||
import org.springframework.web.bind.annotation.PathVariable; | |||
import org.springframework.web.bind.annotation.RequestBody; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import com.taauav.admin.entity.TauvInspectPhoto; | |||
import com.taauav.admin.service.ITauvInspectPhotoService; | |||
/** | |||
* 巡检正摄图Controller | |||
* | |||
* @author daixiantong | |||
* @date 20200518 | |||
*/ | |||
@RestController | |||
@RequestMapping("/admin/photo") | |||
public class TauvInspectPhotoController extends BaseController { | |||
@Autowired | |||
private ITauvInspectPhotoService tauvInspectPhotoService; | |||
@Autowired | |||
private Response response; | |||
/** | |||
* 查询巡检正摄图列表 | |||
*/ | |||
// @RequiresPermissions("admin:photo:list") | |||
@GetMapping("/list") | |||
public Response list(TauvInspectPhotoDTO inspectPhotoDTO, BaseQuery query) { | |||
return tauvInspectPhotoService.selectPhotoPage(inspectPhotoDTO, query); | |||
} | |||
/** | |||
* 获取巡检正摄图详细信息 | |||
*/ | |||
// @RequiresPermissions("admin:photo:query") | |||
@GetMapping(value = "/{id}") | |||
public Response getInfo(@PathVariable("id") Integer id) { | |||
return response.success(tauvInspectPhotoService.getInfo(id)); | |||
} | |||
/** | |||
* 新增巡检正摄图 | |||
*/ | |||
@RequiresPermissions("admin:photo:add") | |||
@PostMapping | |||
public Response add(@RequestBody TauvInspectPhoto tauvInspectPhoto) { | |||
return response.success(tauvInspectPhotoService.save(tauvInspectPhoto)); | |||
} | |||
/** | |||
* 修改巡检正摄图 | |||
*/ | |||
// @RequiresPermissions("admin:photo:edit") | |||
@PostMapping("/edit") | |||
public Response edit(@RequestBody TauvInspectPhoto tauvInspectPhoto) { | |||
return tauvInspectPhotoService.editPhoto(tauvInspectPhoto); | |||
} | |||
/** | |||
* 删除巡检正摄图 | |||
*/ | |||
@RequiresPermissions("admin:photo:remove") | |||
@DeleteMapping("/{ids}") | |||
public Response remove(@PathVariable Integer[] ids) { | |||
return response.success(tauvInspectPhotoService.deleteByIds(ids, new TauvInspectPhoto())); | |||
} | |||
} |
@@ -0,0 +1,79 @@ | |||
package com.taauav.admin.controller; | |||
import com.taauav.admin.controller.BaseController; | |||
import com.taauav.common.bean.Response; | |||
import org.apache.shiro.authz.annotation.RequiresPermissions; | |||
import com.taauav.common.core.mps.BaseQuery; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.GetMapping; | |||
import org.springframework.web.bind.annotation.PostMapping; | |||
import org.springframework.web.bind.annotation.PutMapping; | |||
import org.springframework.web.bind.annotation.DeleteMapping; | |||
import org.springframework.web.bind.annotation.PathVariable; | |||
import org.springframework.web.bind.annotation.RequestBody; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import com.taauav.admin.entity.TauvInspectTrack; | |||
import com.taauav.admin.service.ITauvInspectTrackService; | |||
/** | |||
* 巡检飞行轨迹Controller | |||
* | |||
* @author daixiantong | |||
* @date 20200518 | |||
*/ | |||
@RestController | |||
@RequestMapping("/admin/track") | |||
public class TauvInspectTrackController extends BaseController { | |||
@Autowired | |||
private ITauvInspectTrackService tauvInspectTrackService; | |||
@Autowired | |||
private Response response; | |||
/** | |||
* 查询巡检飞行轨迹列表 | |||
*/ | |||
@RequiresPermissions("admin:track:list") | |||
@GetMapping("/list") | |||
public Response list(TauvInspectTrack tauvInspectTrack, BaseQuery query) { | |||
return tauvInspectTrackService.pageData(query, tauvInspectTrack); | |||
} | |||
/** | |||
* 获取巡检飞行轨迹详细信息 | |||
*/ | |||
@RequiresPermissions("admin:track:query") | |||
@GetMapping(value = "/{id}") | |||
public Response getInfo(@PathVariable("id") Integer id) { | |||
return response.success(tauvInspectTrackService.getInfo(id)); | |||
} | |||
/** | |||
* 新增巡检飞行轨迹 | |||
*/ | |||
@RequiresPermissions("admin:track:add") | |||
@PostMapping | |||
public Response add(@RequestBody TauvInspectTrack tauvInspectTrack) { | |||
return response.success(tauvInspectTrackService.save(tauvInspectTrack)); | |||
} | |||
/** | |||
* 修改巡检飞行轨迹 | |||
*/ | |||
@RequiresPermissions("admin:track:edit") | |||
@PutMapping | |||
public Response edit(@RequestBody TauvInspectTrack tauvInspectTrack) { | |||
return response.success(tauvInspectTrackService.updateById(tauvInspectTrack)); | |||
} | |||
/** | |||
* 删除巡检飞行轨迹 | |||
*/ | |||
@RequiresPermissions("admin:track:remove") | |||
@DeleteMapping("/{ids}") | |||
public Response remove(@PathVariable Integer[] ids) { | |||
return response.success(tauvInspectTrackService.deleteByIds(ids, new TauvInspectTrack())); | |||
} | |||
} |
@@ -0,0 +1,47 @@ | |||
package com.taauav.admin.dto; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import lombok.Data; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import java.math.BigInteger; | |||
import java.util.Date; | |||
/** | |||
* 正摄图管理列表请求实体类 | |||
* | |||
* @author daixiantong | |||
* @date 2020-05-18 | |||
*/ | |||
@Data | |||
public class TauvInspectPhotoDTO { | |||
/** | |||
* 任务单号 | |||
*/ | |||
private String inspectNo; | |||
/** | |||
* 区属id | |||
*/ | |||
private BigInteger driverArea; | |||
/** | |||
* 河湖名称 | |||
*/ | |||
private String driverName; | |||
/** | |||
* 巡检时间(开始) | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd") | |||
@JsonFormat(pattern = "yyyy-MM-dd") | |||
private Date startTime; | |||
/** | |||
* 巡检时间(结束) | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd") | |||
@JsonFormat(pattern = "yyyy-MM-dd") | |||
private Date endTime; | |||
} |
@@ -0,0 +1,43 @@ | |||
package com.taauav.admin.entity; | |||
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 java.util.Date; | |||
/** | |||
* 巡检正摄图对象 tauv_inspect_photo | |||
* | |||
* @author daixiantong | |||
* @date 20200518 | |||
*/ | |||
@Data | |||
@EqualsAndHashCode(callSuper = false) | |||
@Accessors(chain = true) | |||
public class TauvInspectPhoto extends Entity { | |||
private static final long serialVersionUID = 1L; | |||
/** | |||
* 巡检河流ID | |||
*/ | |||
private Integer inspectDriverId; | |||
/** | |||
* 正摄图地址 | |||
*/ | |||
private String photoUrl; | |||
/** | |||
* 上传人id | |||
*/ | |||
private Integer uploadUser; | |||
/** | |||
* 上传时间 | |||
*/ | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date uploadTime; | |||
} |
@@ -0,0 +1,30 @@ | |||
package com.taauav.admin.entity; | |||
import com.taauav.common.domain.Entity; | |||
import lombok.Data; | |||
import lombok.EqualsAndHashCode; | |||
import lombok.experimental.Accessors; | |||
import java.util.Date; | |||
/** | |||
* 巡检飞行轨迹对象 tauv_inspect_track | |||
* | |||
* @author daixiantong | |||
* @date 20200518 | |||
*/ | |||
@Data | |||
@EqualsAndHashCode(callSuper = false) | |||
@Accessors(chain = true) | |||
public class TauvInspectTrack extends Entity { | |||
private static final long serialVersionUID = 1L; | |||
/** 巡检河流ID */ | |||
private Integer inspectDriverId; | |||
/** 飞行开始时间 */ | |||
private Date startTime; | |||
/** 飞行结束时间 */ | |||
private Date endTime; | |||
/** 飞行轨迹地址 */ | |||
private String trackUrl; | |||
} |
@@ -0,0 +1,25 @@ | |||
package com.taauav.admin.mapper; | |||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.taauav.admin.dto.TauvInspectPhotoDTO; | |||
import com.taauav.admin.entity.TauvInspectPhoto; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.taauav.admin.vo.TauvInspectPhotoVo; | |||
import org.apache.ibatis.annotations.Param; | |||
/** | |||
* 巡检正摄图Mapper接口 | |||
* | |||
* @author daixiantong | |||
* @date 20200518 | |||
*/ | |||
public interface TauvInspectPhotoMapper extends BaseMapper<TauvInspectPhoto> | |||
{ | |||
/** | |||
* 自定义分页列表 | |||
* @param page | |||
* @param inspectPhotoDTO | |||
* @return | |||
*/ | |||
IPage<TauvInspectPhotoVo> selectPhotoPage(IPage page, @Param("param")TauvInspectPhotoDTO inspectPhotoDTO); | |||
} |
@@ -0,0 +1,27 @@ | |||
<?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.admin.mapper.TauvInspectPhotoMapper"> | |||
<select id="selectPhotoPage" resultType="com.taauav.admin.vo.TauvInspectPhotoVo"> | |||
select p.*, d.inspect_no `inspectNo`, c.name `areaName`, d.driver_name `driverName`, | |||
d.execution_time `inspectTime`, a.realname `uploadUserName`, d.driver_area `driverArea` | |||
from tauv_inspect_photo as p left join tauv_inspect_driver as d on p.inspect_driver_id = d.id | |||
left join sys_city as c on d.driver_area = c.id | |||
left join sys_admin as a on p.upload_user = a.id | |||
where p.mark = 1 and d.mark = 1 | |||
<if test="param != null and param.inspectNo != null and param.inspectNo != ''"> | |||
and d.inspect_no like concat('%', #{param.inspectNo}, '%') | |||
</if> | |||
<if test="param != null and param.driverArea != null and param.driverArea > 0"> | |||
and d.driver_area = #{param.driverArea} | |||
</if> | |||
<if test="param != null and param.driverName != null and param.driverName != ''"> | |||
and d.driver_name like concat('%', #{param.driverName}, '%') | |||
</if> | |||
<if test="param != null and param.startTime != null and param.entTime != null"> | |||
and d.execution_time between #{param.startTime} and #{param.endTime} | |||
</if> | |||
order by p.id desc | |||
</select> | |||
</mapper> |
@@ -0,0 +1,15 @@ | |||
package com.taauav.admin.mapper; | |||
import com.taauav.admin.entity.TauvInspectTrack; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
/** | |||
* 巡检飞行轨迹Mapper接口 | |||
* | |||
* @author daixiantong | |||
* @date 20200518 | |||
*/ | |||
public interface TauvInspectTrackMapper extends BaseMapper<TauvInspectTrack> | |||
{ | |||
} |
@@ -0,0 +1,7 @@ | |||
<?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.admin.mapper.TauvInspectTrackMapper"> | |||
</mapper> |
@@ -0,0 +1,31 @@ | |||
package com.taauav.admin.service; | |||
import com.taauav.admin.dto.TauvInspectPhotoDTO; | |||
import com.taauav.admin.entity.TauvInspectPhoto; | |||
import com.taauav.common.bean.Response; | |||
import com.taauav.common.core.mps.BaseQuery; | |||
import com.taauav.common.service.IBaseService; | |||
/** | |||
* 巡检正摄图Service接口 | |||
* | |||
* @author daixiantong | |||
* @date 20200518 | |||
*/ | |||
public interface ITauvInspectPhotoService extends IBaseService<TauvInspectPhoto> | |||
{ | |||
/** | |||
* 自定义分页列表 | |||
* @param inspectPhotoDTO | |||
* @param query | |||
* @return | |||
*/ | |||
Response selectPhotoPage(TauvInspectPhotoDTO inspectPhotoDTO, BaseQuery query); | |||
/** | |||
* 添加正摄图 | |||
* @param inspectPhoto | |||
* @return | |||
*/ | |||
Response editPhoto(TauvInspectPhoto inspectPhoto); | |||
} |
@@ -0,0 +1,15 @@ | |||
package com.taauav.admin.service; | |||
import com.taauav.admin.entity.TauvInspectTrack; | |||
import com.taauav.common.service.IBaseService; | |||
/** | |||
* 巡检飞行轨迹Service接口 | |||
* | |||
* @author daixiantong | |||
* @date 20200518 | |||
*/ | |||
public interface ITauvInspectTrackService extends IBaseService<TauvInspectTrack> | |||
{ | |||
} |
@@ -0,0 +1,59 @@ | |||
package com.taauav.admin.service.impl; | |||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.taauav.admin.dto.TauvInspectPhotoDTO; | |||
import com.taauav.admin.vo.TauvInspectPhotoVo; | |||
import com.taauav.common.bean.Response; | |||
import com.taauav.common.core.mps.BaseQuery; | |||
import com.taauav.common.service.impl.BaseServiceImpl; | |||
import com.taauav.common.util.DateUtil; | |||
import com.taauav.common.util.ShiroUtils; | |||
import com.taauav.common.util.StringUtils; | |||
import org.springframework.stereotype.Service; | |||
import com.taauav.admin.mapper.TauvInspectPhotoMapper; | |||
import com.taauav.admin.entity.TauvInspectPhoto; | |||
import com.taauav.admin.service.ITauvInspectPhotoService; | |||
import javax.annotation.Resource; | |||
/** | |||
* 巡检正摄图Service业务层处理 | |||
* | |||
* @author daixiantong | |||
* @date 20200518 | |||
*/ | |||
@Service | |||
public class TauvInspectPhotoServiceImpl extends BaseServiceImpl<TauvInspectPhotoMapper, TauvInspectPhoto> implements ITauvInspectPhotoService | |||
{ | |||
@Resource | |||
private Response response; | |||
/** | |||
* 自定义分页列表 | |||
* @param inspectPhotoDTO | |||
* @param query | |||
* @return | |||
*/ | |||
@Override | |||
public Response selectPhotoPage(TauvInspectPhotoDTO inspectPhotoDTO, BaseQuery query) { | |||
IPage<TauvInspectPhoto> page = new Page<>(query.getPage(), query.getPageSize()); | |||
IPage<TauvInspectPhotoVo> list = baseMapper.selectPhotoPage(page, inspectPhotoDTO); | |||
return response.success(list); | |||
} | |||
@Override | |||
public Response editPhoto(TauvInspectPhoto inspectPhoto) { | |||
if (inspectPhoto == null || inspectPhoto.getId() == null) { | |||
return response.failure("id不能为空"); | |||
} | |||
if (StringUtils.isEmpty(inspectPhoto.getPhotoUrl())) { | |||
return response.failure("请先上传正摄图"); | |||
} | |||
inspectPhoto.setUploadTime(DateUtil.now()); | |||
inspectPhoto.setUploadUser(ShiroUtils.getAdminId()); | |||
updateById(inspectPhoto); | |||
return response.success("操作成功"); | |||
} | |||
} |
@@ -0,0 +1,20 @@ | |||
package com.taauav.admin.service.impl; | |||
import com.taauav.common.service.impl.BaseServiceImpl; | |||
import org.springframework.stereotype.Service; | |||
import com.taauav.admin.mapper.TauvInspectTrackMapper; | |||
import com.taauav.admin.entity.TauvInspectTrack; | |||
import com.taauav.admin.service.ITauvInspectTrackService; | |||
/** | |||
* 巡检飞行轨迹Service业务层处理 | |||
* | |||
* @author daixiantong | |||
* @date 20200518 | |||
*/ | |||
@Service | |||
public class TauvInspectTrackServiceImpl extends BaseServiceImpl<TauvInspectTrackMapper, TauvInspectTrack> implements ITauvInspectTrackService | |||
{ | |||
} |
@@ -70,6 +70,8 @@ public class TauvReportServiceImpl extends BaseServiceImpl<TauvReportMapper, Tau | |||
private TauvWaterWarnMapper waterWarnMapper; | |||
@Autowired | |||
private TauvInspectQuestionMapper inspectQuestionMapper; | |||
@Autowired | |||
private TauvInspectPhotoMapper inspectPhotoMapper; | |||
/** | |||
* 添加报告 | |||
@@ -729,6 +731,8 @@ public class TauvReportServiceImpl extends BaseServiceImpl<TauvReportMapper, Tau | |||
} | |||
// 问题数据入库 | |||
dealQuestionData(inspectDriverInfo); | |||
// 正摄图数据入库 | |||
dealPhotoData(inspectDriverId); | |||
} else if (status == 4) { | |||
// 审核驳回 | |||
inspectDriver.setStatus(6); | |||
@@ -1031,4 +1035,23 @@ public class TauvReportServiceImpl extends BaseServiceImpl<TauvReportMapper, Tau | |||
String code = "10" + year + month + (int) ((Math.random() * 9 + 1) * 100000); | |||
return code; | |||
} | |||
/** | |||
* 处理正摄图数据 | |||
* @param inspectDriverId | |||
*/ | |||
private void dealPhotoData(Integer inspectDriverId) { | |||
QueryWrapper wrapper = new QueryWrapper(); | |||
wrapper.eq("mark", 1); | |||
wrapper.eq("inspect_driver_id", inspectDriverId); | |||
wrapper.last("limit 1"); | |||
TauvInspectPhoto inspectPhoto = inspectPhotoMapper.selectOne(wrapper); | |||
if (inspectPhoto == null) { | |||
inspectPhoto = new TauvInspectPhoto(); | |||
inspectPhoto.setInspectDriverId(inspectDriverId); | |||
inspectPhoto.setCreateTime(DateUtil.now()); | |||
inspectPhoto.setCreateUser(ShiroUtils.getAdminId()); | |||
inspectPhotoMapper.insert(inspectPhoto); | |||
} | |||
} | |||
} |
@@ -0,0 +1,49 @@ | |||
package com.taauav.admin.vo; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import com.taauav.admin.entity.TauvInspectPhoto; | |||
import lombok.Data; | |||
import java.math.BigInteger; | |||
import java.util.Date; | |||
/** | |||
* 正摄图管理返回结果实体类 | |||
* | |||
* @author daixiantong | |||
* @date 2020-05-18 | |||
*/ | |||
@Data | |||
public class TauvInspectPhotoVo extends TauvInspectPhoto { | |||
/** | |||
* 任务单号 | |||
*/ | |||
private String inspectNo; | |||
/** | |||
* 区划id | |||
*/ | |||
private BigInteger driverArea; | |||
/** | |||
* 区划名称 | |||
*/ | |||
private String areaName; | |||
/** | |||
* 河湖名称 | |||
*/ | |||
private String driverName; | |||
/** | |||
* 巡检时间 | |||
*/ | |||
@JsonFormat(pattern = "yyyy-MM-dd") | |||
private Date inspectTime; | |||
/** | |||
* 上传人名称 | |||
*/ | |||
private String uploadUserName; | |||
} |