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
 		endTime = theTime.Unix()
117
 		endTime = theTime.Unix()
118
 	}
118
 	}
119
 	data, total, _ := service.GetNewDialysisWeightDetailTableTen(c.GetAdminUserInfo().CurrentOrgId, startTime, endTime, add_type, dry_type, after_type, page, limit)
119
 	data, total, _ := service.GetNewDialysisWeightDetailTableTen(c.GetAdminUserInfo().CurrentOrgId, startTime, endTime, add_type, dry_type, after_type, page, limit)
120
+	fmt.Println(data)
120
 	c.ServeSuccessJSON(map[string]interface{}{
121
 	c.ServeSuccessJSON(map[string]interface{}{
121
 		"list":  data,
122
 		"list":  data,
122
 		"total": total,
123
 		"total": total,
149
 		}
150
 		}
150
 		endTime = theTime.Unix()
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
 func (c *StatisticsApiController) GetPatientBPDetail() {
166
 func (c *StatisticsApiController) GetPatientBPDetail() {
161
 	start_time := c.GetString("start_time")
167
 	start_time := c.GetString("start_time")
162
 	end_time := c.GetString("end_time")
168
 	end_time := c.GetString("end_time")
163
 	add_type, _ := c.GetInt64("status_type")
169
 	add_type, _ := c.GetInt64("status_type")
170
+	statistics_type, _ := c.GetInt64("statistics_type")
171
+
164
 	page, _ := c.GetInt64("page")
172
 	page, _ := c.GetInt64("page")
165
 	limit, _ := c.GetInt64("limit")
173
 	limit, _ := c.GetInt64("limit")
166
 
174
 
186
 		}
194
 		}
187
 		endTime = theTime.Unix()
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
 	c.ServeSuccessJSON(map[string]interface{}{
208
 	c.ServeSuccessJSON(map[string]interface{}{
191
 		"list":  data,
209
 		"list":  data,
192
 		"total": total,
210
 		"total": total,

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