Bläddra i källkod

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

XMLWAN 4 år sedan
förälder
incheckning
6a8bf0a8fa

+ 8 - 8
controllers/base_api_controller.go Visa fil

@@ -68,7 +68,7 @@ func (this *BaseAuthAPIController) Prepare() {
68 68
 	this.BaseAPIController.Prepare()
69 69
 	if this.GetAdminUserInfo() == nil {
70 70
 		var userAdmin models.AdminUser
71
-		userAdmin.Id = 400
71
+		userAdmin.Id = 558
72 72
 		userAdmin.Mobile = "13535547901"
73 73
 
74 74
 		//userAdmin.Id = 597
@@ -79,7 +79,7 @@ func (this *BaseAuthAPIController) Prepare() {
79 79
 		userAdmin.ModifyTime = 1530786071
80 80
 		var subscibe models.ServeSubscibe
81 81
 		subscibe.ID = 1
82
-		subscibe.OrgId = 12
82
+		subscibe.OrgId = 7957
83 83
 		subscibe.PeriodStart = 1538035409
84 84
 		subscibe.PeriodEnd = 1569571409
85 85
 		subscibe.State = 1
@@ -89,7 +89,7 @@ func (this *BaseAuthAPIController) Prepare() {
89 89
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
90 90
 		subscibes[4] = &subscibe
91 91
 		var adminUserInfo service.AdminUserInfo
92
-		adminUserInfo.CurrentOrgId = 12
92
+		adminUserInfo.CurrentOrgId = 7957
93 93
 		adminUserInfo.CurrentAppId = 18
94 94
 		adminUserInfo.AdminUser = &userAdmin
95 95
 		adminUserInfo.Subscibes = subscibes
@@ -319,17 +319,17 @@ func (this *BaseServeAPIController) Prepare() {
319 319
 	this.BaseAPIController.Prepare()
320 320
 	if this.GetAdminUserInfo() == nil {
321 321
 		var userAdmin models.AdminUser
322
-		userAdmin.Id = 400
322
+		userAdmin.Id = 558
323 323
 		userAdmin.Mobile = "13535547901"
324
-		userAdmin.Id = 597
325
-		userAdmin.Mobile = "19874122664"
324
+		//userAdmin.Id = 597
325
+		//userAdmin.Mobile = "19874122664"
326 326
 		userAdmin.IsSuperAdmin = false
327 327
 		userAdmin.Status = 1
328 328
 		userAdmin.CreateTime = 1530786071
329 329
 		userAdmin.ModifyTime = 1530786071
330 330
 		var subscibe models.ServeSubscibe
331 331
 		subscibe.ID = 1
332
-		subscibe.OrgId = 12
332
+		subscibe.OrgId = 7957
333 333
 		subscibe.PeriodStart = 1538035409
334 334
 		subscibe.PeriodEnd = 1569571409
335 335
 		subscibe.State = 1
@@ -339,7 +339,7 @@ func (this *BaseServeAPIController) Prepare() {
339 339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
340 340
 		subscibes[4] = &subscibe
341 341
 		var adminUserInfo service.AdminUserInfo
342
-		adminUserInfo.CurrentOrgId = 12
342
+		adminUserInfo.CurrentOrgId = 7957
343 343
 		adminUserInfo.CurrentAppId = 18
344 344
 		adminUserInfo.AdminUser = &userAdmin
345 345
 		adminUserInfo.Subscibes = subscibes

+ 0 - 23
controllers/new_mobile_api_controllers/common_api_router.go Visa fil

@@ -6,29 +6,6 @@ import (
6 6
 
7 7
 func CommonApiControllersRegisterRouters() {
8 8
 
9
-	beego.Router("/api/dialysisprocessindex/chart", &IndexEvaluationApiController{}, "Get:GetDialysisProcessIndexChartData")
10
-	beego.Router("/api/dialysisprocessindex/table", &IndexEvaluationApiController{}, "Get:GetDialysisProcessIndexTableData")
11
-
12
-	beego.Router("/api/dialysiswatch/chart", &IndexEvaluationApiController{}, "Get:GetDialysisWatchChartData")
13
-	beego.Router("/api/dialysiswatch/table", &IndexEvaluationApiController{}, "Get:GetDialysisWatchTableData")
14
-
15
-	beego.Router("/api/dialysisbloodpressure/chart", &IndexEvaluationApiController{}, "Get:GetDialysisBloodPressureChartData")
16
-	beego.Router("/api/dialysisbloodpressure/table", &IndexEvaluationApiController{}, "Get:GetDialysisBloodPressureTableData")
17
-	beego.Router("/api/patientdialysisbloodpressure/chart", &IndexEvaluationApiController{}, "Get:GetDialysisPatientBloodPressureChartData")
18
-
19
-	beego.Router("/api/dialysisweight/chart", &IndexEvaluationApiController{}, "Get:GetDialysisWeightChartData")
20
-	beego.Router("/api/dialysisweight/table", &IndexEvaluationApiController{}, "Get:GetDialysisWeightTableData")
21
-	beego.Router("/api/patientdialysisweight/chart", &IndexEvaluationApiController{}, "Get:GetDialysisPatientWeightChartData")
22
-
23
-	beego.Router("/api/doctorworkload/chart", &IndexEvaluationApiController{}, "Get:GetDoctorWorkloadChartData")
24
-	beego.Router("/api/doctorworkload/table", &IndexEvaluationApiController{}, "Get:GetDoctorWorkloadTableData")
25
-
26
-	beego.Router("/api/nurseworkload/chart", &IndexEvaluationApiController{}, "Get:GetNurseWorkloadChartData")
27
-	beego.Router("/api/nurseworkload/table", &IndexEvaluationApiController{}, "Get:GetNurseWorkloadTableData")
28
-
29
-	beego.Router("/api/adminuser/all", &IndexEvaluationApiController{}, "Get:GetAdminUser")
30
-	beego.Router("/api/defalutpatient/get", &IndexEvaluationApiController{}, "Get:GetDefaultPatient")
31
-
32 9
 	beego.Router("/com/api/getinspectionmajor", &CommonApiController{}, "Get:GetInspectionMajor")
33 10
 	beego.Router("/com/api/getinspectionminor", &CommonApiController{}, "Get:GetInspectionMinor")
34 11
 	beego.Router("/com/api/getinspectionrange", &CommonApiController{}, "Get:GetInspectionRange")

+ 28 - 0
controllers/pc_index_evaluation_api_controller.go Visa fil

@@ -4,9 +4,37 @@ import (
4 4
 	"XT_New/enums"
5 5
 	"XT_New/service/statistics_service"
6 6
 	"XT_New/utils"
7
+	"github.com/astaxie/beego"
7 8
 	"time"
8 9
 )
9 10
 
11
+func PCIndexEvaluationApiControllersRegisterRouters() {
12
+
13
+	beego.Router("/api/dialysisprocessindex/chart", &PCIndexEvaluationApiController{}, "Get:GetDialysisProcessIndexChartData")
14
+	beego.Router("/api/dialysisprocessindex/table", &PCIndexEvaluationApiController{}, "Get:GetDialysisProcessIndexTableData")
15
+
16
+	beego.Router("/api/dialysiswatch/chart", &PCIndexEvaluationApiController{}, "Get:GetDialysisWatchChartData")
17
+	beego.Router("/api/dialysiswatch/table", &PCIndexEvaluationApiController{}, "Get:GetDialysisWatchTableData")
18
+
19
+	beego.Router("/api/dialysisbloodpressure/chart", &PCIndexEvaluationApiController{}, "Get:GetDialysisBloodPressureChartData")
20
+	beego.Router("/api/dialysisbloodpressure/table", &PCIndexEvaluationApiController{}, "Get:GetDialysisBloodPressureTableData")
21
+	beego.Router("/api/patientdialysisbloodpressure/chart", &PCIndexEvaluationApiController{}, "Get:GetDialysisPatientBloodPressureChartData")
22
+
23
+	beego.Router("/api/dialysisweight/chart", &PCIndexEvaluationApiController{}, "Get:GetDialysisWeightChartData")
24
+	beego.Router("/api/dialysisweight/table", &PCIndexEvaluationApiController{}, "Get:GetDialysisWeightTableData")
25
+	beego.Router("/api/patientdialysisweight/chart", &PCIndexEvaluationApiController{}, "Get:GetDialysisPatientWeightChartData")
26
+
27
+	beego.Router("/api/doctorworkload/chart", &PCIndexEvaluationApiController{}, "Get:GetDoctorWorkloadChartData")
28
+	beego.Router("/api/doctorworkload/table", &PCIndexEvaluationApiController{}, "Get:GetDoctorWorkloadTableData")
29
+
30
+	beego.Router("/api/nurseworkload/chart", &PCIndexEvaluationApiController{}, "Get:GetNurseWorkloadChartData")
31
+	beego.Router("/api/nurseworkload/table", &PCIndexEvaluationApiController{}, "Get:GetNurseWorkloadTableData")
32
+
33
+	beego.Router("/api/adminuser/all", &PCIndexEvaluationApiController{}, "Get:GetAdminUser")
34
+	beego.Router("/api/defalutpatient/get", &PCIndexEvaluationApiController{}, "Get:GetDefaultPatient")
35
+
36
+}
37
+
10 38
 type PCIndexEvaluationApiController struct {
11 39
 	BaseAuthAPIController
12 40
 }

+ 2 - 1
routers/router.go Visa fil

@@ -12,7 +12,7 @@ import (
12 12
 func init() {
13 13
 	beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
14 14
 		// AllowAllOrigins:  true,
15
-		AllowOrigins: []string{"https://xt.kuyicloud.com", "http://localhost:9528", "http://localhost:9531", "http://xt.test.shengws.com", "http://new_mobile.test.sgjyun.com", "https://xt.test.shengws.com", "http://xt.test.sgjyun.com", "https://xt.test.sgjyun.com", "http://localhost:8081", "http://localhost:8082", "https://pad.kuyicloud.com", "http://pad.kuyicloud.com", "http://pad.test.sgjyun.com", "https://pad.test.sgjyun.com", "http://admin.xt.test.sgjyun.com", "http://admin.xt.kuyicloud.com", "http://mobile.sgjyun.com", "http://mobile.kuyicloud.com"},
15
+		AllowOrigins: []string{"https://xt.kuyicloud.com", "http://localhost:9528", "http://localhost:9529", "http://localhost:9531", "http://xt.test.shengws.com", "http://new_mobile.test.sgjyun.com", "https://xt.test.shengws.com", "http://xt.test.sgjyun.com", "https://xt.test.sgjyun.com", "http://localhost:8081", "http://localhost:8082", "https://pad.kuyicloud.com", "http://pad.kuyicloud.com", "http://pad.test.sgjyun.com", "https://pad.test.sgjyun.com", "http://admin.xt.test.sgjyun.com", "http://admin.xt.kuyicloud.com", "http://mobile.sgjyun.com", "http://mobile.kuyicloud.com"},
16 16
 		//AllowOrigins:     []string{"https://xt.kuyicloud.com", "http://localhost:9528", "http://xt.test.shengws.com","https://xt.test.shengws.com", "http://xt.test.sgjyun.com","https://xt.test.sgjyun.com", "http://localhost:8081", "http://localhost:8082", "https://pad.kuyicloud.com", "http://pad.kuyicloud.com", "http://pad.test.sgjyun.com","https://pad.test.sgjyun.com", "http://admin.xt.test.sgjyun.com", "http://admin.xt.kuyicloud.com","http://mobile.sgjyun.com","http://mobile.kuyicloud.com"},
17 17
 		AllowMethods:     []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
18 18
 		AllowHeaders:     []string{"Origin", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type", "X-XSRF-TOKEN", "Permission"},
@@ -50,6 +50,7 @@ func init() {
50 50
 	controllers.DistrictApiRegistRouters()
51 51
 	controllers.GobalConfigRegistRouters()
52 52
 	controllers.IntegrationConfigRegistRouters()
53
+	controllers.PCIndexEvaluationApiControllersRegisterRouters()
53 54
 
54 55
 	m_api.MobileAPIControllersRegisterRouters()
55 56
 	new_m_api.NewMobileAPIControllersRegisterRouters()

+ 8 - 2
service/statistics_service/index_evaluation_service.go Visa fil

@@ -680,9 +680,14 @@ func GetDialysisWeightTableData(orgID, patientID int64, page, limit, start, end
680 680
 	return orders, total, err
681 681
 }
682 682
 
683
-func GetLastAfterWeight(user_org_id int64, before_assessment_date int64, patient_id int64) (after models.AssessmentAfterDislysis, err error) {
683
+type LastAfter struct {
684
+	ID          int64   `json:"id"`
685
+	WeightAfter float64 `json:"weight_after"`
686
+}
687
+
688
+func GetLastAfterWeight(user_org_id int64, before_assessment_date int64, patient_id int64) (after LastAfter, err error) {
684 689
 	readDb := service.XTReadDB()
685
-	err = readDb.Model(&models.AssessmentAfterDislysis{}).Where("user_org_id = ? AND patient_id = ? AND assessment_date < ?", user_org_id, patient_id, before_assessment_date).Order("id desc").First(&after).Error
690
+	err = readDb.Raw("SELECT weight_after as weight_after,id as id from xt_assessment_after_dislysis   WHERE (user_org_id = ? AND patient_id = ? AND assessment_date < ?) ORDER BY id desc,`xt_assessment_after_dislysis`.`id` ASC LIMIT 1 ", user_org_id, patient_id, before_assessment_date).Scan(&after).Error
686 691
 	return
687 692
 }
688 693
 
@@ -965,6 +970,7 @@ func GetBloodPressureTableData(orgID, patientID int64, page, limit, start, end i
965 970
 		Preload("VMPatients", "status = 1 AND user_org_id = ?", orgID)
966 971
 	err = db.Count(&total).Offset(offset).Limit(limit).Order("sch.schedule_date desc").Select(" sch.schedule_date,sch.patient_id,sch.user_org_id").Find(&orders).Error
967 972
 	return orders, total, err
973
+
968 974
 }
969 975
 
970 976
 type BPDataStruct struct {