From 72aa82ca406b95fd56de4c8233db44be0bb5a1a3 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期三, 08 一月 2025 13:46:50 +0800 Subject: [PATCH] bug修改 --- manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java b/manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java index c147357..e413752 100644 --- a/manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java +++ b/manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java @@ -92,17 +92,18 @@ @ApiOperation(value = "镜片-根据系列id、球/非球、品牌id、折射率、ballMirror、columnMirror查询当前库存") @PostMapping(value = "/getCurrentByParamLens") public ApiResult<Integer> getCurrentByParamLens(@RequestBody GetCurrentByParamLens dto) { - TLensGoods one = lensGoodsService.lambdaQuery().eq(TLensGoods::getSeriesId, dto.getSeriesId()) + List<TLensGoods> one = lensGoodsService.lambdaQuery().eq(TLensGoods::getSeriesId, dto.getSeriesId()) .eq(dto.getLensType()!=null,TLensGoods::getLensType, dto.getLensType()) .eq(StringUtils.hasLength(dto.getRefractiveIndex()),TLensGoods::getRefractiveIndex, dto.getRefractiveIndex()) .eq(StringUtils.hasLength(dto.getBallMirror()),TLensGoods::getBallMirror, dto.getBallMirror()) .eq(StringUtils.hasLength(dto.getColumnMirror()),TLensGoods::getColumnMirror, dto.getColumnMirror()) .eq(dto.getStoreId()!=null,TLensGoods::getStoreId, dto.getStoreId()) - .one(); - if (one!=null){ - return ApiResult.success(one.getTotal()); - } - return ApiResult.success(0); + .list(); + if (one.isEmpty())return ApiResult.success(0); + Integer temp = one.stream() + .mapToInt(TLensGoods::getTotal) + .sum(); + return ApiResult.success(temp); } @ApiOperation(value = "镜架库存分页列表") @PostMapping(value = "/frameReceiptList") -- Gitblit v1.7.1