|
|
@@ -169,15 +169,9 @@ public class ChargeOrderInfoServiceImpl extends ServiceImpl<ChargeOrderInfoMappe
|
|
|
Assert.isTrue(userInfo != null, "用户信息不存在");
|
|
|
|
|
|
//判断有没有正在进行中的订单
|
|
|
- ChargeOrderInfo selectOne = this.baseMapper.selectOne(Wrappers.lambdaQuery(ChargeOrderInfo.class)
|
|
|
- .eq(ChargeOrderInfo::getUserId, userId)
|
|
|
- .in(ChargeOrderInfo::getStatus, SystemConstants.STATUS_ZERO, SystemConstants.STATUS_ONE, SystemConstants.STATUS_TWO)
|
|
|
- .last("limit 1"));
|
|
|
- if(null != selectOne){
|
|
|
- appInvokeChargeVO.setChargeOrderId(selectOne.getId());
|
|
|
- appInvokeChargeVO.setChargeOrderNo(selectOne.getChargeOrderNo());
|
|
|
- appInvokeChargeVO.setStatus(selectOne.getStatus());
|
|
|
- return appInvokeChargeVO;
|
|
|
+ Long count = this.baseMapper.selectCount(Wrappers.lambdaQuery(ChargeOrderInfo.class).eq(ChargeOrderInfo::getUserId, userId).in(ChargeOrderInfo::getStatus, SystemConstants.STATUS_ZERO, SystemConstants.STATUS_ONE, SystemConstants.STATUS_TWO));
|
|
|
+ if (count > 0){
|
|
|
+ throw new BusinessException("您有正在进行中的订单,请先停止充电");
|
|
|
}
|
|
|
//生成系统充电订单号及互联互通充电订单号 startChargeSeq equipAuthSeq (格式"运营商ID+唯一编号")
|
|
|
assert userId != null;
|
|
|
@@ -247,12 +241,9 @@ public class ChargeOrderInfoServiceImpl extends ServiceImpl<ChargeOrderInfoMappe
|
|
|
appInvokeChargeVO.setChargeOrderNo(chargeOrderNo);
|
|
|
appInvokeChargeVO.setChargeOrderId(chargeOrderInfo.getId());
|
|
|
return appInvokeChargeVO;
|
|
|
- } catch (BusinessException e) {
|
|
|
- log.error("启动充电失败:{}", e.getMessage());
|
|
|
- throw e;
|
|
|
} catch (Exception e) {
|
|
|
log.error("启动充电失败,系统错误", e);
|
|
|
- throw new BusinessException("启动充电失败,系统错误,请联系客服处理!" + e.getMessage());
|
|
|
+ throw new BusinessException("启动充电失败 !" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|