Browse Source

Merge branch 'master' of http://git.shengws.com/csx/XT_New

csx 4 years ago
parent
commit
475a6492d3

+ 16 - 0
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -6250,3 +6250,19 @@ func (c *DialysisAPIController) GetSchedule() {
6250 6250
 	})
6251 6251
 
6252 6252
 }
6253
+
6254
+func (this *DialysisAPIController) GetBloodDialysisPatient() {
6255
+	//adminUser := this.GetAdminUserInfo()
6256
+	//orgId := adminUser.CurrentOrgId
6257
+	//fmt.Print("orgId")
6258
+	patient, err := service.GetBloodDialysisPatient(7957)
6259
+	fmt.Print(patient)
6260
+	fmt.Print("报错------------------", err)
6261
+	//if err != nil {
6262
+	//  this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加设备失败")
6263
+	//  return
6264
+	//}
6265
+	//this.ServeSuccessJSON(map[string]interface{}{
6266
+	//  "patient": patient,
6267
+	//})
6268
+}

+ 1 - 0
controllers/mobile_api_controllers/mobile_api_router_register.go View File

@@ -110,4 +110,5 @@ func MobileAPIControllersRegisterRouters() {
110 110
 
111 111
 	beego.Router("/m/api/schedule/get", &DialysisAPIController{}, "Get:GetSchedule")
112 112
 
113
+	beego.Router("/api/patient/getbloodDialysisPatient", &DialysisAPIController{}, "Get:GetBloodDialysisPatient")
113 114
 }

+ 33 - 0
controllers/patientManage_api_controller.go View File

@@ -0,0 +1,33 @@
1
+package controllers
2
+
3
+import (
4
+	"XT_New/controllers/mobile_api_controllers"
5
+	"XT_New/enums"
6
+	"XT_New/service"
7
+	"fmt"
8
+	"github.com/astaxie/beego"
9
+)
10
+
11
+type PatientAPIController struct {
12
+	//controllers.BaseAPIController
13
+	mobile_api_controllers.MobileBaseAPIAuthController
14
+}
15
+
16
+func PatientRouters() {
17
+	beego.Router("/api/patient/getbloodDialysisPatient", &PatientAPIController{}, "Get:GetBloodDialysisPatient")
18
+}
19
+
20
+func (this *PatientAPIController) GetBloodDialysisPatient() {
21
+	//adminUser := this.GetAdminUserInfo()
22
+	//orgId := adminUser.CurrentOrgId
23
+	//fmt.Print("orgId")
24
+	patient, err := service.GetBloodDialysisPatient(7957)
25
+	fmt.Print("报错------------------", err)
26
+	if err != nil {
27
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加设备失败")
28
+		return
29
+	}
30
+	this.ServeSuccessJSON(map[string]interface{}{
31
+		"patient": patient,
32
+	})
33
+}

+ 3 - 0
routers/router.go View File

@@ -4,6 +4,7 @@ import (
4 4
 	"XT_New/controllers"
5 5
 	admin_api "XT_New/controllers/admin_api_controllers"
6 6
 	m_api "XT_New/controllers/mobile_api_controllers"
7
+	"fmt"
7 8
 
8 9
 	"github.com/astaxie/beego"
9 10
 	"github.com/astaxie/beego/plugins/cors"
@@ -55,4 +56,6 @@ func init() {
55 56
 	admin_api.AdminAPIControllersRegisterRouters()
56 57
 
57 58
 	controllers.ManageRouters()
59
+	fmt.Print("进来了美欧")
60
+	//controllers.PatientRouters()
58 61
 }

+ 9 - 0
service/patientmanage_service.go View File

@@ -0,0 +1,9 @@
1
+package service
2
+
3
+import "XT_New/models"
4
+
5
+func GetBloodDialysisPatient(orgid int64) (paitents []*models.Patients, err error) {
6
+
7
+	err = XTReadDB().Model(&paitents).Where("user_org_id = ? and status =1", orgid).Find(&paitents).Error
8
+	return paitents, err
9
+}