ソースを参照

11月8日库存管理

XMLWAN 3 年 前
コミット
47db7ba988
共有1 個のファイルを変更した29 個の追加0 個の削除を含む
  1. 29 0
      controllers/patient_api_controller.go

+ 29 - 0
controllers/patient_api_controller.go ファイルの表示

@@ -76,6 +76,8 @@ func PatientApiRegistRouters() {
76 76
 
77 77
 	beego.Router("/api/patients/dialysis_no", &PatientApiController{}, "Get:GetMaxDialysisNo")
78 78
 
79
+	beego.Router("/api/patients/banner", &PatientApiController{}, "Get:GetBanner")
80
+
79 81
 }
80 82
 
81 83
 //GetPatientsList 取患者列表
@@ -4749,3 +4751,30 @@ func GenerateDialysisNoTwo(patients []*models.Patients) string {
4749 4751
 	}
4750 4752
 	return GenerateDialysisNoTwo(patients)
4751 4753
 }
4754
+
4755
+func (c *PatientApiController) GetBanner() {
4756
+
4757
+	orgId := c.GetAdminUserInfo().CurrentOrgId
4758
+
4759
+	_, errcodes := service.GetOrgFollowIsExist(orgId)
4760
+
4761
+	if errcodes == gorm.ErrRecordNotFound {
4762
+		information, err := service.GetAdminUserRoleInformation(0)
4763
+		if err != nil {
4764
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4765
+			return
4766
+		}
4767
+		c.ServeSuccessJSON(map[string]interface{}{
4768
+			"information": information,
4769
+		})
4770
+	} else if errcodes == nil {
4771
+		information, err := service.GetAdminUserRoleInformation(0)
4772
+		if err != nil {
4773
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4774
+			return
4775
+		}
4776
+		c.ServeSuccessJSON(map[string]interface{}{
4777
+			"information": information,
4778
+		})
4779
+	}
4780
+}