Browse Source

数据统计模块功能

master
牧羊人 4 years ago
parent
commit
fc07aa2720
11 changed files with 320 additions and 129 deletions
  1. +226
    -0
      src/main/java/com/taauav/front/controller/UserDataStatisticsController.java
  2. +12
    -13
      src/main/java/com/taauav/front/controller/UserIndexController.java
  3. +13
    -10
      src/main/java/com/taauav/front/controller/UserScreenStatisticsController.java
  4. +0
    -90
      src/main/java/com/taauav/front/entity/UserInspectQuestion.java
  5. +10
    -2
      src/main/java/com/taauav/front/mapper/UserInspectQuestionMapper.java
  6. +12
    -0
      src/main/java/com/taauav/front/mapper/UserInspectQuestionMapper.xml
  7. +13
    -0
      src/main/java/com/taauav/front/mapper/UserWaterAlarmMapper.java
  8. +21
    -0
      src/main/java/com/taauav/front/mapper/UserWaterAlarmMapper.xml
  9. +2
    -2
      src/main/java/com/taauav/front/service/IUserInspectQuestionService.java
  10. +9
    -8
      src/main/java/com/taauav/front/service/impl/UserInspectQuestionServiceImpl.java
  11. +2
    -4
      src/main/java/com/taauav/front/vo/IndexQuestionListVo.java

+ 226
- 0
src/main/java/com/taauav/front/controller/UserDataStatisticsController.java View File

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

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.taauav.admin.entity.TauvInspectQuestion;
import com.taauav.common.bean.Response;
import com.taauav.front.mapper.UserInspectQuestionMapper;
import com.taauav.front.mapper.UserWaterAlarmInfoMapper;
import com.taauav.front.mapper.UserWaterAlarmMapper;
import com.taauav.front.vo.inspectquestion.InspectQuestionCategoryVo;
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.RestController;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.*;
import java.util.*;

@RestController
@RequestMapping("/front/data")
public class UserDataStatisticsController {

@Autowired
private UserInspectQuestionMapper inspectQuestionMapper;
@Autowired
private UserWaterAlarmInfoMapper userWaterAlarmInfoMapper;
@Autowired
private UserWaterAlarmMapper userWaterAlarmMapper;
@Autowired
private Response response;

@GetMapping("/index")
public Response index() {
// 巡检问题处理情况统计
Map<String, Object> inspectQuestionInfo = getInspectQuestionInfo();
// 获取月度巡检问题统计
List<Map<String, Integer>> monthQuestionList = getMonthQuestionList();
// 巡检问题类型统计
List<InspectQuestionCategoryVo> inspectQuestionCategoryList = inspectQuestionMapper.getInspectQuestionCategoryList();
// 获取水质警告分类统计列表
List<Map<String, Object>> waterAlarmCategoryList = userWaterAlarmInfoMapper.getWaterAlarmCategoryList();

// 返回结果
Map<String, Object> result = new HashMap<>();
result.put("inspectQuestionInfo", inspectQuestionInfo);
result.put("monthQuestionList", monthQuestionList);
result.put("inspectQuestionCategoryList", inspectQuestionCategoryList);
result.put("waterAlarmCategoryList", waterAlarmCategoryList);
return response.success(result);
}

/**
* 巡检问题处理情况统计
*
* @return
*/
private Map<String, Object> getInspectQuestionInfo() {
Map<String, Object> result = new HashMap<>();
// 获取已发现问题数
Integer totalNum = inspectQuestionMapper.selectCount(new LambdaQueryWrapper<TauvInspectQuestion>()
.eq(TauvInspectQuestion::getMark, 1));
result.put("totalNum", totalNum);
// 获取已解决问题数
Integer finishedNum = inspectQuestionMapper.selectCount(new LambdaQueryWrapper<TauvInspectQuestion>()
.eq(TauvInspectQuestion::getStatus, 3)
.eq(TauvInspectQuestion::getMark, 1));
result.put("finishedNum", finishedNum);
// 已处理占比
if (totalNum > 0) {
result.put("percentage", String.format("%.2f", (float) finishedNum / (float) totalNum * 100));
} else {
result.put("percentage", "0.00");
}
return result;
}

/**
* 月度巡检问题统计
*
* @return
*/
private List<Map<String, Integer>> getMonthQuestionList() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar date = Calendar.getInstance();
Integer year = Integer.valueOf(date.get(Calendar.YEAR));
List<Map<String, Integer>> mapList = new ArrayList<>();
for (int i = 1; i <= 12; i++) {
Date beginTime = getBeginTime(year, i);
System.out.println(sdf.format(beginTime));

Date endTime = getEndTime(year, i);
System.out.println(sdf.format(endTime));

// 已完成数量
QueryWrapper<TauvInspectQuestion> queryWrapper = new QueryWrapper<>();
queryWrapper.between("create_time", sdf.format(beginTime), sdf.format(endTime));
queryWrapper.eq("status", 3);
queryWrapper.eq("mark", 1);
Integer finishedNum = inspectQuestionMapper.selectCount(queryWrapper);

QueryWrapper<TauvInspectQuestion> queryWrapper2 = new QueryWrapper<>();
queryWrapper2.between("create_time", sdf.format(beginTime), sdf.format(endTime));
queryWrapper2.le("status", 2);
queryWrapper2.eq("mark", 1);
Integer waitNum = inspectQuestionMapper.selectCount(queryWrapper2);

Map<String, Integer> map = new HashMap<>();
map.put("month", i);
map.put("finishedNum", finishedNum);
map.put("waitNum", waitNum);
map.put("totalNum", finishedNum + waitNum);
mapList.add(map);
}
return mapList;
}

