发送遥控地锁指令

This commit is contained in:
2023-08-02 13:30:54 +08:00
parent 9b2b2396bb
commit ad2901a19d
3 changed files with 409 additions and 354 deletions

View File

@@ -1,5 +1,6 @@
package com.jsowell.web.controller.pile; package com.jsowell.web.controller.pile;
import com.alibaba.fastjson2.JSON;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.jsowell.common.core.controller.BaseController; import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.core.domain.AjaxResult; import com.jsowell.common.core.domain.AjaxResult;
@@ -143,15 +144,16 @@ public class PileRemoteController extends BaseController {
*/ */
@PostMapping("remoteControlGroundLock") @PostMapping("remoteControlGroundLock")
public AjaxResult remoteControlGroundLock(@RequestBody RemoteControlGroundLockCommand command) { public AjaxResult remoteControlGroundLock(@RequestBody RemoteControlGroundLockCommand command) {
logger.info("遥控地锁接口param:{}", JSON.toJSONString(command));
AjaxResult result; AjaxResult result;
try { try {
pileRemoteService.remoteControlGroundLock(command); pileRemoteService.remoteControlGroundLock(command);
result = AjaxResult.success(); result = AjaxResult.success();
} catch (BusinessException e) { } catch (BusinessException e) {
logger.error("遥控地锁error", e); logger.error("遥控地锁接口error", e);
result = AjaxResult.error(e.getMessage()); result = AjaxResult.error(e.getMessage());
} catch (Exception e) { } catch (Exception e) {
logger.error("遥控地锁error", e); logger.error("遥控地锁接口error", e);
result = AjaxResult.error(e.getMessage()); result = AjaxResult.error(e.getMessage());
} }
return result; return result;

View File

@@ -8,3 +8,12 @@ export function updateFirmware(data) {
data: data data: data
}) })
} }
// 遥控地锁
export function remoteControlGroundLock(data) {
return request({
url: '/pile/remote/remoteControlGroundLock',
method: 'post',
data: data
})
}

View File

