pengzhenggao 1 hete
szülő
commit
919a8cc0e3

+ 18 - 0
fuintBackend/fuint-application/src/main/java/com/fuint/common/dto/ext/TableCategoryDto.java

@@ -0,0 +1,18 @@
+package com.fuint.common.dto.ext;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class TableCategoryDto {
+
+	@ApiModelProperty("桌号分类ID,主键,自增")
+	private Long id;
+
+	@ApiModelProperty("桌号分类名称,如一楼、二楼等")
+	private String categoryName;
+
+	@ApiModelProperty("桌号分类描述,可选")
+	private String description;
+
+}

+ 2 - 0
fuintBackend/fuint-application/src/main/java/com/fuint/common/service/TableCategoryService.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.fuint.common.dto.ext.TableCategoryDto;
 import com.fuint.common.param.PageParam;
 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.model.MtTableCategory;

+ 25 - 0
fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/TableCategoryServiceImpl.java

@@ -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;
+    }
+
     /**
      * 添加餐桌分类表
      *

+ 33 - 0
fuintBackend/fuint-repository/src/main/java/com/fuint/repository/bean/TableCategoryBean.java

@@ -0,0 +1,33 @@
+package com.fuint.repository.bean;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author 彭Mr.
+ * @date 2025/3/5
+ * @Description
+ */
+@Data
+public class TableCategoryBean {
+
+	@ApiModelProperty("桌号分类ID,主键,自增")
+	private Long id;
+
+	@ApiModelProperty("桌号分类名称,如一楼、二楼等")
+	private String categoryName;
+
+	@ApiModelProperty("记录创建时间")
+	private Date createTime;
+
+	@ApiModelProperty("桌号分类描述,可选")
+	private String description;
+
+	@ApiModelProperty("门店名称")
+	private String storeName;
+
+	@ApiModelProperty("记录更新时间")
+	private Date updateTime;
+}