feat(erp): 新增做账合同生成功能和数据归档接口

- 在 accounting 模块中新增 Gen 方法用于生成做账合同
- 在 shipment 模块中新增 ArchiveData 方法用于数据归档
- 调整 import 包顺序并优化 rpcx 客户端初始化逻辑
-为 erp服务添加本地调试用的 p2p discovery 配置
This commit is contained in:
2025-10-29 17:28:34 +08:00
parent 308f6e93fe
commit d402297eb8
3 changed files with 54 additions and 15 deletions

View File

@@ -2,11 +2,12 @@ package erp
import (
"context"
"time"
"git.kumo.work/shama/service/client"
accounting2 "git.kumo.work/shama/service/erp/accounting"
"git.kumo.work/shama/service/lib/bean"
"github.com/shopspring/decimal"
"time"
)
type accounting struct {
@@ -98,6 +99,16 @@ func (a *accounting) Add(ctx context.Context, args ArgsAccountingAdd) (accountId
return
}
// Gen @TITLE 生成做账合同
func (a *accounting) Gen(ctx context.Context, shipmentId int64) (err error) {
xClient, err := client.GetClient(a)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Gen", shipmentId, &reply)
}
type ReplyAccountingInfo struct {
Id int64 `json:"id"`
CustomId int64 `json:"customId"`