23
This commit is contained in:
parent
76c1c3b849
commit
613feb2dd0
@ -501,6 +501,24 @@ func (r *Export) OrderProduct(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 特殊处理
|
||||||
|
// 获取配置
|
||||||
|
systemConfigDao := dao.SystemConfigDao{}
|
||||||
|
systemConfig, err := systemConfigDao.GetSystemConfigById(1)
|
||||||
|
if err != nil {
|
||||||
|
responses.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 年度审查
|
||||||
|
if systemConfig.IsAnnualReview == 1 {
|
||||||
|
adminUserId := c.GetInt64("UserId")
|
||||||
|
if adminUserId == 1845704393354121216 || adminUserId == 1732273543535661056 {
|
||||||
|
annualReviewHide := 0
|
||||||
|
req.AnnualReviewHide = &annualReviewHide
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 获取数据
|
// 获取数据
|
||||||
orderProductDao := dao.OrderProductDao{}
|
orderProductDao := dao.OrderProductDao{}
|
||||||
orderProducts, err := orderProductDao.GetOrderProductExportListSearch(req)
|
orderProducts, err := orderProductDao.GetOrderProductExportListSearch(req)
|
||||||
|
|||||||
@ -38,6 +38,24 @@ func (r *OrderProduct) GetOrderProductPage(c *gin.Context) {
|
|||||||
req.PageSize = 20
|
req.PageSize = 20
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 特殊处理
|
||||||
|
// 获取配置
|
||||||
|
systemConfigDao := dao.SystemConfigDao{}
|
||||||
|
systemConfig, err := systemConfigDao.GetSystemConfigById(1)
|
||||||
|
if err != nil {
|
||||||
|
responses.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 年度审查
|
||||||
|
if systemConfig.IsAnnualReview == 1 {
|
||||||
|
adminUserId := c.GetInt64("UserId")
|
||||||
|
if adminUserId == 1845704393354121216 || adminUserId == 1732273543535661056 {
|
||||||
|
annualReviewHide := 0
|
||||||
|
req.AnnualReviewHide = &annualReviewHide
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
orderProductDao := dao.OrderProductDao{}
|
orderProductDao := dao.OrderProductDao{}
|
||||||
orderProduct, total, err := orderProductDao.GetOrderProductPageSearch(req, req.Page, req.PageSize)
|
orderProduct, total, err := orderProductDao.GetOrderProductPageSearch(req, req.Page, req.PageSize)
|
||||||
|
|
||||||
|
|||||||
@ -123,6 +123,12 @@ func (r *OrderProductDao) GetOrderProductPageSearch(req requests.GetOrderProduct
|
|||||||
// 构建查询条件
|
// 构建查询条件
|
||||||
query := global.Db.Model(&model.OrderProduct{})
|
query := global.Db.Model(&model.OrderProduct{})
|
||||||
|
|
||||||
|
// 年度审查隐藏
|
||||||
|
if req.AnnualReviewHide != nil {
|
||||||
|
query = query.Joins("JOIN gdxz_order_inquiry ON gdxz_order_inquiry.order_inquiry_id = gdxz_order_product.order_inquiry_id")
|
||||||
|
query = query.Where("gdxz_order_inquiry.annual_review_hide = ?", req.AnnualReviewHide)
|
||||||
|
}
|
||||||
|
|
||||||
// 药品数据
|
// 药品数据
|
||||||
query = query.Preload("OrderProductItem")
|
query = query.Preload("OrderProductItem")
|
||||||
|
|
||||||
@ -412,6 +418,12 @@ func (r *OrderProductDao) GetOrderProductExportListSearch(req requests.OrderProd
|
|||||||
// 构建查询条件
|
// 构建查询条件
|
||||||
query := global.Db.Model(&model.OrderProduct{})
|
query := global.Db.Model(&model.OrderProduct{})
|
||||||
|
|
||||||
|
// 年度审查隐藏
|
||||||
|
if req.AnnualReviewHide != nil {
|
||||||
|
query = query.Joins("JOIN gdxz_order_inquiry ON gdxz_order_inquiry.order_inquiry_id = gdxz_order_product.order_inquiry_id")
|
||||||
|
query = query.Where("gdxz_order_inquiry.annual_review_hide = ?", req.AnnualReviewHide)
|
||||||
|
}
|
||||||
|
|
||||||
// 医生
|
// 医生
|
||||||
query = query.Preload("UserDoctor", func(db *gorm.DB) *gorm.DB {
|
query = query.Preload("UserDoctor", func(db *gorm.DB) *gorm.DB {
|
||||||
return db.Omit("open_id", "union_id", "wx_session_key")
|
return db.Omit("open_id", "union_id", "wx_session_key")
|
||||||
|
|||||||
@ -34,7 +34,7 @@ type GetOrderProductPage struct {
|
|||||||
ProductName string `json:"product_name" form:"product_name" label:"药品名称"`
|
ProductName string `json:"product_name" form:"product_name" label:"药品名称"`
|
||||||
CommonName string `json:"common_name" form:"common_name" label:"药品通用名"`
|
CommonName string `json:"common_name" form:"common_name" label:"药品通用名"`
|
||||||
PrescriptionCode string `json:"prescription_code" form:"prescription_code" label:"处方编号"`
|
PrescriptionCode string `json:"prescription_code" form:"prescription_code" label:"处方编号"`
|
||||||
|
AnnualReviewHide *int `json:"-" form:"-"` // 内部传递条件
|
||||||
}
|
}
|
||||||
|
|
||||||
// CancelOrderProduct 取消药品订单
|
// CancelOrderProduct 取消药品订单
|
||||||
@ -67,4 +67,5 @@ type OrderProductExportList struct {
|
|||||||
ConsigneeTel string `json:"consignee_tel" form:"cancel_reason" label:"收货人电话"`
|
ConsigneeTel string `json:"consignee_tel" form:"cancel_reason" label:"收货人电话"`
|
||||||
PatientName string `json:"patient_name" form:"patient_name" label:"患者姓名-就诊人"`
|
PatientName string `json:"patient_name" form:"patient_name" label:"患者姓名-就诊人"`
|
||||||
Mobile string `json:"mobile" form:"mobile" label:"手机号-医生/患者"`
|
Mobile string `json:"mobile" form:"mobile" label:"手机号-医生/患者"`
|
||||||
|
AnnualReviewHide *int `json:"-" form:"-"` // 内部传递条件
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user