diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java b/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java index 82e3710a..7a9a7129 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java @@ -318,7 +318,7 @@ public class HighCouponController { } // 中石化 - if (coupon.getCouponSource() != null && (coupon.getCouponSource() != 4 && coupon.getCouponSource() != 5)) { + if (coupon.getCouponSource() != null && (coupon.getCouponSource() != 4 && coupon.getCouponSource() != 5 && coupon.getCouponSource() != 6)) { // 根据卡卷查询 销售码库存 if (highCouponCodeService.getStockCountByCoupon(coupon.getId()) == 0) { log.error("HighCouponController -> upShelfApprove() error!","卡卷库存数量错误"); @@ -326,19 +326,27 @@ public class HighCouponController { } } - HighApprove approve = new HighApprove(); - approve.setObjectType(ApproveType.UP_SHELF_APPROVE.getType()); - approve.setObjectId(id); - approve.setObjectName(coupon.getCouponName()); - approve.setApproveSerialNo(DateUtil.date2String(new Date(), "yyyyMMddHHmmss")); - approve.setStatus(1); - approve.setCreateTime(new Date()); - approve.setUpdateTime(new Date()); - approve.setSubmitOperatorId(userInfoModel.getSecUser().getId()); - approve.setSubmitOperatorName(userInfoModel.getSecUser().getUserName()); + if (coupon.getCompanyId() == 57) { + coupon.setStatus(2); + highCouponService.updateCoupon(coupon); + coupon.setUpdateTime(new Date()); + } else { + HighApprove approve = new HighApprove(); + approve.setObjectType(ApproveType.UP_SHELF_APPROVE.getType()); + approve.setObjectId(id); + approve.setObjectName(coupon.getCouponName()); + approve.setApproveSerialNo(DateUtil.date2String(new Date(), "yyyyMMddHHmmss")); + approve.setStatus(1); + approve.setCreateTime(new Date()); + approve.setUpdateTime(new Date()); + approve.setSubmitOperatorId(userInfoModel.getSecUser().getId()); + approve.setSubmitOperatorName(userInfoModel.getSecUser().getUserName()); + + // 增加审批 + highApproveService.insertApprove(approve); + } + - // 增加审批 - highApproveService.insertApprove(approve); return ResponseMsgUtil.success("操作成功"); } catch (Exception e) { diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighDiscountPackageController.java b/hai-cweb/src/main/java/com/cweb/controller/HighDiscountPackageController.java index 0036994d..b4160ea0 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighDiscountPackageController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighDiscountPackageController.java @@ -36,15 +36,6 @@ public class HighDiscountPackageController { private static Logger log = LoggerFactory.getLogger(HighDiscountPackageController.class); - @Autowired - private UserCenter userCenter; - - @Resource - private CommonService commonService; - - @Resource - private BsCompanyService bsCompanyService; - @Resource private HighDiscountPackageService highDiscountPackageService; 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 8f8c333c..f667a8a1 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 @@ -9,6 +9,7 @@ import com.hai.config.DataUtilConfig; import com.hai.config.QianZhuConfig; import com.hai.entity.*; import com.hai.openApi.config.PriceComputeConfig; +import com.hai.openApi.service.ApiBlxCouponService; import com.hai.openApi.service.ApiMchProductService; import com.hai.openApi.service.ApiOrderCreateHandleService; import com.hai.openApi.type.OperatorTypeEnum; @@ -47,6 +48,9 @@ public class ApiOrderCreateHandleServiceImpl implements ApiOrderCreateHandleServ @Resource private ApiProductService apiProductService; + @Resource + private ApiBlxCouponService apiBlxCouponService; + @Override public ApiOrder oilHandle(JSONObject object) throws Exception { @@ -349,6 +353,20 @@ public class ApiOrderCreateHandleServiceImpl implements ApiOrderCreateHandleServ // 查询api商户 ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId")); + ApiBlxCoupon apiBlxCoupon = apiBlxCouponService.findBlxCoupon(object.getString("couponCode")); + + // 查询折扣比例 + Map mapProduct = new HashMap<>(); + mapProduct.put("mchId" , object.getString("merchId")); + mapProduct.put("productType" , OrderProductType.PRODUCT_TYPE13.getNumber()); + + ApiMchProduct apiMchProducts = apiMchProductService.findByMap(mapProduct); + + BigDecimal priceTotal = new BigDecimal(0); + BigDecimal facePrice = new BigDecimal(0); + + + 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 934dc356..4dc3a69c 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 @@ -203,8 +203,9 @@ public class ApiOrderServiceImpl implements ApiOrderService { orderService.createOrder(createOrderModel); } - // 处理话费充值订单 + // 处理停车券订单 if (OrderProductType.PRODUCT_TYPE13.getNumber().equals(object.getInteger("productType"))) { + apiOrder = orderCreateHandleService.mobileHandle(object); // 组装子订单内容 @@ -222,9 +223,11 @@ public class ApiOrderServiceImpl implements ApiOrderService { // 组装订单 createOrderModel.getChildOrderList().add(createOrderChildModel); orderService.createOrder(createOrderModel); + } + apiOrder.setOrderNo(createOrderModel.getOrderNo()); apiOrder.setStatus(1); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighUserCardServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighUserCardServiceImpl.java index 667566d7..1d54689a 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighUserCardServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighUserCardServiceImpl.java @@ -174,21 +174,26 @@ public class HighUserCardServiceImpl implements HighUserCardService { @Override public Integer getBlxCouponBalance(String phone) { - if (phone == null) { - return 0; - } + try { + if (phone == null) { + return 0; + } - JSONObject jsonObject = new JSONObject(); - jsonObject.put("userMobile" , phone); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("userMobile" , phone); - JSONObject object = blxConfig.getUserCouponPage(jsonObject); + JSONObject object = blxConfig.getUserCouponPage(jsonObject); - int num = 0; + int num = 0; - if (object.getInteger("code") == 1) { - num = object.getJSONObject("data").getInteger("total"); + if (object.getInteger("code") == 1) { + num = object.getJSONObject("data").getInteger("total"); + } + + return num; + } catch (Exception e) { + return 0; } - return num; } }