Merge branch 'master' of git.oa00.com:supply-chain/service

finance
黄伟 2 years ago
commit 71a3e9a074

@ -3,7 +3,9 @@ package customer
import ( import (
"context" "context"
"git.oa00.com/supply-chain/service/client" "git.oa00.com/supply-chain/service/client"
user2 "git.oa00.com/supply-chain/service/customer/user"
"git.oa00.com/supply-chain/service/lib/bean" "git.oa00.com/supply-chain/service/lib/bean"
"github.com/shopspring/decimal"
) )
const ( const (
@ -15,6 +17,7 @@ const (
) )
type user struct { type user struct {
user2.User
} }
type UserSearch struct { type UserSearch struct {
Status uint // 状态 Status uint // 状态
@ -25,15 +28,16 @@ type ArgsUserList struct {
Page bean.Page Page bean.Page
} }
type UserItem struct { type UserItem struct {
Id uint `json:"id"` Id uint `json:"id"`
Name string `json:"name"` Name string `json:"name"`
Account string `json:"account"` Account string `json:"account"`
Liaison string `json:"liaison"` Liaison string `json:"liaison"`
Phone string `json:"phone"` Phone string `json:"phone"`
Status uint `json:"status"` Amount decimal.Decimal `json:"amount"`
CreatedType uint `json:"createdType"` Status uint `json:"status"`
CreatedUserId uint `json:"createdUserId"` CreatedType uint `json:"createdType"`
CreatedAt int64 `json:"createdAt"` CreatedUserId uint `json:"createdUserId"`
CreatedAt int64 `json:"createdAt"`
} }
type ReplyUserList struct { type ReplyUserList struct {
Lists []UserItem `json:"lists"` Lists []UserItem `json:"lists"`

@ -0,0 +1,62 @@
package user
import (
"context"
"git.oa00.com/supply-chain/service/client"
"github.com/shopspring/decimal"
)
type deposit struct {
}
type applyType uint // 申请人类型
const (
ApplyTypeCustomer = 1 // 客户
ApplyTypePlatform = 2 // 平台
DepositAuditStatusWait = 1 // 待审核
DepositAuditStatusAdopt = 2 // 审核通过
DepositAuditStatusReject = 3 // 审核驳回
)
type ArgsDepositAdd struct {
UserId uint // 客户id
ApplyType uint // 申请人类型 1=客户 2=平台
ApplyUserId uint // 申请人id
Amount decimal.Decimal // 充值金额
Proof string // 充值凭证
DepositAt int64 // 充值时间
Remark string // 备注
}
// Add @Title 充值
func (d *deposit) Add(ctx context.Context, args ArgsDepositAdd) error {
reply := 0
return client.GetClient(d).Call(ctx, "Add", args, &reply)
}
type ArgsDepositInfo struct {
DepositId uint // 充值记录id 必须
UserId uint // 用户id 可选
}
type ReplyDepositInfo struct {
Id uint `json:"id"`
UserId uint `json:"userId"`
UserName string `json:"userName"`
Amount decimal.Decimal `json:"amount"`
ApplyType uint `json:"applyType"`
ApplyUserId uint `json:"applyUserId"`
ApplyAt int64 `json:"applyAt"`
Proof string `json:"proof"`
DepositAt int64 `json:"depositAt"`
Remark string `json:"remark"`
AuditStatus uint `json:"auditStatus"`
AuditUserId uint `json:"auditUserId"`
AuditAt int64 `json:"auditAt"`
Reason string `json:"reason"`
}
// Info @Title 详情
func (d *deposit) Info(ctx context.Context, args ArgsDepositInfo) (reply ReplyDepositInfo, err error) {
err = client.GetClient(d).Call(ctx, "Info", args, &reply)
return
}

@ -0,0 +1,70 @@
package user
import (
"context"
"git.oa00.com/supply-chain/service/client"
"git.oa00.com/supply-chain/service/lib/bean"
"github.com/shopspring/decimal"
)
type depositAudit struct {
}
type ArgsDepositAuditLists struct {
Search DepositAuditSearch
Page bean.Page
}
type DepositAuditSearch struct {
Status uint // 审核状态 1=待审核 2=通过 3=驳回
Name string // 客户名称
Amount decimal.Decimal // 充值金额
ApplyDateStart string // 申请日期
ApplyDateEnd string // 申请日期
AuditDateStart string // 审核日期
AuditDateEnd string // 审核日期
}
type ReplyDepositAuditList struct {
Lists []DepositAuditItem `json:"lists"`
Total int64 `json:"total"`
}
type DepositAuditItem struct {
Id uint `json:"id"`
UserId uint `json:"userId"`
UserName string `json:"userName"`
Amount decimal.Decimal `json:"amount"`
ApplyType uint `json:"applyType"`
ApplyUserId uint `json:"applyUserId"`
ApplyAt int64 `json:"applyAt"`
AuditStatus uint `json:"auditStatus"`
}
// Lists @Title 充值审核列表
func (d *depositAudit) Lists(ctx context.Context, args ArgsDepositAuditLists) (reply ReplyDepositAuditList, err error) {
err = client.GetClient(d).Call(ctx, "Lists", args, &reply)
return
}
type ArgsDepositAuditAdopt struct {
DepositId uint // 充值记录id
AuditUserId uint // 审核人id
}
// Adopt @Title 通过
func (d *depositAudit) Adopt(ctx context.Context, args ArgsDepositAuditAdopt) error {
reply := 0
return client.GetClient(d).Call(ctx, "Adopt", args, &reply)
}
type ArgsDepositAuditReject struct {
DepositId uint // 充值记录id
AuditUserId uint // 审核人id
Reason string // 驳回原因
}
// Reject @Title 驳回
func (d *depositAudit) Reject(ctx context.Context, args ArgsDepositAuditReject) error {
reply := 0
return client.GetClient(d).Call(ctx, "Reject", args, &reply)
}

@ -0,0 +1,6 @@
package user
type User struct {
Deposit deposit // 充值
DepositAudit depositAudit // 充值审核
}

@ -0,0 +1,34 @@
package user
import (
"context"
"git.oa00.com/supply-chain/service/client"
"github.com/shopspring/decimal"
)
type wallet struct {
}
type walletType uint // 费用类型
const (
WalletTypeIncome walletType = 1 // 收入
WalletTypeExpend walletType = 2 // 支出
WalletStatusHandle = 1 // 处理中
WalletStatusSuccess = 2 // 成功
WalletStatusFail = 3 // 失败
)
type ArgsWalletDirect struct {
UserId uint // 客户id
WalletType walletType // 收支类型
Amount decimal.Decimal // 金额 正数
ServiceId uint // 服务id
Remark string // 备注信息
}
// Direct @Title 直接消费
func (w *wallet) Direct(ctx context.Context, args ArgsDepositAuditReject) error {
reply := 0
return client.GetClient(w).Call(ctx, "Direct", args, &reply)
}

@ -94,7 +94,7 @@ type SkuImg struct {
} }
// GetImgs @Title 获取预览图 // GetImgs @Title 获取预览图
func (s *sku) GetImgs(ctx context.Context, skuId uint) (reply SkuImg, err error) { func (s *sku) GetImgs(ctx context.Context, skuId uint) (reply []SkuImg, err error) {
err = client.GetClient(s).Call(ctx, "GetImgs", skuId, &reply) err = client.GetClient(s).Call(ctx, "GetImgs", skuId, &reply)
return return
} }

Loading…
Cancel
Save