csx 4 years ago
parent
commit
548ecaccd1
2 changed files with 5 additions and 4 deletions
  1. 3 0
      controllers/gdyb_controller.go
  2. 2 4
      controllers/his_api_controller.go

+ 3 - 0
controllers/gdyb_controller.go View File

152
 	secret_key := c.GetString("secret_key")
152
 	secret_key := c.GetString("secret_key")
153
 
153
 
154
 	result := service.Gdyb2203(psnNo, mdtrtId, doctor, department, diag, org_name, med_type, doctor_id, fixmedins_code, diag_code, insuplc_admdvs, mdtrtarea_admvs, secret_key)
154
 	result := service.Gdyb2203(psnNo, mdtrtId, doctor, department, diag, org_name, med_type, doctor_id, fixmedins_code, diag_code, insuplc_admdvs, mdtrtarea_admvs, secret_key)
155
+
155
 	var dat map[string]interface{}
156
 	var dat map[string]interface{}
156
 	if err := json.Unmarshal([]byte(result), &dat); err == nil {
157
 	if err := json.Unmarshal([]byte(result), &dat); err == nil {
158
+
157
 	} else {
159
 	} else {
160
+
158
 	}
161
 	}
159
 	c.ServeSuccessJSON(map[string]interface{}{
162
 	c.ServeSuccessJSON(map[string]interface{}{
160
 		"pre": dat,
163
 		"pre": dat,

+ 2 - 4
controllers/his_api_controller.go View File

554
 				}
554
 				}
555
 				body2, ioErr2 := ioutil.ReadAll(resp2.Body)
555
 				body2, ioErr2 := ioutil.ReadAll(resp2.Body)
556
 				if ioErr2 != nil {
556
 				if ioErr2 != nil {
557
-					utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
557
+					utils.ErrorLog("接口返回数据读取失败: %v", ioErr2)
558
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
558
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
559
 					return
559
 					return
560
 				}
560
 				}
564
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
564
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
565
 					return
565
 					return
566
 				}
566
 				}
567
-				respJSON2 = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
567
+				respJSON2 = respJSON2["data"].(map[string]interface{})["pre"].(map[string]interface{})
568
 				userJSONBytes2, _ := json.Marshal(respJSON2)
568
 				userJSONBytes2, _ := json.Marshal(respJSON2)
569
-				fmt.Println(respJSON2)
570
-				fmt.Println(userJSONBytes2)
571
 
569
 
572
 				var res2 ResultSix
570
 				var res2 ResultSix
573
 				if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
571
 				if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {