Authored by mali

缓存细化

... ... @@ -6,6 +6,8 @@ import com.yohoufo.dal.product.model.ProductSales;
import com.yohoufo.product.cache.UfoProductCacheKeyEnum;
import com.yohoufo.product.cache.UfoProductCacheService;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
... ... @@ -20,6 +22,8 @@ import java.util.stream.Collectors;
*/
@Service
public class ProductSalesService {
private static Logger logger = LoggerFactory.getLogger(ProductSalesService.class);
@Autowired
private ProductSalesMapper productSalesMapper;
... ... @@ -31,6 +35,8 @@ public class ProductSalesService {
return Maps.newHashMap();
}
logger.info("method selectAmountByProductIdList begin");
Map<Integer, Integer> bulk = productCacheService.getBulk(UfoProductCacheKeyEnum.SELLER_NUM_KEY, productIdList, Integer.class, new Function<String, Integer>() {
public Integer apply(String s) {
return Integer.valueOf(s);
... ...