From 364e21d175d91ad58cbc65642bfc036780192374 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期三, 08 一月 2025 14:29:50 +0800
Subject: [PATCH] bug修改
---
manage/src/main/java/com/jilongda/manage/controller/TInventoryController.java | 27 ++++++++++++++-------------
1 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/manage/src/main/java/com/jilongda/manage/controller/TInventoryController.java b/manage/src/main/java/com/jilongda/manage/controller/TInventoryController.java
index fac1b2e..7f80c11 100644
--- a/manage/src/main/java/com/jilongda/manage/controller/TInventoryController.java
+++ b/manage/src/main/java/com/jilongda/manage/controller/TInventoryController.java
@@ -134,29 +134,30 @@
.eq(getCurrentByParam.getBrandId()!=null,TModel::getBrandId,getCurrentByParam.getBrandId())
.list().stream().map(TModel::getId).collect(Collectors.toList());
if (collect.isEmpty())collect.add(-1);
- TFrameGoods one = frameGoodsService.lambdaQuery().in(TFrameGoods::getModelId, collect)
+ List<TFrameGoods> one = frameGoodsService.lambdaQuery().in(TFrameGoods::getModelId, collect)
.eq(TFrameGoods::getStoreId,getCurrentByParam.getStoreId())
- .eq(TFrameGoods::getColor, getCurrentByParam.getColor()).one();
- if (one!=null){
- return ApiResult.success(one.getTotal());
-
- }
- return ApiResult.success(0);
+ .eq(TFrameGoods::getColor, getCurrentByParam.getColor()).list();
+ if (one.isEmpty())return ApiResult.success(0);
+ Integer temp = one.stream()
+ .mapToInt(TFrameGoods::getTotal)
+ .sum();
+ return ApiResult.success(temp);
}
@ApiOperation(value = "镜片-根据品牌id、型号名称、色号名称、材质id查询当前库存")
@PostMapping(value = "/getCurrentByParamLens")
public ApiResult<Integer> getCurrentByParamLens(@RequestBody GetCurrentByParamLens dto) {
- TLensGoods one = lensGoodsService.lambdaQuery().in(TLensGoods::getSeriesId, dto.getSeriesId())
+ List<TLensGoods> one = lensGoodsService.lambdaQuery().in(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 = "查看详情")
@GetMapping(value = "/getDetailById")
--
Gitblit v1.7.1