Commit 47f46b34 authored by 王晓倩's avatar 王晓倩
parents 0443a8fb 4f794384
...@@ -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));
}
} }
...@@ -6,10 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -6,10 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -68,16 +65,30 @@ public class PipeInterfaceController { ...@@ -68,16 +65,30 @@ public class PipeInterfaceController {
DeviceList deviceList=new DeviceList(); DeviceList deviceList=new DeviceList();
//调压箱数据循环 //调压箱数据循环
for (int i=0;i<deviceData.size();i++){ for (int i=0;i<deviceData.size();i++){
//临时存下级数据id //临时存储压力表数据数组
List<PressureFlow> pressList=new ArrayList<>(); List<PressureFlow> pressureList=new ArrayList<>();
//临时存储流量计数据数组
List<PressureFlow> flowmeterList=new ArrayList<>();
//存储全部数据
List<PressureFlow> List=new ArrayList<>();
for (int s=0;s<pressureFlows1.size();s++){ for (int s=0;s<pressureFlows1.size();s++){
//判断调压箱id与下级数据调压箱id是否相等 //判断调压箱id与下级数据调压箱id是否相等
if (pressureFlows1.get(s).getDeviceId()==deviceData.get(i).getDeviceId()){ if (pressureFlows1.get(s).getDeviceId()==deviceData.get(i).getDeviceId()){
//下级数据添加进临时存储数据的数组中 //下级数据添加进临时存储数据的数组中
pressList.add(pressureFlows1.get(s)); List.add(pressureFlows1.get(s));
//判断是压力表还是流量计 1压力表 2流量计
if (pressureFlows1.get(s).getDeviceType()=="1"){
pressureList.add(pressureFlows1.get(s));
}else {
flowmeterList.add(pressureFlows1.get(s));
}
} }
} }
deviceData.get(i).setPressureFlows(pressList); //压力表设备数量添加
deviceData.get(i).setNumberPressureGauges(pressureList.size());
deviceData.get(i).setPressureFlows(List);
//流量计设备数量添加
deviceData.get(i).setNumberEquipment(flowmeterList.size());
deviceData.get(i).setIconType(2); deviceData.get(i).setIconType(2);
} }
deviceList.setData(deviceData); deviceList.setData(deviceData);
...@@ -93,11 +104,32 @@ public class PipeInterfaceController { ...@@ -93,11 +104,32 @@ public class PipeInterfaceController {
public TSiteStationInfoDataList selectTSiteStationInfoData(){ public TSiteStationInfoDataList selectTSiteStationInfoData(){
//场站信息查询方法 //场站信息查询方法
List<TSiteStationInfoData> tSiteStationInfoData = iPipeInterfaceService.selectTSiteStationInfoData(); List<TSiteStationInfoData> tSiteStationInfoData = iPipeInterfaceService.selectTSiteStationInfoData();
//查询场站下级设备数据
List<PressureFlow> pressureFlows = iPipeInterfaceService.selecttSiteStationInfoDataList("1");
TSiteStationInfoDataList tSiteStationInfoDataList=new TSiteStationInfoDataList(); TSiteStationInfoDataList tSiteStationInfoDataList=new TSiteStationInfoDataList();
for (int i=0;i<tSiteStationInfoData.size();i++){ for (int i=0;i<tSiteStationInfoData.size();i++){
//查询场站下级设备数据 //临时存储压力表数据数组
List<PressureFlow> pressureFlows = iPipeInterfaceService.selecttSiteStationInfoDataList(tSiteStationInfoData.get(i).getSiteStationId()); List<PressureFlow> pressureList=new ArrayList<>();
tSiteStationInfoData.get(i).setPressureFlows(pressureFlows); //临时存储流量计数据数组
List<PressureFlow> flowmeterList=new ArrayList<>();
//存储全部数据
List<PressureFlow> List=new ArrayList<>();
for (int s=0;s<pressureFlows.size();s++){
if (tSiteStationInfoData.get(i).getSiteStationId()==pressureFlows.get(s).getDeviceId()){
List.add(pressureFlows.get(s));
//判断是压力表还是流量计 1压力表 2流量计
if (pressureFlows.get(s).getDeviceType()=="1"){
pressureList.add(pressureFlows.get(s));
}else {
flowmeterList.add(pressureFlows.get(s));
}
}
}
//压力表设备数量添加
tSiteStationInfoData.get(i).setNumberPressureGauges(pressureList.size());
tSiteStationInfoData.get(i).setPressureFlows(List);
//流量计设备数量添加
tSiteStationInfoData.get(i).setNumberEquipment(flowmeterList.size());
tSiteStationInfoData.get(i).setIconType(4); tSiteStationInfoData.get(i).setIconType(4);
} }
tSiteStationInfoDataList.setData(tSiteStationInfoData); tSiteStationInfoDataList.setData(tSiteStationInfoData);
...@@ -164,16 +196,29 @@ public class PipeInterfaceController { ...@@ -164,16 +196,29 @@ public class PipeInterfaceController {
DeviceDataList deviceDataList=new DeviceDataList(); DeviceDataList deviceDataList=new DeviceDataList();
//调压箱数据循环 //调压箱数据循环
for (int i=0;i<pipeDates.size();i++){ for (int i=0;i<pipeDates.size();i++){
//临时存下级数据id //临时存储压力表数据数组
List<PressureFlow> pressList=new ArrayList<>(); List<PressureFlow> pressureList=new ArrayList<>();
//临时存储流量计数据数组
List<PressureFlow> flowmeterList=new ArrayList<>();
//存储全部数据
List<PressureFlow> List=new ArrayList<>();
for (int s=0;s<pressureFlows1.size();s++){ for (int s=0;s<pressureFlows1.size();s++){
//判断调压箱id与下级数据调压箱id是否相等 //判断调压箱id与下级数据调压箱id是否相等
if (pressureFlows1.get(s).getDeviceId()==pipeDates.get(i).getDeviceId()){ if (pressureFlows1.get(s).getDeviceId()==pipeDates.get(i).getDeviceId()){
//下级数据添加进临时存储数据的数组中 List.add(pressureFlows1.get(s));
pressList.add(pressureFlows1.get(s)); //判断是压力表还是流量计 1压力表 2流量计
if (pressureFlows1.get(s).getDeviceType()=="1"){
pressureList.add(pressureFlows1.get(s));
}else {
flowmeterList.add(pressureFlows1.get(s));
}
} }
} }
pipeDates.get(i).setPressureFlows(pressList); //压力表设备数量添加
pipeDates.get(i).setNumberPressureGauges(pressureList.size());
pipeDates.get(i).setPressureFlows(List);
//流量计设备数量添加
pipeDates.get(i).setNumberEquipment(flowmeterList.size());
pipeDates.get(i).setIconType(3); pipeDates.get(i).setIconType(3);
} }
deviceDataList.setData(pipeDates); deviceDataList.setData(pipeDates);
......
...@@ -30,6 +30,139 @@ public class DeviceData { ...@@ -30,6 +30,139 @@ public class DeviceData {
private int iconType; private int iconType;
//压力表设备数量
private int numberPressureGauges;
//压力表在线设备
private int onlineEquipment;
//压力表离线设备
private int offlineEquipment;
//压力表历史报警
private int historicalAlarm;
//压力表已处理报警
private int alarmProcessed;
//压力表报警中
private int inAlarm;
//流量计设备数量
private int numberEquipment;
//流量计在线设备
private int numberOnlineEquipment;
//流量计离线设备
private int numberOfflineEquipment;
//流量计历史报警
private int numberHistoricalAlarm;
//流量计已处理报警
private int numberAlarmProcessed;
//流量计报警中
private int numberInAlarm;
public int getNumberPressureGauges() {
return numberPressureGauges;
}
public void setNumberPressureGauges(int numberPressureGauges) {
this.numberPressureGauges = numberPressureGauges;
}
public int getNumberOnlineEquipment() {
return numberOnlineEquipment;
}
public void setNumberOnlineEquipment(int numberOnlineEquipment) {
this.numberOnlineEquipment = numberOnlineEquipment;
}
public int getNumberOfflineEquipment() {
return numberOfflineEquipment;
}
public void setNumberOfflineEquipment(int numberOfflineEquipment) {
this.numberOfflineEquipment = numberOfflineEquipment;
}
public int getNumberHistoricalAlarm() {
return numberHistoricalAlarm;
}
public void setNumberHistoricalAlarm(int numberHistoricalAlarm) {
this.numberHistoricalAlarm = numberHistoricalAlarm;
}
public int getNumberAlarmProcessed() {
return numberAlarmProcessed;
}
public void setNumberAlarmProcessed(int numberAlarmProcessed) {
this.numberAlarmProcessed = numberAlarmProcessed;
}
public int getNumberInAlarm() {
return numberInAlarm;
}
public void setNumberInAlarm(int numberInAlarm) {
this.numberInAlarm = numberInAlarm;
}
public int getOnlineEquipment() {
return onlineEquipment;
}
public void setOnlineEquipment(int onlineEquipment) {
this.onlineEquipment = onlineEquipment;
}
public int getOfflineEquipment() {
return offlineEquipment;
}
public void setOfflineEquipment(int offlineEquipment) {
this.offlineEquipment = offlineEquipment;
}
public int getHistoricalAlarm() {
return historicalAlarm;
}
public void setHistoricalAlarm(int historicalAlarm) {
this.historicalAlarm = historicalAlarm;
}
public int getAlarmProcessed() {
return alarmProcessed;
}
public void setAlarmProcessed(int alarmProcessed) {
this.alarmProcessed = alarmProcessed;
}
public int getInAlarm() {
return inAlarm;
}
public void setInAlarm(int inAlarm) {
this.inAlarm = inAlarm;
}
public int getNumberEquipment() {
return numberEquipment;
}
public void setNumberEquipment(int numberEquipment) {
this.numberEquipment = numberEquipment;
}
public int getIconType() { public int getIconType() {
return iconType; return iconType;
} }
...@@ -126,6 +259,7 @@ public class DeviceData { ...@@ -126,6 +259,7 @@ public class DeviceData {
this.pressureFlows = pressureFlows; this.pressureFlows = pressureFlows;
} }
@Override @Override
public String toString() { public String toString() {
return "DeviceData{" + return "DeviceData{" +
...@@ -141,6 +275,18 @@ public class DeviceData { ...@@ -141,6 +275,18 @@ public class DeviceData {
", pressureFlows=" + pressureFlows + ", pressureFlows=" + pressureFlows +
", beyondEnterpriseName='" + beyondEnterpriseName + '\'' + ", beyondEnterpriseName='" + beyondEnterpriseName + '\'' +
", iconType=" + iconType + ", iconType=" + iconType +
", numberPressureGauges=" + numberPressureGauges +
", onlineEquipment=" + onlineEquipment +
", offlineEquipment=" + offlineEquipment +
", historicalAlarm=" + historicalAlarm +
", alarmProcessed=" + alarmProcessed +
", inAlarm=" + inAlarm +
", numberEquipment=" + numberEquipment +
", numberOnlineEquipment=" + numberOnlineEquipment +
", numberOfflineEquipment=" + numberOfflineEquipment +
", numberHistoricalAlarm=" + numberHistoricalAlarm +
", numberAlarmProcessed=" + numberAlarmProcessed +
", numberInAlarm=" + numberInAlarm +
'}'; '}';
} }
} }
package com.zehong.system.domain; package com.zehong.system.domain;
import java.util.List; import java.util.List;
public class TSiteStationInfoData { public class TSiteStationInfoData {
...@@ -23,13 +22,148 @@ public class TSiteStationInfoData { ...@@ -23,13 +22,148 @@ public class TSiteStationInfoData {
private String buildCompany; private String buildCompany;
private String powerCompany; private String powerCompany;
//流量计数组
private List<PressureFlow> pressureFlows; private List<PressureFlow> pressureFlows;
private int iconType; private int iconType;
private String companyType; private String companyType;
//压力表设备数量
private int numberPressureGauges;
//压力表在线设备
private int onlineEquipment;
//压力表离线设备
private int offlineEquipment;
//压力表历史报警
private int historicalAlarm;
//压力表已处理报警
private int alarmProcessed;
//压力表报警中
private int inAlarm;
//流量计设备数量
private int numberEquipment;
//流量计在线设备
private int numberOnlineEquipment;
//流量计离线设备
private int numberOfflineEquipment;
//流量计历史报警
private int numberHistoricalAlarm;
//流量计已处理报警
private int numberAlarmProcessed;
//流量计报警中
private int numberInAlarm;
public int getNumberOnlineEquipment() {
return numberOnlineEquipment;
}
public void setNumberOnlineEquipment(int numberOnlineEquipment) {
this.numberOnlineEquipment = numberOnlineEquipment;
}
public int getNumberOfflineEquipment() {
return numberOfflineEquipment;
}
public void setNumberOfflineEquipment(int numberOfflineEquipment) {
this.numberOfflineEquipment = numberOfflineEquipment;
}
public int getNumberHistoricalAlarm() {
return numberHistoricalAlarm;
}
public void setNumberHistoricalAlarm(int numberHistoricalAlarm) {
this.numberHistoricalAlarm = numberHistoricalAlarm;
}
public int getNumberAlarmProcessed() {
return numberAlarmProcessed;
}
public void setNumberAlarmProcessed(int numberAlarmProcessed) {
this.numberAlarmProcessed = numberAlarmProcessed;
}
public int getNumberInAlarm() {
return numberInAlarm;
}
public void setNumberInAlarm(int numberInAlarm) {
this.numberInAlarm = numberInAlarm;
}
public int getNumberPressureGauges() {
return numberPressureGauges;
}
public void setNumberPressureGauges(int numberPressureGauges) {
this.numberPressureGauges = numberPressureGauges;
}
public int getNumberEquipment() {
return numberEquipment;
}
public void setNumberEquipment(int numberEquipment) {
this.numberEquipment = numberEquipment;
}
public int getOnlineEquipment() {
return onlineEquipment;
}
public void setOnlineEquipment(int onlineEquipment) {
this.onlineEquipment = onlineEquipment;
}
public int getOfflineEquipment() {
return offlineEquipment;
}
public void setOfflineEquipment(int offlineEquipment) {
this.offlineEquipment = offlineEquipment;
}
public int getHistoricalAlarm() {
return historicalAlarm;
}
public void setHistoricalAlarm(int historicalAlarm) {
this.historicalAlarm = historicalAlarm;
}
public int getAlarmProcessed() {
return alarmProcessed;
}
public void setAlarmProcessed(int alarmProcessed) {
this.alarmProcessed = alarmProcessed;
}
public int getInAlarm() {
return inAlarm;
}
public void setInAlarm(int inAlarm) {
this.inAlarm = inAlarm;
}
public String getCompanyType() { public String getCompanyType() {
return companyType; return companyType;
} }
...@@ -150,6 +284,18 @@ public class TSiteStationInfoData { ...@@ -150,6 +284,18 @@ public class TSiteStationInfoData {
", pressureFlows=" + pressureFlows + ", pressureFlows=" + pressureFlows +
", iconType=" + iconType + ", iconType=" + iconType +
", companyType='" + companyType + '\'' + ", companyType='" + companyType + '\'' +
", numberPressureGauges=" + numberPressureGauges +
", onlineEquipment=" + onlineEquipment +
", offlineEquipment=" + offlineEquipment +
", historicalAlarm=" + historicalAlarm +
", alarmProcessed=" + alarmProcessed +
", inAlarm=" + inAlarm +
", numberEquipment=" + numberEquipment +
", numberOnlineEquipment=" + numberOnlineEquipment +
", numberOfflineEquipment=" + numberOfflineEquipment +
", numberHistoricalAlarm=" + numberHistoricalAlarm +
", numberAlarmProcessed=" + numberAlarmProcessed +
", numberInAlarm=" + numberInAlarm +
'}'; '}';
} }
} }
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(","));
}
} }
...@@ -115,8 +115,8 @@ ...@@ -115,8 +115,8 @@
<!--查询场站下级数据--> <!--查询场站下级数据-->
<select id="selecttSiteStationInfoDataList" parameterType="DeviceData" resultMap="PressureFlowResult"> <select id="selecttSiteStationInfoDataList" parameterType="DeviceData" resultMap="PressureFlowResult">
select device_model,device_type,create_time from t_relation_device_detail_info select device_model,device_type,create_time,relation_device_id from t_relation_device_detail_info
where relation_device_id=#{deviceId} and relation_device_type='2' where relation_device_type='2'
</select> </select>
<!--监控信息查询--> <!--监控信息查询-->
......
...@@ -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
})
}
...@@ -321,7 +321,7 @@ export default { ...@@ -321,7 +321,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({
...@@ -404,6 +404,7 @@ export default { ...@@ -404,6 +404,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();
...@@ -425,6 +426,7 @@ export default { ...@@ -425,6 +426,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