单位名称
This commit is contained in:
@@ -15,6 +15,7 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
public class ProductVO extends Product {
|
public class ProductVO extends Product {
|
||||||
private BigDecimal lowPrice;
|
private BigDecimal lowPrice;
|
||||||
|
private Long unitName;
|
||||||
private BigDecimal lowMemberPrice;
|
private BigDecimal lowMemberPrice;
|
||||||
private List<ProdSku> skuList;
|
private List<ProdSku> skuList;
|
||||||
private Integer isSaleTime;
|
private Integer isSaleTime;
|
||||||
|
|||||||
@@ -118,8 +118,8 @@ public class PadProdServiceImpl implements PadProdService {
|
|||||||
List<ProdSku> skuList = prodSkuService.list(new QueryWrapper().eq(ProdSku::getProductId, item.getId()));
|
List<ProdSku> skuList = prodSkuService.list(new QueryWrapper().eq(ProdSku::getProductId, item.getId()));
|
||||||
item.setSkuList(skuList);
|
item.setSkuList(skuList);
|
||||||
item.setIsSaleTime(calcIsSaleTime(item.getDays(), item.getStartTime(), item.getEndTime()));
|
item.setIsSaleTime(calcIsSaleTime(item.getDays(), item.getStartTime(), item.getEndTime()));
|
||||||
Optional<BigDecimal> lowMemberPriceIsPresent = skuList.stream().map(obj -> NumberUtil.nullToZero(obj.getMemberPrice())).min(BigDecimal::compareTo);
|
// Optional<BigDecimal> lowMemberPriceIsPresent = skuList.stream().map(obj -> NumberUtil.nullToZero(obj.getMemberPrice())).min(BigDecimal::compareTo);
|
||||||
lowMemberPriceIsPresent.ifPresent(item::setLowMemberPrice);
|
// lowMemberPriceIsPresent.ifPresent(item::setLowMemberPrice);
|
||||||
});
|
});
|
||||||
padDetailDTO.setProductList(products);
|
padDetailDTO.setProductList(products);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,9 +246,10 @@
|
|||||||
where id = #{shopId}
|
where id = #{shopId}
|
||||||
</select>
|
</select>
|
||||||
<select id="productList" resultType="com.czg.product.vo.ProductVO">
|
<select id="productList" resultType="com.czg.product.vo.ProductVO">
|
||||||
select a.*, min(b.sale_price) as lowPrice
|
select a.*, min(b.sale_price) as lowPrice, min(b.member_price) as lowMemberPrice, unit.name as unitName
|
||||||
from tb_product as a
|
from tb_product as a
|
||||||
left join tb_prod_sku as b on a.id = b.product_id
|
left join tb_prod_sku as b on a.id = b.product_id
|
||||||
|
left join tb_shop_prod_unit unit on a.unit_id=unit.id
|
||||||
where a.shop_id = #{shopId}
|
where a.shop_id = #{shopId}
|
||||||
<if test="productIds != null">
|
<if test="productIds != null">
|
||||||
and a.id in
|
and a.id in
|
||||||
|
|||||||
Reference in New Issue
Block a user