|
|
@ -974,7 +974,7 @@ public class CereShopProductServiceImpl implements CereShopProductService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Page getProducts2(CanvasAppProductParam param) throws CoBusinessException,Exception { |
|
|
|
public Page getProducts2(CanvasAppProductParam param, CereBuyerUser user) throws CoBusinessException,Exception { |
|
|
|
PageHelper.startPage(param.getPage(),param.getPageSize()); |
|
|
|
List<CanvasProduct> list=null; |
|
|
|
Map<Long,CanvasProductUsers> productUsersMap = new HashMap<>(); |
|
|
@ -1011,13 +1011,13 @@ public class CereShopProductServiceImpl implements CereShopProductService { |
|
|
|
productNumberMap = cereShopProductDAO.getProductNumber(param); |
|
|
|
} |
|
|
|
//填充产品属性 |
|
|
|
fillProductProperties(list, productUsersMap, productSkuMap, productNumberMap); |
|
|
|
fillProductProperties(list, productUsersMap, productSkuMap, productNumberMap, user); |
|
|
|
PageInfo<CanvasProduct> pageInfo=new PageInfo<>(list); |
|
|
|
Page page=new Page(pageInfo.getList(),pageInfo.getTotal()); |
|
|
|
return page; |
|
|
|
} |
|
|
|
|
|
|
|
private void fillProductProperties(List<CanvasProduct> list, Map<Long, CanvasProductUsers> productUsersMap, Map<Long, CanvasProductSku> productSkuMap, Map<Long, CanvasProductNumber> productNumberMap) { |
|
|
|
private void fillProductProperties(List<CanvasProduct> list, Map<Long, CanvasProductUsers> productUsersMap, Map<Long, CanvasProductSku> productSkuMap, Map<Long, CanvasProductNumber> productNumberMap, CereBuyerUser user) { |
|
|
|
|
|
|
|
boolean usersMapIsEmpty = productUsersMap.isEmpty(); |
|
|
|
boolean skuMapIsEmpty = productSkuMap.isEmpty(); |
|
|
@ -1055,6 +1055,13 @@ public class CereShopProductServiceImpl implements CereShopProductService { |
|
|
|
product.setStockNumber(productBo.getSurplusNumber()); |
|
|
|
} |
|
|
|
|
|
|
|
if (ObjectUtils.isNotNull(user)){ |
|
|
|
CereBuyerCollect collect = cereBuyerCollectService.findByUserProduct(user.getBuyerUserId(),product.getProductId()); |
|
|
|
if(collect!=null){ |
|
|
|
product.setCollectId(collect.getCollectId()); |
|
|
|
product.setIfCollect(collect.getState()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
initCanvasProductLangInfo(list); |
|
|
|
} |
|
|
|