Procházet zdrojové kódy

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

28169 před 2 měsíci
rodič
revize
26bd74e1f0

+ 4 - 4
controllers/his_api_controller.go Zobrazit soubor

@@ -3241,8 +3241,8 @@ func (c *HisApiController) CreateHisPrescription() {
3241 3241
 					timeLayout := "2006-01-02"
3242 3242
 					loc, _ := time.LoadLocation("Local")
3243 3243
 					theTime2, err := time.ParseInLocation(timeLayout+" 15:04", preTime, loc)
3244
-					result := strings.Split(preTime, " ")
3245
-					theTime3, _ := time.ParseInLocation(timeLayout, result[0], loc)
3244
+					//result := strings.Split(preTime, " ")
3245
+					theTime3, _ := time.ParseInLocation(timeLayout, record_date, loc)
3246 3246
 					if err != nil {
3247 3247
 						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
3248 3248
 						return
@@ -4421,8 +4421,8 @@ func (c *HisApiController) CreateHisPrescription() {
4421 4421
 					timeLayout := "2006-01-02"
4422 4422
 					loc, _ := time.LoadLocation("Local")
4423 4423
 					theTime2, err := time.ParseInLocation(timeLayout+" 15:04", preTime, loc)
4424
-					result := strings.Split(preTime, " ")
4425
-					theTime3, _ := time.ParseInLocation(timeLayout, result[0], loc)
4424
+					//result := strings.Split(preTime, " ")
4425
+					theTime3, _ := time.ParseInLocation(timeLayout, record_date, loc)
4426 4426
 					if err != nil {
4427 4427
 						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
4428 4428
 						return

+ 25 - 7
controllers/statistics_api_controller.go Zobrazit soubor

@@ -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,

Diff nebyl zobrazen, protože je příliš veliký
+ 894 - 265
service/statistis_qc_service.go