| | |
| | | public AjaxResult stopCharging(String id) { |
| | | TChargingOrder chargingOrder = this.getById(id); |
| | | Integer status = chargingOrder.getStatus(); |
| | | if(status != 3){ |
| | | return AjaxResult.error("还未开始充电"); |
| | | } |
| | | if(status == 4 || status == 5){ |
| | | return AjaxResult.error("不能重复操作"); |
| | | } |
| | |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | |
| | | TChargingOrder chargingOrder1 = this.getById(id); |
| | | if(chargingOrder1.getStatus() != 3){ |
| | | break; |
| | | } |
| | | |
| | | if(0 == reply.getStop_result()){ |
| | | String failure_cause = ""; |
| | | switch (reply.getFailure_cause()){ |
| | |
| | | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 停止充电应答结果处理 |
| | | * @param platformStopChargingReply |
| | | */ |
| | | @Override |
| | | public void terminateSuccessfulResponse(PlatformStopChargingReplyVO platformStopChargingReply){ |
| | | GetChargingGunByCode code = new GetChargingGunByCode(); |
| | | code.setCharging_gun_code(platformStopChargingReply.getCharging_gun_code()); |
| | |
| | | TChargingGun chargingGun = chargingGunClient.getChargingGunByCode(code).getData(); |
| | | TChargingOrder order = this.getOne(new LambdaQueryWrapper<TChargingOrder>().eq(TChargingOrder::getChargingGunId, chargingGun.getId()) |
| | | .orderByDesc(TChargingOrder::getEndTime).eq(TChargingOrder::getRechargePaymentStatus, 2).last(" limit 0, 1")); |
| | | if(order.getStatus() != 3){ |
| | | if(null != order && order.getStatus() != 3){ |
| | | return; |
| | | } |
| | | String code1 = order.getCode(); |
| | |
| | | chargingGunClient.updateChargingGunById(chargingGun); |
| | | //计算费用,处理退款 |
| | | endCharge(order); |
| | | log.error(code1 + ":-------------------远程停止充电请求成功-------------------"); |
| | | } |
| | | |
| | | |