| | |
| | | .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") |