Authored by Lixiaodi

闪购:增加商品汇总数据

package com.yohoufo.order.controller;
import com.alibaba.fastjson.JSONObject;
import com.yohobuy.ufo.model.order.bo.DepositDetailBo;
import com.yohobuy.ufo.model.order.bo.DepositProductBo;
import com.yohoufo.common.ApiResponse;
... ... @@ -67,7 +68,11 @@ public class DepositController {
}
List<DepositDetailBo> depositDetailBoList = depositService.queryUserProductDopositingDetail(uid, productId, page, limit);
LOG.info("queryUserDopositing result: {}", depositDetailBoList);
return new ApiResponse.ApiResponseBuilder().code(200).data(depositDetailBoList).build();
DepositProductBo countBo = depositService.queryUserDepositProductCountInfo(uid, productId);
JSONObject result = new JSONObject();
result.put("product", countBo);
result.put("items", depositDetailBoList);
LOG.info("queryUserDopositing result: {}", result);
return new ApiResponse.ApiResponseBuilder().code(200).data(result).build();
}
}
... ...
... ... @@ -17,6 +17,8 @@ public interface DepositService {
List<DepositDetailBo> queryUserProductDopositingDetail(Integer uid, Integer productId, Integer page, Integer limit);
DepositProductBo queryUserDepositProductCountInfo(Integer uid, Integer productId);
boolean changeSaleStatusOn(Integer uid, String depositCode, Integer skup);
boolean changeSaleStatusOff(Integer uid, Integer skup);
boolean changeOwner(Integer uid, Integer skup, long buyOrderCode, Integer newUid);
... ...
... ... @@ -141,6 +141,25 @@ public class DepositServiceImpl implements DepositService {
return result;
}
public DepositProductBo queryUserDepositProductCountInfo(Integer uid, Integer productId) {
List<StorageDepositCount> countInfoList = storageDepositMapper.queryUserDepositProduct(uid, Arrays.asList(productId));
if (countInfoList.isEmpty()) {
return null;
}
StorageDepositCount countInfo = countInfoList.get(0);
DepositProductBo bo = new DepositProductBo();
SellerOrderGoods goods = sellerOrderGoodsMapper.selectByPrimaryKey(countInfo.getSkup());
bo.setProductId(productId);
if (goods != null) {
bo.setProductName(goods.getProductName());
bo.setColorName(goods.getColorName());
bo.setPic(goods.getImageUrl());
}
bo.setSizeCount(countInfo.getStorageIdCount());
bo.setStorageCount(countInfo.getStorageCount());
return bo;
}
// 上架
@Override
... ...