计算成本价问题

This commit is contained in:
2026-01-05 14:31:32 +08:00
parent f3c42856fc
commit e8b2924d60
2 changed files with 2 additions and 2 deletions

View File

@@ -320,7 +320,7 @@ public interface ShopOrderStatisticMapper extends BaseMapper<ShopOrderStatistic>
" `order`.shop_id = #{shopId} " +
" and trade_day = #{tradeDay} " +
" and paid_time is not null" +
" order by detail.product_id, detail.sku_id")
" group by detail.product_id, detail.sku_id")
List<ProductCostAmountVO> getOrderDetailProduct(Long shopId, LocalDate tradeDay);
}

View File

@@ -226,7 +226,7 @@ public class ShopOrderStatisticServiceImpl extends ServiceImpl<ShopOrderStatisti
*/
private BigDecimal getProductCostAmount(Long shopId, LocalDate day) {
BigDecimal productCostAmount = BigDecimal.ZERO;
////获取orderDetail信息 productId skuId 数量
//获取orderDetail信息 productId skuId 数量
List<ProductCostAmountVO> orderDetailProduct = mapper.getOrderDetailProduct(shopId, day);
orderDetailProduct = orderDetailProduct.stream()
.filter(Objects::nonNull)