From 7f7adc5cd7eadc5fdd9324fbdca6200ec4bee00b Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 9 Sep 2026 15:17:09 +0800 Subject: [PATCH] =?UTF-8?q?refactor(sale):=20=E4=BF=AE=E6=94=B9=E9=94=80?= =?UTF-8?q?=E5=94=AE=E4=BA=A7=E5=93=81=E7=BB=93=E6=9E=84=E4=BD=93=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 ChangeProductItem 中的 SaleCount 和 SalePrice 字段改为指针类型 - 将 ChangeProduct 中的 SaleCount 和 SalePrice 字段改为指针类型 - 保持其他字段类型不变以维持兼容性 - 通过指针类型支持空值处理场景 --- erp/sale/audit.go | 6 +++--- erp/sale/change.go | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/erp/sale/audit.go b/erp/sale/audit.go index d017343..53c7e7f 100644 --- a/erp/sale/audit.go +++ b/erp/sale/audit.go @@ -55,9 +55,9 @@ type ArgsAuditChange struct { Products []ChangeProductItem // 产品信息 } type ChangeProductItem struct { - Id int64 // 产品id - SaleCount int64 // 销售数量 - SalePrice decimal.Decimal // 销售单价 + Id int64 // 产品id + SaleCount *int64 // 销售数量 + SalePrice *decimal.Decimal // 销售单价 } // Change @TITLE 编辑商品审核 diff --git a/erp/sale/change.go b/erp/sale/change.go index de328b1..5f3241b 100644 --- a/erp/sale/change.go +++ b/erp/sale/change.go @@ -16,14 +16,14 @@ type ArgsChangeAllSearch struct { WorkflowId int64 // 审核id } type ChangeProduct struct { - Id int64 `json:"id"` - SaleProductID int64 `json:"saleProductID"` - BeforeSaleCount int64 `json:"beforeSaleCount"` - SaleCount int64 `json:"saleCount"` - BeforeSalePrice decimal.Decimal `json:"beforeSalePrice"` - SalePrice decimal.Decimal `json:"salePrice"` - CreatedAt *time.Time `json:"createdAt"` - UpdatedAt *time.Time `json:"updatedAt"` + Id int64 `json:"id"` + SaleProductID int64 `json:"saleProductID"` + BeforeSaleCount int64 `json:"beforeSaleCount"` + SaleCount *int64 `json:"saleCount"` + BeforeSalePrice decimal.Decimal `json:"beforeSalePrice"` + SalePrice *decimal.Decimal `json:"salePrice"` + CreatedAt *time.Time `json:"createdAt"` + UpdatedAt *time.Time `json:"updatedAt"` } // All @TITLE 获取产品