fix
This commit is contained in:
parent
c500891702
commit
6e0d89039c
|
|
@ -10,6 +10,7 @@ import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
|
|
@ -44,6 +45,8 @@ public class ProductVO {
|
||||||
|
|
||||||
private BigDecimal productStock;
|
private BigDecimal productStock;
|
||||||
|
|
||||||
|
private List<String> productImgList;
|
||||||
|
|
||||||
@JsonSerialize(using = BigDecimalSerializerBO.class)
|
@JsonSerialize(using = BigDecimalSerializerBO.class)
|
||||||
private BigDecimal purchasePrice;
|
private BigDecimal purchasePrice;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ import java.math.RoundingMode;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
@ -327,6 +328,14 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||||
ProductVO productVO = new ProductVO();
|
ProductVO productVO = new ProductVO();
|
||||||
BeanUtils.copyProperties(item, productVO);
|
BeanUtils.copyProperties(item, productVO);
|
||||||
|
|
||||||
|
// 填充图片信息
|
||||||
|
var productImgList = productImageService.lambdaQuery()
|
||||||
|
.select(ProductImage::getImageUrl)
|
||||||
|
.eq(ProductImage::getDeleteFlag, CommonConstants.NOT_DELETED)
|
||||||
|
.eq(ProductImage::getProductId, item.getId())
|
||||||
|
.list();
|
||||||
|
productVO.setProductImgList(productImgList.stream().map(ProductImage::getImageUrl).collect(Collectors.toList()));
|
||||||
|
|
||||||
var productCategoryName = productCategoryService.lambdaQuery()
|
var productCategoryName = productCategoryService.lambdaQuery()
|
||||||
.eq(ProductCategory::getId, item.getProductCategoryId())
|
.eq(ProductCategory::getId, item.getProductCategoryId())
|
||||||
.eq(ProductCategory::getDeleteFlag, CommonConstants.NOT_DELETED)
|
.eq(ProductCategory::getDeleteFlag, CommonConstants.NOT_DELETED)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue