mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-09 20:40:03 +08:00
后管站点充电接口页面新增 车位号字段
This commit is contained in:
@@ -444,6 +444,8 @@ public class MemberService {
|
||||
// 不为空说明该用户绑定过此车牌号
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_THIS_CARNO_HAS_BEEN_BINDING);
|
||||
}
|
||||
// 校验该车牌号是否为新能源车牌
|
||||
|
||||
relation.setPhoneNumber(dto.getPhoneNumber());
|
||||
if (StringUtils.isNotBlank(dto.getVinCode())) {
|
||||
// 判断当前vin是否被绑定
|
||||
|
||||
@@ -5,10 +5,12 @@ import com.jsowell.common.annotation.Log;
|
||||
import com.jsowell.common.core.controller.BaseController;
|
||||
import com.jsowell.common.core.page.TableDataInfo;
|
||||
import com.jsowell.common.enums.BusinessType;
|
||||
import com.jsowell.common.response.RestApiResponse;
|
||||
import com.jsowell.common.util.poi.ExcelUtil;
|
||||
import com.jsowell.pile.domain.PileConnectorInfo;
|
||||
import com.jsowell.pile.dto.QueryConnectorDTO;
|
||||
import com.jsowell.pile.dto.QueryConnectorListDTO;
|
||||
import com.jsowell.pile.dto.UpdateConnectorParkNoDTO;
|
||||
import com.jsowell.pile.service.IPileConnectorInfoService;
|
||||
import com.jsowell.pile.vo.web.PileConnectorInfoVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -70,6 +72,26 @@ public class PileConnectorInfoController extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车位号
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:connector:edit')")
|
||||
@Log(title = "充电桩枪口信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/updateParkNo")
|
||||
public RestApiResponse<?> updateParkNo(@RequestBody UpdateConnectorParkNoDTO dto) {
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
int i = pileConnectorInfoService.updateConnectorParkNo(dto);
|
||||
response = new RestApiResponse<>(i);
|
||||
} catch (Exception e) {
|
||||
logger.error("修改车位号 error,", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取充电桩枪口信息详细信息
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.jsowell.pile.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 修改车位号DTO
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/8/9 11:25
|
||||
*/
|
||||
@Data
|
||||
public class UpdateConnectorParkNoDTO {
|
||||
private String connectorId;
|
||||
private String stationId;
|
||||
private String parkNo;
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.jsowell.common.core.page.PageResponse;
|
||||
import com.jsowell.pile.domain.PileConnectorInfo;
|
||||
import com.jsowell.pile.dto.QueryConnectorDTO;
|
||||
import com.jsowell.pile.dto.QueryConnectorListDTO;
|
||||
import com.jsowell.pile.dto.UpdateConnectorParkNoDTO;
|
||||
import com.jsowell.pile.vo.base.ConnectorInfoVO;
|
||||
import com.jsowell.pile.vo.web.PileConnectorInfoVO;
|
||||
|
||||
@@ -124,4 +125,10 @@ public interface IPileConnectorInfoService {
|
||||
* @return
|
||||
*/
|
||||
Map<String, Integer> getPileTypeNum(Long stationId);
|
||||
|
||||
/**
|
||||
* 修改车位号
|
||||
* @param pileConnectorInfo
|
||||
*/
|
||||
int updateConnectorParkNo(UpdateConnectorParkNoDTO dto);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.jsowell.pile.domain.PileBasicInfo;
|
||||
import com.jsowell.pile.domain.PileConnectorInfo;
|
||||
import com.jsowell.pile.dto.QueryConnectorDTO;
|
||||
import com.jsowell.pile.dto.QueryConnectorListDTO;
|
||||
import com.jsowell.pile.dto.UpdateConnectorParkNoDTO;
|
||||
import com.jsowell.pile.mapper.PileBasicInfoMapper;
|
||||
import com.jsowell.pile.mapper.PileConnectorInfoMapper;
|
||||
import com.jsowell.pile.service.*;
|
||||
@@ -706,4 +707,19 @@ public class PileConnectorInfoServiceImpl implements IPileConnectorInfoService {
|
||||
List<ConnectorInfoVO> connectorList = getUniAppConnectorList(stationId);
|
||||
return getPileTypeNum(connectorList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车位号
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int updateConnectorParkNo(UpdateConnectorParkNoDTO dto) {
|
||||
// TODO 先查询该车位号在该站点下是否已被使用
|
||||
|
||||
PileConnectorInfo info = new PileConnectorInfo();
|
||||
info.setId(Integer.parseInt(dto.getConnectorId()));
|
||||
info.setParkNo(dto.getParkNo());
|
||||
return pileConnectorInfoMapper.updatePileConnectorInfo(info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,11 @@ public class PileConnectorInfoVO {
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 车位号
|
||||
*/
|
||||
private String parkNo;
|
||||
|
||||
/**
|
||||
* 站点id
|
||||
*/
|
||||
|
||||
@@ -124,7 +124,6 @@
|
||||
<include refid="Base_Column_List"/>
|
||||
from adapay_member_account
|
||||
where del_flag = '0'
|
||||
and status = '1'
|
||||
and merchant_id = #{merchantId,jdbcType=VARCHAR}
|
||||
</select>
|
||||
|
||||
|
||||
@@ -166,6 +166,7 @@
|
||||
t1.id as connectorId,
|
||||
t1.pile_connector_code as pileConnectorCode,
|
||||
t1.status as status,
|
||||
t1.park_no as parkNo,
|
||||
t1.pile_sn as pileSn,
|
||||
t2.station_id as stationId,
|
||||
t2.merchant_id as merchantId,
|
||||
|
||||
@@ -2,53 +2,61 @@ import request from '@/utils/request'
|
||||
|
||||
// 查询充电桩枪口信息列表
|
||||
export function listConnector(query) {
|
||||
return request({
|
||||
url: '/pile/connector/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
return request({
|
||||
url: '/pile/connector/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询充电桩枪口信息详细
|
||||
export function getConnector(id) {
|
||||
return request({
|
||||
url: '/pile/connector/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: '/pile/connector/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增充电桩枪口信息
|
||||
export function addConnector(data) {
|
||||
return request({
|
||||
url: '/pile/connector',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
return request({
|
||||
url: '/pile/connector',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改充电桩枪口信息
|
||||
export function updateConnector(data) {
|
||||
return request({
|
||||
url: '/pile/connector',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
return request({
|
||||
url: '/pile/connector',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除充电桩枪口信息
|
||||
export function delConnector(id) {
|
||||
return request({
|
||||
url: '/pile/connector/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
return request({
|
||||
url: '/pile/connector/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 通过入参查询接口列表
|
||||
export function queryConnectorListByParams(data) {
|
||||
console.log("通过入参查询接口列表", data);
|
||||
return request({
|
||||
url: '/pile/connector/getConnectorInfoListByParams',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
console.log("通过入参查询接口列表", data);
|
||||
return request({
|
||||
url: '/pile/connector/getConnectorInfoListByParams',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 修改车位号
|
||||
export function updateParkNo(data) {
|
||||
return request({
|
||||
url: '/pile/connector/updateParkNo',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,106 +1,153 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="margin: auto 20px">
|
||||
<!-- 刷新按钮 -->
|
||||
<el-button size="medium" type="primary" @click="refreshList"
|
||||
>刷新</el-button
|
||||
>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<el-table v-loading="loading" :data="connectorList">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="枪口编号" prop="pileConnectorCode" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.connector_status"
|
||||
:value="scope.row.status"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="电桩类型" align="center" prop="type">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.connector_type"
|
||||
:value="scope.row.type"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!--<el-table-column label="充电时长" align="center" prop="type" />-->
|
||||
<div>
|
||||
<div style="margin: auto 20px">
|
||||
<!-- 刷新按钮 -->
|
||||
<el-button size="medium" type="primary" @click="refreshList"
|
||||
>刷新
|
||||
</el-button
|
||||
>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<el-table v-loading="loading" :data="connectorList">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="枪口编号" prop="pileConnectorCode"/>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.connector_status"
|
||||
:value="scope.row.status"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="电桩类型" align="center" prop="type">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.connector_type"
|
||||
:value="scope.row.type"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!--<el-table-column label="充电时长" align="center" prop="type" />-->
|
||||
<el-table-column align="center">
|
||||
<template slot="header">
|
||||
车位号
|
||||
<el-button type="text" icon="el-icon-edit" size="medium" circle
|
||||
@click="openEdit" v-hasPermi="['pile:connector:edit']"/>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.parkNo" size="medium" clearable
|
||||
:disabled="clearableFlag">
|
||||
<template slot="append">
|
||||
<el-button type="text" icon="el-icon-check" size="medium"
|
||||
circle @click="updateParkNo(scope.row)"/>
|
||||
</template>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="功率(kW)"
|
||||
align="center"
|
||||
prop="instantPower"
|
||||
/>
|
||||
<el-table-column label="电流(A)" align="center" prop="current"/>
|
||||
<el-table-column label="电压(V)" align="center" prop="voltage"/>
|
||||
<el-table-column label="温度(°C)" align="center" prop="temperature"/>
|
||||
<el-table-column label="SOC(%)" align="center" prop="soc"/>
|
||||
<!--<el-table-column label="用户信息" align="center" prop="plantformOrderNum" />-->
|
||||
<!--<el-table-column label="订单" align="center" prop="plantformOrderNum" />-->
|
||||
<!--<el-table-column label="车牌号" align="center" prop="plantformOrderNum" />-->
|
||||
</el-table>
|
||||
|
||||
<el-table-column
|
||||
label="功率(kW)"
|
||||
align="center"
|
||||
prop="instantPower"
|
||||
/>
|
||||
<el-table-column label="电流(A)" align="center" prop="current" />
|
||||
<el-table-column label="电压(V)" align="center" prop="voltage" />
|
||||
<el-table-column label="温度(°C)" align="center" prop="temperature" />
|
||||
<el-table-column label="SOC(%)" align="center" prop="soc" />
|
||||
<!--<el-table-column label="用户信息" align="center" prop="plantformOrderNum" />-->
|
||||
<!--<el-table-column label="订单" align="center" prop="plantformOrderNum" />-->
|
||||
<!--<el-table-column label="车牌号" align="center" prop="plantformOrderNum" />-->
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { queryConnectorListByParams } from "@/api/pile/connector";
|
||||
import {queryConnectorListByParams, updateParkNo} from "@/api/pile/connector";
|
||||
import Template from "@/views/billing/template";
|
||||
|
||||
export default {
|
||||
name: "",
|
||||
dicts: ["connector_type", "connector_status"],
|
||||
// props: {
|
||||
// stationId: {
|
||||
// type: String,
|
||||
// required: true
|
||||
// }
|
||||
// },
|
||||
data() {
|
||||
return {
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
connectorList: [],
|
||||
queryParams: {
|
||||
stationIdList: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
stationId: this.$route.params.id,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// this.getList();
|
||||
},
|
||||
methods: {
|
||||
refreshList() {
|
||||
this.loading = true;
|
||||
setTimeout(() => {
|
||||
this.getList();
|
||||
this.loading = false;
|
||||
}, 800);
|
||||
name: "",
|
||||
components: {Template},
|
||||
dicts: ["connector_type", "connector_status"],
|
||||
// props: {
|
||||
// stationId: {
|
||||
// type: String,
|
||||
// required: true
|
||||
// }
|
||||
// },
|
||||
data() {
|
||||
return {
|
||||
clearableFlag: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
connectorList: [],
|
||||
queryParams: {
|
||||
stationIdList: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
stationId: this.$route.params.id,
|
||||
};
|
||||
},
|
||||
getList() {
|
||||
this.queryParams.stationIdList.push(this.stationId);
|
||||
this.loading = true;
|
||||
// console.log(this.queryParams, "充电站接口列表");
|
||||
queryConnectorListByParams(this.queryParams).then((response) => {
|
||||
this.connectorList = response.rows;
|
||||
// console.log("接口列表", this.connectorList);
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
created() {
|
||||
// this.getList();
|
||||
},
|
||||
methods: {
|
||||
refreshList() {
|
||||
this.loading = true;
|
||||
setTimeout(() => {
|
||||
this.getList();
|
||||
this.loading = false;
|
||||
this.clearableFlag = true;
|
||||
}, 800);
|
||||
},
|
||||
// 开放编辑按钮
|
||||
openEdit() {
|
||||
this.clearableFlag = this.clearableFlag === false;
|
||||
},
|
||||
updateParkNo(row) {
|
||||
const params = {
|
||||
connectorId: row.connectorId,
|
||||
parkNo: row.parkNo
|
||||
}
|
||||
console.log("params", params)
|
||||
updateParkNo(params).then((response) =>{
|
||||
console.log("response", response)
|
||||
const result = response.obj;
|
||||
if (result === 1) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!',
|
||||
});
|
||||
}else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '修改失败',
|
||||
});
|
||||
}
|
||||
this.getList();
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
this.queryParams.stationIdList.push(this.stationId);
|
||||
this.loading = true;
|
||||
// console.log(this.queryParams, "充电站接口列表");
|
||||
queryConnectorListByParams(this.queryParams).then((response) => {
|
||||
this.connectorList = response.rows;
|
||||
console.log("接口列表", this.connectorList);
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user