Authored by mali

Merge branch 'test6.9.8' of http://git.yoho.cn/ufo/yohoufo-fore into test6.9.8

... ... @@ -13,8 +13,10 @@ import com.yohoufo.common.cache.ControllerCacheAop;
import com.yohoufo.common.caller.UfoServiceCaller;
import com.yohoufo.common.exception.UfoServiceException;
import com.yohoufo.common.helper.ImageUrlAssist;
import com.yohoufo.dal.order.BuyerOrderMapper;
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
import com.yohoufo.dal.order.StorageDepositMapper;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.dal.order.model.StorageDeposit;
import com.yohoufo.dal.order.model.StorageDepositCount;
... ... @@ -52,6 +54,9 @@ public class DepositServiceImpl implements DepositService {
private SellerOrderGoodsMapper sellerOrderGoodsMapper;
@Autowired
private BuyerOrderMapper buyerOrderMapper;
@Autowired
private UfoServiceCaller ufoServiceCaller;
private static final int DEPOSIT_MAX_TIME = 45 * 24 * 60 * 60;
... ... @@ -107,6 +112,8 @@ public class DepositServiceImpl implements DepositService {
}
// 召回或者到期退回的
List<StorageDeposit> depositList = storageDepositMapper.queryUserDopositBack(uid, (page - 1) * limit, limit);
List<BuyerOrder> buyerGoodsList = buyerOrderMapper.selectByOrderCodes(depositList.stream().map(StorageDeposit::getOrderCode).collect(Collectors.toList()), null);
Map<Long, BuyerOrder> buyerGoodsMap = buyerGoodsList.stream().map(Function.identity()).collect(Collectors.toMap(BuyerOrder::getOrderCode, Function.identity()));
List<Integer> skupList = depositList.stream().map(StorageDeposit::getSkup).collect(Collectors.toList());
List<SellerOrderGoods> goodsList = sellerOrderGoodsMapper.selectBySkups(skupList);
Map<Integer, SellerOrderGoods> goodsMap = goodsList.stream().map(Function.identity()).collect(Collectors.toMap(SellerOrderGoods::getId, Function.identity()));
... ... @@ -120,7 +127,10 @@ public class DepositServiceImpl implements DepositService {
bo.setColorName(goods.getColorName());
bo.setSizeName(goods.getSizeName());
bo.setPic(ImageUrlAssist.getAllProductPicUrl(goods.getImageUrl(), "goodsimg", "center", "d2hpdGU="));
bo.setPrice(goods.getGoodsPrice().toString());
BuyerOrder buyerOrder = buyerGoodsMap.get(buyerGoodsMap.get(depo.getOrderCode()));
if (buyerOrder != null) {
bo.setPrice(buyerOrder.getAmount().toString());
}
bo.setDepositStatusName(getBackStatusName(depo.getStatus()));
bo.setDepositCode(depo.getDepositCode());
}
... ...
... ... @@ -35,6 +35,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.List;
... ... @@ -451,6 +452,8 @@ public class ProductController {
cacheAop.clearCache(
ProductController.class.getMethod("queryProductDetailById", new Class[]{Integer.class}),
new Object[]{productId});
Method queryLeastFlashSalePrice = ProductController.class.getMethod("queryLeastFlashSalePrice", new Class[]{Integer.class});
cacheAop.clearCache(queryLeastFlashSalePrice, new Object[]{productId});
Integer storageId = sp.getStorageId();
// sku最低价
LOG.info("clearCache queryStorageLeastprice skup = {}, ", skup);
... ... @@ -506,6 +509,8 @@ public class ProductController {
cacheAop.clearCache(
ProductController.class.getMethod("queryProductInStockNewBriefById", new Class[]{Integer.class}),
new Object[]{productId});
Method queryLeastFlashSalePrice = ProductController.class.getMethod("queryLeastFlashSalePrice", new Class[]{Integer.class});
cacheAop.clearCache(queryLeastFlashSalePrice, new Object[]{productId});
} catch (Exception e) {
LOG.error("删除商品详情缓存失败!", e);
}
... ... @@ -528,6 +533,8 @@ public class ProductController {
cacheAop.clearCache(
ProductController.class.getMethod("queryProductInStockNewBriefById", new Class[]{Integer.class}),
new Object[]{productId});
Method queryLeastFlashSalePrice = ProductController.class.getMethod("queryLeastFlashSalePrice", new Class[]{Integer.class});
cacheAop.clearCache(queryLeastFlashSalePrice, new Object[]{productId});
}
}
if (CollectionUtils.isNotEmpty(storageIdList)) {
... ...