Commit c040eeff authored by 耿迪迪's avatar 耿迪迪

安检量统计筛选统计修改

parent a0d0ac5c
...@@ -242,6 +242,7 @@ public class TTaskInspectServiceImpl implements ITTaskInspectService ...@@ -242,6 +242,7 @@ public class TTaskInspectServiceImpl implements ITTaskInspectService
if(null != param.get("beginTime") || null != param.get("memberId")){ if(null != param.get("beginTime") || null != param.get("memberId")){
Map<String,String> newParam = new HashMap<>(); Map<String,String> newParam = new HashMap<>();
newParam.put("village",param.get("village")); newParam.put("village",param.get("village"));
newParam.put("street",param.get("street"));
List<Map<String,Object>> statisticResultNew = tTaskInspectMapper.inspectNumStatisticByInspector(newParam); List<Map<String,Object>> statisticResultNew = tTaskInspectMapper.inspectNumStatisticByInspector(newParam);
groupByTask = statisticResultNew.stream().collect(Collectors.groupingBy(e ->e.get("taskId"))); groupByTask = statisticResultNew.stream().collect(Collectors.groupingBy(e ->e.get("taskId")));
}else{ }else{
......
...@@ -443,13 +443,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -443,13 +443,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY relation.task_id GROUP BY relation.task_id
) user_counts ON user_counts.task_id = inspect.task_id ) user_counts ON user_counts.task_id = inspect.task_id
LEFT JOIN t_task task ON task.id = inspect.task_id LEFT JOIN t_task task ON task.id = inspect.task_id
<if test="village != null"> <if test="village != null or street != null">
LEFT JOIN t_user u ON u.id = inspect.receive_id LEFT JOIN t_user u ON u.id = inspect.receive_id
</if> </if>
<where> <where>
task.status = 0 task.status = 0
<if test="beginTime != null and endTime != null"> and inspect.create_time between #{beginTime} and #{endTime}</if> <if test="beginTime != null and endTime != null"> and inspect.create_time between #{beginTime} and #{endTime}</if>
<if test="village != null"> and u.village = #{village}</if> <if test="village != null"> and u.village = #{village}</if>
<if test="street != null"> and u.street = #{street}</if>
<if test="memberId != null"> and inspect.member_id = #{memberId}</if> <if test="memberId != null"> and inspect.member_id = #{memberId}</if>
</where> </where>
GROUP BY inspect.member_id,inspect.task_id; GROUP BY inspect.member_id,inspect.task_id;
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="120px"> <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="130px">
<el-form-item label="起止时间"> <el-form-item label="起止时间">
<el-date-picker <el-date-picker
v-model="time" v-model="time"
type="datetimerange" type="daterange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
size="small" size="small"
@change="timeChange" @change="timeChange"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd"
:clearable="false" :clearable="false"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="所属区域(区县)" prop="street">
<el-select
v-model="queryParams.street"
placeholder="所属区域(区县)"
@change="changeStreet"
>
<el-option
v-for="item in streetData"
:key="item.id"
:label="item.areaName"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="所属区域(村)" prop="village"> <el-form-item label="所属区域(村)" prop="village">
<el-select v-model="queryParams.village" placeholder="所属区域(村)"> <el-select v-model="queryParams.village" placeholder="所属区域(村)">
<el-option <el-option
...@@ -51,6 +66,7 @@ ...@@ -51,6 +66,7 @@
<script> <script>
import {inspectNumStatisticByInspector} from "@/api/checktask/inspect"; import {inspectNumStatisticByInspector} from "@/api/checktask/inspect";
import { communityList } from "@/api/baseinfo/community"; import { communityList } from "@/api/baseinfo/community";
import { aLLAreaListInfo } from "@/api/baseinfo/area";
export default { export default {
name: "inspect-statistic-index", name: "inspect-statistic-index",
data(){ data(){
...@@ -58,17 +74,20 @@ ...@@ -58,17 +74,20 @@
queryParams:{ queryParams:{
beginTime: null, beginTime: null,
endTime: null, endTime: null,
village: null village: null,
street: null
}, },
loading: true, loading: true,
inspectStatisticInfoList: [], inspectStatisticInfoList: [],
time: [], time: [],
communityData: [] communityData: [],
streetData: []
} }
}, },
created(){ created(){
this.getList(); this.getList();
this.getCommunityInfo(); this.getCommunityInfo();
this.getStreet();
}, },
methods:{ methods:{
/** 搜索按钮操作 */ /** 搜索按钮操作 */
...@@ -81,6 +100,7 @@ ...@@ -81,6 +100,7 @@
this.resetForm("queryForm"); this.resetForm("queryForm");
this.queryParams.beginTime = null; this.queryParams.beginTime = null;
this.queryParams.endTime = null; this.queryParams.endTime = null;
this.getCommunityInfo();
this.time = []; this.time = [];
this.handleQuery(); this.handleQuery();
}, },
...@@ -93,7 +113,7 @@ ...@@ -93,7 +113,7 @@
let statistic = {inspector: "汇总",noInspectNum: 0,normalInspectNum: 0,refuseInspectNum: 0,stopInspectNum: 0, let statistic = {inspector: "汇总",noInspectNum: 0,normalInspectNum: 0,refuseInspectNum: 0,stopInspectNum: 0,
missInspectNum: 0,dangerNum: 0,noDangerNum: 0,total: 0}; missInspectNum: 0,dangerNum: 0,noDangerNum: 0,total: 0};
this.inspectStatisticInfoList.forEach(item =>{ this.inspectStatisticInfoList.forEach(item =>{
let total = item.noInspectNum + item.normalInspectNum + item.refuseInspectNum + item.stopInspectNum + item.missInspectNum + item.dangerNum + item.noDangerNum; let total = item.normalInspectNum + item.refuseInspectNum + item.stopInspectNum + item.missInspectNum;
statistic.noInspectNum += item.noInspectNum; statistic.noInspectNum += item.noInspectNum;
statistic.normalInspectNum += item.normalInspectNum; statistic.normalInspectNum += item.normalInspectNum;
statistic.refuseInspectNum += item.refuseInspectNum; statistic.refuseInspectNum += item.refuseInspectNum;
...@@ -114,12 +134,24 @@ ...@@ -114,12 +134,24 @@
}, },
//获取小区信息 //获取小区信息
getCommunityInfo(){ getCommunityInfo(){
communityList().then(res =>{ communityList({street: this.queryParams.street}).then(res =>{
if(res.code == 200){ if(res.code == 200){
this.communityData = res.data; this.communityData = res.data;
} }
}) })
}, },
//获取街道镇信息
getStreet(){
aLLAreaListInfo({parentId: 8}).then(res =>{
if(res.code == 200){
this.streetData = res.data;
}
})
},
changeStreet(){
this.queryParams.village = null;
this.getCommunityInfo();
}
} }
} }
</script> </script>
......
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