@@ -1,385 +1,429 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 标签页 --> <!-- 标签页 -->
<el-tabs <el-tabs
value="first" value="first"
type="border-card" type="border-card"
@tab-click="handleClick" @tab-click="handleClick"
> >
<el-tab-pane label="基本信息" name="first"> <el-tab-pane label="基本信息" name="first">
<el-row type="flex" justify="space-between"> <el-row type="flex" justify="space-between">
<!-- 左侧内容 --> <!-- 左侧内容 -->
<el-col :span="5"> <el-col :span="5">
<!-- 充电设备 --> <!-- 充电设备 -->
<div class="advContent"> <div class="advContent">
<el-card class="box-card" shadow="hover" v-loading="pileDetailLoading"> <el-card class="box-card" shadow="hover" v-loading="pileDetailLoading">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>充电设备(<span style="color: #bf1c1c">{{ status }}</span>)</span> <span>充电设备(<span style="color: #bf1c1c">{{ status }}</span>)</span>
<el-button icon="el-icon-refresh-right" style="float: right; padding: 3px 0" type="text" @click="getPileDetail">刷新</el-button> <el-button icon="el-icon-refresh-right" style="float: right; padding: 3px 0"
</div> type="text" @click="getPileDetail">刷新
<!--二维码--> </el-button>
<div class="hello"> </div>
<vue-qr <!--二维码-->
ref="Qrcode" <div class="hello">
:text="pileDetail.qrCodeURL" <vue-qr
qid="testQrId" ref="Qrcode"
:width="150" :text="pileDetail.qrCodeURL"
style="margin-left: 25%" qid="testQrId"
/> :width="150"
</div> style="margin-left: 25%"
/>
</div>
<!-- 表格 --> <!-- 表格 -->
<div style="margin-bottom: 10px"> <div style="margin-bottom: 10px">
<el-descriptions :column="1" border> <el-descriptions :column="1" border>
<el-descriptions-item <el-descriptions-item
label="SN" label="SN"
labelStyle="width: 80px" labelStyle="width: 80px"
contentStyle="width: 150px" contentStyle="width: 150px"
>{{ pileDetail.pileSn }}</el-descriptions-item >{{ pileDetail.pileSn }}
> </el-descriptions-item
<el-descriptions-item label="运营商">{{ >
pileDetail.merchantName <el-descriptions-item label="运营商">{{
}}</el-descriptions-item> pileDetail.merchantName
<el-descriptions-item label="站点">{{ }}
pileDetail.stationName </el-descriptions-item>
}}</el-descriptions-item> <el-descriptions-item label="站点">{{
<!--<el-descriptions-item label="厂商"> pileDetail.stationName
<el-tag size="small">举视</el-tag> }}
</el-descriptions-item>--> </el-descriptions-item>
<!-- <el-descriptions-item label="使用车辆类型">{{ <!--<el-descriptions-item label="厂商">
pileDetail.matchCars <el-tag size="small">举视</el-tag>
}}</el-descriptions-item>--> </el-descriptions-item>-->
<el-descriptions-item label="设备型号">{{pileDetail.modelName}}</el-descriptions-item> <!-- <el-descriptions-item label="使用车辆类型">{{
<el-descriptions-item label="额定功率(kW)">{{ pileDetail.matchCars
pileDetail.ratedPower }}</el-descriptions-item>-->
}}</el-descriptions-item> <el-descriptions-item label="设备型号">{{ pileDetail.modelName }}
<!--<el-descriptions-item label="额定电压(V)">{{pileDetail.sn}}</el-descriptions-item>--> </el-descriptions-item>
<el-descriptions-item label="额定电流(A)">{{ <el-descriptions-item label="额定功率(kW)">{{
pileDetail.ratedCurrent pileDetail.ratedPower
}}</el-descriptions-item> }}
</el-descriptions-item>
<!--<el-descriptions-item label="额定电压(V)">{{pileDetail.sn}}</el-descriptions-item>-->
<el-descriptions-item label="额定电流(A)">{{
pileDetail.ratedCurrent
}}
</el-descriptions-item>
<el-descriptions-item label="iccid">{{ <el-descriptions-item label="iccid">{{
pileDetail.iccid pileDetail.iccid
}}</el-descriptions-item> }}
</el-descriptions-item>
<el-descriptions-item label="sim卡商"> <el-descriptions-item label="sim卡商">
<dict-tag <dict-tag
:options="dict.type.sim_supplier" :options="dict.type.sim_supplier"
:value="pileDetail.simSupplier" :value="pileDetail.simSupplier"
/> />
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="卡运营商"> <el-descriptions-item label="卡运营商">
<dict-tag <dict-tag
:options="dict.type.sim_operator" :options="dict.type.sim_operator"
:value="pileDetail.operator" :value="pileDetail.operator"
/> />
</el-descriptions-item> </el-descriptions-item>
<!-- <el-descriptions-item label="桩类型">--> <!-- <el-descriptions-item label="桩类型">-->
<!-- 桩类型 数据--> <!-- 桩类型 数据-->
<!-- </el-descriptions-item>--> <!-- </el-descriptions-item>-->
<el-descriptions-item label="故障原因"> <el-descriptions-item label="故障原因">
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="故障时间"> <el-descriptions-item label="故障时间">
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</div> </div>
<!-- <div ></div> --> <!-- <div ></div> -->
</el-card> </el-card>
</div> </div>
</el-col> </el-col>
<!-- 右侧内容 --> <!-- 右侧内容 -->
<el-col :span="19" style="margin-left: 15px"> <el-col :span="19" style="margin-left: 15px">
<el-card class="box-card" shadow="hover"> <el-card class="box-card" shadow="hover">
<div style="margin: 12px 0"> <div style="margin: 12px 0">
<span>接口列表</span> <span>接口列表</span>
<el-button icon="el-icon-refresh-right" style="float: right; padding: 3px 0" type="text" @click="refreshPileConnectorList">刷新</el-button> <el-button icon="el-icon-refresh-right" style="float: right; padding: 3px 0" type="text"
</div> @click="refreshPileConnectorList">刷新
<!--<div style="margin-top: 20px"> </el-button>
&lt;!&ndash; 刷新按钮 &ndash;&gt; </div>
<el-button <!--<div style="margin-top: 20px">
size="medium" &lt;!&ndash; 刷新按钮 &ndash;&gt;
type="primary" <el-button
@click="refreshPileConnectorList" size="medium"
> type="primary"
刷新 @click="refreshPileConnectorList"
</el-button> >
</div>--> 刷新
<div class="sideNav" id="app"> </el-button>
<!-- 接口列表表单 --> </div>-->
<el-table <div class="sideNav" id="app">
:data="connectorList" <!-- 接口列表表单 -->
style="width: 100%" <el-table
v-loading="pileListLoading" :data="connectorList"
> style="width: 100%"
<el-table-column v-loading="pileListLoading"
prop="pileConnectorCode" >
label="枪口编号" <el-table-column
width="180px" prop="pileConnectorCode"
align="center" label="枪口编号"
/> width="180px"
<el-table-column align="center"
prop="connectorQrCodeUrl" />
label="充电二维码" <el-table-column
width="180px" prop="connectorQrCodeUrl"
align="center" label="充电二维码"
> width="180px"
<template slot-scope="scope"> align="center"
<el-link @click="qrcodeClick(scope.row)"> >
<vue-qr <template slot-scope="scope">
ref="Qrcode" <el-link @click="qrcodeClick(scope.row)">
:text="scope.row.connectorQrCodeUrl" <vue-qr
qid="scope.row.connectorId" ref="Qrcode"
:width="qrWidth" :text="scope.row.connectorQrCodeUrl"
/> qid="scope.row.connectorId"
</el-link> :width="qrWidth"
</template> />
</el-table-column> </el-link>
<el-table-column </template>
width="118px" </el-table-column>
align="center" <el-table-column
prop="status" width="118px"
label="状态" align="center"
> prop="status"
<template slot-scope="scope"> label="状态"
<dict-tag >
:options="dict.type.connector_status" <template slot-scope="scope">
:value="scope.row.status" <dict-tag
/> :options="dict.type.connector_status"
</template> :value="scope.row.status"
</el-table-column> />
<el-table-column </template>
width="80px" </el-table-column>
align="center" <el-table-column
prop="type" width="80px"
label="类型" align="center"
> prop="type"
<template slot-scope="scope"> label="类型"
<dict-tag >
:options="dict.type.connector_type" <template slot-scope="scope">
:value="scope.row.type" <dict-tag
/> :options="dict.type.connector_type"
</template> :value="scope.row.type"
</el-table-column> />
<el-table-column </template>
width="118px" </el-table-column>
align="center" <el-table-column
prop="instantPower" width="118px"
label="即时功率kW" align="center"
/> prop="instantPower"
<el-table-column prop="soc" label="SOC(°C)" align="center" /> label="即时功率kW"
<el-table-column />
prop="equipmentOrderNum" <el-table-column prop="soc" label="SOC(°C)" align="center"/>
label="设备订单号" <el-table-column
align="center" prop="equipmentOrderNum"
width="200" label="设备订单号"
/> align="center"
<el-table-column width="200"
prop="orderCode" />
label="平台订单" <el-table-column
align="center" prop="orderCode"
width="200" label="平台订单"
/> align="center"
<!-- <el-table-column prop="businessType" label="桩类型" align="center" >--> width="200"
<!-- <template slot-scope="scope">--> />
<!-- <span>{{scope.row.businessType === '1' ? '运营桩':'个人桩'}}</span>--> <!-- <el-table-column prop="businessType" label="桩类型" align="center" >-->
<!-- </template>--> <!-- <template slot-scope="scope">-->
<!-- </el-table-column>--> <!-- <span>{{scope.row.businessType === '1' ? '运营桩':'个人桩'}}</span>-->
</el-table> <!-- </template>-->
</div> <!-- </el-table-column>-->
</el-card> <el-table-column label="地锁操作" align="center"
<el-card style="margin-top: 20px" shadow="hover"> class-name="small-padding fixed-width">
<div style="margin: 12px 0"> <template slot-scope="scope">
<span>充电桩通信日志</span> <el-button size="mini" type="text" icon="el-icon-caret-bottom"
<el-button icon="el-icon-refresh-right" style="float: right; padding: 3px 0" type="text" @click="getFeedList">刷新</el-button> @click="remoteControlGroundLock(scope.row, '0')">降锁
</div> </el-button>
<el-table :data="feedList" stripe style="width: 100%" v-loading="feedListLoading"> <el-button size="mini" type="text" icon="el-icon-caret-top"
<el-table-column prop="createTime" label="触发时间" align="center" width="200"/> @click="remoteControlGroundLock(scope.row, '1')">升锁
<el-table-column prop="description" label="描述" align="center" width="200"/> </el-button>
<el-table-column prop="originalMsg" label="原始报文" align="center"/> </template>
</el-table> </el-table-column>
<!--分页--> </el-table>
<pagination </div>
v-show="total > 0" </el-card>
:total="total" <el-card style="margin-top: 20px" shadow="hover">
:page.sync="queryParams.pageNum" <div style="margin: 12px 0">
:limit.sync="queryParams.pageSize" <span>充电桩通信日志</span>
@pagination="getFeedList" <el-button icon="el-icon-refresh-right" style="float: right; padding: 3px 0" type="text"
style="margin-bottom: 20px" @click="getFeedList">刷新
/> </el-button>
</el-card> </div>
</el-col> <el-table :data="feedList" stripe style="width: 100%" v-loading="feedListLoading">
</el-row> <el-table-column prop="createTime" label="触发时间" align="center" width="200"/>
</el-tab-pane> <el-table-column prop="description" label="描述" align="center" width="200"/>
<el-tab-pane label="配置管理" name="second"> <el-table-column prop="originalMsg" label="原始报文" align="center"/>
<remoteUpgrade :pileSn="pileSn" ref="second"></remoteUpgrade> </el-table>
</el-tab-pane> <!--分页-->
</el-tabs> <pagination
</div> v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getFeedList"
style="margin-bottom: 20px"
/>
</el-card>
</el-col>
</el-row>
</el-tab-pane>
<el-tab-pane label="配置管理" name="second">
<remoteUpgrade :pileSn="pileSn" ref="second"></remoteUpgrade>
</el-tab-pane>
</el-tabs>
</div>
</template> </template>
<script> <script>
import remoteUpgrade from './components/remoteUpgrade.vue'; import remoteUpgrade from './components/remoteUpgrade.vue';
import { import {
getPileDetailById, getPileDetailById,
getPileFeedList, getPileFeedList,
listBasic, listBasic,
} from "@/api/pile/basic"; } from "@/api/pile/basic";
import { queryConnectorListByParams } from "@/api/pile/connector"; import {queryConnectorListByParams} from "@/api/pile/connector";
// 二维码组件 // 二维码组件
import VueQr from "vue-qr"; import VueQr from "vue-qr";
import {remoteControlGroundLock} from "@/api/pile/pileRemote";
export default { export default {
components: { VueQr ,remoteUpgrade}, components: {VueQr, remoteUpgrade},
name: "pile-detail", name: "pile-detail",
dicts: ["connector_status", "connector_type", "sim_supplier", "sim_operator"], dicts: ["connector_status", "connector_type", "sim_supplier", "sim_operator"],
data() { data() {
return { return {
pileDetailLoading: false, pileDetailLoading: false,
pileListLoading: false, pileListLoading: false,
pileId: this.$route.params.pileId, pileId: this.$route.params.pileId,
// 右侧数据数组 // 右侧数据数组
connectorList: [], connectorList: [],
stationId: 1, stationId: 1,
// 充电桩详情 竖向 表格渲染的数据 // 充电桩详情 竖向 表格渲染的数据
pileDetail: { url: "" }, pileDetail: {url: ""},
feedListLoading: false, feedListLoading: false,
qrWidth: 60, qrWidth: 60,
flag: true, flag: true,
// 充电桩通信日志 // 充电桩通信日志
feedList: [], feedList: [],
// 总条数 // 总条数
total: 0, total: 0,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pileSn: null, pileSn: null,
pageNum: 1, pageNum: 1,
pageSize: 5, pageSize: 5,
}, },
pileSn: null, pileSn: null,
}; };
},
computed: {
status() {
const status = this.pileDetail.status;
// 0-未知1-在线2-离线3-故障
let str = "";
if (status === "1") {
str = "在线";
} else if (status === "2") {
str = "离线";
} else if (status === "3") {
str = "故障";
} else {
str = "未知";
}
return str;
}, },
}, computed: {
created() { status() {
// 查询充电桩详情 const status = this.pileDetail.status;
this.getPileDetail(); // 0-未知1-在线2-离线3-故障
// 查询充电桩接口列表 let str = "";
this.queryPileConnectorList(); if (status === "1") {
}, str = "在线";
mounted() { } else if (status === "2") {
setTimeout(() => {}, 300); str = "离线";
}, } else if (status === "3") {
methods: { str = "故障";
//点击二维码事件 } else {
qrcodeClick(row) { str = "未知";
if (this.flag) { }
this.flag = false; return str;
this.qrWidth = 150; },
} else {
this.flag = true;
this.qrWidth = 60;
}
}, },
// 查询接口列表 created() {
queryPileConnectorList() { // 查询充电桩详情
const data = { this.getPileDetail();
pileIds: [this.pileId], // 查询充电桩接口列表
};
queryConnectorListByParams(data)
.then((response) => {
console.log("response", response);
this.connectorList = response.rows;
console.log("接口列表", this.connectorList);
})
.catch((error) => {
console.log("错误日志", error);
});
},
// test(dataUrl, id){
// console.log(dataUrl)
// console.log(id)
// },
test() {
console.log("测试");
},
// 查询充电桩详情接口
getPileDetail() {
this.pileDetailLoading = true;
// console.log(this.pileId);
const queryForm = {
pileId: this.pileId,
};
getPileDetailById(queryForm).then((response) => {
this.pileDetail = response.data;
this.pileSn = this.pileDetail.pileSn;
this.pileDetailLoading = false;
console.log("getPileDetailById结果", this.pileDetail);
});
},
handleClick(tab) {
// console.log(tab.name, event);
if(tab.name === 'second') {
this.$refs.second.getList();
}
// this.initializeData(tab.name);
},
// 刷新按钮重新获取数据
refreshPileConnectorList() {
this.pileListLoading = true;
setTimeout(() => {
this.queryPileConnectorList(); this.queryPileConnectorList();
this.pileListLoading = false;
}, 1000);
}, },
/** 查询充电桩通信日志 */ mounted() {
getFeedList() { setTimeout(() => {
this.feedListLoading = true; }, 300);
this.queryParams.pileSn = this.pileSn;
getPileFeedList(this.queryParams).then((response) => {
console.log("查询充电桩通信日志", response);
this.feedList = response.data.list;
this.total = response.data.total;
this.feedListLoading = false;
});
}, },
}, methods: {
watch: { // 遥控地锁
pileSn(newValue, oldValue) { remoteControlGroundLock(row, operate) {
if (newValue !== null) { console.log("row:", row);
this.getFeedList(); const pileSn = row.pileSn;
} const pileConnectorCode = row.pileConnectorCode;
const connectorCode = pileConnectorCode.replace(pileSn, "");
var data = {
"pileSn": pileSn,
"connectorCode": connectorCode,
"operate": operate
};
remoteControlGroundLock(data).then((response) => {
console.log("后管遥控地锁结果:", response);
});
},
//点击二维码事件
qrcodeClick(row) {
if (this.flag) {
this.flag = false;
this.qrWidth = 150;
} else {
this.flag = true;
this.qrWidth = 60;
}
},
// 查询接口列表
queryPileConnectorList() {
const data = {
pileIds: [this.pileId],
};
queryConnectorListByParams(data)
.then((response) => {
console.log("response", response);
this.connectorList = response.rows;
console.log("接口列表", this.connectorList);
})
.catch((error) => {
console.log("错误日志", error);
});
},
// test(dataUrl, id){
// console.log(dataUrl)
// console.log(id)
// },
test() {
console.log("测试");
},
// 查询充电桩详情接口
getPileDetail() {
this.pileDetailLoading = true;
// console.log(this.pileId);
const queryForm = {
pileId: this.pileId,
};
getPileDetailById(queryForm).then((response) => {
this.pileDetail = response.data;
this.pileSn = this.pileDetail.pileSn;
this.pileDetailLoading = false;
console.log("getPileDetailById结果", this.pileDetail);
});
},
handleClick(tab) {
// console.log(tab.name, event);
if (tab.name === 'second') {
this.$refs.second.getList();
}
// this.initializeData(tab.name);
},
// 刷新按钮重新获取数据
refreshPileConnectorList() {
this.pileListLoading = true;
setTimeout(() => {
this.queryPileConnectorList();
this.pileListLoading = false;
}, 1000);
},
/** 查询充电桩通信日志 */
getFeedList() {
this.feedListLoading = true;
this.queryParams.pileSn = this.pileSn;
getPileFeedList(this.queryParams).then((response) => {
console.log("查询充电桩通信日志", response);
this.feedList = response.data.list;
this.total = response.data.total;
this.feedListLoading = false;
});
},
},
watch: {
pileSn(newValue, oldValue) {
if (newValue !== null) {
this.getFeedList();
}
},
}, },
},
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.advContent { .advContent {
background: #fff; background: #fff;
border-radius: 5px 5px 0px 0px; border-radius: 5px 5px 0px 0px;
} }
.sideNav { .sideNav {
padding: 30px 0 12px; padding: 30px 0 12px;
} }
#qrcodeArea img { #qrcodeArea img {
height: 80px; height: 80px;
width: 80px; width: 80px;
} }
</style> </style>