diff --git a/erp/bean/file.go b/erp/bean/file.go new file mode 100644 index 0000000..701f574 --- /dev/null +++ b/erp/bean/file.go @@ -0,0 +1,18 @@ +package bean + +import "encoding/json" + +type FileData struct { + Name string `json:"name"` + Path string `json:"path"` +} + +func (f FileData) ToString() string { + marshal, _ := json.Marshal(f) + return string(marshal) +} + +func (f FileData) Parse(data string) FileData { + json.Unmarshal([]byte(data), &f) + return f +} diff --git a/erp/product.go b/erp/product.go index e3f70bb..b52f627 100644 --- a/erp/product.go +++ b/erp/product.go @@ -3,6 +3,7 @@ package erp import ( "context" "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" @@ -93,7 +94,7 @@ type ProductAdd struct { EngDescription string // 英文描述 PackageDescription string // 包装中文描述 PackageEngDescription string // 包装英文描述 - PackageInfoFile string // 包装描述文件 + PackageInfoFile bean2.FileData // 包装描述文件 Packages []ProductPackage // 包装 Customs ProductCustoms // 海关 Quotes []product2.ArgsQuoteAdd // 工厂报价 @@ -172,7 +173,7 @@ type ReplyProductInfo struct { EngDescription string `json:"engDescription"` PackageDescription string `json:"packageDescription"` PackageEngDescription string `json:"packageEngDescription"` - PackageInfoFile string `json:"packageInfoFile"` + PackageInfoFile bean2.FileData `json:"packageInfoFile"` 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 087076b..7259b7f 100644 --- a/erp/sale/product.go +++ b/erp/sale/product.go @@ -3,6 +3,7 @@ package sale import ( "context" "git.kumo.work/shama/service/client" + bean2 "git.kumo.work/shama/service/erp/bean" product2 "git.kumo.work/shama/service/erp/product" "github.com/shopspring/decimal" "time" @@ -82,7 +83,7 @@ type ProductAdd struct { EngDescription string // 英文描述 PackageDescription string // 包装中文描述 PackageEngDescription string // 包装英文描述 - PackageInfoFile string // 包装描述文件 + PackageInfoFile bean2.FileData // 包装描述文件 Sort int64 // 排序 SaleCount int64 // 销售数量/合同数量 Packages []ProductPackage // 包装 @@ -175,7 +176,7 @@ type ReplyProductInfo struct { EngDescription string `json:"engDescription"` PackageDescription string `json:"packageDescription"` PackageEngDescription string `json:"packageEngDescription"` - PackageInfoFile string `json:"packageInfoFile"` + PackageInfoFile bean2.FileData `json:"packageInfoFile"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` Packages []ProductPackageInfo `json:"packages"` diff --git a/erp/shipment.go b/erp/shipment.go index 09082ae..493a1ae 100644 --- a/erp/shipment.go +++ b/erp/shipment.go @@ -89,6 +89,7 @@ type ShipmentAdd struct { DeliveryCountryEng string // 运抵国英文 Destination string // 目的地 FactoryHaulAdress string // 工厂拖柜地址 + LogisticsCompanyId int64 // 物流公司id LogisticsCompany string // 物流公司 LogisticsCompanyContactName string // 物流公司联系人 LogisticsCompanyContactPhone string // 物流公司手机号 @@ -160,6 +161,7 @@ type ReplyShipmentInfo struct { DeliveryCountryEng string `json:"deliveryCountryEng"` Destination string `json:"destination"` FactoryHaulAdress string `json:"factoryHaulAdress"` + LogisticsCompanyId int64 `json:"logisticsCompanyId"` LogisticsCompany string `json:"logisticsCompany"` LogisticsCompanyContactName string `json:"logisticsCompanyContactName"` LogisticsCompanyContactPhone string `json:"logisticsCompanyContactPhone"` @@ -236,6 +238,7 @@ type ArgsShipmentData struct { Destination string // 目的地 FactoryHaulAdress string // 工厂拖柜地址 SeparableFlag int64 // 可分批标记(1=可分 2=不可分) + LogisticsCompanyId int64 // 物流公司id LogisticsCompany string // 物流公司 LogisticsCompanyContactName string // 物流公司联系人 LogisticsCompanyContactPhone string // 物流公司联系人电话