|
|
@@ -169,6 +169,9 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
@Autowired
|
|
|
private FsStoreProductTagRelationScrmMapper fsStoreProductTagRelationScrmMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FsStoreProductUserEndCategoryMapper fsStoreProductUserEndCategoryMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 清除商品详情缓存
|
|
|
* @param productId 商品ID
|
|
|
@@ -273,6 +276,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
if (productIds != null) {
|
|
|
for (Long pid : productIds) {
|
|
|
if (pid != null) {
|
|
|
+ fsStoreProductUserEndCategoryMapper.deleteByProductId(pid);
|
|
|
fsStoreProductTagRelationScrmMapper.deleteByProductId(pid);
|
|
|
}
|
|
|
}
|
|
|
@@ -538,6 +542,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
public int deleteFsStoreProductById(Long productId)
|
|
|
{
|
|
|
if (productId != null) {
|
|
|
+ fsStoreProductUserEndCategoryMapper.deleteByProductId(productId);
|
|
|
fsStoreProductTagRelationScrmMapper.deleteByProductId(productId);
|
|
|
}
|
|
|
int result = fsStoreProductMapper.deleteFsStoreProductById(productId);
|
|
|
@@ -797,6 +802,10 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
} else {
|
|
|
addProductAttr(product.getProductId(),param.getItems(),param.getValues());
|
|
|
}
|
|
|
+ fsStoreProductUserEndCategoryMapper.deleteByProductId(product.getProductId());
|
|
|
+ if (param.getUserEndCategoryIds() != null && !param.getUserEndCategoryIds().isEmpty()) {
|
|
|
+ fsStoreProductUserEndCategoryMapper.insertBatch(product.getProductId(), param.getUserEndCategoryIds());
|
|
|
+ }
|
|
|
fsStoreProductTagRelationScrmMapper.deleteByProductId(product.getProductId());
|
|
|
if (param.getTagIds() != null && !param.getTagIds().isEmpty()) {
|
|
|
if (param.getTagIds().size() > 3) {
|
|
|
@@ -1748,4 +1757,12 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
}
|
|
|
return fsStoreProductTagRelationScrmMapper.selectTagIdsByProductId(productId);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Long> selectUserEndCategoryIdsByProductId(Long productId) {
|
|
|
+ if (productId == null) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+ return fsStoreProductUserEndCategoryMapper.selectCategoryIdsByProductId(productId);
|
|
|
+ }
|
|
|
}
|