| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -6,6 +6,7 @@ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					package com.shop.cereshop.app.service.stock.impl; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.alibaba.fastjson.JSONObject; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.google.gson.Gson; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.shop.cereshop.app.dao.order.CereOrderProductDAO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.shop.cereshop.app.dao.order.CereShopOrderDAO; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -21,6 +22,7 @@ import com.shop.cereshop.commons.domain.buyer.CereBuyerUser; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.shop.cereshop.commons.domain.express.HttpResult; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.shop.cereshop.commons.domain.order.CereOrderProduct; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.shop.cereshop.commons.domain.order.CereShopOrder; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.shop.cereshop.commons.domain.shop.CereShopCrossDetail; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.shop.cereshop.commons.exception.CoBusinessException; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.shop.cereshop.commons.utils.HttpUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.shop.cereshop.commons.utils.StringUtils; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -63,10 +65,10 @@ public class CrossStockServiceImpl implements CrossStockService{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<CereShopOrder> cereShopOrderList = cereShopOrderDAO.findByFormid(orderFromId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        CereShopOrder cereShopOrder = cereShopOrderList.get(0); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //商家详细信息 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//        CereShopCrossDetail cereShopCrossDetail = cereShopCrossDetailDAO.selectOne(Wrappers.<CereShopCrossDetail>lambdaQuery().eq(CereShopCrossDetail::getShopId, cereShopOrder.getShopId())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//        if(cereShopCrossDetail == null){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//            throw new CoBusinessException("10000","商家未设置跨境信息"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        CereShopCrossDetail cereShopCrossDetail = cereShopCrossDetailDAO.selectOne(Wrappers.<CereShopCrossDetail>lambdaQuery().eq(CereShopCrossDetail::getShopId, cereShopOrder.getShopId())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if(cereShopCrossDetail == null){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new CoBusinessException("10000","商家未设置跨境信息"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.info("firstOrder:" + new Gson().toJson(cereShopOrder)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -106,11 +108,18 @@ public class CrossStockServiceImpl implements CrossStockService{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//        private String consigneeidcard; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        bo.setConsigneetelephone(cereShopOrder.getReceivePhone()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//        bo.setEbpcode(cereShopCrossDetail.getEbpcode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//        bo.setEbpname(cereShopCrossDetail.getEbpname()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        bo.setEbpcode("46016601J4"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        bo.setEbpname("得壹(海南)科技有限公司"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if(StringUtils.isEmpty(CrossStockConfig.DEFAULT_COMPANY_CODE) && | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                StringUtils.isEmpty(CrossStockConfig.DEFAULT_COMPANY_NAME)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            bo.setEbpcode(cereShopCrossDetail.getEbpcode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            bo.setEbpname(cereShopCrossDetail.getEbpname()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//            bo.setEbpcode("46016601J4"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//            bo.setEbpname("得壹(海南)科技有限公司"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            bo.setEbpcode(CrossStockConfig.DEFAULT_COMPANY_CODE); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            bo.setEbpname(CrossStockConfig.DEFAULT_COMPANY_NAME); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        bo.setDiscount(cereShopOrder.getDiscountPrice()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        bo.setFreight(cereShopOrder.getLogisticsPrice()); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -125,7 +134,11 @@ public class CrossStockServiceImpl implements CrossStockService{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            IbOrderItemRequestBo item = new IbOrderItemRequestBo(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            item.setPrice(cereOrderProduct.getProductPrice()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            item.setQty(new BigDecimal(cereOrderProduct.getNumber())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            item.setSku(cereOrderProduct.getSKU()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(StringUtils.isEmpty(CrossStockConfig.DEFAULT_SKU)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                item.setSku(cereOrderProduct.getSKU()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                item.setSku(CrossStockConfig.DEFAULT_SKU); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            items.add(item); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            taxtotal = taxtotal.add(cereOrderProduct.getProductPrice() | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -139,8 +152,11 @@ public class CrossStockServiceImpl implements CrossStockService{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        bo.setOrderno(cereShopOrder.getOrderFormid()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					// | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        bo.setPaycode("460116287K"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        bo.setPayname("新生支付有限公司"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        bo.setPaycode(CrossStockConfig.DEFAULT_PAY_COMPANY_CODE); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        bo.setPayname(CrossStockConfig.DEFAULT_PAY_COMPANY_NAME); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//        bo.setPaycode("460116287K"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//        bo.setPayname("新生支付有限公司"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        bo.setPaytransactionid(payTransactionNo); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        bo.setStoreid("DY"); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |