...
|
...
|
@@ -189,10 +189,10 @@ public class StorageService { |
|
|
public PageResponseBO<ProductResponceBo> storageListLineShops(ProductRequestBo request) {
|
|
|
LOGGER.info("StorageService storageListLineShops param = {}", request);
|
|
|
/**
|
|
|
* seller_uid 取配置的uid 即seller_uid过滤是无效,由后台配置决定
|
|
|
* 如果未传 seller_uid,则取后台配置,2019.07.19
|
|
|
*/
|
|
|
request.setSellerUid(null);
|
|
|
PageResponseBO<ProductResponceBo> productPageRsp = storageListPlus(request, sellerStoreMapUtil.getAllSellerUid());
|
|
|
final List<Integer> sellerUidList = getSellerUid(request);
|
|
|
PageResponseBO<ProductResponceBo> productPageRsp = storageListPlus(request, sellerUidList);
|
|
|
/**
|
|
|
* 设置图片
|
|
|
*/
|
...
|
...
|
@@ -202,7 +202,7 @@ public class StorageService { |
|
|
return productPageRsp;
|
|
|
List<Goods> goodsList = goodsMapper.selectByProductId(productIdList);
|
|
|
Map<Integer, Goods> goodsMap = CollectionUtil.extractMap(goodsList, Goods::getProductId);
|
|
|
List<StoragePrice> storagePricesList = storagePriceMapper.selectByProductIdsAndSellerUid(productIdList, sellerStoreMapUtil.getAllSellerUid(), DEFAULT_SKUP_STATUS);
|
|
|
List<StoragePrice> storagePricesList = storagePriceMapper.selectByProductIdsAndSellerUid(productIdList, sellerUidList, DEFAULT_SKUP_STATUS);
|
|
|
List<ProductResponceBo> filterList = new ArrayList<>();
|
|
|
productList.forEach(respBo -> {
|
|
|
Goods goods = goodsMap.get(respBo.getId());
|
...
|
...
|
@@ -237,11 +237,11 @@ public class StorageService { |
|
|
public PageResponseBO<ProductResponceBo> storagePriceListLineShops(ProductRequestBo bo) {
|
|
|
LOGGER.info("StorageService storagePriceListLineShops param = {}", bo);
|
|
|
/**
|
|
|
* seller_uid 取配置的uid 即seller_uid过滤是无效,由后台配置决定
|
|
|
* 如果未传 seller_uid,则取后台配置,2019.07.19
|
|
|
*/
|
|
|
bo.setSellerUid(null);
|
|
|
final List<Integer> sellerUidList = getSellerUid(bo);
|
|
|
bo.setStatus(DEFAULT_SKUP_STATUS);
|
|
|
PageResponseBO<ProductResponceBo> result = storagePriceListPlus(bo, sellerStoreMapUtil.getAllSellerUid());
|
|
|
PageResponseBO<ProductResponceBo> result = storagePriceListPlus(bo, sellerUidList);
|
|
|
/**
|
|
|
* 排序 : 尺码小 价格低 创建时间前 的排序越靠前
|
|
|
*/
|
...
|
...
|
@@ -277,30 +277,19 @@ public class StorageService { |
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
public ApiResponse storeExportExcel(HttpServletResponse response) {
|
|
|
|
|
|
/*
|
|
|
Integer userId = new UserHelper().getUserId();
|
|
|
Integer count = storagePriceMapper.selectExportInfoCount(sellerStoreMapUtil.getAllSellerUid(), ON_SALE_STATUS);
|
|
|
if (count <= 0) {
|
|
|
LOGGER.info("export excel exception, no data to export");
|
|
|
return new ApiResponse(201, "no data to export");
|
|
|
}
|
|
|
count = count >= MAX_ROWS ? MAX_ROWS : count;
|
|
|
*/
|
|
|
|
|
|
public ApiResponse storeExportExcel(ProductRequestBo bo, HttpServletResponse response) {
|
|
|
/**
|
|
|
* 查询 商品基本信息
|
|
|
* 查询 商品基本信息,如果未传 seller_uid,则取后台配置,2019.07.19
|
|
|
*/
|
|
|
// TODO: 这里通过配置获得 seller_uid, 如何直接获得 seller_uid ?
|
|
|
final List<Integer> sellerUidList = getSellerUid(bo);
|
|
|
// 数据量比较大,选用 LinkedList
|
|
|
LinkedList<ExportStoragePrice> baseInfoList = storagePriceMapper.selectExportInfoList(sellerStoreMapUtil.getAllSellerUid(), ON_SALE_STATUS, MAX_ROWS);
|
|
|
LinkedList<ExportStoragePrice> baseInfoList = storagePriceMapper.selectExportInfoList(sellerUidList, ON_SALE_STATUS, MAX_ROWS);
|
|
|
if (baseInfoList.isEmpty()) {
|
|
|
LOGGER.info("export excel exception, no data to export");
|
|
|
return new ApiResponse(201, "no data to export");
|
|
|
}
|
|
|
// 查询该买家下的所有 SKU / storage_id
|
|
|
final ArrayList<Integer> skuList = storagePriceMapper.selectAllSkuBySeller(sellerStoreMapUtil.getAllSellerUid(), ON_SALE_STATUS);
|
|
|
final ArrayList<Integer> skuList = storagePriceMapper.selectAllSkuBySeller(sellerUidList, ON_SALE_STATUS);
|
|
|
/**
|
|
|
* 查询 SKU 全网最低价和库存
|
|
|
*/
|
...
|
...
|
@@ -344,6 +333,17 @@ public class StorageService { |
|
|
return new ApiResponse("export excel success");
|
|
|
}
|
|
|
|
|
|
private List<Integer> getSellerUid(ProductRequestBo bo) {
|
|
|
List<Integer> sellerUidList;
|
|
|
if (bo.getSellerUid() != null) {
|
|
|
sellerUidList = new ArrayList<>();
|
|
|
sellerUidList.add(bo.getSellerUid());
|
|
|
} else {
|
|
|
sellerUidList = sellerStoreMapUtil.getAllSellerUid();
|
|
|
}
|
|
|
return sellerUidList;
|
|
|
}
|
|
|
|
|
|
public SecondDetailResp getSecondDetailBySkup(Integer skup) {
|
|
|
|
|
|
List<SecondhandImages> imageList = secondhandImagesService.selectBySkup(skup);
|
...
|
...
|
|