增加年度审查隐藏字段
This commit is contained in:
@@ -54,8 +54,10 @@ func (r *OrderInquiry) GetOrderInquiryPage(c *gin.Context) {
|
||||
if adminUserId == 1845704393354121216 || adminUserId == 1732273543535661056 {
|
||||
status := 1
|
||||
req.MultiPointStatus = &status
|
||||
}
|
||||
|
||||
annualReviewHide := 0
|
||||
req.AnnualReviewHide = &annualReviewHide
|
||||
}
|
||||
}
|
||||
|
||||
orderInquiryDao := dao.OrderInquiryDao{}
|
||||
@@ -105,6 +107,40 @@ func (r *OrderInquiry) GetOrderInquiry(c *gin.Context) {
|
||||
|
||||
responses.OkWithData(getUserDoctorResponses, c)
|
||||
}
|
||||
// PutAnnualReviewHide 修改问诊订单年度审查隐藏状态
|
||||
func (r *OrderInquiry) PutAnnualReviewHide(c *gin.Context) {
|
||||
id := c.Param("order_inquiry_id")
|
||||
if id == "" {
|
||||
responses.FailWithMessage("缺少参数", c)
|
||||
return
|
||||
}
|
||||
|
||||
orderInquiryId, err := strconv.ParseInt(id, 10, 64)
|
||||
if err != nil {
|
||||
responses.Fail(c)
|
||||
return
|
||||
}
|
||||
|
||||
req := requests.PutAnnualReviewHide{}
|
||||
if err := c.ShouldBind(&req); err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
if err := global.Validate.Struct(req); err != nil {
|
||||
responses.FailWithMessage(utils.Translate(err), c)
|
||||
return
|
||||
}
|
||||
|
||||
orderInquiryService := service.OrderInquiryService{}
|
||||
err = orderInquiryService.PutAnnualReviewHide(orderInquiryId, *req.AnnualReviewHide)
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
responses.Ok(c)
|
||||
}
|
||||
|
||||
// CancelOrderInquiry 取消问诊订单
|
||||
func (r *OrderInquiry) CancelOrderInquiry(c *gin.Context) {
|
||||
@@ -203,8 +239,10 @@ func (r *OrderInquiry) GetOrderInquiryRecordPage(c *gin.Context) {
|
||||
if adminUserId == 1845704393354121216 || adminUserId == 1732273543535661056 {
|
||||
status := 1
|
||||
req.GetOrderInquiryRecordPage.MultiPointStatus = &status
|
||||
}
|
||||
|
||||
annualReviewHide := 0
|
||||
req.GetOrderInquiryRecordPage.AnnualReviewHide = &annualReviewHide
|
||||
}
|
||||
}
|
||||
|
||||
orderInquiryDao := dao.OrderInquiryDao{}
|
||||
@@ -323,6 +361,24 @@ func (r *OrderInquiry) GetOrderInquiryForAccountPage(c *gin.Context) {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
orderInquiryDao := dao.OrderInquiryDao{}
|
||||
orderInquiry, total, err := orderInquiryDao.GetOrderInquiryForAccountPageSearch(req, req.Page, req.PageSize)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user