From 3838a436157bc993db465dff64b92272a4fe7074 Mon Sep 17 00:00:00 2001 From: kanade Date: Tue, 10 Sep 2024 17:07:31 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- erp/constant.go | 3 ++- erp/product.go | 1 + erp/sale/product.go | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/erp/constant.go b/erp/constant.go index 24369b0..49cdfea 100644 --- a/erp/constant.go +++ b/erp/constant.go @@ -29,5 +29,6 @@ const ( type ExportType = string // 导出类型 const ( - ExportTypeSalePi = "salePi" // 销售pi导出 + ExportTypeSalePi = "salePi" // 销售pi导出 + ExportTypeSaleBenefit = "saleBenefit" // 效益测算导出 ) diff --git a/erp/product.go b/erp/product.go index b52f627..0087c74 100644 --- a/erp/product.go +++ b/erp/product.go @@ -50,6 +50,7 @@ type ProductItem struct { Barcode string `json:"barcode"` SellCountry string `json:"sellCountry"` Info string `json:"info"` + QuotePrice *decimal.Decimal `json:"quotePrice"` CreatedStaffId int64 `json:"createdStaffId"` DepartmentId int64 `json:"departmentId"` CreatedAt *time.Time `json:"createdAt"` diff --git a/erp/sale/product.go b/erp/sale/product.go index 555950f..315db55 100644 --- a/erp/sale/product.go +++ b/erp/sale/product.go @@ -5,6 +5,7 @@ import ( "git.kumo.work/shama/service/client" bean2 "git.kumo.work/shama/service/erp/bean" product2 "git.kumo.work/shama/service/erp/product" + "git.kumo.work/shama/service/lib/bean" "github.com/shopspring/decimal" "time" ) @@ -12,6 +13,41 @@ import ( type product struct { product2.Product } +type ArgsProductList struct { + Page bean.Page + Search ProductSearch +} +type ProductSearch struct { + PiSerial string // PiSerial + PoSerial string // PoSerial + CustomSerial string // 客户货号 + Serial string // 货号 + CreatedStaffIds []int64 // 录入人 +} +type ReplyProductList struct { + Total int64 `json:"total"` + List []ProductListItem `json:"list"` +} +type ProductListItem struct { + ProductItem + CreatedStaffId int64 `json:"createdStaffId"` + CreatedAt *time.Time `json:"createdAt"` + PiSerial string `json:"piSerial"` + PoSerial string `json:"poSerial"` + CustomShortName string `json:"customShortName"` + CustomName string `json:"customName"` +} + +// List @TITLE 产品列表 +func (p *product) List(ctx context.Context, args ArgsProductList) (reply ReplyProductList, err error) { + xClient, err := client.GetClient(p) + if err != nil { + return + } + err = xClient.Call(ctx, "List", args, &reply) + return +} + type ProductItem struct { Id int64 `json:"id"` Mold int64 `json:"mold"`