From f7fbf15176fba52b3caaf2768ab9823034abf677 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Wed, 20 Dec 2023 10:30:35 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/2.0-dev' into 2.0-dev --- .../impl/OrderCreateHandleServiceImpl.java | 105 +----------------- 1 file changed, 1 insertion(+), 104 deletions(-) diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java index 877de769..9f93b665 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java @@ -1168,38 +1168,6 @@ 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 { @@ -1254,78 +1222,7 @@ 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, "未知的油卡"); - } - - // 充值金额 - BigDecimal rechargeAmount = createOrderChildModel.getGoodsPrice(); - // 赠送金额 - BigDecimal givePrice = new BigDecimal("0"); - - SecConfig rechargeRatio = secConfigService.findByCodeType("OIL_CARD_RECHARGE_RATIO"); - if (rechargeRatio != null && StringUtils.isNotBlank(rechargeRatio.getCodeValue())) { - BigDecimal ratio = new BigDecimal(rechargeRatio.getCodeValue()).divide(new BigDecimal("100")); - givePrice = rechargeAmount.multiply(ratio).setScale(2, RoundingMode.DOWN); - } - - 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(rechargeAmount.add(givePrice)); - childOrder.setGoodsActualPrice(createOrderChildModel.getGoodsPrice()); - childOrder.setSaleCount(createOrderChildModel.getSaleCount()); - childOrder.setGiveawayType(false); - childOrder.setChildOrderStatus(OrderChildStatus.STATUS1.getNumber()); - childOrder.setTotalPrice(childOrder.getGoodsPrice()); - childOrder.setTotalActualPrice(createOrderChildModel.getGoodsPrice()); - childOrder.setTotalDeductionPrice(createOrderChildModel.getGoodsPrice().subtract(childOrder.getTotalActualPrice())); - childOrder.setPraiseStatus(0); - childOrder.setCreateTime(new Date()); - childOrder.setExt1(givePrice.toString()); - return childOrder; - } - - @Override - public HighChildOrder petroCoupon(HighOrder order, CreateOrderChildModel createOrderChildModel) throws Exception { - ApiCoupon apiCoupon = apiCouponService.findCoupon(createOrderChildModel.getCouponCode()); - - // 生成交易子订单 - 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.TYPE12.getNumber()); - childOrder.setGoodsId(apiCoupon.getId()); - childOrder.setGoodsName(apiCoupon.getName()); - childOrder.setGoodsSpecName(apiCoupon.getCode()); - childOrder.setGoodsPrice(new BigDecimal(apiCoupon.getPrice())); - childOrder.setGoodsActualPrice(createOrderChildModel.getPrice()); - childOrder.setSaleCount(createOrderChildModel.getSaleCount()); - childOrder.setGiveawayType(false); - childOrder.setChildOrderStatus(OrderChildStatus.STATUS1.getNumber()); - childOrder.setTotalPrice(childOrder.getGoodsPrice().multiply(new BigDecimal(childOrder.getSaleCount()))); - childOrder.setTotalActualPrice(childOrder.getGoodsActualPrice().multiply(new BigDecimal(childOrder.getSaleCount()))); - childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice())); - childOrder.setPraiseStatus(0); - childOrder.setCreateTime(new Date()); - - return childOrder; - } @Override public HighChildOrder oilCard(HighOrder order, CreateOrderChildModel createOrderChildModel) { @@ -1372,7 +1269,7 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { } @Override - public HighChildOrder petroCoupon(HighOrder order, CreateOrderChildModel createOrderChildModel) throws Exception { + public HighChildOrder petroCoupon(HighOrder order, CreateOrderChildModel createOrderChildModel) { ApiCoupon apiCoupon = apiCouponService.findCoupon(createOrderChildModel.getCouponCode());