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

停气监管停气操作日志

parent 968365b0
......@@ -116,4 +116,14 @@ public class TSupBalStopSupController extends BaseController
return AjaxResult.error("上传停气监管记录接口异常");
}
}
/**
* 改变停气状态
* @param tSupBalStopSup
* @return
*/
@PostMapping("/changeStopStatus")
public AjaxResult changeStopStatus(@RequestBody TSupBalStopSup tSupBalStopSup) {
return toAjax(tSupBalStopSupService.changeStopStatus(tSupBalStopSup));
}
}
package com.zehong.web.controller.supplybalance;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TSupBalStopSupOprPressLog;
import com.zehong.system.service.ITSupBalStopSupOprPressLogService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 供需平衡-停气监管-停气进度操作历史记录Controller
*
* @author zehong
* @date 2024-07-16
*/
@RestController
@RequestMapping("/supplyBalance/stopLog")
public class TSupBalStopSupOprPressLogController extends BaseController
{
@Autowired
private ITSupBalStopSupOprPressLogService tSupBalStopSupOprPressLogService;
/**
* 查询供需平衡-停气监管-停气进度操作历史记录列表
*/
@GetMapping("/list")
public TableDataInfo list(TSupBalStopSupOprPressLog tSupBalStopSupOprPressLog)
{
startPage();
List<TSupBalStopSupOprPressLog> list = tSupBalStopSupOprPressLogService.selectTSupBalStopSupOprPressLogList(tSupBalStopSupOprPressLog);
return getDataTable(list);
}
/**
* 导出供需平衡-停气监管-停气进度操作历史记录列表
*/
@Log(title = "供需平衡-停气监管-停气进度操作历史记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TSupBalStopSupOprPressLog tSupBalStopSupOprPressLog)
{
List<TSupBalStopSupOprPressLog> list = tSupBalStopSupOprPressLogService.selectTSupBalStopSupOprPressLogList(tSupBalStopSupOprPressLog);
ExcelUtil<TSupBalStopSupOprPressLog> util = new ExcelUtil<TSupBalStopSupOprPressLog>(TSupBalStopSupOprPressLog.class);
return util.exportExcel(list, "供需平衡-停气监管-停气进度操作历史记录数据");
}
/**
* 获取供需平衡-停气监管-停气进度操作历史记录详细信息
*/
@GetMapping(value = "/{fOprPressLogId}")
public AjaxResult getInfo(@PathVariable("fOprPressLogId") Long fOprPressLogId)
{
return AjaxResult.success(tSupBalStopSupOprPressLogService.selectTSupBalStopSupOprPressLogById(fOprPressLogId));
}
/**
* 新增供需平衡-停气监管-停气进度操作历史记录
*/
@Log(title = "供需平衡-停气监管-停气进度操作历史记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TSupBalStopSupOprPressLog tSupBalStopSupOprPressLog)
{
return toAjax(tSupBalStopSupOprPressLogService.insertTSupBalStopSupOprPressLog(tSupBalStopSupOprPressLog));
}
/**
* 修改供需平衡-停气监管-停气进度操作历史记录
*/
@Log(title = "供需平衡-停气监管-停气进度操作历史记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TSupBalStopSupOprPressLog tSupBalStopSupOprPressLog)
{
return toAjax(tSupBalStopSupOprPressLogService.updateTSupBalStopSupOprPressLog(tSupBalStopSupOprPressLog));
}
/**
* 删除供需平衡-停气监管-停气进度操作历史记录
*/
@Log(title = "供需平衡-停气监管-停气进度操作历史记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{fOprPressLogIds}")
public AjaxResult remove(@PathVariable Long[] fOprPressLogIds)
{
return toAjax(tSupBalStopSupOprPressLogService.deleteTSupBalStopSupOprPressLogByIds(fOprPressLogIds));
}
}
......@@ -29,7 +29,7 @@ public class TSupBalStopSupOprPressLog extends BaseEntity
private String fStopProgress;
/** 操作停气进度时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "操作停气进度时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date fOprDate;
......
......@@ -65,4 +65,11 @@ public interface ITSupBalStopSupService
* @return
*/
int reportSupBalStopSupRecInfo(Long fGasStopId);
/**
* 改变停气状态
* @param tSupBalStopSup
* @return
*/
int changeStopStatus(TSupBalStopSup tSupBalStopSup);
}
......@@ -4,11 +4,16 @@ import java.util.Date;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.TSupBalStopSupOprPressLog;
import com.zehong.system.mapper.TSupBalStopSupOprPressLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TSupBalStopSupMapper;
import com.zehong.system.domain.TSupBalStopSup;
import com.zehong.system.service.ITSupBalStopSupService;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**
* 供需平衡-停气监管Service业务层处理
......@@ -22,6 +27,9 @@ public class TSupBalStopSupServiceImpl implements ITSupBalStopSupService
@Autowired
private TSupBalStopSupMapper tSupBalStopSupMapper;
@Resource
private TSupBalStopSupOprPressLogMapper tSupBalStopSupOprPressLogMapper;
/**
* 查询供需平衡-停气监管
*
......@@ -114,4 +122,24 @@ public class TSupBalStopSupServiceImpl implements ITSupBalStopSupService
return tSupBalStopSupMapper.updateTSupBalStopSup(tSupBalStopSup);
}
/**
* 改变停气状态
* @param tSupBalStopSup
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int changeStopStatus(TSupBalStopSup tSupBalStopSup){
tSupBalStopSup.setUpdateTime(DateUtils.getNowDate());
if("2".equals(tSupBalStopSup.getfStopProgress())){
tSupBalStopSup.setfRecoveryGasTime(new Date());
}
TSupBalStopSupOprPressLog tSupBalStopSupOprPressLog = new TSupBalStopSupOprPressLog();
tSupBalStopSupOprPressLog.setfGasStopId(tSupBalStopSup.getfGasStopId());
tSupBalStopSupOprPressLog.setfStopProgress(tSupBalStopSup.getfStopProgress());
tSupBalStopSupOprPressLog.setfOprDate(new Date());
tSupBalStopSupOprPressLogMapper.insertTSupBalStopSupOprPressLog(tSupBalStopSupOprPressLog);
return tSupBalStopSupMapper.updateTSupBalStopSup(tSupBalStopSup);
}
}
......@@ -51,3 +51,12 @@ export function exportSup(query) {
params: query
})
}
//改变停气状态
export function changeStopStatus(data) {
return request({
url: '/supplyBalance/stop/changeStopStatus',
method: 'post',
data: data
})
}
import request from '@/utils/request'
// 查询供需平衡-停气监管-停气进度操作历史记录列表
export function listLog(query) {
return request({
url: '/supplyBalance/stopLog/list',
method: 'get',
params: query
})
}
// 查询供需平衡-停气监管-停气进度操作历史记录详细
export function getLog(fOprPressLogId) {
return request({
url: '/supplyBalance/stopLog/' + fOprPressLogId,
method: 'get'
})
}
// 新增供需平衡-停气监管-停气进度操作历史记录
export function addLog(data) {
return request({
url: '/supplyBalance/stopLog',
method: 'post',
data: data
})
}
// 修改供需平衡-停气监管-停气进度操作历史记录
export function updateLog(data) {
return request({
url: '/supplyBalance/stopLog',
method: 'put',
data: data
})
}
// 删除供需平衡-停气监管-停气进度操作历史记录
export function delLog(fOprPressLogId) {
return request({
url: '/supplyBalance/stopLog/' + fOprPressLogId,
method: 'delete'
})
}
// 导出供需平衡-停气监管-停气进度操作历史记录
export function exportLog(query) {
return request({
url: '/supplyBalance/stopLog/export',
method: 'get',
params: query
})
}
......@@ -68,6 +68,27 @@
</el-form-item>
</el-col>
</el-row>
<div>
<h3>停气操作记录</h3>
<div class="stop-record">
<el-table :data="stopLog">
<el-table-column label="停气进度" align="center" prop="fStopProgress" :formatter="$parent.fStopProgressFormat"/>
<el-table-column label="操作停气进度时间" align="center" prop="fOprDate" width="150">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.fOprDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:pageSizes="[5,10, 20, 30, 50]"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getStopLog"
/>
</div>
</div>
</el-col>
<el-col :span="12" style="padding-left: 10px">
......@@ -85,12 +106,20 @@
<script>
import { getSup } from "@/api/supplybalance/stop";
import { EditorMap } from "@/utils/mapClass/getPath.js";
import { listLog } from "@/api/supplybalance/stopLog.js";
export default {
name: "detail-info",
data(){
return{
detailInfo: {},
detailOpen: false,
stopLog: [],
total: 0,
queryParams: {
pageNum: 1,
pageSize: 5,
fGasStopId: null,
},
}
},
watch:{
......@@ -99,12 +128,14 @@
//if(this.detailInfo.fGasStopArea) this.path = JSON.parse(this.detailInfo.fGasStopArea);
this.$nextTick(() =>{
this.initMap();
})
});
this.getStopLog();
}
}
},
methods:{
getDetailInfo(id){
this.queryParams.fGasStopId = id;
getSup(id).then(res =>{
if(res.code == 200 && res.data){
this.detailInfo = res.data;
......@@ -118,15 +149,15 @@
if(this.detailInfo.fGasStopArea){
if (this.detailInfo.fGasStopArea.includes("#")){
let areas = this.detailInfo.fGasStopArea.split("#");
for (let i = 0; i < areas.length;i++) {
let areasItem = areas[i];
if (areasItem != null && areasItem != "") {
for (let i = 0; i < areas.length;i++) {
let areasItem = areas[i];
if (areasItem != null && areasItem != "") {
new AMap.Polygon({
map: gaoMap.map,
path: JSON.parse(areasItem),
fillColor:'#00b0ff',
strokeColor:'#80d8ff'
});
});
}
}
......@@ -141,6 +172,15 @@
}
gaoMap.map.setZoom(12)
}
},
getStopLog(){
listLog(this.queryParams).then(res =>{
if(res.code == 200 && res.rows){
console.log("fdsfd=======",res)
this.stopLog = res.rows;
this.total = res.total;
}
})
}
}
}
......@@ -149,7 +189,34 @@
<style scoped lang="scss">
#areaInfo{
width: 100%;
height: 500px;
height: 650px;
}
.stop-record{
height: 350px;
overflow-y: scroll;
&::-webkit-scrollbar {
/* 设置滚动条宽度 */
width: 4px;
/* 设置滚动条背景色 */
//background: black;
}
//滚动条轨道
&::-webkit-scrollbar-track {
background-color:transparent;
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius:2em;
}
//滚动条滑块
&::-webkit-scrollbar-thumb {
background-color: rgb(147,147,153,0.5);
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius:2em;
}
}
</style>
......@@ -290,7 +290,7 @@
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitStopForm()"> </el-button>
<!--<el-button @click="submitForm()"> </el-button>-->
<el-button @click="cancel"> </el-button>
<el-button @click="stopOpen=false"> </el-button>
</div>
</el-dialog>
......@@ -301,7 +301,7 @@
</template>
<script>
import { listSup, getSup, delSup, addSup, updateSup, exportSup, reportSupBalStopSupRecInfo } from "@/api/supplybalance/stop";
import { listSup, getSup, delSup, addSup, updateSup, exportSup, reportSupBalStopSupRecInfo, changeStopStatus } from "@/api/supplybalance/stop";
// 如果只允许画一个,则用这个
// import DrawArea from "@/components/DrawArea";
// 如果需要画多个,则用这个
......@@ -612,7 +612,7 @@ export default {
})
},
submitStopForm(){
updateSup({fGasStopId:this.stopForm.fGasStopId,fStopProgress:this.stopForm.fStopProgress}).then(res =>{
changeStopStatus({fGasStopId:this.stopForm.fGasStopId,fStopProgress:this.stopForm.fStopProgress}).then(res =>{
if(res.code == 200){
this.msgSuccess("停气进度更新成功");
this.stopOpen = false;
......
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