// Package genin
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2026 LiXiujie
// @Author Lxj
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
// @AutoGenerate Version
package model
import (
"context"
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/library/xgorm/hook"
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/model/entity"
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/model/request"
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/errors/gerror"
)
// TFinanceApplyUpdateFields 修改财务申请表字段过滤
type TFinanceApplyUpdateFields struct {
ApplyNo string `json:"applyNo" dc:"申请单号"`
ApplyType int `json:"applyType" dc:"申请类型(1:提现申请,2:余额转提现)"`
AuditType int `json:"auditType" dc:"审核类型:1初审,2复审"`
ApplyDeptId int64 `json:"applyDeptId" dc:"申请机构ID"`
AuditDeptId int64 `json:"auditDeptId" dc:"审核方机构ID,通常为直属上级或顶级"`
AvailableAmountSnapshot float64 `json:"availableAmountSnapshot" dc:"申请前可提现余额快照"`
ApplyAmount float64 `json:"applyAmount" dc:"申请金额"`
AccountType int `json:"accountType" dc:"提现账号类型,1:银行卡,2:支付宝,3:微信"`
BankName string `json:"bankName" dc:"开户行名称"`
BankAccount string `json:"bankAccount" dc:"开户行账号或账号"`
AccountName string `json:"accountName" dc:"用户姓名"`
IdentityCard string `json:"identityCard" dc:"用户身份证号"`
ReceiveAccount *gjson.Json `json:"receiveAccount" dc:"收款账户信息快照"`
ApplyStatus int `json:"applyStatus" dc:"状态:0待审核,1已通过,2已驳回,3已打款,4已取消"`
ApplyTime *gtime.Time `json:"applyTime" dc:"申请时间"`
AuditTime *gtime.Time `json:"auditTime" dc:"最近审核时间"`
Remark string `json:"remark" dc:"备注"`
TenantId string `json:"tenantId" dc:"租户ID"`
UpdatedBy int64 `json:"updatedBy" dc:"更新者"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
}
// TFinanceApplyInsertFields 新增财务申请表字段过滤
type TFinanceApplyInsertFields struct {
ApplyNo string `json:"applyNo" dc:"申请单号"`
ApplyType int `json:"applyType" dc:"申请类型(1:提现申请,2:余额转提现)"`
AuditType int `json:"auditType" dc:"审核类型:1初审,2复审"`
ApplyDeptId int64 `json:"applyDeptId" dc:"申请机构ID"`
AuditDeptId int64 `json:"auditDeptId" dc:"审核方机构ID,通常为直属上级或顶级"`
AvailableAmountSnapshot float64 `json:"availableAmountSnapshot" dc:"申请前可提现余额快照"`
ApplyAmount float64 `json:"applyAmount" dc:"申请金额"`
AccountType int `json:"accountType" dc:"提现账号类型,1:银行卡,2:支付宝,3:微信"`
BankName string `json:"bankName" dc:"开户行名称"`
BankAccount string `json:"bankAccount" dc:"开户行账号或账号"`
AccountName string `json:"accountName" dc:"用户姓名"`
IdentityCard string `json:"identityCard" dc:"用户身份证号"`
ReceiveAccount *gjson.Json `json:"receiveAccount" dc:"收款账户信息快照"`
ApplyStatus int `json:"applyStatus" dc:"状态:0待审核,1已通过,2已驳回,3已打款,4已取消"`
ApplyTime *gtime.Time `json:"applyTime" dc:"申请时间"`
AuditTime *gtime.Time `json:"auditTime" dc:"最近审核时间"`
Remark string `json:"remark" dc:"备注"`
TenantId string `json:"tenantId" dc:"租户ID"`
CreatedDept int64 `json:"createdDept" dc:"创建部门"`
CreatedBy int64 `json:"createdBy" dc:"创建者"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
}
// TFinanceApplyEditParam 修改/新增财务申请表
type TFinanceApplyEditParam struct {
//entity.TFinanceApply
Id int64 `json:"id" dc:"主键ID"`
ApplyNo *string `json:"applyNo" dc:"申请单号"`
ApplyType *int `json:"applyType" dc:"申请类型(1:提现申请,2:余额转提现)"`
AuditType *int `json:"auditType" dc:"审核类型:1初审,2复审"`
ApplyDeptId *int64 `json:"applyDeptId" dc:"申请机构ID"`
AuditDeptId *int64 `json:"auditDeptId" dc:"审核方机构ID,通常为直属上级或顶级"`
AvailableAmountSnapshot *float64 `json:"availableAmountSnapshot" dc:"申请前可提现余额快照"`
ApplyAmount *float64 `json:"applyAmount" dc:"申请金额"`
AccountType *int `json:"accountType" dc:"提现账号类型,1:银行卡,2:支付宝,3:微信"`
BankName *string `json:"bankName" dc:"开户行名称"`
BankAccount *string `json:"bankAccount" dc:"开户行账号或账号"`
AccountName *string `json:"accountName" dc:"用户姓名"`
IdentityCard *string `json:"identityCard" dc:"用户身份证号"`
ReceiveAccount *gjson.Json `json:"receiveAccount" dc:"收款账户信息快照"`
ApplyStatus *int `json:"applyStatus" dc:"状态:0待审核,1已通过,2已驳回,3已打款,4已取消"`
ApplyTime *gtime.Time `json:"applyTime" dc:"申请时间"`
AuditTime *gtime.Time `json:"auditTime" dc:"最近审核时间"`
Remark *string `json:"remark" dc:"备注"`
TenantId *string `json:"tenantId" dc:"租户ID"`
CreatedDept *int64 `json:"createdDept" dc:"创建部门"`
CreatedBy *int64 `json:"createdBy" dc:"创建者"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
UpdatedBy *int64 `json:"updatedBy" dc:"更新者"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
}
func (in *TFinanceApplyEditParam) Filter(ctx context.Context) (err error) {
return
}
type TFinanceApplyEditModel struct{}
// TFinanceApplyDeleteParam 删除财务申请表
type TFinanceApplyDeleteParam struct {
Id interface{} `json:"id" v:"required#主键ID不能为空" dc:"主键ID"`
}
func (in *TFinanceApplyDeleteParam) Filter(ctx context.Context) (err error) {
return
}
type TFinanceApplyDeleteModel struct{}
// TFinanceApplyViewParam 获取指定财务申请表信息
type TFinanceApplyViewParam struct {
Id int64 `json:"id" v:"required#主键ID不能为空" dc:"主键ID"`
}
func (in *TFinanceApplyViewParam) Filter(ctx context.Context) (err error) {
return
}
// TFinanceApplyListParam 获取财务申请表列表
type TFinanceApplyListParam struct {
request.PageInfo
Id int64 `json:"id" dc:"主键ID"`
ApplyStatus int `json:"applyStatus" dc:"状态:0待审核,1已通过,2已驳回,3已打款,4已取消"`
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
}
func (in *TFinanceApplyListParam) Filter(ctx context.Context) (err error) {
return
}
type TFinanceApplyListModel struct {
Id int64 `json:"id" dc:"主键ID"`
ApplyNo string `json:"applyNo" dc:"申请单号"`
ApplyType int `json:"applyType" dc:"申请类型(1:提现申请,2:余额转提现)"`
AuditType int `json:"auditType" dc:"审核类型:1初审,2复审"`
ApplyDeptId int64 `json:"applyDeptId" dc:"申请机构ID"`
AuditDeptId int64 `json:"auditDeptId" dc:"审核方机构ID,通常为直属上级或顶级"`
AvailableAmountSnapshot float64 `json:"availableAmountSnapshot" dc:"申请前可提现余额快照"`
ApplyAmount float64 `json:"applyAmount" dc:"申请金额"`
AccountType int `json:"accountType" dc:"提现账号类型,1:银行卡,2:支付宝,3:微信"`
BankName string `json:"bankName" dc:"开户行名称"`
BankAccount string `json:"bankAccount" dc:"开户行账号或账号"`
AccountName string `json:"accountName" dc:"用户姓名"`
IdentityCard string `json:"identityCard" dc:"用户身份证号"`
ApplyStatus int `json:"applyStatus" dc:"状态:0待审核,1已通过,2已驳回,3已打款,4已取消"`
ApplyTime *gtime.Time `json:"applyTime" dc:"申请时间"`
AuditTime *gtime.Time `json:"auditTime" dc:"最近审核时间"`
TenantId string `json:"tenantId" dc:"租户ID"`
CreatedDept int64 `json:"createdDept" dc:"创建部门"`
CreatedBy int64 `json:"createdBy" dc:"创建者"`
CreatedBySumma *hook.MemberSumma `json:"createdBySumma" dc:"创建者摘要信息"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
UpdatedBy int64 `json:"updatedBy" dc:"更新者"`
UpdatedBySumma *hook.MemberSumma `json:"updatedBySumma" dc:"更新者摘要信息"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
}
// TFinanceApplyExportModel 导出财务申请表
type TFinanceApplyExportModel struct {
Id int64 `json:"id" dc:"主键ID"`
ApplyNo string `json:"applyNo" dc:"申请单号"`
ApplyType int `json:"applyType" dc:"申请类型(1:提现申请,2:余额转提现)"`
AuditType int `json:"auditType" dc:"审核类型:1初审,2复审"`
ApplyDeptId int64 `json:"applyDeptId" dc:"申请机构ID"`
AuditDeptId int64 `json:"auditDeptId" dc:"审核方机构ID,通常为直属上级或顶级"`
AvailableAmountSnapshot float64 `json:"availableAmountSnapshot" dc:"申请前可提现余额快照"`
ApplyAmount float64 `json:"applyAmount" dc:"申请金额"`
AccountType int `json:"accountType" dc:"提现账号类型,1:银行卡,2:支付宝,3:微信"`
BankName string `json:"bankName" dc:"开户行名称"`
BankAccount string `json:"bankAccount" dc:"开户行账号或账号"`
AccountName string `json:"accountName" dc:"用户姓名"`
IdentityCard string `json:"identityCard" dc:"用户身份证号"`
ApplyStatus int `json:"applyStatus" dc:"状态:0待审核,1已通过,2已驳回,3已打款,4已取消"`
ApplyTime *gtime.Time `json:"applyTime" dc:"申请时间"`
AuditTime *gtime.Time `json:"auditTime" dc:"最近审核时间"`
TenantId string `json:"tenantId" dc:"租户ID"`
CreatedDept int64 `json:"createdDept" dc:"创建部门"`
CreatedBy int64 `json:"createdBy" dc:"创建者"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
UpdatedBy int64 `json:"updatedBy" dc:"更新者"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
}
// TAgentBalanceTransferApplyParam 是余额转可提现申请参数。
type TAgentBalanceTransferApplyParam struct {
Amount float64 `json:"amount" dc:"转入可提现金额"`
AccountType int `json:"accountType" dc:"提现账号类型:1银行卡,2支付宝,3微信"`
BankName string `json:"bankName" dc:"开户行名称"`
BankAccount string `json:"bankAccount" dc:"开户地址或账号"`
AccountName string `json:"accountName" dc:"用户姓名"`
IdentityCard string `json:"identityCard" dc:"用户身份证号"`
Remark string `json:"remark" dc:"备注"`
}
func (in *TAgentBalanceTransferApplyParam) Filter(ctx context.Context) (err error) {
if in == nil {
return gerror.New("申请参数不能为空")
}
if in.Amount <= 0 {
return gerror.New("转入金额必须大于0")
}
if in.AccountType <= 0 {
return gerror.New("提现账号类型不能为空")
}
return nil
}
// TAgentBalanceTransferApplyModel 是余额转可提现申请返回结果。
type TAgentBalanceTransferApplyModel struct {
ApplyNo string `json:"applyNo" dc:"申请单号"`
ApplyAmount float64 `json:"applyAmount" dc:"申请金额"`
BalanceAfter float64 `json:"balanceAfter" dc:"扣减后的余额"`
}
// TAgentBalanceTransferAuditParam 是余额转可提现审核参数。
type TAgentBalanceTransferAuditParam struct {
ApplyNo string `json:"applyNo" v:"required#申请单号不能为空" dc:"申请单号"`
AuditResult int `json:"auditResult" dc:"审核结果:0通过,1驳回"`
AuditOpinion string `json:"auditOpinion" dc:"审核意见"`
}
func (in *TAgentBalanceTransferAuditParam) Filter(ctx context.Context) (err error) {
if in == nil {
return gerror.New("审核参数不能为空")
}
if in.ApplyNo == "" {
return gerror.New("申请单号不能为空")
}
if in.AuditResult != 0 && in.AuditResult != 1 {
return gerror.New("审核结果不正确")
}
return nil
}
type TAgentBalanceTransferAuditModel struct{}
// TFinanceApplyCreateBalanceTransferParam 是写入余额转可提现申请单的参数。
type TFinanceApplyCreateBalanceTransferParam struct {
ApplyNo string
ApplyDeptId int64
AuditDeptId int64
AvailableAmountSnapshot float64
ApplyAmount float64
AccountType int
BankName string
BankAccount string
AccountName string
IdentityCard string
ReceiveAccount *gjson.Json
Remark string
TenantId string
CreatedDept int64
CreatedBy int64
CreatedAt *gtime.Time
}
// TFinanceApplyUpdateAuditStatusParam 是更新财务申请审核状态的参数。
type TFinanceApplyUpdateAuditStatusParam struct {
ApplyNo string
ApplyStatus int
AuditTime *gtime.Time
UpdatedBy int64
UpdatedAt *gtime.Time
}
type TFinanceApplyViewModel struct {
entity.TFinanceApply
}