Merge pull request 'finance' (#1) from finance into master

Reviewed-on: #1
detached
黄伟 2 years ago
commit c127a9ed17

@ -2,6 +2,7 @@ package customer
import (
"git.oa00.com/supply-chain/service/customer/batchSku"
"git.oa00.com/supply-chain/service/customer/finance"
"git.oa00.com/supply-chain/service/customer/service"
"git.oa00.com/supply-chain/service/customer/sku"
)
@ -11,4 +12,5 @@ type Customer struct {
Service service.Service
Sku sku.Sku
BatchSku batchSku.BatchSku
Finance finance.Finance
}

@ -0,0 +1,5 @@
package finance
type Finance struct {
Wallet wallet
}

@ -0,0 +1,60 @@
package finance
import (
"context"
"git.oa00.com/supply-chain/service/client"
"github.com/shopspring/decimal"
)
type wallet struct {
}
type ArgsWalletDetail struct {
Year uint // 年份
Month uint // 月份
}
type WalletItem struct {
CustomerName string `json:"customerName"` // 客户名称
CreatedAt int64 `json:"createdAt"` // 交易时间
Type uint `json:"type"` // 交易类型
Amount decimal.Decimal `json:"amount"` // 交易金额
AfterAmount decimal.Decimal `json:"afterAmount"` // 交易后余额
TradeChannel string `json:"tradeChannel"` // 交易渠道
TradeSerialSn string `json:"tradeSerialSn"` // 交易流水号
Remark string `json:"remark"` // 交易备注
}
// WalletDetail @Title 余额统计
func (w *wallet) WalletDetail(ctx context.Context, args ArgsWalletDetail) (reply []WalletItem, err error) {
xClient, err := client.GetClient(w)
if err != nil {
return nil, err
}
err = xClient.Call(ctx, "WalletDetail", args, &reply)
return
}
type ArgsUserWallet struct {
Year uint // 年份
Month uint // 月份
}
type UserWalletItem struct {
CustomerName string `json:"customerName"`
BeforeAmount decimal.Decimal `json:"beforeAmount"` // 期初余额
AfterAmount decimal.Decimal `json:"afterAmount"` // 期末余额
ConsumeAmount decimal.Decimal `json:"consumeAmount"` // 消费金额
ReturnAmount decimal.Decimal `json:"returnAmount"` // 退款金额
RechargeAmount decimal.Decimal `json:"rechargeAmount"` // 充值金额
}
// UserWallet @Title 客户余额
func (w *wallet) UserWallet(ctx context.Context, args ArgsWalletDetail) (reply []UserWalletItem, err error) {
xClient, err := client.GetClient(w)
if err != nil {
return nil, err
}
err = xClient.Call(ctx, "UserWallet", args, &reply)
return
}
Loading…
Cancel
Save