From 1ed8f561a9eb8d931d7fed8bc00786517668ac10 Mon Sep 17 00:00:00 2001 From: x_z Date: Mon, 9 Jan 2023 17:49:54 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=B7=BB=E5=8A=A0=E5=8D=95=E6=8D=AE=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic/BasicBussinessTypeController.java | 24 +++++++++ .../api/dao/basic/BasicBussinessTypeDao.java | 11 ++++ .../req/basic/FilterBussinessTypeRequest.java | 5 -- .../basic/IBasicBussinessTypeService.java | 14 +++++ .../impl/BasicBussinessTypeServiceImpl.java | 16 ++++++ .../mapper/basic/BasicBussinessTypeDao.xml | 51 ++++++++++++++++++- 6 files changed, 114 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/basic/BasicBussinessTypeController.java b/src/main/java/com/glxp/api/controller/basic/BasicBussinessTypeController.java index b7c9ce1b..2dfad1f4 100644 --- a/src/main/java/com/glxp/api/controller/basic/BasicBussinessTypeController.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicBussinessTypeController.java @@ -1,10 +1,17 @@ package com.glxp.api.controller.basic; +import com.github.pagehelper.PageInfo; +import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.req.basic.FilterBussinessTypeRequest; +import com.glxp.api.res.basic.BasicBussinessTypeResponse; import com.glxp.api.service.basic.IBasicBussinessTypeService; import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import java.util.List; /** * 单据类型接口 @@ -16,4 +23,21 @@ public class BasicBussinessTypeController { @Resource private IBasicBussinessTypeService basicBussinessTypeService; + + /** + * 查询单据类型列表 + * + * @param filterBussinessTypeRequest + * @return + */ + @GetMapping("/udiwms/basic/busType/filterList") + public BaseResponse filterList(FilterBussinessTypeRequest filterBussinessTypeRequest) { + List list = basicBussinessTypeService.filterList(filterBussinessTypeRequest); + PageInfo pageInfo = new PageInfo<>(list); + return ResultVOUtils.page(pageInfo); + } + + + //public BaseResponse add() + } diff --git a/src/main/java/com/glxp/api/dao/basic/BasicBussinessTypeDao.java b/src/main/java/com/glxp/api/dao/basic/BasicBussinessTypeDao.java index 5f9e26f5..cb940825 100644 --- a/src/main/java/com/glxp/api/dao/basic/BasicBussinessTypeDao.java +++ b/src/main/java/com/glxp/api/dao/basic/BasicBussinessTypeDao.java @@ -2,10 +2,21 @@ package com.glxp.api.dao.basic; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.glxp.api.entity.basic.BasicBussinessTypeEntity; +import com.glxp.api.req.basic.FilterBussinessTypeRequest; +import com.glxp.api.res.basic.BasicBussinessTypeResponse; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + @Mapper public interface BasicBussinessTypeDao extends BaseMapper { + /** + * 查询单据类型列表 + * + * @param filterBussinessTypeRequest + * @return + */ + List filterList(FilterBussinessTypeRequest filterBussinessTypeRequest); } diff --git a/src/main/java/com/glxp/api/req/basic/FilterBussinessTypeRequest.java b/src/main/java/com/glxp/api/req/basic/FilterBussinessTypeRequest.java index 86db84a7..968583bc 100644 --- a/src/main/java/com/glxp/api/req/basic/FilterBussinessTypeRequest.java +++ b/src/main/java/com/glxp/api/req/basic/FilterBussinessTypeRequest.java @@ -36,11 +36,6 @@ public class FilterBussinessTypeRequest extends ListPageRequest { */ private String mainAction; - /** - * 是否启用 - */ - private Boolean enabled; - /** * 是否二次验收 */ diff --git a/src/main/java/com/glxp/api/service/basic/IBasicBussinessTypeService.java b/src/main/java/com/glxp/api/service/basic/IBasicBussinessTypeService.java index 3b7ad12e..ee41d7c0 100644 --- a/src/main/java/com/glxp/api/service/basic/IBasicBussinessTypeService.java +++ b/src/main/java/com/glxp/api/service/basic/IBasicBussinessTypeService.java @@ -1,7 +1,21 @@ package com.glxp.api.service.basic; +import com.glxp.api.req.basic.FilterBussinessTypeRequest; +import com.glxp.api.res.basic.BasicBussinessTypeResponse; + +import java.util.List; + /** * 单据类型Service */ public interface IBasicBussinessTypeService { + + /** + * 查询单据类型列表 + * + * @param filterBussinessTypeRequest + * @return + */ + List filterList(FilterBussinessTypeRequest filterBussinessTypeRequest); + } diff --git a/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java index 249077fe..c3efa6a1 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java +++ b/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java @@ -1,11 +1,16 @@ package com.glxp.api.service.basic.impl; +import com.github.pagehelper.PageHelper; import com.glxp.api.dao.basic.BasicBussinessTypeDao; +import com.glxp.api.req.basic.FilterBussinessTypeRequest; +import com.glxp.api.res.basic.BasicBussinessTypeResponse; import com.glxp.api.service.basic.IBasicBussinessTypeService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.Collections; +import java.util.List; @Slf4j @Service @@ -14,4 +19,15 @@ public class BasicBussinessTypeServiceImpl implements IBasicBussinessTypeService @Resource private BasicBussinessTypeDao basicBussinessTypeDao; + @Override + public List filterList(FilterBussinessTypeRequest filterBussinessTypeRequest) { + if (null == filterBussinessTypeRequest) { + return Collections.emptyList(); + } + if (null != filterBussinessTypeRequest.getPage() && null != filterBussinessTypeRequest.getLimit()) { + PageHelper.offsetPage((filterBussinessTypeRequest.getPage() - 1) * filterBussinessTypeRequest.getLimit(), filterBussinessTypeRequest.getLimit()); + } + return basicBussinessTypeDao.filterList(filterBussinessTypeRequest); + } + } diff --git a/src/main/resources/mybatis/mapper/basic/BasicBussinessTypeDao.xml b/src/main/resources/mybatis/mapper/basic/BasicBussinessTypeDao.xml index 72007828..8e88683c 100644 --- a/src/main/resources/mybatis/mapper/basic/BasicBussinessTypeDao.xml +++ b/src/main/resources/mybatis/mapper/basic/BasicBussinessTypeDao.xml @@ -2,6 +2,53 @@ - - +