From 84d2953e7b641600779e7aecc80bdd35e96d31d6 Mon Sep 17 00:00:00 2001 From: jiangshuai <291802688@qq.com> Date: 星期二, 06 二月 2024 10:13:12 +0800 Subject: [PATCH] 拦截器 --- model/purchase/request/purchase.go | 46 +++++++++++++++++++++++++--------------------- 1 files changed, 25 insertions(+), 21 deletions(-) diff --git a/model/purchase/request/purchase.go b/model/purchase/request/purchase.go index 19fe8c0..baad417 100644 --- a/model/purchase/request/purchase.go +++ b/model/purchase/request/purchase.go @@ -4,13 +4,11 @@ "github.com/shopspring/decimal" "srm/model/common/request" "srm/model/purchase" - "time" ) type PurchaseSearch struct { - StartCreatedAt *time.Time `json:"startCreatedAt" form:"startCreatedAt"` - EndCreatedAt *time.Time `json:"endCreatedAt" form:"endCreatedAt"` request.PageInfo + SupplierId int `json:"supplierId" form:"supplierId" gorm:"type:int(11);not null;default 0;comment:渚涘簲鍟唅d"` // 渚涘簲鍟唅d } type AddPurchase struct { @@ -23,23 +21,29 @@ ProductList []*purchase.PurchaseProducts `json:"productList"` } +type SubmitPurchase struct { + Id int `json:"id"` + Status purchase.OrderStatus `json:"status"` +} + type Purchase struct { - ID uint `gorm:"primarykey"` // 涓婚敭ID - PurchaseTypeId int `json:"purchaseTypeId" form:"purchaseType" gorm:"type:int(11);not null;default 0;comment:閲囪喘绫诲瀷id"` // 閲囪喘绫诲瀷id - SupplierId int `json:"supplierId" form:"supplierId" gorm:"type:int(11);not null;default 0;comment:渚涘簲鍟唅d"` // 渚涘簲鍟唅d - Number string `json:"number" form:"number" gorm:"unique;type:varchar(255);not null;default '';comment:閲囪喘缂栧彿"` // 閲囪喘缂栧彿 - Name string `json:"name" form:"name" gorm:"type:varchar(255);not null;default '';comment:閲囪喘鍚嶇О"` // 閲囪喘鍚嶇О - Contact string `json:"contact" form:"contact" gorm:"type:varchar(255);not null;default '';comment:鑱旂郴浜�"` // 鑱旂郴浜� - Phone string `json:"phone" form:"phone" gorm:"type:varchar(255);not null;default '';comment:鑱旂郴浜虹數璇�"` // 鑱旂郴浜虹數璇� - SigningDate string `json:"signingDate" form:"signingDate" gorm:"type:varchar(255);not null;default '';comment:绛剧害鏃ユ湡"` // 绛剧害鏃ユ湡 - DeliveryDate string `json:"deliveryDate" form:"deliveryDate" gorm:"type:varchar(255);not null;default '';comment:浜や粯鏃ユ湡"` //浜や粯鏃ユ湡 - Remark string `json:"remark" form:"remark" gorm:"type:varchar(1000);not null;default '';comment:澶囨敞"` //澶囨敞 - Status purchase.OrderStatus `json:"status" form:"status" gorm:"type:tinyint(1);not null;default 0;comment:鐘舵��"` //鐘舵�� - Quantity decimal.Decimal `json:"quantity" form:"quantity" gorm:"type:decimal(12,4);not null;comment:閲囪喘鏁伴噺"` // 閲囪喘鏁伴噺 - TotalPrice decimal.Decimal `json:"totalPrice" form:"totalPrice" gorm:"type:decimal(12,2);not null;default '';comment:浠风◣鍚堣"` //浠风◣鍚堣 - WholeDiscountType purchase.WholeDiscountType `json:"wholeDiscountType" form:"wholeDiscountType" gorm:"type:decimal(12,2);not null;default '';comment:鏁村崟鎶樻墸"` //鏁村崟鎶樻墸绫诲瀷 - WholeDiscount decimal.Decimal `json:"wholeDiscount" form:"wholeDiscount" gorm:"type:decimal(12,2);not null;default '';comment:鏁村崟鎶樻墸"` //鏁村崟鎶樻墸鍊� - PriceAdjustmentType purchase.PriceAdjustmentType `json:"priceAdjustmentType" form:"priceAdjustmentType" gorm:"type:decimal(12,2);not null;default '';comment:浠锋牸璋冩暣"` //浠锋牸璋冩暣绫诲瀷 - PriceAdjustment decimal.Decimal `json:"priceAdjustment" form:"priceAdjustment" gorm:"type:decimal(12,2);not null;default '';comment:浠锋牸璋冩暣"` //浠锋牸璋冩暣鍊� - RealTotalPrice decimal.Decimal `json:"realTotalPrice" form:"realTotalPrice" gorm:"type:decimal(12,2);not null;default '';comment:鏈�缁堜环鏍�"` //鏈�缁堜环鏍� + ID uint `json:"id,string" gorm:"primarykey"` // 涓婚敭ID + PurchaseTypeId int `json:"purchaseTypeId,string" form:"purchaseType" gorm:"type:int(11);not null;default 0;comment:閲囪喘绫诲瀷id"` // 閲囪喘绫诲瀷id + SupplierId int `json:"supplierId,string" form:"supplierId" gorm:"type:int(11);not null;default 0;comment:渚涘簲鍟唅d"` // 渚涘簲鍟唅d + OrderSource string `json:"orderSource" gorm:"type:varchar(255);not null;default '';comment:鍗曟嵁鏉ユ簮"` // 鍗曟嵁鏉ユ簮 + Number string `json:"number" form:"number" gorm:"unique;type:varchar(255);not null;default '';comment:閲囪喘缂栧彿"` // 閲囪喘缂栧彿 + Name string `json:"name" form:"name" gorm:"type:varchar(255);not null;default '';comment:閲囪喘鍚嶇О"` // 閲囪喘鍚嶇О + Contact string `json:"contact" form:"contact" gorm:"type:varchar(255);not null;default '';comment:鑱旂郴浜�"` // 鑱旂郴浜� + Phone string `json:"phone" form:"phone" gorm:"type:varchar(255);not null;default '';comment:鑱旂郴浜虹數璇�"` // 鑱旂郴浜虹數璇� + SigningDate string `json:"signingDate" form:"signingDate" gorm:"type:varchar(255);not null;default '';comment:绛剧害鏃ユ湡"` // 绛剧害鏃ユ湡 + DeliveryDate string `json:"deliveryDate" form:"deliveryDate" gorm:"type:varchar(255);not null;default '';comment:浜や粯鏃ユ湡"` //浜や粯鏃ユ湡 + Remark string `json:"remark" form:"remark" gorm:"type:varchar(1000);not null;default '';comment:澶囨敞"` //澶囨敞 + Status purchase.OrderStatus `json:"status" form:"status" gorm:"type:tinyint(1);not null;default 0;comment:鐘舵��"` //鐘舵�� + Quantity decimal.Decimal `json:"quantity" form:"quantity" gorm:"type:decimal(12,2);not null;default 0;comment:閲囪喘鏁伴噺"` // 閲囪喘鏁伴噺 + TotalPrice decimal.Decimal `json:"totalPrice" form:"totalPrice" gorm:"type:decimal(12,2);not null;default 0.00;comment:浠风◣鍚堣"` //浠风◣鍚堣 + WholeDiscountType purchase.WholeDiscountType `json:"wholeDiscountType" form:"wholeDiscountType" gorm:"type:decimal(12,2);not null;default 0.00;comment:鏁村崟鎶樻墸"` //鏁村崟鎶樻墸绫诲瀷 + WholeDiscount decimal.Decimal `json:"wholeDiscount" form:"wholeDiscount" gorm:"type:decimal(12,2);not null;default 0;comment:鏁村崟鎶樻墸"` //鏁村崟鎶樻墸鍊� + PriceAdjustmentType purchase.PriceAdjustmentType `json:"priceAdjustmentType" form:"priceAdjustmentType" gorm:"type:decimal(12,2);not null;default 0;comment:浠锋牸璋冩暣绫诲瀷"` //浠锋牸璋冩暣绫诲瀷 + PriceAdjustment decimal.Decimal `json:"priceAdjustment" form:"priceAdjustment" gorm:"type:decimal(12,2);not null;default 0.00;comment:浠锋牸璋冩暣"` //浠锋牸璋冩暣鍊� + RealTotalPrice decimal.Decimal `json:"realTotalPrice" form:"realTotalPrice" gorm:"type:decimal(12,2);not null;default 0.00;comment:鏈�缁堜环鏍�"` //鏈�缁堜环鏍� } -- Gitblit v1.8.0