|
|
|
@ -158,6 +158,9 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { |
|
|
|
|
@Resource |
|
|
|
|
private HighOilCardOrderService highOilCardOrderService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighOilCardService oilCardService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private GroupCodeService groupCodeService; |
|
|
|
|
|
|
|
|
@ -1146,6 +1149,38 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { |
|
|
|
|
return childOrder; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public HighChildOrder oilCard(HighOrder order, CreateOrderChildModel createOrderChildModel) { |
|
|
|
|
// 查询油卡
|
|
|
|
|
HighOilCard card = oilCardService.getOilCardByCardNo(createOrderChildModel.getGoodsId().toString()); |
|
|
|
|
if (card == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油卡"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
HighChildOrder childOrder = new HighChildOrder(); |
|
|
|
|
childOrder.setOrderNo(order.getOrderNo()); |
|
|
|
|
childOrder.setMemId(order.getMemId()); |
|
|
|
|
childOrder.setMemName(order.getMemName()); |
|
|
|
|
childOrder.setMemPhone(order.getMemPhone()); |
|
|
|
|
childOrder.setChildOrderNo(OrderUtil.generateChildOrderNo()); |
|
|
|
|
childOrder.setGoodsType(OrderChildGoodsType.TYPE15.getNumber()); |
|
|
|
|
childOrder.setGoodsId(card.getId()); |
|
|
|
|
childOrder.setGoodsName("油卡充值"); |
|
|
|
|
childOrder.setGoodsSpecName(card.getCardNo()); |
|
|
|
|
childOrder.setGoodsPrice(createOrderChildModel.getGoodsPrice()); |
|
|
|
|
childOrder.setGoodsActualPrice(childOrder.getGoodsPrice()); |
|
|
|
|
childOrder.setSaleCount(createOrderChildModel.getSaleCount()); |
|
|
|
|
childOrder.setGiveawayType(false); |
|
|
|
|
childOrder.setChildOrderStatus(OrderChildStatus.STATUS1.getNumber()); |
|
|
|
|
childOrder.setTotalPrice(childOrder.getGoodsPrice()); |
|
|
|
|
childOrder.setTotalActualPrice(childOrder.getGoodsPrice()); |
|
|
|
|
childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice())); |
|
|
|
|
childOrder.setPraiseStatus(0); |
|
|
|
|
childOrder.setCreateTime(new Date()); |
|
|
|
|
|
|
|
|
|
return childOrder; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public HighChildOrder group(HighOrder order, CreateOrderChildModel createOrderChildModel) throws Exception { |
|
|
|
|