feat: 订单明细增加长度、宽度、面积字段
This commit is contained in:
@@ -70,5 +70,20 @@ public class CreateOrderRequest {
|
|||||||
* 销售单价(用户可自定义)
|
* 销售单价(用户可自定义)
|
||||||
*/
|
*/
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 长度(cm)
|
||||||
|
*/
|
||||||
|
private BigDecimal length;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 宽度(cm)
|
||||||
|
*/
|
||||||
|
private BigDecimal width;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 面积(m²)
|
||||||
|
*/
|
||||||
|
private BigDecimal area;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,21 @@ public class OrderItem {
|
|||||||
*/
|
*/
|
||||||
private BigDecimal subtotal;
|
private BigDecimal subtotal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 长度(cm)
|
||||||
|
*/
|
||||||
|
private BigDecimal length;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 宽度(cm)
|
||||||
|
*/
|
||||||
|
private BigDecimal width;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 面积(m²)
|
||||||
|
*/
|
||||||
|
private BigDecimal area;
|
||||||
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
@TableField(fill = FieldFill.INSERT)
|
||||||
private LocalDateTime createdAt;
|
private LocalDateTime createdAt;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,6 +113,9 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
item.setDescription(product.getDescription());
|
item.setDescription(product.getDescription());
|
||||||
item.setPrice(price);
|
item.setPrice(price);
|
||||||
item.setQuantity(itemDTO.getQuantity());
|
item.setQuantity(itemDTO.getQuantity());
|
||||||
|
item.setLength(itemDTO.getLength());
|
||||||
|
item.setWidth(itemDTO.getWidth());
|
||||||
|
item.setArea(itemDTO.getArea());
|
||||||
item.setSubtotal(subtotal);
|
item.setSubtotal(subtotal);
|
||||||
orderItems.add(item);
|
orderItems.add(item);
|
||||||
|
|
||||||
@@ -364,6 +367,9 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
item.setDescription(product.getDescription());
|
item.setDescription(product.getDescription());
|
||||||
item.setPrice(price);
|
item.setPrice(price);
|
||||||
item.setQuantity(itemDTO.getQuantity());
|
item.setQuantity(itemDTO.getQuantity());
|
||||||
|
item.setLength(itemDTO.getLength());
|
||||||
|
item.setWidth(itemDTO.getWidth());
|
||||||
|
item.setArea(itemDTO.getArea());
|
||||||
item.setSubtotal(subtotal);
|
item.setSubtotal(subtotal);
|
||||||
orderItems.add(item);
|
orderItems.add(item);
|
||||||
orderItemMapper.insert(item);
|
orderItemMapper.insert(item);
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- 添加商品长度、宽度、面积字段
|
||||||
|
ALTER TABLE order_items ADD COLUMN length DECIMAL(10,2) COMMENT '长度(cm)';
|
||||||
|
ALTER TABLE order_items ADD COLUMN width DECIMAL(10,2) COMMENT '宽度(cm)';
|
||||||
|
ALTER TABLE order_items ADD COLUMN area DECIMAL(10,4) COMMENT '面积(m²)';
|
||||||
Reference in New Issue
Block a user