| | |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.entity.store.StoreInfo; |
| | | import com.ycl.enums.common.ResultCode; |
| | | import com.ycl.exception.ApiException; |
| | | import com.ycl.mapper.store.StoreInfoMapper; |
| | | import com.ycl.mapper.video.VideoPointMapper; |
| | | import com.ycl.service.store.StoreInfoService; |
| | | import com.ycl.utils.ExcelUtils; |
| | | import com.ycl.vo.store.StoreInfoExcelVo; |
| | | import com.ycl.vo.store.StoreInfoVO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | @Slf4j |
| | | public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo> implements StoreInfoService { |
| | | |
| | | @Resource |
| | | StoreInfoMapper storeInfoMapper; |
| | | |
| | | @Resource |
| | | VideoPointMapper videoPointMapper; |
| | | |
| | | |
| | | @Override |
| | | public Page<StoreInfo> list(String keyword, Integer pageSize, Integer pageNum) { |
| | | Page<StoreInfo> page = new Page<>(pageSize, pageNum); |
| | | LambdaQueryWrapper<StoreInfo> wrapper = new LambdaQueryWrapper<>(); |
| | | if (StrUtil.isNotEmpty(keyword)) { |
| | | wrapper.like(StoreInfo::getStoreName, keyword); |
| | | } |
| | | return page(page, wrapper); |
| | | public Page<StoreInfoVO> list(String keyword, Integer pageSize, Integer pageNum,String status) { |
| | | Page<StoreInfo> storeInfoPage = new Page<>(); |
| | | storeInfoPage.setSize(pageSize); |
| | | storeInfoPage.setCurrent(pageNum); |
| | | Page<StoreInfoVO> page = storeInfoMapper.selectStorePage(storeInfoPage, keyword,status); |
| | | page.getRecords().forEach(x->x.setVideoPoint(videoPointMapper.selectById(x.getVideoId()))); |
| | | return page; |
| | | } |
| | | |
| | | @Override |