|
|
@@ -11,6 +11,7 @@ import com.kym.common.constant.ResponseEnum;
|
|
|
import com.kym.common.exception.BusinessException;
|
|
|
import com.kym.common.utils.CommUtil;
|
|
|
import com.kym.common.utils.OrderUtils;
|
|
|
+import com.kym.entity.admin.Activity;
|
|
|
import com.kym.entity.admin.ConnectorInfo;
|
|
|
import com.kym.entity.admin.EquipmentInfo;
|
|
|
import com.kym.entity.enplus.response.EnBusinessPolicy;
|
|
|
@@ -224,12 +225,14 @@ public class ChargeServiceImpl implements ChargeService {
|
|
|
order.setConnectorId(connectorId);
|
|
|
order.setOrderStatus(ChargeOrder.ORDER_STATUS_未知);
|
|
|
order.setChargeStatus(ChargeOrder.CHARGE_STATUS_启动中);
|
|
|
- chargeOrderService.save(order);
|
|
|
|
|
|
// 订单充值权益
|
|
|
if (!CommUtil.isEmptyOrNull(userRechargeRightsId)) {
|
|
|
var userRechargeRights = userRechargeRightsService.lambdaQuery().eq(UserRechargeRights::getUserId, userId).eq(UserRechargeRights::getId, userRechargeRightsId).one();
|
|
|
if (userRechargeRights != null) {
|
|
|
+ // 设置订单优惠类型
|
|
|
+ order.setDiscountType(Activity.DISCOUNT_TYPE_服务费折扣权益);
|
|
|
+
|
|
|
var orderRechargeRights = new OrderRechargeRights()
|
|
|
.setUserId(userId).setStartChargeSeq(startChargeSeq)
|
|
|
.setActivityId(userRechargeRights.getActivityId())
|
|
|
@@ -244,6 +247,9 @@ public class ChargeServiceImpl implements ChargeService {
|
|
|
if (!CommUtil.isEmptyOrNull(userCouponId)) {
|
|
|
var userCoupon = userCouponService.lambdaQuery().eq(UserCoupon::getUserId, userId).eq(UserCoupon::getId, userCouponId).one();
|
|
|
if (userCoupon != null) {
|
|
|
+ // 设置订单优惠类型
|
|
|
+ order.setDiscountType(Activity.DISCOUNT_TYPE_优惠券);
|
|
|
+
|
|
|
var orderCoupon = new OrderCoupon()
|
|
|
.setUserId(userId)
|
|
|
.setStartChargeSeq(startChargeSeq)
|
|
|
@@ -255,6 +261,9 @@ public class ChargeServiceImpl implements ChargeService {
|
|
|
orderCouponService.save(orderCoupon);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 保存订单信息
|
|
|
+ chargeOrderService.save(order);
|
|
|
}
|
|
|
|
|
|
// 如果是预约订单,则将订单放入预约充电延迟队列
|