import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
import lombok.experimental.Accessors; | import lombok.experimental.Accessors; | ||||
import java.math.BigDecimal; | |||||
/** | /** | ||||
* 巡河坐标对象 tauv_inspect_app_point | * 巡河坐标对象 tauv_inspect_app_point | ||||
* | * | ||||
private String x; | private String x; | ||||
/** 维度 */ | /** 维度 */ | ||||
private String y; | private String y; | ||||
/** | |||||
* 本次移动距离(单位:米) | |||||
*/ | |||||
private BigDecimal length; | |||||
} | } |
import lombok.Data; | import lombok.Data; | ||||
import java.math.BigDecimal; | |||||
/** | /** | ||||
* 巡检坐标定位 | * 巡检坐标定位 | ||||
*/ | */ | ||||
*/ | */ | ||||
private String y; | private String y; | ||||
/** | |||||
* 本次移动距离(单位:米) | |||||
*/ | |||||
private BigDecimal length; | |||||
} | } |
<!-- 获取巡检任务记录列表 --> | <!-- 获取巡检任务记录列表 --> | ||||
<select id="getInspectList" resultType="com.taauav.app.vo.InspectListVo"> | <select id="getInspectList" resultType="com.taauav.app.vo.InspectListVo"> | ||||
SELECT a.id as 'inspectId',i.id as 'inspectDriverId',a.inspect_no as 'inspectNo',a.driver_id AS 'driverId',d.`name` AS 'driverName',d.driver_area AS 'driverArea',a.begin_time AS 'beginTime',a.end_time AS 'endTime',u.realname,(SELECT TIMESTAMPDIFF( MINUTE,a.begin_time,NOW())) AS 'timeUse' FROM tauv_inspect_app AS a | |||||
SELECT a.id as 'inspectId',i.id as 'inspectDriverId',a.inspect_no as 'inspectNo',a.driver_id AS 'driverId',d.`name` AS 'driverName',d.driver_area AS 'driverArea',a.begin_time AS 'beginTime',a.end_time AS 'endTime',u.realname,(SELECT TIMESTAMPDIFF( MINUTE,a.begin_time,a.end_time)) AS 'timeUse' FROM tauv_inspect_app AS a | |||||
INNER JOIN tauv_inspect_driver AS i ON i.inspect_id=a.id | INNER JOIN tauv_inspect_driver AS i ON i.inspect_id=a.id | ||||
INNER JOIN tauv_driver AS d ON a.driver_id=d.id | INNER JOIN tauv_driver AS d ON a.driver_id=d.id | ||||
INNER JOIN user_admin AS u ON a.create_user=u.id | INNER JOIN user_admin AS u ON a.create_user=u.id |
import com.taauav.app.dto.InspectAppPointDto; | import com.taauav.app.dto.InspectAppPointDto; | ||||
import com.taauav.common.bean.Response; | import com.taauav.common.bean.Response; | ||||
import java.math.BigDecimal; | |||||
import java.util.List; | import java.util.List; | ||||
/** | /** | ||||
*/ | */ | ||||
List<TauvInspectAppPoint> getInspectAppPointList(Integer inspectId); | List<TauvInspectAppPoint> getInspectAppPointList(Integer inspectId); | ||||
/** | |||||
* 获取河流巡检长度 | |||||
* | |||||
* @param inspectAppId 巡检任务ID | |||||
* @return | |||||
*/ | |||||
BigDecimal getInspectLength(Integer inspectAppId); | |||||
} | } |
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
import java.math.BigDecimal; | |||||
import java.util.List; | import java.util.List; | ||||
/** | /** | ||||
entity.setInspectAppId(inspectAppPointDto.getInspectAppId()); | entity.setInspectAppId(inspectAppPointDto.getInspectAppId()); | ||||
entity.setX(inspectAppPointDto.getX()); | entity.setX(inspectAppPointDto.getX()); | ||||
entity.setY(inspectAppPointDto.getY()); | entity.setY(inspectAppPointDto.getY()); | ||||
entity.setLength(inspectAppPointDto.getLength()); | |||||
entity.setCreateUser(ShiroUtils.getAdminId()); | entity.setCreateUser(ShiroUtils.getAdminId()); | ||||
entity.setCreateTime(DateUtil.now()); | entity.setCreateTime(DateUtil.now()); | ||||
int result = inspectAppPointMapper.insert(entity); | int result = inspectAppPointMapper.insert(entity); | ||||
QueryWrapper<TauvInspectAppPoint> queryWrapper = new QueryWrapper<>(); | QueryWrapper<TauvInspectAppPoint> queryWrapper = new QueryWrapper<>(); | ||||
queryWrapper.eq("inspect_app_id", inspectId); | queryWrapper.eq("inspect_app_id", inspectId); | ||||
queryWrapper.eq("mark", 1); | queryWrapper.eq("mark", 1); | ||||
queryWrapper.select("sum(length) as length"); | |||||
List<TauvInspectAppPoint> inspectAppPointList = inspectAppPointMapper.selectList(queryWrapper); | List<TauvInspectAppPoint> inspectAppPointList = inspectAppPointMapper.selectList(queryWrapper); | ||||
return inspectAppPointList; | return inspectAppPointList; | ||||
} | } | ||||
/** | |||||
* 获取巡检河流长度 | |||||
* | |||||
* @param inspectAppId 巡检任务ID | |||||
* @return | |||||
*/ | |||||
@Override | |||||
public BigDecimal getInspectLength(Integer inspectAppId) { | |||||
QueryWrapper<TauvInspectAppPoint> queryWrapper = new QueryWrapper<>(); | |||||
queryWrapper.eq("inspect_app_id", inspectAppId); | |||||
queryWrapper.eq("mark", 1); | |||||
queryWrapper.select("sum(length) as length"); | |||||
TauvInspectAppPoint inspectAppPoint = inspectAppPointMapper.selectOne(queryWrapper); | |||||
if (inspectAppPoint == null) { | |||||
return BigDecimal.valueOf(0); | |||||
} | |||||
return inspectAppPoint.getLength(); | |||||
} | |||||
} | } |
inspectListVo.setDriverAreaName(cityName); | inspectListVo.setDriverAreaName(cityName); | ||||
} | } | ||||
// 获取巡检长度 | |||||
BigDecimal inspectLength = inspectAppPointService.getInspectLength(item.getInspectId()); | |||||
inspectListVo.setInspectLength(inspectLength); | |||||
// 获取问题数 | // 获取问题数 | ||||
QueryWrapper<TauvInspectQuestion> queryWrapper = new QueryWrapper<>(); | QueryWrapper<TauvInspectQuestion> queryWrapper = new QueryWrapper<>(); | ||||
queryWrapper.eq("inspect_driver_id", item.getInspectDriverId()); | queryWrapper.eq("inspect_driver_id", item.getInspectDriverId()); |
import lombok.Data; | import lombok.Data; | ||||
import org.springframework.format.annotation.DateTimeFormat; | import org.springframework.format.annotation.DateTimeFormat; | ||||
import java.math.BigDecimal; | |||||
import java.math.BigInteger; | import java.math.BigInteger; | ||||
import java.util.Date; | import java.util.Date; | ||||
import java.util.List; | import java.util.List; | ||||
/** | /** | ||||
* 巡检距离(单位:KM) | * 巡检距离(单位:KM) | ||||
*/ | */ | ||||
private String inspectLength; | |||||
private BigDecimal inspectLength; | |||||
/** | /** | ||||
* 巡检任务坐标列表 | * 巡检任务坐标列表 |