Commit 50b17cd4 authored by 耿迪迪's avatar 耿迪迪

停气监管

parent 2d4e630c
package com.zehong.web.controller.supplybalance; package com.zehong.web.controller.supplybalance;
import java.util.List; import java.util.List;
import com.zehong.common.utils.SecurityUtils;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -40,6 +42,9 @@ public class TSupBalStopSupController extends BaseController ...@@ -40,6 +42,9 @@ public class TSupBalStopSupController extends BaseController
public TableDataInfo list(TSupBalStopSup tSupBalStopSup) public TableDataInfo list(TSupBalStopSup tSupBalStopSup)
{ {
startPage(); startPage();
if(!"-2".equals(SecurityUtils.getLoginUser().getUser().getDeptId())){
tSupBalStopSup.setfCompanyInfoId(SecurityUtils.getLoginUser().getUser().getDeptId());
}
List<TSupBalStopSup> list = tSupBalStopSupService.selectTSupBalStopSupList(tSupBalStopSup); List<TSupBalStopSup> list = tSupBalStopSupService.selectTSupBalStopSupList(tSupBalStopSup);
return getDataTable(list); return getDataTable(list);
} }
......
...@@ -21,9 +21,11 @@ public class TSupBalStopSup extends BaseEntity ...@@ -21,9 +21,11 @@ public class TSupBalStopSup extends BaseEntity
private Long fGasStopId; private Long fGasStopId;
/** 企业uuid */ /** 企业uuid */
@Excel(name = "企业uuid")
private String fCompanyInfoId; private String fCompanyInfoId;
@Excel(name = "企业名称")
private String enterpriseName;
/** 停气开始日期 */ /** 停气开始日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "停气开始日期", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "停气开始日期", width = 30, dateFormat = "yyyy-MM-dd")
...@@ -93,7 +95,16 @@ public class TSupBalStopSup extends BaseEntity ...@@ -93,7 +95,16 @@ public class TSupBalStopSup extends BaseEntity
{ {
return fCompanyInfoId; return fCompanyInfoId;
} }
public void setfStartDate(Date fStartDate)
public String getEnterpriseName() {
return enterpriseName;
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
public void setfStartDate(Date fStartDate)
{ {
this.fStartDate = fStartDate; this.fStartDate = fStartDate;
} }
......
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import java.util.Date;
import java.util.List; import java.util.List;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
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.TSupBalStopSupMapper; import com.zehong.system.mapper.TSupBalStopSupMapper;
...@@ -54,6 +56,7 @@ public class TSupBalStopSupServiceImpl implements ITSupBalStopSupService ...@@ -54,6 +56,7 @@ public class TSupBalStopSupServiceImpl implements ITSupBalStopSupService
public int insertTSupBalStopSup(TSupBalStopSup tSupBalStopSup) public int insertTSupBalStopSup(TSupBalStopSup tSupBalStopSup)
{ {
tSupBalStopSup.setCreateTime(DateUtils.getNowDate()); tSupBalStopSup.setCreateTime(DateUtils.getNowDate());
tSupBalStopSup.setfCompanyInfoId(SecurityUtils.getLoginUser().getUser().getDeptId());
return tSupBalStopSupMapper.insertTSupBalStopSup(tSupBalStopSup); return tSupBalStopSupMapper.insertTSupBalStopSup(tSupBalStopSup);
} }
...@@ -67,6 +70,9 @@ public class TSupBalStopSupServiceImpl implements ITSupBalStopSupService ...@@ -67,6 +70,9 @@ public class TSupBalStopSupServiceImpl implements ITSupBalStopSupService
public int updateTSupBalStopSup(TSupBalStopSup tSupBalStopSup) public int updateTSupBalStopSup(TSupBalStopSup tSupBalStopSup)
{ {
tSupBalStopSup.setUpdateTime(DateUtils.getNowDate()); tSupBalStopSup.setUpdateTime(DateUtils.getNowDate());
if("2".equals(tSupBalStopSup.getfStopProgress())){
tSupBalStopSup.setfRecoveryGasTime(new Date());
}
return tSupBalStopSupMapper.updateTSupBalStopSup(tSupBalStopSup); return tSupBalStopSupMapper.updateTSupBalStopSup(tSupBalStopSup);
} }
......
...@@ -26,16 +26,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -26,16 +26,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTSupBalStopSupVo"> <sql id="selectTSupBalStopSupVo">
select f_gas_stop_id, f_company_info_id, f_start_date, f_end_date, f_stop_type, f_influence_cus, f_stop_reason, f_stop_range, f_stop_progress, f_recovery_gas_time, f_rep_status, f_gas_stop_area, create_by, create_time, update_by, update_time, is_del, remarks from t_sup_bal_stop_sup SELECT
st.f_gas_stop_id,
st.f_company_info_id,
st.f_start_date,
st.f_end_date,
st.f_stop_type,
st.f_influence_cus,
st.f_stop_reason,
st.f_stop_range,
st.f_stop_progress,
st.f_recovery_gas_time,
st.f_rep_status,
st.f_gas_stop_area,
st.create_by,
st.create_time,
st.update_by,
st.update_time,
st.is_del,
st.remarks,
en.enterprise_name AS enterpriseName
FROM
t_sup_bal_stop_sup st
LEFT JOIN t_enterprise_info en ON en.enterprise_id = st.f_company_info_id
</sql> </sql>
<select id="selectTSupBalStopSupList" parameterType="TSupBalStopSup" resultMap="TSupBalStopSupResult"> <select id="selectTSupBalStopSupList" parameterType="TSupBalStopSup" resultMap="TSupBalStopSupResult">
<include refid="selectTSupBalStopSupVo"/> <include refid="selectTSupBalStopSupVo"/>
<where> <where>
<if test="fCompanyInfoId != null and fCompanyInfoId != ''"> and f_company_info_id = #{fCompanyInfoId}</if> <if test="fCompanyInfoId != null and fCompanyInfoId != ''"> and st.f_company_info_id = #{fCompanyInfoId}</if>
<if test="fStopType != null and fStopType != ''"> and f_stop_type = #{fStopType}</if> <if test="fStopType != null and fStopType != ''"> and st.f_stop_type = #{fStopType}</if>
<if test="fStopProgress != null and fStopProgress != ''"> and f_stop_progress = #{fStopProgress}</if> <if test="fStopProgress != null and fStopProgress != ''"> and st.f_stop_progress = #{fStopProgress}</if>
<if test="fRepStatus != null and fRepStatus != ''"> and f_rep_status = #{fRepStatus}</if> <if test="fRepStatus != null and fRepStatus != ''"> and st.f_rep_status = #{fRepStatus}</if>
<if test="enterpriseName != null and enterpriseName != ''"> and en.enterprise_name like concat('%', #{enterpriseName}, '%')</if>
</where> </where>
</select> </select>
......
...@@ -174,7 +174,9 @@ ...@@ -174,7 +174,9 @@
polygon.on("rightclick",() => { polygon.on("rightclick",() => {
this.firstClick = 0; this.firstClick = 0;
this.nowMouseTarget.polygonEditor && this.nowMouseTarget.polygonEditor.close(); this.nowMouseTarget.polygonEditor && this.nowMouseTarget.polygonEditor.close();
}) });
this.gaoMap.setCenter(this.value[0]);
this.gaoMap.map.setZoom(12)
} }
} }
} }
......
<template>
<el-dialog title="详情" :visible.sync="detailOpen" width="1200px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form label-width="120px">
<el-row>
<el-col :span="12">
<el-row class="el-row-table">
<el-col :span="12">
<el-form-item label="停气开始日期">
<span v-if="detailInfo.fStartDate">{{ detailInfo.fStartDate }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="停气结束日期">
<span v-if="detailInfo.fEndDate">{{ detailInfo.fEndDate }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="停气类型">
<span v-if="detailInfo.fStopType">{{ $parent.fStopTypeFormat(detailInfo) }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="停气进度">
<span v-if="detailInfo.fStopType">{{ $parent.fStopProgressFormat(detailInfo) }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="影响用户">
<span v-if="detailInfo.fInfluenceCus">{{ detailInfo.fInfluenceCus }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="停气原因">
<span v-if="detailInfo.fStopReason">{{ detailInfo.fStopReason }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="停气范围">
<span v-if="detailInfo.fStopRange">{{ detailInfo.fStopRange }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建时间">
<span v-if="detailInfo.createTime">{{ detailInfo.createTime }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="更新时间">
<span v-if="detailInfo.updateTime">{{ detailInfo.updateTime }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="12" style="padding-left: 10px">
<div style="font-size: 14px;color: #606266;margin-bottom: 10px;font-weight: 700">停气区域</div>
<div id="areaInfo"></div>
</el-col>
</el-row>
</el-form>
</el-dialog>
</template>
<script>
import { getSup } from "@/api/supplybalance/stop";
import { EditorMap } from "@/utils/mapClass/getPath.js";
export default {
name: "detail-info",
data(){
return{
detailInfo: {},
detailOpen: false,
}
},
watch:{
detailOpen(newVal){
if(newVal){
//if(this.detailInfo.fGasStopArea) this.path = JSON.parse(this.detailInfo.fGasStopArea);
this.$nextTick(() =>{
this.initMap();
})
}
}
},
methods:{
getDetailInfo(id){
getSup(id).then(res =>{
if(res.code == 200 && res.data){
this.detailInfo = res.data;
this.detailOpen = true;
}
})
},
initMap(){
const path = eval(this.$store.state.user.systemSetting.map_center);
const gaoMap = new EditorMap("areaInfo", {center:path}, this);
if(this.detailInfo.fGasStopArea){
new AMap.Polygon({
map: gaoMap.map,
path: JSON.parse(this.detailInfo.fGasStopArea),
fillColor:'#00b0ff',
strokeColor:'#80d8ff'
});
gaoMap.setCenter(JSON.parse(this.detailInfo.fGasStopArea)[0]);
gaoMap.map.setZoom(12)
}
}
}
}
</script>
<style scoped lang="scss">
#areaInfo{
width: 100%;
height: 500px;
}
</style>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="企业名称" prop="fCompanyInfoId"> <el-form-item label="企业名称" prop="enterpriseName">
<el-input <el-input
v-model="queryParams.fCompanyInfoId" v-model="queryParams.enterpriseName"
placeholder="请输入企业名称" placeholder="请输入企业名称"
clearable clearable
size="small" size="small"
...@@ -87,15 +87,15 @@ ...@@ -87,15 +87,15 @@
<el-table v-loading="loading" :data="supList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="supList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="企业名称" align="center" prop="fCompanyInfoId" /> <el-table-column label="企业名称" align="center" prop="enterpriseName" />
<el-table-column label="停气开始日期" align="center" prop="fStartDate" width="180"> <el-table-column label="停气开始日期" align="center" prop="fStartDate" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.fStartDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.fStartDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="停气结束日期" align="center" prop="fEndDate" width="180"> <el-table-column label="停气结束日期" align="center" prop="fEndDate" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.fEndDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.fEndDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="停气类型" align="center" prop="fStopType" :formatter="fStopTypeFormat" /> <el-table-column label="停气类型" align="center" prop="fStopType" :formatter="fStopTypeFormat" />
...@@ -116,6 +116,12 @@ ...@@ -116,6 +116,12 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-document"
@click="handleDetail(scope.row)"
>详情</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
...@@ -142,7 +148,7 @@ ...@@ -142,7 +148,7 @@
<!-- 添加或修改停气监管对话框 --> <!-- 添加或修改停气监管对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body destroy-on-close :close-on-click-modal="false"> <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form label-position="top" ref="form" :model="form" :rules="rules" label-width="120px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-row class="el-row-table"> <el-row class="el-row-table">
...@@ -152,7 +158,7 @@ ...@@ -152,7 +158,7 @@
v-model="form.fStartDate" v-model="form.fStartDate"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%" style="width: 98%"
placeholder="选择停气开始日期"> placeholder="选择停气开始日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
...@@ -172,7 +178,7 @@ ...@@ -172,7 +178,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="停气类型" prop="fStopType"> <el-form-item label="停气类型" prop="fStopType">
<el-select v-model="form.fStopType" style="width: 100%" placeholder="请选择停气类型"> <el-select v-model="form.fStopType" style="width: 98%" placeholder="请选择停气类型">
<el-option <el-option
v-for="dict in fStopTypeOptions" v-for="dict in fStopTypeOptions"
:key="dict.dictValue" :key="dict.dictValue"
...@@ -183,6 +189,19 @@ ...@@ -183,6 +189,19 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="停气进度" prop="fStopProgress">
<el-select v-model="form.fStopProgress" style="width: 98%" placeholder="请选择停气进度">
<el-option
v-for="dict in fStopProgressOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="影响用户" prop="fInfluenceCus"> <el-form-item label="影响用户" prop="fInfluenceCus">
<el-input type="Number" v-model="form.fInfluenceCus" placeholder="请输入影响用户" /> <el-input type="Number" v-model="form.fInfluenceCus" placeholder="请输入影响用户" />
...@@ -200,39 +219,40 @@ ...@@ -200,39 +219,40 @@
<el-input type="textarea" v-model="form.fStopRange" placeholder="请输入停气范围" /> <el-input type="textarea" v-model="form.fStopRange" placeholder="请输入停气范围" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="停气区域" prop="fGasStopArea">
<el-input v-model="form.fGasStopArea" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-row> </el-row>
</el-col> </el-col>
<el-col :span="12" style="padding-left: 10px"> <el-col :span="12" style="padding-left: 10px">
<div>停气</div> <el-form-item label="停气区域" prop="fGasStopArea">
<DrawArea v-model="path"/> <DrawArea class="area-change" v-model="path"/>
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm()"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="submitForm(1)"> </el-button>
<!--<el-button @click="cancel"> </el-button>-->
</div> </div>
</el-dialog> </el-dialog>
<!-- 详情 -->
<DetailInfo ref="detail"/>
</div> </div>
</template> </template>
<script> <script>
import { listSup, getSup, delSup, addSup, updateSup, exportSup } from "@/api/supplybalance/stop"; import { listSup, getSup, delSup, addSup, updateSup, exportSup } from "@/api/supplybalance/stop";
import DrawArea from "@/components/DrawArea"; import DrawArea from "@/components/DrawArea";
import DetailInfo from "./components/DetailInfo";
export default { export default {
name: "Sup", name: "Sup",
components: { components: {
DrawArea DrawArea,
DetailInfo
}, },
data() { data() {
return { return {
...@@ -268,6 +288,7 @@ export default { ...@@ -268,6 +288,7 @@ export default {
fStopType: null, fStopType: null,
fStopProgress: null, fStopProgress: null,
fRepStatus: null, fRepStatus: null,
enterpriseName: null
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -291,8 +312,8 @@ export default { ...@@ -291,8 +312,8 @@ export default {
fStopProgress: [ fStopProgress: [
{ required: true, message: "停气进度不能为空", trigger: "change" } { required: true, message: "停气进度不能为空", trigger: "change" }
], ],
fRepStatus: [ fGasStopArea: [
{ required: true, message: "上报状态 0-未上报,1-已上报不能为空", trigger: "blur" } { required: true, message: "停气区域不能为空" }
], ],
}, },
path:[ path:[
...@@ -314,6 +335,10 @@ export default { ...@@ -314,6 +335,10 @@ export default {
}, },
watch:{ watch:{
path(newVal,oldVal){ path(newVal,oldVal){
if(newVal.length == 0){
this.form.fGasStopArea = "";
return
}
this.form.fGasStopArea = JSON.stringify(newVal); this.form.fGasStopArea = JSON.stringify(newVal);
} }
}, },
...@@ -363,6 +388,7 @@ export default { ...@@ -363,6 +388,7 @@ export default {
remarks: null remarks: null
}; };
this.resetForm("form"); this.resetForm("form");
this.path = [];
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
...@@ -400,7 +426,10 @@ export default { ...@@ -400,7 +426,10 @@ export default {
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm(type) {
if(1 == type){
this.form.fRepStatus = '1';
}
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.fGasStopId != null) { if (this.form.fGasStopId != null) {
...@@ -447,7 +476,16 @@ export default { ...@@ -447,7 +476,16 @@ export default {
this.download(response.msg); this.download(response.msg);
this.exportLoading = false; this.exportLoading = false;
}).catch(() => {}); }).catch(() => {});
} },
//详情
handleDetail(row){
this.$refs.detail.getDetailInfo(row.fGasStopId);
},
} }
}; };
</script> </script>
<style lang="scss">
.area-change input{
border: 1px solid #DCDFE6 !important;
}
</style>
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