| | |
| | | * @param c3Mac |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String finishCharging(String c3Mac) { |
| | | public String finishCharging(String c3Mac, String openId) { |
| | | //查询 |
| | | if (openId.isEmpty()) { |
| | | throw new BusinessException("openId不能为空"); |
| | | } |
| | | //查询该充电桩最近的订单 |
| | | C3mOrder order = SpringContextHolder.getBean(C3mOrderService.class).getOne(Wrappers.lambdaQuery(C3mOrder.class) |
| | | .eq(C3mOrder::getC3Mac, c3Mac).eq(C3mOrder::getChargingStates, 0).last("limit 1")); |
| | | |
| | | if (order == null) { |
| | | throw new BusinessException("充电桩没有进行中的订单"); |
| | | } |
| | | if (!openId.equals(order.getOrderId())) { |
| | | throw new BusinessException("不能操作不属于您的订单"); |
| | | } |
| | | |
| | | C3FinishChargingReqInnerFrame c3FinishChargingReqInnerFrame = |
| | | new C3FinishChargingReqInnerFrame(c3Mac); |