فهرست منبع

Merge remote-tracking branch 'origin/master'

yfh 2 روز پیش
والد
کامیت
f4f99ad87f
26فایلهای تغییر یافته به همراه675 افزوده شده و 57 حذف شده
  1. 57 19
      fs-admin/src/main/java/com/fs/hisStore/task/ErpTask.java
  2. 13 0
      fs-company-app/src/main/java/com/fs/app/controller/FsUserCourseVideoController.java
  3. 7 0
      fs-service/src/main/java/com/fs/erp/service/IErpOrderService.java
  4. 26 0
      fs-service/src/main/java/com/fs/erp/service/impl/DfOrderServiceImpl.java
  5. 26 0
      fs-service/src/main/java/com/fs/erp/service/impl/ErpOrderServiceImpl.java
  6. 26 0
      fs-service/src/main/java/com/fs/erp/service/impl/HzOMSErpOrderServiceImpl.java
  7. 276 0
      fs-service/src/main/java/com/fs/erp/service/impl/JSTErpOrderServiceImpl.java
  8. 26 0
      fs-service/src/main/java/com/fs/erp/service/impl/K9OrderScrmServiceImpl.java
  9. 26 0
      fs-service/src/main/java/com/fs/erp/service/impl/WdtErpOrderServiceImpl.java
  10. 7 0
      fs-service/src/main/java/com/fs/his/param/FsStoreProductAddEditParam.java
  11. 10 0
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreProductScrm.java
  12. 1 0
      fs-service/src/main/java/com/fs/hisStore/enums/OrderInfoEnum.java
  13. 9 0
      fs-service/src/main/java/com/fs/hisStore/param/FsStoreProductAddEditParam.java
  14. 1 1
      fs-service/src/main/java/com/fs/live/mapper/LiveCouponMapper.java
  15. 0 8
      fs-service/src/main/java/com/fs/live/mapper/LiveOrderMapper.java
  16. 2 0
      fs-service/src/main/java/com/fs/live/service/ILiveService.java
  17. 1 1
      fs-service/src/main/java/com/fs/live/service/impl/LiveAfterSalesServiceImpl.java
  18. 31 24
      fs-service/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java
  19. 85 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java
  20. 1 0
      fs-service/src/main/java/com/fs/live/vo/LiveDataListVo.java
  21. 1 0
      fs-service/src/main/java/com/fs/live/vo/LiveDataStatisticsVo.java
  22. 6 1
      fs-service/src/main/resources/application-config-druid-bjzm-test.yml
  23. 6 0
      fs-service/src/main/resources/application-config-druid-bjzm.yml
  24. 16 3
      fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml
  25. 12 0
      fs-service/src/main/resources/mapper/live/LiveOrderMapper.xml
  26. 3 0
      fs-user-app/src/main/java/com/fs/app/controller/live/LiveOrderController.java

+ 57 - 19
fs-admin/src/main/java/com/fs/hisStore/task/ErpTask.java

@@ -7,6 +7,8 @@ import com.fs.erp.mapper.FsErpFinishPushMapper;
 import com.fs.erp.service.IErpOrderService;
 import com.fs.hisStore.domain.FsStoreOrderScrm;
 import com.fs.hisStore.service.IFsStoreOrderScrmService;
+import com.fs.live.domain.LiveOrder;
+import com.fs.live.service.ILiveOrderService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -27,6 +29,9 @@ public class ErpTask {
     @Autowired
     private IFsStoreOrderScrmService fsStoreOrderService;
 
+    @Autowired
+    private ILiveOrderService liveOrderService;
+
 
     /**
      * 推送完成订单到ERP
@@ -35,34 +40,67 @@ public class ErpTask {
         List<FsErpFinishPush> fsErpFinishPushes = fsErpFinishPushMapper.queryPenddingOrder();
         for (FsErpFinishPush fsErpFinishPush : fsErpFinishPushes) {
             FsStoreOrderScrm fsStoreOrder = fsStoreOrderService.selectFsStoreOrderById(fsErpFinishPush.getOrderId());
+            if (fsStoreOrder != null) {
+                try {
 
-            try {
-
-                ErpOrder erpOrder = fsStoreOrderService.getErpOrder(fsStoreOrder);
+                    ErpOrder erpOrder = fsStoreOrderService.getErpOrder(fsStoreOrder);
 
-                ErpOrderResponse erpOrderResponse = erpOrderService.finishOrder(erpOrder);
+                    ErpOrderResponse erpOrderResponse = erpOrderService.finishOrder(erpOrder);
 
-                fsErpFinishPush.setParams(erpOrderResponse.getRequestRawData());
-                fsErpFinishPush.setResult(erpOrderResponse.getResponseRawData());
-                fsErpFinishPush.setUpdateTime(new Date());
+                    fsErpFinishPush.setParams(erpOrderResponse.getRequestRawData());
+                    fsErpFinishPush.setResult(erpOrderResponse.getResponseRawData());
+                    fsErpFinishPush.setUpdateTime(new Date());
 
-                if(erpOrderResponse.getSuccess()!= null && erpOrderResponse.getSuccess()){
-                    fsErpFinishPush.setTaskStatus(1);
+                    if(erpOrderResponse.getSuccess()!= null && erpOrderResponse.getSuccess()){
+                        fsErpFinishPush.setTaskStatus(1);
 
-                    log.error("推送完成订单到ERP成功! 订单号: {}",fsErpFinishPush.getOrderId());
-                } else {
-                    fsErpFinishPush.setTaskStatus(2);
+                        log.error("推送完成订单到ERP成功! 订单号: {}",fsErpFinishPush.getOrderId());
+                    } else {
+                        fsErpFinishPush.setTaskStatus(2);
+                        fsErpFinishPush.setRetryCount(fsErpFinishPush.getRetryCount()+1);
+                        log.error("推送完成订单到ERP失败! 订单号: {}",fsErpFinishPush.getOrderId());
+                    }
+                } catch (Throwable e) {
                     fsErpFinishPush.setRetryCount(fsErpFinishPush.getRetryCount()+1);
-                    log.error("推送完成订单到ERP失败! 订单号: {}",fsErpFinishPush.getOrderId());
+                    fsErpFinishPush.setErrorMessage(ExceptionUtils.getStackTrace(e));
+                    fsErpFinishPush.setTaskStatus(2);
+                    log.error("订单推送失败!原因: {}", ExceptionUtils.getStackTrace(e),e);
+                    continue;
+                }
+            } else {
+                LiveOrder liveOrder = liveOrderService.selectLiveOrderByOrderId(String.valueOf(fsErpFinishPush.getOrderId()));
+                if (liveOrder != null) {
+                    try {
+                        ErpOrder erpOrder = liveOrderService.getErpOrder(liveOrder);
+
+                        ErpOrderResponse erpOrderResponse = erpOrderService.finishOrder(erpOrder);
+
+                        fsErpFinishPush.setParams(erpOrderResponse.getRequestRawData());
+                        fsErpFinishPush.setResult(erpOrderResponse.getResponseRawData());
+                        fsErpFinishPush.setUpdateTime(new Date());
+
+                        if (erpOrderResponse.getSuccess() != null && erpOrderResponse.getSuccess()) {
+                            fsErpFinishPush.setTaskStatus(1);
+
+                            log.error("推送完成订单到ERP成功! 订单号: {}", fsErpFinishPush.getOrderId());
+                        } else {
+                            fsErpFinishPush.setTaskStatus(2);
+                            fsErpFinishPush.setRetryCount(fsErpFinishPush.getRetryCount() + 1);
+                            log.error("推送完成订单到ERP失败! 订单号: {}", fsErpFinishPush.getOrderId());
+                        }
+                    } catch (Throwable e) {
+                        fsErpFinishPush.setRetryCount(fsErpFinishPush.getRetryCount() + 1);
+                        fsErpFinishPush.setErrorMessage(ExceptionUtils.getStackTrace(e));
+                        fsErpFinishPush.setTaskStatus(2);
+                        log.error("订单推送失败!原因: {}", ExceptionUtils.getStackTrace(e), e);
+                        continue;
+                    }
+                } else {
+                    log.error("订单不存在! 订单号: {}",fsErpFinishPush.getOrderId());
+                    continue;
                 }
-            } catch (Throwable e) {
-                fsErpFinishPush.setRetryCount(fsErpFinishPush.getRetryCount()+1);
-                fsErpFinishPush.setErrorMessage(ExceptionUtils.getStackTrace(e));
-                fsErpFinishPush.setTaskStatus(2);
-                log.error("订单推送失败!原因: {}", ExceptionUtils.getStackTrace(e),e);
             }
 
-
             fsErpFinishPushMapper.updateById(fsErpFinishPush);
         }
 

+ 13 - 0
fs-company-app/src/main/java/com/fs/app/controller/FsUserCourseVideoController.java

@@ -33,6 +33,7 @@ import com.fs.im.service.IFsImMsgSendDetailService;
 import com.fs.im.service.IFsImMsgSendLogService;
 import com.fs.im.service.OpenIMService;
 import com.fs.im.vo.FsImMsgSendLogVO;
+import com.fs.live.service.ILiveService;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
@@ -78,6 +79,8 @@ public class FsUserCourseVideoController extends AppBaseController {
 
     @Autowired
     private IFsImMsgSendLogService imMsgSendLogService;
+    @Autowired
+    private ILiveService liveService;
 
     @Autowired
     private ICompanyMiniappService companyMiniappService;
@@ -287,6 +290,16 @@ public class FsUserCourseVideoController extends AppBaseController {
         return ResponseResult.ok(courseLinkService.getGotoWxAppLink(linkStr,appid));
     }
 
+    /**
+     * 获取跳转微信小程序的链接地址
+     */
+    @Login
+    @GetMapping("/getGotoWxAppLiveLink")
+    @ApiOperation("获取跳转微信小程序直播的链接地址")
+    public ResponseResult<String> getGotoWxAppLiveLink(String linkStr,String appid) {
+        return ResponseResult.ok(liveService.getGotoWxAppLiveLink(linkStr,appid));
+    }
+
     @ApiOperation("会员批量发送课程消息")
     @PostMapping("/batchSendCourse")
     public OpenImResponseDTO batchSendCourse(@RequestBody BatchSendCourseDTO batchSendCourseDTO) throws JsonProcessingException {

+ 7 - 0
fs-service/src/main/java/com/fs/erp/service/IErpOrderService.java

@@ -5,6 +5,7 @@ import com.fs.erp.domain.ErpRefundOrder;
 import com.fs.erp.dto.*;
 import com.fs.his.domain.FsStoreOrder;
 import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.live.domain.LiveOrder;
 
 public interface IErpOrderService
 {
@@ -13,19 +14,25 @@ public interface IErpOrderService
 
     ErpOrderResponse addOrderScrm(ErpOrder order);
 
+    ErpOrderResponse addLiveOrder(ErpOrder order);
+
     //用户发起退款,然后后台审核通过后,提交退款单
     ErpOrderResponse refundOrder(ErpRefundOrder order);
     ErpOrderResponse refundOrderScrm(ErpRefundOrder order);
+    ErpOrderResponse refundLiveOrder(ErpRefundOrder order);
     ErpDeliverysResponse getDeliver(ErpDeliverysRequest param);
     ErpOrderQueryResponse getOrder(ErpOrderQueryRequert param);
     ErpOrderQueryResponse getScrmOrder(ErpOrderQueryRequert param);
+    ErpOrderQueryResponse getLiveOrder(ErpOrderQueryRequert param);
     BaseResponse refundUpdate(ErpRefundUpdateRequest param);
     BaseResponse refundUpdateScrm(ErpRefundUpdateRequest param);
+    BaseResponse refundUpdateLive(ErpRefundUpdateRequest param);
 
     ErpOrderResponse finishOrder(ErpOrder order);
     //代服管家查物流状态
     void getOrderDeliveryStatus(FsStoreOrder order);
 
     void getOrderScrmDeliveryStatus(FsStoreOrderScrm order);
+    void getOrderLiveDeliveryStatus(LiveOrder order);
 }
 

+ 26 - 0
fs-service/src/main/java/com/fs/erp/service/impl/DfOrderServiceImpl.java

@@ -51,6 +51,7 @@ import com.fs.hisStore.param.FsStoreAfterSalesParam;
 import com.fs.hisStore.service.IFsExpressScrmService;
 import com.fs.hisStore.service.IFsStoreOrderScrmService;
 import com.fs.hisStore.vo.FsStoreOrderItemVO;
+import com.fs.live.domain.LiveOrder;
 import com.fs.qw.domain.QwExternalContact;
 import com.fs.qw.domain.QwUser;
 import com.fs.qw.mapper.QwUserMapper;
@@ -168,6 +169,11 @@ public class DfOrderServiceImpl implements IErpOrderService {
         return getScrmErpOrderResponse(order);
     }
 
+    @Override
+    public ErpOrderResponse addLiveOrder(ErpOrder order) {
+        return null;
+    }
+
     /**
      * 退款 取消订单
      *
@@ -278,6 +284,11 @@ public class DfOrderServiceImpl implements IErpOrderService {
         return new ErpOrderResponse();
     }
 
+    @Override
+    public ErpOrderResponse refundLiveOrder(ErpRefundOrder order) {
+        return null;
+    }
+
     @Override
     public ErpDeliverysResponse getDeliver(ErpDeliverysRequest request) {
         ErpDeliverysResponse erpDeliverysResponse = new ErpDeliverysResponse();
@@ -428,6 +439,11 @@ public class DfOrderServiceImpl implements IErpOrderService {
         return response;
     }
 
+    @Override
+    public ErpOrderQueryResponse getLiveOrder(ErpOrderQueryRequert param) {
+        return null;
+    }
+
     @Override
     public BaseResponse refundUpdate(ErpRefundUpdateRequest request) {
         ErpRefundOrder erpRefundOrder = new ErpRefundOrder();
@@ -442,6 +458,11 @@ public class DfOrderServiceImpl implements IErpOrderService {
         return refundOrderScrm(erpRefundOrder);
     }
 
+    @Override
+    public BaseResponse refundUpdateLive(ErpRefundUpdateRequest param) {
+        return null;
+    }
+
     @Override
     public ErpOrderResponse finishOrder(ErpOrder order) {
         return null;
@@ -767,6 +788,11 @@ public class DfOrderServiceImpl implements IErpOrderService {
         }
     }
 
+    @Override
+    public void getOrderLiveDeliveryStatus(LiveOrder order) {
+
+    }
+
     private void cancelOrder(FsStoreOrder order) {
         Integer deliveryStatus = order.getDeliveryStatus();
         if (deliveryStatus == null || deliveryStatus == 0) {

+ 26 - 0
fs-service/src/main/java/com/fs/erp/service/impl/ErpOrderServiceImpl.java

@@ -12,6 +12,7 @@ import com.fs.his.config.FsSysConfig;
 import com.fs.his.domain.FsStoreOrder;
 import com.fs.his.utils.ConfigUtil;
 import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.live.domain.LiveOrder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -65,6 +66,11 @@ public class ErpOrderServiceImpl implements IErpOrderService
         return addOrder( order);
     }
 
+    @Override
+    public ErpOrderResponse addLiveOrder(ErpOrder order) {
+        return null;
+    }
+
     @Override
     public ErpOrderResponse refundOrder(ErpRefundOrder order) {
         FsSysConfig sysConfig = configUtil.getSysConfig();
@@ -89,6 +95,11 @@ public class ErpOrderServiceImpl implements IErpOrderService
         return null;
     }
 
+    @Override
+    public ErpOrderResponse refundLiveOrder(ErpRefundOrder order) {
+        return null;
+    }
+
     @Override
     public ErpDeliverysResponse getDeliver(ErpDeliverysRequest request) {
         FsSysConfig sysConfig = configUtil.getSysConfig();
@@ -129,6 +140,11 @@ public class ErpOrderServiceImpl implements IErpOrderService
         return null;
     }
 
+    @Override
+    public ErpOrderQueryResponse getLiveOrder(ErpOrderQueryRequert param) {
+        return null;
+    }
+
     @Override
     public BaseResponse refundUpdate(ErpRefundUpdateRequest request) {
         FsSysConfig sysConfig = configUtil.getSysConfig();
@@ -150,6 +166,11 @@ public class ErpOrderServiceImpl implements IErpOrderService
         return null;
     }
 
+    @Override
+    public BaseResponse refundUpdateLive(ErpRefundUpdateRequest param) {
+        return null;
+    }
+
     @Override
     public ErpOrderResponse finishOrder(ErpOrder order) {
         return null;
@@ -164,4 +185,9 @@ public class ErpOrderServiceImpl implements IErpOrderService
     public void getOrderScrmDeliveryStatus(FsStoreOrderScrm order) {
 
     }
+
+    @Override
+    public void getOrderLiveDeliveryStatus(LiveOrder order) {
+
+    }
 }

+ 26 - 0
fs-service/src/main/java/com/fs/erp/service/impl/HzOMSErpOrderServiceImpl.java

@@ -14,6 +14,7 @@ import com.fs.his.domain.*;
 import com.fs.his.service.*;
 import com.fs.his.utils.PhoneUtil;
 import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.live.domain.LiveOrder;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -69,6 +70,11 @@ public class HzOMSErpOrderServiceImpl implements IErpOrderService {
         return addOrder( order);
     }
 
+    @Override
+    public ErpOrderResponse addLiveOrder(ErpOrder order) {
+        return null;
+    }
+
     @Override
     public ErpOrderResponse refundOrder(ErpRefundOrder order) {
         String orderCode = order.getOrderCode();
@@ -83,6 +89,11 @@ public class HzOMSErpOrderServiceImpl implements IErpOrderService {
         return null;
     }
 
+    @Override
+    public ErpOrderResponse refundLiveOrder(ErpRefundOrder order) {
+        return null;
+    }
+
     @Override
     public ErpDeliverysResponse getDeliver(ErpDeliverysRequest param) {
         return null;
@@ -98,6 +109,11 @@ public class HzOMSErpOrderServiceImpl implements IErpOrderService {
         return null;
     }
 
+    @Override
+    public ErpOrderQueryResponse getLiveOrder(ErpOrderQueryRequert param) {
+        return null;
+    }
+
     @Override
     public BaseResponse refundUpdate(ErpRefundUpdateRequest param) {
 
@@ -167,6 +183,11 @@ public class HzOMSErpOrderServiceImpl implements IErpOrderService {
         return null;
     }
 
+    @Override
+    public BaseResponse refundUpdateLive(ErpRefundUpdateRequest param) {
+        return null;
+    }
+
     @Override
     public ErpOrderResponse finishOrder(ErpOrder order) {
         return null;
@@ -182,6 +203,11 @@ public class HzOMSErpOrderServiceImpl implements IErpOrderService {
 
     }
 
+    @Override
+    public void getOrderLiveDeliveryStatus(LiveOrder order) {
+
+    }
+
     /**
      * 构建瀚智创建订单参数
      *

+ 276 - 0
fs-service/src/main/java/com/fs/erp/service/impl/JSTErpOrderServiceImpl.java

@@ -31,6 +31,10 @@ import com.fs.hisStore.service.IFsStoreOrderScrmService;
 import com.fs.hisStore.service.IFsStoreProductScrmService;
 import com.fs.hisStore.service.impl.FsStoreProductScrmServiceImpl;
 import com.fs.hisStore.vo.FsStoreOrderItemVO;
+import com.fs.live.domain.LiveOrder;
+import com.fs.live.domain.LiveOrderItem;
+import com.fs.live.mapper.LiveOrderItemMapper;
+import com.fs.live.mapper.LiveOrderMapper;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.http.util.Asserts;
@@ -76,6 +80,12 @@ public class JSTErpOrderServiceImpl implements IErpOrderService {
     @Autowired
     private IFsStoreProductScrmService fsStoreProductScrmService;
 
+    @Autowired
+    private LiveOrderMapper liveOrderMapper;
+
+    @Autowired
+    private LiveOrderItemMapper liveOrderItemMapper;
+
     @Override
     public ErpOrderResponse addOrder(ErpOrder order) {
         FsStoreOrder fsStoreOrder = fsStoreOrderService.selectFsStoreOrderByOrderCode(order.getPlatform_code());
@@ -327,7 +337,127 @@ public class JSTErpOrderServiceImpl implements IErpOrderService {
         return erpOrderResponse;
     }
 
+    @Override
+    public ErpOrderResponse addLiveOrder(ErpOrder order) {
+        LiveOrder liveOrder = liveOrderMapper.selectLiveOrderByOrderCode(order.getPlatform_code());
+        log.info("ERP订单号: {}, 订单信息: {}",order.getPlatform_code(), JSON.toJSONString(liveOrder));
+
+        ErpOrderPayment erpOrderPayment = order.getPayments().get(0);
+
+        ShopOrderDTO shopOrderDTO = new ShopOrderDTO();
+
+        shopOrderDTO.setShopId(Long.valueOf(order.getShop_code()));
+        shopOrderDTO.setSoId(order.getPlatform_code());
+        shopOrderDTO.setOrderDate(order.getDeal_datetime());
+        // 待发货
+        shopOrderDTO.setShopStatus(OrderStatusEnum.WAIT_SELLER_SEND_GOODS.name());
+        // 买家账号
+        shopOrderDTO.setShopBuyerId(order.getBuyer_account());
+        // 收货人省份
+        shopOrderDTO.setReceiverState(order.getReceiver_province());
+        // 收货人城市
+        shopOrderDTO.setReceiverCity(order.getReceiver_city());
+        // 收货人区域
+        shopOrderDTO.setReceiverDistrict(order.getReceiver_district());
+        // 收货人详细地址
+        shopOrderDTO.setReceiverAddress(order.getReceiver_address());
+        // 收货人详细地址
+        shopOrderDTO.setReceiverName(order.getReceiver_name());
+        // 收货人电话
+        shopOrderDTO.setReceiverPhone(order.getReceiver_mobile());
+        // 支付金额
+        shopOrderDTO.setPayAmount(erpOrderPayment.getPayment());
+        // 运费 改
+        if (ObjectUtil.isNull(liveOrder.getPayDelivery())) {
+            shopOrderDTO.setFreight(Double.valueOf("0.00"));
+        } else {
+            shopOrderDTO.setFreight(liveOrder.getPayDelivery().doubleValue());
+        }
+        // 备注
+        shopOrderDTO.setRemark(DateUtil.format(new Date(), "dd"));
+        // 买家留言
+        shopOrderDTO.setBuyerMessage(order.getBuyer_memo());
+
+        // 订单商品项列表
+        List<OrderItemDTO> itemDTOList = new ArrayList<>();
+
+        List<LiveOrderItem> liveOrderItems = liveOrderItemMapper.selectLiveOrderItemByOrderId(liveOrder.getOrderId());
+        log.info("liveOrderItems==========>{}",liveOrderItems);
+        for (LiveOrderItem item : liveOrderItems) {
+            OrderItemDTO orderItemDTO = new OrderItemDTO();
+            JSONObject jsonObject = JSON.parseObject(item.getJsonInfo());
+
+            String barCode = jsonObject.getString("barCode");
+            String productName = jsonObject.getString("productName");
+            String sku=jsonObject.getString("sku");
+
+            orderItemDTO.setSkuId(barCode);
+            orderItemDTO.setShopSkuId(barCode);
+            orderItemDTO.setName(productName);
+            orderItemDTO.setShopIId(orderItemDTO.getSkuId());//款式编码ID,当前没有这个目前就与SKU ID一致
+            orderItemDTO.setPropertiesValue(sku);//商品属性
+
+            FsStoreProductScrm fsStoreProduct = fsStoreProductScrmService.selectFsStoreProductById(item.getProductId());
+
+            orderItemDTO.setAmount(fsStoreProduct.getPrice().multiply(new BigDecimal(item.getNum())));
+            orderItemDTO.setPic(fsStoreProduct.getImage());
+            orderItemDTO.setPrice(fsStoreProduct.getPrice());
+            orderItemDTO.setQty(item.getNum().intValue());
+            orderItemDTO.setOuterOiId(String.format("%s%s",liveOrder.getOrderCode(),item.getItemId()));
+            itemDTOList.add(orderItemDTO);
+        }
+        shopOrderDTO.setItems(itemDTOList);
+
+        // 实际支付金额
+        PaymentDTO paymentDTO = new PaymentDTO();
+        paymentDTO.setAmount(liveOrder.getPayMoney().doubleValue());
+        paymentDTO.setOuterPayId(order.getPlatform_code());
+        paymentDTO.setPayDate(order.getDeal_datetime());
+        paymentDTO.setPayment("微信支付");
+        paymentDTO.setBuyerAccount(order.getBuyer_account());
+        paymentDTO.setSellerAccount("平台销售");
+        shopOrderDTO.setPay(paymentDTO);
+
+        // 如果是货到付款
+        if("2".equals(liveOrder.getPayType()) || "3".equals(liveOrder.getPayType())){
+            shopOrderDTO.setIsCod(true);
+            // 货到付款金额 = 物流代收金额-优惠金额
+            //应付金额(货到付款= 订单总金额 - 已付金额)
+            shopOrderDTO.setPayAmount(liveOrder.getTotalPrice().subtract(liveOrder.getPayPrice()).doubleValue());
+
+            // 货到付款要推两次
+            PaymentDTO paymentDTO2 = new PaymentDTO();
+            // 物流代收金额
+            paymentDTO2.setAmount(liveOrder.getTotalPrice().subtract(liveOrder.getPayPrice()).doubleValue());
+            paymentDTO2.setOuterPayId(String.format("%s%d",order.getPlatform_code(),1));
+            paymentDTO2.setPayDate(order.getDeal_datetime());
+            paymentDTO2.setPayment("货到付款");
+            paymentDTO2.setBuyerAccount(order.getBuyer_account());
+            paymentDTO2.setSellerAccount("平台销售");
+            shopOrderDTO.setPay(paymentDTO2);
+
+            FsJstCodPush fsJstCodPush = new FsJstCodPush();
+            fsJstCodPush.setOrderId(liveOrder.getOrderCode());
+            fsJstCodPush.setType("0");
+            fsJstCodPush.setParams(JSON.toJSONString(shopOrderDTO));
+            fsJstCodPush.setRetryCount(0);
+            fsJstCodPush.setTaskStatus(TaskStatusEnum.PENDING.getCode());
+            fsJstCodPushScrmMapper.insert(fsJstCodPush);
+        }
+
+        ErpOrderResponseDTO upload = jstErpHttpService.upload(shopOrderDTO);
+
+        if(CollectionUtils.isEmpty(upload.getDatas())) {
+            log.info("推送ERP返回结果: {}",upload);
+            throw new IllegalArgumentException("推送ERP返回数不应该为0");
+        }
+        ErpOrderResponseDTO.OrderData orderData = upload.getDatas().get(0);
 
+        ErpOrderResponse erpOrderResponse = new ErpOrderResponse();
+        erpOrderResponse.setSuccess(true);
+        erpOrderResponse.setCode(String.valueOf(orderData.getOId()));
+        return erpOrderResponse;
+    }
 
     @Override
     public ErpOrderResponse refundOrder(ErpRefundOrder order) {
@@ -339,6 +469,11 @@ public class JSTErpOrderServiceImpl implements IErpOrderService {
         return null;
     }
 
+    @Override
+    public ErpOrderResponse refundLiveOrder(ErpRefundOrder order) {
+        return null;
+    }
+
     @Override
     public ErpDeliverysResponse getDeliver(ErpDeliverysRequest param) {
         return null;
@@ -402,6 +537,35 @@ public class JSTErpOrderServiceImpl implements IErpOrderService {
 
         return response;
     }
+
+    @Override
+    public ErpOrderQueryResponse getLiveOrder(ErpOrderQueryRequert param) {
+        // 1. 构建查询请求DTO
+        OrderQueryRequestDTO requestDTO = new OrderQueryRequestDTO();
+        requestDTO.setOIds(Collections.singletonList(Long.valueOf(param.getCode())));
+
+        // 2. 调用ERP服务查询订单
+        OrderQueryResponseDTO query = jstErpHttpService.query(requestDTO);
+
+        // 3. 构建响应对象
+        ErpOrderQueryResponse response = new ErpOrderQueryResponse();
+
+        // 4. 设置基本响应信息
+
+        // 5. 转换订单数据
+        if (query.getOrders() != null && !query.getOrders().isEmpty()) {
+            List<ErpOrderQuery> erpOrders = query.getOrders().stream()
+                    .map(this::convertToErpOrderQueryLive)
+                    .collect(Collectors.toList());
+
+            response.setOrders(erpOrders);
+        } else {
+            response.setOrders(Collections.emptyList());
+        }
+
+        return response;
+    }
+
     /**
      * 将OrderQueryResponseDTO.Order转换为ErpOrderQuery
      *
@@ -562,6 +726,80 @@ public class JSTErpOrderServiceImpl implements IErpOrderService {
         return erpOrder;
     }
 
+    private ErpOrderQuery convertToErpOrderQueryLive(OrderQueryResponseDTO.Order order) {
+        ErpOrderQuery erpOrder = new ErpOrderQuery();
+
+        LiveOrder liveOrder = liveOrderMapper.selectLiveOrderByOrderCode(order.getSoId());
+        Asserts.notNull(liveOrder,"该订单号没有找到!");
+
+        // 设置基本订单信息
+        erpOrder.setCode(order.getSoId());
+
+        // 计算订单总数量
+        if (order.getItems() != null && !order.getItems().isEmpty()) {
+            int totalQty = order.getItems().stream()
+                    .mapToInt(OrderQueryResponseDTO.OrderItem::getQty)
+                    .sum();
+            erpOrder.setQty(totalQty);
+        }
+
+        // 设置金额相关信息
+        erpOrder.setAmount(order.getAmount() != null ? order.getAmount().doubleValue() : null);
+        erpOrder.setPayment(order.getPaidAmount() != null ? order.getPaidAmount().doubleValue() : null);
+
+        // 设置其他订单属性
+        erpOrder.setCod(order.getIsCod());
+        erpOrder.setPlatform_code(order.getOrderFrom());
+
+        // 尝试解析创建时间
+        try {
+            if (order.getCreated() != null) {
+                SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                erpOrder.setCreatetime(formatter.parse(order.getCreated()));
+            }
+        } catch (Exception e) {
+            // 日期解析异常处理
+            // 可以记录日志或保持为null
+        }
+
+        // 设置店铺信息
+        erpOrder.setShop_name(order.getShopName());
+        erpOrder.setShop_code(String.valueOf(order.getShopId()));
+
+        // 设置物流信息
+        erpOrder.setExpress_name(order.getLogisticsCompany());
+        erpOrder.setExpress_code(order.getLId());
+
+        // 设置收件人信息
+        erpOrder.setReceiver_name(liveOrder.getUserName());
+        erpOrder.setReceiver_phone(liveOrder.getUserPhone());
+        erpOrder.setReceiver_mobile(liveOrder.getUserPhone());
+
+        // 构建完整地址
+        erpOrder.setReceiver_address(liveOrder.getUserAddress());
+
+        // 如果是已发货
+        if(ObjectUtil.equal(order.getStatus(), ErpQueryOrderStatusEnum.SENT.getCode())){
+            List<ErpDeliverys> deliverysList = new ArrayList<>();
+
+            ErpDeliverys delivery = new ErpDeliverys();
+            delivery.setMail_no(order.getLId());
+            delivery.setExpress_code(order.getLcId());
+            delivery.setExpress_name(order.getLogisticsCompany());
+            delivery.setDelivery(true);
+            delivery.setCode(order.getSoId());
+
+            deliverysList.add(delivery);
+            erpOrder.setDeliverys(deliverysList);
+
+            // 设置发货状态,假设有物流单号就是已发货状态
+            erpOrder.setDelivery_state(1);
+        } else {
+            erpOrder.setDelivery_state(0);
+        }
+
+        return erpOrder;
+    }
 
     @Override
     public BaseResponse refundUpdate(ErpRefundUpdateRequest param) {
@@ -632,6 +870,39 @@ public class JSTErpOrderServiceImpl implements IErpOrderService {
         return baseResponse;
     }
 
+    @Override
+    public BaseResponse refundUpdateLive(ErpRefundUpdateRequest param) {
+        LiveOrder liveOrder = liveOrderMapper.selectLiveOrderByOrderCode(param.getTid());
+        log.info("订单号: {},发货状态: {},是否发货后: {}",liveOrder.getOrderCode(),liveOrder.getStatus(),ObjectUtils.equals(liveOrder.getStatus(),2));
+
+        // 发货后退款
+        if(ObjectUtils.equals(param.getOrderStatus(),2)){
+
+            FsJstAftersalePush fsJstAftersalePush = new FsJstAftersalePush();
+            fsJstAftersalePush.setOrderId(liveOrder.getOrderCode());
+            fsJstAftersalePush.setTaskStatus(com.fs.hisStore.enums.TaskStatusEnum.PENDING.getCode());
+            fsJstAftersalePush.setType(String.valueOf(AfterSalesOrderStatusEnum.WAIT_SELLER_AGREE.getIndex()));
+            fsJstAftersalePush.setRetryCount(0);
+            fsJstAftersalePush.setAfterSaleId(String.valueOf(param.getStoreAfterSalesId()));
+            fsJstAftersalePushScrmMapper.insert(fsJstAftersalePush);
+
+        } else {
+            // 如果是发货前退款,直接走取消订单流程
+            // 如果是发货后退款,走售后流程
+            OrderCancelRequestDTO requestDTO = new OrderCancelRequestDTO();
+            requestDTO.setOIds(Collections.singletonList(Integer.valueOf(liveOrder.getExtendOrderId())));
+            requestDTO.setCancelType("用户退款");
+            requestDTO.setRemark("用户退款");
+
+            jstErpHttpService.cancel(requestDTO);
+        }
+
+        BaseResponse baseResponse = new BaseResponse();
+        baseResponse.setSuccess(true);
+
+        return baseResponse;
+    }
+
     @Override
     public ErpOrderResponse finishOrder(ErpOrder order) {
         return null;
@@ -646,5 +917,10 @@ public class JSTErpOrderServiceImpl implements IErpOrderService {
     public void getOrderScrmDeliveryStatus(FsStoreOrderScrm order) {
 
     }
+
+    @Override
+    public void getOrderLiveDeliveryStatus(LiveOrder order) {
+
+    }
 }
 

+ 26 - 0
fs-service/src/main/java/com/fs/erp/service/impl/K9OrderScrmServiceImpl.java

@@ -22,6 +22,7 @@ import com.fs.hisStore.mapper.FsStoreOrderScrmMapper;
 import com.fs.hisStore.mapper.FsStoreProductScrmMapper;
 import com.fs.hisStore.service.IFsStoreOrderItemScrmService;
 import com.fs.hisStore.vo.FsStoreOrderItemVO;
+import com.fs.live.domain.LiveOrder;
 import lombok.extern.slf4j.Slf4j;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -64,6 +65,11 @@ public class K9OrderScrmServiceImpl implements IErpOrderService {
         return addOmsOrder(order.getPlatform_code());
     }
 
+    @Override
+    public ErpOrderResponse addLiveOrder(ErpOrder order) {
+        return null;
+    }
+
 
     /**
      * 退款
@@ -93,6 +99,11 @@ public class K9OrderScrmServiceImpl implements IErpOrderService {
         return null;
     }
 
+    @Override
+    public ErpOrderResponse refundLiveOrder(ErpRefundOrder order) {
+        return null;
+    }
+
     private KingbosRefundOrderRequest getKingbosRefundOrderRequest(String orderCode) {
         FsStoreOrderScrm order = fsStoreOrderMapper.selectFsStoreOrderByOrderCode(orderCode);
         if (order != null){
@@ -138,6 +149,11 @@ public class K9OrderScrmServiceImpl implements IErpOrderService {
         return null;
     }
 
+    @Override
+    public ErpOrderQueryResponse getLiveOrder(ErpOrderQueryRequert param) {
+        return null;
+    }
+
     @Override
     public BaseResponse refundUpdate(ErpRefundUpdateRequest param) {
         return null;
@@ -148,6 +164,11 @@ public class K9OrderScrmServiceImpl implements IErpOrderService {
         return null;
     }
 
+    @Override
+    public BaseResponse refundUpdateLive(ErpRefundUpdateRequest param) {
+        return null;
+    }
+
 
     /**
      * 退款 运单号已获取到
@@ -460,4 +481,9 @@ public class K9OrderScrmServiceImpl implements IErpOrderService {
     public void getOrderScrmDeliveryStatus(FsStoreOrderScrm order) {
 
     }
+
+    @Override
+    public void getOrderLiveDeliveryStatus(LiveOrder order) {
+
+    }
 }

+ 26 - 0
fs-service/src/main/java/com/fs/erp/service/impl/WdtErpOrderServiceImpl.java

@@ -32,6 +32,7 @@ import com.fs.hisStore.domain.FsStoreProductScrm;
 import com.fs.hisStore.service.IFsStoreOrderItemScrmService;
 import com.fs.hisStore.service.IFsStoreOrderScrmService;
 import com.fs.hisStore.service.IFsStoreProductScrmService;
+import com.fs.live.domain.LiveOrder;
 import com.hc.openapi.tool.util.StringUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
@@ -103,6 +104,11 @@ public class WdtErpOrderServiceImpl implements IErpOrderService {
         return getErpOrderResponseScrm(order);
     }
 
+    @Override
+    public ErpOrderResponse addLiveOrder(ErpOrder order) {
+        return null;
+    }
+
     /**
      * 获取erp推送参数
      * @param order 订单参数
@@ -800,6 +806,11 @@ public class WdtErpOrderServiceImpl implements IErpOrderService {
         return null;
     }
 
+    @Override
+    public ErpOrderResponse refundLiveOrder(ErpRefundOrder order) {
+        return null;
+    }
+
     @Override
     public ErpDeliverysResponse getDeliver(ErpDeliverysRequest param) {
         return null;
@@ -837,6 +848,11 @@ public class WdtErpOrderServiceImpl implements IErpOrderService {
         return null;
     }
 
+    @Override
+    public ErpOrderQueryResponse getLiveOrder(ErpOrderQueryRequert param) {
+        return null;
+    }
+
     @Override
     public BaseResponse refundUpdate(ErpRefundUpdateRequest param) {
         FsSysConfig sysConfig = configUtil.getSysConfig();
@@ -921,6 +937,11 @@ public class WdtErpOrderServiceImpl implements IErpOrderService {
         return null;
     }
 
+    @Override
+    public BaseResponse refundUpdateLive(ErpRefundUpdateRequest param) {
+        return null;
+    }
+
     @Override
     public ErpOrderResponse finishOrder(ErpOrder order) {
         FsSysConfig sysConfig = configUtil.getSysConfig();
@@ -1103,6 +1124,11 @@ public class WdtErpOrderServiceImpl implements IErpOrderService {
 
     }
 
+    @Override
+    public void getOrderLiveDeliveryStatus(LiveOrder order) {
+
+    }
+
     public static String convertToSnakeCase(Object obj) {
         SerializeConfig config = new SerializeConfig();
         config.propertyNamingStrategy = PropertyNamingStrategy.SnakeCase;

+ 7 - 0
fs-service/src/main/java/com/fs/his/param/FsStoreProductAddEditParam.java

@@ -159,6 +159,13 @@ public class FsStoreProductAddEditParam implements Serializable {
     /** 品牌 */
     @Excel(name = "品牌")
     private String brand;
+    /** 品牌 */
+    @Excel(name = "食品生产许可证编码")
+    private String foodProductionLicenseCode;
+
+    /** 退货地址 */
+    @Excel(name = "退货地址")
+    private String returnAddress;
 
     //属性项目
     private List<ProductArrtDTO> items;

+ 10 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreProductScrm.java

@@ -306,8 +306,18 @@ public class FsStoreProductScrm extends BaseEntity
     @Excel(name = "品牌")
     private String brand;
 
+    /** 食品生产许可证编码 */
+    @Excel(name = "食品生产许可证编码")
+    private String foodProductionLicenseCode;
 
     @Excel(name = "是否药品")
     private String isDrug;
 
+    /**
+     * 退货地址
+     */
+    @Excel(name = "退货地址")
+    private String returnAddress;
+
+
 }

+ 1 - 0
fs-service/src/main/java/com/fs/hisStore/enums/OrderInfoEnum.java

@@ -15,6 +15,7 @@ public enum OrderInfoEnum {
     STATUS_1(1,"待发货"),
     STATUS_2(2,"待收货"),
     STATUS_3(3,"已完成"),
+    STATUS_4(4,"待评价"),
 
     PAY_STATUS_0(0,"未支付"),
     PAY_STATUS_1(1,"已支付"),

+ 9 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsStoreProductAddEditParam.java

@@ -258,6 +258,15 @@ public class FsStoreProductAddEditParam implements Serializable
     @Excel(name = "品牌")
     private String brand;
 
+    /** 品牌 */
+    @Excel(name = "食品生产许可证编码")
+    private String foodProductionLicenseCode;
+
+    /** 退货地址 */
+    @Excel(name = "退货地址")
+    private String returnAddress;
+
+
     private Integer isDrug;
 
     //属性项目

+ 1 - 1
fs-service/src/main/java/com/fs/live/mapper/LiveCouponMapper.java

@@ -112,7 +112,7 @@ public interface LiveCouponMapper
             "from live_coupon_issue_relation lcir left join live_coupon_issue lci " +
             "left join live_coupon lc on lc.coupon_id=lci.coupon_id on lci.id = lcir.coupon_issue_id  " +
             "left join live_goods lg on lg.goods_id = lcir.goods_id " +
-            "left join fs_store_product fsp on lg.product_id = fsp.product_id " +
+            "left join fs_store_product_scrm fsp on lg.product_id = fsp.product_id " +
             "where lcir.live_id = #{liveId} and lcir.goods_id is not null")
     List<LiveCoupon> listOn(@Param("liveId") Long liveId);
 

+ 0 - 8
fs-service/src/main/java/com/fs/live/mapper/LiveOrderMapper.java

@@ -29,14 +29,6 @@ public interface LiveOrderMapper {
      */
     LiveOrder selectLiveOrderByOrderId(String orderId);
 
-    /**
-     * 查询订单
-     *
-     * @param orderId 订单主键
-     * @return 订单
-     */
-    @Select("select * from live_order where order_id=#{orderId}")
-    LiveOrder selectLiveOrderByOrderId(Long orderId);
 
     @Select("select order_code from live_order where order_id=#{orderId}")
     String selectLiveOrderCodeByOrderId(@Param("orderId") String orderId);

+ 2 - 0
fs-service/src/main/java/com/fs/live/service/ILiveService.java

@@ -187,4 +187,6 @@ public interface ILiveService
     int updateLiveEntity(Live live);
 
     void updateGlobalVisible(long liveId, Integer status);
+
+    String getGotoWxAppLiveLink(String linkStr, String appid);
 }

+ 1 - 1
fs-service/src/main/java/com/fs/live/service/impl/LiveAfterSalesServiceImpl.java

@@ -406,7 +406,7 @@ public class LiveAfterSalesServiceImpl implements ILiveAfterSalesService {
         request.setRefund_state(1);
         request.setStoreAfterSalesId(storeAfterSales.getId());
         if (StringUtils.isNotBlank(order.getExtendOrderId())){
-            BaseResponse response=erpOrderService.refundUpdateScrm(request);
+            BaseResponse response=erpOrderService.refundUpdateLive(request);
             if(response.getSuccess()){
                 return R.ok();
             }

+ 31 - 24
fs-service/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java

@@ -310,7 +310,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
             return;
         }
         // 2. 从数据库获取完整订单(用于补全必要字段;当前是修改商城订单接口,查询fs_store_order_scrm表)
-        LiveOrder dbOrder = liveOrderMapper.selectLiveOrderByOrderId(partialOrder.getOrderId());
+        LiveOrder dbOrder = liveOrderMapper.selectLiveOrderByOrderId(String.valueOf(partialOrder.getOrderId()));
         if (dbOrder == null) {
             log.error("数据库表fs_store_order_scrm中订单不存在,orderId: {}", partialOrder.getOrderId());
             return;
@@ -333,7 +333,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
             // 5. 调用对应 ERP 服务(当前是聚水潭ERP)
             IErpOrderService erpService = erpServiceMap.get(erpType);
             //执行商城订单推送逻辑
-            ErpOrderResponse response = erpService.addOrderScrm(erpOrder);
+            ErpOrderResponse response = erpService.addLiveOrder(erpOrder);
             log.info("ERP地址推送结果 - 商城订单: {}, ERP类型: {}, 成功: {}, 外部单号: {}",
                     dbOrder.getOrderCode(), erpType, response.getSuccess(), response.getCode());
         } catch (Exception e) {
@@ -682,7 +682,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
             LiveOrderPaymentError err = new LiveOrderPaymentError();
             err.setOrderNo(payCode);
             err.setOrderFlowNo(tradeNo);
-            err.setStatus(0);
+            err.setStatus(OrderInfoEnum.STATUS_0.getValue());
             err.setMsg("支付错误:"+e.getMessage());
             err.setCreateTime(DateUtils.getNowDate());
             liveOrderPaymentErrorMapper.insertLiveOrderPaymentError(err);
@@ -1007,7 +1007,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
     @Override
     @Transactional
     public synchronized R finishOrder(Long orderId) {
-        LiveOrder order = liveOrderMapper.selectLiveOrderByOrderId(orderId);
+        LiveOrder order = liveOrderMapper.selectLiveOrderByOrderId(String.valueOf(orderId));
         if (order.getStatus() == OrderInfoEnum.STATUS_2.getValue()) {
             order.setFinishTime(new Date());
             order.setStatus(OrderInfoEnum.STATUS_3.getValue());
@@ -1079,7 +1079,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
     public R refundOrderMoney(Long orderId) {
         IErpOrderService erpOrderService = getErpService();
         FsErpConfig erpConfig = configUtil.generateStructConfigByKey("his.config", FsErpConfig.class);
-        LiveOrder order = baseMapper.selectLiveOrderByOrderId(orderId);
+        LiveOrder order = baseMapper.selectLiveOrderByOrderId(String.valueOf(orderId));
         if (order == null) {
             return R.error("订单不存在");
         }
@@ -1118,7 +1118,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
                 }
                 return liveAfterSalesService.applyForAfterSales(order.getUserId(), param);
             } else {
-                jSTOrderService.refundUpdateScrm(request);
+                jSTOrderService.refundUpdateLive(request);
             }
         }
         order.setStatus(OrderInfoEnum.STATUS_2.getValue());
@@ -1248,7 +1248,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
     public R refundOrderMoney(Long orderId, LiveAfterSales liveAfterSales) {
         IErpOrderService erpOrderService = getErpService();
         FsErpConfig erpConfig = configUtil.generateStructConfigByKey("his.config", FsErpConfig.class);
-        LiveOrder order = baseMapper.selectLiveOrderByOrderId(orderId);
+        LiveOrder order = baseMapper.selectLiveOrderByOrderId(String.valueOf(orderId));
         if (order == null) {
             return R.error("订单不存在");
         }
@@ -1287,10 +1287,10 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
                 }
                 return liveAfterSalesService.applyForAfterSales(order.getUserId(), param);
             } else {
-                jSTOrderService.refundUpdateScrm(request);
+                jSTOrderService.refundUpdateLive(request);
             }
         }
-        order.setStatus(-2);
+        order.setStatus(OrderInfoEnum.STATUS_NE2.getValue());
         order.setRefundMoney(order.getPayMoney());
         order.setRefundStatus(String.valueOf(OrderInfoEnum.REFUND_STATUS_2.getValue()));
         liveUserLotteryRecordMapper.updateOrderStatusByOrderId(order.getOrderId(), -2);
@@ -1492,7 +1492,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
 
     @Override
     public R createOmsOrder(Long orderId)  throws ParseException {
-        LiveOrder order = liveOrderMapper.selectLiveOrderByOrderId(orderId);
+        LiveOrder order = liveOrderMapper.selectLiveOrderByOrderId(String.valueOf(orderId));
         FsSysConfig erpConfig = configUtil.generateStructConfigByKey(SysConfigEnum.HIS_CONFIG.getKey(), FsSysConfig.class);
         List<Long> noErpCompany = erpConfig.getNoErpCompany();
         if (noErpCompany != null && noErpCompany.contains(order.getCompanyId())) {
@@ -1511,7 +1511,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         if (erpOrderService == jSTOrderService) {
             erpOrder.setShop_code(erpConfig.getErpJstShopCode());
         }
-        ErpOrderResponse response = erpOrderService.addOrderScrm(erpOrder);
+        ErpOrderResponse response = erpOrderService.addLiveOrder(erpOrder);
 
         //写入日志
         log.info("ErpCreate:" + order.getOrderCode() + ":" + JSONUtil.toJsonStr(response));
@@ -1547,7 +1547,8 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         //payment.setPaytime(new Timestamp(System.currentTimeMillis()));
         if (order.getPayTime() != null) {
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            String timeString = sdf.format(order.getPayTime());
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            String timeString = order.getPayTime().format(formatter);
             Date date = sdf.parse(timeString); // 时间格式转为时间戳
             long timeLong = date.getTime();
             payment.setPaytime(new Timestamp(timeLong));
@@ -1601,9 +1602,9 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         remarkDTO.setYdMoney(order.getPayPrice().subtract(order.getPayMoney().subtract(order.getPayDelivery())));
 
         if (order.getPayTime() != null) {
-            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            String format = sdf.format(order.getPayTime());
-            remarkDTO.setPayTime(format);
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            String timeString = order.getPayTime().format(formatter);
+            remarkDTO.setPayTime(timeString);
         }
         erpOrder.setSeller_memo(erpOrder.getSeller_memo() + JSONUtil.toJsonStr(remarkDTO));
 
@@ -1615,8 +1616,8 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         for (LiveOrderItem orderItem : orderItems) {
             FsStoreProduct cartDTO = JSONUtil.toBean(orderItem.getJsonInfo(), FsStoreProduct.class);
             ErpOrderItem item = new ErpOrderItem();
-            item.setItem_code(cartDTO.getBarCode().trim());
-            item.setPrice(cartDTO.getPrice().toString());
+            item.setItem_code(cartDTO.getBarCode() == null ? "" : cartDTO.getBarCode().trim());
+            item.setPrice(cartDTO.getPrice() == null ? "" : cartDTO.getPrice().toString());
             // todo yhq 需要检查
             item.setQty(Integer.valueOf(order.getTotalNum()));
             item.setRefund(0);
@@ -1792,7 +1793,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
                 liveUserLotteryRecord.setOrderStatus(liveOrder.getStatus());
                 liveUserLotteryRecordMapper.updateLiveUserLotteryRecord(liveUserLotteryRecord);
                 LiveOrderItemDTO dto=new LiveOrderItemDTO();
-                dto.setImage(fsStoreProduct.getImgUrl());
+                dto.setImage(fsStoreProduct.getImage());
                 dto.setSku(String.valueOf(fsStoreProduct.getStock()));
                 if (StringUtils.isEmpty(fsStoreProduct.getBarCode())) {
                     FsStoreProductAttrValueScrm fsStoreProductAttrValue = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(fsStoreProduct.getProductId()).stream().filter(attrValue -> StringUtils.isNotEmpty(attrValue.getBarCode())).findFirst().orElse(null);
@@ -1920,7 +1921,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         }
         ErpOrderQueryRequert request = new ErpOrderQueryRequert();
         request.setCode(order.getExtendOrderId());
-        ErpOrderQueryResponse response = erpOrderService.getScrmOrder(request);
+        ErpOrderQueryResponse response = erpOrderService.getLiveOrder(request);
         if(response.getOrders()!=null&&response.getOrders().size()>0){
             for(ErpOrderQuery orderQuery : response.getOrders()){
                 if(orderQuery.getDeliverys()!=null&&orderQuery.getDeliverys().size()>0){
@@ -2376,7 +2377,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         LiveOrder order= baseMapper.selectLiveOrderByOrderId(String.valueOf(orderId));
         if(order.getStatus()==OrderInfoEnum.STATUS_3.getValue()){
             order.setFinishTime(new Date());
-            order.setStatus(4);
+            order.setStatus(OrderInfoEnum.STATUS_4.getValue());
             liveUserLotteryRecordMapper.updateOrderStatusByOrderId(order.getOrderId(), 4);
             baseMapper.updateLiveOrder(order);
             liveOrderLogsService.create(order.getOrderId(), OrderLogEnum.FINISH_ORDER.getValue(),
@@ -2418,7 +2419,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         //创建时间
         liveOrder.setCreateTime(DateUtils.getNowDate());
         //订单状态 默认1
-        liveOrder.setStatus(1);
+        liveOrder.setStatus(OrderInfoEnum.STATUS_0.getValue());
         //支付状态 默认0
         liveOrder.setIsPay("0");
         //支付类型 默认1微信
@@ -2725,7 +2726,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
             //更新用户下单次数和累计成交总额
             userMapper.updateUserOrderCountAndAmount(Long.valueOf(liveOrder.getUserId()), liveOrder.getPayMoney());
 
-            liveOrder.setStatus(2);
+            liveOrder.setStatus(OrderInfoEnum.STATUS_1.getValue());
             liveOrder.setPayTime(LocalDateTime.now());
             liveUserLotteryRecordMapper.updateOrderStatusByOrderId(liveOrder.getOrderId(), 2);
             baseMapper.updateLiveOrder(liveOrder);
@@ -2735,7 +2736,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
             TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint);
             LiveOrderPaymentError err = new LiveOrderPaymentError();
             err.setOrderNo(String.valueOf(orderId));
-            err.setStatus(0);
+            err.setStatus(OrderInfoEnum.STATUS_0.getValue());
             err.setMsg("抽奖订单支付错误:"+e.getMessage());
             err.setCreateTime(DateUtils.getNowDate());
             liveOrderPaymentErrorMapper.insertLiveOrderPaymentError(err);
@@ -2988,7 +2989,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         try {
             if (baseMapper.insertLiveOrder(liveOrder) > 0) {
                 LiveOrderItemDTO dto=new LiveOrderItemDTO();
-                dto.setImage(fsStoreProduct.getImgUrl());
+                dto.setImage(fsStoreProduct.getImage());
                 dto.setSku(String.valueOf(fsStoreProduct.getStock()));
                 FsStoreProductAttrValueScrm fsStoreProductAttrValue = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(fsStoreProduct.getProductId()).stream().filter(attrValue -> StringUtils.isNotEmpty(attrValue.getBarCode())).findFirst().orElse(null);
                 if (fsStoreProductAttrValue != null) {
@@ -3138,17 +3139,23 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         if(order.getStatus() == 1){
             LiveOrder liveOrder = baseMapper.selectLiveOrderByOrderId(String.valueOf(order.getOrderId()));
             if(liveOrder == null) return R.error("订单不存在");
+            // 更新用户抽奖记录
             liveUserLotteryRecordMapper.updateOrderStatusByOrderId(order.getOrderId(), -3);
+            // 更新订单
             baseMapper.cancelOrder(order.getOrderId());
+            // 创建订单日志
             liveOrderLogsService.create(order.getOrderId(), OrderLogEnum.CANCEL_ORDER.getValue(),
                     OrderLogEnum.CANCEL_ORDER.getDesc());
             // 恢复库存
             FsStoreProductScrm fsStoreProduct = fsStoreProductService.selectFsStoreProductById(liveOrder.getProductId());
             LiveGoods goods = liveGoodsMapper.selectLiveGoodsByProductId(liveOrder.getLiveId(), liveOrder.getProductId());
             fsStoreProduct.setStock(fsStoreProduct.getStock()+Integer.parseInt(liveOrder.getTotalNum()));
+            // 更新商品库存
             fsStoreProductService.updateFsStoreProduct(fsStoreProduct);
             goods.setStock(goods.getStock()+Long.parseLong(liveOrder.getTotalNum()));
+            // 更新商品库存
             liveGoodsMapper.updateLiveGoods(goods);
+            // 退券
             this.refundCoupon(order);
 
             return R.ok("操作成功");

+ 85 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java

@@ -1,5 +1,6 @@
 package com.fs.live.service.impl;
 
+import cn.binarywang.wx.miniapp.api.WxMaService;
 import cn.hutool.core.thread.ThreadUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSON;
@@ -7,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
 
 import com.fs.common.exception.base.BaseException;
 import com.fs.company.mapper.CompanyMapper;
+import com.fs.core.config.WxMaConfiguration;
 import com.fs.his.domain.FsStoreProduct;
 import com.fs.his.domain.FsUser;
 import com.fs.his.mapper.FsUserMapper;
@@ -31,16 +33,26 @@ import com.fs.system.domain.SysConfig;
 import com.fs.system.service.ISysConfigService;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.common.error.WxErrorException;
 import okhttp3.FormBody;
 import okhttp3.OkHttpClient;
 import okhttp3.Request;
 import okhttp3.Response;
+import org.apache.http.HttpEntity;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import com.fs.common.utils.sign.Md5Utils;
 
 import java.io.IOException;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.time.temporal.ChronoUnit;
@@ -101,6 +113,10 @@ public class LiveServiceImpl implements ILiveService
     @Autowired
     private LiveCouponMapper liveCouponMapper;
 
+    private static String TOKEN_VALID_CODE = "40001";
+
+    private volatile Integer version = 0;
+
 
 
     /**
@@ -363,6 +379,75 @@ public class LiveServiceImpl implements ILiveService
         baseMapper.updateGlobalVisible(liveId, status);
     }
 
+    @Override
+    public String getGotoWxAppLiveLink(String linkStr, String appId) {
+        CloseableHttpClient client = null;
+        try {
+            client = HttpClients.createDefault();
+            String[] split = linkStr.split("\\?");
+            if (split.length == 2 && split[0].length() > 0 && split[1].length() > 0) {
+                //处理页面路径
+                String pageUrl = split[0];
+                if (pageUrl.startsWith("/")) {
+                    pageUrl = pageUrl.substring(1);
+                }
+                //处理参数
+                String query = split[1];
+                query = URLEncoder.encode(query, StandardCharsets.UTF_8.toString());
+//                String json = configService.selectConfigByKey("course.config");
+//                CourseConfig config = JSON.parseObject(json, CourseConfig.class);
+//                String miniprogramAppid = config.getMiniprogramAppid();
+//                if (StringUtils.isBlank(miniprogramAppid)) {
+//                    return "未配置点播小程序id";
+//                }
+                //获取微信token
+                final WxMaService wxService = WxMaConfiguration.getMaService(appId);
+                String token = wxService.getAccessToken();
+                log.info("小程序TOKEN值-------->刷新前TOKEN:{}", token);
+                HttpPost httpPost = new HttpPost("https://api.weixin.qq.com/wxa/generate_urllink?access_token=" + token);
+                JSONObject bodyObj = new JSONObject();
+                bodyObj.put("path", pageUrl);
+                bodyObj.put("query", query);
+                log.info("微信小程序请求参数打印:{}", bodyObj.toJSONString());
+                StringEntity entity = new StringEntity(bodyObj.toJSONString(),"UTF-8");
+                httpPost.setEntity(entity);
+                httpPost.setHeader("Content-type", "application/json");
+                httpPost.setHeader("cache-control","max-age=0");
+                HttpEntity response = client.execute(httpPost).getEntity();
+                String responseString = EntityUtils.toString(response);
+                log.info("微信小程序接口响应数据:{}", responseString);
+                JSONObject jsonObject = JSONObject.parseObject(responseString);
+
+                if(TOKEN_VALID_CODE.equals(jsonObject.getString("errcode"))){
+                    Integer curVersion =  Integer.valueOf(version);
+                    synchronized (TOKEN_VALID_CODE){
+                        if(curVersion.equals(version)){
+                            log.info("小程序TOKEN:40001进入强制刷新-------->刷新前TOKEN:{}", token);
+                            wxService.getAccessToken(true);
+                            version = version.equals(Integer.MAX_VALUE) ? 0 : curVersion + 1;
+                            log.info("小程序TOKEN:40001进入强制刷新-------->刷新后TOKEN:{}", wxService.getAccessToken());
+                        }
+                        return getGotoWxAppLiveLink(linkStr,appId);
+                    }
+                }
+
+                if(null != jsonObject && !jsonObject.isEmpty() && jsonObject.containsKey("url_link")){
+                    return jsonObject.getString("url_link");
+                }
+            } else {
+                return "页面链接错误,获取失败";
+            }
+
+        } catch (WxErrorException e) {
+            throw new RuntimeException(e);
+        } catch (ClientProtocolException e) {
+            throw new RuntimeException(e);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        return "";
+    }
+
     /**
      * 修改直播
      *

+ 1 - 0
fs-service/src/main/java/com/fs/live/vo/LiveDataListVo.java

@@ -75,3 +75,4 @@ public class LiveDataListVo {
 
 
 
+

+ 1 - 0
fs-service/src/main/java/com/fs/live/vo/LiveDataStatisticsVo.java

@@ -56,3 +56,4 @@ public class LiveDataStatisticsVo {
 
 
 
+

+ 6 - 1
fs-service/src/main/resources/application-config-druid-bjzm-test.yml

@@ -97,4 +97,9 @@ wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:
 
-
+# 聚水潭API配置
+jst:
+  app_key: 86b28953506749a1b6845332c1497308 #聚水潭2025-08-15
+  app_secret: 808ea0f49de04e13886b1aca6e504fc3 #聚水潭2025-08-15
+  authorization_code: 777777
+  shop_code: "19544649"

+ 6 - 0
fs-service/src/main/resources/application-config-druid-bjzm.yml

@@ -98,3 +98,9 @@ wx_miniapp_temp:
   inquiry_temp_id:
 
 
+# 聚水潭API配置
+jst:
+  app_key: 86b28953506749a1b6845332c1497308 #聚水潭2025-08-15
+  app_secret: 808ea0f49de04e13886b1aca6e504fc3 #聚水潭2025-08-15
+  authorization_code: 777777
+  shop_code: "19544649"

+ 16 - 3
fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml

@@ -68,6 +68,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="precautions" column="precautions"/>
         <result property="isAudit" column="is_audit"/>
         <result property="storeId" column="store_id"/>
+        <result property="returnAddress"    column="return_address"    />
+        <result property="brand"    column="brand"    />
+        <result property="foodProductionLicenseCode"    column="food_production_license_code"    />
     </resultMap>
 
     <sql id="selectFsStoreProductVo">
@@ -78,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                integral, product_type, prescribe_code, prescribe_spec, prescribe_factory, prescribe_name,
                is_display,tui_cate_id,company_ids,is_drug,drug_image,drug_reg_cert_no,common_name,dosage_form,
                unit_price,batch_number,mah,mah_address,manufacturer,manufacturer_address,indications,dosage,
-               adverse_reactions,contraindications,precautions,is_audit,store_id
+               adverse_reactions,contraindications,precautions,is_audit,store_id,return_address,brand,food_production_license_code
                from fs_store_product_scrm
     </sql>
 
@@ -90,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                p.integral, p.product_type, p.prescribe_code, p.prescribe_spec, p.prescribe_factory, p.prescribe_name,
                p.is_display,p.tui_cate_id,p.company_ids,p.is_drug,p.drug_image,p.drug_reg_cert_no,p.common_name,p.dosage_form,
                p.unit_price,p.batch_number,p.mah,p.mah_address,p.manufacturer,p.manufacturer_address,p.indications,p.dosage,
-               p.adverse_reactions,p.contraindications,p.precautions,p.is_audit,p.store_id
+               p.adverse_reactions,p.contraindications,p.precautions,p.is_audit,p.store_id,p.return_address,p.brand,p.food_production_license_code
         from fs_store_product_scrm p
     </sql>
 
@@ -159,6 +162,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="precautions != null and precautions != ''">and precautions = #{precautions} </if>
             <if test="isAudit != null and isAudit != ''">and is_audit = #{isAudit} </if>
             <if test="storeId != null and storeId != ''">and store_id = #{storeId} </if>
+            <if test="brand != null and brand != ''">and brand = #{brand} </if>
+            <if test="foodProductionLicenseCode != null and foodProductionLicenseCode != ''">and food_production_license_code = #{foodProductionLicenseCode} </if>
         </where>
     </select>
 
@@ -254,6 +259,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="precautions != null and precautions != ''">precautions ,</if>
             <if test="isAudit != null and isAudit != ''">is_audit ,</if>
             <if test="storeId != null and storeId != ''">store_id ,</if>
+            <if test="returnAddress != null">return_address,</if>
+            <if test="brand != null and brand != ''">brand,</if>
+            <if test="foodProductionLicenseCode != null and foodProductionLicenseCode != ''">food_production_license_code,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="image != null and image != ''">#{image},</if>
@@ -318,6 +326,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="precautions != null and precautions != ''">#{precautions} ,</if>
             <if test="isAudit != null and isAudit != ''">#{isAudit} ,</if>
             <if test="storeId != null and storeId != ''">#{storeId} ,</if>
+            <if test="returnAddress != null">#{returnAddress},</if>
+            <if test="brand != null and brand != ''">#{brand},</if>
+            <if test="foodProductionLicenseCode != null and foodProductionLicenseCode != ''">#{foodProductionLicenseCode},</if>
          </trim>
     </insert>
 
@@ -386,7 +397,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="precautions != null and precautions != ''">precautions = #{precautions} ,</if>
             <if test="isAudit != null and isAudit != ''">is_audit = #{isAudit} ,</if>
             <if test="storeId != null and storeId != ''">store_id = #{storeId} ,</if>
-
+            <if test="returnAddress != null">return_address = #{returnAddress},</if>
+            <if test="brand != null and brand != ''">brand = #{brand},</if>
+            <if test="foodProductionLicenseCode != null and foodProductionLicenseCode != ''">food_production_license_code = #{foodProductionLicenseCode},</if>
         </trim>
         where product_id = #{productId}
     </update>

+ 12 - 0
fs-service/src/main/resources/mapper/live/LiveOrderMapper.xml

@@ -214,6 +214,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orderCode != null and orderCode != ''">order_code,</if>
             <if test="userId != null and userId != ''">user_id,</if>
             <if test="realName != null">real_name,</if>
+            <if test="userName != null">user_name,</if>
             <if test="userPhone != null">user_phone,</if>
             <if test="userAddress != null">user_address,</if>
             <if test="cartId != null">cart_id,</if>
@@ -285,6 +286,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orderCode != null and orderCode != ''">#{orderCode},</if>
             <if test="userId != null and userId != ''">#{userId},</if>
             <if test="realName != null">#{realName},</if>
+            <if test="userName != null">#{userName},</if>
             <if test="userPhone != null">#{userPhone},</if>
             <if test="userAddress != null">#{userAddress},</if>
             <if test="cartId != null">#{cartId},</if>
@@ -360,6 +362,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orderCode != null and orderCode != ''">order_code = #{orderCode},</if>
             <if test="userId != null and userId != ''">user_id = #{userId},</if>
             <if test="realName != null">real_name = #{realName},</if>
+            <if test="userName != null">user_name = #{userName},</if>
             <if test="userPhone != null">user_phone = #{userPhone},</if>
             <if test="userAddress != null">user_address = #{userAddress},</if>
             <if test="cartId != null">cart_id = #{cartId},</if>
@@ -528,6 +531,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="maps.realName != null and  maps.realName !=''">
             and o.user_name like CONCAT('%',#{maps.realName},'%')
         </if>
+        <if test="maps.userName != null and  maps.userName !=''">
+            and o.user_name like CONCAT('%',#{maps.userName},'%')
+        </if>
         <if test="maps.phone != null and  maps.phone !=''">
             and u.phone like CONCAT('%',#{maps.phone},'%')
         </if>
@@ -687,6 +693,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maps.realName != null and  maps.realName !=''">
                 and o.user_name like CONCAT('%',#{maps.realName},'%')
             </if>
+            <if test="maps.userName != null and  maps.userName !=''">
+                and o.user_name like CONCAT('%',#{maps.userName},'%')
+            </if>
             <if test="maps.phone != null and  maps.phone !=''">
                 and u.phone like CONCAT('%',#{maps.phone},'%')
             </if>
@@ -828,6 +837,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maps.realName != null and  maps.realName !=''">
                 and o.user_name like CONCAT('%',#{maps.realName},'%')
             </if>
+            <if test="maps.userName != null and  maps.userName !=''">
+                and o.user_name like CONCAT('%',#{maps.userName},'%')
+            </if>
             <if test="maps.phone != null and  maps.phone !=''">
                 and u.phone like CONCAT('%',#{maps.phone},'%')
             </if>

+ 3 - 0
fs-user-app/src/main/java/com/fs/app/controller/live/LiveOrderController.java

@@ -708,6 +708,9 @@ public class LiveOrderController extends AppBaseController
 
 
     private void handleCancelLiveOrderPay(LiveOrderPayParam param) {
+        LiveOrder liveOrder = new LiveOrder();
+        liveOrder.setOrderId(param.getOrderId());
+        orderService.cancelOrder(liveOrder);
         redisCache.deleteObject("isPaying:"+param.getOrderId());
     }