| 
					
				 | 
			
			
				@@ -31,6 +31,7 @@ import com.fs.his.vo.OptionsVO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.hisStore.config.MedicalMallConfig; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.hisStore.domain.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.hisStore.mapper.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.fs.hisStore.param.FsStoreCartCountParam; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.hisStore.utils.StoreAuditLogUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.statis.dto.ModifyMoreDTO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fs.hisStore.dto.ProductArrtDTO; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -61,8 +62,7 @@ import org.springframework.transaction.annotation.Transactional; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 @Service 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 @Slf4j 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private FsStoreProductScrmMapper fsStoreProductMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Autowired 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -110,8 +110,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @return 商品 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public FsStoreProductScrm selectFsStoreProductById(Long productId) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public FsStoreProductScrm selectFsStoreProductById(Long productId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return fsStoreProductMapper.selectFsStoreProductById(productId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -122,8 +121,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @return 商品 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public List<FsStoreProductScrm> selectFsStoreProductList(FsStoreProductScrm fsStoreProduct) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public List<FsStoreProductScrm> selectFsStoreProductList(FsStoreProductScrm fsStoreProduct) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return fsStoreProductMapper.selectFsStoreProductList(fsStoreProduct); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -134,8 +132,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @return 结果 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public int insertFsStoreProduct(FsStoreProductScrm fsStoreProduct) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public int insertFsStoreProduct(FsStoreProductScrm fsStoreProduct) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         fsStoreProduct.setCreateTime(DateUtils.getNowDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         fsStoreProductMapper.insertFsStoreProduct(fsStoreProduct); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         storeAuditLogUtil.addOperLog(fsStoreProduct.getProductId()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -149,8 +146,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @return 结果 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public int updateFsStoreProduct(FsStoreProductScrm fsStoreProduct) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public int updateFsStoreProduct(FsStoreProductScrm fsStoreProduct) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         fsStoreProduct.setUpdateTime(DateUtils.getNowDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         storeAuditLogUtil.addOperLog(fsStoreProduct.getProductId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         FsStoreProductScrm oldFsStoreProduct = fsStoreProductMapper.selectFsStoreProductById(fsStoreProduct.getProductId()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -161,7 +157,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     Map<String, Object> diff = getDiff(oldFsStoreProduct, fsStoreProduct); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     Set<String> diff_columns = diff.keySet(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     JSONArray productColumns = configUtil.generateConfigByKey("medicalMall.func.switch").getJSONArray("productColumns"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if(com.fs.common.utils.StringUtils.isNotEmpty(productColumns)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (com.fs.common.utils.StringUtils.isNotEmpty(productColumns)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         //判断diff_columns是否在productColumns中,不是则将isAudit设置为0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         for (String column : diff_columns) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             if (!productColumns.contains(column)) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -169,7 +165,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         fsStoreProduct.setIsAudit("0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -216,8 +212,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @return 结果 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public int deleteFsStoreProductByIds(Long[] productIds) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public int deleteFsStoreProductByIds(Long[] productIds) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         storeAuditLogUtil.addBatchAuditArray(productIds, "", ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return fsStoreProductMapper.deleteFsStoreProductByIds(productIds); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -229,8 +224,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @return 结果 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public int deleteFsStoreProductById(Long productId) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public int deleteFsStoreProductById(Long productId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return fsStoreProductMapper.deleteFsStoreProductById(productId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -239,20 +233,20 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<FsStoreProductListVO> fsStoreProductListVOS = fsStoreProductMapper.selectFsStoreProductListVO(fsStoreProduct); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (FsStoreProductListVO item : fsStoreProductListVOS) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if(StringUtils.isNotBlank(item.getCompanyIds())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (StringUtils.isNotBlank(item.getCompanyIds())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 List<String> companyNameList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 String[] split = item.getCompanyIds().split(","); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 for (String companyId : split) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if(StringUtils.isNotBlank(companyId)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (StringUtils.isNotBlank(companyId)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         String companyName = companyCacheService.selectCompanyNameById(Long.valueOf(companyId)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         companyNameList.add(companyName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                item.setCompanyName(String.join(",",companyNameList)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                item.setCompanyName(String.join(",", companyNameList)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //店铺名称 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if(StringUtils.isNotEmpty(item.getStoreId())) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (StringUtils.isNotEmpty(item.getStoreId())) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 item.setStoreName(fsStoreScrmService.selectFsStoreByStoreId(Long.parseLong(item.getStoreId())).getStoreName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -264,7 +258,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<FsStoreProductListVO> fsStoreProductListVOS = fsStoreProductMapper.selectFsStoreProductBarCodeListVO(fsStoreProduct); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (FsStoreProductListVO item : fsStoreProductListVOS) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if(StringUtils.isNotBlank(item.getCompanyIds())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (StringUtils.isNotBlank(item.getCompanyIds())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 List<String> companyNameList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 String[] split = item.getCompanyIds().split(","); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -272,14 +266,14 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     String companyName = companyCacheService.selectCompanyNameById(Long.valueOf(companyId)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     companyNameList.add(companyName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                item.setCompanyName(String.join(",",companyNameList)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                item.setCompanyName(String.join(",", companyNameList)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return fsStoreProductListVOS; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public Map<String, Object> getFormatAttr(Long productId, String jsonStr,Long[] stores) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public Map<String, Object> getFormatAttr(Long productId, String jsonStr, Long[] stores) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         JSONObject jsonObject = JSON.parseObject(jsonStr); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Map<String, Object> resultMap = new LinkedHashMap<>(3); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (jsonObject == null || jsonObject.get("attrs") == null || jsonObject.getJSONArray("attrs").isEmpty()) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -345,13 +339,13 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             valueMap.put("brokerageThree", 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             valueMap.put("integral", 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (productId > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                FsStoreProductAttrValueScrm attrValueMap=new FsStoreProductAttrValueScrm(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                FsStoreProductAttrValueScrm attrValueMap = new FsStoreProductAttrValueScrm(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 attrValueMap.setProductId(productId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 attrValueMap.setSku(sku); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 List<FsStoreProductAttrValueScrm> values = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueList(attrValueMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (values != null&&values.size()==1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    valueMap.put("id",values.get(0).getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    valueMap.put("sku",values.get(0).getSku()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (values != null && values.size() == 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    valueMap.put("id", values.get(0).getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    valueMap.put("sku", values.get(0).getSku()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     valueMap.put("image", values.get(0).getImage()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     valueMap.put("price", values.get(0).getPrice()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     valueMap.put("cost", values.get(0).getCost()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -380,9 +374,9 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Transactional 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public R addOrEdit(FsStoreProductAddEditParam param) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ProductAttrCountDto countDto=computedProductCount(param.getValues()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        FsStoreProductScrm product=new FsStoreProductScrm(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        BeanUtils.copyProperties(param,product); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ProductAttrCountDto countDto = computedProductCount(param.getValues()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        FsStoreProductScrm product = new FsStoreProductScrm(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        BeanUtils.copyProperties(param, product); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         product.setPrice(countDto.getMinPrice()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         product.setOtPrice(countDto.getMinOtPrice()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         product.setCost(countDto.getMinCost()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -393,28 +387,43 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Long storeId = param.getStoreId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         product.setStoreId(storeId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         product.setIsDrug(param.getIsDrug().toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        product.setInstructionManual(param.getInstructionManual()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        product.setReviewAudit(param.getReviewAudit()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        product.setQualificationCertificate(param.getQualificationCertificate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (param.getQualificationCertificateStart() != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            product.setQualificationCertificateStart(LocalDate.parse(param.getQualificationCertificateStart())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (param.getQualificationCertificateEnd() != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            product.setQualificationCertificateEnd(LocalDate.parse(param.getQualificationCertificateEnd())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //获取商品编码 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!param.getValues().isEmpty()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (param.getValues().get(0).getBarCode() != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                product.setBarCode(param.getValues().get(0).getBarCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //校验店铺资质信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //获取店铺 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         FsStoreScrm store = fsStoreScrmService.selectFsStoreByStoreId(product.getStoreId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if(store == null || 1 != store.getStatus()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (store == null || 1 != store.getStatus()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return R.error("店铺不存在或未启用"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //验证资质 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            switch (product.getProductType()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            switch (product.getProductType()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 case 1://非处方 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 case 2://处方 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if(StringUtils.isEmpty(store.getDrugLicense()) || "".equals(store.getDrugLicense()) ||  LocalDate.now().isAfter(store.getDrugLicenseExpiryEnd())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (StringUtils.isEmpty(store.getDrugLicense()) || "".equals(store.getDrugLicense()) || LocalDate.now().isAfter(store.getDrugLicenseExpiryEnd())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         return R.error("店铺药品资质为空或已过期,请完善后再添加"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 case 3://食品 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if(StringUtils.isEmpty(store.getFoodLicense()) || "".equals(store.getFoodLicense()) ||  LocalDate.now().isAfter(store.getFoodLicenseExpiryEnd())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (StringUtils.isEmpty(store.getFoodLicense()) || "".equals(store.getFoodLicense()) || LocalDate.now().isAfter(store.getFoodLicenseExpiryEnd())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         return R.error("店铺食品资质为空或已过期,请完善后再添加"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 case 4://器械 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if(StringUtils.isEmpty(store.getMedicalDevice3()) || "".equals(store.getMedicalDevice3()) ||  LocalDate.now().isAfter(store.getMedicalDevice3ExpiryEnd())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (StringUtils.isEmpty(store.getMedicalDevice3()) || "".equals(store.getMedicalDevice3()) || LocalDate.now().isAfter(store.getMedicalDevice3ExpiryEnd())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         return R.error("店铺器械资质为空或已过期,请完善后再添加"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     break; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -423,11 +432,11 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if("纯正堂".equals(cloudHostProper.getCompanyName())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ("纯正堂".equals(cloudHostProper.getCompanyName())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             product.setIsAudit("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if(param.getProductId() != null && param.getProductId() > 0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (param.getProductId() != null && param.getProductId() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             FsStoreProductScrm oldFsStoreProduct = fsStoreProductMapper.selectFsStoreProductById(product.getProductId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             Boolean isAudit = configUtil.generateConfigByKey("medicalMall.func.switch").getBoolean("isAudit"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             try { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -436,7 +445,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         Map<String, Object> diff = getDiff(oldFsStoreProduct, product); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         Set<String> diff_columns = diff.keySet(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         JSONArray productColumns = configUtil.generateConfigByKey("medicalMall.func.switch").getJSONArray("productColumns"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        if(com.fs.common.utils.StringUtils.isNotEmpty(productColumns)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (com.fs.common.utils.StringUtils.isNotEmpty(productColumns)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             //判断diff_columns是否在productColumns中,不是则将isAudit设置为0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             for (String column : diff_columns) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 if (!productColumns.contains(column)) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -444,7 +453,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             product.setIsAudit("0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -458,15 +467,14 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         .value("规格") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         .detail(ListUtil.toList("默认")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         .build(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                List<ProductArrtDTO> items=new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<ProductArrtDTO> items = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 items.add(fromatDetailDto); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 param.getValues().get(0).setSku("默认"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                addProductAttr(product.getProductId(),items,param.getValues(),storeId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                addProductAttr(product.getProductId(), items, param.getValues(), storeId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                addProductAttr(product.getProductId(),param.getItems(),param.getValues(),storeId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                addProductAttr(product.getProductId(), param.getItems(), param.getValues(), storeId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             fsStoreProductMapper.insertFsStoreProduct(product); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         storeAuditLogUtil.addOperLog(product.getProductId()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -475,52 +483,52 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     .value("规格") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     .detail(ListUtil.toList("默认")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     .build(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            List<ProductArrtDTO> items=new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            List<ProductArrtDTO> items = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             items.add(fromatDetailDto); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             param.getValues().get(0).setSku("默认"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            addProductAttr(product.getProductId(),items,param.getValues(),storeId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            addProductAttr(product.getProductId(), items, param.getValues(), storeId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            addProductAttr(product.getProductId(),param.getItems(),param.getValues(),storeId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            addProductAttr(product.getProductId(), param.getItems(), param.getValues(), storeId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return R.ok(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private void addProductAttr(Long productId, List<ProductArrtDTO> items, List<FsStoreProductAttrValueScrm> values,Long storeId){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void addProductAttr(Long productId, List<ProductArrtDTO> items, List<FsStoreProductAttrValueScrm> values, Long storeId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //清空attr 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         fsStoreProductAttrMapper.clear(productId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //清空values 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //查出商品属性所有ID; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<FsStoreProductAttrValueScrm> attrValues=fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(productId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<FsStoreProductAttrValueScrm> attrValues = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(productId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         fsStoreProductAttrValueMapper.deleteFsStoreProductAttrValueByProductId(productId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //写入attr 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        for(ProductArrtDTO vo:items){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            FsStoreProductAttrScrm attr=new FsStoreProductAttrScrm(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for (ProductArrtDTO vo : items) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            FsStoreProductAttrScrm attr = new FsStoreProductAttrScrm(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             attr.setProductId(productId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             attr.setAttrName(vo.getValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             attr.setAttrValues(StringUtils.join(vo.getDetail(), ",")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             fsStoreProductAttrMapper.insertFsStoreProductAttr(attr); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        Map<String,Object> map = new LinkedHashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        map.put("attr",items); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Map<String, Object> map = new LinkedHashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        map.put("attr", items); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // map.put("value",values); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        for(FsStoreProductAttrValueScrm val: values){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for (FsStoreProductAttrValueScrm val : values) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //更新套餐商品属性ID  获取套餐 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Long id=val.getId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if(val.getDetail()!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Long id = val.getId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (val.getDetail() != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 List<String> stringList = new ArrayList<>(val.getDetail().values()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 Collections.sort(stringList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                val.setSku(StrUtil.join(",",stringList)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                val.setSku(StrUtil.join(",", stringList)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             val.setProductId(productId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             val.setStoreId(storeId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             fsStoreProductAttrValueMapper.insertFsStoreProductAttrValue(val); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if(attrValues!=null&&attrValues.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                for(FsStoreProductAttrValueScrm attrValue:attrValues){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if(attrValue.getId().equals(id)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        fsStoreProductGroupMapper.updateProducts(attrValue.getId(),val.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        fsStoreProductPackageMapper.updateProducts(attrValue.getId(),val.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (attrValues != null && attrValues.size() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                for (FsStoreProductAttrValueScrm attrValue : attrValues) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (attrValue.getId().equals(id)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        fsStoreProductGroupMapper.updateProducts(attrValue.getId(), val.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        fsStoreProductPackageMapper.updateProducts(attrValue.getId(), val.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -700,9 +708,8 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private ProductAttrCountDto computedProductCount(List<FsStoreProductAttrValueScrm> values) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        BigDecimal val=new BigDecimal(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        BigDecimal val = new BigDecimal(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //取最小价格 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         BigDecimal minPrice = values 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .stream() 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -755,35 +762,34 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public List<FsStoreProductListQueryVO> selectFsStoreProductListQuery(FsStoreProductQueryParam param) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         SysConfig config = configService.selectConfigByConfigKey("medicalMall.func.switch"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         MedicalMallConfig medicalMallConfig = JSON.parseObject(config.getConfigValue(), MedicalMallConfig.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         boolean stores = medicalMallConfig != null && medicalMallConfig.isStores(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        param.setIsStores(stores?1:0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        param.setIsStores(stores ? 1 : 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return fsStoreProductMapper.selectFsStoreProductListQuery(param); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public FsStoreProductQueryVO selectFsStoreProductByIdQuery(Long productId,String storeId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public FsStoreProductQueryVO selectFsStoreProductByIdQuery(Long productId, String storeId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         SysConfig config = configService.selectConfigByConfigKey("medicalMall.func.switch"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         MedicalMallConfig medicalMallConfig = JSON.parseObject(config.getConfigValue(), MedicalMallConfig.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return fsStoreProductMapper.selectFsStoreProductByIdQuery(productId,storeId,medicalMallConfig); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return fsStoreProductMapper.selectFsStoreProductByIdQuery(productId, storeId, medicalMallConfig); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public void decProductStock(Long productId, Long productAttrValueId, Integer cartNum) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //处理属性sku 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        fsStoreProductAttrValueMapper.decProductAttrStock(productAttrValueId,cartNum); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        fsStoreProductMapper.decProductAttrStock(productId,cartNum); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        fsStoreProductAttrValueMapper.decProductAttrStock(productAttrValueId, cartNum); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        fsStoreProductMapper.decProductAttrStock(productId, cartNum); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public void incProductStock(Long num, Long productId, Long productAttrValueId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //处理属性sku 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (productAttrValueId!=null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (productAttrValueId != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             attrValueService.incProductAttrStock(num, productId, productAttrValueId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //先处理商品库存 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -815,7 +821,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public List<FsStoreProductListQueryVO> selectFsStoreProductGoodQuery(int count) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         SysConfig config = configService.selectConfigByConfigKey("medicalMall.func.switch"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         MedicalMallConfig medicalMallConfig = JSON.parseObject(config.getConfigValue(), MedicalMallConfig.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return fsStoreProductMapper.selectFsStoreProductGoodQuery(count,medicalMallConfig); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return fsStoreProductMapper.selectFsStoreProductGoodQuery(count, medicalMallConfig); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -839,7 +845,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public Long selectFsStoreProductCount(int type, Long companyId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return fsStoreProductMapper.selectFsStoreProductCompanyCount(type,companyId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return fsStoreProductMapper.selectFsStoreProductCompanyCount(type, companyId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -861,19 +867,17 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public String importStoreProduct(List<FsStoreProductExportVO> list, boolean updateSupport) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         storeAuditLogUtil.generateOperId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (com.fs.common.utils.StringUtils.isNull(list) || list.size() == 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (com.fs.common.utils.StringUtils.isNull(list) || list.size() == 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             throw new CustomException("导入商品数据不能为空!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         int successNum = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         int failureNum = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         StringBuilder successMsg = new StringBuilder(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         StringBuilder failureMsg = new StringBuilder(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        for (FsStoreProductExportVO productVO : list){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            try 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for (FsStoreProductExportVO productVO : list) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 FsStoreProductScrm product = BeanCopyUtils.copy(productVO, FsStoreProductScrm.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (product.getBarCode()==null || product.getBarCode()==""){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (product.getBarCode() == null || product.getBarCode() == "") { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     throw new CustomException("商品编号为空"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 this.insertFsStoreProduct(product); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -881,36 +885,36 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         .value("规格") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         .detail(ListUtil.toList("默认")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         .build(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                List<ProductArrtDTO> items=new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<ProductArrtDTO> items = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 items.add(formatDetailDto); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 FsStoreProductAttrValueScrm p = new FsStoreProductAttrValueScrm(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 p.setProductId(product.getProductId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 p.setSku("默认"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 p.setStock(product.getStock().intValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (product.getStock()==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (product.getStock() == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     p.setStock(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 p.setSales(product.getSales().intValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (product.getSales()==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (product.getSales() == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     p.setStock(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 p.setPrice(product.getPrice()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (product.getPrice()==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (product.getPrice() == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     p.setPrice(new BigDecimal(0)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 p.setImage(product.getImage()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 p.setCost(product.getCost()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (product.getCost()==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (product.getCost() == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     p.setCost(new BigDecimal(0)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 p.setBarCode(product.getBarCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 p.setGroupBarCode(product.getBarCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 p.setOtPrice(product.getOtPrice()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (product.getOtPrice()==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (product.getOtPrice() == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     p.setOtPrice(new BigDecimal(0)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 p.setWeight(productVO.getWeight()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (productVO.getWeight()==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (productVO.getWeight() == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     p.setWeight(new BigDecimal(0)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -929,23 +933,18 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 fsStoreProductAttrMapper.insertFsStoreProductAttr(attr); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 successNum++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 successMsg.append("<br/>" + successNum + "、商品 " + product.getProductName() + " 导入成功"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            catch (Exception e) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } catch (Exception e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 failureNum++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                String msg = "<br/>" + failureNum + "、商品 " + productVO.getProductName()  + " 导入失败:"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                String msg = "<br/>" + failureNum + "、商品 " + productVO.getProductName() + " 导入失败:"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 failureMsg.append(msg + e.getMessage()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (failureNum > 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (failureNum > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             throw new CustomException(failureMsg.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return successMsg.toString(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -953,7 +952,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public void batchModify(ModifyMoreDTO modifyMoreDTO) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        storeAuditLogUtil.addBatchAuditList(modifyMoreDTO.getProductId(),"",null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        storeAuditLogUtil.addBatchAuditList(modifyMoreDTO.getProductId(), "", null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         fsStoreProductMapper.batchModify(modifyMoreDTO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -973,7 +972,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         StringBuilder failureMsg = new StringBuilder(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //存储商品Id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<Long> jstProductIds=new LinkedList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<Long> jstProductIds = new LinkedList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (FsStoreProductExcelVO productVO : productList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1067,17 +1066,17 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 Integer erpOpen = sysConfig.getErpOpen(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (erpOpen == null || erpOpen == 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     //不作操作 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     //判断erp类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     Integer erpType = sysConfig.getErpType(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     if (erpType == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         //不作操作 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    }else if (erpType == 3) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } else if (erpType == 3) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         ErpGoods params = new ErpGoods(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         params.setStoreProductId(product.getProductId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         //瀚智OMS 维护添加商品 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         hzOMSErpGoodsService.addGoodsScrm(params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    }else if(erpType == 5){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } else if (erpType == 5) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         jstProductIds.add(product.getProductId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1090,7 +1089,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //验证聚水潭商品Id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if(!jstProductIds.isEmpty()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!jstProductIds.isEmpty()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //同步聚水潭商品 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             ErpGoods params = new ErpGoods(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             params.setProductIdList(jstProductIds); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1133,7 +1132,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Transactional 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public void batchAudit(ProductAuditDTO auditDTO) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         fsStoreProductMapper.batchAudit(auditDTO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        storeAuditLogUtil.addBatchAuditList(auditDTO.getProductIds(),auditDTO.getReason(),auditDTO.getAttachImage()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        storeAuditLogUtil.addBatchAuditList(auditDTO.getProductIds(), auditDTO.getReason(), auditDTO.getAttachImage()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1142,9 +1141,10 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public List<FsStoreProductActivityListVO> selectFsStoreProductByIdsAudit(String productIds) {SysConfig config = configService.selectConfigByConfigKey("medicalMall.func.switch"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public List<FsStoreProductActivityListVO> selectFsStoreProductByIdsAudit(String productIds) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SysConfig config = configService.selectConfigByConfigKey("medicalMall.func.switch"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         MedicalMallConfig medicalMallConfig = JSON.parseObject(config.getConfigValue(), MedicalMallConfig.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return fsStoreProductMapper.selectFsStoreProductByIdsAudit(productIds,medicalMallConfig); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return fsStoreProductMapper.selectFsStoreProductByIdsAudit(productIds, medicalMallConfig); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1152,10 +1152,10 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public R bulkCopyFsStoreProductByIds(Long[] productIds) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         storeAuditLogUtil.addBatchAuditArray(productIds, "", ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<FsStoreProductScrm> list = fsStoreProductMapper.bulkCopyFsStoreProductByIds(productIds); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if(list != null && !list.isEmpty()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (list != null && !list.isEmpty()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             for (FsStoreProductScrm product : list) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 List<FsStoreProductAttrValueScrm> param = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(product.getProductId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if(!("益善缘".equals(cloudHostProper.getCompanyName()))) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (!("益善缘".equals(cloudHostProper.getCompanyName()))) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     //获取店铺 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     FsStoreScrm store = fsStoreScrmService.selectFsStoreByStoreId(product.getStoreId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     if (store == null || 1 != store.getStatus()) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1196,10 +1196,10 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             .value("规格") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             .detail(ListUtil.toList("默认")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             .build(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    List<ProductArrtDTO> items=new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    List<ProductArrtDTO> items = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     items.add(fromatDetailDto); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     param.get(0).setSku("默认"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    addProductAttr(product.getProductId(),items,param,product.getStoreId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    addProductAttr(product.getProductId(), items, param, product.getStoreId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     List<FsStoreProductAttrScrm> items = fsStoreProductAttrMapper.selectFsStoreProductAttrByProductId(product.getProductId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1207,33 +1207,33 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     fsStoreProductAttrMapper.clear(fsStoreProductId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     //清空values 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     //查出商品属性所有ID; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    List<FsStoreProductAttrValueScrm> attrValues=fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(fsStoreProductId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    List<FsStoreProductAttrValueScrm> attrValues = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(fsStoreProductId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     fsStoreProductAttrValueMapper.deleteFsStoreProductAttrValueByProductId(fsStoreProductId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     //写入attr 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    for(FsStoreProductAttrScrm vo:items){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    for (FsStoreProductAttrScrm vo : items) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         vo.setProductId(fsStoreProductId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         fsStoreProductAttrMapper.insertFsStoreProductAttr(vo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    Map<String,Object> map = new LinkedHashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    map.put("attr",items); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Map<String, Object> map = new LinkedHashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    map.put("attr", items); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     // map.put("value",values); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    for(FsStoreProductAttrValueScrm val: param){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    for (FsStoreProductAttrValueScrm val : param) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         //更新套餐商品属性ID  获取套餐 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        Long id=val.getId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        if(val.getDetail()!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Long id = val.getId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (val.getDetail() != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             List<String> stringList = new ArrayList<>(val.getDetail().values()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             Collections.sort(stringList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            val.setSku(StrUtil.join(",",stringList)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            val.setSku(StrUtil.join(",", stringList)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         val.setProductId(fsStoreProductId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         fsStoreProductAttrValueMapper.insertFsStoreProductAttrValue(val); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        if(attrValues!=null && !attrValues.isEmpty()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            for(FsStoreProductAttrValueScrm attrValue:attrValues){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                                if(attrValue.getId().equals(id)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                                    fsStoreProductGroupMapper.updateProducts(attrValue.getId(),val.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                                    fsStoreProductPackageMapper.updateProducts(attrValue.getId(),val.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (attrValues != null && !attrValues.isEmpty()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            for (FsStoreProductAttrValueScrm attrValue : attrValues) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (attrValue.getId().equals(id)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    fsStoreProductGroupMapper.updateProducts(attrValue.getId(), val.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    fsStoreProductPackageMapper.updateProducts(attrValue.getId(), val.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1250,14 +1250,27 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return fsStoreProductMapper.getStoreProductInProductIds(productIds); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public R instructionsViewable(FsStoreCartCountParam param) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //判断商品是否存在 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        FsStoreProductScrm productScrm = fsStoreProductMapper.selectFsStoreProductById(param.getProductId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (productScrm == null || productScrm.getProductType() == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return R.error("商品数据不存在,或类型异常!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else if (productScrm.getProductType() != 2) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return R.ok().put("data", true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return R.ok().put("data", fsStoreProductMapper.instructionsViewable(param) > 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public List<Map<String, String>> getStoreProductColumns() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<Map<String, String> > list = fsStoreProductMapper.getStoreProductColumns(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<Map<String, String>> list = fsStoreProductMapper.getStoreProductColumns(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<Map<String, String>> result = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (Map<String, String> column : list) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             Map<String, String> camelCaseColumn = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             String columnName = column.get("colName"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            String camelCaseName = com.fs.common.utils.StringUtils.toCamelCase(columnName);; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String camelCaseName = com.fs.common.utils.StringUtils.toCamelCase(columnName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             camelCaseColumn.put("colName", camelCaseName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             camelCaseColumn.put("colComment", column.get("colComment")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             result.add(camelCaseColumn); 
			 |