From 5ba247dee7bf1c186aa51043269e5d19158c715a Mon Sep 17 00:00:00 2001 From: yuyang <2265829957@qq.com> Date: Sat, 18 Sep 2021 10:47:28 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E4=BA=A4=E6=B5=81=E6=A1=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xhpc/order/api/XhpcChargeOrderController.java | 5 +---- .../com/xhpc/order/mapper/XhpcChargeOrderMapper.java | 7 +++++++ .../com/xhpc/order/service/IXhpcChargeOrderService.java | 8 ++++++++ .../order/service/impl/XhpcChargeOrderServiceImpl.java | 5 +++++ .../order/service/impl/XhpcRealTimeOrderServiceImpl.java | 7 +++++++ .../src/main/resources/mapper/XhpcChargeOrderMapper.xml | 9 +++++++++ .../com/xhpc/wxma/socket/OrderNotificationWebSocket.java | 1 + 7 files changed, 38 insertions(+), 4 deletions(-) diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcChargeOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcChargeOrderController.java index fee28ecd..16e80cf5 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcChargeOrderController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcChargeOrderController.java @@ -129,10 +129,6 @@ public class XhpcChargeOrderController extends BaseController { public void getOrderMessage(@RequestParam Long userId) { logger.info("<<<<<<<<<<再次<<<<<<<<<<<<<<实时数据接口>>>>>>>>>>>>>>>>>"); - logger.info("<<<<<<<<<<再次<<<<<<<<<<<<<实时数据接口>>>>>>>>>>>>>>>>>>"+userId); - logger.info("<<<<<<<<<<再次<<<<<<<<<<<<<<实时数据接口>>>>>>>>>>>>>>>>>"+userId); - logger.info("<<<<<<<<<<再次<<<<<<<<<<<<<<实时数据接口>>>>>>>>>>>>>>>>>"); - logger.info("<<<<<<<<<<接收时间<<<<<<<<<<<<<<"+ DateUtil.format(Calendar.getInstance().getTime(), "yyyy-MM-dd HH:mm:ss")+">>>>>>>>>>>>>>>>>"); Map orderMessage = iXhpcChargeOrderService.getOrderMessage(userId); Map map =new HashMap<>(); @@ -154,6 +150,7 @@ public class XhpcChargeOrderController extends BaseController { data.put("remainingTime","0"); data.put("chargingTimeNumber",0); data.put("serialNumber","0"); + data.put("type","1"); data.put("parkingInstructions","在非充电情况下占用车位按照0.30元/分钟收费"); map.put("data", data); }else{ diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcChargeOrderMapper.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcChargeOrderMapper.java index f53af9c9..c78ed1d1 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcChargeOrderMapper.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcChargeOrderMapper.java @@ -141,4 +141,11 @@ public interface XhpcChargeOrderMapper { * 获取费率 */ List getRateModelId(@Param("rateModelId")Long rateModelId); + + /** + * 获取电桩信息 + * @param chargingPileId + * @return + */ + Map getXhpcChargingPile(@Param("terminalId")Long terminalId); } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcChargeOrderService.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcChargeOrderService.java index 5f34449a..2f8c9ad2 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcChargeOrderService.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcChargeOrderService.java @@ -135,4 +135,12 @@ public interface IXhpcChargeOrderService { * 获取费率 */ List getRateModelId(Long rateModelId); + + + /** + * 获取电桩信息 + * @param chargingPileId + * @return + */ + Map getXhpcChargingPile(Long terminalId); } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java index 626f9e55..6decca72 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java @@ -324,5 +324,10 @@ public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService { return xhpcChargeOrderMapper.getRateModelId(rateModelId); } + @Override + public Map getXhpcChargingPile(Long terminalId) { + return xhpcChargeOrderMapper.getXhpcChargingPile(terminalId); + } + } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java index 8c5809c6..4cd5c1f4 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java @@ -610,6 +610,13 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService { data.put("remainingTime",xhpcRealTimeOrder.getRemainingTime()); data.put("serialNumber",orderNo.substring(0,16)); data.put("parkingInstructions","在非充电情况下占用车位按照0.30元/分钟收费"); + //获取桩直流还是交流 + Map xhpcChargingPile = xhpcChargeOrderService.getXhpcChargingPile(xhpcChargeOrder.getTerminalId()); + if(xhpcChargingPile !=null){ + data.put("type", xhpcChargingPile.get("type").toString()); + }else{ + data.put("type", 1); + } map.put("data", data); } return map; diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcChargeOrderMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcChargeOrderMapper.xml index 709445f0..2a34d655 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcChargeOrderMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcChargeOrderMapper.xml @@ -93,9 +93,11 @@ rto.charging_time as chargingTime, rto.remaining_time as remainingTime, rto.amount_charged as amountCharged, + IFNULL(cp.type,'1') as type, au.balance as balance from xhpc_real_time_order as rto LEFT JOIN xhpc_app_user as au on au.app_user_id = rto.user_id + left join xhpc_charging_pile as cp on cp.serial_number = rto.pile_number and cp.status =0 and cp.del_flag=0 where rto.charging_order_id =(select charge_order_id from xhpc_charge_order where status =0 and source = 0 and user_id=#{userId} ORDER BY create_time desc LIMIT 1) and rto.user_id=#{userId} ORDER BY rto.create_time DESC limit 1 @@ -469,4 +471,11 @@ + + diff --git a/xhpc-modules/xhpc-wxma/src/main/java/com/xhpc/wxma/socket/OrderNotificationWebSocket.java b/xhpc-modules/xhpc-wxma/src/main/java/com/xhpc/wxma/socket/OrderNotificationWebSocket.java index 60e39e9b..2354ca78 100644 --- a/xhpc-modules/xhpc-wxma/src/main/java/com/xhpc/wxma/socket/OrderNotificationWebSocket.java +++ b/xhpc-modules/xhpc-wxma/src/main/java/com/xhpc/wxma/socket/OrderNotificationWebSocket.java @@ -114,6 +114,7 @@ public class OrderNotificationWebSocket { data.put("remainingTime","0"); data.put("serialNumber","0"); data.put("parkingInstructions","在非充电情况下占用车位按照0.30元/分钟收费"); + data.put("type", "1"); map.put("data", data); JSONObject json = new JSONObject(map); sendMessage(this.userId,json.toString());