public static Date getBeginTime(int year, int month) {
YearMonth yearMonth = YearMonth.of(year, month);
LocalDate localDate = yearMonth.atDay(1);
LocalDateTime startOfDay = localDate.atStartOfDay();
ZonedDateTime zonedDateTime = startOfDay.atZone(ZoneId.of("Asia/Shanghai"));

return Date.from(zonedDateTime.toInstant());
}

public static Date getEndTime(int year, int month) {
YearMonth yearMonth = YearMonth.of(year, month);
LocalDate endOfMonth = yearMonth.atEndOfMonth();
LocalDateTime localDateTime = endOfMonth.atTime(23, 59, 59, 999);
ZonedDateTime zonedDateTime = localDateTime.atZone(ZoneId.of("Asia/Shanghai"));
return Date.from(zonedDateTime.toInstant());
}

/**
* 巡检问题河湖统计
*
* @return
*/
@GetMapping("/getInspectQuestionDriverList")
private Response getInspectQuestionDriverList(Integer type) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar date = Calendar.getInstance();
if (type == 2) {
// 前三个月
String endTime = sdf.format(new Date());
String startTime = addMonthDate(endTime, -3, "yyyy-MM-dd HH:mm:ss");
List<Map<String, Object>> mapList = inspectQuestionMapper.getInspectQuestionDriverList(startTime, endTime);
return response.success(mapList);
} else if (type == 3) {
// 前半年
String endTime = sdf.format(new Date());
String startTime = addMonthDate(endTime, -6, "yyyy-MM-dd HH:mm:ss");
List<Map<String, Object>> mapList = inspectQuestionMapper.getInspectQuestionDriverList(startTime, endTime);
return response.success(mapList);
} else {
// 当月
Integer year = Integer.valueOf(date.get(Calendar.YEAR));
Integer month = Integer.valueOf(date.get(Calendar.MONTH)) + 1;

Date beginTime = getBeginTime(year, month);
System.out.println(sdf.format(beginTime));

Date endTime = getEndTime(year, month);
System.out.println(sdf.format(endTime));

List<Map<String, Object>> mapList = inspectQuestionMapper.getInspectQuestionDriverList(sdf.format(beginTime), sdf.format(endTime));
return response.success(mapList);
}
}

/**
* 得到几个月之后的时间
*
* @param date
* @param month
* @return
*/
public static String addMonthDate(String date, int month, String pattern) {
String nowDate = null;
SimpleDateFormat format = new SimpleDateFormat(pattern);
try {
Date parse = format.parse(date);
Calendar calendar = Calendar.getInstance();
calendar.setTime(parse);
calendar.add(Calendar.MONTH, month);
nowDate = format.format(calendar.getTime());
} catch (ParseException e) {
}
return nowDate;
}

