新增审核-医生列表-详情
This commit is contained in:
parent
8b0589af51
commit
54feddd429
45
api/controller/area.go
Normal file
45
api/controller/area.go
Normal file
@ -0,0 +1,45 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"hospital-admin-api/api/dao"
|
||||
"hospital-admin-api/api/requests"
|
||||
"hospital-admin-api/api/responses"
|
||||
"hospital-admin-api/api/responses/areaResponse"
|
||||
"hospital-admin-api/global"
|
||||
"hospital-admin-api/utils"
|
||||
)
|
||||
|
||||
type Area struct{}
|
||||
|
||||
// GetAreaList 获取地区列表
|
||||
func (b *Area) GetAreaList(c *gin.Context) {
|
||||
req := requests.AreaRequest{}
|
||||
if err := c.ShouldBind(&req.GetAreaList); err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 参数验证
|
||||
if err := global.Validate.Struct(req.GetAreaList); err != nil {
|
||||
responses.FailWithMessage(utils.Translate(err), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 处理参数
|
||||
if req.ParentId == "" && req.AreaId == "" && req.AreaName == "" {
|
||||
req.ParentId = "1"
|
||||
req.AreaType = 2
|
||||
}
|
||||
|
||||
areaDao := dao.AreaDao{}
|
||||
area, err := areaDao.GetAreaListByStruct(req.GetAreaList)
|
||||
if err != nil {
|
||||
responses.Ok(c)
|
||||
return
|
||||
}
|
||||
|
||||
// 处理返回值
|
||||
r := areaResponse.GetAreaListResponse(area)
|
||||
responses.OkWithData(r, c)
|
||||
}
|
||||
@ -29,4 +29,5 @@ type basic struct {
|
||||
Hospital // 医院管理
|
||||
DiseaseClassExpertise // 专长管理
|
||||
Bank // 银行管理
|
||||
Area // 省市区管理
|
||||
}
|
||||
|
||||
@ -219,3 +219,41 @@ func (r *UserDoctor) GetUserDoctorPending(c *gin.Context) {
|
||||
|
||||
responses.OkWithData(g, c)
|
||||
}
|
||||
|
||||
// PutUserDoctorPending 审核-审核医生
|
||||
func (r *UserDoctor) PutUserDoctorPending(c *gin.Context) {
|
||||
userDoctorRequest := requests.UserDoctorRequest{}
|
||||
if err := c.ShouldBindJSON(&userDoctorRequest.PutUserDoctor); err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 参数验证
|
||||
if err := global.Validate.Struct(userDoctorRequest.PutUserDoctor); err != nil {
|
||||
responses.FailWithMessage(utils.Translate(err), c)
|
||||
return
|
||||
}
|
||||
|
||||
id := c.Param("doctor_id")
|
||||
if id == "" {
|
||||
responses.FailWithMessage("缺少参数", c)
|
||||
return
|
||||
}
|
||||
|
||||
// 将 id 转换为 int64 类型
|
||||
doctorId, err := strconv.ParseInt(id, 10, 64)
|
||||
if err != nil {
|
||||
responses.Fail(c)
|
||||
return
|
||||
}
|
||||
|
||||
// 业务处理
|
||||
userDoctorService := service.UserDoctorService{}
|
||||
_, err = userDoctorService.PutUserDoctor(doctorId, userDoctorRequest.PutUserDoctor)
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
responses.Ok(c)
|
||||
}
|
||||
|
||||
100
api/dao/area.go
Normal file
100
api/dao/area.go
Normal file
@ -0,0 +1,100 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/api/requests"
|
||||
"hospital-admin-api/global"
|
||||
)
|
||||
|
||||
type AreaDao struct {
|
||||
}
|
||||
|
||||
// GetAreaById 获取地区-地区id
|
||||
func (r *AreaDao) GetAreaById(areaId int64) (m *model.Area, err error) {
|
||||
err = global.Db.First(&m, areaId).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// DeleteArea 删除地区
|
||||
func (r *AreaDao) DeleteArea(tx *gorm.DB, maps interface{}) error {
|
||||
err := tx.Where(maps).Delete(&model.Area{}).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// EditArea 修改地区
|
||||
func (r *AreaDao) EditArea(tx *gorm.DB, maps interface{}, data interface{}) error {
|
||||
err := tx.Model(&model.Area{}).Where(maps).Updates(data).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// EditAreaById 修改地区-医生id
|
||||
func (r *AreaDao) EditAreaById(tx *gorm.DB, areaId int64, data interface{}) error {
|
||||
err := tx.Model(&model.Area{}).Where("area_id = ?", areaId).Updates(data).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetAreaList 获取地区列表
|
||||
func (r *AreaDao) GetAreaList(maps interface{}) (m []*model.Area, err error) {
|
||||
err = global.Db.Where(maps).Find(&m).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// AddArea 新增地区
|
||||
func (r *AreaDao) AddArea(tx *gorm.DB, model *model.Area) (*model.Area, error) {
|
||||
if err := tx.Create(model).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return model, nil
|
||||
}
|
||||
|
||||
// AddAreaByMap 新增地区-map
|
||||
func (r *AreaDao) AddAreaByMap(tx *gorm.DB, data map[string]interface{}) (*model.Area, error) {
|
||||
userDoctorInfo := &model.Area{}
|
||||
if err := tx.Model(&model.Area{}).Create(data).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return userDoctorInfo, nil
|
||||
}
|
||||
|
||||
// GetAreaListByStruct 获取地区列表
|
||||
func (r *AreaDao) GetAreaListByStruct(request requests.GetAreaList) (m []*model.Area, err error) {
|
||||
result := global.Db
|
||||
|
||||
if request.AreaId != "" {
|
||||
result = result.Where("area_id = ?", request.AreaId)
|
||||
}
|
||||
|
||||
if request.AreaName != "" {
|
||||
result = result.Where("area_name like ?", "%"+request.AreaName+"%")
|
||||
}
|
||||
|
||||
if request.ParentId != "" {
|
||||
result = result.Where("parent_id = ?", request.ParentId)
|
||||
}
|
||||
|
||||
if request.AreaType != 0 {
|
||||
result = result.Where("area_type = ?", request.AreaType)
|
||||
}
|
||||
|
||||
err = result.Find(&m).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
@ -37,7 +37,7 @@ func (r *BasicBankDao) EditBasicBank(tx *gorm.DB, maps interface{}, data interfa
|
||||
return nil
|
||||
}
|
||||
|
||||
// EditBasicBankById 修改专长-医生id
|
||||
// EditBasicBankById 修改专长-银行id
|
||||
func (r *BasicBankDao) EditBasicBankById(tx *gorm.DB, bankId int64, data interface{}) error {
|
||||
err := tx.Model(&model.BasicBank{}).Where("bank_id = ?", bankId).Updates(data).Error
|
||||
if err != nil {
|
||||
|
||||
101
api/dao/doctorIdenFail.go
Normal file
101
api/dao/doctorIdenFail.go
Normal file
@ -0,0 +1,101 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/api/requests"
|
||||
"hospital-admin-api/global"
|
||||
)
|
||||
|
||||
type DoctorIdenFailDao struct {
|
||||
}
|
||||
|
||||
// GetDoctorIdenFailByDoctorId 获取失败原因-医生id
|
||||
func (r *DoctorIdenFailDao) GetDoctorIdenFailByDoctorId(doctorId int64) (m *model.DoctorIdenFail, err error) {
|
||||
err = global.Db.Where("doctor_id = ?", doctorId).First(&m).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// GetDoctorIdenFailListByDoctorId 获取失败原因列表-医生id
|
||||
func (r *DoctorIdenFailDao) GetDoctorIdenFailListByDoctorId(doctorId int64) (m []*model.DoctorIdenFail, err error) {
|
||||
err = global.Db.Where("doctor_id = ?", doctorId).Find(&m).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// DeleteDoctorIdenFail 删除失败原因
|
||||
func (r *DoctorIdenFailDao) DeleteDoctorIdenFail(tx *gorm.DB, maps interface{}) error {
|
||||
err := tx.Where(maps).Delete(&model.DoctorIdenFail{}).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// EditDoctorIdenFail 修改失败原因
|
||||
func (r *DoctorIdenFailDao) EditDoctorIdenFail(tx *gorm.DB, maps interface{}, data interface{}) error {
|
||||
err := tx.Model(&model.DoctorIdenFail{}).Where(maps).Updates(data).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// EditDoctorIdenFailById 修改失败原因-医生id
|
||||
func (r *DoctorIdenFailDao) EditDoctorIdenFailById(tx *gorm.DB, bankId int64, data interface{}) error {
|
||||
err := tx.Model(&model.DoctorIdenFail{}).Where("bank_id = ?", bankId).Updates(data).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetDoctorIdenFailList 获取失败原因列表
|
||||
func (r *DoctorIdenFailDao) GetDoctorIdenFailList(maps interface{}) (m []*model.DoctorIdenFail, err error) {
|
||||
err = global.Db.Where(maps).Find(&m).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// AddDoctorIdenFail 新增失败原因
|
||||
func (r *DoctorIdenFailDao) AddDoctorIdenFail(tx *gorm.DB, model *model.DoctorIdenFail) (*model.DoctorIdenFail, error) {
|
||||
if err := tx.Create(model).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return model, nil
|
||||
}
|
||||
|
||||
// AddDoctorIdenFailByMap 新增失败原因-map
|
||||
func (r *DoctorIdenFailDao) AddDoctorIdenFailByMap(tx *gorm.DB, data map[string]interface{}) (*model.DoctorIdenFail, error) {
|
||||
userDoctorInfo := &model.DoctorIdenFail{}
|
||||
if err := tx.Model(&model.DoctorIdenFail{}).Create(data).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return userDoctorInfo, nil
|
||||
}
|
||||
|
||||
// GetDoctorIdenFailListByStruct 获取失败原因列表
|
||||
func (r *DoctorIdenFailDao) GetDoctorIdenFailListByStruct(bankRequest requests.GetBankList) (m []*model.DoctorIdenFail, err error) {
|
||||
result := global.Db
|
||||
|
||||
if bankRequest.BankCode != "" {
|
||||
result = result.Where("bank_code = ?", bankRequest.BankCode)
|
||||
}
|
||||
|
||||
if bankRequest.BankName != "" {
|
||||
result = result.Where("bank_name like ?", "%"+bankRequest.BankName+"%")
|
||||
}
|
||||
|
||||
err = result.Find(&m).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
14
api/model/area.go
Normal file
14
api/model/area.go
Normal file
@ -0,0 +1,14 @@
|
||||
package model
|
||||
|
||||
// Area 地区表
|
||||
type Area struct {
|
||||
AreaId int64 `gorm:"column:area_id;type:bigint(19);primary_key;comment:地区编号" json:"area_id"`
|
||||
AreaName string `gorm:"column:area_name;type:varchar(255);comment:名称" json:"area_name"`
|
||||
ParentId int64 `gorm:"column:parent_id;type:bigint(19);comment:上级编号" json:"parent_id"`
|
||||
Zip string `gorm:"column:zip;type:varchar(10);comment:邮编" json:"zip"`
|
||||
AreaType int `gorm:"column:area_type;type:tinyint(4);comment:类型(1:国家,2:省,3:市,4:区县)" json:"area_type"`
|
||||
}
|
||||
|
||||
func (m *Area) TableName() string {
|
||||
return "gdxz_area"
|
||||
}
|
||||
17
api/model/doctorIdenFail.go
Normal file
17
api/model/doctorIdenFail.go
Normal file
@ -0,0 +1,17 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// DoctorIdenFail 医生身份审核失败原因表
|
||||
type DoctorIdenFail struct {
|
||||
IdenFailId int64 `gorm:"column:iden_fail_id;type:bigint(19);primary_key;comment:主键id" json:"iden_fail_id"`
|
||||
DoctorId int64 `gorm:"column:doctor_id;type:bigint(19);comment:医生id" json:"doctor_id"`
|
||||
FieldName string `gorm:"column:field_name;type:varchar(50);comment:字段名称" json:"field_name"`
|
||||
FailReason string `gorm:"column:fail_reason;type:varchar(255);comment:失败原因" json:"fail_reason"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;type:datetime;comment:创建时间" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;type:datetime;comment:修改时间" json:"updated_at"`
|
||||
}
|
||||
|
||||
func (m *DoctorIdenFail) TableName() string {
|
||||
return "gdxz_doctor_iden_fail"
|
||||
}
|
||||
13
api/requests/area.go
Normal file
13
api/requests/area.go
Normal file
@ -0,0 +1,13 @@
|
||||
package requests
|
||||
|
||||
type AreaRequest struct {
|
||||
GetAreaList // 获取地区列表
|
||||
}
|
||||
|
||||
// GetAreaList 获取地区列表
|
||||
type GetAreaList struct {
|
||||
AreaId string `json:"area_id" form:"area_id" label:"地区编号"`
|
||||
AreaName string `json:"area_name" form:"area_name" label:"名称"`
|
||||
ParentId string `json:"parent_id" form:"parent_id" label:"上级编号"`
|
||||
AreaType int `json:"area_type" form:"area_type" label:"类型(1:国家,2:省,3:市,4:区县)"`
|
||||
}
|
||||
@ -84,3 +84,16 @@ type GetUserDoctorPendingPage struct {
|
||||
HospitalName string `json:"hospital_name" form:"hospital_name" label:"医院名称"`
|
||||
IdenAuthStatus int `json:"iden_auth_status" form:"iden_auth_status" label:"认证状态"` // (0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
}
|
||||
|
||||
// PutUserDoctorPending 审核-审核医生
|
||||
type PutUserDoctorPending struct {
|
||||
IdenAuthStatus int `json:"iden_auth_status" form:"iden_auth_status" label:"认证状态"` // (0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
AvatarReason string `json:"avatar_reason" form:"avatar_reason" label:"头像失败原因"`
|
||||
DepartmentCustomMobileReason string `json:"department_custom_mobile_reason" form:"department_custom_mobile_reason" label:"科室电话失败原因"`
|
||||
DepartmentCustomNameReason string `json:"department_custom_name_reason" form:"department_custom_name_reason" label:"科室名称失败原因"`
|
||||
BriefIntroductionReason string `json:"brief_introduction_reason" form:"brief_introduction_reason" label:"医生简介失败原因"`
|
||||
BeGoodAtReason string `json:"be_good_at_reason" form:"be_good_at_reason" label:"擅长失败原因"`
|
||||
LicenseCertReason string `json:"license_cert_reason" form:"license_cert_reason" label:"医师执业证失败原因"`
|
||||
QualificationCertReason string `json:"qualification_cert_reason" form:"qualification_cert_reason" label:"医师资格证失败原因"`
|
||||
WorkCertReason string `json:"work_cert_reason" form:"work_cert_reason" label:"医师工作证失败原因"`
|
||||
}
|
||||
|
||||
49
api/responses/areaResponse/area.go
Normal file
49
api/responses/areaResponse/area.go
Normal file
@ -0,0 +1,49 @@
|
||||
package areaResponse
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/model"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type Area struct {
|
||||
AreaId string `json:"area_id"` // 地区编号
|
||||
AreaName string `json:"area_name"` // 名称
|
||||
ParentId string `json:"parent_id"` // 上级编号
|
||||
Zip string `json:"zip"` // 邮编
|
||||
AreaType int `json:"area_type"` // 类型(1:国家,2:省,3:市,4:区县)
|
||||
}
|
||||
|
||||
// AreaResponse 地区详情
|
||||
func AreaResponse(area *model.Area) *Area {
|
||||
return &Area{
|
||||
AreaId: strconv.FormatInt(area.AreaId, 10),
|
||||
AreaName: area.AreaName,
|
||||
ParentId: strconv.FormatInt(area.ParentId, 10),
|
||||
Zip: area.Zip,
|
||||
AreaType: area.AreaType,
|
||||
}
|
||||
}
|
||||
|
||||
// GetAreaListResponse 获取银行列表
|
||||
func GetAreaListResponse(area []*model.Area) []Area {
|
||||
// 处理返回值
|
||||
r := make([]Area, len(area))
|
||||
|
||||
if len(area) > 0 {
|
||||
for i, v := range area {
|
||||
// 将原始结构体转换为新结构体
|
||||
l := Area{
|
||||
AreaId: strconv.FormatInt(v.AreaId, 10),
|
||||
AreaName: v.AreaName,
|
||||
ParentId: strconv.FormatInt(v.ParentId, 10),
|
||||
Zip: v.Zip,
|
||||
AreaType: v.AreaType,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
r[i] = l
|
||||
}
|
||||
}
|
||||
|
||||
return r
|
||||
}
|
||||
@ -7,13 +7,13 @@ import (
|
||||
)
|
||||
|
||||
type BasicBank struct {
|
||||
BankId string `json:"bank_id"` // 主键
|
||||
BankCode string `gorm:"column:bank_code;type:varchar(255);comment:银行编码" json:"bank_code"` // 银行编码
|
||||
BankName string `gorm:"column:bank_name;type:varchar(50);comment:银行名称" json:"bank_name"` // 银行名称
|
||||
BankIconPath string `gorm:"column:bank_icon_path;type:varchar(255);comment:银行图标地址" json:"bank_icon_path"` // 银行图标地址
|
||||
BankImgPath string `gorm:"column:bank_img_path;type:varchar(255);comment:银行图片地址" json:"bank_img_path"` // 银行图片地址
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
BankId string `json:"bank_id"` // 主键
|
||||
BankCode string `json:"bank_code"` // 银行编码
|
||||
BankName string `json:"bank_name"` // 银行名称
|
||||
BankIconPath string `json:"bank_icon_path"` // 银行图标地址
|
||||
BankImgPath string `json:"bank_img_path"` // 银行图片地址
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
// BasicBankResponse 银行详情
|
||||
|
||||
@ -124,7 +124,7 @@ type GetUserDoctorPending struct {
|
||||
IDCardStatus int `json:"idcard_status"` // 实名认证状态(0:未认证 1:认证通过 2:认证失败)
|
||||
IdenAuthStatus int `json:"iden_auth_status"` // 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
IdenAuthTime model.LocalTime `json:"iden_auth_time"` // 审核时间
|
||||
IdenAuthFailReason string `json:"iden_auth_fail_reason"` // 身份认证失败原因
|
||||
IdenAuthFailReason *IdenAuthFailReason `json:"iden_auth_fail_reason"` // 身份认证失败原因
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
DoctorTitle int `json:"doctor_title"` // 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
|
||||
DepartmentCustomID string `json:"department_custom_id"` // 科室id-自定义
|
||||
@ -141,6 +141,18 @@ type GetUserDoctorPending struct {
|
||||
DoctorExpertise []*doctorExpertiseResponse.DoctorExpertise `json:"doctor_expertise"` // 医生专长
|
||||
}
|
||||
|
||||
// IdenAuthFailReason 身份认证失败原因
|
||||
type IdenAuthFailReason struct {
|
||||
AvatarReason string `json:"avatar_reason"` // 头像失败原因
|
||||
DepartmentCustomMobileReason string `json:"department_custom_mobile_reason"` // 科室电话失败原因
|
||||
DepartmentCustomNameReason string `json:"department_custom_name_reason"` // 科室名称失败原因
|
||||
BriefIntroductionReason string `json:"brief_introduction_reason"` // 医生简介失败原因
|
||||
BeGoodAtReason string `json:"be_good_at_reason"` // 医生简介失败原因
|
||||
LicenseCertReason string `json:"license_cert_reason"` // 医师执业证失败原因
|
||||
QualificationCertReason string `json:"qualification_cert_reason"` // 医师资格证失败原因
|
||||
WorkCertReason string `json:"work_cert_reason"` // 医师工作证失败原因
|
||||
}
|
||||
|
||||
// GetUserDoctorPageResponse 获取用户列表-分页
|
||||
func GetUserDoctorPageResponse(userDoctor []*model.UserDoctor) []getUserDoctorPage {
|
||||
// 处理返回值
|
||||
|
||||
@ -143,19 +143,19 @@ func basicRouter(r *gin.Engine, api controller.Api) {
|
||||
// 新增银行
|
||||
}
|
||||
|
||||
// 省市区管理-基础数据
|
||||
// 地区管理-基础数据
|
||||
areaGroup := basicGroup.Group("/area")
|
||||
{
|
||||
// 获取省市区列表
|
||||
areaGroup.GET("/list", api.Bank.GetBankList)
|
||||
// 获取地区列表
|
||||
areaGroup.GET("/list", api.Area.GetAreaList)
|
||||
|
||||
// 获取银行列表-分页
|
||||
// 获取地区列表-分页
|
||||
|
||||
// 银行详情
|
||||
// 地区详情
|
||||
|
||||
// 修改银行
|
||||
// 修改地区
|
||||
|
||||
// 新增银行
|
||||
// 新增地区
|
||||
}
|
||||
}
|
||||
|
||||
@ -325,12 +325,8 @@ func privateRouter(r *gin.Engine, api controller.Api) {
|
||||
// 审核-医生详情
|
||||
doctorPendingGroup.GET("/:doctor_id", api.UserDoctor.GetUserDoctorPending)
|
||||
|
||||
// 修改医生
|
||||
doctorPendingGroup.PUT("/:doctor_id", api.UserDoctor.PutUserDoctor)
|
||||
|
||||
// 新增医生
|
||||
doctorPendingGroup.POST("", api.UserDoctor.AddUserDoctor)
|
||||
|
||||
// 审核-审核医生
|
||||
doctorPendingGroup.PUT("/:doctor_id", api.UserDoctor.PutUserDoctorPending)
|
||||
}
|
||||
//
|
||||
// // 医生详情
|
||||
|
||||
@ -856,7 +856,45 @@ func (r *UserDoctorService) GetUserDoctorBankByDoctorId(doctorId int64) (*doctor
|
||||
return doctorExpertisesResponse, nil
|
||||
}
|
||||
|
||||
// GetUserDoctorPending 医生详情-审核
|
||||
// GetDoctorIdenFailReasonByDoctorId 获取医生审核失败原因
|
||||
func (r *UserDoctorService) GetDoctorIdenFailReasonByDoctorId(doctorId int64) (*userDoctorResponse.IdenAuthFailReason, error) {
|
||||
doctorIdenFailDao := dao.DoctorIdenFailDao{}
|
||||
doctorIdenFail, err := doctorIdenFailDao.GetDoctorIdenFailListByDoctorId(doctorId)
|
||||
if err != nil {
|
||||
return nil, errors.New("审核失败原因数据错误")
|
||||
}
|
||||
|
||||
var idenAuthFailReason userDoctorResponse.IdenAuthFailReason
|
||||
|
||||
if doctorIdenFail != nil {
|
||||
for _, v := range doctorIdenFail {
|
||||
switch v.FieldName {
|
||||
case "avatar":
|
||||
idenAuthFailReason.AvatarReason = v.FailReason
|
||||
case "department_custom_mobile":
|
||||
idenAuthFailReason.DepartmentCustomMobileReason = v.FailReason
|
||||
case "department_custom_name":
|
||||
idenAuthFailReason.DepartmentCustomNameReason = v.FailReason
|
||||
case "brief_introduction":
|
||||
idenAuthFailReason.BriefIntroductionReason = v.FailReason
|
||||
case "be_good_at":
|
||||
idenAuthFailReason.BeGoodAtReason = v.FailReason
|
||||
case "license_cert":
|
||||
idenAuthFailReason.LicenseCertReason = v.FailReason
|
||||
case "qualification_cert":
|
||||
idenAuthFailReason.QualificationCertReason = v.FailReason
|
||||
case "work_cert":
|
||||
idenAuthFailReason.WorkCertReason = v.FailReason
|
||||
default:
|
||||
return nil, errors.New("审核失败原因数据错误")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return &idenAuthFailReason, nil
|
||||
}
|
||||
|
||||
// GetUserDoctorPending 审核-医生详情
|
||||
func (r *UserDoctorService) GetUserDoctorPending(doctorId int64) (g *userDoctorResponse.GetUserDoctorPending, err error) {
|
||||
// 获取医生数据
|
||||
userDoctorDao := dao.UserDoctorDao{}
|
||||
@ -873,6 +911,14 @@ func (r *UserDoctorService) GetUserDoctorPending(doctorId int64) (g *userDoctorR
|
||||
return nil, errors.New(err.Error())
|
||||
}
|
||||
|
||||
// 获取医生审核失败原因
|
||||
var IdenAuthFailReason *userDoctorResponse.IdenAuthFailReason
|
||||
if userDoctor.IdenAuthStatus == 3 {
|
||||
IdenAuthFailReason, err = userDoctorService.GetDoctorIdenFailReasonByDoctorId(doctorId)
|
||||
if err != nil {
|
||||
return nil, errors.New(err.Error())
|
||||
}
|
||||
}
|
||||
// 处理返回值
|
||||
var userDoctorInfo *userDoctorInfoResponse.UserDoctorInfo
|
||||
if userDoctor.UserDoctorInfo != nil {
|
||||
@ -899,7 +945,7 @@ func (r *UserDoctorService) GetUserDoctorPending(doctorId int64) (g *userDoctorR
|
||||
IDCardStatus: userDoctor.Status,
|
||||
IdenAuthStatus: userDoctor.IdenAuthStatus,
|
||||
IdenAuthTime: userDoctor.IdenAuthTime,
|
||||
IdenAuthFailReason: userDoctor.IdenAuthFailReason,
|
||||
IdenAuthFailReason: IdenAuthFailReason,
|
||||
Avatar: config.C.Oss.OssCustomDomainName + userDoctor.Avatar,
|
||||
DoctorTitle: userDoctor.DoctorTitle,
|
||||
DepartmentCustomID: strconv.Itoa(int(userDoctor.DepartmentCustomId)),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user