浏览代码

Merge branch 'master' of http://git.shengws.com/csx/gdyb

csx 3 年前
父节点
当前提交
3da2107e87
共有 1 个文件被更改,包括 35 次插入16 次删除
  1. 35 16
      controllers/sg/his_api_controller.go

+ 35 - 16
controllers/sg/his_api_controller.go 查看文件

@@ -2664,16 +2664,23 @@ func (c *HisApiController) GetRegisterInfo() {
2664 2664
 		} else {
2665 2665
 			result, requestLog := service.Gdyb1101(patient.IdCardNo, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, "", strconv.FormatInt(certificates, 10), name)
2666 2666
 			saveLog(result, requestLog, "1101", "人员基本信息获取")
2667
-			if err := json.Unmarshal([]byte(result), &res); err != nil {
2668
-				utils.ErrorLog("解析失败:%v", err)
2669
-				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2670
-				return
2671
-			}
2667
+			if miConfig.Code == "H15049901371" {
2672 2668
 
2673
-			if err := json.Unmarshal([]byte(result), &res10265); err != nil {
2674
-				utils.ErrorLog("解析失败:%v", err)
2675
-				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2676
-				return
2669
+				if err := json.Unmarshal([]byte(result), &res10265); err != nil {
2670
+					utils.ErrorLog("解析失败:%v", err)
2671
+					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2672
+					return
2673
+				}
2674
+				res.ErrMsg = res10265.ErrMsg
2675
+				res.Output = res10265.Output
2676
+				res.InfRefmsgid = res10265.InfRefmsgid
2677
+
2678
+			} else {
2679
+				if err := json.Unmarshal([]byte(result), &res); err != nil {
2680
+					utils.ErrorLog("解析失败:%v", err)
2681
+					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2682
+					return
2683
+				}
2677 2684
 			}
2678 2685
 
2679 2686
 			PsnNo = res.Output.Baseinfo.PsnNo
@@ -2829,8 +2836,6 @@ func (c *HisApiController) GetRegisterInfo() {
2829 2836
 
2830 2837
 				respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
2831 2838
 				result, _ := json.Marshal(respJSON)
2832
-				fmt.Println("log")
2833
-				fmt.Println(string(result))
2834 2839
 
2835 2840
 				if err := json.Unmarshal([]byte(result), &resThree); err != nil {
2836 2841
 					utils.ErrorLog("解析失败:%v", err)
@@ -2840,14 +2845,28 @@ func (c *HisApiController) GetRegisterInfo() {
2840 2845
 				infocode = resThree.Infcode
2841 2846
 
2842 2847
 			} else {
2843
-				fmt.Println(roles.UserName)
2848
+
2844 2849
 				result, requestLog := service.Gdyb2201(res.Output.Baseinfo.PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_id, insuplc_admdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName)
2845 2850
 				saveLog(result, requestLog, "2201", "挂号")
2846
-				if err := json.Unmarshal([]byte(result), &resThree); err != nil {
2847
-					utils.ErrorLog("解析失败:%v", err)
2848
-					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2849
-					return
2851
+
2852
+				if miConfig.Code == "H15049901371" {
2853
+
2854
+					if err := json.Unmarshal([]byte(result), &resThree10265); err != nil {
2855
+						utils.ErrorLog("解析失败:%v", err)
2856
+						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2857
+						return
2858
+					}
2859
+					resThree.ErrMsg = resThree10265.ErrMsg
2860
+					resThree.Output = resThree10265.Output
2861
+					resThree.InfRefmsgid = resThree10265.InfRefmsgid
2862
+				} else {
2863
+					if err := json.Unmarshal([]byte(result), &resThree); err != nil {
2864
+						utils.ErrorLog("解析失败:%v", err)
2865
+						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2866
+						return
2867
+					}
2850 2868
 				}
2869
+
2851 2870
 				if miConfig.Code == "H15049901371" {
2852 2871
 					infocode, _ = strconv.ParseInt(resThree10265.Infcode, 10, 64)
2853 2872
 				} else {