商品详情开工,商品首页调整
This commit is contained in:
@@ -15,6 +15,7 @@ import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
@@ -83,7 +84,8 @@ public class HomePageService {
|
||||
homeVO.setShopTag(new ArrayList<>());
|
||||
}else {
|
||||
TbPlatformDict tbPlatformDict = platformDictMapper.queryById(Integer.valueOf(tbShopInfo.getTag()));
|
||||
homeVO.setShopTag(tbPlatformDict == null ? new ArrayList<>() : Collections.singletonList(tbPlatformDict.getName()));
|
||||
|
||||
homeVO.setShopTag(tbPlatformDict == null ? new ArrayList<>() : Collections.singletonList(tbPlatformDict.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -106,16 +108,25 @@ public class HomePageService {
|
||||
}
|
||||
for (TagProductVO tagProductVO :dictPro.get()) {
|
||||
if (o.getRelationIds().equals(tagProductVO.getProductId().toString())){
|
||||
homeVO.setProTag(Collections.singletonList(tagProductVO.getTags()));
|
||||
homeVO.setProTag(tagList(tagProductVO.getTags()));
|
||||
}
|
||||
}
|
||||
homeVO.setEndTime(DateUtils.getTodayEndTimeAsString());
|
||||
homeVO.setEndTime(DateUtils.getDayEndLong());
|
||||
homeVOList.add(homeVO);
|
||||
}
|
||||
|
||||
return Result.success(CodeEnum.SUCCESS, homeVOList);
|
||||
}
|
||||
|
||||
private List<String> tagList(String tag){
|
||||
if (tag == null){
|
||||
return new ArrayList<>();
|
||||
}else {
|
||||
String[] arr = tag.split(",");
|
||||
return new ArrayList<>(Arrays.asList(arr));
|
||||
}
|
||||
}
|
||||
|
||||
public Result homePageUp(String environment) {
|
||||
HomeUpVO homeUpVO = new HomeUpVO();
|
||||
//轮播图
|
||||
@@ -161,6 +172,16 @@ public class HomePageService {
|
||||
TodayRankingVO todayRankingVO = new TodayRankingVO();
|
||||
todayRankingVO.setTodayList(homeVODay);
|
||||
homeUpVO.setTodayList(todayRankingVO);
|
||||
/**
|
||||
* 小条幅
|
||||
*/
|
||||
TbSystemCoupons tbSystemCoupons = productMapper.selectLimit();
|
||||
BannerVO bannerVO = new BannerVO();
|
||||
bannerVO.setCoupons(tbSystemCoupons == null?"":tbSystemCoupons.getName());
|
||||
List<TbPlatformDict> tbPlatformDicts = platformDictMapper.queryAllByType("icon", environment);
|
||||
bannerVO.setLogo(tbPlatformDicts);
|
||||
homeUpVO.setBannerVO(bannerVO);
|
||||
|
||||
return Result.success(CodeEnum.SUCCESS, homeUpVO);
|
||||
}
|
||||
|
||||
|
||||
@@ -118,4 +118,9 @@ public class ProductService {
|
||||
return Result.success(CodeEnum.SUCCESS,tbProductSkuWithBLOBs);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// public Result productInfo(Integer productId){
|
||||
// TbShopInfo tbShopInfo = tbShopInfoMapper.selectByPrimaryKey(productId);
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user