|
@@ -540,6 +540,9 @@ public class PageServiceImpl implements PageService {
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public ResponseJson<List<ProductListVo>> getProductDetailRecommends(Integer productId, Integer recommendType, Integer userId) {
|
|
public ResponseJson<List<ProductListVo>> getProductDetailRecommends(Integer productId, Integer recommendType, Integer userId) {
|
|
|
|
+ if (null == productId) {
|
|
|
|
+ return ResponseJson.error("商品Id不能为空!", null);
|
|
|
|
+ }
|
|
// 根据用户Id查询用户身份
|
|
// 根据用户Id查询用户身份
|
|
Integer identity = 0;
|
|
Integer identity = 0;
|
|
if (null != userId && userId > 0) {
|
|
if (null != userId && userId > 0) {
|
|
@@ -547,11 +550,11 @@ public class PageServiceImpl implements PageService {
|
|
if (null == identity){identity = 0;}
|
|
if (null == identity){identity = 0;}
|
|
}
|
|
}
|
|
List<ProductListVo> list = null;
|
|
List<ProductListVo> list = null;
|
|
- //相关推荐类型 0自动选择; 1手动推荐
|
|
|
|
- if (1 == recommendType) {
|
|
|
|
- list = pageMapper.getProductRecommendsById(productId);
|
|
|
|
- } else {
|
|
|
|
|
|
+ //相关推荐类型 0自动选择(默认); 1手动推荐
|
|
|
|
+ if (null == recommendType || 1 != recommendType) {
|
|
list = pageMapper.getAutoProductRecommends(productId);
|
|
list = pageMapper.getAutoProductRecommends(productId);
|
|
|
|
+ } else {
|
|
|
|
+ list = pageMapper.getProductRecommendsById(productId);
|
|
}
|
|
}
|
|
if (null != list && list.size()>0) {
|
|
if (null != list && list.size()>0) {
|
|
// identity: 0个人,1协销,2会员机构,3供应商,4普通机构
|
|
// identity: 0个人,1协销,2会员机构,3供应商,4普通机构
|