From c5034108bd144e3f4dc933adebbd7d5058e984c4 Mon Sep 17 00:00:00 2001 From: yuyang <2265829957@qq.com> Date: Wed, 4 Aug 2021 18:23:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../station/mapper/XhpcChargingPileMapper.java | 7 +++++++ .../station/service/XhpcChargingPileServiceImpl.java | 10 +++++++++- .../main/resources/mapper/XhpcChargingPileMapper.xml | 4 ++++ .../resources/mapper/XhpcChargingStationMapper.xml | 3 ++- 4 files changed, 22 insertions(+), 2 deletions(-) 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 8cc5c2e7..5effd2ad 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 @@ -69,4 +69,11 @@ public interface XhpcChargingPileMapper { * @return 结果 */ int updateXhpcChargingPileById(@Param("chargingPileId")Long chargingPileId); + + /** + * 判断 + * @param serialNumber + * @return + */ + int getXhpcChargingPileSerialNumberCount(@Param("serialNumber")String serialNumber); } 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 06eab553..78987430 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 @@ -49,11 +49,19 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService{ Map stringObjectMap = xhpcChargingPileMapper.selectXhpcChargingStationById(chargingStationId); Long rateModelId = Long.parseLong(stringObjectMap.get("rateModelId").toString()); xhpcChargingPile.setRateModelId(rateModelId); + String serialNumber = xhpcChargingPile.getSerialNumber(); + //判断桩编号是否重复 + int count = xhpcChargingPileMapper.getXhpcChargingPileSerialNumberCount(serialNumber); + if(count>0){ + return AjaxResult.error("桩编号重复"); + } + + //桩 xhpcChargingPileMapper.addXhpcChargingPile(xhpcChargingPile); //终端 Long chargingPileId=xhpcChargingPile.getChargingPileId(); - String serialNumber = xhpcChargingPile.getSerialNumber(); + if(xhpcChargingPile.getGunNumber()>0){ for (int i = 0; i < xhpcChargingPile.getGunNumber(); i++) { XhpcTerminal xhpcTerminal =new XhpcTerminal(); 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 12b13a8e..db5ebfd9 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 @@ -307,4 +307,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update xhpc_charging_pile set del_flag =1 where charging_pile_id = #{chargingPileId} + + diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml index b96f9be6..df8f6ec0 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml @@ -189,6 +189,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ct.construction_site as constructionSite, (select dict_value from xhpc_dict_biz where code ='charging_construction_site' and dict_key =ct.construction_site) as constructionSiteName, ct.address as address, + ct.remark as remark, ct.detailed_address as detailedAddress, ct.periphery_facilities as peripheryFacilities, ct.service_facilities as serviceFacilities, @@ -728,7 +729,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"