feat: 订单明细增加商品冗余字段,保存完整商品信息
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Agent
2026-03-31 16:27:04 +00:00
parent 161fe60bd7
commit abd1d32e14
3 changed files with 49 additions and 0 deletions

View File

@@ -102,9 +102,15 @@ public class OrderServiceImpl implements OrderService {
item.setItemId(UUID.randomUUID().toString());
item.setOrderId(order.getOrderId());
item.setProductId(product.getProductId());
item.setCategoryId(product.getCategoryId());
item.setProductName(product.getName());
item.setProductSpec(product.getSpec());
item.setUnit(product.getUnit());
item.setCostPrice(product.getCostPrice());
item.setImageUrl(product.getImageUrl());
item.setBarcode(product.getBarcode());
item.setStockAlert(product.getStockAlert());
item.setDescription(product.getDescription());
item.setPrice(price);
item.setQuantity(itemDTO.getQuantity());
item.setSubtotal(subtotal);
@@ -347,9 +353,15 @@ public class OrderServiceImpl implements OrderService {
item.setItemId(UUID.randomUUID().toString());
item.setOrderId(orderId);
item.setProductId(product.getProductId());
item.setCategoryId(product.getCategoryId());
item.setProductName(product.getName());
item.setProductSpec(product.getSpec());
item.setUnit(product.getUnit());
item.setCostPrice(product.getCostPrice());
item.setImageUrl(product.getImageUrl());
item.setBarcode(product.getBarcode());
item.setStockAlert(product.getStockAlert());
item.setDescription(product.getDescription());
item.setPrice(price);
item.setQuantity(itemDTO.getQuantity());
item.setSubtotal(subtotal);