三只松鼠 před 4 roky
rodič
revize
a123540848
7 změnil soubory, kde provedl 51 přidání a 2 odebrání
  1. +6
    -0
      src/main/java/com/taauav/admin/entity/TauvInspectAppPoint.java
  2. +7
    -0
      src/main/java/com/taauav/app/dto/InspectAppPointDto.java
  3. +1
    -1
      src/main/java/com/taauav/app/mapper/InspectAppMapper.xml
  4. +9
    -0
      src/main/java/com/taauav/app/service/IInspectAppPointService.java
  5. +22
    -0
      src/main/java/com/taauav/app/service/impl/InspectAppPointServiceImpl.java
  6. +4
    -0
      src/main/java/com/taauav/app/service/impl/InspectAppServiceImpl.java
  7. +2
    -1
      src/main/java/com/taauav/app/vo/InspectListVo.java

+ 6
- 0
src/main/java/com/taauav/admin/entity/TauvInspectAppPoint.java Zobrazit soubor

@@ -5,6 +5,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;

/**
* 巡河坐标对象 tauv_inspect_app_point
*
@@ -24,4 +26,8 @@ public class TauvInspectAppPoint extends Entity {
private String x;
/** 维度 */
private String y;
/**
* 本次移动距离(单位:米)
*/
private BigDecimal length;
}

+ 7
- 0
src/main/java/com/taauav/app/dto/InspectAppPointDto.java Zobrazit soubor

@@ -2,6 +2,8 @@ package com.taauav.app.dto;

import lombok.Data;

import java.math.BigDecimal;

/**
* 巡检坐标定位
*/
@@ -23,4 +25,9 @@ public class InspectAppPointDto {
*/
private String y;

/**
* 本次移动距离(单位:米)
*/
private BigDecimal length;

}

+ 1
- 1
src/main/java/com/taauav/app/mapper/InspectAppMapper.xml Zobrazit soubor

@@ -4,7 +4,7 @@

<!-- 获取巡检任务记录列表 -->
<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_driver AS d ON a.driver_id=d.id
INNER JOIN user_admin AS u ON a.create_user=u.id

+ 9
- 0
src/main/java/com/taauav/app/service/IInspectAppPointService.java Zobrazit soubor

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.taauav.app.dto.InspectAppPointDto;
import com.taauav.common.bean.Response;

import java.math.BigDecimal;
import java.util.List;

/**
@@ -33,4 +34,12 @@ public interface IInspectAppPointService extends IService<TauvInspectAppPoint> {
*/
List<TauvInspectAppPoint> getInspectAppPointList(Integer inspectId);

/**
* 获取河流巡检长度
*
* @param inspectAppId 巡检任务ID
* @return
*/
BigDecimal getInspectLength(Integer inspectAppId);

}

+ 22
- 0
src/main/java/com/taauav/app/service/impl/InspectAppPointServiceImpl.java Zobrazit soubor

@@ -13,6 +13,7 @@ import com.taauav.common.util.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

/**
@@ -55,6 +56,7 @@ public class InspectAppPointServiceImpl extends ServiceImpl<InspectAppPointMappe
entity.setInspectAppId(inspectAppPointDto.getInspectAppId());
entity.setX(inspectAppPointDto.getX());
entity.setY(inspectAppPointDto.getY());
entity.setLength(inspectAppPointDto.getLength());
entity.setCreateUser(ShiroUtils.getAdminId());
entity.setCreateTime(DateUtil.now());
int result = inspectAppPointMapper.insert(entity);
@@ -75,7 +77,27 @@ public class InspectAppPointServiceImpl extends ServiceImpl<InspectAppPointMappe
QueryWrapper<TauvInspectAppPoint> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("inspect_app_id", inspectId);
queryWrapper.eq("mark", 1);
queryWrapper.select("sum(length) as length");
List<TauvInspectAppPoint> inspectAppPointList = inspectAppPointMapper.selectList(queryWrapper);
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();
}
}

+ 4
- 0
src/main/java/com/taauav/app/service/impl/InspectAppServiceImpl.java Zobrazit soubor

@@ -262,6 +262,10 @@ public class InspectAppServiceImpl extends ServiceImpl<InspectAppMapper, TauvIns
inspectListVo.setDriverAreaName(cityName);
}

// 获取巡检长度
BigDecimal inspectLength = inspectAppPointService.getInspectLength(item.getInspectId());
inspectListVo.setInspectLength(inspectLength);

// 获取问题数
QueryWrapper<TauvInspectQuestion> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("inspect_driver_id", item.getInspectDriverId());

+ 2
- 1
src/main/java/com/taauav/app/vo/InspectListVo.java Zobrazit soubor

@@ -5,6 +5,7 @@ import com.taauav.admin.entity.TauvInspectAppPoint;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
@@ -97,7 +98,7 @@ public class InspectListVo {
/**
* 巡检距离(单位:KM)
*/
private String inspectLength;
private BigDecimal inspectLength;

/**
* 巡检任务坐标列表

Načítá se…
Zrušit
Uložit