|
@@ -12,17 +12,23 @@ import com.fuint.common.util.AuthUserUtil;
|
|
|
import com.fuint.common.util.I18nUtil;
|
|
|
import com.fuint.framework.annoation.OperationServiceLog;
|
|
|
import com.fuint.framework.exception.BusinessCheckException;
|
|
|
+import com.fuint.framework.pagination.PaginationRequest;
|
|
|
+import com.fuint.framework.pagination.PaginationResponse;
|
|
|
import com.fuint.framework.web.PageResult;
|
|
|
import com.fuint.repository.bean.TableCategoryBean;
|
|
|
import com.fuint.repository.mapper.MtTableCategoryMapper;
|
|
|
import com.fuint.repository.mapper.MtTableInfoMapper;
|
|
|
import com.fuint.repository.model.MtTableCategory;
|
|
|
import com.fuint.repository.model.MtTableInfo;
|
|
|
+import com.github.pagehelper.Page;
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.data.domain.PageImpl;
|
|
|
+import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
@@ -50,6 +56,25 @@ public class TableCategoryServiceImpl extends ServiceImpl<MtTableCategoryMapper,
|
|
|
private MtTableInfoMapper tableInfoMapper;
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
+ public PaginationResponse<MtTableCategory> queryTableCategoryListByPagination(PaginationRequest paginationRequest) {
|
|
|
+ Page<MtTableCategory> pageHelper = PageHelper.startPage(paginationRequest.getCurrentPage(), paginationRequest.getPageSize());
|
|
|
+ LambdaQueryWrapper<MtTableCategory> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
|
|
+ lambdaQueryWrapper.ne(MtTableCategory::getDeleteFlag, 1);
|
|
|
+
|
|
|
+ lambdaQueryWrapper.orderByAsc(MtTableCategory::getId);
|
|
|
+ List<MtTableCategory> dataList = mtTableCategoryMapper.selectList(lambdaQueryWrapper);
|
|
|
+
|
|
|
+ PageRequest pageRequest = PageRequest.of(paginationRequest.getCurrentPage(), paginationRequest.getPageSize());
|
|
|
+ PageImpl pageImpl = new PageImpl(dataList, pageRequest, pageHelper.getTotal());
|
|
|
+ PaginationResponse<MtTableCategory> paginationResponse = new PaginationResponse(pageImpl, MtTableCategory.class);
|
|
|
+ paginationResponse.setTotalPages(pageHelper.getPages());
|
|
|
+ paginationResponse.setTotalElements(pageHelper.getTotal());
|
|
|
+ paginationResponse.setContent(dataList);
|
|
|
+
|
|
|
+ return paginationResponse;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 添加餐桌分类表
|
|
|
*
|