| 
														
															@@ -7,12 +7,14 @@ import com.fs.common.core.redis.RedisCache; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.company.domain.CompanyUser; 
														 | 
														
														 | 
														
															 import com.fs.company.domain.CompanyUser; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.company.mapper.CompanyUserMapper; 
														 | 
														
														 | 
														
															 import com.fs.company.mapper.CompanyUserMapper; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.core.security.SecurityUtils; 
														 | 
														
														 | 
														
															 import com.fs.core.security.SecurityUtils; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.fs.erp.constant.ErpTypeConstant; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.erp.domain.ErpDeliverys; 
														 | 
														
														 | 
														
															 import com.fs.erp.domain.ErpDeliverys; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.erp.domain.ErpGoods; 
														 | 
														
														 | 
														
															 import com.fs.erp.domain.ErpGoods; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.erp.domain.ErpOrderQuery; 
														 | 
														
														 | 
														
															 import com.fs.erp.domain.ErpOrderQuery; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.erp.dto.*; 
														 | 
														
														 | 
														
															 import com.fs.erp.dto.*; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.erp.service.IErpGoodsService; 
														 | 
														
														 | 
														
															 import com.fs.erp.service.IErpGoodsService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.erp.service.IErpOrderService; 
														 | 
														
														 | 
														
															 import com.fs.erp.service.IErpOrderService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.fs.erp.utils.ErpContextHolder; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.config.StoreConfig; 
														 | 
														
														 | 
														
															 import com.fs.store.config.StoreConfig; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.domain.*; 
														 | 
														
														 | 
														
															 import com.fs.store.domain.*; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.dto.StoreProductGroupDTO; 
														 | 
														
														 | 
														
															 import com.fs.store.dto.StoreProductGroupDTO; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -39,6 +41,7 @@ import java.text.ParseException; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.time.LocalDateTime; 
														 | 
														
														 | 
														
															 import java.time.LocalDateTime; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.util.ArrayList; 
														 | 
														
														 | 
														
															 import java.util.ArrayList; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.util.List; 
														 | 
														
														 | 
														
															 import java.util.List; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import java.util.Map; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.util.Set; 
														 | 
														
														 | 
														
															 import java.util.Set; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import static com.fs.store.constants.StoreConstants.DELIVERY; 
														 | 
														
														 | 
														
															 import static com.fs.store.constants.StoreConstants.DELIVERY; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -63,6 +66,9 @@ public class StoreTask { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Autowired 
														 | 
														
														 | 
														
															     @Autowired 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     private IFsUserService userService; 
														 | 
														
														 | 
														
															     private IFsUserService userService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @Autowired 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private FsStoreProductMapper fsStoreProductMapper; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Autowired 
														 | 
														
														 | 
														
															     @Autowired 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     private IErpOrderService erpOrderService; 
														 | 
														
														 | 
														
															     private IErpOrderService erpOrderService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -112,6 +118,8 @@ public class StoreTask { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Autowired 
														 | 
														
														 | 
														
															     @Autowired 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     private FsWxExpressTaskMapper fsWxExpressTaskMapper; 
														 | 
														
														 | 
														
															     private FsWxExpressTaskMapper fsWxExpressTaskMapper; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @Autowired 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private FsWarehousesMapper fsWarehousesMapper; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     /** 
														 | 
														
														 | 
														
															     /** 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * 发货任务 
														 | 
														
														 | 
														
															      * 发货任务 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -125,6 +133,11 @@ public class StoreTask { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             String orderCode = order.getOrderCode(); 
														 | 
														
														 | 
														
															             String orderCode = order.getOrderCode(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             ErpOrderQueryRequert request = new ErpOrderQueryRequert(); 
														 | 
														
														 | 
														
															             ErpOrderQueryRequert request = new ErpOrderQueryRequert(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             request.setCode(order.getExtendOrderId()); 
														 | 
														
														 | 
														
															             request.setCode(order.getExtendOrderId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            // 根据仓库code找erp 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            if(com.fs.common.utils.StringUtils.isNotBlank(order.getStoreHouseCode())){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                String erp = fsWarehousesMapper.selectErpByCode(order.getStoreHouseCode()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                ErpContextHolder.setErpType(erp); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             ErpOrderQueryResponse response = erpOrderService.getOrder(request); 
														 | 
														
														 | 
														
															             ErpOrderQueryResponse response = erpOrderService.getOrder(request); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if (CollectionUtils.isNotEmpty(response.getOrders())) { 
														 | 
														
														 | 
														
															             if (CollectionUtils.isNotEmpty(response.getOrders())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 for (ErpOrderQuery orderQuery : response.getOrders()) { 
														 | 
														
														 | 
														
															                 for (ErpOrderQuery orderQuery : response.getOrders()) { 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -227,12 +240,20 @@ public class StoreTask { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         String json = configService.selectConfigByKey("store.config"); 
														 | 
														
														 | 
														
															         String json = configService.selectConfigByKey("store.config"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         StoreConfig config = JSONUtil.toBean(json, StoreConfig.class); 
														 | 
														
														 | 
														
															         StoreConfig config = JSONUtil.toBean(json, StoreConfig.class); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         List<FsStoreProductAttrValue> values = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueList(new FsStoreProductAttrValue()); 
														 | 
														
														 | 
														
															         List<FsStoreProductAttrValue> values = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueList(new FsStoreProductAttrValue()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        Map<Long, FsStoreProduct> fsStoreProductMap = fsStoreProductMapper.selectAllProductMappingInfo(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         int i = 0; 
														 | 
														
														 | 
														
															         int i = 0; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         for (FsStoreProductAttrValue value : values) { 
														 | 
														
														 | 
														
															         for (FsStoreProductAttrValue value : values) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             try { 
														 | 
														
														 | 
														
															             try { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 if (StringUtils.isNotEmpty(value.getBarCode())) { 
														 | 
														
														 | 
														
															                 if (StringUtils.isNotEmpty(value.getBarCode())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     ErpGoodsQueryRequert query = new ErpGoodsQueryRequert(); 
														 | 
														
														 | 
														
															                     ErpGoodsQueryRequert query = new ErpGoodsQueryRequert(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     query.setCode(value.getBarCode()); 
														 | 
														
														 | 
														
															                     query.setCode(value.getBarCode()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    FsStoreProduct fsStoreProduct = fsStoreProductMap.get(value.getProductId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    String erp = fsStoreProduct.getErp(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    ErpContextHolder.setErpType(erp); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     ErpGoodsQueryResponse goods = erpGoodsService.getGoods(query); 
														 | 
														
														 | 
														
															                     ErpGoodsQueryResponse goods = erpGoodsService.getGoods(query); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     List<ErpGoods> items = goods.getItems(); 
														 | 
														
														 | 
														
															                     List<ErpGoods> items = goods.getItems(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     if (items != null && items.size() > 0) { 
														 | 
														
														 | 
														
															                     if (items != null && items.size() > 0) { 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -261,6 +282,11 @@ public class StoreTask { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                 String barCode = attrValue.getBarCode(); 
														 | 
														
														 | 
														
															                                 String barCode = attrValue.getBarCode(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                 ErpGoodsQueryRequert query = new ErpGoodsQueryRequert(); 
														 | 
														
														 | 
														
															                                 ErpGoodsQueryRequert query = new ErpGoodsQueryRequert(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                 query.setCode(barCode); 
														 | 
														
														 | 
														
															                                 query.setCode(barCode); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                FsStoreProduct fsStoreProduct = fsStoreProductMap.get(value.getProductId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                String erp = fsStoreProduct.getErp(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                ErpContextHolder.setErpType(erp); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                 ErpGoodsQueryResponse goods = erpGoodsService.getGoods(query); 
														 | 
														
														 | 
														
															                                 ErpGoodsQueryResponse goods = erpGoodsService.getGoods(query); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                 List<ErpGoods> items = goods.getItems(); 
														 | 
														
														 | 
														
															                                 List<ErpGoods> items = goods.getItems(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                 if (items != null && items.size() > 0) { 
														 | 
														
														 | 
														
															                                 if (items != null && items.size() > 0) { 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -286,6 +312,8 @@ public class StoreTask { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } catch (Exception e) { 
														 | 
														
														 | 
														
															             } catch (Exception e) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 logger.info("商品更新成本价错误:" + value.getId()); 
														 | 
														
														 | 
														
															                 logger.info("商品更新成本价错误:" + value.getId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            }finally { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                ErpContextHolder.clear(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -454,6 +482,12 @@ public class StoreTask { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         for (FsStoreOrder order : list) { 
														 | 
														
														 | 
														
															         for (FsStoreOrder order : list) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             ErpOrderQueryRequert request = new ErpOrderQueryRequert(); 
														 | 
														
														 | 
														
															             ErpOrderQueryRequert request = new ErpOrderQueryRequert(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             request.setCode(order.getExtendOrderId()); 
														 | 
														
														 | 
														
															             request.setCode(order.getExtendOrderId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            // 根据仓库code找erp 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            if(com.fs.common.utils.StringUtils.isNotBlank(order.getStoreHouseCode())){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                String erp = fsWarehousesMapper.selectErpByCode(order.getStoreHouseCode()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                ErpContextHolder.setErpType(erp); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             ErpOrderQueryResponse response = erpOrderService.getOrder(request); 
														 | 
														
														 | 
														
															             ErpOrderQueryResponse response = erpOrderService.getOrder(request); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if (CollectionUtils.isNotEmpty(response.getOrders())) { 
														 | 
														
														 | 
														
															             if (CollectionUtils.isNotEmpty(response.getOrders())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 for (ErpOrderQuery orderQuery : response.getOrders()) { 
														 | 
														
														 | 
														
															                 for (ErpOrderQuery orderQuery : response.getOrders()) { 
														 |