diff --git a/api/controller/userPatient.go b/api/controller/userPatient.go new file mode 100644 index 0000000..0dc5e57 --- /dev/null +++ b/api/controller/userPatient.go @@ -0,0 +1,3 @@ +package controller + +type UserPatient struct{} diff --git a/api/dao/orderInquiry.go b/api/dao/orderInquiry.go index 4276c3b..25e1c78 100644 --- a/api/dao/orderInquiry.go +++ b/api/dao/orderInquiry.go @@ -196,6 +196,16 @@ func (r *OrderInquiryDao) GetOrderInquiryPageSearch(req requests.GetOrderInquiry } } + // 创建时间 + if req.CreatedAt != "" { + createdAt := strings.Split(req.CreatedAt, "&") + if len(createdAt) == 2 { + startTime, _ := time.Parse("2006-01-02", createdAt[0]) + endTime, _ := time.Parse("2006-01-02", createdAt[1]) + query = query.Where("created_at BETWEEN ? AND ?", startTime, endTime) + } + } + // 患者姓名-就诊人 if req.PatientName != "" { query = query.Where("patient_name LIKE ?", "%"+req.PatientName+"%") diff --git a/api/dao/orderProduct.go b/api/dao/orderProduct.go index 33763d1..babea36 100644 --- a/api/dao/orderProduct.go +++ b/api/dao/orderProduct.go @@ -215,6 +215,16 @@ func (r *OrderProductDao) GetOrderProductPageSearch(req requests.GetOrderProduct } } + // 创建时间 + if req.CreatedAt != "" { + createdAt := strings.Split(req.CreatedAt, "&") + if len(createdAt) == 2 { + startTime, _ := time.Parse("2006-01-02", createdAt[0]) + endTime, _ := time.Parse("2006-01-02", createdAt[1]) + query = query.Where("created_at BETWEEN ? AND ?", startTime, endTime) + } + } + // 收货人姓名 if req.ConsigneeName != "" { query = query.Where("consignee_name LIKE ?", "%"+req.ConsigneeName+"%") diff --git a/api/requests/orderInquiry.go b/api/requests/orderInquiry.go index cc169ca..820a586 100644 --- a/api/requests/orderInquiry.go +++ b/api/requests/orderInquiry.go @@ -24,6 +24,7 @@ type GetOrderInquiryPage struct { FinishTime string `json:"finish_time" form:"finish_time" label:"订单结束时间"` // 时间区间,数组形式,下标0为开始时间,下标1为结束时间 IsWithdrawal *int `json:"is_withdrawal" form:"is_withdrawal" label:"是否提现"` // 0:否 1:是 2:提现中 CancelTime string `json:"cancel_time" form:"cancel_time" label:"订单取消时间"` // 时间区间,数组形式,下标0为开始时间,下标1为结束时间 + CreatedAt string `json:"created_at" form:"created_at" label:"订单创建时间"` // 时间区间,数组形式,下标0为开始时间,下标1为结束时间 PatientName string `json:"patient_name" form:"patient_name" label:"患者姓名-就诊人"` Mobile string `json:"mobile" form:"mobile" label:"手机号-医生/患者"` } diff --git a/api/requests/orderProduct.go b/api/requests/orderProduct.go index 1b2f306..3965fad 100644 --- a/api/requests/orderProduct.go +++ b/api/requests/orderProduct.go @@ -25,6 +25,7 @@ type GetOrderProductPage struct { CancelTime string `json:"cancel_time" form:"cancel_time" label:"订单取消时间"` // 时间区间,数组形式,下标0为开始时间,下标1为结束时间 PayTime string `json:"pay_time" form:"pay_time" label:"支付时间"` // 时间区间,数组形式,下标0为开始时间,下标1为结束时间 ReportPreTime string `json:"report_pre_time" form:"report_pre_time" label:"上报处方平台时间"` // 时间区间,数组形式,下标0为开始时间,下标1为结束时间 + CreatedAt string `json:"created_at" form:"created_at" label:"订单创建时间"` // 时间区间,数组形式,下标0为开始时间,下标1为结束时间 ConsigneeName string `json:"consignee_name" form:"consignee_name" label:"收货人姓名"` ConsigneeTel string `json:"consignee_tel" form:"cancel_reason" label:"收货人电话"` PatientName string `json:"patient_name" form:"patient_name" label:"患者姓名-就诊人"` diff --git a/api/router/router.go b/api/router/router.go index bda8039..3d9467c 100644 --- a/api/router/router.go +++ b/api/router/router.go @@ -374,7 +374,7 @@ func privateRouter(r *gin.Engine, api controller.Api) { inquiryGroup.PUT("/cancel/:order_inquiry_id", api.OrderInquiry.CancelOrderInquiry) } - // 问诊订单 + // 药品订单 productGroup := orderGroup.Group("/product") { // 获取药品订单列表-分页 @@ -396,4 +396,33 @@ func privateRouter(r *gin.Engine, api controller.Api) { // 上报监管平台 } } + + // 患者管理 + patientGroup := adminGroup.Group("/patient") + { + // 获取患者列表-分页 + patientGroup.GET("", api.UserDoctor.GetUserDoctorPage) + + // 患者详情 + patientGroup.GET("/:patient_id", api.UserDoctor.GetUserDoctor) + + // 修改患者状态 + patientGroup.PUT("/status/:patient_id", api.UserDoctor.GetUserDoctor) + + // 就诊人管理 + patientFamilyGroup := doctorGroup.Group("/family") + { + // 获取就诊人列表-分页 + patientFamilyGroup.GET("", api.UserDoctor.GetUserDoctorPendingPage) + + // 就诊人详情 + patientFamilyGroup.GET("/:family_id", api.UserDoctor.GetUserDoctorPending) + + // 删除就诊人 + patientFamilyGroup.DELETE("/:family_id", api.UserDoctor.PutUserDoctorPending) + + // 修改就诊人状态 + patientFamilyGroup.DELETE("/status/:family_id", api.UserDoctor.PutUserDoctorPending) + } + } }