Explorar el Código

数据统计

master
牧羊人 hace 4 años
padre
commit
0737458905
Se han modificado 18 ficheros con 378 adiciones y 19 borrados
  1. +20
    -0
      src/main/java/com/taauav/admin/entity/TauvInspectPhoto.java
  2. +5
    -0
      src/main/java/com/taauav/admin/entity/TauvWaterAlarm.java
  3. +16
    -0
      src/main/java/com/taauav/admin/entity/TauvWaterSpectrum.java
  4. +1
    -9
      src/main/java/com/taauav/admin/mapper/TauvInspectQuestionMapper.xml
  5. +3
    -4
      src/main/java/com/taauav/admin/service/impl/TauvInspectPhotoServiceImpl.java
  6. +30
    -1
      src/main/java/com/taauav/admin/service/impl/TauvWaterDataServiceImpl.java
  7. +41
    -0
      src/main/java/com/taauav/front/controller/IndexInspectController.java
  8. +13
    -3
      src/main/java/com/taauav/front/controller/IndexQuestionController.java
  9. +7
    -0
      src/main/java/com/taauav/front/mapper/UserInspectQuestionMapper.java
  10. +41
    -0
      src/main/java/com/taauav/front/mapper/UserInspectQuestionMapper.xml
  11. +1
    -1
      src/main/java/com/taauav/front/mapper/UserWaterSpectrumMapper.xml
  12. +14
    -0
      src/main/java/com/taauav/front/service/IUserInspectDriverService.java
  13. +7
    -0
      src/main/java/com/taauav/front/service/IUserInspectQuestionService.java
  14. +41
    -0
      src/main/java/com/taauav/front/service/impl/UserInspectDriverServiceImpl.java
  15. +41
    -1
      src/main/java/com/taauav/front/service/impl/UserInspectQuestionServiceImpl.java
  16. +63
    -0
      src/main/java/com/taauav/front/vo/IndexInspectListVo.java
  17. +15
    -0
      src/main/java/com/taauav/front/vo/IndexQuestionListVo.java
  18. +19
    -0
      src/main/java/com/taauav/front/vo/userwaterspectrum/UserWaterSpectrumListVo.java

+ 20
- 0
src/main/java/com/taauav/admin/entity/TauvInspectPhoto.java Ver fichero

