From c7e82fd1d76b9fb25497d5aba4372bbfe13a8468 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 28 三月 2024 20:00:21 +0800 Subject: [PATCH] 采购入库增加来源 --- model/purchase/request/purchase.go | 70 +++++++++++++++++++++++++++++++++-- 1 files changed, 66 insertions(+), 4 deletions(-) diff --git a/model/purchase/request/purchase.go b/model/purchase/request/purchase.go index d0dad8c..1612ce1 100644 --- a/model/purchase/request/purchase.go +++ b/model/purchase/request/purchase.go @@ -1,18 +1,80 @@ package purchaserequest import ( + "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 { - Purchase purchase.Purchase + Purchase Purchase `json:"purchase"` ProductList []*purchase.PurchaseProducts `json:"productList"` } + +type UpdatePurchase struct { + Purchase Purchase `json:"purchase"` + ProductList []*purchase.PurchaseProducts `json:"productList"` +} + +type SubmitPurchase struct { + Id int `json:"id"` + Status purchase.OrderStatus `json:"status"` +} + +type Purchase struct { + 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:鏈�缁堜环鏍�"` //鏈�缁堜环鏍� + Warehouse string `json:"warehouse" form:"warehouse" gorm:"type:varchar(255);not null;default '';comment:鏀惰揣浠撳簱"` //鏀惰揣浠撳簱 + WarehouseAddress string `json:"warehouseAddress" form:"warehouseAddress" gorm:"type:varchar(512);default '';comment:鏀惰揣浠撳簱鍦板潃"` //鏀惰揣浠撳簱鍦板潃 + Principal string `json:"principal" form:"principal" gorm:"type:varchar(255);not null;default '';comment:浠撳簱璐熻矗浜�"` //浠撳簱璐熻矗浜� + SourceOrder string `json:"sourceOrder" gorm:"type:varchar(255);comment:鏉ユ簮鍗曟嵁"` //鏉ユ簮鍗曟嵁 +} + +type PurchaseProductConfirmInfo struct { + PurchaseNumber string `json:"purchaseNumber" gorm:"type:varchar(255);comment:閲囪喘鍗曠紪鍙�"` + ProductId string `json:"productId" gorm:"type:varchar(255);comment:浜у搧缂栫爜"` + ProductName string `json:"productName" gorm:"type:varchar(255);comment:浜у搧鍚�"` + Principal string `json:"principal" gorm:"type:varchar(255);comment:鏀惰揣浜�"` + Unit string `json:"unit" gorm:"type:varchar(255);comment:璁¢噺鍗曚綅"` + Specs string `json:"specs" gorm:"type:varchar(255);comment:瑙勬牸"` + Type string `json:"type" gorm:"type:varchar(255);comment:鍨嬪彿"` + Amount decimal.Decimal `json:"amount" gorm:"type:decimal(12,4);not null;comment:閲囪喘鏁伴噺"` + OverReceiveAmount decimal.Decimal `json:"overReceiveAmount" gorm:"type:decimal(12,4);comment:宸叉敹璐ф暟閲�"` + NotReceiveAmount decimal.Decimal `json:"notReceiveAmount" gorm:"type:decimal(12,4);comment:鏈敹璐ф暟閲�"` + NowReceiveAmount decimal.Decimal `json:"nowReceiveAmount" gorm:"type:decimal(12,4);comment:鏈鏀惰揣鏁伴噺"` + SurplusReceiveAmount decimal.Decimal `json:"surplusReceiveAmount" gorm:"type:decimal(12,4);comment:鍓╀綑鏀惰揣鏁伴噺"` +} + +type GetQualityInspectionInfo struct { + PurchaseNumber string `json:"purchaseNumber"` + Status []int `json:"status"` + Times []string `json:"times"` +} + +type SaveQualityInspectionInfo struct { + PurchaseId uint `json:"purchaseId"` + Ids []int `json:"ids"` + Status int `json:"status"` +} -- Gitblit v1.8.0