Commit 69bfeeb0 authored by shiyu's avatar shiyu

列表展示开关2

parent 4a4d7753
......@@ -155,10 +155,23 @@ public class SupplierItemServiceImpl implements SupplierItemService {
@Override
public Result findItemsOfCurrentDistributor(SupplierItemRequestDto dto) {
try {
//为了小程序过审,关闭列表展示,0关闭,1打开
List<SupplierItemVo> supplierItemVos = new ArrayList<>();
//为了小程序过审,关闭列表展示,0关闭,1打开,展示一个默认
Switch sswitch = switchDao.find();
if (sswitch.getState() == 0) {
return Result.success();
SupplierItem supplierItem = supplierItemDao.findById(3289012L);
SupplierItemVo supplierItemVo = new SupplierItemVo();
EntityMapper.copyAttribute(supplierItem, supplierItemVo);
supplierItemVo.setSalePrice(PriceUtil.convertPriceFenToYuan(100L));
supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos()));
supplierItemVos.add(supplierItemVo);
PageSearchResult pageSearchResult = new PageSearchResult();
pageSearchResult.setTotal(1L);
pageSearchResult.setPageSize(20);
pageSearchResult.setPageIndex(1);
pageSearchResult.setIsHasNextPage(false);
pageSearchResult.setDataList(supplierItemVos);
return Result.success(pageSearchResult);
}
//当前用户
long userId = dto.getUserId();
......@@ -189,7 +202,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
searchDto.setLimit(dto.getLimit());
List<SupplierItem> supplierItemList = supplierItemDao.findList(searchDto);
PageInfo<SupplierItem> pageInfo = new PageInfo(supplierItemList);
List<SupplierItemVo> supplierItemVos = new ArrayList<>();
supplierItemList.forEach(supplierItem -> {
SupplierItemVo supplierItemVo = new SupplierItemVo();
EntityMapper.copyAttribute(supplierItem, supplierItemVo);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment