|
|
@@ -39,6 +39,7 @@ import com.fs.hisStore.domain.*;
|
|
|
import com.fs.hisStore.dto.ForbiddenDrugItemDTO;
|
|
|
import com.fs.hisStore.dto.FsStoreProductScrmInfoDTO;
|
|
|
import com.fs.hisStore.mapper.*;
|
|
|
+import com.fs.hisStore.param.FsPlatFormProductAddEditParam;
|
|
|
import com.fs.hisStore.param.FsStoreCartCountParam;
|
|
|
import com.fs.hisStore.service.IFsPlatformProductScrmService;
|
|
|
import com.fs.hisStore.service.IFsStoreProductCategoryScrmService;
|
|
|
@@ -46,6 +47,7 @@ import com.fs.hisStore.service.categoryVal.AbstractHandler;
|
|
|
import com.fs.hisStore.service.categoryVal.ProductCategoryCheckFactory;
|
|
|
import com.fs.hisStore.util.DrugComponentAnalyzer;
|
|
|
import com.fs.hisStore.util.ForbiddenDrugListManager;
|
|
|
+import com.fs.hisStore.util.FsProductUtils;
|
|
|
import com.fs.hisStore.utils.StoreAuditLogUtil;
|
|
|
import com.fs.hisStore.util.BusinessScopeProductTypeUtil;
|
|
|
import com.fs.statis.dto.ModifyMoreDTO;
|
|
|
@@ -132,7 +134,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
|
|
|
@Lazy
|
|
|
@Autowired
|
|
|
- private IFsPlatformProductScrmService ifsPlatformProductService;
|
|
|
+ private IFsPlatformProductScrmMapper iFsPlatformProductScrmMapper;
|
|
|
|
|
|
|
|
|
private ForbiddenDrugListManager forbiddenListManager = new ForbiddenDrugListManager();
|
|
|
@@ -399,7 +401,6 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
// if(StringUtils.isNotEmpty(item.getStoreId()))
|
|
|
// item.setStoreName(fsStoreScrmService.selectFsStoreByStoreId(Long.parseLong(item.getStoreId())).getStoreName());
|
|
|
}
|
|
|
-
|
|
|
return fsStoreProductListVOS;
|
|
|
}
|
|
|
|
|
|
@@ -601,7 +602,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
fsStoreProductMapper.insertFsStoreProduct(product);
|
|
|
}
|
|
|
storeAuditLogUtil.addOperLog(product.getProductId());
|
|
|
- //处理多规格
|
|
|
+ //处理规格
|
|
|
handleProductAttributes(param, product, storeId);
|
|
|
return R.ok();
|
|
|
}
|
|
|
@@ -614,7 +615,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
.build();
|
|
|
List<ProductArrtDTO> items=new ArrayList<>();
|
|
|
items.add(fromatDetailDto);
|
|
|
- param.getValues().get(0).setSku("每"+param.getUnitName());
|
|
|
+ param.getValues().get(0).setSku(param.getUnitName());
|
|
|
addProductAttr(product.getProductId(),items, param.getValues(), storeId);
|
|
|
} else {
|
|
|
addProductAttr(product.getProductId(), param.getItems(), param.getValues(), storeId);
|
|
|
@@ -628,7 +629,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
* @param values 属性值
|
|
|
* @param storeId 店铺id
|
|
|
*/
|
|
|
- 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
|
|
|
@@ -1318,14 +1319,37 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
// 正常情况是退回后可以申请重新上架的如果不通过2,那么show就变回0(直接在sql中去做的),按照原有逻辑去做
|
|
|
fsStoreProductMapper.batchAudit(auditDTO);
|
|
|
storeAuditLogUtil.addBatchAuditList(auditDTO.getProductIds(),auditDTO.getReason(),auditDTO.getAttachImage());
|
|
|
- //TODO 平台商品库
|
|
|
-// if(auditDTO.getIsAudit() == 1){
|
|
|
-// //复制一份到平台商品库
|
|
|
-// for(Long productId : auditDTO.getProductIds()){
|
|
|
-// fsStoreProductMapper.selectFsStoreProductById(auditDTO.getProductIds());
|
|
|
-// ifsPlatformProductService.addOrEdit(auditDTO);
|
|
|
-// }
|
|
|
-// }
|
|
|
+ //审核通过进入、平台商品库
|
|
|
+ if(auditDTO.getIsAudit() == 1){
|
|
|
+ //复制一份到平台商品库
|
|
|
+ for(Long storeProductId : auditDTO.getProductIds()){
|
|
|
+ //复制商品
|
|
|
+ FsStoreProductScrm fsStoreProductScrm = fsStoreProductMapper.selectFsStoreProductById(storeProductId);
|
|
|
+ FsPlatformProductScrm fsPlatformProductScrm = new FsPlatformProductScrm();
|
|
|
+ BeanUtils.copyProperties(fsStoreProductScrm, fsPlatformProductScrm); //copy
|
|
|
+// Long storeProductId = fsPlatformProductScrm.getProductId();//店铺商品id
|
|
|
+ Long id = FsProductUtils.createId();//平台总库商品id
|
|
|
+ fsPlatformProductScrm.setStoreProductId(storeProductId);
|
|
|
+ fsPlatformProductScrm.setProductId(id);
|
|
|
+ fsPlatformProductScrm.setIsShow(9);//对比字典store_product_is_show,草稿
|
|
|
+ fsPlatformProductScrm.setStoreId(null);
|
|
|
+ iFsPlatformProductScrmMapper.insertFsPlatformProduct(fsPlatformProductScrm);
|
|
|
+ //复制规格
|
|
|
+ List<FsStoreProductAttrScrm> fsStoreProductAttrScrms = fsStoreProductAttrMapper.selectFsStoreProductAttrByProductId(storeProductId);
|
|
|
+ for (FsStoreProductAttrScrm fsStoreProductAttrScrm : fsStoreProductAttrScrms){
|
|
|
+ fsStoreProductAttrScrm.setId(null);
|
|
|
+ fsStoreProductAttrScrm.setProductId(id);
|
|
|
+ fsStoreProductAttrMapper.insertFsStoreProductAttr(fsStoreProductAttrScrm);
|
|
|
+ }
|
|
|
+ List<FsStoreProductAttrValueScrm> fsStoreProductAttrValueScrms = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(storeProductId);
|
|
|
+ for (FsStoreProductAttrValueScrm fsStoreProductAttrValueScrm : fsStoreProductAttrValueScrms){
|
|
|
+ fsStoreProductAttrValueScrm.setId(null);
|
|
|
+ fsStoreProductAttrValueScrm.setProductId(id);
|
|
|
+ fsStoreProductAttrValueScrm.setStoreId(null);
|
|
|
+ fsStoreProductAttrValueMapper.insertFsStoreProductAttrValue(fsStoreProductAttrValueScrm);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|