From 01788ea18a48b738df0807f656a4007a5f16a13a Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期一, 06 一月 2025 17:51:54 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/eyes

---
 manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 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 f5ead40..051a1d1 100644
--- a/manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java
+++ b/manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java
@@ -33,6 +33,7 @@
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 /**
@@ -75,12 +76,14 @@
         // 根据型号名称 查询型号列表ids
         List<Integer> collect = modelService.lambdaQuery()
                 .eq(StringUtils.hasLength(getCurrentByParam.getModel()),TModel::getName, getCurrentByParam.getModel())
-                .eq(getCurrentByParam.getMaterialId()!=null,TModel::getMaterialId,getCurrentByParam.getMaterialId())
+                .eq(Objects.nonNull(getCurrentByParam.getMaterialId()),TModel::getMaterialId,getCurrentByParam.getMaterialId())
                 .eq(StringUtils.hasLength(getCurrentByParam.getColor()),TModel::getColor,getCurrentByParam.getColor())
-                .eq(getCurrentByParam.getBrandId()!=null,TModel::getBrandId,getCurrentByParam.getBrandId())
+                .eq(Objects.nonNull(getCurrentByParam.getBrandId()),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)
-                .eq(TFrameGoods::getColor, getCurrentByParam.getColor()).one();
+                .eq(TFrameGoods::getColor, getCurrentByParam.getColor())
+                .eq(TFrameGoods::getStoreId, getCurrentByParam.getStoreId()).one();
         if (one!=null){
             return ApiResult.success(one.getTotal());
         }
@@ -89,11 +92,12 @@
     @ApiOperation(value = "镜片-根据系列id、球/非球、品牌id、折射率、ballMirror、columnMirror查询当前库存")
     @PostMapping(value = "/getCurrentByParamLens")
     public ApiResult<Integer> getCurrentByParamLens(@RequestBody GetCurrentByParamLens dto) {
-        TLensGoods one = lensGoodsService.lambdaQuery().in(TLensGoods::getSeriesId, dto.getSeriesId())
+        TLensGoods one = lensGoodsService.lambdaQuery().eq(TLensGoods::getSeriesId, dto.getSeriesId())
                 .eq(dto.getLensType()!=null,TLensGoods::getLensType, dto.getLensType())
                 .eq(dto.getRefractiveIndex()!=null,TLensGoods::getRefractiveIndex, dto.getRefractiveIndex())
                 .eq(dto.getBallMirror()!=null,TLensGoods::getBallMirror, dto.getBallMirror())
                 .eq(dto.getColumnMirror()!=null,TLensGoods::getColumnMirror, dto.getColumnMirror())
+                .eq(dto.getStoreId()!=null,TLensGoods::getStoreId, dto.getStoreId())
                 .one();
         if (one!=null){
             return ApiResult.success(one.getTotal());

--
Gitblit v1.7.1