From 5cfea359d1acd70bd0ec383cb9e9c0a4e6cbdd32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AD=9D=E9=BE=99?= Date: Wed, 10 May 2023 19:20:49 +0800 Subject: [PATCH] =?UTF-8?q?update=20full=E6=8E=A5=E5=8F=A3=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=98=8E=E7=BB=86=EF=BC=8C=E8=BF=94=E5=9B=9Evo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReagentConsumableInventoryController.java | 15 ++++++-- .../ReagentConsumableInventoryService.java | 2 +- ...ReagentConsumableInventoryServiceImpl.java | 36 ++++++++++++++++--- 3 files changed, 45 insertions(+), 8 deletions(-) diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java b/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java index 8136130..72423f2 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java @@ -62,7 +62,7 @@ public class ReagentConsumableInventoryController { */ @ApiOperation(value = "通过id查询", notes = "通过id查询") @GetMapping("/{reagentConsumableInventoryId}") - @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')") +// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')") public R getById(@PathVariable("reagentConsumableInventoryId") String reagentConsumableInventoryId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -145,11 +145,20 @@ public class ReagentConsumableInventoryController { @ApiOperation(value = "试剂耗材/标准物质集合列表", notes = "试剂耗材/标准物质集合列表") @GetMapping("/full") // @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" ) - public R> getReagentConsumableInventoryFull( String category,String name, HttpServletRequest theHttpServletRequest) { + public R> getReagentConsumableInventoryFull( String category,String name, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - List reagentConsumableInventoryFull = reagentConsumableInventoryService.getReagentConsumableInventoryFull(Wrappers.query() + QueryWrapper reagentConsumableInventoryQueryWrapper = new QueryWrapper<>(); + + if (category!=null){ + reagentConsumableInventoryQueryWrapper.eq("category",category); + } + if (name!=null){ + reagentConsumableInventoryQueryWrapper.like("reagent_consumable_name",name); + } + + List reagentConsumableInventoryFull = reagentConsumableInventoryService.getReagentConsumableInventoryFull(Wrappers.query() .eq((StrUtil.isNotBlank(category)),"category",category) .like((StrUtil.isNotBlank(name)),"reagent_consumable_name",name)); diff --git a/src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java b/src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java index 13e4e16..e7eada7 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java @@ -34,5 +34,5 @@ public interface ReagentConsumableInventoryService extends IService getReagentConsumableInventoryRMVOList(Page page,String reagentConsumableName); - List getReagentConsumableInventoryFull(QueryWrapper qw); + List getReagentConsumableInventoryFull(QueryWrapper qw); } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumableInventoryServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumableInventoryServiceImpl.java index 18cf06d..2515b44 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumableInventoryServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumableInventoryServiceImpl.java @@ -316,13 +316,41 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl getReagentConsumableInventoryFull(QueryWrapper qw) { + public List getReagentConsumableInventoryFull(QueryWrapper qw){ + List list = reagentConsumableInventoryService.list(qw); +// return list; + List reagentConsumableInventoryFullVOList = new ArrayList<>(); - List list = reagentConsumableInventoryService.list(qw); + //找出对应的仓库信息 + for (ReagentConsumableInventory reagentConsumableInventory : list) { + + LambdaQueryWrapper batchDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>(); + + batchDetailsLambdaQueryWrapper.eq(BatchDetails::getReagentConsumableInventoryId, reagentConsumableInventory.getReagentConsumableInventoryId()) + .or().eq(BatchDetails::getServiceStatus, 1); + + List list1 = batchDetailsService.list(batchDetailsLambdaQueryWrapper); + //将不同批次的物品展示出来 + for (BatchDetails batchDetails : list1) { + + ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO(); - return list; + BeanUtils.copyProperties(reagentConsumableInventory, reagentConsumableInventoryFullVO); + SupplierInformation byId = supplierInformationService.getById(batchDetails.getSupplierId()); + + reagentConsumableInventoryFullVO.setSupplierName(byId.getSupplierName()); + + reagentConsumableInventoryFullVO.setBatch(batchDetails.getBatch()); + + reagentConsumableInventoryFullVO.setBatchDetailsId(batchDetails.getBatchDetailsId()); + + reagentConsumableInventoryFullVO.setTotalQuantity(batchDetails.getQuantity()); + + reagentConsumableInventoryFullVOList.add(reagentConsumableInventoryFullVO); + } + } + return reagentConsumableInventoryFullVOList; } } -