/**
* 获取水质污染程度统计
*
* @param type 类型:1当月 2三个月 3半年
* @return
*/
@GetMapping("/getWaterAlarmInfoList")
private Response getWaterAlarmInfoList(Integer type) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar date = Calendar.getInstance();
if (type == 2) {
// 前三个月
String endTime = sdf.format(new Date());
String startTime = addMonthDate(endTime, -3, "yyyy-MM-dd HH:mm:ss");
List<Map<String, Object>> mapList = userWaterAlarmMapper.getWaterAlarmInfoList(startTime, endTime);
return response.success(mapList);
} else if (type == 3) {
// 前半年
String endTime = sdf.format(new Date());
String startTime = addMonthDate(endTime, -6, "yyyy-MM-dd HH:mm:ss");
List<Map<String, Object>> mapList = userWaterAlarmMapper.getWaterAlarmInfoList(startTime, endTime);
return response.success(mapList);
} else {
// 当月
Integer year = Integer.valueOf(date.get(Calendar.YEAR));
Integer month = Integer.valueOf(date.get(Calendar.MONTH)) + 1;
Date beginTime = getBeginTime(year, month);
Date endTime = getEndTime(year, month);
List<Map<String, Object>> mapList = userWaterAlarmMapper.getWaterAlarmInfoList(sdf.format(beginTime), sdf.format(endTime));
return response.success(mapList);
}
}
}

+ 12
- 13
src/main/java/com/taauav/front/controller/UserIndexController.java View File

