Explorar o código

海博订单模块

fubojin hai 5 días
pai
achega
4674216e1d

+ 13 - 0
yami-shop-api/src/main/java/com/yami/shop/api/controller/OrderController.java

@@ -24,6 +24,7 @@ import com.yami.shop.common.exception.GlobalException;
 import com.yami.shop.common.util.Arith;
 import com.yami.shop.security.api.util.SecurityUtils;
 import com.yami.shop.service.*;
+import com.yami.shop.service.hb.IHBOrderService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiOperation;
@@ -61,6 +62,9 @@ public class OrderController {
     @Autowired
     private IQnhService qnhService;
 
+    @Autowired
+    private IHBOrderService hbOrderService;
+
     /**
      * 生成订单
      */
@@ -290,6 +294,15 @@ public class OrderController {
             basketService.removeShopCartItemsCacheByUserId(userId);
         }
         orderService.removeConfirmOrderCache(userId + submitOrderParam.getUuid());
+
+
+        for (Order order : orders) {
+            //推送海博订单
+            if (!order.getNextPay()) {
+                hbOrderService.createOrderAsync(order.getOrderNumber());
+            }
+        }
+
         return ResponseEntity.ok(new OrderNumbersDto(orderNumbers.toString(), mergerOrder.getNextPay()));
     }
 

+ 3 - 3
yami-shop-api/src/main/java/com/yami/shop/api/controller/OrderRefundController.java

