diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/PileBasicInfo.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/PileBasicInfo.java index 285285753..d0c548b2d 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/domain/PileBasicInfo.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/PileBasicInfo.java @@ -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()) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/PileDetailVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/PileDetailVO.java index 7e554ac71..5b237b81f 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/PileDetailVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/PileDetailVO.java @@ -23,6 +23,11 @@ public class PileDetailVO { */ private String pileSn; + /** + * 别名 + */ + private String name; + /** * 状态 0-未知;1-在线;2-离线;3-故障 */ diff --git a/jsowell-pile/src/main/resources/mapper/pile/PileBasicInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/PileBasicInfoMapper.xml index 8ed715afd..619c9a556 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/PileBasicInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/PileBasicInfoMapper.xml @@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -27,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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 @@ -40,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and sn = #{sn} + and name = #{name} and business_type = #{businessType} and secret_key = #{secretKey} and software_protocol = #{softwareProtocol} @@ -68,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" insert into pile_basic_info sn, + name, business_type, secret_key, software_protocol, @@ -87,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{sn}, + #{name}, #{businessType}, #{secretKey}, #{softwareProtocol}, @@ -110,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update pile_basic_info sn = #{sn}, + name = #{name}, business_type = #{businessType}, secret_key = #{secretKey}, software_protocol = #{softwareProtocol}, @@ -195,12 +200,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 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 ( #{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, diff --git a/jsowell-ui/src/views/pile/basic/detail.vue b/jsowell-ui/src/views/pile/basic/detail.vue index 9b8b8b3f1..ea09538d8 100644 --- a/jsowell-ui/src/views/pile/basic/detail.vue +++ b/jsowell-ui/src/views/pile/basic/detail.vue @@ -38,8 +38,21 @@ labelStyle="width: 80px" contentStyle="width: 150px" >{{ pileDetail.pileSn }} - + + + + + + + {{ 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;