From 70323f2e5fe060627583881c72eb34cdd23ffba8 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Thu, 26 Oct 2023 10:15:28 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E7=94=A8=E8=8E=B7=E5=8F=96=E4=B8=8A?= =?UTF-8?q?=E7=BA=A7=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/config/MasterDataSourceConfig.java | 2 +- .../auth/InvWarehouseController.java | 38 +++++++++++++------ .../purchase/PurOrderReceiveController.java | 3 +- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/glxp/api/config/MasterDataSourceConfig.java b/src/main/java/com/glxp/api/config/MasterDataSourceConfig.java index 6626ebc8..b008043c 100644 --- a/src/main/java/com/glxp/api/config/MasterDataSourceConfig.java +++ b/src/main/java/com/glxp/api/config/MasterDataSourceConfig.java @@ -59,7 +59,7 @@ public class MasterDataSourceConfig { sessionFactory.setConfiguration(configuration); globalConfig.setSqlInjector(new CustomerSqlInjector()); sessionFactory.setGlobalConfig(globalConfig); - sessionFactory.setPlugins(mybatisPlusInterceptor()); +// sessionFactory.setPlugins(mybatisPlusInterceptor()); sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver() .getResources(MasterDataSourceConfig.MAPPER_LOCATION)); return sessionFactory.getObject(); diff --git a/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java b/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java index 9e7cac83..7e091f05 100644 --- a/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java +++ b/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java @@ -184,19 +184,10 @@ public class InvWarehouseController extends BaseController { filterInvSubWarehouseRequest.setAdvanceType(1); } List invWarehouseEntities = invWarehouseService.filterInvSubWarehouse(filterInvSubWarehouseRequest); - List invWarehouseEntities1 = new ArrayList<>(); - for (InvWarehouseEntity invWarehouseEntity : invWarehouseEntities) { - if (!"".equals(invWarehouseEntity.getParentCode())) { - invWarehouseEntities1.add(invWarehouseEntity); - } - //领用仓库选择二级仓库的话,可以领用上一级中心库的产品 - if (!filterInvWarehouseRequest.getLocInvCode().equals("1000000") && invWarehouseEntity.getCode().equals("1000000")) { - invWarehouseEntities1.add(invWarehouseEntity); - } - } + List results = new ArrayList<>(); - if (CollUtil.isNotEmpty(invWarehouseEntities1)) { - invWarehouseEntities1.forEach(invWarehouseEntity -> { + if (CollUtil.isNotEmpty(invWarehouseEntities)) { + invWarehouseEntities.forEach(invWarehouseEntity -> { if (!invWarehouseEntity.getCode().equals(filterInvWarehouseRequest.getLocInvCode())) { results.add(invWarehouseEntity); } @@ -205,6 +196,29 @@ public class InvWarehouseController extends BaseController { return ResultVOUtils.success(results.stream().distinct().collect(Collectors.toList())); } + /** + * 获取上级仓库 + * + * @param filterInvWarehouseRequest + * @return + */ + @AuthRuleAnnotation("") + @GetMapping("spms/inv/warehouse/findByUp") + public BaseResponse findByUp(FilterInvWarehouseRequest filterInvWarehouseRequest) { + if (StrUtil.isEmpty(filterInvWarehouseRequest.getLocInvCode())) { + return ResultVOUtils.error(500, "当前仓库不能为空!"); + } + List invWarehouseEntities = new ArrayList<>(); + InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode(filterInvWarehouseRequest.getLocInvCode()); + if (invWarehouseEntity != null) { + InvWarehouseEntity invWarehouseEntity1 = invWarehouseService.findByInvSubByCode(invWarehouseEntity.getParentCode()); + if (invWarehouseEntity1 != null) + invWarehouseEntities.add(invWarehouseEntity1); + } + return ResultVOUtils.success(invWarehouseEntities); +// return ResultVOUtils.error(500, "未找到!"); + } + @AuthRuleAnnotation("") @GetMapping("spms/sub/inv/warehouse/filterSub") diff --git a/src/main/java/com/glxp/api/controller/purchase/PurOrderReceiveController.java b/src/main/java/com/glxp/api/controller/purchase/PurOrderReceiveController.java index 6dfa8958..86ff5bb8 100644 --- a/src/main/java/com/glxp/api/controller/purchase/PurOrderReceiveController.java +++ b/src/main/java/com/glxp/api/controller/purchase/PurOrderReceiveController.java @@ -166,8 +166,7 @@ public class PurOrderReceiveController extends BaseController { } List data = receiveService.filterList(filterReceiveRequest); - PageInfo pageInfo; - pageInfo = new PageInfo<>(data); + PageInfo pageInfo = new PageInfo<>(data); PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); pageSimpleResponse.setTotal(pageInfo.getTotal()); pageSimpleResponse.setList(data);