新增药品订单详情

This commit is contained in:
2023-09-11 14:34:50 +08:00
parent e82932ab53
commit 0a51e0fcbc
19 changed files with 869 additions and 116 deletions
@@ -0,0 +1,34 @@
package orderPrescriptionResponse
import (
"hospital-admin-api/api/model"
)
type OrderPrescription 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"` // 修改时间
}
@@ -0,0 +1,57 @@
package orderProductItemResponse
import (
"hospital-admin-api/api/model"
"hospital-admin-api/utils"
"strconv"
)
type OrderProductItem 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"` // 修改时间
}
// GetOrderProductItemListResponse 获取订单商品列表
func GetOrderProductItemListResponse(u []*model.OrderProductItem) []*OrderProductItem {
// 处理返回值
orderProductItemResponses := make([]*OrderProductItem, len(u))
if len(u) > 0 {
for i, v := range u {
// 将原始结构体转换为新结构体
orderProductItemResponse := &OrderProductItem{
ProductItemId: strconv.Itoa(int(v.ProductItemId)),
OrderProductId: strconv.Itoa(int(v.OrderProductId)),
OrderInquiryId: strconv.Itoa(int(v.OrderInquiryId)),
OrderPrescriptionId: strconv.Itoa(int(v.OrderPrescriptionId)),
ProductId: strconv.Itoa(int(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,
}
// 将转换后的结构体添加到新切片中
orderProductItemResponses[i] = orderProductItemResponse
}
}
return orderProductItemResponses
}
@@ -0,0 +1,17 @@
package orderProductLogisticsResponse
import (
"hospital-admin-api/api/model"
)
type OrderProductLogistics 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"` // 修改时间
}
@@ -0,0 +1,21 @@
package orderProductRefundResponse
import (
"hospital-admin-api/api/model"
)
// OrderProductRefund 药品订单退款详情
type OrderProductRefund 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"` // 修改时间
}
@@ -3,6 +3,12 @@ package orderProductResponse
import (
"fmt"
"hospital-admin-api/api/model"
"hospital-admin-api/api/responses/orderInquiryCaseResponse"
"hospital-admin-api/api/responses/orderPrescriptionResponse"
"hospital-admin-api/api/responses/orderProductItemResponse"
"hospital-admin-api/api/responses/orderProductLogisticsResponse"
"hospital-admin-api/api/responses/orderProductRefundResponse"
"hospital-admin-api/api/responses/userDoctorResponse"
)
// getOrderProductPage 获取医生列表-分页
@@ -39,48 +45,44 @@ type getOrderProductPage struct {
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
}
// // GetOrderProduct 问诊订单详情
// type GetOrderProduct struct {
// OrderProductId 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"` // 患者年龄-就诊人
// OrderProductCoupon *orderInquiryCouponResponse.OrderProductCoupon `json:"order_inquiry_coupon"` // 订单优惠卷
// OrderProductCase *orderInquiryCaseResponse.OrderProductCase `json:"order_inquiry_case"` // 问诊病例
// OrderProductRefund *orderInquiryRefundResponse.OrderProductRefund `json:"order_inquiry_refund"` // 退款数据
// OrderEvaluation *orderEvaluationResponse.OrderEvaluation `json:"order_evaluation"` // 订单评价
// UserDoctor *userDoctorResponse.OrderProductUserDoctor `json:"user_doctor"` // 医生数据
// CreatedAt model.LocalTime `json:"created_at"` // 创建时间
// UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
// }
// GetOrderProduct 问诊订单详情
type GetOrderProduct 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:退款异常)
ReportPreStatus int `json:"report_pre_status"` // 上报处方平台状态(0:未上报 1:已上报 2:上报失败)
ConsigneeNameMask string `json:"consignee_name_mask"` // 收货人姓名(掩码)
ConsigneeTelMask string `json:"consignee_tel_mask"` // 收货人电话(掩码
PatientNameMask string `json:"patient_name_mask"` // 患者姓名-就诊人(掩码)
PatientSex int `json:"patient_sex"` // 患者性别-就诊人(0:未知 1:男 2:女)
PatientAge int `json:"patient_age"` // 患者年龄-就诊人
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
OrderProductRefund *orderProductRefundResponse.OrderProductRefund `json:"order_product_refund"` // 退款数据
OrderProductItem []*orderProductItemResponse.OrderProductItem `json:"order_product_item"` // 商品数据
OrderProductLogistics *orderProductLogisticsResponse.OrderProductLogistics `json:"order_product_logistics"` // 物流数据
UserDoctor *userDoctorResponse.OrderInquiryUserDoctor `json:"user_doctor"` // 医生数据
OrderPrescription *orderPrescriptionResponse.OrderPrescription `json:"order_prescription"` // 处方数据
OrderInquiryCase *orderInquiryCaseResponse.OrderInquiryCase `json:"order_inquiry_case"` // 问诊病例
}
// GetOrderProductPageResponse 获取药品订单列表-分页
func GetOrderProductPageResponse(orderProduct []*model.OrderProduct) []getOrderProductPage {