添加订舱修改单
This commit is contained in:
77
erp/shipment/modify/customsCost.go
Normal file
77
erp/shipment/modify/customsCost.go
Normal file
@@ -0,0 +1,77 @@
|
||||
package modify
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.kumo.work/shama/service/client"
|
||||
"github.com/shopspring/decimal"
|
||||
"time"
|
||||
)
|
||||
|
||||
type customsCost struct {
|
||||
}
|
||||
|
||||
type CustomsCostItem struct {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Type int64 `json:"type"`
|
||||
Amount decimal.Decimal `json:"amount"`
|
||||
Remarks string `json:"remarks"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// All @TITLE 获取费用
|
||||
func (c *customsCost) All(ctx context.Context, modifyId int64) (reply []CustomsCostItem, err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "All", modifyId, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsCustomsCostAdd struct {
|
||||
ModifyId int64 // 订舱修改单ID
|
||||
CustomsCostAdd
|
||||
}
|
||||
|
||||
type CustomsCostAdd struct {
|
||||
Name string // 费用名
|
||||
Amount decimal.Decimal // 金额
|
||||
Remarks string // 备注信息
|
||||
}
|
||||
|
||||
// Add @TITLE 添加费用
|
||||
func (c *customsCost) Add(ctx context.Context, args ArgsCustomsCostAdd) (err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Add", args, &reply)
|
||||
}
|
||||
|
||||
type ArgsCustomsCostEdit struct {
|
||||
CustomsCostId int64 // 费用ID
|
||||
CustomsCostAdd
|
||||
}
|
||||
|
||||
// Edit @TITLE 编辑费用
|
||||
func (c *customsCost) Edit(ctx context.Context, args ArgsCustomsCostEdit) (err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Edit", args, &reply)
|
||||
}
|
||||
|
||||
// Delete @TITLE 删除费用
|
||||
func (c *customsCost) Delete(ctx context.Context, customsCostIds []int64) (err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Delete", customsCostIds, &reply)
|
||||
}
|
||||
Reference in New Issue
Block a user