@@ -5,13 +5,13 @@ 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.entity.TauvInspectDriver;
import com.taauav.admin.entity.TauvInspectQuestion;
import com.taauav.admin.entity.TauvWaterAlarm;
import com.taauav.admin.entity.TauvWaterWarn;
import com.taauav.admin.mapper.TauvInspectDriverMapper;
import com.taauav.admin.mapper.TauvWaterAlarmMapper;
import com.taauav.admin.mapper.TauvWaterWarnMapper;
import com.taauav.common.bean.Response;
import com.taauav.front.entity.UserInspectQuestion;
import com.taauav.front.entity.UserNotice;
import com.taauav.front.mapper.UserInspectQuestionMapper;
import com.taauav.front.mapper.UserNoticeMapper;
@@ -49,7 +49,6 @@ public class UserIndexController {
@Autowired
private UserNoticeMapper userNoticeMapper;


/**
* 获取首页统计
*
@@ -119,23 +118,23 @@ public class UserIndexController {
private Map<String, Object> getInspectQuestionInfo() {
Map<String, Object> map = new HashMap<>();
// 获取问题总数
Integer totalNum = inspectQuestionMapper.selectCount(new LambdaQueryWrapper<UserInspectQuestion>()
.eq(UserInspectQuestion::getMark, 1));
Integer totalNum = inspectQuestionMapper.selectCount(new LambdaQueryWrapper<TauvInspectQuestion>()
.eq(TauvInspectQuestion::getMark, 1));
map.put("totalNum", totalNum);
// 获取已完成总数
Integer funishedNum = inspectQuestionMapper.selectCount(new LambdaQueryWrapper<UserInspectQuestion>()
.eq(UserInspectQuestion::getStatus, 3)
.eq(UserInspectQuestion::getMark, 1));
Integer funishedNum = inspectQuestionMapper.selectCount(new LambdaQueryWrapper<TauvInspectQuestion>()
.eq(TauvInspectQuestion::getStatus, 3)
.eq(TauvInspectQuestion::getMark, 1));
map.put("funishedNum", funishedNum);
// 获取处理中总数
Integer processNum = inspectQuestionMapper.selectCount(new LambdaQueryWrapper<UserInspectQuestion>()
.eq(UserInspectQuestion::getStatus, 2)
.eq(UserInspectQuestion::getMark, 1));
Integer processNum = inspectQuestionMapper.selectCount(new LambdaQueryWrapper<TauvInspectQuestion>()
.eq(TauvInspectQuestion::getStatus, 2)
.eq(TauvInspectQuestion::getMark, 1));
map.put("processNum", processNum);
// 获取待处理总数
Integer waitNum = inspectQuestionMapper.selectCount(new LambdaQueryWrapper<UserInspectQuestion>()
.eq(UserInspectQuestion::getStatus, 1)
.eq(UserInspectQuestion::getMark, 1));
Integer waitNum = inspectQuestionMapper.selectCount(new LambdaQueryWrapper<TauvInspectQuestion>()
.eq(TauvInspectQuestion::getStatus, 1)
.eq(TauvInspectQuestion::getMark, 1));
map.put("waitNum", waitNum);
return map;
}

src/main/java/com/taauav/front/controller/UserScreenController.java → src/main/java/com/taauav/front/controller/UserScreenStatisticsController.java View File

@@ -3,12 +3,10 @@ package com.taauav.front.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.taauav.admin.entity.SysCity;
import com.taauav.admin.entity.TauvInspectQuestion;
import com.taauav.admin.mapper.SysCityMapper;
import com.taauav.admin.mapper.TauvWaterAlarmInfoMapper;
import com.taauav.admin.mapper.TauvWaterAlarmMapper;
import com.taauav.admin.service.ISysCityService;
import com.taauav.common.bean.Response;
import com.taauav.front.entity.UserInspectQuestion;
import com.taauav.front.mapper.UserInspectQuestionMapper;
import com.taauav.front.mapper.UserWaterAlarmInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
@@ -16,7 +14,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -25,7 +22,7 @@ import java.util.Map;

@RestController
@RequestMapping("/front/screen")
public class UserScreenController {
public class UserScreenStatisticsController {

@Autowired
private UserInspectQuestionMapper inspectQuestionMapper;
@@ -74,14 +71,20 @@ public class UserScreenController {
private Map<String, Object> getInspectQuestionInfo() {
Map<String, Object> result = new HashMap<>();
// 获取已发现问题数
Integer totalNum = inspectQuestionMapper.selectCount(new LambdaQueryWrapper<UserInspectQuestion>()
.eq(UserInspectQuestion::getMark, 1));
Integer totalNum = inspectQuestionMapper.selectCount(new LambdaQueryWrapper<TauvInspectQuestion>()
.eq(TauvInspectQuestion::getMark, 1));
result.put("totalNum", totalNum);
// 获取已解决问题数
Integer finishedNum = inspectQuestionMapper.selectCount(new LambdaQueryWrapper<UserInspectQuestion>()
.eq(UserInspectQuestion::getStatus, 3)
.eq(UserInspectQuestion::getMark, 1));
Integer finishedNum = inspectQuestionMapper.selectCount(new LambdaQueryWrapper<TauvInspectQuestion>()
.eq(TauvInspectQuestion::getStatus, 3)
.eq(TauvInspectQuestion::getMark, 1));
result.put("finishedNum", finishedNum);
// 已处理占比
if (totalNum > 0) {
result.put("percentage", String.format("%.2f", (float) finishedNum / (float) totalNum * 100));
} else {
result.put("percentage", "0.00%");
}
return result;
}


+ 0
- 90
src/main/java/com/taauav/front/entity/UserInspectQuestion.java View File

@@ -1,90 +0,0 @@
package com.taauav.front.entity;

import java.time.LocalDateTime;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableName;
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;

/**
* <p>
* 问题管理
* </p>
*
* @author 鲲鹏
* @since 2020-05-14
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tauv_inspect_question")
public class UserInspectQuestion extends Entity {

private static final long serialVersionUID = 1L;

/**
* 巡检河流ID
*/
private Integer inspectDriverId;

/**
* 巡检图片文件ID
*/
private Integer inspectFileId;

/**
* 问题单号
*/
private String questionNo;

/**
* 指派负责人
*/
private Integer assignUser;

/**
* 指派负责人联系方式
*/
private String assignContact;

/**
* 指派备注
*/
private String assignNote;

/**
* 指派时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date assignTime;

/**
* 处理人
*/
private Integer handlerUser;

/**
* 处理后图片
*/
private String handlerImage;

/**
* 处理结果
*/
private String handlerResult;

/**
* 处理时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date handlerTime;


}

+ 10
- 2
src/main/java/com/taauav/front/mapper/UserInspectQuestionMapper.java View File

@@ -1,8 +1,8 @@
package com.taauav.front.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.taauav.admin.entity.TauvInspectQuestion;
import com.taauav.front.dto.IndexQuestionDto;
import com.taauav.front.entity.UserInspectQuestion;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.taauav.front.query.UserInspectQuestionQuery;
import com.taauav.front.vo.IndexQuestionListVo;
@@ -23,7 +23,7 @@ import java.util.Map;
* @author 鲲鹏
* @since 2020-05-14
*/
public interface UserInspectQuestionMapper extends BaseMapper<UserInspectQuestion> {
public interface UserInspectQuestionMapper extends BaseMapper<TauvInspectQuestion> {

/**
* 获取巡检问题列表
@@ -70,6 +70,13 @@ public interface UserInspectQuestionMapper extends BaseMapper<UserInspectQuestio
*/
List<Map<String, Object>> getQuestionDriverAreaList();

/**
* 数据类型巡检问题河湖统计
*
* @return
*/
List<Map<String, Object>> getInspectQuestionDriverList(@Param("startTime") String startTime, @Param("endTime") String endTime);

/**
* 指挥大屏问题清单 - 问题列表分页数据
*
@@ -78,4 +85,5 @@ public interface UserInspectQuestionMapper extends BaseMapper<UserInspectQuestio
* @return
*/
IPage<IndexQuestionListVo> selectIndexPageList(IPage page, @Param("param") IndexQuestionDto indexQuestionDto);

}

+ 12
- 0
src/main/java/com/taauav/front/mapper/UserInspectQuestionMapper.xml View File

@@ -82,6 +82,18 @@
GROUP BY d.driver_area
</select>

<!-- 数据统计巡检问题河湖统计 -->
<select id="getInspectQuestionDriverList" resultType="java.util.Map">
SELECT d.driver_id as driverId,d.driver_name AS driverName,count(d.id) AS totalNum FROM tauv_inspect_question AS q
INNER JOIN tauv_inspect_driver AS d ON q.inspect_driver_id=d.id
WHERE q.mark=1 AND d.mark=1
<if test="startTime != null and startTime !='' and endTime != null and endTime !=''">
and q.create_time between #{startTime} and #{endTime}
</if>
GROUP BY d.driver_id
ORDER BY totalNum DESC;
</select>

<!-- 获取指挥大屏问题清单-问题分页列表数据 -->
<select id="selectIndexPageList" resultType="com.taauav.front.vo.IndexQuestionListVo">


+ 13
- 0
src/main/java/com/taauav/front/mapper/UserWaterAlarmMapper.java View File

@@ -2,6 +2,10 @@ package com.taauav.front.mapper;

import com.taauav.admin.entity.TauvWaterAlarm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
* <p>
@@ -13,4 +17,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface UserWaterAlarmMapper extends BaseMapper<TauvWaterAlarm> {

/**
* 数据统计水质污染程度统计
*
* @param startTime 开始时间
* @param endTime 结束时间
* @return
*/
List<Map<String, Object>> getWaterAlarmInfoList(@Param("startTime") String startTime, @Param("endTime") String endTime);

}

+ 21
- 0
src/main/java/com/taauav/front/mapper/UserWaterAlarmMapper.xml View File

@@ -2,4 +2,25 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.taauav.front.mapper.UserWaterAlarmMapper">

<!-- 数据统计水质污染程度统计 -->
<select id="getWaterAlarmInfoList" resultType="java.util.Map">
SELECT g.* FROM (
SELECT a.inspect_driver_id,a.driver_id,a.driver_name,a.driver_area,c.`name`,a.measured_standard,(
CASE `measured_standard`
WHEN 5 THEN '重度污染'
WHEN 4 THEN '中度污染'
ELSE NULL
END
) 'measured_name' FROM tauv_water_alarm AS a
INNER JOIN sys_city AS c ON c.id=a.driver_area
WHERE a.mark=1
<if test="startTime != null and startTime !='' and endTime != null and endTime !=''">
and a.create_time between #{startTime} and #{endTime}
</if>
ORDER BY measured_standard DESC
LIMIT 6
) AS g
GROUP BY inspect_driver_id
</select>

</mapper>

+ 2
- 2
src/main/java/com/taauav/front/service/IUserInspectQuestionService.java View File

@@ -1,12 +1,12 @@
package com.taauav.front.service;

import com.taauav.admin.entity.TauvInspectQuestion;
import com.taauav.common.bean.Response;
import com.taauav.common.core.mps.BaseQuery;
import com.taauav.common.service.IBaseService;
import com.taauav.front.dto.IndexQuestionDto;
import com.taauav.front.dto.inspectquestion.InspectQuestionDealwithDto;
import com.taauav.front.dto.inspectquestion.InspectQuestionDto;
import com.taauav.front.entity.UserInspectQuestion;
import com.taauav.front.query.UserInspectQuestionQuery;

/**
@@ -17,7 +17,7 @@ import com.taauav.front.query.UserInspectQuestionQuery;
* @author 鲲鹏
* @since 2020-05-14
*/
public interface IUserInspectQuestionService extends IBaseService<UserInspectQuestion> {
public interface IUserInspectQuestionService extends IBaseService<TauvInspectQuestion> {

/**
* 获取巡检问题列表

+ 9
- 8
src/main/java/com/taauav/front/service/impl/UserInspectQuestionServiceImpl.java View File

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

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.taauav.admin.entity.TauvInspectQuestion;
import com.taauav.admin.service.ISysCityService;
import com.taauav.common.bean.Response;
import com.taauav.common.core.mps.BaseQuery;
@@ -14,7 +15,6 @@ import com.taauav.front.constant.UserInspectQuestionConstant;
import com.taauav.front.dto.IndexQuestionDto;
import com.taauav.front.dto.inspectquestion.InspectQuestionDealwithDto;
import com.taauav.front.dto.inspectquestion.InspectQuestionDto;
import com.taauav.front.entity.UserInspectQuestion;
import com.taauav.front.mapper.UserInspectQuestionMapper;
import com.taauav.front.query.UserInspectQuestionQuery;
import com.taauav.front.service.IUserInspectQuestionService;
@@ -40,7 +40,7 @@ import java.util.List;
* @since 2020-05-14
*/
@Service
public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQuestionMapper, UserInspectQuestion> implements IUserInspectQuestionService {
public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQuestionMapper, TauvInspectQuestion> implements IUserInspectQuestionService {

@Autowired
private UserInspectQuestionMapper inspectQuestionMapper;
@@ -109,14 +109,14 @@ public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQ
if (StringUtils.isEmpty(inspectQuestionDto.getAssignUser())) {
return response.failure("责任人不能为空");
}
UserInspectQuestion inspectQuestion = inspectQuestionMapper.selectById(inspectQuestionDto.getId());
TauvInspectQuestion inspectQuestion = inspectQuestionMapper.selectById(inspectQuestionDto.getId());
if (inspectQuestion == null) {
return response.failure("巡检问题信息不存在");
}
if (inspectQuestion.getStatus() == 3) {
return response.failure("巡检问题已处理完成,无法指派");
}
UserInspectQuestion entity = new UserInspectQuestion();
TauvInspectQuestion entity = new TauvInspectQuestion();
entity.setId(inspectQuestionDto.getId());
entity.setAssignUser(inspectQuestionDto.getAssignUser());
entity.setAssignContact(inspectQuestionDto.getAssignContact());
@@ -144,7 +144,7 @@ public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQ
if (StringUtils.isEmpty(inspectQuestionDealwithDto.getHandlerImage())) {
return response.failure("处理结果图片不能为空");
}
UserInspectQuestion inspectQuestion = inspectQuestionMapper.selectById(inspectQuestionDealwithDto.getId());
TauvInspectQuestion inspectQuestion = inspectQuestionMapper.selectById(inspectQuestionDealwithDto.getId());
if (inspectQuestion == null) {
return response.failure("巡检问题信息不存在");
}
@@ -154,7 +154,7 @@ public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQ
if (inspectQuestion.getStatus() == 3) {
return response.failure("巡检问题已处理完成,无需再次处理");
}
UserInspectQuestion entity = new UserInspectQuestion();
TauvInspectQuestion entity = new TauvInspectQuestion();
entity.setId(inspectQuestionDealwithDto.getId());
entity.setHandlerUser(ShiroUtils.getAdminId());
entity.setHandlerResult(inspectQuestionDealwithDto.getHandlerResult());
@@ -203,7 +203,7 @@ public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQ
if (id == null || id <= 0) {
return response.failure("问题ID不能为空");
}
UserInspectQuestion entity = inspectQuestionMapper.selectById(id);
TauvInspectQuestion entity = inspectQuestionMapper.selectById(id);
if (entity == null) {
return response.failure("巡检问题信息不存在");
}
@@ -226,7 +226,7 @@ public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQ
if (id == null || id <= 0) {
return response.failure("问题ID不能为空");
}
UserInspectQuestion entity = inspectQuestionMapper.selectById(id);
TauvInspectQuestion entity = inspectQuestionMapper.selectById(id);
if (entity == null) {
return response.failure("巡检问题信息不存在");
}
@@ -240,6 +240,7 @@ public class UserInspectQuestionServiceImpl extends BaseServiceImpl<UserInspectQ

/**
* 获取指挥大屏问题清单分页列表数据
*
* @param indexQuestionDto
* @param query
* @return

+ 2
- 4
src/main/java/com/taauav/front/vo/IndexQuestionListVo.java View File

@@ -1,10 +1,8 @@
package com.taauav.front.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.taauav.front.entity.UserInspectQuestion;
import com.taauav.admin.entity.TauvInspectQuestion;
import lombok.Data;

import java.util.Date;

/**
* 指挥大屏-问题清单 返回结果实体类
@@ -13,7 +11,7 @@ import java.util.Date;
* @date 2020-05-20
*/
@Data
public class IndexQuestionListVo extends UserInspectQuestion {
public class IndexQuestionListVo extends TauvInspectQuestion {

/**
* 问题类型

Loading…
Cancel
Save