Commit 0b181fee authored by 王晓倩's avatar 王晓倩

首页数据接口及路由

parent 17621578
...@@ -8,13 +8,15 @@ import com.zehong.common.utils.file.FileUploadUtils; ...@@ -8,13 +8,15 @@ import com.zehong.common.utils.file.FileUploadUtils;
import com.zehong.common.utils.file.FileUtils; import com.zehong.common.utils.file.FileUtils;
import com.zehong.framework.config.ServerConfig; import com.zehong.framework.config.ServerConfig;
import com.zehong.system.domain.THiddenDangerStandingBook; import com.zehong.system.domain.THiddenDangerStandingBook;
import com.zehong.system.domain.TSafeEquipmentStandingBook;
import com.zehong.system.domain.TTroubleStandingBook; import com.zehong.system.domain.TTroubleStandingBook;
import com.zehong.system.domain.TVideoManager;
import com.zehong.system.domain.form.THiddenDangerStandingBookForm; import com.zehong.system.domain.form.THiddenDangerStandingBookForm;
import com.zehong.system.domain.form.TTroubleStandingBookForm; import com.zehong.system.domain.form.TTroubleStandingBookForm;
import com.zehong.system.domain.vo.HomepageVo;
import com.zehong.system.domain.vo.THiddenDangerStandingBookVo; import com.zehong.system.domain.vo.THiddenDangerStandingBookVo;
import com.zehong.system.domain.vo.TTroubleStandingBookVo; import com.zehong.system.domain.vo.TTroubleStandingBookVo;
import com.zehong.system.service.ITHiddenDangerStandingBookService; import com.zehong.system.service.*;
import com.zehong.system.service.ITTroubleStandingBookService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -41,10 +43,18 @@ public class StatisticController ...@@ -41,10 +43,18 @@ public class StatisticController
{ {
private static final Logger log = LoggerFactory.getLogger(StatisticController.class); private static final Logger log = LoggerFactory.getLogger(StatisticController.class);
@Autowired
private ITVideoManagerService tVideoManagerService;
@Autowired
private ITSafeEquipmentStandingBookService tSafeEquipmentStandingBookService;
@Autowired @Autowired
private ITTroubleStandingBookService tTroubleStandingBookService; private ITTroubleStandingBookService tTroubleStandingBookService;
@Autowired @Autowired
private ITHiddenDangerStandingBookService tHiddenDangerStandingBookService; private ITHiddenDangerStandingBookService tHiddenDangerStandingBookService;
@Autowired
private ITComplainDealService tComplainDealService;
@Autowired
private ITWorkOrderService tWorkOrderService;
/** /**
* 燃气事故台账统计 * 燃气事故台账统计
...@@ -64,4 +74,28 @@ public class StatisticController ...@@ -64,4 +74,28 @@ public class StatisticController
return AjaxResult.success(tHiddenDangerStandingBookService.selectTHiddenDangerStandingBookStatistic()); return AjaxResult.success(tHiddenDangerStandingBookService.selectTHiddenDangerStandingBookStatistic());
} }
/**
* 首页统计
*/
@GetMapping("/homepageStatistic")
public AjaxResult homepageStatistic()
{
HomepageVo homepageVo = new HomepageVo();
homepageVo = tComplainDealService.countTComplainDeal();
homepageVo = tWorkOrderService.countTWorkOrder();
List<TVideoManager> tVideoManagerList = tVideoManagerService.selectTVideoManagerList(null);
List<TSafeEquipmentStandingBook> tSafeEquipmentStandingBookList = tSafeEquipmentStandingBookService.selectTSafeEquipmentStandingBookList(null);
List<TTroubleStandingBook> tTroubleStandingBookList = tTroubleStandingBookService.selectTTroubleStandingBookList(null);
List<THiddenDangerStandingBook> tHiddenDangerStandingBookList = tHiddenDangerStandingBookService.selectTHiddenDangerStandingBookList(null);
homepageVo.setVideoTotal(tVideoManagerList.size());
homepageVo.setEquipmentTotal(tSafeEquipmentStandingBookList.size());
homepageVo.setTroubleTotal(tTroubleStandingBookList.size());
homepageVo.setHiddenTotal(tHiddenDangerStandingBookList.size());
return AjaxResult.success(homepageVo);
}
} }
package com.zehong.system.domain.vo;
import lombok.Data;
@Data
public class HomepageVo
{
// 任务总数
private int taskTotal;
// 任务反馈总数
private int taskFeedbackTotal;
// 投诉总数
private int complaintTotal;
// 投诉反馈总数
private int complaintFeedbackTotal;
// 视频监控总数
private int videoTotal;
// 安全装置总数
private int equipmentTotal;
// 事故总数
private int troubleTotal;
// 隐患总数
private int hiddenTotal;
}
...@@ -5,6 +5,7 @@ import java.util.Map; ...@@ -5,6 +5,7 @@ import java.util.Map;
import java.util.Objects; import java.util.Objects;
import com.zehong.system.domain.TComplainDeal; import com.zehong.system.domain.TComplainDeal;
import com.zehong.system.domain.vo.HomepageVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**
...@@ -31,6 +32,13 @@ public interface TComplainDealMapper ...@@ -31,6 +32,13 @@ public interface TComplainDealMapper
*/ */
public List<TComplainDeal> selectTComplainDealList(TComplainDeal tComplainDeal); public List<TComplainDeal> selectTComplainDealList(TComplainDeal tComplainDeal);
/**
* 投诉处置统计
*
* @return 投诉处置统计
*/
public HomepageVo countTComplainDeal();
/** /**
* 新增投诉处置 * 新增投诉处置
* *
......
...@@ -2,6 +2,7 @@ package com.zehong.system.mapper; ...@@ -2,6 +2,7 @@ package com.zehong.system.mapper;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TWorkOrder; import com.zehong.system.domain.TWorkOrder;
import com.zehong.system.domain.vo.HomepageVo;
/** /**
* 燃气任务Mapper接口 * 燃气任务Mapper接口
...@@ -27,6 +28,13 @@ public interface TWorkOrderMapper ...@@ -27,6 +28,13 @@ public interface TWorkOrderMapper
*/ */
public List<TWorkOrder> selectTWorkOrderList(TWorkOrder tWorkOrder); public List<TWorkOrder> selectTWorkOrderList(TWorkOrder tWorkOrder);
/**
* 燃气任务统计
*
* @return 燃气任务统计
*/
public HomepageVo countTWorkOrder();
/** /**
* 新增燃气任务 * 新增燃气任务
* *
......
...@@ -4,6 +4,7 @@ import java.util.List; ...@@ -4,6 +4,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import com.zehong.system.domain.TComplainDeal; import com.zehong.system.domain.TComplainDeal;
import com.zehong.system.domain.vo.HomepageVo;
/** /**
* 投诉处置Service接口 * 投诉处置Service接口
...@@ -29,6 +30,13 @@ public interface ITComplainDealService ...@@ -29,6 +30,13 @@ public interface ITComplainDealService
*/ */
public List<TComplainDeal> selectTComplainDealList(TComplainDeal tComplainDeal); public List<TComplainDeal> selectTComplainDealList(TComplainDeal tComplainDeal);
/**
* 投诉处置统计
*
* @return 投诉处置统计
*/
public HomepageVo countTComplainDeal();
/** /**
* 新增投诉处置 * 新增投诉处置
* *
......
...@@ -2,6 +2,7 @@ package com.zehong.system.service; ...@@ -2,6 +2,7 @@ package com.zehong.system.service;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TWorkOrder; import com.zehong.system.domain.TWorkOrder;
import com.zehong.system.domain.vo.HomepageVo;
/** /**
* 燃气任务Service接口 * 燃气任务Service接口
...@@ -27,6 +28,13 @@ public interface ITWorkOrderService ...@@ -27,6 +28,13 @@ public interface ITWorkOrderService
*/ */
public List<TWorkOrder> selectTWorkOrderList(TWorkOrder tWorkOrder); public List<TWorkOrder> selectTWorkOrderList(TWorkOrder tWorkOrder);
/**
* 燃气任务统计
*
* @return 燃气任务统计
*/
public HomepageVo countTWorkOrder();
/** /**
* 新增燃气任务 * 新增燃气任务
* *
......
...@@ -4,6 +4,7 @@ import java.util.List; ...@@ -4,6 +4,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.vo.HomepageVo;
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 com.zehong.system.mapper.TComplainDealMapper; import com.zehong.system.mapper.TComplainDealMapper;
...@@ -46,6 +47,16 @@ public class TComplainDealServiceImpl implements ITComplainDealService ...@@ -46,6 +47,16 @@ public class TComplainDealServiceImpl implements ITComplainDealService
return tComplainDealMapper.selectTComplainDealList(tComplainDeal); return tComplainDealMapper.selectTComplainDealList(tComplainDeal);
} }
/**
* 投诉处置统计
*
* @return 投诉处置统计
*/
public HomepageVo countTComplainDeal()
{
return tComplainDealMapper.countTComplainDeal();
}
/** /**
* 新增投诉处置 * 新增投诉处置
* *
......
...@@ -5,6 +5,7 @@ import com.zehong.common.utils.SecurityUtils; ...@@ -5,6 +5,7 @@ import com.zehong.common.utils.SecurityUtils;
import com.zehong.common.utils.StringUtils; import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.TEnterpriseInfo; import com.zehong.system.domain.TEnterpriseInfo;
import com.zehong.system.domain.TWorkOrder; import com.zehong.system.domain.TWorkOrder;
import com.zehong.system.domain.vo.HomepageVo;
import com.zehong.system.mapper.TEnterpriseInfoMapper; import com.zehong.system.mapper.TEnterpriseInfoMapper;
import com.zehong.system.mapper.TWorkOrderMapper; import com.zehong.system.mapper.TWorkOrderMapper;
import com.zehong.system.service.ITWorkOrderService; import com.zehong.system.service.ITWorkOrderService;
...@@ -52,6 +53,16 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -52,6 +53,16 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
return tWorkOrderMapper.selectTWorkOrderList(tWorkOrder); return tWorkOrderMapper.selectTWorkOrderList(tWorkOrder);
} }
/**
* 燃气任务统计
*
* @return 燃气任务统计
*/
public HomepageVo countTWorkOrder()
{
return tWorkOrderMapper.countTWorkOrder();
}
/** /**
* 新增燃气任务 * 新增燃气任务
* *
......
...@@ -45,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -45,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if> <if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if> <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where> </where>
ORDER BY create_time DESC
</select> </select>
<select id="selectTComplainDealById" parameterType="Long" resultMap="TComplainDealResult"> <select id="selectTComplainDealById" parameterType="Long" resultMap="TComplainDealResult">
...@@ -52,6 +53,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -52,6 +53,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where complain_deal_id = #{complainDealId} where complain_deal_id = #{complainDealId}
</select> </select>
<select id="countTComplainDeal" resultType="HomepageVo">
select COUNT(t.complain_deal_id) AS complaintTotal,
SUM(CASE t.complain_status WHEN '2' THEN 1 ELSE 0 END) AS complaintFeedbackTotal
from (select * from t_complain_deal where is_del = '0') t
</select>
<insert id="insertTComplainDeal" parameterType="TComplainDeal" useGeneratedKeys="true" keyProperty="complainDealId"> <insert id="insertTComplainDeal" parameterType="TComplainDeal" useGeneratedKeys="true" keyProperty="complainDealId">
insert into t_complain_deal insert into t_complain_deal
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
......
...@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTVideoManagerList" parameterType="TVideoManager" resultMap="TVideoManagerResult"> <select id="selectTVideoManagerList" parameterType="TVideoManager" resultMap="TVideoManagerResult">
<include refid="selectTVideoManagerVo"/> <include refid="selectTVideoManagerVo"/>
<where> <where> is_del = '0'
<if test="videoName != null and videoName != ''"> and video_name like concat('%', #{videoName}, '%')</if> <if test="videoName != null and videoName != ''"> and video_name like concat('%', #{videoName}, '%')</if>
<if test="resourceId != null and resourceId != ''"> and resource_id = #{resourceId}</if> <if test="resourceId != null and resourceId != ''"> and resource_id = #{resourceId}</if>
<if test="longitude != null "> and longitude = #{longitude}</if> <if test="longitude != null "> and longitude = #{longitude}</if>
...@@ -37,7 +37,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -37,7 +37,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="type != null and type != ''"> and type = #{type}</if> <if test="type != null and type != ''"> and type = #{type}</if>
<if test="beyondEnterpriseId != null "> and beyond_enterprise_id = #{beyondEnterpriseId}</if> <if test="beyondEnterpriseId != null "> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="beyondEnterpriseName != null and beyondEnterpriseName != ''"> and beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if> <if test="beyondEnterpriseName != null and beyondEnterpriseName != ''"> and beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if> <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where> </where>
</select> </select>
......
...@@ -101,6 +101,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -101,6 +101,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where workOrder.work_id = #{workId} where workOrder.work_id = #{workId}
</select> </select>
<select id="countTWorkOrder" resultType="HomepageVo">
select COUNT(t.work_id) AS taskTotal,
SUM(CASE t.work_status WHEN '2' THEN 1 ELSE 0 END) AS taskFeedbackTotal
from (select * from t_work_order where is_del = '0') t
</select>
<insert id="insertTWorkOrder" parameterType="TWorkOrder" useGeneratedKeys="true" keyProperty="workId"> <insert id="insertTWorkOrder" parameterType="TWorkOrder" useGeneratedKeys="true" keyProperty="workId">
insert into t_work_order insert into t_work_order
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
......
import request from '@/utils/request' import request from '@/utils/request'
// 燃气事故台账统计 // 燃气事故台账统计
export function troubleStatistic(query) { export function troubleStatistic() {
return request({ return request({
url: '/statistic/troubleStatistic', url: '/statistic/troubleStatistic',
method: 'get', method: 'get'
params: query
}) })
} }
// 隐患整治台账统计 // 隐患整治台账统计
export function hiddenStatistic(query) { export function hiddenStatistic() {
return request({ return request({
url: '/statistic/hiddenStatistic', url: '/statistic/hiddenStatistic',
method: 'get', method: 'get'
params: query })
}
// 隐患整治台账统计
export function homepageStatistic() {
return request({
url: '/statistic/homepageStatistic',
method: 'get'
}) })
} }
This diff is collapsed.
...@@ -431,7 +431,6 @@ export default { ...@@ -431,7 +431,6 @@ export default {
// 导出遮罩层 // 导出遮罩层
exportLoading: false, exportLoading: false,
detailDialogVisible: false, detailDialogVisible: false,
workForm: {},
// 选中数组 // 选中数组
ids: [], ids: [],
// 非单个禁用 // 非单个禁用
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment