xdd 1 week geleden
bovenliggende
commit
9ee9938f33

+ 1 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveOrderController.java

@@ -397,6 +397,7 @@ public class LiveOrderController extends BaseController
     @GetMapping("/createErpOrder")
     public R createErpOrder(@RequestParam("orderCode") String orderCode) throws Exception
     {
+        logger.info("手动推管易 订单号: {}",orderCode);
         LiveOrder order=liveOrderService.selectOrderIdByOrderCode(orderCode);
         liveOrderService.createOmsOrder(order.getOrderId());
         return R.ok();

+ 4 - 5
fs-service-system/src/main/java/com/fs/live/service/impl/LiveAfterSalesServiceImpl.java

@@ -584,6 +584,7 @@ public class LiveAfterSalesServiceImpl implements ILiveAfterSalesService {
         }
     }
 
+
     @Override
     public R revoke(String userId, LiveAfterSalesRevokeParam param) {
         LiveAfterSales storeAfterSales = baseMapper.selectLiveAfterSalesById(param.getId());
@@ -597,7 +598,7 @@ public class LiveAfterSalesServiceImpl implements ILiveAfterSalesService {
             throw new CustomException("已发货退款单不能撤销");
         }
         //只有未发货的可以撤销,
-        if (!storeAfterSales.getOrderStatus().equals(OrderInfoEnum.STATUS_2.getValue())) {
+        if (!storeAfterSales.getOrderStatus().equals(2)) {
             throw new CustomException("只有未发货的订单可以撤销售后");
         }
         storeAfterSales.setSalesStatus(1);
@@ -614,7 +615,7 @@ public class LiveAfterSalesServiceImpl implements ILiveAfterSalesService {
         logs.setStoreAfterSalesId(storeAfterSales.getId());
         logs.setChangeMessage(OrderInfoEnum.REFUND_STATUS_1.getDesc());
         liveAfterSalesLogsMapper.insertLiveAfterSalesLogs(logs);
-        if (storeAfterSales.getOrderStatus().equals(OrderInfoEnum.STATUS_2.getValue())) {
+        if (storeAfterSales.getOrderStatus().equals(3)) {
             if (StringUtils.isNotEmpty(order.getExtendOrderId())) {
                 //更新订单code
                 String orderSn = SnowflakeUtils.nextId();
@@ -626,7 +627,6 @@ public class LiveAfterSalesServiceImpl implements ILiveAfterSalesService {
                 orderMap.setOrderCode(orderSn);
                 liveOrderService.updateLiveOrder(orderMap);
                 //生成新的订单
-
                 List<LiveOrderPayment> payments = liveOrderPaymentMapper.selectLiveOrderPaymentByPay(2, order.getOrderId());
                 for (LiveOrderPayment payment : payments) {
                     LiveOrderPayment livePayment = new LiveOrderPayment();
@@ -635,9 +635,8 @@ public class LiveAfterSalesServiceImpl implements ILiveAfterSalesService {
                     liveOrderPaymentMapper.updateLiveOrderPayment(livePayment);
                 }
 
-
                 try {
-                    liveOrderService.pushLiveOrder(order);
+                    liveOrderService.createOmsOrder(order.getOrderId());
                 } catch (Exception e) {
                     log.error("推送ERP订单失败!",e);
                 }

+ 8 - 2
fs-service-system/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java

@@ -1122,6 +1122,13 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         //3.新疆  西藏 内蒙古 海南  全款订单走顺丰丰云配  【非全款】的就根据公司配置那来 配的哪个走哪个快递
         //4.把现在发中通的规则改成发顺丰风云配 CQRXSF.0235487868_241231
         //5.全款支付且应付金额小于等于100元,快递方式默认中通小件455 ZTO 中通小件 CQRXSF.0235487868_241231
+        if(ObjectUtil.equal(order.getCompanyId(),-1L)) {
+            order.setCompanyId(null);
+        }
+        if(ObjectUtil.equal(order.getCompanyUserId(),-1L)) {
+            order.setCompanyUserId(null);
+        }
+
         if(order.getCompanyId()!=null&&order.getStoreHouseCode()!=null&&order.getStoreHouseCode().equals("WHSP001")){
             //杭州家有仙妻实业有限公司 全部订单快递方式设置为商城德邦快递
             FsExpress express=fsExpressCacheService.selectFsExpressByOmsCode("SF-WHC");
@@ -1139,8 +1146,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
                 payments.add(codPayment);
                 erpOrder.setCod(true);
             }
-        }
-        else if(order.getCompanyId()!=null){
+        } else if(order.getCompanyId()!=null){
             Company company = companyService.selectCompanyById(order.getCompanyId());
             if (order.getPayDelivery().compareTo(new BigDecimal(0)) == 0) {  //没有物流代收(全款订单)
                 FsExpress express = new FsExpress();