From f740a822a454b94c06b9f575a2f2e583d92de7b3 Mon Sep 17 00:00:00 2001 From: yuyang <2265829957@qq.com> Date: Wed, 28 Jul 2021 17:28:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A1=A9=E8=AF=A6=E6=83=85=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../XhpcChargingPileController.java | 3 +- .../XhpcChargingStationController.java | 18 +++---- .../mapper/XhpcChargingPileMapper.java | 7 +++ .../service/IXhpcChargingPileService.java | 4 +- .../service/XhpcChargingPileServiceImpl.java | 10 +++- .../mapper/XhpcChargingPileMapper.xml | 52 ++++++++++++++++++- 6 files changed, 75 insertions(+), 19 deletions(-) diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingPileController.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingPileController.java index 15df3e42..248b0915 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingPileController.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingPileController.java @@ -4,7 +4,6 @@ import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.TableDataInfo; import com.xhpc.charging.station.domain.XhpcChargingPile; -import com.xhpc.charging.station.dto.XhpcChargingStationDto; import com.xhpc.charging.station.service.IXhpcChargingPileService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -65,7 +64,7 @@ public class XhpcChargingPileController extends BaseController { * @return */ @PostMapping(value = "/selectXhpcChargingPile") - public AjaxResult selectXhpcChargingPile(@PathVariable("roleId")Long chargingPileId) + public AjaxResult selectXhpcChargingPile(@RequestParam(value = "chargingPileId",required = true) Long chargingPileId) { return AjaxResult.success(xhpcChargingPileService.selectXhpcChargingPile(chargingPileId)); } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java index 34be851c..2e3aec97 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java @@ -106,7 +106,7 @@ public class XhpcChargingStationController extends BaseController { //@PreAuthorize(hasPermi = "system:station:remove") //@Log(title = "电站", businessType = BusinessType.DELETE) @PostMapping("/status") - public AjaxResult status(@Param("status")Integer status,@Param("chargingStationId")Long chargingStationId) + public AjaxResult status(@RequestParam(value = "status",required = true)Integer status,@RequestParam(value = "chargingStationId",required = true)Long chargingStationId) { return toAjax(xhpcChargingStationService.status(status,chargingStationId)); } @@ -121,7 +121,7 @@ public class XhpcChargingStationController extends BaseController { //@PreAuthorize(hasPermi = "system:station:remove") //@Log(title = "电站", businessType = BusinessType.DELETE) @PostMapping("/clientVisible") - public AjaxResult status(@Param("type")Integer type,@Param("clientVisible")String clientVisible,@Param("chargingStationId")Long chargingStationId) + public AjaxResult status(@RequestParam(value = "type",required = true)Integer type,@RequestParam(value = "clientVisible",required = true)String clientVisible,@RequestParam(value = "chargingStationId",required = true)Long chargingStationId) { return toAjax(xhpcChargingStationService.clientVisible(type,clientVisible,chargingStationId)); } @@ -133,7 +133,7 @@ public class XhpcChargingStationController extends BaseController { //@PreAuthorize(hasPermi = "system:station:remove") //@Log(title = "电站", businessType = BusinessType.DELETE) @GetMapping(value = "/stationInternetBlackList") - public AjaxResult stationInternetBlackList(@Param("chargingStationId") Long chargingStationId) + public AjaxResult stationInternetBlackList(@RequestParam(value = "chargingStationId",required = true) Long chargingStationId) { return AjaxResult.success(xhpcChargingStationService.stationInternetBlackList(chargingStationId)); } @@ -162,12 +162,6 @@ public class XhpcChargingStationController extends BaseController { return AjaxResult.success(xhpcChargingStationService.getXhpcChargingStationMessage(chargingStationId,type)); } - - - - - - /** * 微信小程序电站列表 * @param name 电站名称 @@ -195,7 +189,7 @@ public class XhpcChargingStationController extends BaseController { * @return */ @GetMapping(value = "/getWXXhpcChargingStationMessage") - public AjaxResult getWXXhpcChargingStationMessage(@RequestParam("chargingStationId") Long chargingStationId,@RequestParam("longitude")String longitude,@RequestParam("latitude")String latitude) + public AjaxResult getWXXhpcChargingStationMessage(@RequestParam(value = "chargingStationId",required = true)Long chargingStationId,@RequestParam(value = "longitude",required = true)String longitude,@RequestParam(value = "latitude",required = true)String latitude) { return AjaxResult.success(xhpcChargingStationService.getWXXhpcChargingStationMessage(chargingStationId,longitude,latitude)); } @@ -206,7 +200,7 @@ public class XhpcChargingStationController extends BaseController { * @return */ @GetMapping(value = "/getWXXhpcRateTimeMassage") - public AjaxResult getXhpcRateTimeMassage(@Param("chargingStationId") Long chargingStationId) + public AjaxResult getXhpcRateTimeMassage(@RequestParam(value = "chargingStationId",required = true) Long chargingStationId) { return AjaxResult.success(xhpcChargingStationService.getWXXhpcRateTimeMassage(chargingStationId)); } @@ -217,7 +211,7 @@ public class XhpcChargingStationController extends BaseController { * @return */ @GetMapping(value = "/getWXXhpcTerminalMassage") - public AjaxResult getWXXhpcTerminalMassage(@Param("chargingStationId") Long chargingStationId) + public AjaxResult getWXXhpcTerminalMassage(@RequestParam(value = "chargingStationId",required = true) Long chargingStationId) { return AjaxResult.success(xhpcChargingStationService.getWXXhpcTerminalMassage(chargingStationId)); } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingPileMapper.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingPileMapper.java index 3a2ce494..f94d1dbe 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingPileMapper.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingPileMapper.java @@ -55,4 +55,11 @@ public interface XhpcChargingPileMapper { * @return 结果 */ int updaeXhpcChargingPile(XhpcChargingPile xhpcChargingPile); + + /** + * 终端列表 + * @param chargingPileId 桩id + * @return + */ + List> selectXhpcTerminalList(@Param("chargingPileId") Long chargingPileId); } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingPileService.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingPileService.java index 1342309a..01d1d359 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingPileService.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingPileService.java @@ -23,14 +23,14 @@ public interface IXhpcChargingPileService { /** - * 添加电站(编辑费率) + * 添加桩 * @param * @return */ AjaxResult addXhpcChargingPile(XhpcChargingPile xhpcChargingPile); /** - * 编辑电站(编辑费率) + * 编辑桩 * @param * @return */ diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java index ec75bf3b..8d790408 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java @@ -9,6 +9,7 @@ import com.xhpc.common.api.PowerPileService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -93,8 +94,13 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService{ @Override public AjaxResult selectXhpcChargingPile(Long chargingPileId) { - - return null; + XhpcChargingPile xhpc = xhpcChargingPileMapper.selectXhpcChargingPileById(chargingPileId); + //终端信息 + Map map = new HashMap<>(); + List> list = xhpcChargingPileMapper.selectXhpcTerminalList(chargingPileId); + map.put("chargingPile",xhpc); + map.put("terminal",list); + return AjaxResult.success(map); } } diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingPileMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingPileMapper.xml index c04fa973..b44586f2 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingPileMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingPileMapper.xml @@ -248,6 +248,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + update xhpc_charging_pile + + charging_station_id = #{chargingStationId}, + name = #{name}, + national_standard = #{nationalStandard}, + power = #{power}, + auxiliary_power_supply = #{auxiliaryPowerSupply}, + input_voltage = #{inputVoltage}, + max_voltage = #{maxVoltage}, + min_voltage = #{minVoltage}, + max_electric_current = #{maxElectricCurrent}, + min_electric_current = #{minElectriCurrent}, + serial_number = #{serialNumber}, + type = #{type}, + program_version = #{programVersion}, + network_link_type = #{networkLinkType}, + network_link_type = #{gunNumber}, + gun_number = #{networkLinkType}, + communication_protocol_version = #{communicationProtocolVersion}, + communication_operator = #{communicationOperator}, + sim_card = #{simCard}, + rate_model_id = #{rateModelId}, + charging_pile_number = #{chargingPileNumber}, + status = #{status}, + del_flag = #{delFlag}, + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + remark = #{remark}, + + where charging_pile_id = #{chargingPileId} + + \ No newline at end of file