@@ -30,6 +30,26 @@ public class TauvInspectPhoto extends Entity {
* 正摄图地址
*/
private String photoUrl;
/**
* 正摄图名称
*/
private String photoName;
/**
* 左下纬度
*/
private String leftLatitude;
/**
* 左下经度
*/
private String leftLongitude;
/**
* 右上纬度
*/
private String rightLatitude;
/**
* 右上经度
*/
private String rightLongitude;
/**
* 上传人id
*/

+ 5
- 0
src/main/java/com/taauav/admin/entity/TauvWaterAlarm.java Ver fichero

@@ -57,6 +57,11 @@ public class TauvWaterAlarm extends Entity {
*/
private String alarmStandard;

/**
* 实测水质标准
*/
private Integer measuredStandard;

/**
* 报警信息
*/

+ 16
- 0
src/main/java/com/taauav/admin/entity/TauvWaterSpectrum.java Ver fichero

@@ -77,4 +77,20 @@ public class TauvWaterSpectrum extends Entity {
* 浊度多光谱路径
*/
private String tubPic;
/**
* 左下纬度
*/
private String leftLatitude;
/**
* 左下经度
*/
private String leftLongitude;
/**
* 右上纬度
*/
private String rightLatitude;
/**
* 右上经度
*/
private String rightLongitude;
}

+ 1
- 9
src/main/java/com/taauav/admin/mapper/TauvInspectQuestionMapper.xml Ver fichero

@@ -5,20 +5,12 @@
<mapper namespace="com.taauav.admin.mapper.TauvInspectQuestionMapper">
<select id="selectQuestionList" resultType="com.taauav.admin.vo.TauvInspectQuestionVo">
select q.*, d.inspect_no as `inspectNo`, f.thumb_img as `imgUrl`, d.driver_area as `driverArea`, t.name as `areaName`,
d.driver_name as `driverName`, d.execution_time as `inspectTime`, o.content as `questionType`, f.location,
f.latitude, f.longitude,a.realname as `createUserName`, b.realname as `assignUserName`, c.realname as `handlerUserName`,
a1.name as `createUserDept`,b1.name as `assignUserDept`,c1.name as `handlerUserDept`, f.original_img as `originUrl`
d.driver_name as `driverName`, d.execution_time as `inspectTime`, o.content as `questionType`
from tauv_inspect_question as q
left join tauv_inspect_driver as d on q.inspect_driver_id = d.id
left join tauv_inspect_file as f on q.inspect_file_id = f.id
left join tauv_question_options as o on f.question_id = o.id
left join sys_city as t on d.driver_area = t.id
left join user_admin as a on q.create_user = a.id
left join sys_city as a1 on a.driver_area = a1.id
left join user_admin as b on q.assign_user = b.id
left join sys_city as b1 on b.driver_area = b1.id
left join user_admin as c on q.handler_user = c.id
left join sys_city as c1 on c.driver_area = c1.id
where q.mark = 1 and d.mark = 1 and f.mark = 1 and o.mark = 1
<if test="param != null and param.questionNo != null and param.questionNo != ''">
and q.question_no like concat('%', #{param.questionNo}, '%')

+ 3
- 4
src/main/java/com/taauav/admin/service/impl/TauvInspectPhotoServiceImpl.java Ver fichero

@@ -48,11 +48,10 @@ public class TauvInspectPhotoServiceImpl extends BaseServiceImpl<TauvInspectPhot
if (inspectPhoto == null || inspectPhoto.getId() == null) {
return response.failure("id不能为空");
}
if (StringUtils.isEmpty(inspectPhoto.getPhotoUrl())) {
return response.failure("请先上传正摄图");
if (!StringUtils.isEmpty(inspectPhoto.getPhotoUrl())) {
inspectPhoto.setUploadTime(DateUtil.now());
inspectPhoto.setUploadUser(ShiroUtils.getAdminId());
}
inspectPhoto.setUploadTime(DateUtil.now());
inspectPhoto.setUploadUser(ShiroUtils.getAdminId());
updateById(inspectPhoto);
return response.success("操作成功");
}

+ 30
- 1
src/main/java/com/taauav/admin/service/impl/TauvWaterDataServiceImpl.java Ver fichero

@@ -223,6 +223,7 @@ public class TauvWaterDataServiceImpl extends BaseServiceImpl<TauvWaterDataMappe
List<String> alarmInfo = new ArrayList<>();
List<TauvWaterAlarmInfo> waterAlarmInfoList = new ArrayList<>();
Boolean flag = false;
Integer max = 1;
for (TauvWaterStandard item : standardList) {
// 实测值
BigDecimal value = BigDecimal.ZERO;
@@ -253,18 +254,23 @@ public class TauvWaterDataServiceImpl extends BaseServiceImpl<TauvWaterDataMappe
switch (driver.getCategory()) {
case "categoryOne":
standardValue = item.getCategoryOne();
max = 1;
break;
case "categoryTwo":
standardValue = item.getCategoryTwo();
max = 2;
break;
case "categoryThree":
standardValue = item.getCategoryThree();
max = 3;
break;
case "categoryFour":
standardValue = item.getCategoryFour();
max = 4;
break;
case "categoryFive":
standardValue = item.getCategoryFive();
max = 5;
break;
default:
break;
@@ -275,13 +281,35 @@ public class TauvWaterDataServiceImpl extends BaseServiceImpl<TauvWaterDataMappe
waterAlarmInfo.setName(item.getName());
waterAlarmInfo.setStandardValue(standardValue);
waterAlarmInfo.setMeasuredValue(value);
Integer standard = 0;
if (exceed.compareTo(BigDecimal.ZERO) > 0) {
flag = true;
BigDecimal rate = exceed.multiply(new BigDecimal("100")).divide(standardValue, 2, BigDecimal.ROUND_HALF_UP);
String exceedStandard = item.getName() + "超标" + rate + "%";
alarmInfo.add(exceedStandard);
// 超标详情
waterAlarmInfo.setMeasuredStandard(checkCategory(item, value));
String category = checkCategory(item, value);
switch (category) {
case "Ⅰ类" :
standard = 1;
break;
case "Ⅱ类":
standard = 2;
break;
case "Ⅲ类":
standard = 3;
break;
case "Ⅳ类":
standard = 4;
break;
case "Ⅴ类":
standard = 5;
break;
default:
break;
}
max = standard > max ? standard : max;
waterAlarmInfo.setMeasuredStandard(category);
waterAlarmInfo.setExceedStandard(exceedStandard);
waterAlarmInfo.setIsExceed(1);
}
@@ -296,6 +324,7 @@ public class TauvWaterDataServiceImpl extends BaseServiceImpl<TauvWaterDataMappe
waterAlarm.setDriverName(inspectDriver.getDriverName());
waterAlarm.setInspectTime(inspectDriver.getExecutionTime());
waterAlarm.setAlarmStandard(driver.getCategory());
waterAlarm.setMeasuredStandard(max);
waterAlarm.setAlarmInfo(Joiner.on(",").join(alarmInfo));
waterAlarmService.saveOrUpdate(waterAlarm);
// 报警详情附表数据入库

+ 41
- 0
src/main/java/com/taauav/front/controller/IndexInspectController.java Ver fichero

@@ -0,0 +1,41 @@
package com.taauav.front.controller;

import com.taauav.common.bean.Response;
import com.taauav.front.service.IUserInspectDriverService;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
* 指挥大屏 - 任务管理 控制器
*
* @author daixiantong
* @date 2020-05-21
*/
@RestController
@RequestMapping("/index/inspect")
public class IndexInspectController {
@Autowired
private IUserInspectDriverService inspectDriverService;

/**
* 统计任务数量
* @return
*/
@GetMapping("/count")
public Response countInspect() {
return inspectDriverService.countInspectNum();
}

/**
* 任务管理列表
* @return
*/
@GetMapping("/list")
public Response list(@RequestParam("type") Integer type) {
return inspectDriverService.getInspectList(type);
}
}

+ 13
- 3
src/main/java/com/taauav/front/controller/IndexQuestionController.java Ver fichero

@@ -16,8 +16,8 @@ import org.springframework.web.bind.annotation.RestController;
* @date 2020-05-20
*/
@RestController
@RequestMapping("/front/question")
public class IndexQuestionController extends FrontBaseController {
@RequestMapping("/index/question")
public class IndexQuestionController {

@Autowired
private IUserInspectQuestionService questionService;
@@ -28,8 +28,18 @@ public class IndexQuestionController extends FrontBaseController {
* @param query
* @return
*/
@GetMapping("/index")
@GetMapping("/list")
public Response questionList(IndexQuestionDto indexQuestionDto, BaseQuery query) {
return questionService.selectIndexPage(indexQuestionDto, query);
}

/**
* 获取问题详情
* @param id
* @return
*/
@GetMapping("/detail")
public Response getQuestionDetail(Integer id) {
return questionService.getQuestionDetail(id);
}
}

+ 7
- 0
src/main/java/com/taauav/front/mapper/UserInspectQuestionMapper.java Ver fichero

@@ -86,4 +86,11 @@ public interface UserInspectQuestionMapper extends BaseMapper<TauvInspectQuestio
*/
IPage<IndexQuestionListVo> selectIndexPageList(IPage page, @Param("param") IndexQuestionDto indexQuestionDto);

/**
* 指挥大屏-问题详情
*
* @param id
* @return
*/
IndexQuestionListVo getQuestionDetail(Integer id);
}

+ 41
- 0
src/main/java/com/taauav/front/mapper/UserInspectQuestionMapper.xml Ver fichero

@@ -96,7 +96,48 @@

<!-- 获取指挥大屏问题清单-问题分页列表数据 -->
<select id="selectIndexPageList" resultType="com.taauav.front.vo.IndexQuestionListVo">
select q.*, d.inspect_no as `inspectNo`, f.thumb_img as `imgUrl`, d.driver_area as `driverArea`, t.name as `areaName`,
d.driver_name as `driverName`, d.execution_time as `inspectTime`, o.content as `questionType`, f.location,
f.latitude, f.longitude
from tauv_inspect_question as q
left join tauv_inspect_driver as d on q.inspect_driver_id = d.id
left join tauv_inspect_file as f on q.inspect_file_id = f.id
left join tauv_question_options as o on f.question_id = o.id
left join sys_city as t on d.driver_area = t.id
where q.mark = 1 and d.mark = 1 and f.mark = 1 and o.mark = 1
<if test="param != null and param.driverId != null and param.driverId > 0">
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>
<if test="param != null and param.driverArea != null and param.driverArea > 0">
and d.driverArea = #{param.driverArea}
</if>
<if test="param != null and param.status != null and param.status > 0">
and q.status = #{param.status}
</if>
order by q.id desc
</select>

<!-- 指挥大屏问题详情 -->
<select id="getQuestionDetail" resultType="com.taauav.front.vo.IndexQuestionListVo">
select q.*, d.inspect_no as `inspectNo`, f.thumb_img as `imgUrl`, d.driver_area as `driverArea`, t.name as `areaName`,
d.driver_name as `driverName`, d.execution_time as `inspectTime`, o.content as `questionType`, f.location,
f.latitude, f.longitude,a.realname as `createUserName`, b.realname as `assignUserName`, c.realname as `handlerUserName`,
a1.name as `createUserDept`,b1.name as `assignUserDept`,c1.name as `handlerUserDept`, f.original_img as `originUrl`
from tauv_inspect_question as q
left join tauv_inspect_driver as d on q.inspect_driver_id = d.id
left join tauv_inspect_file as f on q.inspect_file_id = f.id
left join tauv_question_options as o on f.question_id = o.id
left join user_admin as a on q.create_user = a.id
left join sys_city as a1 on a.driver_area = a1.id
left join user_admin as b on q.assign_user = b.id
left join sys_city as b1 on b.driver_area = b1.id
left join user_admin as c on q.handler_user = c.id
left join sys_city as c1 on c.driver_area = c1.id
left join sys_city as t on d.driver_area = t.id
where q.mark = 1 and d.mark = 1 and f.mark = 1 and o.mark = 1 and t.mark = 1 and q.id = #{id}
</select>

</mapper>

+ 1
- 1
src/main/java/com/taauav/front/mapper/UserWaterSpectrumMapper.xml Ver fichero

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

<!-- 获取多光谱数据列表 -->
<select id="getWaterSpectrumList" parameterType="com.taauav.front.query.UserWaterSpectrumQuery" resultType="com.taauav.front.vo.userwaterspectrum.UserWaterSpectrumListVo">
SELECT s.id,s.area_name,d.inspect_no,d.num,d.driver_id,d.driver_name,i.inspect_time,s.cod_pic,s.nh3n_pic,s.tp_pic,s.tn_pic,s.do_pic,s.tub_pic
SELECT s.id,s.area_name,d.inspect_no,d.num,d.driver_id,d.driver_name,i.inspect_time,s.cod_pic,s.nh3n_pic,s.tp_pic,s.tn_pic,s.do_pic,s.tub_pic,s.latitude,s.longitude
FROM tauv_water_spectrum s
INNER JOIN tauv_inspect_driver AS d ON s.inspect_driver_id = d.id
INNER JOIN tauv_inspect AS i ON i.id = d.inspect_id

+ 14
- 0
src/main/java/com/taauav/front/service/IUserInspectDriverService.java Ver fichero

@@ -43,4 +43,18 @@ public interface IUserInspectDriverService extends IBaseService<TauvInspectDrive
*/
Response detail(Integer id);

/**
* 统计指挥大屏任务数量
* @return
*/
Response countInspectNum();

/**
* 指挥大屏-任务管理列表
* @param type:1已完成 2执行中
* @return
*/
Response getInspectList(Integer type);


}

+ 7
- 0
src/main/java/com/taauav/front/service/IUserInspectQuestionService.java Ver fichero

@@ -66,4 +66,11 @@ public interface IUserInspectQuestionService extends IBaseService<TauvInspectQue
* @return
*/
Response selectIndexPage(IndexQuestionDto indexQuestionDto, BaseQuery query);

/**
* 获取指挥大屏问题详情
* @param id
* @return
*/
Response getQuestionDetail(Integer id);
}

+ 41
- 0
src/main/java/com/taauav/front/service/impl/UserInspectDriverServiceImpl.java Ver fichero

@@ -1,6 +1,7 @@
package com.taauav.front.service.impl;

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.dto.TauvInspectDriverDTO;
import com.taauav.admin.entity.*;
@@ -299,4 +300,44 @@ public class UserInspectDriverServiceImpl extends BaseServiceImpl<TauvInspectDri
inspectDriverInfoVo.setInspectFileList(inspectFileList);
return response.success(inspectDriverInfoVo);
}

/**
* 统计指挥大屏任务数量
* @return
*/
@Override
public Response countInspectNum() {
// 执行中
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("mark", 1);
wrapper.eq("status", 3);
Integer inExecution = count(wrapper);
// 已完成
QueryWrapper wrapper1 = new QueryWrapper();
wrapper1.eq("mark", 1);
wrapper1.eq("status", 4);
Integer finished = count(wrapper1);

Map<String, Integer> map = new HashMap<>();
map.put("inExecution", inExecution);
map.put("finished", finished);
return response.success(map);
}

/**
* 指挥大屏-任务管理列表
* @param type:1已完成 2执行中
* @return
*/
@Override
public Response getInspectList(Integer type) {
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("mark", 1);
if (type != null && type == 2) {
wrapper.eq("status", 3);
} else {
wrapper.eq("status", 4);
}
return null;
}
}

+ 41
- 1
src/main/java/com/taauav/front/service/impl/UserInspectQuestionServiceImpl.java Ver fichero

@@ -55,6 +55,8 @@ public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQ
private String uploadUrl;
@Value("${file.uploadFolder}")
private String uploadFolder;
@Value("${server.IMAGE_URL}")
private String imageUrl;

/**
* 获取巡检问题列表
@@ -249,6 +251,44 @@ public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQ
public Response selectIndexPage(IndexQuestionDto indexQuestionDto, BaseQuery query) {
IPage page = new Page(query.getPage(), query.getPageSize());
IPage<IndexQuestionListVo> list = baseMapper.selectIndexPageList(page, indexQuestionDto);
return null;
if (list.getRecords().size() > 0) {
for (IndexQuestionListVo item : list.getRecords()) {
// 状态描述
item.setStatusText(FunctionUtils.getArrayText(item.getStatus().toString(), item.statusList()));
// 图片路径处理
if (com.taauav.common.util.StringUtils.isNotEmpty(item.getImgUrl()) && !item.getImgUrl().contains("http")) {
item.setImgUrl(imageUrl + item.getImgUrl());
}
if (com.taauav.common.util.StringUtils.isNotEmpty(item.getOriginUrl()) && !item.getOriginUrl().contains("http")) {
item.setOriginUrl(imageUrl + item.getOriginUrl());
}
}
}
return response.success(list);
}

/**
* 获取指挥大屏问题详情
* @param id
* @return
*/
@Override
public Response getQuestionDetail(Integer id) {
if (id == null || id <= 0) {
return response.failure("问题id不能为空");
}
IndexQuestionListVo detail = baseMapper.getQuestionDetail(id);
if (detail != null) {
// 状态描述
detail.setStatusText(FunctionUtils.getArrayText(detail.getStatus().toString(), detail.statusList()));
// 图片路径处理
if (com.taauav.common.util.StringUtils.isNotEmpty(detail.getImgUrl()) && !detail.getImgUrl().contains("http")) {
detail.setImgUrl(imageUrl + detail.getImgUrl());
}
if (com.taauav.common.util.StringUtils.isNotEmpty(detail.getOriginUrl()) && !detail.getOriginUrl().contains("http")) {
detail.setOriginUrl(imageUrl + detail.getOriginUrl());
}
}
return response.success(detail);
}
}

+ 63
- 0
src/main/java/com/taauav/front/vo/IndexInspectListVo.java Ver fichero

@@ -0,0 +1,63 @@
package com.taauav.front.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.taauav.admin.entity.TauvDriverPoint;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
* 指挥大屏-任务管理列表返回结果实体类
*
* @author daixiantong
* @date 2020-05-21
*/
@Data
public class IndexInspectListVo {

/**
* 任务id
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 河湖id
*/
private Integer driverId;
/**
* 河湖名称
*/
private String driverName;
/**
* 区属名称
*/
private String areaName;
/**
* 巡检日期
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date inspectTime;
/**
* 起点
*/
private String startPoint;
/**
* 终点
*/
private String endPoint;
/**
* 状态描述
*/
private String statusText;
/**
* 河道坐标
*/
private List<TauvDriverPoint> pointList;
/**
* 直播地址
*/
private String liveUrl;
}

+ 15
- 0
src/main/java/com/taauav/front/vo/IndexQuestionListVo.java Ver fichero

@@ -3,6 +3,8 @@ package com.taauav.front.vo;
import com.taauav.admin.entity.TauvInspectQuestion;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
* 指挥大屏-问题清单 返回结果实体类
@@ -92,4 +94,17 @@ public class IndexQuestionListVo extends TauvInspectQuestion {
* 处理人部门
*/
private String handlerUserDept;

/**
* 状态数组
*
* @return
*/
public Map<String, String> statusList() {
Map<String, String> map = new HashMap<>();
map.put("1", "待指派");
map.put("2", "待处理");
map.put("3", "已完成");
return map;
}
}

+ 19
- 0
src/main/java/com/taauav/front/vo/userwaterspectrum/UserWaterSpectrumListVo.java Ver fichero

@@ -73,4 +73,23 @@ public class UserWaterSpectrumListVo {
*/
private String tubPic;

/**
* 左下纬度
*/
private String leftLatitude;

/**
* 左下经度
*/
private String leftLongitude;

/**
* 右上纬度
*/
private String rightLatitude;

/**
* 右上经度
*/
private String rightLongitude;
}

Cargando…
Cancelar
Guardar