医生账户-导出
This commit is contained in:
@@ -3,6 +3,7 @@ package controller
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"hospital-admin-api/api/dao"
|
||||
"hospital-admin-api/api/dto"
|
||||
"hospital-admin-api/api/requests"
|
||||
"hospital-admin-api/api/responses"
|
||||
"hospital-admin-api/api/service"
|
||||
@@ -37,19 +38,31 @@ func (r *DoctorAccount) GetDoctorAccountPage(c *gin.Context) {
|
||||
}
|
||||
|
||||
doctorAccountDao := dao.DoctorAccountDao{}
|
||||
doctorAccount, total, err := doctorAccountDao.GetDoctorAccountPage(req, req.Page, req.PageSize)
|
||||
doctorAccounts, total, err := doctorAccountDao.GetDoctorAccountPage(req, req.Page, req.PageSize)
|
||||
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 业务处理
|
||||
doctorAccountService := service.DoctorAccountService{}
|
||||
res, err := doctorAccountService.GetDoctorAccountPage(doctorAccount)
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
// 处理返回值
|
||||
res := dto.GetDoctorAccountListDto(doctorAccounts)
|
||||
|
||||
for _, v := range res {
|
||||
// 将 id 转换为 int64 类型
|
||||
doctorId, err := strconv.ParseInt(v.DoctorId, 10, 64)
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
userDoctorService := service.UserDoctorService{}
|
||||
|
||||
// 获取医生已完成待入账金额
|
||||
v.CompletedWaitEntryAmount, _ = userDoctorService.GetDoctorCompletedWaitEntryAmount(doctorId)
|
||||
|
||||
// 获取医生今日预计收入
|
||||
v.EstimateIncome, _ = userDoctorService.GetDoctorEstimateIncome(doctorId)
|
||||
}
|
||||
|
||||
result := make(map[string]interface{})
|
||||
|
||||
Reference in New Issue
Block a user