Commit 9a96849e authored by zhangjianqian's avatar zhangjianqian

大屏 基本信息以及任务完成数据对接

parent 0715ba09
...@@ -133,4 +133,11 @@ public class TWorkOrderController extends BaseController ...@@ -133,4 +133,11 @@ public class TWorkOrderController extends BaseController
{ {
return toAjax(tWorkOrderService.deleteTWorkOrderByIds(workIds)); return toAjax(tWorkOrderService.deleteTWorkOrderByIds(workIds));
} }
@GetMapping("/selectWorkOrderNum")
public AjaxResult selectWorkOrderNum(String enterpriseId)
{
return AjaxResult.success(tWorkOrderService.selectWorkOrderNum(enterpriseId));
}
} }
package com.zehong.system.mapper; package com.zehong.system.mapper;
import java.util.List; import java.util.List;
import java.util.Map;
import com.zehong.system.domain.TWorkOrder; import com.zehong.system.domain.TWorkOrder;
import com.zehong.system.domain.vo.HomepageVo; import com.zehong.system.domain.vo.HomepageVo;
import org.apache.ibatis.annotations.Param;
/** /**
* 燃气任务Mapper接口 * 燃气任务Mapper接口
...@@ -66,4 +69,11 @@ public interface TWorkOrderMapper ...@@ -66,4 +69,11 @@ public interface TWorkOrderMapper
* @return 结果 * @return 结果
*/ */
public int deleteTWorkOrderByIds(Long[] workIds); public int deleteTWorkOrderByIds(Long[] workIds);
/**
* 查询任务完成率
* @param enterpriseId
* @return
*/
public Map<String,Object> selectWorkOrderNum(@Param("enterpriseIds")String[] enterpriseIds);
} }
package com.zehong.system.service; package com.zehong.system.service;
import java.util.List; import java.util.List;
import java.util.Map;
import com.zehong.system.domain.TWorkOrder; import com.zehong.system.domain.TWorkOrder;
import com.zehong.system.domain.vo.HomepageVo; import com.zehong.system.domain.vo.HomepageVo;
...@@ -66,4 +68,6 @@ public interface ITWorkOrderService ...@@ -66,4 +68,6 @@ public interface ITWorkOrderService
* @return 结果 * @return 结果
*/ */
public int deleteTWorkOrderById(Long workId); public int deleteTWorkOrderById(Long workId);
public Map<String,Object> selectWorkOrderNum(String enterpriseId);
} }
...@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 燃气任务Service业务层处理 * 燃气任务Service业务层处理
...@@ -132,4 +133,15 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -132,4 +133,15 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
{ {
return tWorkOrderMapper.deleteTWorkOrderById(workId); return tWorkOrderMapper.deleteTWorkOrderById(workId);
} }
/**
*
* @param enterpriseId
* @return
*/
@Override
public Map<String,Object> selectWorkOrderNum(String enterpriseId){
return tWorkOrderMapper.selectWorkOrderNum(enterpriseId.split(","));
}
} }
...@@ -208,4 +208,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -208,4 +208,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{workId} #{workId}
</foreach> </foreach>
</delete> </delete>
<select id="selectWorkOrderNum" resultType="java.util.HashMap">
SELECT IFNULL(SUM(IF(work_status=3 AND work_type=1,1,0))/SUM(IF(work_type=1,1,0)),0) AS typeOne,
IFNULL(SUM(IF(work_status=3 AND work_type=2,1,0))/SUM(IF(work_type=2,1,0)),0) AS typeTwo,
IFNULL(SUM(IF(work_status=3 AND work_type=3,1,0))/SUM(IF(work_type=3,1,0)),0) AS typeThree,
IFNULL(SUM(IF(work_status=3 AND work_type=4,1,0))/SUM(IF(work_type=4,1,0)),0) AS typeFor,
(SELECT COUNT(employed_people_id) FROM t_employed_people_info WHERE is_del = 0
AND beyond_enterprise_id IN
<foreach item="enterpriseId" collection="enterpriseIds" open="(" separator="," close=")">
#{enterpriseId}
</foreach>
) AS peopleNum,
(SELECT CAST(SUM(pipe_length) AS DECIMAL(20,0)) FROM t_pipe_info WHERE is_del = 0
AND beyond_enterprise_id IN
<foreach item="enterpriseId" collection="enterpriseIds" open="(" separator="," close=")">
#{enterpriseId}
</foreach>
)AS allPipeLength
FROM t_work_order WHERE is_del = 0
AND work_assign_enterprose_id IN
<foreach item="enterpriseId" collection="enterpriseIds" open="(" separator="," close=")">
#{enterpriseId}
</foreach>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -50,4 +50,12 @@ export function exportOrder(query) { ...@@ -50,4 +50,12 @@ export function exportOrder(query) {
method: 'get', method: 'get',
params: query params: query
}) })
} }
\ No newline at end of file
export function selectWorkOrderNum(query) {
return request({
url: '/system/order/selectWorkOrderNum',
method: 'get',
params: query
})
}
<template> <template>
<div> <div>
<div> <div>
<div class="item1"> <div class="item1">
<span class="dot"> <span class="dot">
<span class="dot-inner"></span> <span class="dot-inner"></span>
</span> </span>
<span style="letter-spacing :3px;color:#cddbe4">基本信息</span> <span style="letter-spacing :3px;color:#cddbe4">基本信息</span>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #2c888899;float: right;margin-top: 10px;transform: skewX(-25deg)"></div> <div class="fong-div" style="width: 8px;height: 12px;background-color: #2c888899;float: right;margin-top: 10px;transform: skewX(-25deg)"></div>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #24b1b1b3;float: right;margin-top: 10px;margin-right: 10px;transform: skewX(-25deg)"></div> <div class="fong-div" style="width: 8px;height: 12px;background-color: #24b1b1b3;float: right;margin-top: 10px;margin-right: 10px;transform: skewX(-25deg)"></div>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #11e9e9b3;float: right;margin-top: 10px;margin-right: 10px;transform: skewX(-25deg)"></div> <div class="fong-div" style="width: 8px;height: 12px;background-color: #11e9e9b3;float: right;margin-top: 10px;margin-right: 10px;transform: skewX(-25deg)"></div>
</div> </div>
</div> </div>
<div class="left-top" style="margin-top: 40px;width: 430px;margin-left: 10px;display: flex;justify-content: space-around;"> <div class="left-top" style="margin-top: 40px;width: 430px;margin-left: 10px;display: flex;justify-content: space-around;">
<div style="width: 40%;text-align: center;color: #339CC9;"> <div style="width: 40%;text-align: center;color: #339CC9;">
<div class="div-p">从业人员数</div> <div class="div-p">从业人员数</div>
<span style="font-family: 'arialbd';font-size: 35px;background-image:-webkit-linear-gradient(bottom,#f0c41b,#e4dbb7);-webkit-background-clip:text;-webkit-text-fill-color:transparent; ">{{datanow.congyeNum}}</span> <span style="font-family: 'arialbd';font-size: 35px;background-image:-webkit-linear-gradient(bottom,#f0c41b,#e4dbb7);-webkit-background-clip:text;-webkit-text-fill-color:transparent; ">{{allNum.peopleNum}}</span>
</div> </div>
<div style="width: 40%;text-align: center;color: #339CC9;"> <div style="width: 40%;text-align: center;color: #339CC9;">
<div class="div-p">管道长度(m)</div> <div class="div-p">管道长度(m)</div>
<span style="font-family: 'arialbd';font-size: 35px;background-image:-webkit-linear-gradient(bottom,#f86742,#f0c41b);-webkit-background-clip:text;-webkit-text-fill-color:transparent; ">{{datanow.guandaoNum}}</span> <span style="font-family: 'arialbd';font-size: 35px;background-image:-webkit-linear-gradient(bottom,#f86742,#f0c41b);-webkit-background-clip:text;-webkit-text-fill-color:transparent; ">{{allNum.allPipeLength}}</span>
</div> </div>
</div> </div>
<div> <div>
<div class="item1" style="margin-top: 30px;"> <div class="item1" style="margin-top: 30px;">
<span class="dot"> <span class="dot">
<span class="dot-inner"></span> <span class="dot-inner"></span>
</span> </span>
<span style="letter-spacing :3px;color:#cddbe4">安全监管</span> <span style="letter-spacing :3px;color:#cddbe4">安全监管</span>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #2c888899;float: right;margin-top: 10px;transform: skewX(-25deg)"></div> <div class="fong-div" style="width: 8px;height: 12px;background-color: #2c888899;float: right;margin-top: 10px;transform: skewX(-25deg)"></div>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #24b1b1b3;float: right;margin-top: 10px;margin-right: 10px;transform: skewX(-25deg)"></div> <div class="fong-div" style="width: 8px;height: 12px;background-color: #24b1b1b3;float: right;margin-top: 10px;margin-right: 10px;transform: skewX(-25deg)"></div>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #11e9e9b3;float: right;margin-top: 10px;margin-right: 10px;transform: skewX(-25deg)"></div> <div class="fong-div" style="width: 8px;height: 12px;background-color: #11e9e9b3;float: right;margin-top: 10px;margin-right: 10px;transform: skewX(-25deg)"></div>
</div> </div>
</div> </div>
<div id="main1" style="width: 100%;height: 280px;"></div> <div id="main1" style="width: 100%;height: 280px;"></div>
...@@ -41,39 +41,34 @@ ...@@ -41,39 +41,34 @@
<span class="dot-inner"></span> <span class="dot-inner"></span>
</span> </span>
<span style="letter-spacing :3px;color:#cddbe4">任务完成率</span> <span style="letter-spacing :3px;color:#cddbe4">任务完成率</span>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #2c888899;float: right;margin-top: 10px;transform: skewX(-25deg)"></div> <div class="fong-div" style="width: 8px;height: 12px;background-color: #2c888899;float: right;margin-top: 10px;transform: skewX(-25deg)"></div>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #24b1b1b3;float: right;margin-top: 10px;margin-right: 10px;transform: skewX(-25deg)"></div> <div class="fong-div" style="width: 8px;height: 12px;background-color: #24b1b1b3;float: right;margin-top: 10px;margin-right: 10px;transform: skewX(-25deg)"></div>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #11e9e9b3;float: right;margin-top: 10px;margin-right: 10px;transform: skewX(-25deg)"></div> <div class="fong-div" style="width: 8px;height: 12px;background-color: #11e9e9b3;float: right;margin-top: 10px;margin-right: 10px;transform: skewX(-25deg)"></div>
</div> </div>
</div> </div>
<!-- <div id="myCharttwo" :style="{width: '450px', height: '270px'}"></div>
<div class="titleTex" style="height: 20px;margin-top: 0px;font-size: 15px;">
● 已完成数量:{{datanow.renwu[1]}}
</div>
<div class="titleTex" style="height: 20px;margin-top: 0px;font-size: 15px;color: #0099ff">
● 未成数量:{{datanow.renwu[0]}}
</div> -->
<div class="div-el"> <div class="div-el">
<div class="el-left">入户安检</div> <div class="el-left">入户安检</div>
<el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="63"></el-progress> <el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="allNum.typeOne*100"></el-progress>
</div> </div>
<div class="div-el"> <div class="div-el">
<div class="el-left">巡查</div> <div class="el-left">巡查</div>
<el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="50" status="success"></el-progress> <el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="allNum.typeTwo*100" status="success"></el-progress>
</div> </div>
<div class="div-el"> <div class="div-el">
<div class="el-left">报警巡查</div> <div class="el-left">报警巡查</div>
<el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="80" status="warning"></el-progress> <el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="allNum.typeThree*100" status="warning"></el-progress>
</div> </div>
<div class="div-el"> <div class="div-el">
<div class="el-left">其他</div> <div class="el-left">其他</div>
<el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="50" status="exception"></el-progress> <el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="allNum.typeFor*100" status="exception"></el-progress>
</div> </div>
<!-- </div> --> <!-- </div> -->
</div> </div>
</template> </template>
<script> <script>
import { selectWorkOrderNum } from "@/api/operationMonitor/order";
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') let echarts = require('echarts/lib/echarts')
// 引入柱状图组件 // 引入柱状图组件
...@@ -84,6 +79,18 @@ ...@@ -84,6 +79,18 @@
export default { export default {
data () { data () {
  return {   return {
allNum:{},
zeroNum:{
allPipeLength: 0,
peopleNum: 0,
typeFor: 0,
typeOne: 0,
typeThree: 0,
typeTwo: 0
},
enterpriseIds:{
enterpriseId:""
},
dataAll:{ dataAll:{
congyeNum:1544, congyeNum:1544,
guandaoNum:3658495, guandaoNum:3658495,
...@@ -128,30 +135,42 @@ ...@@ -128,30 +135,42 @@
mounted(){ mounted(){
this.datanow = this.dataAll; this.datanow = this.dataAll;
this.drawLine(this.datanow); this.drawLine(this.datanow);
this.initdata(this.datanow); //this.getNum(null)
}, },
methods: { methods: {
choice(index){ choice(val){
console.log("-----"+index) // if(index==0){
if(index==0){ // this.datanow = this.dataAll;
this.datanow = this.dataAll; // this.drawLine(this.datanow);
this.drawLine(this.datanow); // this.getNum(index);
this.initdata(this.datanow); // }else
}else this.getNum(val);
if(index==1){ // if(index==1){
this.datanow = this.dataone; // this.datanow = this.dataone;
this.drawLine(this.datanow); // this.drawLine(this.datanow);
this.initdata(this.datanow); // }else if(index==2){
}else if(index==2){ // this.datanow = this.datatwo;
this.datanow = this.datatwo; // this.drawLine(this.datanow);
this.drawLine(this.datanow); // }else if(index==3){
this.initdata(this.datanow); // this.datanow = this.datathree;
}else if(index==3){ // this.drawLine(this.datanow);
this.datanow = this.datathree; // }
this.drawLine(this.datanow);
this.initdata(this.datanow);
}
}, },
getNum( val){
if(val!=null && val!=''){
this.enterpriseIds.enterpriseId = val.toString();
selectWorkOrderNum (this.enterpriseIds).then(response => {
console.log(response);
this.allNum=response.data;
});
}else {
this.allNum = this.zeroNum;
}
},
//折线图
drawLine(data){ drawLine(data){
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
let myChart = echarts.init(document.getElementById('main1')) let myChart = echarts.init(document.getElementById('main1'))
...@@ -163,12 +182,12 @@ ...@@ -163,12 +182,12 @@
color:"#cddbe4" color:"#cddbe4"
}, },
}, },
grid: { grid: {
left: '5%', left: '5%',
right: '7%', right: '7%',
bottom: '4%', bottom: '4%',
containLabel: true containLabel: true
}, },
xAxis: { xAxis: {
axisLine: { axisLine: {
...@@ -248,86 +267,6 @@ ...@@ -248,86 +267,6 @@
] ]
}); });
}, },
initdata(data){
// 基于准备好的dom,初始化echarts实例
//console.log(data.renwu[0]+"=-=-=-"+data.renwu[1])
let myChart2 = this.$echarts.init(document.getElementById('myCharttwo'))
// 绘制图表
myChart2.setOption({
title: {
text: '任务总数量:'+data.renwuzong,
left: 'center',
top :20,
textStyle:{
color: "#00ffff"
}
},
tooltip: {
trigger: 'item',
},
series: [
{
name: '任务概况',
type: 'pie',
radius: '60%',
center: ['50%','58%'],
data: [
{
value: data.renwu[0],
name: '未完成',
itemStyle: { color: '#09f' }
},
{
value: data.renwu[1],
name: '已完成' ,
itemStyle: { color: '#00ffff' }
},
],
labelLine:{
length:20,
length2:50,
},
label:{
color:'#fff',
fontSize: 14,
// formatter:"{b}\n\n",
// padding:[0,-55],
normal: {
show: true,
position: 'outer',
// formatter: '{d}%, {c} \n\n',
//模板变量有 {a}, {b},{c},{d},{e},分别表示系列名,数据名,数据值等。
formatter: "{a_set|{b}}\n{b_set|{d}%}\n\n\n",
// formatter: "{a_set|{b}}\n{c_set|{d}%}\n{b|}\n\n",
borderWidth: 20,
borderRadius: 4,
padding: [0, -55],
rich: {
a_set: {
color: "#fff",
lineHeight: 20,
align: "center",
padding: [55, -40, -15, -40],
},
b_set:{
color: "auto",
},
}
}
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
});
},
} }
...@@ -335,7 +274,7 @@ ...@@ -335,7 +274,7 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/* @font-face { /* @font-face {
font-family: 'arialbd'; font-family: 'arialbd';
} */ } */
......
...@@ -313,7 +313,7 @@ export default { ...@@ -313,7 +313,7 @@ export default {
this.currentTime(); this.currentTime();
this.$refs.mychild.choice(0); this.$refs.mychild.choice(0);
this.$refs.mychild2.choice(0); this.$refs.mychild2.choice(this.selarr);
}, },
methods: { methods: {
...mapActions({ ...mapActions({
...@@ -387,6 +387,7 @@ export default { ...@@ -387,6 +387,7 @@ export default {
this.map.allfilter(this.selarr, this.selarr1); this.map.allfilter(this.selarr, this.selarr1);
this.map.infowindowClose(); this.map.infowindowClose();
this.show = false; this.show = false;
this.$refs.mychild2.choice(this.selarr);
}, },
sel(index, item) { sel(index, item) {
this.map.infowindowClose(); this.map.infowindowClose();
...@@ -408,6 +409,7 @@ export default { ...@@ -408,6 +409,7 @@ export default {
} }
// this.map.companyFilter(this.selarr); // this.map.companyFilter(this.selarr);
this.map.allfilter(this.selarr, this.selarr1); this.map.allfilter(this.selarr, this.selarr1);
this.$refs.mychild2.choice(this.selarr);
}, },
sel1(index, item) { sel1(index, item) {
......
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