feat: findOrder价格返回改价后的价格
This commit is contained in:
@@ -11,6 +11,7 @@ public class SkuInfoPo {
|
|||||||
private String productSkuName;
|
private String productSkuName;
|
||||||
private BigDecimal num;
|
private BigDecimal num;
|
||||||
private BigDecimal priceAmount;
|
private BigDecimal priceAmount;
|
||||||
|
private BigDecimal discountAmount;
|
||||||
private BigDecimal packAmount;
|
private BigDecimal packAmount;
|
||||||
private String categoryId;
|
private String categoryId;
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
|
|||||||
@@ -1519,12 +1519,22 @@ public class OrderService {
|
|||||||
if (Objects.isNull(skuInfoPos) || skuInfoPos.size() < 0) {
|
if (Objects.isNull(skuInfoPos) || skuInfoPos.size() < 0) {
|
||||||
skuInfoPos = new ArrayList<>();
|
skuInfoPos = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
skuInfoPos.forEach(item -> {
|
||||||
|
if (item.getDiscountAmount() != null) {
|
||||||
|
item.setPriceAmount(item.getPriceAmount().subtract(item.getDiscountAmount()));
|
||||||
|
}
|
||||||
|
});
|
||||||
orderInfo.setSkuInfos(skuInfoPos);
|
orderInfo.setSkuInfos(skuInfoPos);
|
||||||
} else {
|
} else {
|
||||||
List<SkuInfoPo> skuInfoPos = tbOrderInfoMapper.selectSkuByOrderId(orderInfo.getId().toString());
|
List<SkuInfoPo> skuInfoPos = tbOrderInfoMapper.selectSkuByOrderId(orderInfo.getId().toString());
|
||||||
if (Objects.isNull(skuInfoPos) || skuInfoPos.size() < 0) {
|
if (Objects.isNull(skuInfoPos) || skuInfoPos.size() < 0) {
|
||||||
skuInfoPos = new ArrayList<>();
|
skuInfoPos = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
skuInfoPos.forEach(item -> {
|
||||||
|
if (item.getDiscountAmount() != null) {
|
||||||
|
item.setPriceAmount(item.getPriceAmount().subtract(item.getDiscountAmount()));
|
||||||
|
}
|
||||||
|
});
|
||||||
orderInfo.setSkuInfos(skuInfoPos);
|
orderInfo.setSkuInfos(skuInfoPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -611,6 +611,7 @@ select * from tb_order_info where trade_day = #{day} and table_id = #{masterId}
|
|||||||
d.product_sku_name AS productSkuName,
|
d.product_sku_name AS productSkuName,
|
||||||
c.category_id AS categoryId,
|
c.category_id AS categoryId,
|
||||||
d.price_amount as priceAmount,
|
d.price_amount as priceAmount,
|
||||||
|
d.discount_amount as discountAmount,
|
||||||
d.pack_amount as packAmount,
|
d.pack_amount as packAmount,
|
||||||
d.price as price,
|
d.price as price,
|
||||||
d.pro_group_info as proGroupInfo
|
d.pro_group_info as proGroupInfo
|
||||||
@@ -632,6 +633,7 @@ select * from tb_order_info where trade_day = #{day} and table_id = #{masterId}
|
|||||||
d.product_sku_name AS productSkuName,
|
d.product_sku_name AS productSkuName,
|
||||||
'' AS categoryId,
|
'' AS categoryId,
|
||||||
d.price_amount as priceAmount,
|
d.price_amount as priceAmount,
|
||||||
|
d.discount_amount as discountAmount,
|
||||||
d.pack_amount as packAmount,
|
d.pack_amount as packAmount,
|
||||||
d.price as price,
|
d.price as price,
|
||||||
d.pro_group_info as proGroupInfo
|
d.pro_group_info as proGroupInfo
|
||||||
|
|||||||
Reference in New Issue
Block a user