From 0c9ed50afba582467d29dc2344eec93768add388 Mon Sep 17 00:00:00 2001 From: chenhao <852066789@qq.com> Date: Fri, 16 May 2025 10:13:51 +0800 Subject: [PATCH] =?UTF-8?q?feat(order):=20=E6=96=B0=E5=A2=9E=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E4=BA=A7=E5=93=81=E6=8A=98=E6=89=A3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在订单编辑页面添加产品折扣输入框 - 在 OrderList 模型中添加 discount 字段 - 更新 OrderInfoMapper映射文件,支持 discount 字段的查询和更新 -调整订单总价计算逻辑,考虑折扣因素 --- .../templates/manage/order/edit.html | 41 +++++++++++-------- .../java/com/ruoyi/sip/domain/OrderList.java | 2 + .../mapper/manage/OrderInfoMapper.xml | 3 ++ 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/manage/order/edit.html b/ruoyi-admin/src/main/resources/templates/manage/order/edit.html index aa0f8c7f..cb6fc21c 100644 --- a/ruoyi-admin/src/main/resources/templates/manage/order/edit.html +++ b/ruoyi-admin/src/main/resources/templates/manage/order/edit.html @@ -88,30 +88,30 @@ -
-
- -
-
+ + + + + -
-
-
-
-
-
- -
+ + + + + + + + -
-
-
+ + +
@@ -252,6 +252,15 @@ return html; } }, + { + field: 'discount', + align: 'center', + title: '折扣', + formatter: function(value, row, index) { + var html = $.common.sprintf("", index, value); + return html; + } + }, { field: 'amount', diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/OrderList.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/OrderList.java index e8ed2be2..8d4763c7 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/OrderList.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/OrderList.java @@ -47,6 +47,8 @@ public class OrderList extends BaseEntity /** 总价 */ @Excel(name = "总价") private BigDecimal amount; + /** 优惠 */ + private BigDecimal discount; /** 创建时间 */ diff --git a/ruoyi-sip/src/main/resources/mapper/manage/OrderInfoMapper.xml b/ruoyi-sip/src/main/resources/mapper/manage/OrderInfoMapper.xml index a0ad37c4..0eb31ae5 100644 --- a/ruoyi-sip/src/main/resources/mapper/manage/OrderInfoMapper.xml +++ b/ruoyi-sip/src/main/resources/mapper/manage/OrderInfoMapper.xml @@ -154,6 +154,7 @@ t1.product_code, t2.product_name, t1.quantity, + t1.discount, t1.price, t1.amount, t1.remark, @@ -279,6 +280,8 @@ quantity = #{item.quantity}, amount = #{item.amount}, + discount = #{item.discount}, + price = #{item.price}, remark = #{item.remark}, updated_at = NOW(),