Files
service/erp/shipment/mixed.go
kanade 9a7cfac480 feat(shipment): 添加删除混合装运功能
- 实现了 Delete 方法用于删除指定 ID 的混合装运记录
2026-07-23 17:27:36 +08:00

70 lines
1.6 KiB
Go

package shipment
import (
"context"
"time"
"git.kumo.work/shama/service/client"
mixed2 "git.kumo.work/shama/service/erp/shipment/mixed"
"git.kumo.work/shama/service/lib/bean"
)
type mixed struct {
Mixed mixed2.Mixed
}
type ArgsMixedList struct {
Page bean.Page
Search MixedSearch
}
type MixedSearch struct {
InvoiceSerial string // 出运发票号
CreatedStaffIds []int64 // 业务员筛选
}
type ReplyMixedList struct {
List []MixedItem `json:"list"`
Total int64 `json:"total"`
}
type MixedItem struct {
Id int64 `json:"id"`
ShipmentId int64 `json:"shipmentId"`
InvoiceSerial string `json:"invoiceSerial"`
CreatedStaffId int64 `json:"createdStaffId"`
CreatedAt *time.Time `json:"createdAt"`
}
// List @TITLE 列表
func (m *mixed) List(ctx context.Context, args ArgsMixedList) (reply ReplyMixedList, err error) {
xClient, err := client.GetClient(m)
if err != nil {
return
}
err = xClient.Call(ctx, "List", args, &reply)
return
}
type ArgsMixedGen struct {
ShipmentId int64 // 订舱单id
StaffId int64 // 业务员id
}
// Gen @TITLE 生成
func (m *mixed) Gen(ctx context.Context, args ArgsMixedGen) (mixedId int64, err error) {
xClient, err := client.GetClient(m)
if err != nil {
return mixedId, err
}
err = xClient.Call(ctx, "Gen", args, &mixedId)
return
}
// Delete @TITLE 删除
func (m *mixed) Delete(ctx context.Context, mixedId int64) (err error) {
xClient, err := client.GetClient(m)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Delete", mixedId, &reply)
}