| | |
| | | import cc.mrbird.febs.mall.service.IApiMallNewsService; |
| | | import cc.mrbird.febs.mall.vo.NewsListVo; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | private final PlatformBannerMapper platformBannerMapper; |
| | | private final MallGoodsMapper mallGoodsMapper; |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | private final MallActivityMapper mallActivityMapper; |
| | | |
| | | @Override |
| | | public List<MallNewsCategory> findNewsCategoryList() { |
| | |
| | | queryWrapper.orderByAsc("created_time"); |
| | | List<PlatformBanner> paymentMethodList = platformBannerMapper.selectList(queryWrapper); |
| | | if(CollUtil.isNotEmpty(paymentMethodList)){ |
| | | for(PlatformBanner platformBanner : paymentMethodList){ |
| | | if("1".equals(platformBanner.getIsJump()) && |
| | | 1 == platformBanner.getIsInside()){ |
| | | String jumpUrl = platformBanner.getJumpUrl(); |
| | | QueryWrapper<MallGoods> queryWrapperGoods = new QueryWrapper<>(); |
| | | queryWrapperGoods.eq("goods_no",jumpUrl); |
| | | List<MallGoods> goodsList = mallGoodsMapper.selectList(queryWrapperGoods); |
| | | if(CollUtil.isNotEmpty(goodsList)){ |
| | | platformBanner.setGoodsId(goodsList.get(0).getId()); |
| | | } |
| | | paymentMethodList.forEach(item -> { |
| | | if("1".equals(item.getIsJump()) && 1 == item.getIsInside()){ |
| | | String jumpUrl = item.getJumpUrl(); |
| | | MallActivity mallActivity = mallActivityMapper.selectById( |
| | | new LambdaQueryWrapper<MallActivity>().eq(MallActivity::getId, Long.parseLong(jumpUrl))); |
| | | item.setActivityId(mallActivity.getId()); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | return new FebsResponse().success().data(paymentMethodList); |
| | | } |