diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcPileOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcPileOrderController.java index a26f13e2..cf275c07 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcPileOrderController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcPileOrderController.java @@ -346,19 +346,21 @@ public class XhpcPileOrderController extends BaseController { if(!"".equals(stopReason) && stopReason!=null){ xhpcChargeOrder.setType(Integer.parseInt(stopReason)); if("40".equals(stopReason)){ - xhpcHistoryOrder.setStopReasonEvcs(40); + xhpcChargeOrder.setStopReasonEvcs(40); }else if("42".equals(stopReason)){ - xhpcHistoryOrder.setStopReasonEvcs(42); + xhpcChargeOrder.setStopReasonEvcs(42); }else if("43".equals(stopReason)){ - xhpcHistoryOrder.setStopReasonEvcs(43); + xhpcChargeOrder.setStopReasonEvcs(43); }else if("44".equals(stopReason)){ - xhpcHistoryOrder.setStopReasonEvcs(44); + xhpcChargeOrder.setStopReasonEvcs(44); }else if("41".equals(stopReason)){ - xhpcHistoryOrder.setStopReasonEvcs(41); + xhpcChargeOrder.setStopReasonEvcs(41); }else if("48".equals(stopReason)){ - xhpcHistoryOrder.setStopReasonEvcs(48); + xhpcChargeOrder.setStopReasonEvcs(48); + }else if("45".equals(stopReason)){ + xhpcChargeOrder.setStopReasonEvcs(45); }else{ - xhpcHistoryOrder.setStopReasonEvcs(49); + xhpcChargeOrder.setStopReasonEvcs(49); } } }catch (Exception e){} 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 8ff2b5fa..2546eb44 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 @@ -324,6 +324,7 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe } xhpcChargeOrder.setStatus(3); xhpcChargeOrder.setAmountCharged(money); + xhpcChargeOrder.setStopReasonEvcs(45); Long userId = xhpcChargeOrder.getUserId(); Integer source = xhpcChargeOrder.getSource(); String tenantId = xhpcChargeOrder.getTenantId(); @@ -530,11 +531,16 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe if("支付宝".equals(xhpcChargeOrder.getChargingMode())){ xhpcHistoryOrder.setChargingMode("支付宝"); } + if("刷卡".equals(xhpcChargeOrder.getChargingMode())){ + xhpcHistoryOrder.setChargingMode("刷卡"); + } }else{ //订单异常 xhpcChargeOrder.setStatus(2); //异常原因 xhpcChargeOrder.setErroRemark("运营商数据为空"); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return R.fail(); } } Long chargeOrderId = xhpcChargeOrder.getChargeOrderId(); @@ -543,8 +549,13 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe xhpcHistoryOrder.setUserId(userId); xhpcHistoryOrder.setTerminalId(xhpcChargeOrder.getTerminalId()); xhpcHistoryOrder.setStartTime(xhpcChargeOrder.getStartTime()); - xhpcHistoryOrder.setStopReasonEvcs(xhpcChargeOrder.getStopReasonEvcs());//todo 从头开始设置所有evcs字段 - xhpcHistoryOrder.setChargeModelEvcs(xhpcChargeOrder.getChargeModelEvcs()); + //todo 从头开始设置所有evcs字段 + if(UserTypeUtil.COMMUNIT_TYPE.equals(source) || UserTypeUtil.CUSTOMERS_TYPE.equals(source)){ + xhpcHistoryOrder.setChargeModelEvcs(2); + }else{ + xhpcHistoryOrder.setChargeModelEvcs(xhpcChargeOrder.getChargeModelEvcs()); + } + xhpcHistoryOrder.setStopReasonEvcs(xhpcChargeOrder.getStopReasonEvcs()); xhpcHistoryOrder.setSerialNumber(xhpcChargeOrder.getSerialNumber()); xhpcHistoryOrder.setRateModelId(xhpcChargeOrder.getRateModelId()); xhpcHistoryOrder.setStartSoc(xhpcChargeOrder.getStartSoc()); diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml index 7b092d9c..b978617b 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml @@ -574,10 +574,10 @@ ho.act_power_price as actPowerPrice, co.charging_time as chargingTime, co.charging_degree as chargingDegree, - DATE_FORMAT(co.start_time,'%m月%d日') as daysOne, - DATE_FORMAT(co.start_time,'%H:%i:%s') as timeOne, - DATE_FORMAT(co.end_time,'%m月%d日') as daysTwo, - DATE_FORMAT(co.end_time,'%H:%i:%s') as timeTwo, + DATE_FORMAT(ho.start_time,'%m月%d日') as daysOne, + DATE_FORMAT(ho.start_time,'%H:%i:%s') as timeOne, + DATE_FORMAT(ho.end_time,'%m月%d日') as daysTwo, + DATE_FORMAT(ho.end_time,'%H:%i:%s') as timeTwo, co.status as status, co.type as type, case when co.type=40 then "APP远程停止"