瀏覽代碼

新功能

csx 4 年之前
父節點
當前提交
868fd95abf

+ 10 - 2
controllers/new_mobile_api_controllers/index_evaluation_api_controller.go 查看文件

276
 
276
 
277
 	var range_value string
277
 	var range_value string
278
 	if range_type == 1 {
278
 	if range_type == 1 {
279
-		qcs, _ := statistics_service.FindOrgConfigRangeTypeValue(adminUserInfo.Org.Id, project_id, item_id)
279
+		count, _ := statistics_service.FindOrgInspectionCount(adminUserInfo.Org.Id)
280
+
281
+		if count <= 0 {
282
+			qcs, _ := statistics_service.FindOrgConfigRangeTypeValue(0, project_id, item_id)
283
+			range_value = qcs.RangeMin + "," + qcs.RangeMax
280
 
284
 
281
-		range_value = qcs.RangeMin + "," + qcs.RangeMax
285
+		} else {
286
+			qcs, _ := statistics_service.FindOrgConfigRangeTypeValue(adminUserInfo.Org.Id, project_id, item_id)
287
+			range_value = qcs.RangeMin + "," + qcs.RangeMax
288
+		}
282
 
289
 
283
 	} else {
290
 	} else {
284
 
291
 
290
 				range_value = range_value + "," + item.InspectValue
297
 				range_value = range_value + "," + item.InspectValue
291
 			}
298
 			}
292
 		}
299
 		}
300
+
293
 	}
301
 	}
294
 
302
 
295
 	data, _ := statistics_service.GetPatientInspectionBarChartData(adminUserInfo.Org.Id, theStartTIme, theEndtTIme, project_id, item_id, range_type, range_value, patient_id)
303
 	data, _ := statistics_service.GetPatientInspectionBarChartData(adminUserInfo.Org.Id, theStartTIme, theEndtTIme, project_id, item_id, range_type, range_value, patient_id)

+ 11 - 3
controllers/pc_index_evaluation_api_controller.go 查看文件

278
 
278
 
279
 	var range_value string
279
 	var range_value string
280
 	if range_type == 1 {
280
 	if range_type == 1 {
281
-		qcs, _ := statistics_service.FindOrgConfigRangeTypeValue(adminUserInfo.CurrentOrgId, project_id, item_id)
282
-		range_value = qcs.RangeMin + "," + qcs.RangeMax
281
+		count, _ := statistics_service.FindOrgInspectionCount(adminUserInfo.CurrentOrgId)
282
+
283
+		if count <= 0 {
284
+			qcs, _ := statistics_service.FindOrgConfigRangeTypeValue(0, project_id, item_id)
285
+			range_value = qcs.RangeMin + "," + qcs.RangeMax
286
+
287
+		} else {
288
+			qcs, _ := statistics_service.FindOrgConfigRangeTypeValue(adminUserInfo.CurrentOrgId, project_id, item_id)
289
+			range_value = qcs.RangeMin + "," + qcs.RangeMax
290
+		}
283
 
291
 
284
 	} else {
292
 	} else {
293
+
285
 		inspection, _ := statistics_service.FindOrgInspectionReferenceRangeTypeValue(adminUserInfo.CurrentOrgId, project_id, item_id)
294
 		inspection, _ := statistics_service.FindOrgInspectionReferenceRangeTypeValue(adminUserInfo.CurrentOrgId, project_id, item_id)
286
 		for _, item := range inspection {
295
 		for _, item := range inspection {
287
 			if len(range_value) == 0 {
296
 			if len(range_value) == 0 {
292
 		}
301
 		}
293
 
302
 
294
 	}
303
 	}
295
-
296
 	data, _ := statistics_service.GetPatientInspectionBarChartData(adminUserInfo.CurrentOrgId, theStartTIme, theEndtTIme, project_id, item_id, range_type, range_value, patient_id)
304
 	data, _ := statistics_service.GetPatientInspectionBarChartData(adminUserInfo.CurrentOrgId, theStartTIme, theEndtTIme, project_id, item_id, range_type, range_value, patient_id)
297
 	this.ServeSuccessJSON(map[string]interface{}{
305
 	this.ServeSuccessJSON(map[string]interface{}{
298
 		"data": data,
306
 		"data": data,