|
@@ -66,7 +66,8 @@ public class PageServiceImpl implements PageService {
|
|
|
|
|
|
/**
|
|
|
* 获取分类列表
|
|
|
- * @param typeSort 分类类型:1产品,2仪器,0全部
|
|
|
+ *
|
|
|
+ * @param typeSort 分类类型:1产品,2仪器,0全部
|
|
|
* @param source 请求来源:www,crm
|
|
|
* @param mallType
|
|
|
*/
|
|
@@ -158,7 +159,6 @@ public class PageServiceImpl implements PageService {
|
|
|
map.put("homePageFloor", homePageFloor);
|
|
|
|
|
|
|
|
|
-
|
|
|
List<PageFloorVo> pageFloorList = pageMapper.getPageFloor(source);
|
|
|
Iterator<PageFloorVo> floorIterators = pageFloorList.iterator();
|
|
|
while (floorIterators.hasNext()) {
|
|
@@ -167,7 +167,7 @@ public class PageServiceImpl implements PageService {
|
|
|
setFloorLinkType(floorContent);
|
|
|
floors.setFloorContent(floorContent);
|
|
|
|
|
|
- List<ProductItemVo> newFloorList = pageMapper.getNewFloorList(null);
|
|
|
+ List<ProductItemVo> newFloorList = pageMapper.getNewFloorList(null, 1);
|
|
|
newFloorList.forEach(n -> priceUtilService.setProductDetails(userId, n));
|
|
|
List<FloorImageVo> floorImageLists = new ArrayList<>();
|
|
|
for (int i = 0; i < newFloorList.size(); i++) {
|
|
@@ -181,7 +181,7 @@ public class PageServiceImpl implements PageService {
|
|
|
}
|
|
|
pageFloorList.forEach(po -> po.setFloorImageList4(floorImageLists));
|
|
|
}
|
|
|
- map.put("pageFloorList",pageFloorList);
|
|
|
+ map.put("pageFloorList", pageFloorList);
|
|
|
|
|
|
// 优质供应商
|
|
|
ShopFloorVo supplierImage = pageMapper.getSupplierFloorImage();
|
|
@@ -1002,7 +1002,7 @@ public class PageServiceImpl implements PageService {
|
|
|
|
|
|
Iterator<FloorImageVo> iterator = floorImageList.iterator();
|
|
|
while (iterator.hasNext()) {
|
|
|
- FloorImageVo image = iterator.next();
|
|
|
+ FloorImageVo image = iterator.next();
|
|
|
Integer linkType = AppletsLinkUtil.getLinkType(image.getLink());
|
|
|
Map<String, Object> linkParam = AppletsLinkUtil.getLinkParam(linkType, image.getLink());
|
|
|
image.setLinkType(linkType);
|
|
@@ -1025,41 +1025,37 @@ public class PageServiceImpl implements PageService {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
- if (image.getProductId() != null) {
|
|
|
- // 获取商品及价格
|
|
|
- ProductItemVo product = pageMapper.getProductItemById(image.getProductId());
|
|
|
- if (product != null) {
|
|
|
- // visibility 3:所有人可见,2:普通机构可见,1:会员机构可见,4:仅医美机构可见
|
|
|
- String visibility = product.getVisibility();
|
|
|
- boolean visibileFlag = "3".equals(visibility) || ("4".equals(visibility) && clubType == 1) || ("1".equals(visibility) && (isSuperVip || identity == 2))
|
|
|
- || ("2".equals(visibility) && (isSuperVip || identity == 2 || identity == 4));
|
|
|
- if (!visibileFlag) {
|
|
|
- iterator.remove();
|
|
|
- } else {
|
|
|
- // 商品价格
|
|
|
- priceUtilService.setProductDetails(userId, product);
|
|
|
- // 设置商品主图
|
|
|
- image.setListType(1);
|
|
|
- image.setName(product.getName());
|
|
|
- image.setImage(ImageUtils.getImageURL("product", product.getImage(), 0, domain));
|
|
|
- //优惠券标识
|
|
|
- Boolean couponsLogo = setCouponsLogo(userId, image.getProductId(), source);
|
|
|
- product.setCouponsLogo(couponsLogo);
|
|
|
-
|
|
|
- image.setProduct(product);
|
|
|
- }
|
|
|
- } else {
|
|
|
+ if (image.getProductId() != null) {
|
|
|
+ // 获取商品及价格
|
|
|
+ ProductItemVo product = pageMapper.getProductItemById(image.getProductId());
|
|
|
+ if (product != null) {
|
|
|
+ // visibility 3:所有人可见,2:普通机构可见,1:会员机构可见,4:仅医美机构可见
|
|
|
+ String visibility = product.getVisibility();
|
|
|
+ boolean visibileFlag = "3".equals(visibility) || ("4".equals(visibility) && clubType == 1) || ("1".equals(visibility) && (isSuperVip || identity == 2))
|
|
|
+ || ("2".equals(visibility) && (isSuperVip || identity == 2 || identity == 4));
|
|
|
+ if (!visibileFlag) {
|
|
|
iterator.remove();
|
|
|
+ } else {
|
|
|
+ // 商品价格
|
|
|
+ priceUtilService.setProductDetails(userId, product);
|
|
|
+ // 设置商品主图
|
|
|
+ image.setListType(1);
|
|
|
+ image.setName(product.getName());
|
|
|
+ image.setImage(ImageUtils.getImageURL("product", product.getImage(), 0, domain));
|
|
|
+ //优惠券标识
|
|
|
+ Boolean couponsLogo = setCouponsLogo(userId, image.getProductId(), source);
|
|
|
+ product.setCouponsLogo(couponsLogo);
|
|
|
+
|
|
|
+ image.setProduct(product);
|
|
|
}
|
|
|
} else {
|
|
|
- image.setListType(2);
|
|
|
+ iterator.remove();
|
|
|
}
|
|
|
+ } else {
|
|
|
+ image.setListType(2);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -1355,26 +1351,26 @@ public class PageServiceImpl implements PageService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResponseJson<List<ProductPo>>getNewFloorRecommend(){
|
|
|
- List<ProductPo> floorRecommend=pageMapper.getNewFloorRecommend();
|
|
|
- return ResponseJson.success(floorRecommend);
|
|
|
+ public ResponseJson<List<ProductPo>> getNewFloorRecommend() {
|
|
|
+ List<ProductPo> floorRecommend = pageMapper.getNewFloorRecommend();
|
|
|
+ return ResponseJson.success(floorRecommend);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResponseJson <List<BrandVo>>getNewFloorBrand() {
|
|
|
+ public ResponseJson<List<BrandVo>> getNewFloorBrand() {
|
|
|
|
|
|
List<BrandVo> floorBrand = pageMapper.getNewFloorBrand();
|
|
|
return ResponseJson.success(floorBrand);
|
|
|
}
|
|
|
- @Override
|
|
|
- public ResponseJson<PaginationVo<ProductItemVo>> getNewFloorList(Integer source,Integer userId,List<String> brandID,int pageNum, int pageSize) {
|
|
|
- log.info("pagenum,pagesize,brandId-------------------------------->"+pageNum+"-----"+pageSize+"-=---------------"+brandID.toString());
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResponseJson<PaginationVo<ProductItemVo>> getNewFloorList(Integer source, Integer userId, List<String> brandID, int pageNum, int pageSize) {
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
- List<ProductItemVo> list = pageMapper.getNewFloorList(brandID);
|
|
|
+ List<ProductItemVo> list = pageMapper.getNewFloorList(brandID, 0);
|
|
|
list.forEach(product -> {
|
|
|
Boolean couponsLogo = setCouponsLogo(userId, product.getProductId(), source);
|
|
|
product.setCouponsLogo(couponsLogo);
|
|
|
- if(product.getBrandID()!=null){
|
|
|
+ if (product.getBrandID() != null) {
|
|
|
if (StringUtils.isNotBlank(product.getBrandID().toString())) {
|
|
|
if (product.getBrandID().toString().contains(",")) {
|
|
|
String[] split = product.getBrandID().toString().split(",");
|