update full接口增加明细,返回vo

main
张孝龙 2 years ago
parent fed8bedd32
commit 5cfea359d1
  1. 15
      src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java
  2. 2
      src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java
  3. 36
      src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumableInventoryServiceImpl.java

@ -62,7 +62,7 @@ public class ReagentConsumableInventoryController {
*/ */
@ApiOperation(value = "通过id查询", notes = "通过id查询") @ApiOperation(value = "通过id查询", notes = "通过id查询")
@GetMapping("/{reagentConsumableInventoryId}") @GetMapping("/{reagentConsumableInventoryId}")
@PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')") // @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')")
public R<ReagentConsumableInventory> getById(@PathVariable("reagentConsumableInventoryId") String reagentConsumableInventoryId, HttpServletRequest theHttpServletRequest) { public R<ReagentConsumableInventory> getById(@PathVariable("reagentConsumableInventoryId") String reagentConsumableInventoryId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@ -145,11 +145,20 @@ public class ReagentConsumableInventoryController {
@ApiOperation(value = "试剂耗材/标准物质集合列表", notes = "试剂耗材/标准物质集合列表") @ApiOperation(value = "试剂耗材/标准物质集合列表", notes = "试剂耗材/标准物质集合列表")
@GetMapping("/full") @GetMapping("/full")
// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" ) // @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" )
public R<List<ReagentConsumableInventory>> getReagentConsumableInventoryFull( String category,String name, HttpServletRequest theHttpServletRequest) { public R<List<ReagentConsumableInventoryFullVO>> getReagentConsumableInventoryFull( String category,String name, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
List<ReagentConsumableInventory> reagentConsumableInventoryFull = reagentConsumableInventoryService.getReagentConsumableInventoryFull(Wrappers.<ReagentConsumableInventory>query() QueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryQueryWrapper = new QueryWrapper<>();
if (category!=null){
reagentConsumableInventoryQueryWrapper.eq("category",category);
}
if (name!=null){
reagentConsumableInventoryQueryWrapper.like("reagent_consumable_name",name);
}
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFull = reagentConsumableInventoryService.getReagentConsumableInventoryFull(Wrappers.<ReagentConsumableInventory>query()
.eq((StrUtil.isNotBlank(category)),"category",category) .eq((StrUtil.isNotBlank(category)),"category",category)
.like((StrUtil.isNotBlank(name)),"reagent_consumable_name",name)); .like((StrUtil.isNotBlank(name)),"reagent_consumable_name",name));

@ -34,5 +34,5 @@ public interface ReagentConsumableInventoryService extends IService<ReagentConsu
Page<ReagentConsumableInventoryVO> getReagentConsumableInventoryRMVOList(Page page,String reagentConsumableName); Page<ReagentConsumableInventoryVO> getReagentConsumableInventoryRMVOList(Page page,String reagentConsumableName);
List<ReagentConsumableInventory> getReagentConsumableInventoryFull(QueryWrapper<ReagentConsumableInventory> qw); List<ReagentConsumableInventoryFullVO> getReagentConsumableInventoryFull(QueryWrapper<ReagentConsumableInventory> qw);
} }

@ -316,13 +316,41 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
@Override @Override
public List<ReagentConsumableInventory> getReagentConsumableInventoryFull(QueryWrapper<ReagentConsumableInventory> qw) { public List<ReagentConsumableInventoryFullVO> getReagentConsumableInventoryFull(QueryWrapper<ReagentConsumableInventory> qw){
List<ReagentConsumableInventory> list = reagentConsumableInventoryService.list(qw);
// return list;
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFullVOList = new ArrayList<>();
List<ReagentConsumableInventory> list = reagentConsumableInventoryService.list(qw); //找出对应的仓库信息
for (ReagentConsumableInventory reagentConsumableInventory : list) {
LambdaQueryWrapper<BatchDetails> batchDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>();
batchDetailsLambdaQueryWrapper.eq(BatchDetails::getReagentConsumableInventoryId, reagentConsumableInventory.getReagentConsumableInventoryId())
.or().eq(BatchDetails::getServiceStatus, 1);
List<BatchDetails> 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;
} }
} }

Loading…
Cancel
Save