Browse Source

提交代码

陈少旭 2 months ago
parent
commit
eccca6bb1b
2 changed files with 919 additions and 272 deletions
  1. 25 7
      controllers/statistics_api_controller.go
  2. 894 265
      service/statistis_qc_service.go

+ 25 - 7
controllers/statistics_api_controller.go View File

@@ -117,6 +117,7 @@ func (c *StatisticsApiController) GetPatientWeightDetail() {
117 117
 		endTime = theTime.Unix()
118 118
 	}
119 119
 	data, total, _ := service.GetNewDialysisWeightDetailTableTen(c.GetAdminUserInfo().CurrentOrgId, startTime, endTime, add_type, dry_type, after_type, page, limit)
120
+	fmt.Println(data)
120 121
 	c.ServeSuccessJSON(map[string]interface{}{
121 122
 		"list":  data,
122 123
 		"total": total,
@@ -149,18 +150,25 @@ func (c *StatisticsApiController) GetPatientBP() {
149 150
 		}
150 151
 		endTime = theTime.Unix()
151 152
 	}
152
-	fmt.Println(startTime)
153
-	fmt.Println(endTime)
153
+	if statistics_type == 1 {
154
+		item, _ := service.GetNewDialysisBPDetailTableTenThree(c.GetAdminUserInfo().CurrentOrgId, startTime, endTime)
155
+		c.ServeSuccessJSON(map[string]interface{}{
156
+			"list": item,
157
+		})
158
+	} else {
159
+		item, _ := service.GetNewDialysisBPDetailTableTenFour(c.GetAdminUserInfo().CurrentOrgId, startTime, endTime)
160
+		c.ServeSuccessJSON(map[string]interface{}{
161
+			"list": item,
162
+		})
163
+	}
154 164
 
155
-	item, _ := service.GetNewDialysisBloodChartData(c.GetAdminUserInfo().CurrentOrgId, startTime, endTime, statistics_type)
156
-	c.ServeSuccessJSON(map[string]interface{}{
157
-		"list": item,
158
-	})
159 165
 }
160 166
 func (c *StatisticsApiController) GetPatientBPDetail() {
161 167
 	start_time := c.GetString("start_time")
162 168
 	end_time := c.GetString("end_time")
163 169
 	add_type, _ := c.GetInt64("status_type")
170
+	statistics_type, _ := c.GetInt64("statistics_type")
171
+
164 172
 	page, _ := c.GetInt64("page")
165 173
 	limit, _ := c.GetInt64("limit")
166 174
 
@@ -186,7 +194,17 @@ func (c *StatisticsApiController) GetPatientBPDetail() {
186 194
 		}
187 195
 		endTime = theTime.Unix()
188 196
 	}
189
-	data, total, _ := service.GetNewDialysisBPDetailTableTen(c.GetAdminUserInfo().CurrentOrgId, startTime, endTime, add_type, page, limit)
197
+	var data []service.DialysisDataThree
198
+	var total int64
199
+
200
+	if statistics_type == 1 {
201
+		data, total, _ = service.GetNewDialysisBPDetailTableTen(c.GetAdminUserInfo().CurrentOrgId, startTime, endTime, add_type, page, limit)
202
+
203
+	} else {
204
+
205
+		data, total, _ = service.GetNewDialysisBPDetailTableTenOne(c.GetAdminUserInfo().CurrentOrgId, startTime, endTime, add_type, page, limit)
206
+
207
+	}
190 208
 	c.ServeSuccessJSON(map[string]interface{}{
191 209
 		"list":  data,
192 210
 		"total": total,

File diff suppressed because it is too large
+ 894 - 265
service/statistis_qc_service.go