|
|
@@ -198,28 +198,32 @@ public class GoodsDescController extends BladeController {
|
|
|
@GetMapping("/findById")
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
@ApiOperation(value = "分页", notes = "传入goodsDesc")
|
|
|
- public R list(@RequestParam(name = "id", required = true) String id) {
|
|
|
+ public R list(@RequestParam(name = "id") String id) {
|
|
|
GoodsDesc goodsDesc = goodsDescService.getById(id);
|
|
|
- LambdaQueryWrapper<GoodsPrice> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- lambdaQueryWrapper.eq(GoodsPrice::getPid, id);
|
|
|
- List<GoodsPrice> priceList = goodsPriceService.list(lambdaQueryWrapper);
|
|
|
-
|
|
|
- LambdaQueryWrapper<GoodsFiles> filesLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- filesLambdaQueryWrapper.eq(GoodsFiles::getPid, id);
|
|
|
- List<GoodsFiles> filesList = goodsFilesService.list(filesLambdaQueryWrapper);
|
|
|
- //查询商品规格明细
|
|
|
- LambdaQueryWrapper<GoodsSpecification> specificationWrapper = new LambdaQueryWrapper<>();
|
|
|
- specificationWrapper.eq(GoodsSpecification::getPid, id);
|
|
|
- specificationWrapper.eq(GoodsSpecification::getIsDeleted, 0);
|
|
|
- specificationWrapper.eq(GoodsSpecification::getTenantId, SecureUtil.getTenantId());
|
|
|
- List<GoodsSpecification> goodsSpecificationList = goodsSpecificationService.list(specificationWrapper);
|
|
|
+
|
|
|
+ List<GoodsPrice> priceList = goodsPriceService.list(new LambdaQueryWrapper<GoodsPrice>()
|
|
|
+ .eq(GoodsPrice::getPid, id)
|
|
|
+ .eq(GoodsPrice::getIsDeleted, 0)
|
|
|
+ );
|
|
|
if (!CollectionUtils.isEmpty(priceList)) {
|
|
|
List<GoodsPrice> sale = priceList.stream().filter(e -> "0".equals(e.getBillType())).collect(Collectors.toList());
|
|
|
List<GoodsPrice> buy = priceList.stream().filter(e -> "1".equals(e.getBillType())).collect(Collectors.toList());
|
|
|
goodsDesc.setSaleGoodsPrice(sale);
|
|
|
goodsDesc.setBuyGoodsPrice(buy);
|
|
|
}
|
|
|
+
|
|
|
+ List<GoodsFiles> filesList = goodsFilesService.list(new LambdaQueryWrapper<GoodsFiles>()
|
|
|
+ .eq(GoodsFiles::getPid, id)
|
|
|
+ .eq(GoodsFiles::getIsDeleted, 0)
|
|
|
+ );
|
|
|
goodsDesc.setFilesList(filesList);
|
|
|
+
|
|
|
+ // 查询商品规格明细
|
|
|
+ List<GoodsSpecification> goodsSpecificationList = goodsSpecificationService.list(new LambdaQueryWrapper<GoodsSpecification>()
|
|
|
+ .eq(GoodsSpecification::getPid, id)
|
|
|
+ .eq(GoodsSpecification::getIsDeleted, 0)
|
|
|
+ .eq(GoodsSpecification::getTenantId, SecureUtil.getTenantId())
|
|
|
+ );
|
|
|
goodsDesc.setGoodsSpecificationList(goodsSpecificationList);
|
|
|
return R.data(goodsDesc);
|
|
|
}
|