diff --git a/src/main/java/com/glxp/api/controller/basic/BasicBusTypeChangeController.java b/src/main/java/com/glxp/api/controller/basic/BasicBusTypeChangeController.java index 7be26db9..2d0481d3 100644 --- a/src/main/java/com/glxp/api/controller/basic/BasicBusTypeChangeController.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicBusTypeChangeController.java @@ -23,7 +23,7 @@ import java.util.Date; import java.util.List; /** - * 单据流转接口 + * 单据生成接口 */ @Slf4j @RestController @@ -33,7 +33,7 @@ public class BasicBusTypeChangeController { private IBasicBusTypeChangeService basicBusTypeChangeService; /** - * 查询单据转换设置列表 + * 查询单据生成设置列表 * * @param basicBusTypeChangeRequest * @param bindingResult @@ -51,7 +51,7 @@ public class BasicBusTypeChangeController { } /** - * 新增单据转换设置 + * 新增单据生成设置 * * @param basicBusTypeChangeEntity * @param bindingResult @@ -68,7 +68,7 @@ public class BasicBusTypeChangeController { } /** - * 更新单据转换设置 + * 更新单据生成设置 * * @param basicBusTypeChangeEntity * @param bindingResult @@ -85,7 +85,7 @@ public class BasicBusTypeChangeController { } /** - * 删除单据转换设置 + * 删除单据生成设置 * * @param deleteRequest * @param bindingResult diff --git a/src/main/java/com/glxp/api/controller/basic/BasicBusTypePreController.java b/src/main/java/com/glxp/api/controller/basic/BasicBusTypePreController.java index cfdb1486..7d1a86d8 100644 --- a/src/main/java/com/glxp/api/controller/basic/BasicBusTypePreController.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicBusTypePreController.java @@ -14,6 +14,7 @@ import com.glxp.api.entity.basic.BasicBussinessTypeEntity; import com.glxp.api.req.basic.FilterBusTypeChangeRequest; import com.glxp.api.req.basic.FilterBusTypePreRequest; import com.glxp.api.req.system.DeleteRequest; +import com.glxp.api.res.basic.BasicBusTypePreResponse; import com.glxp.api.service.auth.InvWarehouseService; import com.glxp.api.service.basic.IBasicBusTypePreService; import com.glxp.api.service.basic.IBasicBussinessTypeService; @@ -28,7 +29,7 @@ import javax.annotation.Resource; import java.util.List; /** - * 补单设置接口 + * 单据流转接口 */ @Slf4j @RestController @@ -42,7 +43,7 @@ public class BasicBusTypePreController { private InvWarehouseService invWarehouseService; /** - * 补单设置查询 + * 单据流转查询 * * @param filterBusTypePreRequest * @return @@ -53,7 +54,7 @@ public class BasicBusTypePreController { BasicBussinessTypeEntity basicBussinessType = basicBussinessTypeService.findByAction(filterBusTypePreRequest.getAction()); List basicBusTypePreEntities = basicBusTypePreService.findByAction(filterBusTypePreRequest.getAction()); if (CollUtil.isEmpty(basicBusTypePreEntities)) { - //创建对应补单设置 + //创建对应单据流转 if (filterBusTypePreRequest.getType() != null && "changEnable".equals(filterBusTypePreRequest.getType())) { if (ConstantType.TYPE_OUT.equals(basicBussinessType.getMainAction()) && !basicBussinessType.isAdvanceType()) { BasicBusTypePreEntity basicBusTypePreEntity = new BasicBusTypePreEntity(); @@ -77,7 +78,7 @@ public class BasicBusTypePreController { } /** - * 补单设置实体数据查询接口 + * 单据流转实体数据查询接口 * * @param busTypeChangeFilterRequest * @param bindingResult @@ -93,6 +94,23 @@ public class BasicBusTypePreController { return ResultVOUtils.page(pageInfo); } + /** + * 查询单据流转列表数据 + * + * @param filterBusTypePreRequest + * @param bindingResult + * @return + */ + @GetMapping("/spms/busTypePre/filterBusTypePreRes") + public BaseResponse filterBusTypePreResList(FilterBusTypePreRequest filterBusTypePreRequest, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + List list = basicBusTypePreService.filterBusTypePreResList(filterBusTypePreRequest); + PageInfo pageInfo = new PageInfo<>(list); + return ResultVOUtils.page(pageInfo); + } + /** * 根据补单单据类型编码或ID删除补单单据类型 * 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 bda34cff..797f6e55 100644 --- a/src/main/java/com/glxp/api/controller/basic/BasicBussinessTypeController.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicBussinessTypeController.java @@ -15,6 +15,7 @@ import com.glxp.api.req.system.DeleteRequest; import com.glxp.api.res.basic.BasicBussinessTypeResponse; import com.glxp.api.res.basic.BussinessTypExportResponse; import com.glxp.api.res.basic.CandidateRequest; +import com.glxp.api.service.auth.CustomerService; import com.glxp.api.service.basic.IBasicBussinessTypeService; import com.glxp.api.util.CustomUtil; import com.glxp.api.util.FileUtils; @@ -42,6 +43,8 @@ public class BasicBussinessTypeController { @Resource private IBasicBussinessTypeService basicBussinessTypeService; + @Resource + private CustomerService customerService; /** * 查询单据类型列表 @@ -56,6 +59,24 @@ public class BasicBussinessTypeController { return ResultVOUtils.page(pageInfo); } + /** + * 根据当前用户查询单据类型 + * + * @param filterBussinessTypeRequest + * @param bindingResult + * @return + */ + @GetMapping("/udiwms/localBusType/filterByUser") + public BaseResponse filterByUser(FilterBussinessTypeRequest filterBussinessTypeRequest, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + filterBussinessTypeRequest.setUserId(customerService.getUserId()); + List list = basicBussinessTypeService.filterByUser(filterBussinessTypeRequest); + PageInfo pageInfo = new PageInfo<>(list); + return ResultVOUtils.page(pageInfo); + } + /** * 新增单据类型 * diff --git a/src/main/java/com/glxp/api/dao/basic/BasicBusTypePreDao.java b/src/main/java/com/glxp/api/dao/basic/BasicBusTypePreDao.java index 4f8275ee..88eb6ae5 100644 --- a/src/main/java/com/glxp/api/dao/basic/BasicBusTypePreDao.java +++ b/src/main/java/com/glxp/api/dao/basic/BasicBusTypePreDao.java @@ -3,6 +3,8 @@ package com.glxp.api.dao.basic; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.glxp.api.entity.basic.BasicBusTypePreEntity; import com.glxp.api.req.basic.FilterBusTypeChangeRequest; +import com.glxp.api.req.basic.FilterBusTypePreRequest; +import com.glxp.api.res.basic.BasicBusTypePreResponse; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -31,4 +33,13 @@ public interface BasicBusTypePreDao extends BaseMapper { * @return */ List findByAction(String action); + + /** + * 查询单据流转列表数据 + * + * @param filterBusTypePreRequest + * @return + */ + List selectBusTypePreResList(FilterBusTypePreRequest filterBusTypePreRequest); + } \ No newline at end of file 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 51d04365..c264f085 100644 --- a/src/main/java/com/glxp/api/dao/basic/BasicBussinessTypeDao.java +++ b/src/main/java/com/glxp/api/dao/basic/BasicBussinessTypeDao.java @@ -51,4 +51,13 @@ public interface BasicBussinessTypeDao extends BaseMapper selectCandidateBusType(@Param("mainAction") String mainAction); + + /** + * 查询用户关联的单据类型 + * + * @param filterBussinessTypeRequest + * @return + */ + List selectByUser(FilterBussinessTypeRequest filterBussinessTypeRequest); + } diff --git a/src/main/java/com/glxp/api/req/basic/FilterBusTypeChangeRequest.java b/src/main/java/com/glxp/api/req/basic/FilterBusTypeChangeRequest.java index 02dff6c8..c74002ba 100644 --- a/src/main/java/com/glxp/api/req/basic/FilterBusTypeChangeRequest.java +++ b/src/main/java/com/glxp/api/req/basic/FilterBusTypeChangeRequest.java @@ -14,11 +14,6 @@ public class FilterBusTypeChangeRequest extends ListPageRequest { */ private String originAction; - /** - * 是否启用: 0:启用;1:禁用 - */ - private Boolean enable; - /** * 原单据类型名称 */ diff --git a/src/main/java/com/glxp/api/req/basic/FilterBusTypePreRequest.java b/src/main/java/com/glxp/api/req/basic/FilterBusTypePreRequest.java index 25963b91..b7c17855 100644 --- a/src/main/java/com/glxp/api/req/basic/FilterBusTypePreRequest.java +++ b/src/main/java/com/glxp/api/req/basic/FilterBusTypePreRequest.java @@ -21,4 +21,21 @@ public class FilterBusTypePreRequest extends ListPageRequest { private String type; + /** + * 原单据类型代码 + */ + private String originAction; + + /** + * 原单据类型名称 + */ + private String originName; + + /** + * 目标单据类型名称 + */ + private String targetName; + + private String name; + } diff --git a/src/main/java/com/glxp/api/service/basic/IBasicBusTypeChangeService.java b/src/main/java/com/glxp/api/service/basic/IBasicBusTypeChangeService.java index 14b0d105..79e27e56 100644 --- a/src/main/java/com/glxp/api/service/basic/IBasicBusTypeChangeService.java +++ b/src/main/java/com/glxp/api/service/basic/IBasicBusTypeChangeService.java @@ -7,12 +7,12 @@ import com.glxp.api.res.basic.BasicBusTypeChangeResponse; import java.util.List; /** - * 单据转换设置Service + * 单据生成设置Service */ public interface IBasicBusTypeChangeService { /** - * 查询单据转换设置列表 + * 查询单据生成设置列表 * * @param filterBusTypeChangeRequest * @return @@ -20,7 +20,7 @@ public interface IBasicBusTypeChangeService { List filterList(FilterBusTypeChangeRequest filterBusTypeChangeRequest); /** - * 新增单据转换设置 + * 新增单据生成设置 * * @param basicBusTypeChangeEntity * @return @@ -28,14 +28,14 @@ public interface IBasicBusTypeChangeService { int insert(BasicBusTypeChangeEntity basicBusTypeChangeEntity); /** - * 更新单据转换设置 + * 更新单据生成设置 * * @param basicBusTypeChangeEntity */ boolean updateBasicBusTypeChange(BasicBusTypeChangeEntity basicBusTypeChangeEntity); /** - * 删除单据转换设置 + * 删除单据生成设置 * * @param id */ diff --git a/src/main/java/com/glxp/api/service/basic/IBasicBusTypePreService.java b/src/main/java/com/glxp/api/service/basic/IBasicBusTypePreService.java index 38873b1d..4957facc 100644 --- a/src/main/java/com/glxp/api/service/basic/IBasicBusTypePreService.java +++ b/src/main/java/com/glxp/api/service/basic/IBasicBusTypePreService.java @@ -2,6 +2,8 @@ package com.glxp.api.service.basic; import com.glxp.api.entity.basic.BasicBusTypePreEntity; import com.glxp.api.req.basic.FilterBusTypeChangeRequest; +import com.glxp.api.req.basic.FilterBusTypePreRequest; +import com.glxp.api.res.basic.BasicBusTypePreResponse; import java.util.List; @@ -59,4 +61,13 @@ public interface IBasicBusTypePreService { * @return */ List findByAction(String action); + + /** + * 查询单据流转列表数据 + * + * @param filterBusTypePreRequest + * @return + */ + List filterBusTypePreResList(FilterBusTypePreRequest filterBusTypePreRequest); + } 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 8bf1eaf0..6a674536 100644 --- a/src/main/java/com/glxp/api/service/basic/IBasicBussinessTypeService.java +++ b/src/main/java/com/glxp/api/service/basic/IBasicBussinessTypeService.java @@ -85,8 +85,17 @@ public interface IBasicBussinessTypeService { /** * 第三方系统,单据提交接口,查询未绑定的单据类型 + * * @return */ List filterForThirdSys(); + /** + * 查询用户关联单据类型 + * + * @param filterBussinessTypeRequest + * @return + */ + List filterByUser(FilterBussinessTypeRequest filterBussinessTypeRequest); + } diff --git a/src/main/java/com/glxp/api/service/basic/impl/BasicBusTypePreServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/BasicBusTypePreServiceImpl.java index 925c1247..47d2ea0b 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/BasicBusTypePreServiceImpl.java +++ b/src/main/java/com/glxp/api/service/basic/impl/BasicBusTypePreServiceImpl.java @@ -4,6 +4,8 @@ import com.github.pagehelper.PageHelper; import com.glxp.api.dao.basic.BasicBusTypePreDao; import com.glxp.api.entity.basic.BasicBusTypePreEntity; import com.glxp.api.req.basic.FilterBusTypeChangeRequest; +import com.glxp.api.req.basic.FilterBusTypePreRequest; +import com.glxp.api.res.basic.BasicBusTypePreResponse; import com.glxp.api.service.auth.CustomerService; import com.glxp.api.service.basic.IBasicBusTypePreService; import lombok.extern.slf4j.Slf4j; @@ -11,6 +13,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.Collections; import java.util.Date; import java.util.List; @@ -59,6 +62,17 @@ public class BasicBusTypePreServiceImpl implements IBasicBusTypePreService { return basicBusTypePreDao.findByAction(action); } + @Override + public List filterBusTypePreResList(FilterBusTypePreRequest filterBusTypePreRequest) { + if (null == filterBusTypePreRequest) { + return Collections.emptyList(); + } + if (null != filterBusTypePreRequest.getPage() && null != filterBusTypePreRequest.getLimit()) { + PageHelper.offsetPage((filterBusTypePreRequest.getPage() - 1) * filterBusTypePreRequest.getLimit(), filterBusTypePreRequest.getLimit()); + } + return basicBusTypePreDao.selectBusTypePreResList(filterBusTypePreRequest); + } + /** * 设置创建/更新信息 * 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 d5572118..639721b4 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 @@ -141,6 +141,17 @@ public class BasicBussinessTypeServiceImpl implements IBasicBussinessTypeService return basicBussinessTypeDao.selectForThirdSys(); } + @Override + public List filterByUser(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.selectByUser(filterBussinessTypeRequest); + } + /** * 统一设置创建/更新信息 * diff --git a/src/main/resources/mybatis/mapper/basic/BasicBusTypePreDao.xml b/src/main/resources/mybatis/mapper/basic/BasicBusTypePreDao.xml index af3eae3e..6eb0c25b 100644 --- a/src/main/resources/mybatis/mapper/basic/BasicBusTypePreDao.xml +++ b/src/main/resources/mybatis/mapper/basic/BasicBusTypePreDao.xml @@ -4,6 +4,11 @@ @@ -21,4 +26,30 @@ left join auth_warehouse on basic_bustype_pre.defaultInvCode = auth_warehouse.code where basic_bustype_pre.action = #{action} + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/basic/BasicBussinessTypeDao.xml b/src/main/resources/mybatis/mapper/basic/BasicBussinessTypeDao.xml index 61e92e9f..cfcccdd2 100644 --- a/src/main/resources/mybatis/mapper/basic/BasicBussinessTypeDao.xml +++ b/src/main/resources/mybatis/mapper/basic/BasicBussinessTypeDao.xml @@ -180,4 +180,31 @@ and corpType = 1 and (supplementOrderType is null or supplementOrderType = '') + +