新增药品订单详情
This commit is contained in:
@@ -16,15 +16,15 @@ type OrderPrescription struct {
|
||||
PharmacistId int64 `gorm:"column:pharmacist_id;type:bigint(19);comment:药师id" json:"pharmacist_id"`
|
||||
PrescriptionStatus int `gorm:"column:prescription_status;type:tinyint(1);comment:处方状态(1:待审核 2:待使用 3:已失效 4:已使用)" json:"prescription_status"`
|
||||
PharmacistAuditStatus int `gorm:"column:pharmacist_audit_status;type:tinyint(1);default:0;comment:药师审核状态(0:审核中 1:审核成功 2:审核驳回)" json:"pharmacist_audit_status"`
|
||||
PharmacistVerifyTime time.Time `gorm:"column:pharmacist_verify_time;type:datetime;comment:药师审核时间" json:"pharmacist_verify_time"`
|
||||
PharmacistVerifyTime LocalTime `gorm:"column:pharmacist_verify_time;type:datetime;comment:药师审核时间" json:"pharmacist_verify_time"`
|
||||
PharmacistFailReason string `gorm:"column:pharmacist_fail_reason;type:varchar(255);comment:药师审核驳回原因" json:"pharmacist_fail_reason"`
|
||||
PlatformAuditStatus int `gorm:"column:platform_audit_status;type:tinyint(1);default:0;comment:处方平台审核状态(0:审核中 1:审核成功 2:审核驳回)" json:"platform_audit_status"`
|
||||
PlatformFailTime time.Time `gorm:"column:platform_fail_time;type:datetime;comment:平台审核失败时间" json:"platform_fail_time"`
|
||||
PlatformFailTime LocalTime `gorm:"column:platform_fail_time;type:datetime;comment:平台审核失败时间" json:"platform_fail_time"`
|
||||
PlatformFailReason string `gorm:"column:platform_fail_reason;type:varchar(255);comment:处方平台驳回原因" json:"platform_fail_reason"`
|
||||
IsAutoPharVerify int `gorm:"column:is_auto_phar_verify;type:tinyint(1);default:0;comment:是否药师自动审核(0:否 1:是)" json:"is_auto_phar_verify"`
|
||||
DoctorCreatedTime time.Time `gorm:"column:doctor_created_time;type:datetime;comment:医生开具处方时间" json:"doctor_created_time"`
|
||||
ExpiredTime time.Time `gorm:"column:expired_time;type:datetime;comment:处方过期时间" json:"expired_time"`
|
||||
VoidTime time.Time `gorm:"column:void_time;type:datetime;comment:处方作废时间" json:"void_time"`
|
||||
DoctorCreatedTime LocalTime `gorm:"column:doctor_created_time;type:datetime;comment:医生开具处方时间" json:"doctor_created_time"`
|
||||
ExpiredTime LocalTime `gorm:"column:expired_time;type:datetime;comment:处方过期时间" json:"expired_time"`
|
||||
VoidTime LocalTime `gorm:"column:void_time;type:datetime;comment:处方作废时间" json:"void_time"`
|
||||
IsDelete int `gorm:"column:is_delete;type:tinyint(1);default:0;comment:是否删除(0:否 1:是)" json:"is_delete"`
|
||||
PrescriptionCode string `gorm:"column:prescription_code;type:varchar(255);comment:处方编号" json:"prescription_code"`
|
||||
DoctorName string `gorm:"column:doctor_name;type:varchar(100);comment:医生名称" json:"doctor_name"`
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"hospital-admin-api/global"
|
||||
"time"
|
||||
)
|
||||
|
||||
// OrderProductItem 订单-商品订单列表
|
||||
type OrderProductItem struct {
|
||||
ProductItemId int64 `gorm:"column:product_item_id;type:bigint(19);primary_key;comment:主键id" json:"product_item_id"`
|
||||
OrderProductId int64 `gorm:"column:order_product_id;type:bigint(19);comment:订单-商品订单id" json:"order_product_id"`
|
||||
OrderInquiryId int64 `gorm:"column:order_inquiry_id;type:bigint(19);comment:订单-问诊id" json:"order_inquiry_id"`
|
||||
OrderPrescriptionId int64 `gorm:"column:order_prescription_id;type:bigint(19);comment:订单-处方id" json:"order_prescription_id"`
|
||||
ProductId int64 `gorm:"column:product_id;type:bigint(19);comment:商品id" json:"product_id"`
|
||||
ProductName string `gorm:"column:product_name;type:varchar(255);comment:商品名称" json:"product_name"`
|
||||
ProductPrice float64 `gorm:"column:product_price;type:decimal(10,2);comment:商品价格" json:"product_price"`
|
||||
ProductPlatformCode string `gorm:"column:product_platform_code;type:varchar(100);comment:商品处方平台编码" json:"product_platform_code"`
|
||||
Amount int `gorm:"column:amount;type:int(11);comment:数量" json:"amount"`
|
||||
Manufacturer string `gorm:"column:manufacturer;type:varchar(255);comment:生产厂家" json:"manufacturer"`
|
||||
ProductCoverImg string `gorm:"column:product_cover_img;type:varchar(255);comment:商品封面图" json:"product_cover_img"`
|
||||
ProductSpec string `gorm:"column:product_spec;type:varchar(255);comment:商品规格" json:"product_spec"`
|
||||
Model
|
||||
}
|
||||
|
||||
func (m *OrderProductItem) TableName() string {
|
||||
return "gdxz_order_product_item"
|
||||
}
|
||||
|
||||
func (m *OrderProductItem) BeforeCreate(tx *gorm.DB) error {
|
||||
if m.ProductItemId == 0 {
|
||||
m.ProductItemId = global.Snowflake.Generate().Int64()
|
||||
}
|
||||
|
||||
m.CreatedAt = LocalTime(time.Now())
|
||||
tx.Statement.SetColumn("CreatedAt", m.CreatedAt)
|
||||
|
||||
m.UpdatedAt = LocalTime(time.Now())
|
||||
tx.Statement.SetColumn("UpdatedAt", m.UpdatedAt)
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"hospital-admin-api/global"
|
||||
"time"
|
||||
)
|
||||
|
||||
// OrderProductLogistics 商品订单-物流数据
|
||||
type OrderProductLogistics struct {
|
||||
LogisticsId int64 `gorm:"column:logistics_id;type:bigint(19);primary_key;comment:主键id" json:"logistics_id"`
|
||||
OrderProductId int64 `gorm:"column:order_product_id;type:bigint(19);comment:药品订单id;NOT NULL" json:"order_product_id"`
|
||||
LogisticsStatus int `gorm:"column:logistics_status;type:tinyint(1);comment:运单签收状态(0在途 1揽收 2疑难 3签收 4退签 5派件 8清关 14拒签);NOT NULL" json:"logistics_status"`
|
||||
LogisticsNo string `gorm:"column:logistics_no;type:varchar(255);comment:物流编号" json:"logistics_no"`
|
||||
CompanyName string `gorm:"column:company_name;type:varchar(255);comment:快递公司名称" json:"company_name"`
|
||||
CompanyCode string `gorm:"column:company_code;type:varchar(255);comment:快递公司编码" json:"company_code"`
|
||||
LogisticsContent string `gorm:"column:logistics_content;type:text;comment:内容" json:"logistics_content"`
|
||||
Model
|
||||
}
|
||||
|
||||
func (m *OrderProductLogistics) TableName() string {
|
||||
return "gdxz_order_product_logistics"
|
||||
}
|
||||
|
||||
func (m *OrderProductLogistics) BeforeCreate(tx *gorm.DB) error {
|
||||
if m.LogisticsId == 0 {
|
||||
m.LogisticsId = global.Snowflake.Generate().Int64()
|
||||
}
|
||||
|
||||
m.CreatedAt = LocalTime(time.Now())
|
||||
tx.Statement.SetColumn("CreatedAt", m.CreatedAt)
|
||||
|
||||
m.UpdatedAt = LocalTime(time.Now())
|
||||
tx.Statement.SetColumn("UpdatedAt", m.UpdatedAt)
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"hospital-admin-api/global"
|
||||
"time"
|
||||
)
|
||||
|
||||
// OrderProductRefund 订单-药品-退款表
|
||||
type OrderProductRefund struct {
|
||||
ProductRefundId int64 `gorm:"column:product_refund_id;type:bigint(19);primary_key;comment:主键id" json:"product_refund_id"`
|
||||
PatientId int64 `gorm:"column:patient_id;type:bigint(19);comment:患者id" json:"patient_id"`
|
||||
OrderProductId int64 `gorm:"column:order_product_id;type:bigint(19);comment:订单-药品订单id" json:"order_product_id"`
|
||||
OrderProductNo string `gorm:"column:order_product_no;type:varchar(100);comment:系统订单编号" json:"order_product_no"`
|
||||
ProductRefundNo string `gorm:"column:product_refund_no;type:varchar(50);comment:系统退款编号" json:"product_refund_no"`
|
||||
RefundId string `gorm:"column:refund_id;type:varchar(50);comment:第三方退款单号" json:"refund_id"`
|
||||
ProductRefundStatus int `gorm:"column:product_refund_status;type:tinyint(4);comment:商品订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭 6:退款异常)" json:"product_refund_status"`
|
||||
RefundTotal float64 `gorm:"column:refund_total;type:decimal(10,2);comment:退款金额" json:"refund_total"`
|
||||
RefundReason string `gorm:"column:refund_reason;type:varchar(255);comment:退款原因" json:"refund_reason"`
|
||||
SuccessTime LocalTime `gorm:"column:success_time;type:datetime;comment:退款成功时间" json:"success_time"`
|
||||
Model
|
||||
}
|
||||
|
||||
func (m *OrderProductRefund) TableName() string {
|
||||
return "gdxz_order_product_refund"
|
||||
}
|
||||
|
||||
func (m *OrderProductRefund) BeforeCreate(tx *gorm.DB) error {
|
||||
if m.ProductRefundId == 0 {
|
||||
m.ProductRefundId = global.Snowflake.Generate().Int64()
|
||||
}
|
||||
|
||||
m.CreatedAt = LocalTime(time.Now())
|
||||
tx.Statement.SetColumn("CreatedAt", m.CreatedAt)
|
||||
|
||||
m.UpdatedAt = LocalTime(time.Now())
|
||||
tx.Statement.SetColumn("UpdatedAt", m.UpdatedAt)
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user