部署
This commit is contained in:
		
							parent
							
								
									65c59f2c7b
								
							
						
					
					
						commit
						246c7a4922
					
				| @ -18,3 +18,15 @@ const ( | |||||||
| 	AuditStatusAdopt  AuditStatus = 3 // 审核通过 | 	AuditStatusAdopt  AuditStatus = 3 // 审核通过 | ||||||
| 	AuditStatusReject AuditStatus = 4 // 审核驳回 | 	AuditStatusReject AuditStatus = 4 // 审核驳回 | ||||||
| ) | ) | ||||||
|  | 
 | ||||||
|  | type IsOpen = int64 // 开启状态 | ||||||
|  | const ( | ||||||
|  | 	IsOpenTrue  IsOpen = 1 // 开启 | ||||||
|  | 	IsOpenFalse IsOpen = 2 // 关闭 | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | type ExportType = string // 导出类型 | ||||||
|  | 
 | ||||||
|  | const ( | ||||||
|  | 	ExportTypeSalePi = "salePi" // 销售pi导出 | ||||||
|  | ) | ||||||
|  | |||||||
							
								
								
									
										7
									
								
								erp/contact.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								erp/contact.go
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,7 @@ | |||||||
|  | package erp | ||||||
|  | 
 | ||||||
|  | import contact2 "git.kumo.work/shama/service/erp/contact" | ||||||
|  | 
 | ||||||
|  | type contact struct { | ||||||
|  | 	contact2.Contact | ||||||
|  | } | ||||||
							
								
								
									
										5
									
								
								erp/contact/contact.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								erp/contact/contact.go
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | |||||||
|  | package contact | ||||||
|  | 
 | ||||||
|  | type Contact struct { | ||||||
|  | 	Template template | ||||||
|  | } | ||||||
							
								
								
									
										73
									
								
								erp/contact/template.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								erp/contact/template.go
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,73 @@ | |||||||
|  | package contact | ||||||
|  | 
 | ||||||
|  | import ( | ||||||
|  | 	"context" | ||||||
|  | 	client2 "git.kumo.work/shama/service/client" | ||||||
|  | 	"git.kumo.work/shama/service/lib/bean" | ||||||
|  | 	"time" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | type template struct { | ||||||
|  | } | ||||||
|  | type ArgsTemplateList struct { | ||||||
|  | 	Page   bean.Page | ||||||
|  | 	Search TemplateSearch | ||||||
|  | } | ||||||
|  | type TemplateSearch struct { | ||||||
|  | 	Type        int64   // 类型 | ||||||
|  | 	Title       string  // 标题 | ||||||
|  | 	StaffIds    []int64 // 创建人 | ||||||
|  | 	TemplateIds []int64 // 模板id | ||||||
|  | } | ||||||
|  | type ReplyTemplateList struct { | ||||||
|  | 	List  []TemplateItem `json:"list"` | ||||||
|  | 	Total int64          `json:"total"` | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | type TemplateItem struct { | ||||||
|  | 	Id             int64      `json:"id"` | ||||||
|  | 	Type           int64      `json:"type"` | ||||||
|  | 	Title          string     `json:"title"` | ||||||
|  | 	Content        string     `json:"content"` | ||||||
|  | 	CreatedStaffId int64      `json:"createdStaffId"` | ||||||
|  | 	CreatedAt      *time.Time `json:"createdAt"` | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // List @TITLE 列表 | ||||||
|  | func (t *template) List(ctx context.Context, args ArgsTemplateList) (reply ReplyTemplateList, err error) { | ||||||
|  | 	xClient, err := client2.GetClient(t) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	err = xClient.Call(ctx, "List", args, &reply) | ||||||
|  | 	return | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | type ArgsTemplateAdd struct { | ||||||
|  | 	Type    int64  // 类型 | ||||||
|  | 	Title   string // 标题 | ||||||
|  | 	Content string // 内容 | ||||||
|  | 	StaffId int64  // 员工id | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // Add @TITLE 添加 | ||||||
|  | func (t *template) Add(ctx context.Context, args ArgsTemplateAdd) (err error) { | ||||||
|  | 	xClient, err := client2.GetClient(t) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	reply := 0 | ||||||
|  | 	err = xClient.Call(ctx, "Add", args, &reply) | ||||||
|  | 	return | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // Delete @TITLE 删除 | ||||||
|  | func (t *template) Delete(ctx context.Context, templateIds []int64) (err error) { | ||||||
|  | 	xClient, err := client2.GetClient(t) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	reply := 0 | ||||||
|  | 	err = xClient.Call(ctx, "Delete", templateIds, &reply) | ||||||
|  | 	return | ||||||
|  | } | ||||||
| @ -9,4 +9,6 @@ type Erp struct { | |||||||
| 	LogisticsCompany logisticsCompany | 	LogisticsCompany logisticsCompany | ||||||
| 	Workflow         workflow | 	Workflow         workflow | ||||||
| 	Shipment         shipment | 	Shipment         shipment | ||||||
|  | 	Contact          contact | ||||||
|  | 	Template         template | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,6 +1,7 @@ | |||||||
| package purchase | package purchase | ||||||
| 
 | 
 | ||||||
| type Purchase struct { | type Purchase struct { | ||||||
|  | 	Audit       audit | ||||||
| 	Cost        cost | 	Cost        cost | ||||||
| 	Clause      clause | 	Clause      clause | ||||||
| 	Annotations annotations | 	Annotations annotations | ||||||
|  | |||||||
| @ -17,8 +17,12 @@ type ArgsSaleList struct { | |||||||
| 	Search SaleSearch | 	Search SaleSearch | ||||||
| } | } | ||||||
| type SaleSearch struct { | type SaleSearch struct { | ||||||
| 	PiSerial string // pi | 	PiSerial        string  // pi | ||||||
| 	PoSerial string // po | 	PoSerial        string  // po | ||||||
|  | 	CustomIds       []int64 // 客户 | ||||||
|  | 	PurchaseStatus  []int64 // 采购状态 | ||||||
|  | 	ShipmentStatus  []int64 // 出舱状态 | ||||||
|  | 	CreatedStaffIds []int64 // 业务员 | ||||||
| } | } | ||||||
| type ReplySaleList struct { | type ReplySaleList struct { | ||||||
| 	List  []SaleItem `json:"list"` | 	List  []SaleItem `json:"list"` | ||||||
|  | |||||||
| @ -16,8 +16,8 @@ type SaleItem struct { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // All @TITLE 获取销售合同 | // All @TITLE 获取销售合同 | ||||||
| func (c *sale) All(ctx context.Context, shipmentId int64) (reply []SaleItem, err error) { | func (s *sale) All(ctx context.Context, shipmentId int64) (reply []SaleItem, err error) { | ||||||
| 	xClient, err := client.GetClient(c) | 	xClient, err := client.GetClient(s) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| @ -31,8 +31,8 @@ type ArgsSaleAdd struct { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // Add @TITLE 添加销售合同 | // Add @TITLE 添加销售合同 | ||||||
| func (c *sale) Add(ctx context.Context, args ArgsSaleAdd) (err error) { | func (s *sale) Add(ctx context.Context, args ArgsSaleAdd) (err error) { | ||||||
| 	xClient, err := client.GetClient(c) | 	xClient, err := client.GetClient(s) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| @ -46,8 +46,8 @@ type ArgsSaleDelete struct { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // Delete @TITLE 删除销售合同 | // Delete @TITLE 删除销售合同 | ||||||
| func (c *sale) Delete(ctx context.Context, args ArgsSaleDelete) (err error) { | func (s *sale) Delete(ctx context.Context, args ArgsSaleDelete) (err error) { | ||||||
| 	xClient, err := client.GetClient(c) | 	xClient, err := client.GetClient(s) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  | |||||||
							
								
								
									
										91
									
								
								erp/shipment/saleProduct.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										91
									
								
								erp/shipment/saleProduct.go
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,91 @@ | |||||||
|  | package shipment | ||||||
|  | 
 | ||||||
|  | import ( | ||||||
|  | 	"context" | ||||||
|  | 	"git.kumo.work/shama/service/client" | ||||||
|  | 	"github.com/shopspring/decimal" | ||||||
|  | 	"time" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | type saleProduct struct { | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | type SaleProductItem struct { | ||||||
|  | 	Id                    int64           `json:"id"` | ||||||
|  | 	PiSerial              string          `json:"piSerial"` | ||||||
|  | 	Sort                  int64           `json:"sort"` | ||||||
|  | 	Po                    string          `json:"po"` | ||||||
|  | 	Serial                string          `json:"serial"` | ||||||
|  | 	CustomSerial          string          `json:"customSerial"` | ||||||
|  | 	PackageDescription    string          `json:"packageDescription"` | ||||||
|  | 	PackageEngDescription string          `json:"packageEngDescription"` | ||||||
|  | 	EngName               string          `json:"engName"` | ||||||
|  | 	Name                  string          `json:"name"` | ||||||
|  | 	CustomsName           string          `json:"customsName"` | ||||||
|  | 	CustomsSerial         string          `json:"customsSerial"` | ||||||
|  | 	CustomsMeasureUnit    string          `json:"customsMeasureUnit"` | ||||||
|  | 	CustomsInvoiceUnit    string          `json:"customsInvoiceUnit"` | ||||||
|  | 	CustomsDetail         string          `json:"customsDetail"` | ||||||
|  | 	BlEngName             string          `json:"blEngName"` | ||||||
|  | 	BoxCount              int64           `json:"boxCount"` | ||||||
|  | 	InnerNum              int64           `json:"innerNum"` | ||||||
|  | 	InnerBoxCount         *int64          `json:"innerBoxCount"` | ||||||
|  | 	BoxNumUnit            string          `json:"boxNumUnit"` | ||||||
|  | 	OuterNum              int64           `json:"outerNum"` | ||||||
|  | 	ShipmentCount         int64           `json:"shipmentCount"` | ||||||
|  | 	ShipmentCountUnit     string          `json:"shipmentCountUnit"` | ||||||
|  | 	Length                decimal.Decimal `json:"length"` | ||||||
|  | 	Width                 decimal.Decimal `json:"width"` | ||||||
|  | 	Height                decimal.Decimal `json:"height"` | ||||||
|  | 	Volume                decimal.Decimal `json:"volume"` | ||||||
|  | 	TotalVolume           decimal.Decimal `json:"totalVolume"` | ||||||
|  | 	NetGrossVolume        int64           `json:"netGrossVolume"` | ||||||
|  | 	GrossWeight           decimal.Decimal `json:"grossWeight"` | ||||||
|  | 	TotalGrossWeight      decimal.Decimal `json:"totalGrossWeight"` | ||||||
|  | 	NetWeight             decimal.Decimal `json:"netWeight"` | ||||||
|  | 	TotalNetWeight        decimal.Decimal `json:"totalNetWeight"` | ||||||
|  | 	SalePrice             decimal.Decimal `json:"salePrice"` | ||||||
|  | 	CurrencyRate          decimal.Decimal `json:"currencyRate"` | ||||||
|  | 	Brand                 string          `json:"brand"` | ||||||
|  | 	DomesticSupply        string          `json:"domesticSupply"` | ||||||
|  | 	EpmNo                 string          `json:"epmNo"` | ||||||
|  | 	HsSerial              int64           `json:"hsSerial"` | ||||||
|  | 	TaxExemption          string          `json:"taxExemption"` | ||||||
|  | 	ItemNumber            string          `json:"itemNumber"` | ||||||
|  | 	Texture               string          `json:"texture"` | ||||||
|  | 	Remark1               string          `json:"remark1"` | ||||||
|  | 	Remark2               string          `json:"remark2"` | ||||||
|  | 	Remark3               string          `json:"remark3"` | ||||||
|  | 	Remark4               string          `json:"remark4"` | ||||||
|  | 	Remark5               string          `json:"remark5"` | ||||||
|  | 	Remark6               string          `json:"remark6"` | ||||||
|  | 	ContainerNumber       string          `json:"containerNumber"` | ||||||
|  | 	SealNumber            string          `json:"sealNumber"` | ||||||
|  | 	CreatedAt             *time.Time      `json:"createdAt"` | ||||||
|  | 	UpdatedAt             *time.Time      `json:"updatedAt"` | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // All @TITLE 获取商品 | ||||||
|  | func (s *saleProduct) All(ctx context.Context, shipmentId int64) (reply []SaleProductItem, err error) { | ||||||
|  | 	xClient, err := client.GetClient(s) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	err = xClient.Call(ctx, "All", shipmentId, &reply) | ||||||
|  | 	return | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | type ArgsSaleProductDelete struct { | ||||||
|  | 	ShipmentId             int64   // 订舱单id | ||||||
|  | 	ShipmentSaleProductIds []int64 // 出运参评id | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // Delete @TITLE 删除出运产品 | ||||||
|  | func (s *saleProduct) Delete(ctx context.Context, args ArgsSaleProductDelete) (err error) { | ||||||
|  | 	xClient, err := client.GetClient(s) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	reply := 0 | ||||||
|  | 	return xClient.Call(ctx, "Delete", args, &reply) | ||||||
|  | } | ||||||
| @ -1,6 +1,7 @@ | |||||||
| package shipment | package shipment | ||||||
| 
 | 
 | ||||||
| type Shipment struct { | type Shipment struct { | ||||||
| 	Sale sale | 	Sale        sale | ||||||
| 	Cost cost | 	Cost        cost | ||||||
|  | 	SaleProduct saleProduct | ||||||
| } | } | ||||||
|  | |||||||
							
								
								
									
										165
									
								
								erp/template.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										165
									
								
								erp/template.go
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,165 @@ | |||||||
|  | package erp | ||||||
|  | 
 | ||||||
|  | import ( | ||||||
|  | 	"context" | ||||||
|  | 	"git.kumo.work/shama/service/client" | ||||||
|  | 	"git.kumo.work/shama/service/lib/bean" | ||||||
|  | 	"time" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | type template struct { | ||||||
|  | } | ||||||
|  | type ArgsTemplateList struct { | ||||||
|  | 	Page   bean.Page | ||||||
|  | 	Search TemplateSearch | ||||||
|  | } | ||||||
|  | type TemplateSearch struct { | ||||||
|  | 	Name   string   // 模板名称 | ||||||
|  | 	Types  []string // 模板类型 | ||||||
|  | 	IsOpen int64    // 是否开启 | ||||||
|  | } | ||||||
|  | type ReplyTemplateList struct { | ||||||
|  | 	List  []TemplateItem `json:"list"` | ||||||
|  | 	Total int64          `json:"total"` | ||||||
|  | } | ||||||
|  | type TemplateItem struct { | ||||||
|  | 	Id             int64      `json:"id"` | ||||||
|  | 	Name           string     `json:"name"` | ||||||
|  | 	Type           string     `json:"type"` | ||||||
|  | 	Path           string     `json:"path"` | ||||||
|  | 	Sort           int64      `json:"sort"` | ||||||
|  | 	PdfConfig      string     `json:"pdfConfig"` | ||||||
|  | 	IsOpen         int64      `json:"isOpen"` | ||||||
|  | 	CreatedStaffId int64      `json:"createdStaffId"` | ||||||
|  | 	CreatedAt      *time.Time `json:"createdAt"` | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // List @TITLE 列表 | ||||||
|  | func (t *template) List(ctx context.Context, args ArgsTemplateList) (reply ReplyTemplateList, err error) { | ||||||
|  | 	xClient, err := client.GetClient(t) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	err = xClient.Call(ctx, "List", args, &reply) | ||||||
|  | 	return | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | type ArgsTemplateAdd struct { | ||||||
|  | 	StaffId     int64 // 员工id | ||||||
|  | 	TemplateAdd TemplateAdd | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | type TemplateAdd struct { | ||||||
|  | 	Name      string // 模板名称 | ||||||
|  | 	Type      string // 模板类型 | ||||||
|  | 	Path      string // 模板文件地址 | ||||||
|  | 	Sort      int64  // 排序 | ||||||
|  | 	PdfConfig string // pdf配置 | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // Add @TITLE 添加 | ||||||
|  | func (t *template) Add(ctx context.Context, args ArgsTemplateAdd) (err error) { | ||||||
|  | 	xClient, err := client.GetClient(t) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	reply := 0 | ||||||
|  | 	err = xClient.Call(ctx, "Add", args, &reply) | ||||||
|  | 	return | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | type TemplateInfo struct { | ||||||
|  | 	Id             int64      `json:"id"` | ||||||
|  | 	Name           string     `json:"name"` | ||||||
|  | 	Type           string     `json:"type"` | ||||||
|  | 	Path           string     `json:"path"` | ||||||
|  | 	Sort           int64      `json:"sort"` | ||||||
|  | 	PdfConfig      string     `json:"pdfConfig"` | ||||||
|  | 	IsOpen         int64      `json:"isOpen"` | ||||||
|  | 	CreatedStaffId int64      `json:"createdStaffId"` | ||||||
|  | 	CreatedAt      *time.Time `json:"createdAt"` | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // Info @TITLE 详情 | ||||||
|  | func (t *template) Info(ctx context.Context, templateId int64) (reply TemplateInfo, err error) { | ||||||
|  | 	xClient, err := client.GetClient(t) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	err = xClient.Call(ctx, "Info", templateId, &reply) | ||||||
|  | 	return | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | type ArgsTemplateEdit struct { | ||||||
|  | 	TemplateId  int64 // 模板id | ||||||
|  | 	TemplateAdd TemplateAdd | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // Edit @TITLE 编辑 | ||||||
|  | func (t *template) Edit(ctx context.Context, args ArgsTemplateEdit) (err error) { | ||||||
|  | 	xClient, err := client.GetClient(t) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	reply := 0 | ||||||
|  | 	err = xClient.Call(ctx, "Edit", args, &reply) | ||||||
|  | 	return | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // Open @TITLE 开启 | ||||||
|  | func (t *template) Open(ctx context.Context, templateIds []int64) (err error) { | ||||||
|  | 	xClient, err := client.GetClient(t) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	reply := 0 | ||||||
|  | 	err = xClient.Call(ctx, "Open", templateIds, &reply) | ||||||
|  | 	return | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // Close @TITLE 关闭 | ||||||
|  | func (t *template) Close(ctx context.Context, templateIds []int64) (err error) { | ||||||
|  | 	xClient, err := client.GetClient(t) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	reply := 0 | ||||||
|  | 	err = xClient.Call(ctx, "Close", templateIds, &reply) | ||||||
|  | 	return | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // Delete @TITLE 删除 | ||||||
|  | func (t *template) Delete(ctx context.Context, templateIds []int64) (err error) { | ||||||
|  | 	xClient, err := client.GetClient(t) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	reply := 0 | ||||||
|  | 	err = xClient.Call(ctx, "Delete", templateIds, &reply) | ||||||
|  | 	return | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | type ArgsTemplateExportData struct { | ||||||
|  | 	ExportType ExportType // 导出类型 | ||||||
|  | 	DataId     int64      // 导出数据id | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // ExportData @TITLE 导出数据 | ||||||
|  | func (t *template) ExportData(ctx context.Context, args ArgsTemplateExportData) (reply interface{}, err error) { | ||||||
|  | 	xClient, err := client.GetClient(t) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	err = xClient.Call(ctx, "ExportData", args, &reply) | ||||||
|  | 	return | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // ExportStruct @TITLE 导出数据结构 | ||||||
|  | func (t *template) ExportStruct(ctx context.Context, exportType ExportType) (reply interface{}, err error) { | ||||||
|  | 	xClient, err := client.GetClient(t) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	err = xClient.Call(ctx, "ExportStruct", exportType, &reply) | ||||||
|  | 	return | ||||||
|  | } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user