后管页面 新增 修改充电桩别名

This commit is contained in:
Lemon
2023-08-08 14:37:55 +08:00
parent 2634b8b3c7
commit 129374117f
4 changed files with 66 additions and 6 deletions

View File

@@ -28,6 +28,11 @@ public class PileBasicInfo extends BaseEntity {
@Excel(name = "桩号")
private String sn;
/**
* 桩别名
*/
private String name;
/**
* 状态0-未知1-在线2-离线3-故障)
*/
@@ -118,6 +123,14 @@ public class PileBasicInfo extends BaseEntity {
return sn;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void setBusinessType(String businessType) {
this.businessType = businessType;
}
@@ -224,6 +237,7 @@ public class PileBasicInfo extends BaseEntity {
return new ToStringBuilder(this, ToStringStyle.JSON_STYLE)
.append("id", getId())
.append("sn", getSn())
.append("name", getName())
.append("businessType", getBusinessType())
.append("secretKey", getSecretKey())
.append("softwareProtocol", getSoftwareProtocol())

View File

@@ -23,6 +23,11 @@ public class PileDetailVO {
*/
private String pileSn;
/**
* 别名
*/
private String name;
/**
* 状态 0-未知1-在线2-离线3-故障
*/

View File

@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="com.jsowell.pile.domain.PileBasicInfo" id="PileBasicInfoResult">
<result property="id" column="id" />
<result property="sn" column="sn" />
<result property="name" column="name" />
<result property="businessType" column="business_type" />
<result property="secretKey" column="secret_key" />
<result property="softwareProtocol" column="software_protocol" />
@@ -27,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, sn, business_type, secret_key, software_protocol, production_date, licence_id, model_id, sim_id,
id, sn, name, business_type, secret_key, software_protocol, production_date, licence_id, model_id, sim_id,
merchant_id, station_id, fault_reason, create_by, create_time, update_by, update_time, del_flag, remark
</sql>
@@ -40,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectPileBasicInfoVo"/>
<where>
<if test="sn != null and sn != ''"> and sn = #{sn}</if>
<if test="name != null and name != ''"> and name = #{name}</if>
<if test="businessType != null and businessType != ''"> and business_type = #{businessType}</if>
<if test="secretKey != null and secretKey != ''"> and secret_key = #{secretKey}</if>
<if test="softwareProtocol != null and softwareProtocol != ''"> and software_protocol = #{softwareProtocol}</if>
@@ -68,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into pile_basic_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="sn != null">sn,</if>
<if test="name != null">name,</if>
<if test="businessType != null">business_type,</if>
<if test="secretKey != null">secret_key,</if>
<if test="softwareProtocol != null">software_protocol,</if>
@@ -87,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sn != null">#{sn},</if>
<if test="name != null">#{name},</if>
<if test="businessType != null">#{businessType},</if>
<if test="secretKey != null">#{secretKey},</if>
<if test="softwareProtocol != null">#{softwareProtocol},</if>
@@ -110,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update pile_basic_info
<trim prefix="SET" suffixOverrides=",">
<if test="sn != null">sn = #{sn},</if>
<if test="name != null">name = #{name},</if>
<if test="businessType != null">business_type = #{businessType},</if>
<if test="secretKey != null">secret_key = #{secretKey},</if>
<if test="softwareProtocol != null">software_protocol = #{softwareProtocol},</if>
@@ -195,12 +200,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="batchInsertPileBasicInfo">
insert into pile_basic_info
(sn, business_type, secret_key, software_protocol, production_date, licence_id, model_id, sim_id,
(sn, name, business_type, secret_key, software_protocol, production_date, licence_id, model_id, sim_id,
merchant_id, station_id, fault_reason, create_by, update_by, del_flag, remark)
values
<foreach collection="infoList" item="item" separator=",">
(
#{item.sn,jdbcType=VARCHAR},
#{item.name,jdbcType=VARCHAR},
#{item.businessType,jdbcType=VARCHAR},
#{item.secretKey,jdbcType=VARCHAR},
#{item.softwareProtocol,jdbcType=VARCHAR},
@@ -238,6 +244,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
t1.id as pileId,
t1.sn AS pileSn,
t1.name as name,
t1.merchant_id AS merchantId,
t2.merchant_name AS merchantName,
t1.station_id AS stationId,

View File

@@ -38,8 +38,21 @@
labelStyle="width: 80px"
contentStyle="width: 150px"
>{{ pileDetail.pileSn }}
</el-descriptions-item
>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
别名
<el-button type="text" icon="el-icon-edit" size="medium" circle
@click="openEdit"/>
</template>
<el-input v-model="pileDetail.name" size="medium" clearable
:disabled="clearableFlag">
<template slot="append">
<el-button type="text" icon="el-icon-check" size="medium"
circle @click="updateName"/>
</template>
</el-input>
</el-descriptions-item>
<el-descriptions-item label="运营商">{{
pileDetail.merchantName
}}
@@ -248,19 +261,21 @@ import remoteUpgrade from './components/remoteUpgrade.vue';
import {
getPileDetailById,
getPileFeedList,
listBasic,
listBasic, updateBasic,
} from "@/api/pile/basic";
import {queryConnectorListByParams} from "@/api/pile/connector";
// 二维码组件
import VueQr from "vue-qr";
import {remoteControlGroundLock} from "@/api/pile/pileRemote";
import Template from "@/views/billing/template";
export default {
components: {VueQr, remoteUpgrade},
components: {Template, VueQr, remoteUpgrade},
name: "pile-detail",
dicts: ["connector_status", "connector_type", "sim_supplier", "sim_operator"],
data() {
return {
clearableFlag: true,
pileDetailLoading: false,
pileListLoading: false,
pileId: this.$route.params.pileId,
@@ -361,6 +376,25 @@ export default {
test() {
console.log("测试");
},
// 开放编辑按钮
openEdit() {
this.clearableFlag = this.clearableFlag === false;
},
// 修改充电桩别名
updateName() {
const params = {
id: this.pileDetail.pileId,
name: this.pileDetail.name,
sn: this.pileDetail.pileSn,
stationId: this.pileDetail.stationId
}
console.log("params", params)
updateBasic(params).then((response) => {
console.log("response", response)
this.clearableFlag = true;
this.getPileDetail();
})
},
// 查询充电桩详情接口
getPileDetail() {
this.pileDetailLoading = true;