From de244978b6d620244a67f3ed5419c70658339b5b Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Thu, 31 Aug 2023 10:17:13 +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 --- .../com/hai/openApi/config/BlxConfig.java | 4 ++-- .../service/ApiOrderCreateHandleService.java | 18 ++++++++++++++++ .../impl/ApiOrderCreateHandleServiceImpl.java | 12 +++++++++++ .../service/impl/ApiOrderServiceImpl.java | 21 +++++++++++++++++++ .../com/hai/order/type/OrderProductType.java | 2 ++ .../com/v1/controller/orderController.java | 16 ++++++++++++++ 6 files changed, 71 insertions(+), 2 deletions(-) diff --git a/hai-service/src/main/java/com/hai/openApi/config/BlxConfig.java b/hai-service/src/main/java/com/hai/openApi/config/BlxConfig.java index 10007bc7..c293d4df 100644 --- a/hai-service/src/main/java/com/hai/openApi/config/BlxConfig.java +++ b/hai-service/src/main/java/com/hai/openApi/config/BlxConfig.java @@ -277,7 +277,7 @@ public class BlxConfig { public JSONObject creatOrder(JSONObject object) { Map map = new HashMap<>(); - map.put("organizeCode" , object.getString("organizeCode")); + map.put("organizeCode" , "dhy"); map.put("userMobile" , object.getString("userMobile")); map.put("userCouponCode" , object.getString("userCouponCode")); map.put("parkOrderId" , object.getString("parkOrderId")); @@ -290,7 +290,7 @@ public class BlxConfig { map.put("inTime" , object.getString("inTime")); map.put("outTime" , object.getString("outTime")); map.put("carNo" , object.getString("carNo")); - map.put("parkType" , object.getString("parkType")); + map.put("parkType" , 1); Map header = new HashMap<>(); header.put("token" , generateJw()); diff --git a/hai-service/src/main/java/com/hai/openApi/service/ApiOrderCreateHandleService.java b/hai-service/src/main/java/com/hai/openApi/service/ApiOrderCreateHandleService.java index e0ca47d8..2ec0a95e 100644 --- a/hai-service/src/main/java/com/hai/openApi/service/ApiOrderCreateHandleService.java +++ b/hai-service/src/main/java/com/hai/openApi/service/ApiOrderCreateHandleService.java @@ -68,6 +68,24 @@ public interface ApiOrderCreateHandleService { */ ApiOrder starbucksHandle(JSONObject object) throws Exception; + /** + * @Author Sum1Dream + * @Name blxCouponHandle + * @Description // 比邻星停车券业务 + * @Date 17:15 2023/8/30 + * @Param [object] + * @Return com.hai.entity.ApiOrder + */ ApiOrder blxCouponHandle(JSONObject object) throws Exception; + /** + * @Author Sum1Dream + * @Name blxOrder + * @Description // 比邻星停车下单业务 + * @Date 17:16 2023/8/30 + * @Param [object] + * @Return com.hai.entity.ApiOrder + */ + ApiOrder blxOrder(JSONObject object) throws Exception; + } diff --git a/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderCreateHandleServiceImpl.java b/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderCreateHandleServiceImpl.java index ab1e9c92..c46c47f9 100644 --- a/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderCreateHandleServiceImpl.java +++ b/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderCreateHandleServiceImpl.java @@ -393,4 +393,16 @@ public class ApiOrderCreateHandleServiceImpl implements ApiOrderCreateHandleServ return apiOrder; } + + @Override + public ApiOrder blxOrder(JSONObject object) throws Exception { + + // 获取下单内容 + JSONObject dataObject = JSONObject.parseObject(object.getString("content")); + + // 查询api商户 + ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId")); + + return null; + } } diff --git a/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java b/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java index d29bc852..622ae273 100644 --- a/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java @@ -222,6 +222,27 @@ public class ApiOrderServiceImpl implements ApiOrderService { orderService.createOrder(createOrderModel); } + // 处理停车订单 + if (OrderProductType.PRODUCT_TYPE14.getNumber().equals(object.getInteger("productType"))) { + + apiOrder = orderCreateHandleService.blxCouponHandle(object); + + // 组装子订单内容 + CreateOrderChildModel createOrderChildModel = new CreateOrderChildModel(); + createOrderChildModel.setMemName(apiMerchants.getMerchantName()); + createOrderChildModel.setMemPhone(apiMerchants.getPhone()); + createOrderChildModel.setCompanyId(2L); + createOrderChildModel.setGoodsType(OrderChildGoodsType.TYPE12.getNumber()); + createOrderChildModel.setCouponCode(dataObject.getString("couponCode")); + createOrderChildModel.setSaleCount(dataObject.getInteger("receiverCount")); + createOrderChildModel.setIsTyAgent(false); + createOrderChildModel.setGoodsPrice(apiOrder.getOrderPrice()); + + // 组装订单 + createOrderModel.getChildOrderList().add(createOrderChildModel); + orderService.createOrder(createOrderModel); + + } diff --git a/hai-service/src/main/java/com/hai/order/type/OrderProductType.java b/hai-service/src/main/java/com/hai/order/type/OrderProductType.java index 0e027e41..3b3d8cd0 100644 --- a/hai-service/src/main/java/com/hai/order/type/OrderProductType.java +++ b/hai-service/src/main/java/com/hai/order/type/OrderProductType.java @@ -14,6 +14,7 @@ public enum OrderProductType { PRODUCT_TYPE3(3, "第三方充值", "orderLogo/member-top-up.png" , "MEMBER_RECHARGE_CONFIG"), PRODUCT_TYPE4(4, "积分充值", "orderLogo/integral-top-up.png" , "INTEGRAL_RECHARGE_CONFIG"), PRODUCT_TYPE5(5, "购买卡券", "orderLogo/coupon.png", "COUPON_CONFIG"), + PRODUCT_TYPE6(6, "在线加油" , "orderLogo/refuel-online.png", "REFUEL_ONLINE_CONFIG"), PRODUCT_TYPE7(7, "优惠券包", "orderLogo/coupon-packs.png", "COUPON_PACKS_CONFIG"), PRODUCT_TYPE8(8, "汇联通工会卡充值", "orderLogo/hlt.png", "HLT_CONFIG"), @@ -22,6 +23,7 @@ public enum OrderProductType { PRODUCT_TYPE11(11, "贵州中石化" , "", "GZ_SINOPEC_CONFIG"), PRODUCT_TYPE12(12, "实物商品" , "orderLogo/goods.png", "GOODS"), PRODUCT_TYPE13(13, "比邻星停车券" , "orderLogo/coupon.png", "BLX_COUPON"), + PRODUCT_TYPE14(14, "比邻星停车业务" , "orderLogo/coupon.png", "BLX_PARK"), PRODUCT_TYPE101(101, "惠支付" , "orderLogo/pay.png", "PAY"), PRODUCT_TYPE102(102, "门店活动" , "orderLogo/store_activity.png", "STORE_ACTIVITY"), ; diff --git a/v1/src/main/java/com/v1/controller/orderController.java b/v1/src/main/java/com/v1/controller/orderController.java index b009d86e..eae9133e 100644 --- a/v1/src/main/java/com/v1/controller/orderController.java +++ b/v1/src/main/java/com/v1/controller/orderController.java @@ -177,6 +177,22 @@ public class orderController { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未填写卡券编码,手机号,购买数量"); } } + if (object.getInteger("productType").equals(OrderProductType.PRODUCT_TYPE14.getNumber())) { + if ( StringUtils.isBlank(dataObject.getString("userMobile")) + || StringUtils.isBlank(dataObject.getString("parkOrderId")) + || StringUtils.isBlank(dataObject.getString("parkName")) + || dataObject.getInteger("orderType") == null + || dataObject.getBigDecimal("prePrice") == null + || dataObject.getInteger("parkId") == null + || dataObject.getInteger("parkTime") == null + || dataObject.getDate("inTime") == null + || dataObject.getDate("outTime") == null + || dataObject.getDate("carNo") == null + ) { + log.error("OrderController -> create() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未填写卡券编码,手机号,购买数量"); + } + } return ResponseMsgUtil.success(apiOrderService.createOrder(object));