- 新增 currencyRate 模块,支持按货币和日期查询汇率信息 - 定义汇率响应结构,包含中间价、现钞卖出价、买入价等字段 - 在 ERP 服务结构体中注册 CurrencyRate 客户端 - 新增收汇水单批量生成接口 Gen,支持按交易明细ID批量生成 - 定义 ArgsReceiptGen 参数结构,包含员工ID和交易明细ID列表
35 lines
889 B
Go
35 lines
889 B
Go
package erp
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
client2 "git.kumo.work/shama/service/client"
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
type currencyRate struct {
|
|
}
|
|
type ArgsCurrencyRateDay struct {
|
|
Currency string `binding:"required" label:"货币"`
|
|
Day time.Time `binding:"required" label:"日期"`
|
|
}
|
|
|
|
type ReplyCurrencyRateItem struct {
|
|
MiddleRate decimal.Decimal `json:"middleRate"`
|
|
CashSellingRate decimal.Decimal `json:"cashSellingRate"`
|
|
BuyingRate decimal.Decimal `json:"buyingRate"`
|
|
CashBuyingRate decimal.Decimal `json:"cashBuyingRate"`
|
|
SellingRate decimal.Decimal `json:"sellingRate"`
|
|
}
|
|
|
|
// Day @TITLE 获取货币汇率
|
|
func (c *currencyRate) Day(ctx context.Context, args ArgsCurrencyRateDay) (reply ReplyCurrencyRateItem, err error) {
|
|
xClient, err := client2.GetClient(c)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = xClient.Call(ctx, "Day", args, &reply)
|
|
return
|
|
}
|