添加供应商列表接口

finance
黄伟 2 years ago
parent 8a1ea45af3
commit 9e11d54f1f

@ -3,10 +3,13 @@ package supplier
import ( import (
"context" "context"
"git.oa00.com/supply-chain/service/client" "git.oa00.com/supply-chain/service/client"
"git.oa00.com/supply-chain/service/lib/bean"
"github.com/shopspring/decimal"
) )
type Supplier struct { type Supplier struct {
Goods goods Goods goods
Apply supplierApply
supplier supplier
} }
@ -33,3 +36,38 @@ func (s *supplier) Add(ctx context.Context, args ArgsSupplierAdd) error {
reply := 0 reply := 0
return xClient.Call(ctx, "Add", args, &reply) return xClient.Call(ctx, "Add", args, &reply)
} }
type SupplierSearch struct {
SupplierName string
Status uint
}
type ArgsSupplierLists struct {
Search SupplierSearch
Page bean.Page
}
type ReplySupplierLists struct {
Lists []SupplierItem
Total int64
}
type SupplierItem struct {
Id uint
SupplierName string // 供应商名称
Status uint // 状态
Prepayment decimal.Decimal // 预付款余额
WarnStatus uint // 预警状态
ApplyUserId uint // 创建人
CreatedAt int64 // 创建时间
}
// Lists @Title 供应商列表
func (s *supplier) Lists(ctx context.Context, args ArgsSupplierLists) (reply ReplySupplierLists, err error) {
xClient, err := client.GetClient(s)
if err != nil {
return ReplySupplierLists{}, err
}
err = xClient.Call(ctx, "Lists", args, &reply)
return
}

@ -0,0 +1,46 @@
package supplier
import (
"context"
"git.oa00.com/supply-chain/service/client"
"git.oa00.com/supply-chain/service/lib/bean"
)
type supplierApply struct {
}
type ArgsSupplierApplyLists struct {
Search SupplierApplySearch
Page bean.Page
}
type SupplierApplySearch struct {
SupplierName string
AuditStatus uint
ApplyUserId uint
}
type ReplySupplierApplyLists struct {
Lists []SupplierApplyItem
Total int64
}
type SupplierApplyItem struct {
ApplyId uint
SupplierName string // 供应商名称
ApplyUserId uint // 申请人
AuditStatus uint // 审核状态
AuditUserId uint // 审核人
AuditTime int64 // 审核时间
CreatedAt int64 // 申请时间
}
// Lists @Title 审核列表
func (s *supplierApply) Lists(ctx context.Context, args ArgsSupplierApplyLists) (reply ReplySupplierApplyLists, err error) {
xClient, err := client.GetClient(s)
if err != nil {
return ReplySupplierApplyLists{}, err
}
err = xClient.Call(ctx, "Lists", args, &reply)
return
}
Loading…
Cancel
Save