@@ -326,9 +326,9 @@ public class OrderRefundController {
         if (!orderRefundService.checkRefundDate(order)) {
             throw new GlobalException("当前订单已确认收货超过" + Constant.MAX_FINALLY_REFUND_TIME + "天,无法退款");
         }
-        if (Objects.equals(order.getOrderType(), Constant.ORDER_TYPE_SCORE)) {
-            throw new GlobalException("积分商品,无法退款");
-        }
+//        if (Objects.equals(order.getOrderType(), Constant.ORDER_TYPE_SCORE)) {
+//            throw new GlobalException("积分商品,无法退款");
+//        }
         if (Objects.equals(orderRefundParam.getRefundType(), RefundType.ALL.value()) && (!Objects.isNull(order.getRefundStatus()) && !Objects.equals(order.getRefundStatus(), RefundStatusEnum.DISAGREE.value()))) {
             throw new GlobalException("该订单已有商品正在退款中,不能再进行整单退款");
         }

+ 2 - 1
yami-shop-bean/src/main/java/com/yami/shop/bean/model/OrderRefund.java

@@ -101,7 +101,8 @@ public class OrderRefund implements Serializable{
      */
     private String photoFiles;
     /**
-     * 处理退款状态:(1.买家申请 2.卖家接受 3.买家发货 4.卖家收货 5.退款成功 6.买家撤回申请 7.商家拒绝 -1.退款关闭)详情见ReturnMoneyStsType
+     * 退款单状态 10:待审核 20:处理中 30:驳回退款 40:撤销退款 60:待退货(一审同意) 65:待确认收货(二审待审核) 70:退款完成
+     *
      */
     private Integer returnMoneySts;
     /**

+ 4 - 0
yami-shop-common/src/main/java/com/yami/shop/common/exception/GlobalException.java

@@ -1,8 +1,10 @@
 package com.yami.shop.common.exception;
 
+import com.esotericsoftware.minlog.Log;
 import com.yami.shop.common.util.IBasicInfo;
 import lombok.Getter;
 import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
 
 /**
  * <p>TODO</p>
@@ -11,6 +13,7 @@ import lombok.Setter;
  * @version 1.0.0
  * @since 2025-08-26
  */
+@Slf4j
 @Setter
 @Getter
 public class GlobalException extends RuntimeException {
@@ -43,6 +46,7 @@ public class GlobalException extends RuntimeException {
 
     public GlobalException(String errorMsg) {
         super(errorMsg);
+        log.error(errorMsg, this);
         this.errorMsg = errorMsg;
     }
 

+ 1 - 1
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/hb/GoodsController.java

@@ -48,7 +48,7 @@ public class GoodsController {
     @ApiOperation(value = "修改商品信息", notes = "海博新增商品信息回调接口")
     public HBR updateGoods(@RequestBody JSONObject HBRequest) {
         log.info("海博变更商品{}",HBRequest);
-        return goodsService.updateGoods(HBRequest);
+        return goodsService.addHBGoods(HBRequest);
     }
 
     /**

+ 11 - 9
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/hb/HBOrderRefundController.java

@@ -32,7 +32,7 @@ public class HBOrderRefundController {
 
     //*************************** 售后接口 ***************************
     /**
-     * 创建退款单上行)
+     * 创建退款单(上行)
      * 海博售后订单创建接口-推送接口
      *
      * @param channelOrderId 海博订单单号
@@ -44,6 +44,16 @@ public class HBOrderRefundController {
         return HBR.success(orderRefundService.createRefundOrder(channelOrderId,afterSaleOrder));
     }
 
+    /**
+     * 查询退款单详情(下行)-回调接口
+     */
+    @PostMapping("/details")
+    public HBR details(@RequestBody JSONObject hBRequest) {
+        log.info("查询退款单详情{}",hBRequest);
+        return orderRefundService.details(hBRequest);
+    }
+
+
     /**
      * 退款-退款单状态同步(上行)
      * @param afterSaleOrder  退款单号
@@ -54,14 +64,6 @@ public class HBOrderRefundController {
         return HBR.success(orderRefundService.changeStatus(afterSaleOrder));
     }
 
-    /**
-     * 查询退款单详情(下行)-回调接口
-     */
-    @PostMapping("/details")
-    public HBR details(@RequestBody JSONObject hBRequest) {
-        log.info("进入海博查询订单详情接口{}",hBRequest);
-        return orderRefundService.details(hBRequest);
-    }
 
     /**
      * 商家审核(下行)-回调接口

+ 25 - 19
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBGoodsService.java

@@ -77,7 +77,7 @@ public class HBGoodsService implements IHBGoodsService {
                     setSpuMapper(productInfo, productAdd);
                     Product productInfoById = productMapper.selectByHbSpuId(hbSpuId);
 
-                    if (ObjectUtil.isNotEmpty(productInfoById) && productInfoById.getIsDelete() == 0) {
+                    if (ObjectUtil.isNotEmpty(productInfoById)) {
                         prodId = productInfoById.getProdId();
                         log.info("商品spuID={},spuName={}已经存在,修改商品", productInfo.getLong("spuId"), productInfo.getString("spuName"));
                         productAdd.setProdId(productInfoById.getProdId());
@@ -519,28 +519,34 @@ public class HBGoodsService implements IHBGoodsService {
             String ztFrontCategoryCodeLevel = jsonObject.getString("ztFrontCategoryCodeLevel2");
             if (StringUtils.isEmpty(ztFrontCategoryCodeLevel)) {
                 ztFrontCategoryCodeLevel = jsonObject.getString("ztFrontCategoryCode");
+            }else {
+                //如果是二级,一级对应商品不存在也需要添加
+                addCategoryProd(spuId, ztFrontCategoryCodeLevel);
+                ztFrontCategoryCodeLevel = jsonObject.getString("ztFrontCategoryCode");
             }
-//            FrontCategory frontCategory = frontCategoryMapper.selectOne(new LambdaQueryWrapper<FrontCategory>()
-//                    .eq(FrontCategory::getCode, ztFrontCategoryCodeLevel));
-
-            CategoryProd categoryProd = new CategoryProd();
-            categoryProd.setCode(ztFrontCategoryCodeLevel);
-            categoryProd.setProdId(spuId);
-            categoryProd.setIsDelete(0);
-            CategoryProd integer = categoryProdMapper.selectOne(new LambdaQueryWrapper<CategoryProd>()
-                    .eq(CategoryProd::getProdId, spuId)
-                    .eq(CategoryProd::getIsDelete, 0)
-                    .eq(CategoryProd::getCode, ztFrontCategoryCodeLevel));
-            if (integer != null) {
-                categoryProd.setId(integer.getId());
-                categoryProdMapper.updateById(categoryProd);
-                log.info("商品对应分类已存在{}", categoryProd);
-            } else {
-                categoryProdMapper.insert(categoryProd);
-            }
+            addCategoryProd(spuId, ztFrontCategoryCodeLevel);
+
 
         }
     }
 
+    private void addCategoryProd(Long spuId, String ztFrontCategoryCodeLevel) {
+        CategoryProd categoryProd = new CategoryProd();
+        categoryProd.setCode(ztFrontCategoryCodeLevel);
+        categoryProd.setProdId(spuId);
+        categoryProd.setIsDelete(0);
+        CategoryProd integer = categoryProdMapper.selectOne(new LambdaQueryWrapper<CategoryProd>()
+                .eq(CategoryProd::getProdId, spuId)
+                .eq(CategoryProd::getIsDelete, 0)
+                .eq(CategoryProd::getCode, ztFrontCategoryCodeLevel));
+        if (integer != null) {
+            categoryProd.setId(integer.getId());
+            categoryProdMapper.updateById(categoryProd);
+            log.info("商品对应分类已存在{}", categoryProd);
+        } else {
+            categoryProdMapper.insert(categoryProd);
+        }
+    }
+
 
 }

+ 195 - 11
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBOrderService.java

@@ -1,34 +1,37 @@
 package com.yami.shop.service.hb.impl;
 
+import cn.hutool.core.lang.Snowflake;
+import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.yami.shop.bean.app.param.OrderRefundParam;
 import com.yami.shop.bean.dto.hb.*;
-import com.yami.shop.bean.enums.DvyType;
-import com.yami.shop.bean.enums.OrderStatus;
+import com.yami.shop.bean.enums.*;
 import com.yami.shop.bean.model.*;
+import com.yami.shop.common.config.Constant;
 import com.yami.shop.common.exception.GlobalException;
+import com.yami.shop.common.util.Arith;
+import com.yami.shop.common.util.CommonUtils;
 import com.yami.shop.common.util.hb.HBR;
 import com.yami.shop.dao.*;
-import com.yami.shop.service.SkuService;
-import com.yami.shop.service.UserAddrOrderService;
-import com.yami.shop.service.UserAddrService;
-import com.yami.shop.service.UserService;
+import com.yami.shop.service.*;
 import com.yami.shop.service.hb.IHBOrderService;
+import com.yami.shop.utils.CullenUtils;
 import com.yami.shop.utils.HBSignUtil;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestBody;
 
+import javax.validation.Valid;
 import java.time.Instant;
 import java.time.LocalDate;
 import java.time.ZoneId;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
 
 import static com.yami.shop.common.util.HttpUtil.post;
 
@@ -54,6 +57,12 @@ public class HBOrderService implements IHBOrderService {
     private final ProductMapper productMapper;
     private final SkuMapper skuMapper;
     private final OrderRiderLocationMapper orderRiderLocationMapper;
+    private final OrderRefundService orderRefundService;
+    private final OrderItemService orderItemService;
+    private final OrderService orderService;
+    private final OrderRefundSkuMapper orderRefundSkuMapper;
+    private final Snowflake snowflake;
+
 
     public HBR addHBGoods(JSONObject hbRequest) {
         try {
@@ -197,6 +206,33 @@ public class HBOrderService implements IHBOrderService {
         orderMapper.updateById(order);
 
 
+        //取消订单
+        if (operatorType == 60) {
+            log.info("取消订单{}", channelOrderId);
+            changeOrderStatus(channelOrderId, 60);
+            //创建退款单
+            OrderRefundParam orderRefundParam = new OrderRefundParam();
+            orderRefundParam.setOrderNumber(order.getOrderNumber());
+            orderRefundParam.setApplyType(1);
+            orderRefundParam.setRefundType(1);
+            orderRefundParam.setIsReceiver(false);
+            orderRefundParam.setBuyerReason("17");
+            orderRefundParam.setBuyerDesc(bodyJson.getString("remark"));
+            orderRefundParam.setBuyerMobile(order.getUserMobile());
+            orderRefundParam.setPhotoFiles("");
+
+//            List<OrderRefundSku> orderRefundSkuList = new ArrayList<>();
+//            OrderRefundSku orderRefundSku = new OrderRefundSku();
+//            orderRefundSku.setOrderItemId(order.getOrderItem().getId());
+//            orderRefundSku.setSkuId(order.getOrderItem().getSkuId());
+//            orderRefundSku.setProductCount(order.getOrderItem().getProductCount());
+//            orderRefundSku.setSkuPrice(order.getOrderItem().getSkuPrice());
+//            orderRefundSkuList.add(orderRefundSku);
+//            orderRefundParam.setOrderRefundSkuList(orderRefundSkuList);
+            applyAgain(orderRefundParam);
+
+            //
+        }
         //成功直接通知海博
         if (operatorType == 70) {
             changeOrderStatus(channelOrderId, 80);
@@ -268,11 +304,12 @@ public class HBOrderService implements IHBOrderService {
             log.error("系统订单信息查询不到,单号:{}", bodyJson.getString("channelOrderId"));
             return HBR.error("系统订单信息查询不到,单号:" + bodyJson.getString("channelOrderId"));
         }
+
         CreateOrderRequest createOrderRequest = new CreateOrderRequest();
         createOrderRequest.setChannelOrderId(order.getOrderNumber());
         createOrderRequest.setViewOrderId(order.getOrderNumber());
         createOrderRequest.setOrderStatus(20);
-//        createOrderRequest.setDaySeq(Order.getDaySeq());门店流水号
+//      createOrderRequest.setDaySeq(Order.getDaySeq());门店流水号
 
         ShopDetail shopDetail = shopDetailMapper.selectById(order.getShopId());
         createOrderRequest.setOutStationNo(shopDetail.getOutStationNo());
@@ -456,6 +493,153 @@ public class HBOrderService implements IHBOrderService {
         }
     }
 
+
+    /**
+     * 生成退款单 请求
+     *
+     * @param orderRefundParam 退款单数据
+     * @return
+     */
+    private ResponseEntity<String> applyAgain(OrderRefundParam orderRefundParam) {
+        log.info(" 海博申请退款参数:{}", JSONObject.toJSONString(orderRefundParam));
+        List<OrderRefundSku> orderRefundSkuList = orderRefundParam.getOrderRefundSkuList();
+
+        Order order = orderMapper.getOrderAndOrderItemByOrderNumber(orderRefundParam.getOrderNumber());
+
+        if (!Objects.equals(order.getIsPayed(), 1)) {
+            throw new GlobalException("当前订单还未付款,无法申请");
+        }
+
+        if (!orderRefundService.checkRefundDate(order)) {
+            throw new GlobalException("当前订单已确认收货超过" + Constant.MAX_FINALLY_REFUND_TIME + "天,无法退款");
+        }
+
+        if (Objects.equals(orderRefundParam.getRefundType(), RefundType.ALL.value()) && (!Objects.isNull(order.getRefundStatus()) && !Objects.equals(order.getRefundStatus(), RefundStatusEnum.DISAGREE.value()))) {
+            throw new GlobalException("该订单已有商品正在退款中,不能再进行整单退款");
+        }
+
+        OrderRefund newOrderRefund = new OrderRefund();
+
+        // 获取所有正在进行中的退款订单
+        List<OrderRefund> orderRefunds = orderRefundService.getProcessingOrderRefundByOrderId(order.getOrderId());
+
+        for (OrderRefund orderRefund : orderRefunds) {
+            if (Objects.equals(RefundType.ALL.value(), orderRefund.getRefundType())) {
+                throw new GlobalException("该订单正在进行整单退款,无法进行新的退款操作");
+            }
+
+//            if (Objects.equals(orderRefund.getOrderItemId(), orderRefundParam.getOrderItemId())) {
+//                throw new GlobalException("该商品正在进行退款中,无法进行新的退款操作");
+//            }
+        }
+
+        // 如果存在分销订单,则计算分销总金额
+        List<OrderItem> orderItemList = orderItemService.getOrderItemsByOrderNumber(order.getOrderNumber());
+        // 判断退款单类型(1:整单退款,2:单个物品退款)
+
+        if (orderRefundParam.getRefundType().equals(RefundType.ALL.value())) {
+            // 全部物品退款
+            // 计算该订单项的分销金额
+            newOrderRefund.setDistributionTotalAmount(orderService.sumTotalDistributionAmountByOrderItem(orderItemList));
+            // 计算平台退款金额(退款时将这部分钱退回给平台,所以商家要扣除从平台这里获取的金额)
+            newOrderRefund.setPlatformRefundAmount(order.getPlatformAmount());
+            newOrderRefund.setOrderItemId(0L);
+        } else {
+            CullenUtils.validateDataThrowException(orderRefundSkuList.isEmpty(), "退款商品不能为空...");
+            // 部分物品退款
+            OrderItem orderItem = orderItemService.getOne(new LambdaQueryWrapper<OrderItem>()
+                    .eq(OrderItem::getOrderItemId, orderRefundParam.getOrderItemId())
+                    .eq(OrderItem::getOrderNumber, orderRefundParam.getOrderNumber()));
+            if (orderItem == null) {
+                throw new GlobalException("该物品在订单中不存在");
+            }
+            boolean isCanRefund = false;
+            //  查看是否有支付金额和积分都为空的订单,有则抛出异常
+            for (OrderItem item : orderItemList) {
+                if (item.getActualTotal() <= 0.0 && item.getUseScore() <= 0.0) {
+                    isCanRefund = true;
+                    break;
+                }
+            }
+            if (isCanRefund) {
+                throw new GlobalException("该订单部分订单项支付金额和积分为0,无法使用部分退款!");
+            }
+
+            if (order.getPlatformAmount() > 0 && !Arith.isEquals(orderRefundParam.getRefundAmount(), orderItem.getActualTotal())) {
+                throw new GlobalException("该订单有使用平台优惠,无法使用部分退款!");
+            }
+            // 计算该订单项的分销金额
+            newOrderRefund.setDistributionTotalAmount(orderService.sumTotalDistributionAmountByOrderItem(Collections.singletonList(orderItem)));
+
+            // 计算平台退款金额(退款时将这部分钱退回给平台,所以商家要扣除从平台这里获取的金额)
+            newOrderRefund.setPlatformRefundAmount(orderItem.getPlatformShareReduce());
+
+            // 退款物品数量为null或者0时,则为退款全部数量
+            if (orderRefundParam.getGoodsNum() <= 0) {
+                orderRefundParam.setGoodsNum(orderItem.getProdCount());
+            }
+
+            // 判断退款数量是否溢出
+            if (orderRefundParam.getGoodsNum() > orderItem.getProdCount()) {
+                throw new GlobalException("退款物品数量已超出订单中的数量,不允许申请");
+            }
+
+            // 判断退款金额是否超出订单金额
+            double refundSingleAmount = Arith.div(orderRefundParam.getRefundAmount(), orderRefundParam.getGoodsNum(), 3);
+            double singleAmount = Arith.div(orderItem.getActualTotal(), orderItem.getProdCount(), 3);
+            if (refundSingleAmount > orderItem.getProductTotalAmount() || refundSingleAmount > singleAmount) {
+                throw new GlobalException("退款金额已超出订单金额,无法申请");
+            }
+
+            newOrderRefund.setOrderItemId(orderRefundParam.getOrderItemId());
+            // 待发货状态-最后一件商品进行退款,退款金额 =  商品金额 + 订单运费金额
+            if (Objects.equals(order.getHbOrderStatus(), OrderStatus.PADYED.value()) && order.getFreightAmount() > 0) {
+                int orderItenCount = orderItemService.count(new LambdaQueryWrapper<OrderItem>().eq(OrderItem::getOrderNumber, order.getOrderNumber()));
+                if (Objects.equals(orderRefunds.size(), orderItenCount - 1)) {
+                    newOrderRefund.setRefundAmount(Arith.add(newOrderRefund.getRefundAmount(), order.getFreightAmount()));
+                }
+            }
+        }
+
+        newOrderRefund.setShopId(order.getShopId());
+        newOrderRefund.setUserId(order.getUserId());
+        newOrderRefund.setOrderId(order.getOrderId());
+        newOrderRefund.setOrderNumber(order.getOrderNumber());
+        newOrderRefund.setRefundSn(String.valueOf(snowflake.nextId()));
+        newOrderRefund.setRefundType(orderRefundParam.getRefundType());
+
+        newOrderRefund.setRefundAmount(orderRefundParam.getRefundAmount());
+
+
+        newOrderRefund.setGoodsNum(orderRefundParam.getGoodsNum());
+        newOrderRefund.setApplyType(orderRefundParam.getApplyType());
+        if (Objects.equals(orderRefundParam.getApplyType(), 2)) {
+            newOrderRefund.setIsReceiver(true);
+        } else {
+            newOrderRefund.setIsReceiver(orderRefundParam.getIsReceiver());
+        }
+        newOrderRefund.setBuyerReason(orderRefundParam.getBuyerReason());
+        newOrderRefund.setBuyerDesc(orderRefundParam.getBuyerDesc());
+        newOrderRefund.setBuyerMobile(orderRefundParam.getBuyerMobile());
+        newOrderRefund.setPhotoFiles(orderRefundParam.getPhotoFiles());
+        newOrderRefund.setReturnMoneySts(ReturnMoneyStsType.APPLY.value());
+        newOrderRefund.setApplyTime(new Date());
+        newOrderRefund.setUpdateTime(new Date());
+        log.info("生成退款单:{}", newOrderRefund);
+        OrderRefund orderRefund = orderRefundService.applyRefund(newOrderRefund);
+        if (ObjectUtil.isNotEmpty(orderRefundSkuList)) {
+            orderRefundSkuList.forEach(c -> {
+                c.setOrderRefundId(orderRefund.getRefundId());
+                orderRefundSkuMapper.insert(c);
+            });
+        }
+
+//        orderRefundService.removeById(refundId);
+//        orderRefundSkuMapper.delete(new LambdaQueryWrapper<OrderRefundSku>().eq(OrderRefundSku::getOrderRefundId,refundId));
+        return ResponseEntity.ok(newOrderRefund.getRefundSn());
+    }
+
+
     private boolean isPaymentOver7Days(Date paymentDate) {
         // 1. 将支付时间转换为 Instant
         Instant paymentInstant = paymentDate.toInstant();

+ 9 - 1
yami-shop-service/src/main/java/com/yami/shop/service/impl/OrderRefundServiceImpl.java

@@ -33,6 +33,7 @@ import com.yami.shop.common.util.Arith;
 import com.yami.shop.common.util.hb.HBR;
 import com.yami.shop.dao.*;
 import com.yami.shop.service.*;
+import com.yami.shop.service.hb.IHBOrderService;
 import com.yami.shop.utils.HBSignUtil;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -989,10 +990,11 @@ public class OrderRefundServiceImpl extends ServiceImpl<OrderRefundMapper, Order
         try {
             JSONObject bodyStr = hBRequest.getJSONObject("body");
             log.info("退款订单信息,body:{}", bodyStr);
+            String channelOrderId = bodyStr.getString("channelOrderId");
             OrderRefund orderRefund = orderRefundMapper.selectOne(new LambdaQueryWrapper<OrderRefund>().eq(OrderRefund::getRefundSn, bodyStr.getString("afterSaleOrder")));
             ShopDetail shopDetailByShopId = shopDetailService.getShopDetailByShopId(orderRefund.getShopId());
 
-            thirdPartyRefundRequest.setChannelOrderId(bodyStr.getString("channelOrderId"));
+            thirdPartyRefundRequest.setChannelOrderId(channelOrderId);
             thirdPartyRefundRequest.setOutStationNo(shopDetailByShopId.getHbStationNo());
             thirdPartyRefundRequest.setAfterSaleOrder(orderRefund.getRefundSn());
             thirdPartyRefundRequest.setSaleType(2);
@@ -1040,11 +1042,17 @@ public class OrderRefundServiceImpl extends ServiceImpl<OrderRefundMapper, Order
             orderPaymentRequests.add(orderPaymentRequest);
             thirdPartyRefundRequest.setOrderPayments(orderPaymentRequests);
             log.info("退款订单信息,参数:{}", thirdPartyRefundRequest);
+
+
+            // 返回退款单信息
+            changeStatus(orderRefund.getRefundSn());
+
         } catch (Exception e) {
             log.error("海博退款订单查询异常:{}", e);
             HBR.error("未知异常");
         }
 
+
         return HBR.success(thirdPartyRefundRequest);
     }
 

+ 1 - 7
yami-shop-service/src/main/java/com/yami/shop/service/impl/OrderServiceImpl.java

@@ -88,7 +88,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
     private Snowflake snowflake;
 
 
-    private final IHBOrderService hbOrderService;
 
 
     @Override
@@ -216,12 +215,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         if (mergerOrder.getIsScorePay() != null && mergerOrder.getIsScorePay() == 1) {
             eventPublisher.publishEvent(new SubmitScoreOrderEvent(mergerOrder, orderList));
         }
-        for (Order order : orderList) {
-            //推送海博订单
-            if (!order.getNextPay()) {
-                hbOrderService.createOrderAsync(order.getOrderNumber());
-            }
-        }
+
         return orderList;
     }