- 将Gen方法的返回值从error修改为(mixedId int64, err error) - 更新错误处理逻辑以返回新的返回值结构 - 修改客户端调用方式以适配新的返回值格式
60 lines
1.3 KiB
Go
60 lines
1.3 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
|
|
}
|