新增:提现详情

This commit is contained in:
2023-10-31 09:13:50 +08:00
parent a26cd2cef3
commit bf108857d7
10 changed files with 344 additions and 41 deletions
+17 -17
View File
@@ -8,23 +8,23 @@ import (
// DoctorWithdrawal 医生提现表
type DoctorWithdrawal struct {
WithdrawalId int64 `gorm:"column:withdrawal_id;type:bigint(19);primary_key;comment:主键id" json:"withdrawal_id"`
DoctorId int64 `gorm:"column:doctor_id;type:bigint(19);comment:医生id;NOT NULL" json:"doctor_id"`
BankId int64 `gorm:"column:bank_id;type:bigint(19);comment:银行id" json:"bank_id"`
AccountName string `gorm:"column:account_name;type:varchar(50);comment:银行卡姓名;NOT NULL" json:"account_name"`
BankCardCode string `gorm:"column:bank_card_code;type:varchar(100);comment:银行卡号" json:"bank_card_code"`
BankCardCodeFour string `gorm:"column:bank_card_code_four;type:varchar(10);comment:银行卡号(后四位);NOT NULL" json:"bank_card_code_four"`
AppliedWithdrawalAmount float64 `gorm:"column:applied_withdrawal_amount;type:decimal(10,2);default:0.00;comment:提现金额" json:"applied_withdrawal_amount"`
ActualWithdrawalAmount float64 `gorm:"column:actual_withdrawal_amount;type:decimal(10,2);default:0.00;comment:实际提现金额" json:"actual_withdrawal_amount"`
IncomeTax float64 `gorm:"column:income_tax;type:decimal(10,2);default:0.00;comment:提现所得税金额" json:"income_tax"`
ExamineStatus int `gorm:"column:examine_status;type:tinyint(4);default:0;comment:审核状态(1:审核中 2:审核通过 3:审核未通过)" json:"examine_status"`
ExamineFailReason string `gorm:"column:examine_fail_reason;type:varchar(255);comment:审核失败原因" json:"examine_fail_reason"`
ExamineTime LocalTime `gorm:"column:examine_time;type:datetime;comment:审核日期" json:"examine_time"`
ExamineBy int64 `gorm:"column:examine_by;type:bigint(19);comment:审核人员id(后台用户id" json:"examine_by"`
PaymentStatus int `gorm:"column:payment_status;type:tinyint(1);default:0;comment:财务打款状态(0:否 1:是)" json:"payment_status"`
PaymentTime LocalTime `gorm:"column:payment_time;type:datetime;comment:财务打款时间" json:"payment_time"`
PaymentBy int64 `gorm:"column:payment_by;type:bigint(19);comment:财务打款人员id(后台用户id" json:"payment_by"`
UserDoctor *UserDoctor `gorm:"foreignKey:DoctorId;references:doctor_id" json:"user_doctor"` // 医生
WithdrawalId int64 `gorm:"column:withdrawal_id;type:bigint(19);primary_key;comment:主键id" json:"withdrawal_id"`
DoctorId int64 `gorm:"column:doctor_id;type:bigint(19);comment:医生id;NOT NULL" json:"doctor_id"`
AccountName string `gorm:"column:account_name;type:varchar(50);comment:银行卡姓名;NOT NULL" json:"account_name"`
BankCardCode string `gorm:"column:bank_card_code;type:varchar(100);comment:银行卡号" json:"bank_card_code"`
BankCardCodeFour string `gorm:"column:bank_card_code_four;type:varchar(10);comment:银行卡号(后四位);NOT NULL" json:"bank_card_code_four"`
AppliedWithdrawalAmount float64 `gorm:"column:applied_withdrawal_amount;type:decimal(10,2);default:0.00;comment:提现金额" json:"applied_withdrawal_amount"`
ActualWithdrawalAmount float64 `gorm:"column:actual_withdrawal_amount;type:decimal(10,2);default:0.00;comment:实际提现金额" json:"actual_withdrawal_amount"`
IncomeTax float64 `gorm:"column:income_tax;type:decimal(10,2);default:0.00;comment:提现所得税金额" json:"income_tax"`
ExamineStatus int `gorm:"column:examine_status;type:tinyint(4);default:0;comment:审核状态(1:审核中 2:审核通过 3:审核未通过)" json:"examine_status"`
ExamineFailReason string `gorm:"column:examine_fail_reason;type:varchar(255);comment:审核失败原因" json:"examine_fail_reason"`
ExamineTime LocalTime `gorm:"column:examine_time;type:datetime;comment:审核日期" json:"examine_time"`
ExamineBy int64 `gorm:"column:examine_by;type:bigint(19);comment:审核人员id(后台用户id" json:"examine_by"`
PaymentStatus int `gorm:"column:payment_status;type:tinyint(1);default:0;comment:财务打款状态(0:否 1:是)" json:"payment_status"`
PaymentTime LocalTime `gorm:"column:payment_time;type:datetime;comment:财务打款时间" json:"payment_time"`
PaymentBy int64 `gorm:"column:payment_by;type:bigint(19);comment:财务打款人员id(后台用户id" json:"payment_by"`
UserDoctor *UserDoctor `gorm:"foreignKey:DoctorId;references:doctor_id" json:"user_doctor"` // 医生
DoctorWithdrawalBank *DoctorWithdrawalBank `gorm:"foreignKey:WithdrawalId;references:withdrawal_id" json:"doctor_withdrawal_bank"` // 医生提现表-关联银行
Model
}
+41
View File
@@ -0,0 +1,41 @@
package model
import (
"gorm.io/gorm"
"hospital-admin-api/global"
"time"
)
// DoctorWithdrawalBank 医生提现表-关联银行
type DoctorWithdrawalBank struct {
WithdrawalBankId int64 `gorm:"column:withdrawal_bank_id;type:bigint(19);primary_key;comment:主键id" json:"withdrawal_bank_id"`
WithdrawalId int64 `gorm:"column:withdrawal_id;type:bigint(19)" json:"withdrawal_id"`
BankId int64 `gorm:"column:bank_id;type:bigint(19);comment:银行id" json:"bank_id"`
BankCardCode string `gorm:"column:bank_card_code;type:varchar(100);comment:银行卡号" json:"bank_card_code"`
ProvinceId int `gorm:"column:province_id;type:int(11);comment:省份id" json:"province_id"`
Province string `gorm:"column:province;type:varchar(40);comment:省份" json:"province"`
CityId int `gorm:"column:city_id;type:int(11);comment:城市id" json:"city_id"`
City string `gorm:"column:city;type:varchar(40);comment:城市" json:"city"`
CountyId int `gorm:"column:county_id;type:int(11);comment:区县id" json:"county_id"`
County string `gorm:"column:county;type:varchar(255);comment:区县" json:"county"`
BasicBank *BasicBank `gorm:"foreignKey:BankId;references:bank_id" json:"basic_bank"` // 银行
Model
}
func (m *DoctorWithdrawalBank) TableName() string {
return "gdxz_doctor_withdrawal_bank"
}
func (m *DoctorWithdrawalBank) BeforeCreate(tx *gorm.DB) error {
if m.WithdrawalBankId == 0 {
m.WithdrawalBankId = global.Snowflake.Generate().Int64()
}
m.CreatedAt = LocalTime(time.Now())
tx.Statement.SetColumn("CreatedAt", m.CreatedAt)
m.UpdatedAt = LocalTime(time.Now())
tx.Statement.SetColumn("UpdatedAt", m.UpdatedAt)
return nil
}