XMLWAN 4 vuotta sitten
vanhempi
commit
f7e2e446fc

+ 44 - 0
controllers/new_mobile_api_controllers/new_common_api_controller.go Näytä tiedosto

@@ -79,3 +79,47 @@ func (this *NewCommonApiController) GetMobileTotalSexCount() {
79 79
 		"totalSex": totalSex,
80 80
 	})
81 81
 }
82
+
83
+func (this *NewCommonApiController) GetMobileTotalInfectiousCout() {
84
+	startime, _ := this.GetInt64("startime")
85
+	fmt.Println("startime", startime)
86
+	endtime, _ := this.GetInt64("endtime")
87
+	fmt.Println("endtime", endtime)
88
+	adminUser := this.GetMobileAdminUserInfo()
89
+	orgid := adminUser.Org.Id
90
+	//统计透析总人数
91
+	total := service.GetPatientTotalCount(orgid)
92
+	//统计透析人数传染病所占比例
93
+	count, err := service.GetPatientInfectiousCount(orgid)
94
+	//统计其他
95
+	_, otherTotal, err := service.GetPatientOtherInfectious(orgid)
96
+	if err != nil {
97
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
98
+		return
99
+	}
100
+	this.ServeSuccessJSON(map[string]interface{}{
101
+		"total":      total,
102
+		"count":      count,
103
+		"otherTotal": otherTotal,
104
+	})
105
+}
106
+
107
+func (this *NewCommonApiController) GetMobileTotalAgeCount() {
108
+	startime, _ := this.GetInt64("startime")
109
+	fmt.Println("开始时间", startime)
110
+	endtime, _ := this.GetInt64("endtime")
111
+	fmt.Println("结束时间", endtime)
112
+	adminUser := this.GetMobileAdminUserInfo()
113
+	orgid := adminUser.Org.Id
114
+	total := service.GetPatientTotalCount(orgid)
115
+	agecount, err := service.GetTotalAgeCount(orgid)
116
+	//two, err := service.GetTotalAgeCountTwo(orgid, startime, endtime)
117
+	if err != nil {
118
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
119
+		return
120
+	}
121
+	this.ServeSuccessJSON(map[string]interface{}{
122
+		"total":    total,
123
+		"ageCount": agecount,
124
+	})
125
+}

+ 2 - 0
controllers/new_mobile_api_controllers/new_common_api_router.go Näytä tiedosto

@@ -7,4 +7,6 @@ func NewCommonApiControllersRegisterRouters() {
7 7
 	beego.Router("/m/api/gettotaldialysis", &NewCommonApiController{}, "Get:GetTotalDialysis")
8 8
 	beego.Router("/m/api/getmobiletotallapsecount", &NewCommonApiController{}, "Get:GetMobileTotalLapseCount")
9 9
 	beego.Router("/m/api/getmobiletotalsexcount", &NewCommonApiController{}, "Get:GetMobileTotalSexCount")
10
+	beego.Router("/m/api/getmobiletotalinfectiouscount", &NewCommonApiController{}, "Get:GetMobileTotalInfectiousCout")
11
+	beego.Router("/m/api/getmobiletotalagecount", &NewCommonApiController{}, "Get:GetMobileTotalAgeCount")
10 12
 }