新增:提现详情
This commit is contained in:
+77
-23
@@ -7,32 +7,35 @@ import (
|
||||
)
|
||||
|
||||
type DoctorWithdrawalDto struct {
|
||||
WithdrawalId string `json:"withdrawal_id"` // 主键id
|
||||
DoctorId string `json:"doctor_id"` // 医生id;NOT NULL
|
||||
BankId string `json:"bank_id"` // 银行id
|
||||
AccountName string `json:"account_name"` // 银行卡姓名;NOT NULL
|
||||
BankCardCode string `json:"bank_card_code"` // 银行卡号
|
||||
BankCardCodeFour string `json:"bank_card_code_four"` // 银行卡号(后四位);NOT NULL
|
||||
AppliedWithdrawalAmount float64 `json:"applied_withdrawal_amount"` // 提现金额
|
||||
ActualWithdrawalAmount float64 `json:"actual_withdrawal_amount"` // 实际提现金额
|
||||
IncomeTax float64 `json:"income_tax"` // 提现所得税金额
|
||||
ExamineStatus int `json:"examine_status"` // 审核状态(1:审核中 2:审核通过 3:审核未通过)
|
||||
ExamineFailReason string `json:"examine_fail_reason"` // 审核失败原因
|
||||
ExamineTime model.LocalTime `json:"examine_time"` // 审核日期
|
||||
ExamineBy string `json:"examine_by"` // 审核人员id(后台用户id)
|
||||
PaymentStatus int `json:"payment_status"` // 财务打款状态(0:否 1:是)
|
||||
PaymentTime model.LocalTime `json:"payment_time"` // 财务打款时间
|
||||
PaymentBy string `json:"payment_by"` // 财务打款人员id(后台用户id)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
DoctorName string `json:"doctor_name"` // 医生姓名
|
||||
WithdrawalId string `json:"withdrawal_id"` // 主键id
|
||||
DoctorId string `json:"doctor_id"` // 医生id;NOT NULL
|
||||
AccountName string `json:"account_name"` // 银行卡姓名;NOT NULL
|
||||
BankCardCode string `json:"bank_card_code"` // 银行卡号
|
||||
BankCardCodeFour string `json:"bank_card_code_four"` // 银行卡号(后四位);NOT NULL
|
||||
AppliedWithdrawalAmount float64 `json:"applied_withdrawal_amount"` // 提现金额
|
||||
ActualWithdrawalAmount float64 `json:"actual_withdrawal_amount"` // 实际提现金额
|
||||
IncomeTax float64 `json:"income_tax"` // 提现所得税金额
|
||||
ExamineStatus int `json:"examine_status"` // 审核状态(1:审核中 2:审核通过 3:审核未通过)
|
||||
ExamineFailReason string `json:"examine_fail_reason"` // 审核失败原因
|
||||
ExamineTime model.LocalTime `json:"examine_time"` // 审核日期
|
||||
ExamineBy string `json:"examine_by"` // 审核人员id(后台用户id)
|
||||
PaymentStatus int `json:"payment_status"` // 财务打款状态(0:否 1:是)
|
||||
PaymentTime model.LocalTime `json:"payment_time"` // 财务打款时间
|
||||
PaymentBy string `json:"payment_by"` // 财务打款人员id(后台用户id)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
DoctorName string `json:"doctor_name"` // 医生姓名
|
||||
DoctorCardNumMask string `json:"doctor_card_num_mask"` // 医生证件号码(掩码)
|
||||
DoctorBankCard *DoctorBankCardDto `json:"doctor_bank_card"` // 加载医生银行卡数据
|
||||
DoctorWithdrawalBank *DoctorWithdrawalBankDto `json:"doctor_withdrawal_bank"` // 医生提现表-关联银行
|
||||
BankName string `json:"bank_name"` // 提现银行名称
|
||||
BankCity string `json:"bank_city"` // 提现银行开户行城市
|
||||
}
|
||||
|
||||
func GetDoctorWithdrawalDto(m *model.DoctorWithdrawal) *DoctorWithdrawalDto {
|
||||
return &DoctorWithdrawalDto{
|
||||
WithdrawalId: fmt.Sprintf("%d", m.WithdrawalId),
|
||||
DoctorId: fmt.Sprintf("%d", m.DoctorId),
|
||||
BankId: fmt.Sprintf("%d", m.BankId),
|
||||
AccountName: m.AccountName,
|
||||
BankCardCode: m.BankCardCode,
|
||||
BankCardCodeFour: m.BankCardCodeFour,
|
||||
@@ -60,7 +63,6 @@ func GetDoctorWithdrawalListDto(m []*model.DoctorWithdrawal) []*DoctorWithdrawal
|
||||
response := &DoctorWithdrawalDto{
|
||||
WithdrawalId: fmt.Sprintf("%d", v.WithdrawalId),
|
||||
DoctorId: fmt.Sprintf("%d", v.DoctorId),
|
||||
BankId: fmt.Sprintf("%d", v.BankId),
|
||||
AccountName: v.AccountName,
|
||||
BankCardCode: v.BankCardCode,
|
||||
BankCardCodeFour: v.BankCardCodeFour,
|
||||
@@ -70,10 +72,10 @@ func GetDoctorWithdrawalListDto(m []*model.DoctorWithdrawal) []*DoctorWithdrawal
|
||||
ExamineStatus: v.ExamineStatus,
|
||||
ExamineFailReason: v.ExamineFailReason,
|
||||
ExamineTime: v.ExamineTime,
|
||||
ExamineBy: fmt.Sprintf("%d", v.ExamineBy),
|
||||
ExamineBy: "",
|
||||
PaymentStatus: v.PaymentStatus,
|
||||
PaymentTime: v.PaymentTime,
|
||||
PaymentBy: fmt.Sprintf("%d", v.PaymentBy),
|
||||
PaymentBy: "",
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
@@ -93,6 +95,16 @@ func GetDoctorWithdrawalListDto(m []*model.DoctorWithdrawal) []*DoctorWithdrawal
|
||||
response.LoadPaymentByName(v.PaymentBy)
|
||||
}
|
||||
|
||||
if v.DoctorWithdrawalBank != nil {
|
||||
// 加载提现银行名称
|
||||
if v.DoctorWithdrawalBank.BasicBank != nil {
|
||||
response.LoadBankName(v.DoctorWithdrawalBank.BasicBank)
|
||||
}
|
||||
|
||||
// 加载开户行城市名称
|
||||
response.LoadBankCity(v.DoctorWithdrawalBank)
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
@@ -111,6 +123,7 @@ func (r *DoctorWithdrawalDto) LoadDoctorName(m *model.UserDoctor) *DoctorWithdra
|
||||
|
||||
// LoadExamineByName 加载审核人员名称
|
||||
func (r *DoctorWithdrawalDto) LoadExamineByName(examineBy int64) *DoctorWithdrawalDto {
|
||||
r.ExamineBy = ""
|
||||
if examineBy != 0 {
|
||||
adminUserDao := dao.AdminUserDao{}
|
||||
adminUser, err := adminUserDao.GetAdminUserFirstById(examineBy)
|
||||
@@ -123,6 +136,7 @@ func (r *DoctorWithdrawalDto) LoadExamineByName(examineBy int64) *DoctorWithdraw
|
||||
|
||||
// LoadPaymentByName 加载打款人员名称
|
||||
func (r *DoctorWithdrawalDto) LoadPaymentByName(paymentBy int64) *DoctorWithdrawalDto {
|
||||
r.PaymentBy = ""
|
||||
if paymentBy != 0 {
|
||||
adminUserDao := dao.AdminUserDao{}
|
||||
adminUser, err := adminUserDao.GetAdminUserFirstById(paymentBy)
|
||||
@@ -132,3 +146,43 @@ func (r *DoctorWithdrawalDto) LoadPaymentByName(paymentBy int64) *DoctorWithdraw
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadDoctorCardNumMask 加载医生证件号码(掩码)
|
||||
func (r *DoctorWithdrawalDto) LoadDoctorCardNumMask(m *model.UserDoctorInfo) *DoctorWithdrawalDto {
|
||||
if m != nil {
|
||||
r.DoctorCardNumMask = m.CardNumMask
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadBankName 加载提现银行名称
|
||||
func (r *DoctorWithdrawalDto) LoadBankName(m *model.BasicBank) *DoctorWithdrawalDto {
|
||||
if m != nil {
|
||||
r.BankName = m.BankName
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadBankCity 加载开户行城市名称
|
||||
func (r *DoctorWithdrawalDto) LoadBankCity(m *model.DoctorWithdrawalBank) *DoctorWithdrawalDto {
|
||||
if m != nil {
|
||||
r.BankCity = m.Province + m.City + m.County
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadDoctorWithdrawalBank 加载提现关联银行数据
|
||||
func (r *DoctorWithdrawalDto) LoadDoctorWithdrawalBank(m *model.DoctorWithdrawalBank) *DoctorWithdrawalDto {
|
||||
if m != nil {
|
||||
r.DoctorWithdrawalBank = GetDoctorWithdrawalBankDto(m)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadBasicBank 加载基础银行数据
|
||||
func (r *DoctorWithdrawalDto) LoadBasicBank(m *model.BasicBank) *DoctorWithdrawalDto {
|
||||
if m != nil {
|
||||
r.DoctorWithdrawalBank.BasicBank = GetBasicBankDto(m)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type DoctorWithdrawalBankDto struct {
|
||||
WithdrawalBankId string `json:"withdrawal_bank_id"` // 主键id
|
||||
WithdrawalId string `json:"withdrawal_id"` // 提现id
|
||||
BankId string `json:"bank_id"` // 银行id
|
||||
BankCardCode string `json:"bank_card_code"` // 银行卡号
|
||||
ProvinceId int `json:"province_id"` // 省份id
|
||||
Province string `json:"province"` // 省份
|
||||
CityId int `json:"city_id"` // 城市id
|
||||
City string `json:"city"` // 城市
|
||||
CountyId int `json:"county_id"` // 区县id
|
||||
County string `json:"county"` // 区县
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
BasicBank *BasicBankDto `json:"basic_bank"` // 基础-银行数据
|
||||
}
|
||||
|
||||
func GetDoctorWithdrawalBankDto(m *model.DoctorWithdrawalBank) *DoctorWithdrawalBankDto {
|
||||
return &DoctorWithdrawalBankDto{
|
||||
WithdrawalBankId: fmt.Sprintf("%d", m.WithdrawalBankId),
|
||||
WithdrawalId: fmt.Sprintf("%d", m.WithdrawalId),
|
||||
BankId: fmt.Sprintf("%d", m.BankId),
|
||||
BankCardCode: m.BankCardCode,
|
||||
ProvinceId: m.ProvinceId,
|
||||
Province: m.Province,
|
||||
CityId: m.CityId,
|
||||
City: m.City,
|
||||
CountyId: m.CountyId,
|
||||
County: m.County,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetDoctorWithdrawalBankListDto(m []*model.DoctorWithdrawalBank) []*DoctorWithdrawalBankDto {
|
||||
// 处理返回值
|
||||
responses := make([]*DoctorWithdrawalBankDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := &DoctorWithdrawalBankDto{
|
||||
WithdrawalBankId: fmt.Sprintf("%d", v.WithdrawalBankId),
|
||||
WithdrawalId: fmt.Sprintf("%d", v.WithdrawalId),
|
||||
BankId: fmt.Sprintf("%d", v.BankId),
|
||||
BankCardCode: v.BankCardCode,
|
||||
ProvinceId: v.ProvinceId,
|
||||
Province: v.Province,
|
||||
CityId: v.CityId,
|
||||
City: v.City,
|
||||
CountyId: v.CountyId,
|
||||
County: v.County,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
Reference in New Issue
Block a user