新增 医生账户详情
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"hospital-admin-api/api/dao"
|
||||
"hospital-admin-api/api/dto"
|
||||
)
|
||||
|
||||
// DoctorAccountService 医生账户
|
||||
type DoctorAccountService struct {
|
||||
}
|
||||
|
||||
// GetDoctorAccount 提现详情
|
||||
func (r *DoctorAccountService) GetDoctorAccount(doctorId int64) (g *dto.DoctorAccountDto, err error) {
|
||||
doctorAccountDao := dao.DoctorAccountDao{}
|
||||
doctorAccount, err := doctorAccountDao.GetDoctorAccountByDoctorId(doctorId)
|
||||
if doctorAccount == nil {
|
||||
return nil, errors.New("数据错误")
|
||||
}
|
||||
|
||||
// 医生数据
|
||||
userDoctorDao := dao.UserDoctorDao{}
|
||||
userDoctor, err := userDoctorDao.GetUserDoctorById(doctorAccount.DoctorId)
|
||||
if err != nil {
|
||||
return nil, errors.New(err.Error())
|
||||
}
|
||||
|
||||
// 医生用户数据
|
||||
userDao := dao.UserDao{}
|
||||
user, err := userDao.GetUserById(userDoctor.UserId)
|
||||
if err != nil {
|
||||
return nil, errors.New(err.Error())
|
||||
}
|
||||
|
||||
// 处理返回值
|
||||
g = dto.GetDoctorAccountDto(doctorAccount)
|
||||
|
||||
// 加载医生名称
|
||||
g.LoadDoctorName(userDoctor)
|
||||
|
||||
// 加载医生手机号(掩码)
|
||||
g.LoadDoctorMobileMask(user)
|
||||
|
||||
return g, nil
|
||||
}
|
||||
@@ -11,11 +11,11 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type DoctorWithdrawaService struct {
|
||||
type DoctorWithdrawalService struct {
|
||||
}
|
||||
|
||||
// GetDoctorWithdrawal 提现详情
|
||||
func (r *DoctorWithdrawaService) GetDoctorWithdrawal(withdrawalId int64) (g *dto.DoctorWithdrawalDto, err error) {
|
||||
func (r *DoctorWithdrawalService) GetDoctorWithdrawal(withdrawalId int64) (g *dto.DoctorWithdrawalDto, err error) {
|
||||
doctorWithdrawalDao := dao.DoctorWithdrawalDao{}
|
||||
doctorWithdrawal, err := doctorWithdrawalDao.GetDoctorWithdrawalById(withdrawalId)
|
||||
if doctorWithdrawal == nil {
|
||||
@@ -75,7 +75,7 @@ func (r *DoctorWithdrawaService) GetDoctorWithdrawal(withdrawalId int64) (g *dto
|
||||
}
|
||||
|
||||
// PutDoctorWithdrawalIncome 修改提现个人所得税
|
||||
func (r *DoctorWithdrawaService) PutDoctorWithdrawalIncome(req requests.PutDoctorWithdrawalIncome, withdrawalId int64) (bool, error) {
|
||||
func (r *DoctorWithdrawalService) PutDoctorWithdrawalIncome(req requests.PutDoctorWithdrawalIncome, withdrawalId int64) (bool, error) {
|
||||
doctorWithdrawalDao := dao.DoctorWithdrawalDao{}
|
||||
doctorWithdrawal, _ := doctorWithdrawalDao.GetDoctorWithdrawalById(withdrawalId)
|
||||
if doctorWithdrawal == nil {
|
||||
@@ -125,7 +125,7 @@ func (r *DoctorWithdrawaService) PutDoctorWithdrawalIncome(req requests.PutDocto
|
||||
}
|
||||
|
||||
// PutDoctorWithdrawalExamine 修改提现审核状态
|
||||
func (r *DoctorWithdrawaService) PutDoctorWithdrawalExamine(req requests.PutDoctorWithdrawalExamine, withdrawalId, adminUserId int64) (bool, error) {
|
||||
func (r *DoctorWithdrawalService) PutDoctorWithdrawalExamine(req requests.PutDoctorWithdrawalExamine, withdrawalId, adminUserId int64) (bool, error) {
|
||||
doctorWithdrawalDao := dao.DoctorWithdrawalDao{}
|
||||
doctorWithdrawal, _ := doctorWithdrawalDao.GetDoctorWithdrawalById(withdrawalId)
|
||||
if doctorWithdrawal == nil {
|
||||
@@ -266,7 +266,7 @@ func (r *DoctorWithdrawaService) PutDoctorWithdrawalExamine(req requests.PutDoct
|
||||
}
|
||||
|
||||
// PutDoctorWithdrawalPayment 确认打款
|
||||
func (r *DoctorWithdrawaService) PutDoctorWithdrawalPayment(withdrawalId, adminUserId int64) (bool, error) {
|
||||
func (r *DoctorWithdrawalService) PutDoctorWithdrawalPayment(withdrawalId, adminUserId int64) (bool, error) {
|
||||
doctorWithdrawalDao := dao.DoctorWithdrawalDao{}
|
||||
doctorWithdrawal, _ := doctorWithdrawalDao.GetDoctorWithdrawalById(withdrawalId)
|
||||
if doctorWithdrawal == nil {
|
||||
@@ -334,7 +334,7 @@ func (r *DoctorWithdrawaService) PutDoctorWithdrawalPayment(withdrawalId, adminU
|
||||
}
|
||||
|
||||
// 获取提现关联订单医生分成总金额
|
||||
func (r *DoctorWithdrawaService) getDoctorWithdrawalOrderAmountTotal(withdrawalId int64) (float64, error) {
|
||||
func (r *DoctorWithdrawalService) getDoctorWithdrawalOrderAmountTotal(withdrawalId int64) (float64, error) {
|
||||
// 获取医生提现-关联订单数据
|
||||
doctorWithdrawalOrderDao := dao.DoctorWithdrawalOrderDao{}
|
||||
doctorWithdrawalOrders, err := doctorWithdrawalOrderDao.GetDoctorWithdrawalOrderByWithdrawalId(withdrawalId)
|
||||
Reference in New Issue
Block a user