无关风月
2025-01-15 943af1e14662b88e64b4cdd16fec66e74bcb85da
manage/src/main/java/com/jilongda/manage/controller/TInventoryController.java
@@ -94,7 +94,7 @@
    }
    @ApiOperation(value = "镜架-根据品牌id查询对应库存")
    @GetMapping(value = "/getCountByBrandId")
    @PostMapping(value = "/getCountByBrandId")
    public ApiResult getCountByBrandId(Integer id,Integer storeId) {
        List<Integer> collect = modelService.lambdaQuery().eq(TModel::getBrandId, id)
                .list().stream().map(TModel::getId).distinct().collect(Collectors.toList());
@@ -110,7 +110,7 @@
        return ApiResult.success(i);
    }
    @ApiOperation(value = "镜架-根据材质id查询对应库存")
    @GetMapping(value = "/getCountByMaterialId")
    @PostMapping(value = "/getCountByMaterialId")
    public ApiResult getCountByMaterialId(Integer id,Integer storeId) {
        List<Integer> collect = modelService.lambdaQuery().eq(TModel::getMaterialId, id)
                .list().stream().map(TModel::getId).distinct().collect(Collectors.toList());
@@ -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")