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("刷卡");