增加导出
This commit is contained in:
@@ -14,6 +14,7 @@ type Api struct {
|
||||
inquiryManage // 问诊管理
|
||||
caManage // ca管理
|
||||
financeManage // 财务管理
|
||||
exportManage // 导出管理
|
||||
}
|
||||
|
||||
// SysSetting 系统设置
|
||||
@@ -78,3 +79,8 @@ type caManage struct {
|
||||
type financeManage struct {
|
||||
DoctorWithdrawal // 提现记录
|
||||
}
|
||||
|
||||
// 导出管理
|
||||
type exportManage struct {
|
||||
Export
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gin-gonic/gin"
|
||||
"hospital-admin-api/api/dao"
|
||||
"hospital-admin-api/api/requests"
|
||||
"hospital-admin-api/api/responses"
|
||||
"hospital-admin-api/global"
|
||||
"hospital-admin-api/utils"
|
||||
)
|
||||
|
||||
// Export 导出
|
||||
type Export struct{}
|
||||
|
||||
// DoctorWithdrawal 提现记录
|
||||
func (r *Export) DoctorWithdrawal(c *gin.Context) {
|
||||
doctorWithdrawalRequest := requests.DoctorWithdrawalRequest{}
|
||||
req := doctorWithdrawalRequest.DoctorWithdrawalExportList
|
||||
if err := c.ShouldBind(&req); err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 参数验证
|
||||
if err := global.Validate.Struct(req); err != nil {
|
||||
responses.FailWithMessage(utils.Translate(err), c)
|
||||
return
|
||||
}
|
||||
|
||||
if req.Page == 0 {
|
||||
req.Page = 1
|
||||
}
|
||||
|
||||
if req.PageSize == 0 {
|
||||
req.PageSize = 20
|
||||
}
|
||||
|
||||
doctorWithdrawalDao := dao.DoctorWithdrawalDao{}
|
||||
doctorWithdrawal, total, err := doctorWithdrawalDao.GetDoctorWithdrawalExportListSearch(req, req.Page, req.PageSize)
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(doctorWithdrawal)
|
||||
fmt.Println(total)
|
||||
|
||||
header := []utils.CellData{
|
||||
{Value: "医生姓名", CellType: "string", NumberFmt: "", ColWidth: 18},
|
||||
{Value: "医生手机号", CellType: "string", NumberFmt: "", ColWidth: 18},
|
||||
{Value: "申请提现金额", CellType: "float", NumberFmt: "0.0000", ColWidth: 18},
|
||||
{Value: "审核日期", CellType: "date", NumberFmt: "yyyy-mm-dd hh:mm:ss", ColWidth: 30},
|
||||
}
|
||||
|
||||
_, err = utils.Export(header)
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 处理返回值
|
||||
// res := dto.GetDoctorWithdrawalListDto(doctorWithdrawal)
|
||||
//
|
||||
// result := make(map[string]interface{})
|
||||
// result["page"] = req.Page
|
||||
// result["page_size"] = req.PageSize
|
||||
// result["total"] = total
|
||||
// result["data"] = res
|
||||
responses.Ok(c)
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package requests
|
||||
|
||||
type ExportRequest struct {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
// ExportService 导出
|
||||
type ExportService struct {
|
||||
}
|
||||
|
||||
// DoctorWithdrawal 提现记录
|
||||
func (r *ExportService) DoctorWithdrawal([]*model.DoctorWithdrawal) (string, error) {
|
||||
|
||||
return "", nil
|
||||
}
|
||||
Reference in New Issue
Block a user