From 95af66bb961e8e6a2ffda734595454c942ad5dac Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Mon, 21 Aug 2023 17:26:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OrderMobileRechargeController.java | 1 + .../com/hai/order/model/CreateOrderModel.java | 17 +++++ .../order/model/combine/CreateCombine.java | 17 +---- .../order/service/impl/OrderServiceImpl.java | 63 ++++++++++++++++++- 4 files changed, 80 insertions(+), 18 deletions(-) diff --git a/hai-order/src/main/java/com/web/controller/business/OrderMobileRechargeController.java b/hai-order/src/main/java/com/web/controller/business/OrderMobileRechargeController.java index f1a51dce..0f00e7ac 100644 --- a/hai-order/src/main/java/com/web/controller/business/OrderMobileRechargeController.java +++ b/hai-order/src/main/java/com/web/controller/business/OrderMobileRechargeController.java @@ -313,6 +313,7 @@ public class OrderMobileRechargeController { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); order.setExceptionStatus(false); + order.setOrderStatus(4); highOrderService.updateOrder(order); return ResponseMsgUtil.success("操作成功"); diff --git a/hai-service/src/main/java/com/hai/order/model/CreateOrderModel.java b/hai-service/src/main/java/com/hai/order/model/CreateOrderModel.java index f482505f..1095ad2c 100644 --- a/hai-service/src/main/java/com/hai/order/model/CreateOrderModel.java +++ b/hai-service/src/main/java/com/hai/order/model/CreateOrderModel.java @@ -74,6 +74,23 @@ public class CreateOrderModel { */ private Long deliveryAddressId; + /** + * 产品类型 + 1:星巴克 + 2:肯德基 + 3:会员充值 + 4:积分充值 + 5:购买卡券 + 6:加油服务 + 7:优惠券包 + 8:汇联通充值 + 9:话费充值 + 10:电影票 + 11:贵州中石化 + 12:实物商品 + */ + private Integer productType; + /** * 子订单参数模型 */ diff --git a/hai-service/src/main/java/com/hai/order/model/combine/CreateCombine.java b/hai-service/src/main/java/com/hai/order/model/combine/CreateCombine.java index f2915c94..bf1db0c2 100644 --- a/hai-service/src/main/java/com/hai/order/model/combine/CreateCombine.java +++ b/hai-service/src/main/java/com/hai/order/model/combine/CreateCombine.java @@ -51,22 +51,7 @@ public class CreateCombine { */ private String memPhone; - /** - * 产品类型 - 1:星巴克 - 2:肯德基 - 3:会员充值 - 4:积分充值 - 5:购买卡券 - 6:加油服务 - 7:优惠券包 - 8:汇联通充值 - 9:话费充值 - 10:电影票 - 11:贵州中石化 - 12:实物商品 - */ - private Integer productType; + /** * @Author Sum1Dream diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java index 8cd80821..06640a28 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java @@ -168,7 +168,6 @@ public class OrderServiceImpl implements OrderService { order.setPromoteCode(popularizeUser.getAgentId().toString()); } - order.setCombineOrderNo(createOrderModel.getCombineOrderNo()); order.setOrderNo(createOrderModel.getOrderNo()); order.setMemId(createOrderModel.getMemId()); order.setMemName(createOrderModel.getMemName()); @@ -873,7 +872,7 @@ public class OrderServiceImpl implements OrderService { if (MapUtils.getLong(param, "refundTimeS") != null) { criteria.andRefundTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(param, "refundTimeS"))); - } + } if (MapUtils.getLong(param, "refundTimeE") != null) { criteria.andRefundTimeLessThan(new Date(MapUtils.getLong(param, "refundTimeE"))); } @@ -939,6 +938,66 @@ public class OrderServiceImpl implements OrderService { List createOrderModels = createCombine.getCreateOrderModel(); + // 查询推广员信息 + Map mapUser = new HashMap<>(); + mapUser.put("userId" , createCombine.getMemId()); + BsDistributionUserRel popularizeUser = bsDistributionUserRelService.findDistributionUserRel(mapUser); + + HighOrder order = new HighOrder(); + if (popularizeUser != null) { + order.setPromoteCode(popularizeUser.getAgentId().toString()); + } + + for (CreateOrderModel createOrderModel : createOrderModels) { + order.setCombineOrderNo(createCombine.getCombineOrderNo()); + order.setOrderNo(createOrderModel.getOrderNo()); + order.setMemId(createOrderModel.getMemId()); + order.setMemName(createOrderModel.getMemName()); + order.setMemPhone(createOrderModel.getMemPhone()); + order.setRemarks(createOrderModel.getRemarks()); + order.setOrderStatus(OrderStatus.STATUS1.getNumber()); + order.setWhetherCheck(false); + order.setWhetherRebate(false); + order.setProfitSharingStatus(false); + order.setExceptionStatus(false); + order.setCreateTime(new Date()); + order.setDeductionCouponPrice(new BigDecimal("0")); + order.setDeductionProductPrice(new BigDecimal("0")); + order.setCompanyId(createOrderModel.getCompanyId()); + + if (createOrderModel.getProductType() == 12) {} + + /*********** 组装处理子订单 商品业务************/ + List childOrderList = new ArrayList<>(); + for (CreateOrderChildModel child : createOrderModel.getChildOrderList()) { + child.setMemId(order.getMemId()); + child.setMemName(order.getMemName()); + child.setMemPhone(order.getMemPhone()); + child.setOrderNo(order.getOrderNo()); + + if (child.getGoodsType().equals(OrderChildGoodsType.TYPE11.getNumber())) { + + HighChildOrder childOrder = orderCreateHandleService.goods(order , child); + childOrderList.add(childOrder); + order.setProductType(OrderProductType.PRODUCT_TYPE12.getNumber()); + order.setSecUserId(childOrder.getId()); + + if (StringUtils.isBlank(order.getTitle())) { + order.setTitle(childOrder.getGoodsName()); + order.setExt6(childOrder.getGoodsImg()); + } else { + order.setTitle(order.getTitle() + "+" +childOrder.getGoodsName()); + order.setExt6(order.getExt6() + "," +childOrder.getGoodsImg()); + } + + + + + } + + } + } + return null; } }