...
|
...
|
@@ -19,6 +19,7 @@ import com.yohoufo.common.annotation.IgnoreSession; |
|
|
import com.yohoufo.common.annotation.IgnoreSignature;
|
|
|
import com.yohoufo.common.cache.Cachable;
|
|
|
import com.yohoufo.common.cache.ControllerCacheAop;
|
|
|
import com.yohoufo.common.caller.UfoServiceCaller;
|
|
|
import com.yohoufo.dal.product.model.StoragePrice;
|
|
|
import com.yohoufo.product.model.SkupInfo;
|
|
|
import com.yohoufo.product.response.*;
|
...
|
...
|
@@ -38,6 +39,7 @@ import org.springframework.web.servlet.ModelAndView; |
|
|
import java.lang.reflect.Method;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.Collection;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.ExecutorService;
|
...
|
...
|
@@ -58,6 +60,9 @@ public class ProductController { |
|
|
private ProductBatchService productBatchService;
|
|
|
|
|
|
@Autowired
|
|
|
private UfoServiceCaller ufoServiceCaller;
|
|
|
|
|
|
@Autowired
|
|
|
private ConfigReader configReader;
|
|
|
|
|
|
private static final String LIMIT_PRODUCT_TIP = "很抱歉通知您,您现在还不具备销售此商品的资质。我们需要您提供完整的商品来源凭证,诸如购买单据、发票等,确保您的货源稳定可靠,请将以上资料、联系手机等相关信息通过邮箱发送至luyan.qian@yoho.cn,我们的工作人员审核通过后会联系您并为您添加出售资质权限,谢谢!";
|
...
|
...
|
@@ -534,8 +539,8 @@ public class ProductController { |
|
|
try {
|
|
|
LOG.info("in clearBatchProductCache skupList = {}", skupList);
|
|
|
List<StoragePrice> spList = productService.getStoragePriceBySkupList(skupList);
|
|
|
List<Integer> productIdList = spList.stream().map(StoragePrice::getProductId).collect(Collectors.toList());
|
|
|
List<Integer> storageIdList = spList.stream().map(StoragePrice::getStorageId).collect(Collectors.toList());
|
|
|
List<Integer> productIdList = spList.stream().map(StoragePrice::getProductId).distinct().collect(Collectors.toList());
|
|
|
List<Integer> storageIdList = spList.stream().map(StoragePrice::getStorageId).distinct().collect(Collectors.toList());
|
|
|
if (CollectionUtils.isNotEmpty(productIdList)) {
|
|
|
for (Integer productId : productIdList) {
|
|
|
LOG.info("Batch clearCache queryProductDetailById productId = {}, ", productId);
|
...
|
...
|
@@ -574,8 +579,16 @@ public class ProductController { |
|
|
cacheAop.clearCache(
|
|
|
ProductController.class.getMethod("queryStorageSuggestPrice", new Class[]{Collection.class}),
|
|
|
new Object[]{storageId});
|
|
|
cacheAop.clearCache(
|
|
|
ProductController.class.getMethod("querySecondHandProductListCount", new Class[]{Integer.class}),
|
|
|
new Object[]{storageId});
|
|
|
LOG.info("clearCache querySecondHandProductListFilter skup = {}, ", storageId);
|
|
|
cacheAop.clearCache(
|
|
|
ProductController.class.getMethod("querySecondHandProductListFilter", new Class[]{Integer.class}),
|
|
|
new Object[]{storageId});
|
|
|
}
|
|
|
}
|
|
|
Map<String, StoragePrice> distinctStorage = new HashMap<>();
|
|
|
for(StoragePrice sp : spList) {
|
|
|
Integer skup = sp.getSkup();
|
|
|
Integer storageId = sp.getStorageId();
|
...
|
...
|
@@ -584,15 +597,13 @@ public class ProductController { |
|
|
cacheAop.clearCache(
|
|
|
ProductController.class.getMethod("querySecondHandProductData", new Class[]{Integer.class}),
|
|
|
new Object[]{skup});
|
|
|
LOG.info("clearCache querySecondHandProductListCount skup = {}, ", skup);
|
|
|
cacheAop.clearCache(
|
|
|
ProductController.class.getMethod("querySecondHandProductListCount", new Class[]{Integer.class}),
|
|
|
new Object[]{storageId});
|
|
|
LOG.info("clearCache querySecondHandProductListFilter skup = {}, ", skup);
|
|
|
cacheAop.clearCache(
|
|
|
ProductController.class.getMethod("querySecondHandProductListFilter", new Class[]{Integer.class}),
|
|
|
new Object[]{storageId});
|
|
|
}
|
|
|
if (sp.getPreSaleFlag() != null && (sp.getPreSaleFlag() == 3)) {
|
|
|
distinctStorage.put(sp.getSellerUid() + "_" + sp.getProductId() + "_" + sp.getStorageId(), sp);
|
|
|
}
|
|
|
}
|
|
|
for (StoragePrice sp : distinctStorage.values()) {
|
|
|
ufoServiceCaller.asyncCall("ufo.deposit.innerClearUserDeposit", ApiResponse.class, sp.getSellerUid(), sp.getProductId(), sp.getStorageId());
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
LOG.error("删除商品缓存失败!", e);
|
...
|
...
|
|