|  | @@ -50,6 +50,7 @@ import com.fs.hisStore.domain.FsStorePaymentScrm;
 | 
	
		
			
				|  |  |  import com.fs.hisStore.mapper.FsStoreOrderScrmMapper;
 | 
	
		
			
				|  |  |  import com.fs.hisStore.mapper.FsStorePaymentScrmMapper;
 | 
	
		
			
				|  |  |  import com.fs.hisStore.param.FsStoreOrderRefundByProductParam;
 | 
	
		
			
				|  |  | +import com.fs.hisStore.service.IFsStoreOrderLogsScrmService;
 | 
	
		
			
				|  |  |  import com.fs.hisapi.domain.ApiResponse;
 | 
	
		
			
				|  |  |  import com.fs.hisapi.param.CreateOrderParam;
 | 
	
		
			
				|  |  |  import com.fs.hisapi.param.RecipeDetailParam;
 | 
	
	
		
			
				|  | @@ -1559,6 +1560,53 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    FsStoreOrderScrmMapper storeOrderScrmMapper;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    IFsStoreOrderLogsScrmService iFsStoreOrderLogsScrmService;
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public void deliveryOrderScrm(String orderCode, String deliveryId, String deliverCode, String deliverName) {
 | 
	
		
			
				|  |  | +        FsStoreOrderScrm order = fsStoreOrderMapper.selectFsStoreOrderScrmByOrderCode(orderCode);
 | 
	
		
			
				|  |  | +        if (order != null && order.getStatus() == 1) {
 | 
	
		
			
				|  |  | +            FsExpress express = expressService.selectFsExpressByOmsCode(deliverCode);
 | 
	
		
			
				|  |  | +            if (express != null) {
 | 
	
		
			
				|  |  | +                order.setDeliveryName(deliverName);
 | 
	
		
			
				|  |  | +                order.setDeliveryCode(express.getCode());
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            order.setStatus(2);
 | 
	
		
			
				|  |  | +            order.setDeliverySn(deliveryId);
 | 
	
		
			
				|  |  | +            order.setDeliverySendTime(DateUtils.getNowDate());
 | 
	
		
			
				|  |  | +            storeOrderScrmMapper.updateFsStoreOrder(order);
 | 
	
		
			
				|  |  | +            iFsStoreOrderLogsScrmService.create(order.getId(), FsStoreOrderLogEnum.DELIVERY_GOODS.getValue(), FsStoreOrderLogEnum.DELIVERY_GOODS.getDesc());
 | 
	
		
			
				|  |  | +            if (order.getCompanyId() != null && order.getCompanyId() > 0) {
 | 
	
		
			
				|  |  | +                companyService.subtractCompanyMoneyScrm(order);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            FsStore store = fsStoreMapper.selectFsStoreByStoreId(order.getStoreId());
 | 
	
		
			
				|  |  | +            //订阅物流回调
 | 
	
		
			
				|  |  | +            String lastFourNumber = "";
 | 
	
		
			
				|  |  | +            if (order.getDeliveryCode().equals(ShipperCodeEnum.SF.getValue())) {
 | 
	
		
			
				|  |  | +                if (store != null && store.getSendPhone() != null) {
 | 
	
		
			
				|  |  | +                    lastFourNumber = store.getSendPhone();
 | 
	
		
			
				|  |  | +                } else {
 | 
	
		
			
				|  |  | +                    lastFourNumber = order.getUserPhone();
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                if (lastFourNumber.length() == 11) {
 | 
	
		
			
				|  |  | +                    lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            expressService.subscribeEspress(order.getOrderCode(), order.getDeliveryCode(), order.getDeliverySn(), lastFourNumber);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public FsStoreOrderScrm selectFsStoreOrderScrmByOrderCode(String soId) {
 | 
	
		
			
				|  |  | +        return fsStoreOrderMapper.selectFsStoreOrderScrmByOrderCode(soId);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
 | 
	
		
			
				|  |  |      public int afterSales(FsStoreOrderSalesParam fsStoreOrderSalesParam) {
 |