feat(erp): 新增应收款项同步功能
- 引入常量包以支持状态标识 - 在应收款项结构体中增加 Ik3cloudStatus 字段 - 实现 Ik3cloud 方法用于同步应收款项数据到云端 - 添加对客户端调用失败的错误处理机制
This commit is contained in:
@@ -2,6 +2,7 @@ package erp
|
||||
|
||||
import (
|
||||
"context"
|
||||
"erp/app/constant"
|
||||
"time"
|
||||
|
||||
"git.kumo.work/shama/service/client"
|
||||
@@ -39,6 +40,7 @@ type ReceivableItem struct {
|
||||
CurrencyRate decimal.Decimal `json:"currencyRate"`
|
||||
CurrencySymbol string `json:"currencySymbol"`
|
||||
CreatedStaffID int64 `json:"createdStaffID"`
|
||||
Ik3cloudStatus constant.Flag `json:"ik3CloudStatus"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
}
|
||||
@@ -66,6 +68,7 @@ type ReplyReceivableInfo struct {
|
||||
CurrencyRate decimal.Decimal `json:"currencyRate"`
|
||||
CurrencySymbol string `json:"currencySymbol"`
|
||||
CreatedStaffID int64 `json:"createdStaffID"`
|
||||
Ik3cloudStatus constant.Flag `json:"ik3CloudStatus"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
Products []ReceivableProductItem `json:"products"`
|
||||
@@ -94,3 +97,13 @@ func (r *receivable) Info(ctx context.Context, receivableId int64) (reply ReplyR
|
||||
err = xClient.Call(ctx, "List", receivableId, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
// Ik3cloud @TITLE 同步
|
||||
func (r *receivable) Ik3cloud(ctx context.Context, receivableId int64) (err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Ik3cloud", receivableId, &reply)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user