- 新增收汇单据管理,支持列表、详情、新增、编辑功能 - 新增收汇认领管理,支持认领列表、新增、编辑、删除、确认及取消确认功能 - 新增国内扣费类型常量定义(外币、人民币) - 优化服务发现逻辑,针对特定 basePath 使用本地调试地址 - 修复应收模块方法接收者命名问题,统一为 r *receivable
128 lines
2.8 KiB
Go
128 lines
2.8 KiB
Go
package receipt
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"git.kumo.work/shama/service/client"
|
|
"git.kumo.work/shama/service/lib/bean"
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
type claim struct {
|
|
}
|
|
|
|
type ArgsClaimList struct {
|
|
Page bean.Page
|
|
Search ClaimSearch
|
|
}
|
|
type ClaimSearch struct {
|
|
ReceiptId int64 // 收汇单ID
|
|
}
|
|
type ReplyClaimList struct {
|
|
List []ClaimItem `json:"list"`
|
|
Total int64 `json:"total"`
|
|
}
|
|
type ClaimItem struct {
|
|
Id int64 `json:"id"`
|
|
ReceivableId int64 `json:"receivableId"`
|
|
InvoiceSerial string `json:"invoiceSerial"`
|
|
Amount decimal.Decimal `json:"amount"`
|
|
CustomName string `json:"customName"`
|
|
IsConfirm int64 `json:"isConfirm"`
|
|
CreatedStaffId int64 `json:"createdStaffId"`
|
|
CreatedAt *time.Time `json:"createdAt"`
|
|
UpdatedAt *time.Time `json:"updatedAt"`
|
|
}
|
|
|
|
// List @TITLE 列表
|
|
func (c *claim) List(ctx context.Context, args ArgsClaimList) (reply ReplyClaimList, err error) {
|
|
xClient, err := client.GetClient(c)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = xClient.Call(ctx, "List", args, &reply)
|
|
return
|
|
}
|
|
|
|
type ArgsClaimAdd struct {
|
|
StaffId int64
|
|
ClaimAdd
|
|
}
|
|
type ClaimAdd struct {
|
|
ReceiptId int64 // 收汇单ID
|
|
ReceivableId int64 // 应收单ID
|
|
Amount decimal.Decimal // 应收金额
|
|
Remarks string // 备注
|
|
}
|
|
|
|
// Add @TITLE 添加
|
|
func (c *claim) Add(ctx context.Context, args ArgsClaimAdd) (err error) {
|
|
xClient, err := client.GetClient(c)
|
|
if err != nil {
|
|
return
|
|
}
|
|
reply := 0
|
|
return xClient.Call(ctx, "Add", args, &reply)
|
|
}
|
|
|
|
type ArgsClaimEdit struct {
|
|
ClaimId int64
|
|
ClaimAdd
|
|
}
|
|
|
|
// Edit @TITLE 编辑
|
|
func (c *claim) Edit(ctx context.Context, args ArgsClaimEdit) (err error) {
|
|
xClient, err := client.GetClient(c)
|
|
if err != nil {
|
|
return
|
|
}
|
|
reply := 0
|
|
return xClient.Call(ctx, "Edit", args, &reply)
|
|
}
|
|
|
|
type ArgsClaimDelete struct {
|
|
ReceiptId int64 // 收汇单ID
|
|
ClaimIds []int64
|
|
}
|
|
|
|
// Delete @TITLE 删除
|
|
func (c *claim) Delete(ctx context.Context, args ArgsClaimDelete) (err error) {
|
|
xClient, err := client.GetClient(c)
|
|
if err != nil {
|
|
return
|
|
}
|
|
reply := 0
|
|
return xClient.Call(ctx, "Delete", args, &reply)
|
|
}
|
|
|
|
type ArgsClaimConfirm struct {
|
|
ReceiptId int64 // 收汇单ID
|
|
ClaimIds []int64
|
|
}
|
|
|
|
// Confirm @TITLE 确认
|
|
func (c *claim) Confirm(ctx context.Context, args ArgsClaimConfirm) (err error) {
|
|
xClient, err := client.GetClient(c)
|
|
if err != nil {
|
|
return
|
|
}
|
|
reply := 0
|
|
return xClient.Call(ctx, "Confirm", args, &reply)
|
|
}
|
|
|
|
type ArgsClaimCancelConfirm struct {
|
|
ReceiptId int64 // 收汇单ID
|
|
ClaimIds []int64
|
|
}
|
|
|
|
// CancelConfirm @TITLE 取消确认
|
|
func (c *claim) CancelConfirm(ctx context.Context, args ArgsClaimCancelConfirm) (err error) {
|
|
xClient, err := client.GetClient(c)
|
|
if err != nil {
|
|
return
|
|
}
|
|
reply := 0
|
|
return xClient.Call(ctx, "CancelConfirm", args, &reply)
|
|
}
|