This commit is contained in:
2024-08-13 16:06:41 +08:00
parent d31e958210
commit 65c59f2c7b
8 changed files with 344 additions and 1 deletions

View File

@@ -30,7 +30,7 @@ func (c *cost) All(ctx context.Context, purchaseId int64) (reply []CostItem, err
}
type ArgsCostAdd struct {
PurchaseId int64 // 采购合同ID
ShipmentId int64 // 订舱单ID
CostAdd
}

56
erp/shipment/sale.go Normal file
View File

@@ -0,0 +1,56 @@
package shipment
import (
"context"
"git.kumo.work/shama/service/client"
)
type sale struct {
}
type SaleItem struct {
Id int64 `json:"id"`
SaleId int64 `json:"saleId"`
PiSerial string `json:"piSerial"`
PoSerial string `json:"poSerial"`
}
// All @TITLE 获取销售合同
func (c *sale) All(ctx context.Context, shipmentId int64) (reply []SaleItem, err error) {
xClient, err := client.GetClient(c)
if err != nil {
return
}
err = xClient.Call(ctx, "All", shipmentId, &reply)
return
}
type ArgsSaleAdd struct {
ShipmentId int64 // 订舱单id
SaleIds []int64 // 销售合同
}
// Add @TITLE 添加销售合同
func (c *sale) Add(ctx context.Context, args ArgsSaleAdd) (err error) {
xClient, err := client.GetClient(c)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Add", args, &reply)
}
type ArgsSaleDelete struct {
ShipmentId int64 // 订舱单id
SaleIds []int64 // 销售合同
}
// Delete @TITLE 删除销售合同
func (c *sale) Delete(ctx context.Context, args ArgsSaleDelete) (err error) {
xClient, err := client.GetClient(c)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Delete", args, &reply)
}

View File

@@ -1,5 +1,6 @@
package shipment
type Shipment struct {
Sale sale
Cost cost
}