From f0285805725e02eceb7f3d73a42bd1453584514d Mon Sep 17 00:00:00 2001 From: yuyang <2265829957@qq.com> Date: Thu, 5 Aug 2021 20:30:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E5=85=85=E7=94=B5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/XhpcChargingPileServiceImpl.java | 12 ++- .../XhpcChargingStationServiceImpl.java | 4 +- .../mapper/XhpcChargingStationMapper.xml | 39 +++------ .../resources/mapper/XhpcTerminalMapper.xml | 1 + .../com/xhpc/common/domain/XhpcTerminal.java | 13 +++ .../order/mapper/HxpcChargeOrderMapper.java | 4 + .../impl/HxpcChargeOrderServiceImpl.java | 74 ++++++++++------- .../mapper/XhpcChargeOrderMapper.xml | 81 +++++++++++++++++-- 8 files changed, 163 insertions(+), 65 deletions(-) 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 01ec0ed3..76fd7353 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 @@ -1,5 +1,9 @@ package com.xhpc.charging.station.service; +import com.xhpc.common.core.domain.R; +import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.domain.XhpcChargingPile; +import com.xhpc.common.domain.XhpcTerminal; import com.xhpc.charging.station.mapper.XhpcChargingPileMapper; import com.xhpc.charging.station.mapper.XhpcTerminalMapper; import com.xhpc.common.api.PowerPileService; @@ -74,6 +78,7 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService { xhpcTerminal.setPileSerialNumber(serialNumber); xhpcTerminal.setWorkStatus(2); xhpcTerminal.setStatus(0); + xhpcTerminal.setRateModelId(rateModelId); xhpcTerminalMapper.addXhpcTerminal(xhpcTerminal); } } @@ -81,8 +86,9 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService { //插入redis 桩的编号 HashSet noSet = new HashSet<>(); noSet.add(serialNumber); - powerPileService.addPileWhitelist(chargingStationId, noSet); - + R r = powerPileService.addPileWhitelist(chargingStationId, noSet); + System.out.println(">>>>>>"+r.getCode()); + System.out.println(">>>>>>"+r.getMsg()); return AjaxResult.success(); } @@ -104,6 +110,7 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService { xhpcChargingPileMapper.updateXhpcTerminal(chargingPileId); String serialNumber = xhpcChargingPile.getSerialNumber(); + Long rateModelId = xhpcChargingPile.getRateModelId(); Long chargingStationId = xhpcChargingPile.getChargingStationId(); if (xhpcChargingPile.getGunNumber() > 0) { for (int i = 0; i < xhpcChargingPile.getGunNumber(); i++) { @@ -115,6 +122,7 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService { xhpcTerminal.setPileSerialNumber(serialNumber); xhpcTerminal.setWorkStatus(2); xhpcTerminal.setStatus(0); + xhpcTerminal.setRateModelId(rateModelId); xhpcTerminalMapper.addXhpcTerminal(xhpcTerminal); } } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java index 932369d7..63fad47b 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java @@ -505,7 +505,8 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi cacheRateModel.setTfPricesSeq(tfPricesSeq); R r = powerPileService.setStationRateModel(chargingStationId, rateModelId, cacheRateModel); - System.out.println(r.toString()); + System.out.println(r.getCode()); + System.out.println(r.getMsg()); return AjaxResult.success(); } @@ -537,7 +538,6 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi //费率时段,先反设置时段,在反默认时段 List> xhpcRateTimeTypeList = xhpcChargingStationMapper.getXhpcRateTimeTypeList(chargingStationId, 1); - xhpcRateTimeTypeList.addAll(xhpcChargingStationMapper.getXhpcRateTimeTypeList(chargingStationId, 2)); map.put("xhpcRateTimeList", xhpcRateTimeTypeList); if (type == 2) { //统计终端(充redis获取终端信息) 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 abea1e60..33ff085f 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 @@ -240,11 +240,8 @@ GROUP_CONCAT(DISTINCT xdbp.dict_value ORDER BY xdbp.create_time ASC separator ',' ) peripheryFacilitiesName from xhpc_charging_station as ct left join xhpc_operator as op on op.operator_id = ct.operator_id - left join xhpc_dict_biz xdbs on xdbs.code = 'service_facilities' and FIND_IN_SET(xdbs.dict_key,ct.service_facilities) - left join xhpc_dict_biz xdbp on xdbp.code = 'charging_periphery_facilities' and FIND_IN_SET(xdbp.dict_key,ct.periphery_facilities) where ct.charging_station_id = #{chargingStationId} and ct.del_flag = 0 - group by ct.charging_station_id select rto.real_time_order_id as realTimeOrderId, @@ -84,6 +86,75 @@ where serial_number=#{serialNumber} and del_flag=0 limit 1 + + insert into xhpc_charge_order + + + charging_station_id, + + + user_id, + + + terminal_id, + + + internet_serial_number, + + + serial_number, + + + start_soc, + + + source, + + + status, + + + del_flag, + + + rate_model_id + + + + + #{chargingStationId}, + + + #{userId}, + + + #{terminalId}, + + + #{internetSerialNumber}, + + + #{serialNumber}, + + + #{startSoc}, + + + #{source}, + + + #{status}, + + + #{delFlag}, + + + #{rateModelId} + + + +