From 172ce9fb0ab01c60f10a38ceb4a3410842a60d8e Mon Sep 17 00:00:00 2001 From: ZZ Date: Wed, 23 Feb 2022 16:13:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8D=A1=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/v2.1.sql | 3 +++ .../api/factory/CardHistoryOrderFactory.java | 2 +- .../service/IXhpcChargeOrderService.java | 3 +-- .../impl/XhpcChargeOrderServiceImpl.java | 20 ++++++++++--------- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/sql/v2.1.sql b/sql/v2.1.sql index 8d58bb7e..9309ff33 100644 --- a/sql/v2.1.sql +++ b/sql/v2.1.sql @@ -600,3 +600,6 @@ ALTER TABLE `xhpc_statistics_station` ALTER TABLE `xhpc_operator` CHANGE COLUMN `corp_no` `corp_no` VARCHAR(30) NULL COMMENT '运营商代码,用于桩编号前缀,如80836代表翔桦' AFTER `name`, ADD UNIQUE INDEX `corp_no` (`corp_no`); + +ALTER TABLE `t_iccard_client_users` + ADD COLUMN `tenant_id` VARCHAR(50) NULL COMMENT '租户id' AFTER `usersTime`; diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/factory/CardHistoryOrderFactory.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/factory/CardHistoryOrderFactory.java index 64d53e24..a162d255 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/factory/CardHistoryOrderFactory.java +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/factory/CardHistoryOrderFactory.java @@ -17,7 +17,7 @@ public class CardHistoryOrderFactory implements FallbackFactory xhpcChargingPileById = + xhpcChargeOrderMapper.getXhpcChargingPileById(xhpcTerminal.getChargingPileId(), tenantId); + if (xhpcChargingPileById.size() == 0) { + return R.fail(Constants.INVALID_OPERATOR); + } + if (type != 0) { //获取桩信息 - Map xhpcChargingPileById =xhpcChargeOrderMapper.getXhpcChargingPileById(xhpcTerminal.getChargingPileId(),tenantId); - if(xhpcChargingPileById ==null || !grantOperator.equals(xhpcChargingPileById.get("corpNo").toString())){ + if (grantOperator.equals(xhpcChargingPileById.get("corpNo").toString())) { return R.fail(Constants.INVALID_OPERATOR); } } BigDecimal a = new BigDecimal(5); - if (userMessage == null || userMessage.get("balance") == null || a.compareTo(new BigDecimal(userMessage.get("balance").toString())) == 1) { + if (userMessage == null || userMessage.get("balance") == null || a.compareTo(new BigDecimal(userMessage.get( + "balance").toString())) == 1) { return R.fail(Constants.INSUFFICIENT_ACCOUNT); } @@ -728,10 +733,7 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar xhpcChargeOrder.setStatus(-1); xhpcChargeOrder.setTenantId(tenantId); //获取桩信息 - Map xhpcChargingPileById =xhpcChargeOrderMapper.getXhpcChargingPileById(xhpcTerminal.getChargingPileId(),tenantId); - if (xhpcChargingPileById != null && xhpcChargingPileById.get("power") != null) { - xhpcChargeOrder.setPower(xhpcChargingPileById.get("power").toString()); - } + xhpcChargeOrder.setPower((String) xhpcChargingPileById.get("power")); xhpcChargeOrder.setRateModelId(Long.valueOf(rateModelId)); xhpcChargeOrder.setChargingMode("刷卡");