修正返回目录
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package dto
|
||||
|
||||
import "hospital-admin-api/utils"
|
||||
|
||||
// Login 登陆
|
||||
type Login struct {
|
||||
UserId string `json:"user_id"` // 用户id
|
||||
NickName string `json:"nick_name"` // 昵称
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
Token string `json:"token"` // 用户名
|
||||
}
|
||||
|
||||
// GetLoginFullAvatar 返回带有指定字符串的头像路径
|
||||
func (l *Login) GetLoginFullAvatar() Login {
|
||||
l.Avatar = utils.AddOssDomain(l.Avatar)
|
||||
return Login{}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type AdminApiDto struct {
|
||||
APIID string `json:"api_id"` // 主键id
|
||||
APIName string `json:"api_name"` // api名称
|
||||
APIPath string `json:"api_path"` // 接口路径(全路径 id为:id)
|
||||
APIMethod string `json:"api_method"` // 请求类型
|
||||
IsAuth int `json:"is_auth"` // 是否验证权限(0:否 1:是)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetAdminApiDto(m *model.AdminAPI) *AdminApiDto {
|
||||
return &AdminApiDto{
|
||||
APIID: fmt.Sprintf("%d", m.APIID),
|
||||
APIName: m.APIName,
|
||||
APIPath: m.APIPath,
|
||||
APIMethod: m.APIMethod,
|
||||
IsAuth: m.IsAuth,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetAdminApiListDto(m []*model.AdminAPI) []AdminApiDto {
|
||||
// 处理返回值
|
||||
responses := make([]AdminApiDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := AdminApiDto{
|
||||
APIID: fmt.Sprintf("%d", v.APIID),
|
||||
APIName: v.APIName,
|
||||
APIPath: v.APIPath,
|
||||
APIMethod: v.APIMethod,
|
||||
IsAuth: v.IsAuth,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
// AdminDeptDto 部门详情
|
||||
type AdminDeptDto struct {
|
||||
DeptId string `json:"dept_id"`
|
||||
ParentId string `json:"parent_id"` // 父菜单ID(0表示一级)
|
||||
DeptName string `json:"dept_name"` // 部门名称
|
||||
DeptStatus int `json:"dept_status"` // 部门状态(1:正常 2:删除)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
Children []*AdminDeptDto `json:"children"` // 下级页面
|
||||
}
|
||||
|
||||
func GetAdminDeptDto(m *model.AdminDept) *AdminDeptDto {
|
||||
return &AdminDeptDto{
|
||||
DeptId: fmt.Sprintf("%d", m.DeptId),
|
||||
ParentId: fmt.Sprintf("%d", m.ParentId),
|
||||
DeptName: m.DeptName,
|
||||
DeptStatus: m.DeptStatus,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetAdminDeptListDto(m []*model.AdminDept) []AdminDeptDto {
|
||||
// 处理返回值
|
||||
responses := make([]AdminDeptDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := AdminDeptDto{
|
||||
DeptId: fmt.Sprintf("%d", v.DeptId),
|
||||
ParentId: fmt.Sprintf("%d", v.ParentId),
|
||||
DeptName: v.DeptName,
|
||||
DeptStatus: v.DeptStatus,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type AdminMenuDto struct {
|
||||
MenuId string `json:"menu_id"`
|
||||
MenuName string `json:"menu_name"` // 菜单名称
|
||||
MenuTitle string `json:"menu_title"` // 菜单名称
|
||||
ParentId string `json:"parent_id"` // 父菜单ID(0表示一级)
|
||||
MenuStatus int `json:"menu_status"` // 菜单状态(0:隐藏 1:正常)此优先级最高
|
||||
MenuType int `json:"menu_type"` // 菜单类型(1:模块 2:菜单 3:按钮)
|
||||
Permission string `json:"permission"` // 标识
|
||||
OrderNum int `json:"order_num"` // 显示顺序
|
||||
Icon string `json:"icon"` // 图标地址
|
||||
Path string `json:"path"` // 页面地址(#表示当前页)
|
||||
Component string `json:"component"` // 组件名称
|
||||
Api []*AdminMenuApiDto `json:"api"` // 接口数据
|
||||
Apis []string `json:"apis"` // 接口数据
|
||||
Children []*AdminMenuDto `json:"children"` // 下级页面
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetAdminMenuDto(m *model.AdminMenu) *AdminMenuDto {
|
||||
return &AdminMenuDto{
|
||||
MenuId: fmt.Sprintf("%d", m.MenuId),
|
||||
MenuName: m.MenuName,
|
||||
MenuTitle: m.MenuTitle,
|
||||
ParentId: fmt.Sprintf("%d", m.ParentId),
|
||||
MenuStatus: m.MenuStatus,
|
||||
MenuType: m.MenuType,
|
||||
Permission: m.Permission,
|
||||
OrderNum: m.OrderNum,
|
||||
Icon: m.Icon,
|
||||
Path: m.Path,
|
||||
Component: m.Component,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
// LoadAdminMenuApi 加载菜单api
|
||||
func (r *AdminMenuDto) LoadAdminMenuApi(m []*model.AdminMenuApi) *AdminMenuDto {
|
||||
if len(m) > 0 {
|
||||
r.Api = GetAdminMenuApiListDto(m)
|
||||
|
||||
apis := make([]string, 0, len(r.Api))
|
||||
|
||||
for _, v := range r.Api {
|
||||
apis = append(apis, v.ApiId)
|
||||
}
|
||||
|
||||
r.Apis = apis
|
||||
}
|
||||
return r
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type AdminMenuApiDto struct {
|
||||
ApiId string `json:"api_id"` // 接口id
|
||||
ApiName string `json:"api_name"` // 接口名称
|
||||
}
|
||||
|
||||
func GetAdminMenuApiDto(m *model.AdminMenuApi) *AdminMenuApiDto {
|
||||
return &AdminMenuApiDto{
|
||||
ApiId: fmt.Sprintf("%d", m.ApiId),
|
||||
ApiName: m.API.APIName,
|
||||
}
|
||||
}
|
||||
|
||||
func GetAdminMenuApiListDto(m []*model.AdminMenuApi) []*AdminMenuApiDto {
|
||||
// 处理返回值
|
||||
responses := make([]*AdminMenuApiDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := &AdminMenuApiDto{
|
||||
ApiId: fmt.Sprintf("%d", v.ApiId),
|
||||
ApiName: v.API.APIName,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type AdminPostDto struct {
|
||||
PostId string `json:"post_id"` // 主键id
|
||||
PostName string `json:"post_name"` // 岗位名称
|
||||
PostStatus int `json:"post_status"` // 岗位状态(1:正常 2:删除)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetAdminPostDto(m *model.AdminPost) *AdminPostDto {
|
||||
return &AdminPostDto{
|
||||
PostId: fmt.Sprintf("%d", m.PostId),
|
||||
PostName: m.PostName,
|
||||
PostStatus: m.PostStatus,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetAdminPostListDto(m []*model.AdminPost) []AdminPostDto {
|
||||
// 处理返回值
|
||||
responses := make([]AdminPostDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := AdminPostDto{
|
||||
PostId: fmt.Sprintf("%d", v.PostId),
|
||||
PostName: v.PostName,
|
||||
PostStatus: v.PostStatus,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// AdminRoleDto 角色详情
|
||||
type AdminRoleDto struct {
|
||||
RoleId string `json:"role_id"` // 角色id
|
||||
RoleName string `json:"role_name"` // 角色名称
|
||||
RoleStatus int `json:"role_status"` // 角色状态(1:正常 2:禁用)
|
||||
IsAdmin int `json:"is_admin"` // 是否管理员(0:否 1:是)
|
||||
MenuIds []string `json:"menu_ids"` // 菜单id
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetAdminRoleDto(m *model.AdminRole) *AdminRoleDto {
|
||||
return &AdminRoleDto{
|
||||
RoleId: fmt.Sprintf("%d", m.RoleId),
|
||||
RoleName: m.RoleName,
|
||||
RoleStatus: m.RoleStatus,
|
||||
IsAdmin: m.IsAdmin,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetAdminRoleListDto(m []*model.AdminRole) []AdminRoleDto {
|
||||
// 处理返回值
|
||||
responses := make([]AdminRoleDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := AdminRoleDto{
|
||||
RoleId: fmt.Sprintf("%d", v.RoleId),
|
||||
RoleName: v.RoleName,
|
||||
RoleStatus: v.RoleStatus,
|
||||
IsAdmin: v.IsAdmin,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
|
||||
// LoadRoleMenuIdsDto 加载角色菜单id
|
||||
func (m *AdminRoleDto) LoadRoleMenuIdsDto(menuIds []int64) *AdminRoleDto {
|
||||
var menuIdsString []string
|
||||
for _, menuId := range menuIds {
|
||||
menuId := strconv.FormatInt(menuId, 10)
|
||||
menuIdsString = append(menuIdsString, menuId)
|
||||
}
|
||||
|
||||
m.MenuIds = menuIdsString
|
||||
return m
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package dto
|
||||
|
||||
type AdminRoleMenuDto struct {
|
||||
MenuId string `json:"menu_id"` // 主键id
|
||||
MenuName string `json:"menu_name"` // 菜单名称
|
||||
MenuTitle string `json:"menu_title"` // 菜单名称
|
||||
ParentId string `json:"parent_id"` // 父菜单ID(0表示一级)
|
||||
MenuStatus int `json:"menu_status"` // 菜单状态(0:隐藏 1:正常)此优先级最高
|
||||
MenuType int `json:"menu_type"` // 菜单类型(1:模块 2:菜单 3:按钮)
|
||||
Permission string `json:"permission"` // 标识
|
||||
OrderNum int `json:"order_num"` // 显示顺序
|
||||
Icon string `json:"icon"` // 图标地址
|
||||
Path string `json:"path"` // 页面地址(#表示当前页)
|
||||
Component string `json:"component"` // 组件名称
|
||||
Children []*AdminRoleMenuDto `json:"children"` // 下级页面
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/utils"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type AdminUserDto struct {
|
||||
UserID string `json:"user_id"` // 主键id
|
||||
Access string `json:"access"` // 账号
|
||||
Status int `json:"status"` // 状态(1:正常 2:审核中 3:审核失败)
|
||||
IsDeleted int `json:"is_deleted"` // 是否被删除(0:否 1:是)
|
||||
IsDisabled int `json:"is_disabled"` // 是否被禁用(0:否 1:是)
|
||||
NickName string `json:"nick_name"` // 昵称
|
||||
Phone string `json:"phone"` // 手机号
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
Sex int `json:"sex"` // 性别(1:男 2:女)
|
||||
Email string `json:"email"` // 邮箱
|
||||
RoleID string `json:"role_id"` // 角色id
|
||||
DeptID string `json:"dept_id"` // 部门id
|
||||
PostID string `json:"post_id"` // 岗位id
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
AdminRole *AdminRoleDto `json:"role"` // 角色
|
||||
AdminDept *AdminDeptDto `json:"dept"` // 部门
|
||||
AdminPost *AdminPostDto `json:"post"` // 岗位
|
||||
}
|
||||
|
||||
func GetAdminUserDto(m *model.AdminUser) *AdminUserDto {
|
||||
return &AdminUserDto{
|
||||
UserID: fmt.Sprintf("%d", m.UserID),
|
||||
Access: m.Access,
|
||||
Status: m.Status,
|
||||
IsDeleted: m.IsDeleted,
|
||||
IsDisabled: m.IsDisabled,
|
||||
NickName: m.NickName,
|
||||
Phone: m.Phone,
|
||||
Avatar: utils.AddOssDomain(m.Avatar),
|
||||
Sex: m.Sex,
|
||||
Email: m.Email,
|
||||
RoleID: fmt.Sprintf("%d", m.RoleID),
|
||||
DeptID: fmt.Sprintf("%d", m.DeptID),
|
||||
PostID: fmt.Sprintf("%d", m.PostID),
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetAdminUserListDto(m []*model.AdminUser) []*AdminUserDto {
|
||||
// 处理返回值
|
||||
responses := make([]*AdminUserDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := &AdminUserDto{
|
||||
UserID: fmt.Sprintf("%d", v.UserID),
|
||||
Access: v.Access,
|
||||
Status: v.Status,
|
||||
IsDeleted: v.IsDeleted,
|
||||
IsDisabled: v.IsDisabled,
|
||||
NickName: v.NickName,
|
||||
Phone: v.Phone,
|
||||
Avatar: utils.AddOssDomain(v.Avatar),
|
||||
Sex: v.Sex,
|
||||
Email: v.Email,
|
||||
RoleID: fmt.Sprintf("%d", v.RoleID),
|
||||
DeptID: fmt.Sprintf("%d", v.DeptID),
|
||||
PostID: fmt.Sprintf("%d", v.PostID),
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 角色
|
||||
if v.Role != nil {
|
||||
response = response.LoadAdminRole(v.Role)
|
||||
}
|
||||
|
||||
// 部门
|
||||
if v.Dept != nil {
|
||||
response = response.LoadAdminDept(v.Dept)
|
||||
}
|
||||
|
||||
// 岗位
|
||||
if v.Post != nil {
|
||||
response = response.LoadAdminPost(v.Post)
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
|
||||
// LoadAdminRole 角色
|
||||
func (r *AdminUserDto) LoadAdminRole(m *model.AdminRole) *AdminUserDto {
|
||||
if m != nil {
|
||||
adminRoleDto := &AdminRoleDto{
|
||||
RoleId: strconv.FormatInt(m.RoleId, 10),
|
||||
RoleName: m.RoleName,
|
||||
}
|
||||
|
||||
r.AdminRole = adminRoleDto
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadAdminDept 部门
|
||||
func (r *AdminUserDto) LoadAdminDept(m *model.AdminDept) *AdminUserDto {
|
||||
if m != nil {
|
||||
adminDeptDto := &AdminDeptDto{
|
||||
DeptId: fmt.Sprintf("%d", m.DeptId), // 部门id
|
||||
DeptName: m.DeptName, // 部门名称
|
||||
}
|
||||
|
||||
r.AdminDept = adminDeptDto
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadAdminPost 岗位
|
||||
func (r *AdminUserDto) LoadAdminPost(m *model.AdminPost) *AdminUserDto {
|
||||
if m != nil {
|
||||
adminPostDto := &AdminPostDto{
|
||||
PostId: fmt.Sprintf("%d", m.PostId),
|
||||
PostName: m.PostName,
|
||||
}
|
||||
|
||||
r.AdminPost = adminPostDto
|
||||
}
|
||||
return r
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type AreaDto 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:区县)
|
||||
}
|
||||
|
||||
func GetAreaDto(m *model.Area) *AreaDto {
|
||||
return &AreaDto{
|
||||
AreaId: fmt.Sprintf("%d", m.AreaId),
|
||||
AreaName: m.AreaName,
|
||||
ParentId: fmt.Sprintf("%d", m.ParentId),
|
||||
Zip: m.Zip,
|
||||
AreaType: m.AreaType,
|
||||
}
|
||||
}
|
||||
|
||||
func GetAreaListDto(m []*model.Area) []AreaDto {
|
||||
// 处理返回值
|
||||
responses := make([]AreaDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := AreaDto{
|
||||
AreaId: fmt.Sprintf("%d", v.AreaId),
|
||||
AreaName: v.AreaName,
|
||||
ParentId: fmt.Sprintf("%d", v.ParentId),
|
||||
Zip: v.Zip,
|
||||
AreaType: v.AreaType,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/utils"
|
||||
)
|
||||
|
||||
type BasicBankDto struct {
|
||||
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"` // 修改时间
|
||||
}
|
||||
|
||||
func GetBasicBankDto(m *model.BasicBank) *BasicBankDto {
|
||||
return &BasicBankDto{
|
||||
BankId: fmt.Sprintf("%d", m.BankId),
|
||||
BankCode: m.BankCode,
|
||||
BankName: m.BankName,
|
||||
BankIconPath: utils.AddOssDomain(m.BankIconPath),
|
||||
BankImgPath: utils.AddOssDomain(m.BankImgPath),
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetBasicBankListDto(m []*model.BasicBank) []BasicBankDto {
|
||||
// 处理返回值
|
||||
responses := make([]BasicBankDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := BasicBankDto{
|
||||
BankId: fmt.Sprintf("%d", v.BankId),
|
||||
BankCode: v.BankCode,
|
||||
BankName: v.BankName,
|
||||
BankIconPath: utils.AddOssDomain(v.BankIconPath),
|
||||
BankImgPath: utils.AddOssDomain(v.BankImgPath),
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type DiseaseClassExpertiseDto struct {
|
||||
ExpertiseId string `json:"expertise_id"` // 主键
|
||||
ExpertiseName string `json:"expertise_name"` // 专长名称
|
||||
ExpertiseSort int `json:"expertise_sort"` // 排序(越大排序越靠前)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetDiseaseClassExpertiseDto(m *model.DiseaseClassExpertise) *DiseaseClassExpertiseDto {
|
||||
return &DiseaseClassExpertiseDto{
|
||||
ExpertiseId: fmt.Sprintf("%d", m.ExpertiseId),
|
||||
ExpertiseName: m.ExpertiseName,
|
||||
ExpertiseSort: m.ExpertiseSort,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetDiseaseClassExpertiseListDto(m []*model.DiseaseClassExpertise) []DiseaseClassExpertiseDto {
|
||||
// 处理返回值
|
||||
responses := make([]DiseaseClassExpertiseDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := DiseaseClassExpertiseDto{
|
||||
ExpertiseId: fmt.Sprintf("%d", v.ExpertiseId),
|
||||
ExpertiseName: v.ExpertiseName,
|
||||
ExpertiseSort: v.ExpertiseSort,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type DoctorBankCardDto struct {
|
||||
BankCardId string `json:"bank_card_id"` // 主键id
|
||||
DoctorId string `json:"doctor_id"` // 医生id
|
||||
BankId string `json:"bank_id"` // 银行id
|
||||
BankCardCodeMask string `json:"bank_card_code_mask"` // 银行卡号(掩码)
|
||||
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"` // 区县
|
||||
}
|
||||
|
||||
func GetDoctorBankCardDto(m *model.DoctorBankCard) *DoctorBankCardDto {
|
||||
return &DoctorBankCardDto{
|
||||
BankCardId: fmt.Sprintf("%d", m.BankCardId),
|
||||
DoctorId: fmt.Sprintf("%d", m.DoctorId),
|
||||
BankId: fmt.Sprintf("%d", m.BankId),
|
||||
BankCardCodeMask: m.BankCardCodeMask,
|
||||
ProvinceId: m.ProvinceId,
|
||||
Province: m.Province,
|
||||
CityId: m.CityId,
|
||||
City: m.City,
|
||||
CountyId: m.CountyId,
|
||||
County: m.County,
|
||||
}
|
||||
}
|
||||
|
||||
func GetDoctorBankCardListDto(m []*model.DoctorBankCard) []DoctorBankCardDto {
|
||||
// 处理返回值
|
||||
responses := make([]DoctorBankCardDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := DoctorBankCardDto{
|
||||
BankCardId: fmt.Sprintf("%d", v.BankCardId),
|
||||
DoctorId: fmt.Sprintf("%d", v.DoctorId),
|
||||
BankId: fmt.Sprintf("%d", v.BankId),
|
||||
BankCardCodeMask: v.BankCardCodeMask,
|
||||
ProvinceId: v.ProvinceId,
|
||||
Province: v.Province,
|
||||
CityId: v.CityId,
|
||||
City: v.City,
|
||||
CountyId: v.CountyId,
|
||||
County: v.County,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type DoctorExpertiseDto struct {
|
||||
DoctorId string `json:"doctor_id"` // 医生id
|
||||
ExpertiseId string `json:"expertise_id"` // 专长id
|
||||
ExpertiseName string `json:"expertise_name"` // 专长名称
|
||||
}
|
||||
|
||||
func GetDoctorExpertiseDto(m *model.DoctorExpertise) *DoctorExpertiseDto {
|
||||
return &DoctorExpertiseDto{
|
||||
DoctorId: fmt.Sprintf("%d", m.DoctorId),
|
||||
ExpertiseId: fmt.Sprintf("%d", m.ExpertiseId),
|
||||
}
|
||||
}
|
||||
|
||||
func GetDoctorExpertiseListDto(m []*model.DoctorExpertise) []DoctorExpertiseDto {
|
||||
// 处理返回值
|
||||
responses := make([]DoctorExpertiseDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := DoctorExpertiseDto{
|
||||
DoctorId: fmt.Sprintf("%d", v.DoctorId),
|
||||
ExpertiseId: fmt.Sprintf("%d", v.ExpertiseId),
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
|
||||
// LoadExpertiseName 加载专长名称
|
||||
func (r *DoctorExpertiseDto) LoadExpertiseName(m *model.DiseaseClassExpertise) *DoctorExpertiseDto {
|
||||
if m != nil {
|
||||
r.ExpertiseName = m.ExpertiseName
|
||||
}
|
||||
return r
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type IdenAuthFailReasonDto 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"` // 医师工作证失败原因
|
||||
}
|
||||
|
||||
func GetIdenAuthFailReasonDto(m []*model.DoctorIdenFail) *IdenAuthFailReasonDto {
|
||||
var idenAuthFailReason IdenAuthFailReasonDto
|
||||
|
||||
if len(m) > 0 {
|
||||
for _, v := range m {
|
||||
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 &idenAuthFailReason
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type HospitalDto struct {
|
||||
HospitalID string `json:"hospital_id"` // 主键id
|
||||
HospitalName string `json:"hospital_name"` // 医院名称
|
||||
HospitalStatus int `json:"hospital_status"` // 状态(0:禁用 1:正常 2:删除)
|
||||
HospitalLevelName string `json:"hospital_level_name"` // 医院等级名称
|
||||
PostCode string `json:"post_code"` // 邮政编码
|
||||
Telephone string `json:"telephone"` // 电话
|
||||
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"` // 区县
|
||||
Address string `json:"address"` // 地址
|
||||
Latitude string `json:"latitude"` // 纬度
|
||||
Longitude string `json:"longitude"` // 经度
|
||||
Description string `json:"description"` // 简介
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetHospitalDto(m *model.Hospital) *HospitalDto {
|
||||
return &HospitalDto{
|
||||
HospitalID: fmt.Sprintf("%d", m.HospitalID),
|
||||
HospitalName: m.HospitalName,
|
||||
HospitalStatus: m.HospitalStatus,
|
||||
HospitalLevelName: m.HospitalLevelName,
|
||||
PostCode: m.PostCode,
|
||||
Telephone: m.HospitalName,
|
||||
ProvinceID: m.ProvinceId,
|
||||
Province: m.Province,
|
||||
CityID: m.CityId,
|
||||
City: m.City,
|
||||
CountyID: m.CountyId,
|
||||
County: m.County,
|
||||
Address: m.Address,
|
||||
Latitude: m.Lat,
|
||||
Longitude: m.HospitalName,
|
||||
Description: m.Desc,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetHospitalListDto(m []*model.Hospital) []HospitalDto {
|
||||
// 处理返回值
|
||||
responses := make([]HospitalDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := HospitalDto{
|
||||
HospitalID: fmt.Sprintf("%d", v.HospitalID),
|
||||
HospitalName: v.HospitalName,
|
||||
HospitalStatus: v.HospitalStatus,
|
||||
HospitalLevelName: v.HospitalLevelName,
|
||||
PostCode: v.PostCode,
|
||||
Telephone: v.HospitalName,
|
||||
ProvinceID: v.ProvinceId,
|
||||
Province: v.Province,
|
||||
CityID: v.CityId,
|
||||
City: v.City,
|
||||
CountyID: v.CountyId,
|
||||
County: v.County,
|
||||
Address: v.Address,
|
||||
Latitude: v.Lat,
|
||||
Longitude: v.HospitalName,
|
||||
Description: v.Desc,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/model"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type HospitalDepartmentCustomDto struct {
|
||||
DepartmentCustomId string `json:"department_custom_id"` // 主键
|
||||
DepartmentId string `json:"department_id"` // 医院科室-标准id
|
||||
DepartmentCustomName string `json:"department_custom_name"` // 科室名称-自定义
|
||||
DepartmentName string `json:"department_name"` // 科室名称-标准
|
||||
DepartmentCode string `json:"department_code"` // 科室编码-标准
|
||||
DepartmentStatus int `json:"department_status"` // 状态(1:正常 2:删除)
|
||||
}
|
||||
|
||||
func GetHospitalDepartmentCustomListDto(m []*model.HospitalDepartmentCustom) []HospitalDepartmentCustomDto {
|
||||
// 处理返回值
|
||||
responses := make([]HospitalDepartmentCustomDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
// 将原始结构体转换为新结构体
|
||||
response := HospitalDepartmentCustomDto{
|
||||
DepartmentCustomId: strconv.FormatInt(v.DepartmentCustomId, 10),
|
||||
DepartmentId: strconv.FormatInt(v.DepartmentId, 10),
|
||||
DepartmentCustomName: v.DepartmentCustomName,
|
||||
DepartmentName: v.DepartmentName,
|
||||
DepartmentCode: v.DepartmentCode,
|
||||
DepartmentStatus: v.DepartmentStatus,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type OrderEvaluationDto struct {
|
||||
EvaluationId string `json:"evaluation_id"` // 主键id
|
||||
DoctorId string `json:"doctor_id"` // 医生id;NOT NULL
|
||||
PatientId string `json:"patient_id"` // 患者id;NOT NULL
|
||||
OrderInquiryId string `json:"order_inquiry_id"` // 订单-问诊id;NOT NULL
|
||||
NameMask string `json:"name_mask"` // 患者姓名(掩码)
|
||||
ReplyQuality float64 `json:"reply_quality"` // 回复质量(百分制)
|
||||
ServiceAttitude float64 `json:"service_attitude"` // 服务态度(百分制)
|
||||
ReplyProgress float64 `json:"reply_progress"` // 回复速度(百分制)
|
||||
AvgScore float64 `json:"avg_score"` // 平均得分(百分制,回复质量占4、服务态度占3、回复速度占3,计算公式:每个得分 * 占比 相加)
|
||||
Type int `json:"type"` // 类型(1:默认评价 2:主动评价)
|
||||
Content string `json:"content"` // 评价内容
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetOrderEvaluationDto(m *model.OrderEvaluation) *OrderEvaluationDto {
|
||||
return &OrderEvaluationDto{
|
||||
EvaluationId: fmt.Sprintf("%d", m.EvaluationId),
|
||||
DoctorId: fmt.Sprintf("%d", m.DoctorId),
|
||||
PatientId: fmt.Sprintf("%d", m.PatientId),
|
||||
OrderInquiryId: fmt.Sprintf("%d", m.OrderInquiryId),
|
||||
NameMask: m.NameMask,
|
||||
ReplyQuality: m.ReplyQuality,
|
||||
ServiceAttitude: m.ServiceAttitude,
|
||||
ReplyProgress: m.ReplyProgress,
|
||||
AvgScore: m.AvgScore,
|
||||
Type: m.Type,
|
||||
Content: m.Content,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetOrderEvaluationListDto(m []*model.OrderEvaluation) []OrderEvaluationDto {
|
||||
// 处理返回值
|
||||
responses := make([]OrderEvaluationDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := OrderEvaluationDto{
|
||||
EvaluationId: fmt.Sprintf("%d", v.EvaluationId),
|
||||
DoctorId: fmt.Sprintf("%d", v.DoctorId),
|
||||
PatientId: fmt.Sprintf("%d", v.PatientId),
|
||||
OrderInquiryId: fmt.Sprintf("%d", v.OrderInquiryId),
|
||||
NameMask: v.NameMask,
|
||||
ReplyQuality: v.ReplyQuality,
|
||||
ServiceAttitude: v.ServiceAttitude,
|
||||
ReplyProgress: v.ReplyProgress,
|
||||
AvgScore: v.AvgScore,
|
||||
Type: v.Type,
|
||||
Content: v.Content,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type OrderInquiryDto struct {
|
||||
OrderInquiryId string `json:"order_inquiry_id"` // 主键id
|
||||
UserId string `json:"user_id"` // 用户id-患者
|
||||
PatientId string `json:"patient_id"` // 患者id
|
||||
DoctorId string `json:"doctor_id"` // 医生id(未分配时为null)
|
||||
FamilyId string `json:"family_id"` // 家庭成员id(就诊用户)
|
||||
InquiryType int `json:"inquiry_type"` // 订单类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测)
|
||||
InquiryMode int `json:"inquiry_mode"` // 订单问诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
|
||||
InquiryStatus int `json:"inquiry_status"` // 问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消)
|
||||
IsDelete int `json:"is_delete"` // 删除状态(0:否 1:是)
|
||||
InquiryRefundStatus int `json:"inquiry_refund_status"` // 问诊订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭 6:退款异常)
|
||||
InquiryPayChannel int `json:"inquiry_pay_channel"` // 支付渠道(1:小程序支付 2:微信扫码支付 3:模拟支付)
|
||||
InquiryPayStatus int `json:"inquiry_pay_status"` // 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款)
|
||||
InquiryNo string `json:"inquiry_no"` // 系统订单编号
|
||||
EscrowTradeNo string `json:"escrow_trade_no"` // 第三方支付流水号
|
||||
AmountTotal float64 `json:"amount_total"` // 订单金额
|
||||
CouponAmountTotal float64 `json:"coupon_amount_total"` // 优惠卷总金额
|
||||
PaymentAmountTotal float64 `json:"payment_amount_total"` // 实际付款金额
|
||||
PayTime model.LocalTime `json:"pay_time"` // 支付时间
|
||||
ReceptionTime model.LocalTime `json:"reception_time"` // 接诊时间(已接诊)
|
||||
CompleteTime model.LocalTime `json:"complete_time"` // 订单完成时间(问诊完成时间)
|
||||
FinishTime model.LocalTime `json:"finish_time"` // 订单结束时间
|
||||
StatisticsStatus int `json:"statistics_status"` // 订单统计状态(0:未统计 1:已统计 2:统计失败)
|
||||
StatisticsTime model.LocalTime `json:"statistics_time"` // 订单统计时间
|
||||
IsWithdrawal int `json:"is_withdrawal"` // 是否提现(0:否 1:是 2:提现中)
|
||||
WithdrawalTime model.LocalTime `json:"withdrawal_time"` // 提现时间
|
||||
CancelTime model.LocalTime `json:"cancel_time"` // 订单取消时间
|
||||
CancelReason int `json:"cancel_reason"` // 取消订单原因(1:医生未接诊 2:主动取消 3:无可分配医生 4:客服取消 5:支付超时)
|
||||
CancelRemarks string `json:"cancel_remarks"` // 取消订单备注(自动添加)
|
||||
PatientName string `json:"patient_name"` // 患者姓名-就诊人
|
||||
PatientNameMask string `json:"patient_name_mask"` // 患者姓名-就诊人(掩码)
|
||||
PatientSex int `json:"patient_sex"` // 患者性别-就诊人(0:未知 1:男 2:女)
|
||||
PatientAge int `json:"patient_age"` // 患者年龄-就诊人
|
||||
PatientMobile string `json:"patient_mobile"` // 患者电话
|
||||
DoctorName string `json:"doctor_name"` // 医生姓名
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
OrderInquiryCoupon *OrderInquiryCouponDto `json:"order_inquiry_coupon"` // 订单优惠卷
|
||||
OrderInquiryCase *OrderInquiryCaseDto `json:"order_inquiry_case"` // 问诊病例
|
||||
OrderInquiryRefund *OrderInquiryRefundDto `json:"order_inquiry_refund"` // 退款数据
|
||||
OrderEvaluation *OrderEvaluationDto `json:"order_evaluation"` // 订单评价
|
||||
UserDoctor *UserDoctorDto `json:"user_doctor"` // 医生数据
|
||||
}
|
||||
|
||||
func GetOrderInquiryDto(m *model.OrderInquiry) *OrderInquiryDto {
|
||||
var doctorId string
|
||||
if m.DoctorId != 0 {
|
||||
doctorId = fmt.Sprintf("%v", m.DoctorId)
|
||||
}
|
||||
|
||||
return &OrderInquiryDto{
|
||||
OrderInquiryId: fmt.Sprintf("%d", m.OrderInquiryId),
|
||||
UserId: fmt.Sprintf("%d", m.UserId),
|
||||
DoctorId: doctorId,
|
||||
PatientId: fmt.Sprintf("%d", m.PatientId),
|
||||
FamilyId: fmt.Sprintf("%d", m.FamilyId),
|
||||
InquiryType: m.InquiryType,
|
||||
InquiryMode: m.InquiryMode,
|
||||
InquiryStatus: m.InquiryStatus,
|
||||
IsDelete: m.IsDelete,
|
||||
InquiryRefundStatus: m.InquiryRefundStatus,
|
||||
InquiryPayChannel: m.InquiryPayChannel,
|
||||
InquiryPayStatus: m.InquiryPayStatus,
|
||||
InquiryNo: m.InquiryNo,
|
||||
EscrowTradeNo: m.EscrowTradeNo,
|
||||
AmountTotal: m.AmountTotal,
|
||||
CouponAmountTotal: m.CouponAmountTotal,
|
||||
PaymentAmountTotal: m.PaymentAmountTotal,
|
||||
PayTime: m.PayTime,
|
||||
ReceptionTime: m.ReceptionTime,
|
||||
CompleteTime: m.CompleteTime,
|
||||
FinishTime: m.FinishTime,
|
||||
StatisticsStatus: m.StatisticsStatus,
|
||||
StatisticsTime: m.StatisticsTime,
|
||||
IsWithdrawal: m.IsWithdrawal,
|
||||
WithdrawalTime: m.WithdrawalTime,
|
||||
CancelTime: m.CancelTime,
|
||||
CancelReason: m.CancelReason,
|
||||
CancelRemarks: m.CancelRemarks,
|
||||
PatientName: m.PatientName,
|
||||
PatientNameMask: m.PatientNameMask,
|
||||
PatientSex: m.PatientSex,
|
||||
PatientAge: m.PatientAge,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetOrderInquiryListDto(m []*model.OrderInquiry) []*OrderInquiryDto {
|
||||
// 处理返回值
|
||||
responses := make([]*OrderInquiryDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := &OrderInquiryDto{
|
||||
OrderInquiryId: fmt.Sprintf("%d", v.OrderInquiryId),
|
||||
UserId: fmt.Sprintf("%d", v.UserId),
|
||||
PatientId: fmt.Sprintf("%d", v.PatientId),
|
||||
DoctorId: fmt.Sprintf("%d", v.DoctorId),
|
||||
FamilyId: fmt.Sprintf("%d", v.FamilyId),
|
||||
InquiryType: v.InquiryType,
|
||||
InquiryMode: v.InquiryMode,
|
||||
InquiryStatus: v.InquiryStatus,
|
||||
IsDelete: v.IsDelete,
|
||||
InquiryRefundStatus: v.InquiryRefundStatus,
|
||||
InquiryPayChannel: v.InquiryPayChannel,
|
||||
InquiryPayStatus: v.InquiryPayStatus,
|
||||
InquiryNo: v.InquiryNo,
|
||||
EscrowTradeNo: v.EscrowTradeNo,
|
||||
AmountTotal: v.AmountTotal,
|
||||
CouponAmountTotal: v.CouponAmountTotal,
|
||||
PaymentAmountTotal: v.PaymentAmountTotal,
|
||||
PayTime: v.PayTime,
|
||||
ReceptionTime: v.ReceptionTime,
|
||||
CompleteTime: v.CompleteTime,
|
||||
FinishTime: v.FinishTime,
|
||||
StatisticsStatus: v.StatisticsStatus,
|
||||
StatisticsTime: v.StatisticsTime,
|
||||
IsWithdrawal: v.IsWithdrawal,
|
||||
WithdrawalTime: v.WithdrawalTime,
|
||||
CancelTime: v.CancelTime,
|
||||
CancelReason: v.CancelReason,
|
||||
CancelRemarks: v.CancelRemarks,
|
||||
PatientName: v.PatientName,
|
||||
PatientNameMask: v.PatientNameMask,
|
||||
PatientSex: v.PatientSex,
|
||||
PatientAge: v.PatientAge,
|
||||
PatientMobile: v.User.Mobile,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 加载医生名称
|
||||
if v.UserDoctor != nil {
|
||||
response = response.LoadDoctorName(v.UserDoctor)
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
|
||||
// LoadDoctorName 加载医生名称
|
||||
func (r *OrderInquiryDto) LoadDoctorName(m *model.UserDoctor) *OrderInquiryDto {
|
||||
if m != nil {
|
||||
r.DoctorName = m.UserName
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadOrderInquiryRefund 加载订单退款数据
|
||||
func (r *OrderInquiryDto) LoadOrderInquiryRefund(m *model.OrderInquiryRefund) *OrderInquiryDto {
|
||||
if m != nil {
|
||||
d := GetOrderInquiryRefundBankDto(m)
|
||||
|
||||
r.OrderInquiryRefund = d
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadOrderInquiryCoupon 加载问诊订单优惠卷
|
||||
func (r *OrderInquiryDto) LoadOrderInquiryCoupon(m *model.OrderInquiryCoupon) *OrderInquiryDto {
|
||||
if m != nil {
|
||||
d := GetOrderInquiryCouponDto(m)
|
||||
|
||||
r.OrderInquiryCoupon = d
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadOrderInquiryCase 加载问诊病例
|
||||
func (r *OrderInquiryDto) LoadOrderInquiryCase(m *model.OrderInquiryCase) *OrderInquiryDto {
|
||||
if m != nil {
|
||||
d := GetOrderInquiryCaseDto(m)
|
||||
|
||||
r.OrderInquiryCase = d
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadOrderEvaluation 加载订单评价
|
||||
func (r *OrderInquiryDto) LoadOrderEvaluation(m *model.OrderEvaluation) *OrderInquiryDto {
|
||||
if m != nil {
|
||||
d := GetOrderEvaluationDto(m)
|
||||
|
||||
r.OrderEvaluation = d
|
||||
}
|
||||
return r
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/dao"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/utils"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type OrderInquiryCaseDto struct {
|
||||
InquiryCaseId string `json:"inquiry_case_id"` // 主键id
|
||||
UserId string `json:"user_id"` // 用户id
|
||||
PatientId string `json:"patient_id"` // 患者id
|
||||
OrderInquiryId string `json:"order_inquiry_id"` // 订单-问诊id;NOT NULL
|
||||
FamilyId string `json:"family_id"` // 家庭成员id
|
||||
Relation *int `json:"relation"` // 与患者关系(1:本人 2:父母 3:爱人 4:子女 5:亲戚 6:其他)
|
||||
Status *int `json:"status"` // 状态(1:正常 2:删除)
|
||||
Name string `json:"name"` // 患者名称
|
||||
Sex *int `json:"sex"` // 患者性别(0:未知 1:男 2:女)
|
||||
Age *int `json:"age"` // 患者年龄
|
||||
Height string `json:"height"` // 身高(cm)
|
||||
Weight string `json:"weight"` // 体重(kg)
|
||||
DiseaseClassId string `json:"disease_class_id"` // 疾病分类id-系统
|
||||
DiseaseClassName string `json:"disease_class_name"` // 疾病名称-系统
|
||||
DiagnosisDate model.LocalTime `json:"diagnosis_date"` // 确诊日期
|
||||
DiseaseDesc string `json:"disease_desc"` // 病情描述(主诉)
|
||||
DiagnoseImages []*string `json:"diagnose_images"` // 复诊凭证(多个使用逗号分隔)
|
||||
IsAllergyHistory *int `json:"is_allergy_history"` // 是否存在过敏史(0:否 1:是)
|
||||
AllergyHistory string `json:"allergy_history"` // 过敏史描述
|
||||
IsFamilyHistory *int `json:"is_family_history"` // 是否存在家族病史(0:否 1:是)
|
||||
FamilyHistory string `json:"family_history"` // 家族病史描述
|
||||
IsPregnant *int `json:"is_pregnant"` // 是否备孕、妊娠、哺乳期(0:否 1:是)
|
||||
Pregnant string `json:"pregnant"` // 备孕、妊娠、哺乳期描述
|
||||
IsTaboo *int `json:"is_taboo"` // 是否服用过禁忌药物,且无相关禁忌(0:否 1:是)问诊购药时存在
|
||||
DiagnosisHospital string `json:"diagnosis_hospital"` // 确诊医院
|
||||
IsTakeMedicine *int `json:"is_take_medicine"` // 正在服药(0:否 1:是)
|
||||
DrugsName string `json:"drugs_name"` // 正在服药名称
|
||||
DrinkWineStatus *int `json:"drink_wine_status"` // 饮酒状态(1:从不 2:偶尔 3:经常 4:每天 5:已戒酒)
|
||||
SmokeStatus *int `json:"smoke_status"` // 吸烟状态(1:从不 2:偶尔 3:经常 4:每天 5:已戒烟)
|
||||
ChemicalCompoundStatus *int `json:"chemical_compound_status"` // 化合物状态(1:从不 2:偶尔 3:经常 4:每天)
|
||||
ChemicalCompoundDescribe string `json:"chemical_compound_describe"` // 化合物描述
|
||||
IsOperation *int `json:"is_operation"` // 是否存在手术(0:否 1:是)
|
||||
Operation string `json:"operation"` // 手术描述
|
||||
Product []*string `json:"product"` // 用药意向
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetOrderInquiryCaseDto(m *model.OrderInquiryCase) *OrderInquiryCaseDto {
|
||||
// 复诊凭证
|
||||
var diagnoseImages []*string
|
||||
if m.DiagnoseImages != "" {
|
||||
diagnoseImages := strings.Split(m.DiagnoseImages, ",")
|
||||
|
||||
for i, image := range diagnoseImages {
|
||||
diagnoseImages[i] = utils.AddOssDomain(image)
|
||||
}
|
||||
}
|
||||
|
||||
return &OrderInquiryCaseDto{
|
||||
InquiryCaseId: fmt.Sprintf("%d", m.InquiryCaseId),
|
||||
UserId: fmt.Sprintf("%d", m.InquiryCaseId),
|
||||
PatientId: fmt.Sprintf("%d", m.InquiryCaseId),
|
||||
OrderInquiryId: fmt.Sprintf("%d", m.InquiryCaseId),
|
||||
FamilyId: fmt.Sprintf("%d", m.InquiryCaseId),
|
||||
Relation: m.Relation,
|
||||
Status: m.Status,
|
||||
Name: m.Name,
|
||||
Sex: m.Sex,
|
||||
Age: m.Age,
|
||||
Height: m.Height,
|
||||
Weight: m.Weight,
|
||||
DiseaseClassId: fmt.Sprintf("%d", m.InquiryCaseId),
|
||||
DiseaseClassName: m.DiseaseClassName,
|
||||
DiagnosisDate: m.DiagnosisDate,
|
||||
DiseaseDesc: m.DiseaseDesc,
|
||||
DiagnoseImages: diagnoseImages,
|
||||
IsAllergyHistory: m.IsAllergyHistory,
|
||||
AllergyHistory: m.AllergyHistory,
|
||||
IsFamilyHistory: m.IsFamilyHistory,
|
||||
FamilyHistory: m.FamilyHistory,
|
||||
IsPregnant: m.IsPregnant,
|
||||
Pregnant: m.Pregnant,
|
||||
IsTaboo: m.IsTaboo,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetOrderInquiryCaseListDto(m []*model.OrderInquiryCase) []OrderInquiryCaseDto {
|
||||
// 处理返回值
|
||||
responses := make([]OrderInquiryCaseDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := OrderInquiryCaseDto{
|
||||
InquiryCaseId: fmt.Sprintf("%d", v.InquiryCaseId),
|
||||
UserId: fmt.Sprintf("%d", v.UserId),
|
||||
PatientId: fmt.Sprintf("%d", v.PatientId),
|
||||
OrderInquiryId: fmt.Sprintf("%d", v.OrderInquiryId),
|
||||
FamilyId: fmt.Sprintf("%d", v.FamilyId),
|
||||
Name: v.Name,
|
||||
Sex: v.Sex,
|
||||
Age: v.Age,
|
||||
DiseaseClassName: v.DiseaseClassName,
|
||||
DiseaseDesc: v.DiseaseDesc,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
|
||||
// LoadPatientFamilyHealthAttr 加载健康属性
|
||||
func (r *OrderInquiryCaseDto) LoadPatientFamilyHealthAttr(m *model.PatientFamilyHealth) *OrderInquiryCaseDto {
|
||||
if m != nil {
|
||||
r.DiagnosisHospital = m.DiagnosisHospital
|
||||
r.IsTakeMedicine = m.IsTakeMedicine
|
||||
r.DrugsName = m.DrugsName
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadPatientFamilyPersonalAttr 加载个人情况属性
|
||||
func (r *OrderInquiryCaseDto) LoadPatientFamilyPersonalAttr(m *model.PatientFamilyPersonal) *OrderInquiryCaseDto {
|
||||
if m != nil {
|
||||
r.DrinkWineStatus = m.DrinkWineStatus
|
||||
r.SmokeStatus = m.SmokeStatus
|
||||
r.ChemicalCompoundStatus = m.ChemicalCompoundStatus
|
||||
r.ChemicalCompoundDescribe = m.ChemicalCompoundDescribe
|
||||
r.IsOperation = m.IsOperation
|
||||
r.Operation = m.Operation
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadInquiryCaseProduct 加载用药意向
|
||||
func (r *OrderInquiryCaseDto) LoadInquiryCaseProduct(m []*model.InquiryCaseProduct) *OrderInquiryCaseDto {
|
||||
if len(m) > 0 {
|
||||
var product []*string
|
||||
for _, inquiryCaseProduct := range m {
|
||||
// 获取商品数据
|
||||
productDao := dao.ProductDao{}
|
||||
productData, err := productDao.GetProductById(inquiryCaseProduct.ProductId)
|
||||
if err != nil {
|
||||
return r
|
||||
}
|
||||
|
||||
caseProductNum := fmt.Sprintf("%d", inquiryCaseProduct.CaseProductNum)
|
||||
productName := productData.ProductName + productData.ProductSpec + "(" + caseProductNum + productData.PackagingUnit + ")"
|
||||
|
||||
product = append(product, &productName)
|
||||
}
|
||||
r.Product = product
|
||||
}
|
||||
return r
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type OrderInquiryCouponDto struct {
|
||||
OrderCouponId string `json:"order_coupon_id"` // 主键id
|
||||
OrderInquiryId string `json:"order_inquiry_id"` // 订单-问诊id
|
||||
UserCouponId string `json:"user_coupon_id"` // 用户优惠卷表
|
||||
CouponName string `json:"coupon_name"` // 优惠卷名称
|
||||
CouponUsePrice float64 `json:"coupon_use_price"` // 优惠卷使用金额
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetOrderInquiryCouponDto(m *model.OrderInquiryCoupon) *OrderInquiryCouponDto {
|
||||
return &OrderInquiryCouponDto{
|
||||
OrderCouponId: fmt.Sprintf("%d", m.OrderCouponId),
|
||||
OrderInquiryId: fmt.Sprintf("%d", m.OrderInquiryId),
|
||||
UserCouponId: fmt.Sprintf("%d", m.UserCouponId),
|
||||
CouponName: m.CouponName,
|
||||
CouponUsePrice: m.CouponUsePrice,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetOrderInquiryCouponListDto(m []*model.OrderInquiryCoupon) []OrderInquiryCouponDto {
|
||||
// 处理返回值
|
||||
responses := make([]OrderInquiryCouponDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := OrderInquiryCouponDto{
|
||||
OrderCouponId: fmt.Sprintf("%d", v.OrderCouponId),
|
||||
OrderInquiryId: fmt.Sprintf("%d", v.OrderInquiryId),
|
||||
UserCouponId: fmt.Sprintf("%d", v.UserCouponId),
|
||||
CouponName: v.CouponName,
|
||||
CouponUsePrice: v.CouponUsePrice,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type OrderInquiryRefundDto struct {
|
||||
InquiryRefundId string `json:"inquiry_refund_id"` // 主键id
|
||||
PatientId string `json:"patient_id"` // 患者id
|
||||
OrderInquiryId string `json:"order_inquiry_id"` // 订单-问诊id
|
||||
InquiryNo string `json:"inquiry_no"` // 系统订单编号
|
||||
InquiryRefundNo string `json:"inquiry_refund_no"` // 系统退款编号
|
||||
RefundId string `json:"refund_id"` // 第三方退款单号
|
||||
InquiryRefundStatus int `json:"inquiry_refund_status"` // 问诊订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭 6:退款异常)
|
||||
RefundTotal float64 `json:"refund_total"` // 退款金额
|
||||
RefundReason string `json:"refund_reason"` // 退款原因
|
||||
SuccessTime model.LocalTime `json:"success_time"` // 退款成功时间
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetOrderInquiryRefundBankDto(m *model.OrderInquiryRefund) *OrderInquiryRefundDto {
|
||||
return &OrderInquiryRefundDto{
|
||||
InquiryRefundId: fmt.Sprintf("%d", m.InquiryRefundId),
|
||||
PatientId: fmt.Sprintf("%d", m.PatientId),
|
||||
OrderInquiryId: fmt.Sprintf("%d", m.OrderInquiryId),
|
||||
InquiryNo: m.InquiryNo,
|
||||
InquiryRefundNo: m.InquiryRefundNo,
|
||||
RefundId: m.RefundId,
|
||||
InquiryRefundStatus: m.InquiryRefundStatus,
|
||||
RefundTotal: m.RefundTotal,
|
||||
RefundReason: m.RefundReason,
|
||||
SuccessTime: m.SuccessTime,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetOrderInquiryRefundListDto(m []*model.OrderInquiryRefund) []OrderInquiryRefundDto {
|
||||
// 处理返回值
|
||||
responses := make([]OrderInquiryRefundDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := OrderInquiryRefundDto{
|
||||
InquiryRefundId: fmt.Sprintf("%d", v.InquiryRefundId),
|
||||
PatientId: fmt.Sprintf("%d", v.PatientId),
|
||||
OrderInquiryId: fmt.Sprintf("%d", v.OrderInquiryId),
|
||||
InquiryNo: v.InquiryNo,
|
||||
InquiryRefundNo: v.InquiryRefundNo,
|
||||
RefundId: v.RefundId,
|
||||
InquiryRefundStatus: v.InquiryRefundStatus,
|
||||
RefundTotal: v.RefundTotal,
|
||||
RefundReason: v.RefundReason,
|
||||
SuccessTime: v.SuccessTime,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type OrderPrescriptionDto struct {
|
||||
OrderPrescriptionId string `json:"order_prescription_id"` // 主键id
|
||||
OrderInquiryId string `json:"order_inquiry_id"` // 订单-问诊id;NOT NULL
|
||||
DoctorId string `json:"doctor_id"` // 医生id;NOT NULL
|
||||
PatientId string `json:"patient_id"` // 患者id
|
||||
FamilyId string `json:"family_id"` // 家庭成员id(就诊用户)
|
||||
PharmacistId string `json:"pharmacist_id"` // 药师id
|
||||
PrescriptionStatus int `json:"prescription_status"` // 处方状态(1:待审核 2:待使用 3:已失效 4:已使用)
|
||||
PharmacistAuditStatus int `json:"pharmacist_audit_status"` // 药师审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
PharmacistVerifyTime model.LocalTime `json:"pharmacist_verify_time"` // 药师审核时间
|
||||
PharmacistFailReason string `json:"pharmacist_fail_reason"` // 药师审核驳回原因
|
||||
PlatformAuditStatus int `json:"platform_audit_status"` // 处方平台审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
PlatformFailTime model.LocalTime `json:"platform_fail_time"` // 平台审核失败时间
|
||||
PlatformFailReason string `json:"platform_fail_reason"` // 处方平台驳回原因
|
||||
IsAutoPharVerify int `json:"is_auto_phar_verify"` // 是否药师自动审核(0:否 1:是)
|
||||
DoctorCreatedTime model.LocalTime `json:"doctor_created_time"` // 医生开具处方时间
|
||||
ExpiredTime model.LocalTime `json:"expired_time"` // 处方过期时间
|
||||
VoidTime model.LocalTime `json:"void_time"` // 处方作废时间
|
||||
IsDelete int `json:"is_delete"` // 是否删除(0:否 1:是)
|
||||
PrescriptionCode string `json:"prescription_code"` // 处方编号
|
||||
DoctorName string `json:"doctor_name"` // 医生名称
|
||||
PatientName string `json:"patient_name"` // 患者姓名-就诊人
|
||||
PatientSex int `json:"patient_sex"` // 患者性别-就诊人(1:男 2:女)
|
||||
PatientAge int `json:"patient_age"` // 患者年龄-就诊人
|
||||
DoctorAdvice string `json:"doctor_advice"` // 医嘱
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetOrderPrescriptionDto(m *model.OrderPrescription) *OrderPrescriptionDto {
|
||||
return &OrderPrescriptionDto{
|
||||
OrderPrescriptionId: fmt.Sprintf("%d", m.OrderPrescriptionId),
|
||||
OrderInquiryId: fmt.Sprintf("%d", m.OrderInquiryId),
|
||||
DoctorId: fmt.Sprintf("%d", m.DoctorId),
|
||||
PatientId: fmt.Sprintf("%d", m.PatientId),
|
||||
FamilyId: fmt.Sprintf("%d", m.FamilyId),
|
||||
PharmacistId: fmt.Sprintf("%d", m.PharmacistId),
|
||||
PrescriptionStatus: m.PrescriptionStatus,
|
||||
PharmacistAuditStatus: m.PharmacistAuditStatus,
|
||||
PharmacistVerifyTime: m.PharmacistVerifyTime,
|
||||
PharmacistFailReason: m.PharmacistFailReason,
|
||||
PlatformAuditStatus: m.PlatformAuditStatus,
|
||||
PlatformFailTime: m.PlatformFailTime,
|
||||
PlatformFailReason: m.PlatformFailReason,
|
||||
IsAutoPharVerify: m.IsAutoPharVerify,
|
||||
DoctorCreatedTime: m.DoctorCreatedTime,
|
||||
ExpiredTime: m.ExpiredTime,
|
||||
IsDelete: m.IsDelete,
|
||||
PrescriptionCode: m.PrescriptionCode,
|
||||
DoctorName: m.DoctorName,
|
||||
PatientName: m.PatientName,
|
||||
PatientSex: m.PatientSex,
|
||||
PatientAge: m.PatientAge,
|
||||
DoctorAdvice: m.DoctorAdvice,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetOrderPrescriptionListDto(m []*model.OrderPrescription) []OrderPrescriptionDto {
|
||||
// 处理返回值
|
||||
responses := make([]OrderPrescriptionDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := OrderPrescriptionDto{
|
||||
OrderPrescriptionId: fmt.Sprintf("%d", v.OrderPrescriptionId),
|
||||
OrderInquiryId: fmt.Sprintf("%d", v.OrderInquiryId),
|
||||
DoctorId: fmt.Sprintf("%d", v.DoctorId),
|
||||
PatientId: fmt.Sprintf("%d", v.PatientId),
|
||||
FamilyId: fmt.Sprintf("%d", v.FamilyId),
|
||||
PharmacistId: fmt.Sprintf("%d", v.PharmacistId),
|
||||
PrescriptionStatus: v.PrescriptionStatus,
|
||||
PharmacistAuditStatus: v.PharmacistAuditStatus,
|
||||
PharmacistVerifyTime: v.PharmacistVerifyTime,
|
||||
PharmacistFailReason: v.PharmacistFailReason,
|
||||
PlatformAuditStatus: v.PlatformAuditStatus,
|
||||
PlatformFailTime: v.PlatformFailTime,
|
||||
PlatformFailReason: v.PlatformFailReason,
|
||||
IsAutoPharVerify: v.IsAutoPharVerify,
|
||||
DoctorCreatedTime: v.DoctorCreatedTime,
|
||||
ExpiredTime: v.ExpiredTime,
|
||||
IsDelete: v.IsDelete,
|
||||
PrescriptionCode: v.PrescriptionCode,
|
||||
DoctorName: v.DoctorName,
|
||||
PatientName: v.PatientName,
|
||||
PatientSex: v.PatientSex,
|
||||
PatientAge: v.PatientAge,
|
||||
DoctorAdvice: v.DoctorAdvice,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
// OrderProductDto 订单详情
|
||||
type OrderProductDto struct {
|
||||
OrderProductId string `json:"order_product_id"` // 主键id
|
||||
OrderInquiryId string `json:"order_inquiry_id"` // 订单-问诊id;NOT NULL
|
||||
OrderPrescriptionId string `json:"order_prescription_id"` // 订单-处方id;NOT NULL
|
||||
DoctorId string `json:"doctor_id"` // 医生id
|
||||
PatientId string `json:"patient_id"` // 患者id
|
||||
FamilyId string `json:"family_id"` // 家庭成员id(就诊用户)
|
||||
OrderProductNo string `json:"order_product_no"` // 订单编号
|
||||
EscrowTradeNo string `json:"escrow_trade_no"` // 第三方支付流水号
|
||||
OrderProductStatus int `json:"order_product_status"` // 订单状态(1:待支付 2:待发货 3:已发货 4:已签收 5:已取消)
|
||||
PayChannel int `json:"pay_channel"` // 支付渠道(1:小程序支付 2:微信扫码支付);NOT NULL
|
||||
PayStatus int `json:"pay_status"` // 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款)
|
||||
CancelReason int `json:"cancel_reason"` // 订单取消原因(1:主动取消 2:复核失败/库存不足 3:支付超时 4:客服取消)
|
||||
AmountTotal float64 `json:"amount_total"` // 订单金额
|
||||
PaymentAmountTotal float64 `json:"payment_amount_total"` // 实际付款金额
|
||||
LogisticsFee float64 `json:"logistics_fee"` // 运费金额
|
||||
LogisticsNo string `json:"logistics_no"` // 物流编号
|
||||
LogisticsCompanyCode string `json:"logistics_company_code"` // 快递公司编码
|
||||
DeliveryTime model.LocalTime `json:"delivery_time"` // 发货时间
|
||||
PayTime model.LocalTime `json:"pay_time"` // 支付时间
|
||||
Remarks string `json:"remarks"` // 订单备注
|
||||
RefundStatus int `json:"refund_status"` // 商品订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭 6:退款异常)
|
||||
CancelTime model.LocalTime `json:"cancel_time"` // 订单取消时间
|
||||
CancelRemarks string `json:"cancel_remarks"` // 订单取消备注(自动添加)
|
||||
ReportPreStatus int `json:"report_pre_status"` // 上报处方平台状态(0:未上报 1:已上报 2:上报失败))
|
||||
ReportPreTime model.LocalTime `json:"report_pre_time"` // 上报处方平台时间
|
||||
ReportPreFailReason string `json:"report_pre_fail_reason"` // 上报失败原因
|
||||
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"` // county_id
|
||||
County string `json:"county"` // 区县
|
||||
AddressMask string `json:"address_mask"` // 详细地址(掩码)
|
||||
ConsigneeNameMask string `json:"consignee_name_mask"` // 收货人姓名(掩码)
|
||||
ConsigneeTelMask string `json:"consignee_tel_mask"` // 收货人电话(掩码)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
PrescriptionCode string `json:"prescription_code"` // 处方编号
|
||||
DoctorName string `json:"doctor_name"` // 医生姓名
|
||||
PatientNameMask string `json:"patient_name_mask"` // 患者姓名-就诊人(掩码)
|
||||
PatientSex int `json:"patient_sex"` // 患者性别-就诊人(0:未知 1:男 2:女)
|
||||
PatientAge int `json:"patient_age"` // 患者年龄-就诊人
|
||||
PatientMobile string `json:"patient_mobile"` // 患者电话
|
||||
OrderProductRefund *OrderProductRefundDto `json:"order_product_refund"` // 退款数据
|
||||
OrderProductItem []*OrderProductItemDto `json:"order_product_item"` // 商品数据
|
||||
OrderProductLogistics *OrderProductLogisticsDto `json:"order_product_logistics"` // 物流数据
|
||||
UserDoctor *UserDoctorDto `json:"user_doctor"` // 医生数据
|
||||
OrderPrescription *OrderPrescriptionDto `json:"order_prescription"` // 处方数据
|
||||
OrderInquiryCase *OrderInquiryCaseDto `json:"order_inquiry_case"` // 问诊病例
|
||||
}
|
||||
|
||||
// OrderProductConsigneeDto 药品订单收货人数据
|
||||
type OrderProductConsigneeDto struct {
|
||||
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"` // county_id
|
||||
County string `json:"county"` // 区县
|
||||
Address string `json:"address"` // 详细地址
|
||||
ConsigneeName string `json:"consignee_name"` // 收货人姓名
|
||||
ConsigneeTel string `json:"consignee_tel"` // 收货人电话
|
||||
}
|
||||
|
||||
func GetOrderProductDto(m *model.OrderProduct) *OrderProductDto {
|
||||
return &OrderProductDto{
|
||||
OrderProductId: fmt.Sprintf("%d", m.OrderProductId),
|
||||
OrderInquiryId: fmt.Sprintf("%d", m.OrderInquiryId),
|
||||
OrderPrescriptionId: fmt.Sprintf("%d", m.OrderPrescriptionId),
|
||||
DoctorId: fmt.Sprintf("%d", m.DoctorId),
|
||||
PatientId: fmt.Sprintf("%d", m.PatientId),
|
||||
FamilyId: fmt.Sprintf("%d", m.FamilyId),
|
||||
OrderProductNo: m.OrderProductNo,
|
||||
EscrowTradeNo: m.EscrowTradeNo,
|
||||
OrderProductStatus: m.OrderProductStatus,
|
||||
PayChannel: m.PayChannel,
|
||||
PayStatus: m.PayStatus,
|
||||
CancelReason: m.CancelReason,
|
||||
AmountTotal: m.AmountTotal,
|
||||
PaymentAmountTotal: m.PaymentAmountTotal,
|
||||
LogisticsFee: m.LogisticsFee,
|
||||
LogisticsNo: m.LogisticsNo,
|
||||
LogisticsCompanyCode: m.LogisticsCompanyCode,
|
||||
DeliveryTime: m.DeliveryTime,
|
||||
PayTime: m.PayTime,
|
||||
Remarks: m.Remarks,
|
||||
RefundStatus: m.RefundStatus,
|
||||
CancelTime: m.CancelTime,
|
||||
CancelRemarks: m.CancelRemarks,
|
||||
ReportPreStatus: m.ReportPreStatus,
|
||||
ReportPreTime: m.ReportPreTime,
|
||||
ReportPreFailReason: m.ReportPreFailReason,
|
||||
ProvinceId: m.ProvinceId,
|
||||
Province: m.Province,
|
||||
CityId: m.CityId,
|
||||
City: m.City,
|
||||
CountyId: m.CountyId,
|
||||
County: m.County,
|
||||
AddressMask: m.AddressMask,
|
||||
ConsigneeNameMask: m.ConsigneeNameMask,
|
||||
ConsigneeTelMask: m.ConsigneeTelMask,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
// GetOrderProductConsigneeDtoDto 药品订单收货人数据
|
||||
func GetOrderProductConsigneeDtoDto(m *model.OrderProduct) *OrderProductConsigneeDto {
|
||||
return &OrderProductConsigneeDto{
|
||||
ProvinceId: m.ProvinceId,
|
||||
Province: m.Province,
|
||||
CityId: m.CityId,
|
||||
City: m.City,
|
||||
CountyId: m.CountyId,
|
||||
County: m.County,
|
||||
Address: m.Address,
|
||||
ConsigneeName: m.ConsigneeName,
|
||||
ConsigneeTel: m.ConsigneeTel,
|
||||
}
|
||||
}
|
||||
|
||||
func GetOrderProductListDto(m []*model.OrderProduct) []*OrderProductDto {
|
||||
// 处理返回值
|
||||
responses := make([]*OrderProductDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := &OrderProductDto{
|
||||
OrderProductId: fmt.Sprintf("%d", v.OrderProductId),
|
||||
OrderInquiryId: fmt.Sprintf("%d", v.OrderInquiryId),
|
||||
OrderPrescriptionId: fmt.Sprintf("%d", v.OrderPrescriptionId),
|
||||
DoctorId: fmt.Sprintf("%d", v.DoctorId),
|
||||
PatientId: fmt.Sprintf("%d", v.PatientId),
|
||||
FamilyId: fmt.Sprintf("%d", v.FamilyId),
|
||||
OrderProductNo: v.OrderProductNo,
|
||||
EscrowTradeNo: v.OrderProductNo,
|
||||
OrderProductStatus: v.OrderProductStatus,
|
||||
PayChannel: v.PayChannel,
|
||||
PayStatus: v.PayStatus,
|
||||
CancelReason: v.CancelReason,
|
||||
AmountTotal: v.AmountTotal,
|
||||
PaymentAmountTotal: v.PaymentAmountTotal,
|
||||
LogisticsFee: v.LogisticsFee,
|
||||
LogisticsNo: v.LogisticsNo,
|
||||
LogisticsCompanyCode: v.LogisticsCompanyCode,
|
||||
DeliveryTime: v.DeliveryTime,
|
||||
PayTime: v.PayTime,
|
||||
Remarks: v.Remarks,
|
||||
RefundStatus: v.RefundStatus,
|
||||
ReportPreStatus: v.ReportPreStatus,
|
||||
ConsigneeNameMask: v.ConsigneeNameMask,
|
||||
ConsigneeTelMask: v.ConsigneeTelMask,
|
||||
PatientMobile: v.UserPatient.User.Mobile,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 加载医生名称
|
||||
if v.UserDoctor != nil {
|
||||
response = response.LoadDoctorName(v.UserDoctor)
|
||||
}
|
||||
|
||||
// 加载问诊属性
|
||||
if v.OrderInquiry != nil {
|
||||
response = response.LoadOrderInquiryAttr(v.OrderInquiry)
|
||||
}
|
||||
|
||||
// 加载处方编号
|
||||
if v.OrderPrescription != nil {
|
||||
response = response.LoadOrderPrescriptionCode(v.OrderPrescription)
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
|
||||
// LoadDoctorName 加载医生名称
|
||||
func (r *OrderProductDto) LoadDoctorName(m *model.UserDoctor) *OrderProductDto {
|
||||
if m != nil {
|
||||
r.DoctorName = m.UserName
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadOrderInquiryAttr 加载问诊属性
|
||||
func (r *OrderProductDto) LoadOrderInquiryAttr(m *model.OrderInquiry) *OrderProductDto {
|
||||
if m != nil {
|
||||
r.PatientNameMask = m.PatientNameMask
|
||||
r.PatientSex = m.PatientSex
|
||||
r.PatientAge = m.PatientAge
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadOrderPrescriptionCode 加载处方编号
|
||||
func (r *OrderProductDto) LoadOrderPrescriptionCode(m *model.OrderPrescription) *OrderProductDto {
|
||||
if m != nil {
|
||||
r.PrescriptionCode = m.PrescriptionCode
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadOrderInquiryCase 加载问诊病例
|
||||
func (r *OrderProductDto) LoadOrderInquiryCase(m *model.OrderInquiryCase) *OrderProductDto {
|
||||
if m != nil {
|
||||
d := GetOrderInquiryCaseDto(m)
|
||||
|
||||
r.OrderInquiryCase = d
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadOrderPrescription 加载处方数据
|
||||
func (r *OrderProductDto) LoadOrderPrescription(m *model.OrderPrescription) *OrderProductDto {
|
||||
if m != nil {
|
||||
d := GetOrderPrescriptionDto(m)
|
||||
|
||||
r.OrderPrescription = d
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadOrderProductLogistics 加载物流数据
|
||||
func (r *OrderProductDto) LoadOrderProductLogistics(m *model.OrderProductLogistics) *OrderProductDto {
|
||||
if m != nil {
|
||||
d := GetOrderProductLogisticsDto(m)
|
||||
|
||||
r.OrderProductLogistics = d
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadOrderProductItem 加载商品数据
|
||||
func (r *OrderProductDto) LoadOrderProductItem(m []*model.OrderProductItem) *OrderProductDto {
|
||||
if m != nil {
|
||||
d := GetOrderProductItemListDto(m)
|
||||
|
||||
r.OrderProductItem = d
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadOrderProductRefund 加载退款数据
|
||||
func (r *OrderProductDto) LoadOrderProductRefund(m *model.OrderProductRefund) *OrderProductDto {
|
||||
if m != nil {
|
||||
d := GetOrderProductRefundDto(m)
|
||||
|
||||
r.OrderProductRefund = d
|
||||
}
|
||||
return r
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/utils"
|
||||
)
|
||||
|
||||
type OrderProductItemDto struct {
|
||||
ProductItemId string `json:"product_item_id"` // 主键id
|
||||
OrderProductId string `json:"order_product_id"` // 订单-商品订单id
|
||||
OrderInquiryId string `json:"order_inquiry_id"` // 订单-问诊id
|
||||
OrderPrescriptionId string `json:"order_prescription_id"` // 订单-处方id
|
||||
ProductId string `json:"product_id"` // 商品id
|
||||
ProductName string `json:"product_name"` // 商品名称
|
||||
ProductPrice float64 `json:"product_price"` // 商品价格
|
||||
ProductPlatformCode string `json:"product_platform_code"` // 商品处方平台编码
|
||||
Amount int `json:"amount"` // 数量
|
||||
Manufacturer string `json:"manufacturer"` // 生产厂家
|
||||
ProductCoverImg string `json:"product_cover_img"` // 商品封面图
|
||||
ProductSpec string `json:"product_spec"` // 商品规格
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetOrderProductItemDto(m *model.OrderProductItem) *OrderProductItemDto {
|
||||
return &OrderProductItemDto{
|
||||
ProductItemId: fmt.Sprintf("%d", m.ProductItemId),
|
||||
OrderProductId: fmt.Sprintf("%d", m.OrderProductId),
|
||||
OrderInquiryId: fmt.Sprintf("%d", m.OrderInquiryId),
|
||||
OrderPrescriptionId: fmt.Sprintf("%d", m.OrderPrescriptionId),
|
||||
ProductId: fmt.Sprintf("%d", m.ProductId),
|
||||
ProductName: m.ProductName,
|
||||
ProductPrice: m.ProductPrice,
|
||||
ProductPlatformCode: m.ProductPlatformCode,
|
||||
Amount: m.Amount,
|
||||
Manufacturer: m.Manufacturer,
|
||||
ProductCoverImg: utils.AddOssDomain(m.ProductCoverImg),
|
||||
ProductSpec: m.ProductSpec,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetOrderProductItemListDto(m []*model.OrderProductItem) []*OrderProductItemDto {
|
||||
// 处理返回值
|
||||
responses := make([]*OrderProductItemDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := &OrderProductItemDto{
|
||||
ProductItemId: fmt.Sprintf("%d", v.ProductItemId),
|
||||
OrderProductId: fmt.Sprintf("%d", v.OrderProductId),
|
||||
OrderInquiryId: fmt.Sprintf("%d", v.OrderInquiryId),
|
||||
OrderPrescriptionId: fmt.Sprintf("%d", v.OrderPrescriptionId),
|
||||
ProductId: fmt.Sprintf("%d", v.ProductId),
|
||||
ProductName: v.ProductName,
|
||||
ProductPrice: v.ProductPrice,
|
||||
ProductPlatformCode: v.ProductPlatformCode,
|
||||
Amount: v.Amount,
|
||||
Manufacturer: v.Manufacturer,
|
||||
ProductCoverImg: utils.AddOssDomain(v.ProductCoverImg),
|
||||
ProductSpec: v.ProductSpec,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type OrderProductLogisticsDto struct {
|
||||
LogisticsId string `json:"logistics_id"` // 主键id
|
||||
OrderProductId string `json:"order_product_id"` // 药品订单id;NOT NULL
|
||||
LogisticsStatus int `json:"logistics_status"` // 运单签收状态(0在途 1揽收 2疑难 3签收 4退签 5派件 8清关 14拒签);NOT NULL
|
||||
LogisticsNo string `json:"logistics_no"` // 物流编号
|
||||
CompanyName string `json:"company_name"` // 快递公司名称
|
||||
CompanyCode string `json:"company_code"` // 快递公司编码
|
||||
LogisticsContent string `json:"logistics_content"` // 内容
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetOrderProductLogisticsDto(m *model.OrderProductLogistics) *OrderProductLogisticsDto {
|
||||
return &OrderProductLogisticsDto{
|
||||
LogisticsId: fmt.Sprintf("%d", m.LogisticsId),
|
||||
OrderProductId: fmt.Sprintf("%d", m.OrderProductId),
|
||||
LogisticsStatus: m.LogisticsStatus,
|
||||
LogisticsNo: m.LogisticsNo,
|
||||
CompanyName: m.CompanyName,
|
||||
CompanyCode: m.CompanyCode,
|
||||
LogisticsContent: m.LogisticsContent,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetOrderProductLogisticsListDto(m []*model.OrderProductLogistics) []OrderProductLogisticsDto {
|
||||
// 处理返回值
|
||||
responses := make([]OrderProductLogisticsDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := OrderProductLogisticsDto{
|
||||
LogisticsId: fmt.Sprintf("%d", v.LogisticsId),
|
||||
OrderProductId: fmt.Sprintf("%d", v.OrderProductId),
|
||||
LogisticsStatus: v.LogisticsStatus,
|
||||
LogisticsNo: v.LogisticsNo,
|
||||
CompanyName: v.CompanyName,
|
||||
CompanyCode: v.CompanyCode,
|
||||
LogisticsContent: v.LogisticsContent,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type OrderProductRefundDto struct {
|
||||
ProductRefundId string `json:"product_refund_id"` // 主键id
|
||||
PatientId string `json:"patient_id"` // 患者id
|
||||
OrderProductId string `json:"order_product_id"` // 订单-药品订单id
|
||||
OrderProductNo string `json:"order_product_no"` // 系统订单编号
|
||||
ProductRefundNo string `json:"product_refund_no"` // 系统退款编号
|
||||
RefundId string `json:"refund_id"` // 第三方退款单号
|
||||
ProductRefundStatus int `json:"product_refund_status"` // 商品订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭 6:退款异常)
|
||||
RefundTotal float64 `json:"refund_total"` // 退款金额
|
||||
RefundReason string `json:"refund_reason"` // 退款原因
|
||||
SuccessTime model.LocalTime `json:"success_time"` // 退款成功时间
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetOrderProductRefundDto(m *model.OrderProductRefund) *OrderProductRefundDto {
|
||||
return &OrderProductRefundDto{
|
||||
ProductRefundId: fmt.Sprintf("%d", m.ProductRefundId),
|
||||
PatientId: fmt.Sprintf("%d", m.PatientId),
|
||||
OrderProductId: fmt.Sprintf("%d", m.OrderProductId),
|
||||
OrderProductNo: m.OrderProductNo,
|
||||
ProductRefundNo: m.ProductRefundNo,
|
||||
RefundId: m.RefundId,
|
||||
ProductRefundStatus: m.ProductRefundStatus,
|
||||
RefundTotal: m.RefundTotal,
|
||||
RefundReason: m.RefundReason,
|
||||
SuccessTime: m.SuccessTime,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetOrderProductRefundListDto(m []*model.OrderProductRefund) []OrderProductRefundDto {
|
||||
// 处理返回值
|
||||
responses := make([]OrderProductRefundDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := OrderProductRefundDto{
|
||||
ProductRefundId: fmt.Sprintf("%d", v.ProductRefundId),
|
||||
PatientId: fmt.Sprintf("%d", v.PatientId),
|
||||
OrderProductId: fmt.Sprintf("%d", v.OrderProductId),
|
||||
OrderProductNo: v.OrderProductNo,
|
||||
ProductRefundNo: v.ProductRefundNo,
|
||||
RefundId: v.RefundId,
|
||||
ProductRefundStatus: v.ProductRefundStatus,
|
||||
RefundTotal: v.RefundTotal,
|
||||
RefundReason: v.RefundReason,
|
||||
SuccessTime: v.SuccessTime,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/utils"
|
||||
)
|
||||
|
||||
type PatientFamilyDto struct {
|
||||
FamilyId string `json:"family_id"` // 主键id
|
||||
PatientId string `json:"patient_id"` // 患者id
|
||||
Relation *int `json:"relation"` // 与患者关系(1:本人 2:父母 3:爱人 4:子女 5:亲戚 6:其他)
|
||||
Status *int `json:"status"` // 状态(1:正常 2:删除)
|
||||
IsDefault *int `json:"is_default"` // 是否默认(0:否 1:是)
|
||||
CardName string `json:"card_name"` // 姓名
|
||||
CardNameMask string `json:"card_name_mask"` // 姓名(掩码)
|
||||
Mobile string `json:"mobile"` // 电话
|
||||
MobileMask string `json:"mobile_mask"` // 电话(掩码)
|
||||
Type *int `json:"type"` // 身份类型(1:身份证 2:护照 3:港澳通行证 4:台胞证)
|
||||
IdNumber string `json:"id_number"` // 证件号码
|
||||
IdNumberMask string `json:"id_number_mask"` // 证件号码(掩码)
|
||||
Sex *int `json:"sex"` // 性别(0:未知 1:男 2:女)
|
||||
Age int `json:"age"` // 年龄
|
||||
ProvinceId string `json:"province_id"` // 省份id
|
||||
Province string `json:"province"` // 省份
|
||||
CityId string `json:"city_id"` // 城市id
|
||||
City string `json:"city"` // 城市
|
||||
CountyId string `json:"county_id"` // 区县id
|
||||
County string `json:"county"` // 区县
|
||||
Height string `json:"height"` // 身高(cm)
|
||||
Weight string `json:"weight"` // 体重(kg)
|
||||
MaritalStatus *int `json:"marital_status"` // 婚姻状况(0:未婚 1:已婚 2:离异)
|
||||
NationId string `json:"nation_id"` // 民族
|
||||
NationName string `json:"nation_name"` // 民族名称
|
||||
JobId string `json:"job_id"` // 职业
|
||||
JobName string `json:"job_name"` // 职业名称
|
||||
UserName string `json:"user_name"` // 账号名称
|
||||
User *UserDto `json:"user"` // 用户
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
}
|
||||
|
||||
type PatientFamilyMaskDto struct {
|
||||
FamilyId string `json:"family_id"` // 主键id
|
||||
PatientId string `json:"patient_id"` // 患者id
|
||||
Relation *int `json:"relation"` // 与患者关系(1:本人 2:父母 3:爱人 4:子女 5:亲戚 6:其他)
|
||||
Status *int `json:"status"` // 状态(1:正常 2:删除)
|
||||
IsDefault *int `json:"is_default"` // 是否默认(0:否 1:是)
|
||||
CardNameMask string `json:"card_name_mask"` // 姓名(掩码)
|
||||
MobileMask string `json:"mobile_mask"` // 电话(掩码)
|
||||
IdNumberMask string `json:"id_number_mask"` // 证件号码(掩码)
|
||||
Sex *int `json:"sex"` // 性别(0:未知 1:男 2:女)
|
||||
Age int `json:"age"` // 年龄
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
}
|
||||
|
||||
func GetPatientFamilyMaskDto(m *model.PatientFamily) *PatientFamilyMaskDto {
|
||||
return &PatientFamilyMaskDto{
|
||||
FamilyId: fmt.Sprintf("%d", m.FamilyId),
|
||||
PatientId: fmt.Sprintf("%d", m.PatientId),
|
||||
Relation: m.Relation,
|
||||
Status: &m.Status,
|
||||
IsDefault: &m.IsDefault,
|
||||
CardNameMask: m.CardNameMask,
|
||||
IdNumberMask: m.IdNumberMask,
|
||||
Sex: &m.Sex,
|
||||
Age: m.Age,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetPatientFamilyMaskListDto(m []*model.PatientFamily) []*PatientFamilyMaskDto {
|
||||
// 处理返回值
|
||||
responses := make([]*PatientFamilyMaskDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := &PatientFamilyMaskDto{
|
||||
FamilyId: fmt.Sprintf("%d", v.FamilyId),
|
||||
PatientId: fmt.Sprintf("%d", v.PatientId),
|
||||
Relation: v.Relation,
|
||||
Status: &v.Status,
|
||||
IsDefault: &v.IsDefault,
|
||||
CardNameMask: v.CardNameMask,
|
||||
IdNumberMask: v.IdNumberMask,
|
||||
Sex: &v.Sex,
|
||||
Age: v.Age,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
|
||||
func GetPatientFamilyDto(m *model.PatientFamily) *PatientFamilyDto {
|
||||
return &PatientFamilyDto{
|
||||
FamilyId: fmt.Sprintf("%d", m.FamilyId),
|
||||
PatientId: fmt.Sprintf("%d", m.PatientId),
|
||||
Relation: m.Relation,
|
||||
Status: &m.Status,
|
||||
IsDefault: &m.IsDefault,
|
||||
CardName: m.CardName,
|
||||
CardNameMask: m.CardNameMask,
|
||||
MobileMask: m.MobileMask,
|
||||
Type: &m.Type,
|
||||
IdNumberMask: m.IdNumberMask,
|
||||
Sex: &m.Sex,
|
||||
Age: m.Age,
|
||||
ProvinceId: fmt.Sprintf("%d", m.ProvinceId),
|
||||
Province: m.Province,
|
||||
CityId: fmt.Sprintf("%d", m.CityId),
|
||||
City: m.City,
|
||||
CountyId: fmt.Sprintf("%d", m.CountyId),
|
||||
County: m.County,
|
||||
Height: m.Height,
|
||||
Weight: m.Weight,
|
||||
MaritalStatus: &m.MaritalStatus,
|
||||
NationId: fmt.Sprintf("%d", m.NationId),
|
||||
NationName: m.NationName,
|
||||
JobId: fmt.Sprintf("%d", m.JobId),
|
||||
JobName: m.JobName,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetPatientFamilyListDto(m []*model.PatientFamily) []*PatientFamilyDto {
|
||||
// 处理返回值
|
||||
responses := make([]*PatientFamilyDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := &PatientFamilyDto{
|
||||
FamilyId: fmt.Sprintf("%d", v.FamilyId),
|
||||
PatientId: fmt.Sprintf("%d", v.PatientId),
|
||||
Relation: v.Relation,
|
||||
Status: &v.Status,
|
||||
CardName: v.CardName,
|
||||
MobileMask: utils.MaskPhoneStr(v.UserPatient.User.Mobile),
|
||||
UserName: v.UserPatient.UserName,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
|
||||
// LoadMaskUser 加载用户数据-加密
|
||||
func (r *PatientFamilyDto) LoadMaskUser(m *model.User) *PatientFamilyDto {
|
||||
if m != nil {
|
||||
userDto := GetMaskUserDto(m)
|
||||
|
||||
r.User = userDto
|
||||
}
|
||||
return r
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/utils"
|
||||
)
|
||||
|
||||
type UserDto struct {
|
||||
UserID string `json:"user_id"` // 主键
|
||||
UserName string `json:"user_name"` // 用户名称
|
||||
UserAccount string `json:"user_account"` // 账号
|
||||
Mobile string `json:"mobile"` // 手机号
|
||||
WxMobile string `json:"wx_mobile"` // 微信手机号
|
||||
UserType int `json:"user_type"` // 用户类型(1:患者 2:医师 3:药师)
|
||||
UserStatus int `json:"user_status"` // 状态(0:禁用 1:正常 2:删除)
|
||||
RegisterMethod int `json:"register_method"` // 注册方式(1:微信小程序)
|
||||
Age uint `json:"age"` // 年龄
|
||||
Sex int `json:"sex"` // 性别(0:未知 1:男 2:女)
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
LoginIP string `json:"login_ip"` // 登陆ip
|
||||
LastLoginAt model.LocalTime `json:"last_login_at"` // 最后登陆时间
|
||||
CreatedBy string `json:"created_by"` // 创建者id(后台用户表id null:自己注册)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetUserDto(m *model.User) *UserDto {
|
||||
return &UserDto{
|
||||
UserID: fmt.Sprintf("%d", m.UserId),
|
||||
UserName: m.UserName,
|
||||
UserAccount: m.UserAccount,
|
||||
Mobile: m.Mobile,
|
||||
WxMobile: m.WxMobile,
|
||||
UserType: m.UserType,
|
||||
UserStatus: m.UserStatus,
|
||||
RegisterMethod: m.RegisterMethod,
|
||||
Age: m.Age,
|
||||
Sex: m.Sex,
|
||||
Avatar: utils.AddOssDomain(m.Avatar),
|
||||
LoginIP: m.LoginIp,
|
||||
LastLoginAt: m.LastLoginAt,
|
||||
CreatedBy: m.CreatedBy,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetMaskUserDto(m *model.User) *UserDto {
|
||||
return &UserDto{
|
||||
UserID: fmt.Sprintf("%d", m.UserId),
|
||||
UserName: m.UserName,
|
||||
UserAccount: m.UserAccount,
|
||||
Mobile: utils.MaskPhoneStr(m.Mobile),
|
||||
WxMobile: utils.MaskPhoneStr(m.WxMobile),
|
||||
UserType: m.UserType,
|
||||
UserStatus: m.UserStatus,
|
||||
RegisterMethod: m.RegisterMethod,
|
||||
Age: m.Age,
|
||||
Sex: m.Sex,
|
||||
Avatar: utils.AddOssDomain(m.Avatar),
|
||||
LoginIP: m.LoginIp,
|
||||
LastLoginAt: m.LastLoginAt,
|
||||
CreatedBy: m.CreatedBy,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetUserListDto(m []*model.User) []UserDto {
|
||||
// 处理返回值
|
||||
responses := make([]UserDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := UserDto{
|
||||
UserID: fmt.Sprintf("%d", v.UserId),
|
||||
UserName: v.UserName,
|
||||
UserAccount: v.UserAccount,
|
||||
Mobile: v.Mobile,
|
||||
WxMobile: v.WxMobile,
|
||||
UserType: v.UserType,
|
||||
UserStatus: v.UserStatus,
|
||||
RegisterMethod: v.RegisterMethod,
|
||||
Age: v.Age,
|
||||
Sex: v.Sex,
|
||||
Avatar: utils.AddOssDomain(v.Avatar),
|
||||
LoginIP: v.LoginIp,
|
||||
LastLoginAt: v.LastLoginAt,
|
||||
CreatedBy: v.CreatedBy,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,342 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/utils"
|
||||
)
|
||||
|
||||
type UserDoctorDto struct {
|
||||
DoctorID string `json:"doctor_id"` // 主键id
|
||||
UserID string `json:"user_id"` // 用户id
|
||||
UserName string `json:"user_name"` // 用户名称
|
||||
Status int `json:"status"` // 状态(0:禁用 1:正常 2:删除)
|
||||
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"` // 身份认证失败原因
|
||||
MultiPointStatus int `json:"multi_point_status"` // 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
MultiPointTime model.LocalTime `json:"multi_point_time"` // 审核时间
|
||||
MultiPointFailReason string `json:"multi_point_fail_reason"` // 多点执业认证失败原因
|
||||
IsBindBank int `json:"is_bind_bank"` // 是否已绑定结算银行卡(0:否 1:是)
|
||||
IsRecommend int `json:"is_recommend"` // 是否首页推荐(0:否 1:是)
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
DoctorTitle int `json:"doctor_title"` // 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
|
||||
DepartmentCustomID string `json:"department_custom_id"` // 科室id-自定义
|
||||
DepartmentCustomName string `json:"department_custom_name"` // 科室名称(如未自己输入,填入标准科室名称)
|
||||
DepartmentCustomMobile string `json:"department_custom_mobile"` // 科室电话
|
||||
HospitalID string `json:"hospital_id"` // 所属医院id
|
||||
HospitalName string `json:"hospital_name"` // 医院名称
|
||||
ServedPatientsNum int `json:"served_patients_num"` // 服务患者数量(订单结束时统计)
|
||||
PraiseRate float64 `json:"praise_rate"` // 好评率(百分制。订单平均评价中超过4-5分的订单总数 / 总订单数 * 5)
|
||||
AvgResponseTime float64 `json:"avg_response_time"` // 平均响应时间(分钟制)
|
||||
NumberOfFans uint `json:"number_of_fans"` // 被关注数量
|
||||
IsOnline int `json:"is_online"` // 是否在线(0:不在线 1:在线)
|
||||
IsImgExpertReception int `json:"is_img_expert_reception"` // 是否参加专家图文接诊(0:否 1:是)
|
||||
IsImgWelfareReception int `json:"is_img_welfare_reception"` // 是否参加公益图文问诊(0:否 1:是)
|
||||
IsImgQuickReception int `json:"is_img_quick_reception"` // 是否参加快速图文接诊(0:否 1:是)
|
||||
IsPlatformDeepCooperation int `json:"is_platform_deep_cooperation"` // 是否平台深度合作医生(0:否 1:是)
|
||||
IsEnterpriseDeepCooperation int `json:"is_enterprise_deep_cooperation"` // 是否企业深度合作医生(0:否 1:是)
|
||||
IsSysDiagnoCooperation int `json:"is_sys_diagno_cooperation"` // 是否先思达合作医生(0:否 1:是)
|
||||
QrCode string `json:"qr_code"` // 分享二维码
|
||||
BeGoodAt string `json:"be_good_at"` // 擅长
|
||||
BriefIntroduction string `json:"brief_introduction"` // 医生简介
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
Mobile string `json:"mobile"` // 手机号
|
||||
Age uint `json:"age"` // 年龄
|
||||
Sex int `json:"sex"` // 性别(0:未知 1:男 2:女)
|
||||
RegisterMethod int `json:"register_method"` // 注册方式(1:微信小程序 )
|
||||
User *UserDto `json:"user"` // 用户
|
||||
Hospital *HospitalDto `json:"hospital"` // 医院
|
||||
UserDoctorInfo *UserDoctorInfoDto `json:"user_doctor_info"` // 医生详情
|
||||
DoctorExpertise []*DoctorExpertiseDto `json:"doctor_expertise"` // 医生专长
|
||||
DoctorBankCard *DoctorBankCardDto `json:"doctor_bank_card"` // 医生银行卡
|
||||
}
|
||||
|
||||
type UserDoctorPendingDto struct {
|
||||
DoctorID string `json:"doctor_id"` // 主键id
|
||||
UserID string `json:"user_id"` // 用户id
|
||||
UserName string `json:"user_name"` // 用户名称
|
||||
Status int `json:"status"` // 状态(0:禁用 1:正常 2:删除)
|
||||
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 *IdenAuthFailReasonDto `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-自定义
|
||||
DepartmentCustomName string `json:"department_custom_name"` // 科室名称(如未自己输入,填入标准科室名称)
|
||||
DepartmentCustomMobile string `json:"department_custom_mobile"` // 科室电话
|
||||
HospitalID string `json:"hospital_id"` // 所属医院id
|
||||
BeGoodAt string `json:"be_good_at"` // 擅长
|
||||
BriefIntroduction string `json:"brief_introduction"` // 医生简介
|
||||
IsPlatformDeepCooperation int `json:"is_platform_deep_cooperation"` // 是否平台深度合作医生(0:否 1:是)
|
||||
IsEnterpriseDeepCooperation int `json:"is_enterprise_deep_cooperation"` // 是否企业深度合作医生(0:否 1:是)
|
||||
IsSysDiagnoCooperation int `json:"is_sys_diagno_cooperation"` // 是否先思达合作医生(0:否 1:是)
|
||||
IsRecommend int `json:"is_recommend"` // 是否首页推荐(0:否 1:是)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
User *UserDto `json:"user"` // 用户
|
||||
Hospital *HospitalDto `json:"hospital"` // 医院
|
||||
UserDoctorInfo *UserDoctorInfoDto `json:"user_doctor_info"` // 医生详情
|
||||
DoctorExpertise []*DoctorExpertiseDto `json:"doctor_expertise"` // 医生专长
|
||||
}
|
||||
|
||||
func GetUserDoctorDto(m *model.UserDoctor) *UserDoctorDto {
|
||||
return &UserDoctorDto{
|
||||
DoctorID: fmt.Sprintf("%d", m.DoctorId),
|
||||
UserID: fmt.Sprintf("%d", m.DoctorId),
|
||||
UserName: m.UserName,
|
||||
Status: m.Status,
|
||||
IDCardStatus: m.Status,
|
||||
IdenAuthStatus: m.IdenAuthStatus,
|
||||
IdenAuthTime: m.IdenAuthTime,
|
||||
IdenAuthFailReason: m.IdenAuthFailReason,
|
||||
MultiPointStatus: m.MultiPointStatus,
|
||||
MultiPointTime: m.MultiPointTime,
|
||||
MultiPointFailReason: m.MultiPointFailReason,
|
||||
IsBindBank: m.IsBindBank,
|
||||
IsRecommend: m.IsRecommend,
|
||||
Avatar: utils.AddOssDomain(m.Avatar),
|
||||
DoctorTitle: m.DoctorTitle,
|
||||
DepartmentCustomID: fmt.Sprintf("%d", m.DepartmentCustomId),
|
||||
DepartmentCustomName: m.DepartmentCustomName,
|
||||
DepartmentCustomMobile: m.DepartmentCustomMobile,
|
||||
HospitalID: fmt.Sprintf("%d", m.HospitalID),
|
||||
ServedPatientsNum: m.ServedPatientsNum,
|
||||
PraiseRate: m.PraiseRate,
|
||||
AvgResponseTime: m.AvgResponseTime,
|
||||
NumberOfFans: m.NumberOfFans,
|
||||
IsImgExpertReception: m.IsImgExpertReception,
|
||||
IsImgWelfareReception: m.IsImgWelfareReception,
|
||||
IsImgQuickReception: m.IsImgQuickReception,
|
||||
IsPlatformDeepCooperation: m.IsPlatformDeepCooperation,
|
||||
IsSysDiagnoCooperation: m.IsSysDiagnoCooperation,
|
||||
QrCode: utils.AddOssDomain(m.QrCode),
|
||||
BeGoodAt: m.BeGoodAt,
|
||||
BriefIntroduction: m.BriefIntroduction,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetUserDoctorListDto(m []*model.UserDoctor) []*UserDoctorDto {
|
||||
// 处理返回值
|
||||
responses := make([]*UserDoctorDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := &UserDoctorDto{
|
||||
DoctorID: fmt.Sprintf("%d", v.DoctorId),
|
||||
UserID: fmt.Sprintf("%d", v.UserId),
|
||||
UserName: v.UserName,
|
||||
Status: v.Status,
|
||||
IDCardStatus: v.Status,
|
||||
IdenAuthStatus: v.IdenAuthStatus,
|
||||
IdenAuthTime: v.IdenAuthTime,
|
||||
IdenAuthFailReason: v.IdenAuthFailReason,
|
||||
MultiPointStatus: v.MultiPointStatus,
|
||||
MultiPointTime: v.MultiPointTime,
|
||||
MultiPointFailReason: v.MultiPointFailReason,
|
||||
IsBindBank: v.IsBindBank,
|
||||
IsRecommend: v.IsRecommend,
|
||||
Avatar: utils.AddOssDomain(v.Avatar),
|
||||
DoctorTitle: v.DoctorTitle,
|
||||
DepartmentCustomName: v.DepartmentCustomName,
|
||||
DepartmentCustomMobile: v.DepartmentCustomMobile,
|
||||
HospitalID: fmt.Sprintf("%d", v.HospitalID),
|
||||
ServedPatientsNum: v.ServedPatientsNum,
|
||||
PraiseRate: v.PraiseRate,
|
||||
AvgResponseTime: v.AvgResponseTime,
|
||||
NumberOfFans: v.NumberOfFans,
|
||||
IsImgExpertReception: v.IsImgExpertReception,
|
||||
IsImgWelfareReception: v.IsImgWelfareReception,
|
||||
IsImgQuickReception: v.IsImgQuickReception,
|
||||
IsPlatformDeepCooperation: v.IsPlatformDeepCooperation,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 加载用户属性
|
||||
if v.User != nil {
|
||||
response = response.LoadUserAttr(v.User)
|
||||
}
|
||||
|
||||
// 加载医院名称
|
||||
if v.Hospital != nil {
|
||||
response = response.LoadHospitalName(v.Hospital)
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
|
||||
// GetUserDoctorPendingDto 审核详情
|
||||
func GetUserDoctorPendingDto(m *model.UserDoctor) *UserDoctorPendingDto {
|
||||
return &UserDoctorPendingDto{
|
||||
DoctorID: fmt.Sprintf("%d", m.DoctorId),
|
||||
UserID: fmt.Sprintf("%d", m.DoctorId),
|
||||
UserName: m.UserName,
|
||||
Status: m.Status,
|
||||
IDCardStatus: m.Status,
|
||||
IdenAuthStatus: m.IdenAuthStatus,
|
||||
IdenAuthTime: m.IdenAuthTime,
|
||||
Avatar: utils.AddOssDomain(m.Avatar),
|
||||
DoctorTitle: m.DoctorTitle,
|
||||
DepartmentCustomID: fmt.Sprintf("%d", m.DoctorId),
|
||||
DepartmentCustomName: m.DepartmentCustomName,
|
||||
DepartmentCustomMobile: m.DepartmentCustomMobile,
|
||||
HospitalID: fmt.Sprintf("%d", m.DoctorId),
|
||||
BeGoodAt: m.BeGoodAt,
|
||||
BriefIntroduction: m.BriefIntroduction,
|
||||
IsPlatformDeepCooperation: m.IsPlatformDeepCooperation,
|
||||
IsEnterpriseDeepCooperation: m.IsEnterpriseDeepCooperation,
|
||||
IsSysDiagnoCooperation: m.IsSysDiagnoCooperation,
|
||||
IsRecommend: m.IsRecommend,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
// GetUserDoctorPendingListDto 审核列表
|
||||
func GetUserDoctorPendingListDto(m []*model.UserDoctor) []*UserDoctorDto {
|
||||
// 处理返回值
|
||||
responses := make([]*UserDoctorDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := &UserDoctorDto{
|
||||
DoctorID: fmt.Sprintf("%d", v.DoctorId),
|
||||
UserID: fmt.Sprintf("%d", v.UserId),
|
||||
UserName: v.UserName,
|
||||
Status: v.Status,
|
||||
IDCardStatus: v.Status,
|
||||
IdenAuthStatus: v.IdenAuthStatus,
|
||||
IdenAuthTime: v.IdenAuthTime,
|
||||
IdenAuthFailReason: v.IdenAuthFailReason,
|
||||
Avatar: utils.AddOssDomain(v.Avatar),
|
||||
DoctorTitle: v.DoctorTitle,
|
||||
DepartmentCustomName: v.DepartmentCustomName,
|
||||
DepartmentCustomMobile: v.DepartmentCustomMobile,
|
||||
HospitalID: fmt.Sprintf("%d", v.HospitalID),
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 加载用户属性
|
||||
if v.User != nil {
|
||||
response = response.LoadUserAttr(v.User)
|
||||
}
|
||||
|
||||
// 加载医院名称
|
||||
if v.Hospital != nil {
|
||||
response = response.LoadHospitalName(v.Hospital)
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
|
||||
// LoadUser 加载用户
|
||||
func (r *UserDoctorDto) LoadUser(m *model.User) *UserDoctorDto {
|
||||
if m != nil {
|
||||
userDto := GetUserDto(m)
|
||||
|
||||
r.User = userDto
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadUser 加载用户
|
||||
func (r *UserDoctorPendingDto) LoadUser(m *model.User) *UserDoctorPendingDto {
|
||||
if m != nil {
|
||||
userDto := GetUserDto(m)
|
||||
|
||||
r.User = userDto
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadUserAttr 加载用户属性
|
||||
func (r *UserDoctorDto) LoadUserAttr(m *model.User) *UserDoctorDto {
|
||||
if m != nil {
|
||||
r.Mobile = m.Mobile
|
||||
r.RegisterMethod = m.RegisterMethod
|
||||
r.Age = m.Age
|
||||
r.Sex = m.Sex
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadHospitalName 加载医院名称
|
||||
func (r *UserDoctorDto) LoadHospitalName(m *model.Hospital) *UserDoctorDto {
|
||||
if m != nil {
|
||||
r.HospitalName = m.HospitalName
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadHospital 加载医院
|
||||
func (r *UserDoctorDto) LoadHospital(m *model.Hospital) *UserDoctorDto {
|
||||
if m != nil {
|
||||
r.Hospital = GetHospitalDto(m)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadHospital 加载医院
|
||||
func (r *UserDoctorPendingDto) LoadHospital(m *model.Hospital) *UserDoctorPendingDto {
|
||||
if m != nil {
|
||||
r.Hospital = GetHospitalDto(m)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadExpertise 加载医生专长
|
||||
func (r *UserDoctorDto) LoadExpertise(m *model.Hospital) *UserDoctorDto {
|
||||
if m != nil {
|
||||
r.Hospital = GetHospitalDto(m)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadExpertise 加载医生专长
|
||||
func (r *UserDoctorPendingDto) LoadExpertise(m *model.Hospital) *UserDoctorPendingDto {
|
||||
if m != nil {
|
||||
r.Hospital = GetHospitalDto(m)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadDoctorBankCard 加载医生银行卡
|
||||
func (r *UserDoctorDto) LoadDoctorBankCard(m *model.DoctorBankCard) *UserDoctorDto {
|
||||
if m != nil {
|
||||
r.DoctorBankCard = GetDoctorBankCardDto(m)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadUserDoctorInfo 加载医生详情
|
||||
func (r *UserDoctorDto) LoadUserDoctorInfo(m *model.UserDoctorInfo) *UserDoctorDto {
|
||||
if m != nil {
|
||||
r.UserDoctorInfo = GetUserDoctorInfoDto(m)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadUserDoctorInfo 加载医生详情
|
||||
func (r *UserDoctorPendingDto) LoadUserDoctorInfo(m *model.UserDoctorInfo) *UserDoctorPendingDto {
|
||||
if m != nil {
|
||||
r.UserDoctorInfo = GetUserDoctorInfoDto(m)
|
||||
}
|
||||
return r
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/utils"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type UserDoctorInfoDto struct {
|
||||
DoctorInfoId string `json:"doctor_info_id"` // 主键
|
||||
UserId string `json:"user_id"` // 用户id
|
||||
DoctorId string `json:"doctor_id"` // 医生id
|
||||
CardType int `json:"card_type"` // 类型(1:身份证 2:护照 3:港澳通行证 4:台胞证);NOT NULL
|
||||
CardName string `json:"card_name"` // 证件姓名
|
||||
CardNameMask string `json:"card_name_mask"` // 证件姓名(掩码)
|
||||
CardNumMask string `json:"card_num_mask"` // 证件号码(掩码)
|
||||
LicenseCert []string `json:"license_cert"` // 医师执业证(逗号分隔)
|
||||
QualificationCert []string `json:"qualification_cert"` // 医师资格证(逗号分隔)
|
||||
QualificationCertNum string `json:"qualification_cert_num"` // 医师资格证号(逗号分隔)
|
||||
WorkCert []string `json:"work_cert"` // 医师工作证(逗号分隔)
|
||||
MultiPointImages []string `json:"multi_point_images"` // 多点执业备案信息(逗号分隔)
|
||||
IdCardFront string `json:"id_card_front"` // 身份证正面图片
|
||||
IdCardBack string `json:"id_card_back"` // 身份证背面图片
|
||||
SignImage string `json:"sign_image"` // 签名图片
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
}
|
||||
|
||||
func GetUserDoctorInfoDto(m *model.UserDoctorInfo) *UserDoctorInfoDto {
|
||||
var licenseCert []string
|
||||
if m.LicenseCert != "" {
|
||||
result := strings.Split(m.LicenseCert, ",")
|
||||
if len(result) > 0 {
|
||||
for _, v := range result {
|
||||
v = utils.AddOssDomain(v)
|
||||
licenseCert = append(licenseCert, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var qualificationCert []string
|
||||
if m.QualificationCert != "" {
|
||||
result := strings.Split(m.QualificationCert, ",")
|
||||
if len(result) > 0 {
|
||||
for _, v := range result {
|
||||
v = utils.AddOssDomain(v)
|
||||
qualificationCert = append(qualificationCert, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var workCert []string
|
||||
if m.WorkCert != "" {
|
||||
result := strings.Split(m.WorkCert, ",")
|
||||
if len(result) > 0 {
|
||||
for _, v := range result {
|
||||
v = utils.AddOssDomain(v)
|
||||
workCert = append(workCert, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var multiPointImages []string
|
||||
if m.MultiPointImages != "" {
|
||||
result := strings.Split(m.MultiPointImages, ",")
|
||||
if len(result) > 0 {
|
||||
for _, v := range result {
|
||||
multiPointImages = append(multiPointImages, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return &UserDoctorInfoDto{
|
||||
DoctorInfoId: fmt.Sprintf("%d", m.DoctorInfoId),
|
||||
UserId: fmt.Sprintf("%d", m.UserId),
|
||||
DoctorId: fmt.Sprintf("%d", m.DoctorId),
|
||||
CardType: m.CardType,
|
||||
CardName: m.CardName,
|
||||
CardNameMask: m.CardNameMask,
|
||||
CardNumMask: m.CardNumMask,
|
||||
LicenseCert: licenseCert,
|
||||
QualificationCert: qualificationCert,
|
||||
QualificationCertNum: m.QualificationCertNum,
|
||||
WorkCert: workCert,
|
||||
MultiPointImages: multiPointImages,
|
||||
IdCardFront: utils.AddOssDomain(m.IdCardFront),
|
||||
IdCardBack: utils.AddOssDomain(m.IdCardBack),
|
||||
SignImage: utils.AddOssDomain(m.SignImage),
|
||||
}
|
||||
}
|
||||
|
||||
func GetUserDoctorInfoListDto(m []*model.UserDoctorInfo) []UserDoctorInfoDto {
|
||||
// 处理返回值
|
||||
responses := make([]UserDoctorInfoDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
var licenseCert []string
|
||||
if v.LicenseCert != "" {
|
||||
result := strings.Split(v.LicenseCert, ",")
|
||||
if len(result) > 0 {
|
||||
for _, v := range result {
|
||||
v = utils.AddOssDomain(v)
|
||||
licenseCert = append(licenseCert, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var qualificationCert []string
|
||||
if v.QualificationCert != "" {
|
||||
result := strings.Split(v.QualificationCert, ",")
|
||||
if len(result) > 0 {
|
||||
for _, v := range result {
|
||||
v = utils.AddOssDomain(v)
|
||||
qualificationCert = append(qualificationCert, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var workCert []string
|
||||
if v.WorkCert != "" {
|
||||
result := strings.Split(v.WorkCert, ",")
|
||||
if len(result) > 0 {
|
||||
for _, v := range result {
|
||||
v = utils.AddOssDomain(v)
|
||||
workCert = append(workCert, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var multiPointImages []string
|
||||
if v.MultiPointImages != "" {
|
||||
result := strings.Split(v.MultiPointImages, ",")
|
||||
if len(result) > 0 {
|
||||
for _, v := range result {
|
||||
multiPointImages = append(multiPointImages, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
response := UserDoctorInfoDto{
|
||||
DoctorInfoId: fmt.Sprintf("%d", v.DoctorInfoId),
|
||||
UserId: fmt.Sprintf("%d", v.UserId),
|
||||
DoctorId: fmt.Sprintf("%d", v.DoctorId),
|
||||
CardType: v.CardType,
|
||||
CardName: v.CardName,
|
||||
CardNameMask: v.CardNameMask,
|
||||
CardNumMask: v.CardNumMask,
|
||||
LicenseCert: licenseCert,
|
||||
QualificationCert: qualificationCert,
|
||||
QualificationCertNum: v.QualificationCertNum,
|
||||
WorkCert: workCert,
|
||||
MultiPointImages: multiPointImages,
|
||||
IdCardFront: utils.AddOssDomain(v.IdCardFront),
|
||||
IdCardBack: utils.AddOssDomain(v.IdCardBack),
|
||||
SignImage: utils.AddOssDomain(v.SignImage),
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/utils"
|
||||
)
|
||||
|
||||
type UserPatientDto struct {
|
||||
PatientId string `json:"patient_id"` // 主键id
|
||||
UserId string `json:"user_id"` // 用户id;NOT NULL
|
||||
UserName string `json:"user_name"` // 用户名称
|
||||
Status *int `json:"status"` // 状态(0:禁用 1:正常 2:删除)
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
Mobile string `json:"mobile"` // 手机号
|
||||
DisableReason string `json:"disable_reason"` // 禁用理由
|
||||
PatientFamilyCount int `json:"patient_family_count"` // 家庭成员数量
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
PatientFamily []*PatientFamilyMaskDto `json:"patient_family"` // 家庭成员
|
||||
UserShipAddress []*UserShipAddressDto `json:"user_ship_address"` // 收货地址
|
||||
}
|
||||
|
||||
func GetUserPatientDto(m *model.UserPatient) *UserPatientDto {
|
||||
return &UserPatientDto{
|
||||
PatientId: fmt.Sprintf("%d", m.PatientId),
|
||||
UserId: fmt.Sprintf("%d", m.UserId),
|
||||
UserName: m.UserName,
|
||||
Status: &m.Status,
|
||||
Avatar: utils.AddOssDomain(m.Avatar),
|
||||
DisableReason: m.DisableReason,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetUserPatientListDto(m []*model.UserPatient) []*UserPatientDto {
|
||||
// 处理返回值
|
||||
responses := make([]*UserPatientDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := &UserPatientDto{
|
||||
PatientId: fmt.Sprintf("%d", v.PatientId),
|
||||
UserId: fmt.Sprintf("%d", v.UserId),
|
||||
UserName: v.UserName,
|
||||
Status: &v.Status,
|
||||
Avatar: utils.AddOssDomain(v.Avatar),
|
||||
DisableReason: v.DisableReason,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 加载家庭成员数量
|
||||
response.LoadPatientFamilyCount(v.PatientFamily)
|
||||
|
||||
// 加载患者手机号
|
||||
response.LoadPatientMaskMobile(v.User)
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
|
||||
// LoadPatientFamilyCount 加载家庭成员数量
|
||||
func (r *UserPatientDto) LoadPatientFamilyCount(m []*model.PatientFamily) *UserPatientDto {
|
||||
if len(m) > 0 {
|
||||
r.PatientFamilyCount = len(m)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadPatientMaskMobile 加载患者加密手机号
|
||||
func (r *UserPatientDto) LoadPatientMaskMobile(m *model.User) *UserPatientDto {
|
||||
if m != nil {
|
||||
r.Mobile = utils.MaskPhoneStr(m.Mobile)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadPatientMobile 加载患者手机号
|
||||
func (r *UserPatientDto) LoadPatientMobile(m *model.User) *UserPatientDto {
|
||||
if m != nil {
|
||||
r.Mobile = m.Mobile
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadUserShipAddress 加载用户收货地址
|
||||
func (r *UserPatientDto) LoadUserShipAddress(m []*model.UserShipAddress) *UserPatientDto {
|
||||
if len(m) > 0 {
|
||||
d := GetUserShipAddressListDto(m)
|
||||
|
||||
r.UserShipAddress = d
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadMaskPatientFamily 加载家庭成员数据-加密
|
||||
func (r *UserPatientDto) LoadMaskPatientFamily(m []*model.PatientFamily) *UserPatientDto {
|
||||
if len(m) > 0 {
|
||||
d := GetPatientFamilyMaskListDto(m)
|
||||
|
||||
r.PatientFamily = d
|
||||
}
|
||||
return r
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type UserShipAddressDto struct {
|
||||
AddressId string `json:"address_id"` // 主键id
|
||||
UserId string `json:"user_id"` // 用户id;NOT NULL
|
||||
ProvinceId string `json:"province_id"` // 省份id
|
||||
Province string `json:"province"` // 省份
|
||||
CityId string `json:"city_id"` // 城市id
|
||||
City string `json:"city"` // 城市
|
||||
CountyId string `json:"county_id"` // 区县id
|
||||
County string `json:"county"` // 区县
|
||||
ConsigneeTownId string `json:"consignee_town_id"` // 镇id
|
||||
ConsigneeTown string `json:"consignee_town"` // 镇
|
||||
Address string `json:"address"` // 详细地址
|
||||
AddressMask string `json:"address_mask"` // 详细地址(掩码)
|
||||
ConsigneeName string `json:"consignee_name"` // 收货人姓名;NOT NULL
|
||||
ConsigneeNameMask string `json:"consignee_name_mask"` // 收货人姓名(掩码)
|
||||
ConsigneeTel string `json:"consignee_tel"` // 收货人电话;NOT NULL
|
||||
ConsigneeTelMask string `json:"consignee_tel_mask"` // 收货人电话(掩码)
|
||||
ConsigneeZipCode string `json:"consignee_zip_code"` // 收货邮编
|
||||
IsDefault *int `json:"is_default"` // 默认地址(0:否 1:是)
|
||||
Tag *int `json:"tag"` // 地址标签(1:家 2:公司 3:学校 4:其他)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetUserShipAddressListDto(m []*model.UserShipAddress) []*UserShipAddressDto {
|
||||
// 处理返回值
|
||||
responses := make([]*UserShipAddressDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := &UserShipAddressDto{
|
||||
AddressId: fmt.Sprintf("%d", v.AddressId),
|
||||
UserId: fmt.Sprintf("%d", v.UserId),
|
||||
ProvinceId: fmt.Sprintf("%d", v.ProvinceId),
|
||||
Province: v.Province,
|
||||
CityId: fmt.Sprintf("%d", v.CityId),
|
||||
City: v.City,
|
||||
CountyId: fmt.Sprintf("%d", v.CountyId),
|
||||
County: v.County,
|
||||
ConsigneeTownId: fmt.Sprintf("%d", v.ConsigneeTownId),
|
||||
ConsigneeTown: v.ConsigneeTown,
|
||||
Address: v.Address,
|
||||
AddressMask: v.AddressMask,
|
||||
ConsigneeName: v.ConsigneeName,
|
||||
ConsigneeNameMask: v.ConsigneeNameMask,
|
||||
ConsigneeTel: v.ConsigneeTel,
|
||||
ConsigneeTelMask: v.ConsigneeTelMask,
|
||||
ConsigneeZipCode: v.ConsigneeZipCode,
|
||||
IsDefault: &v.IsDefault,
|
||||
Tag: &v.Tag,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
Reference in New Issue
Block a user