Procházet zdrojové kódy

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

csx před 3 roky
rodič
revize
bbad89f6e9
1 změnil soubory, kde provedl 40 přidání a 23 odebrání
  1. 40 23
      controllers/sg/his_api_controller.go

+ 40 - 23
controllers/sg/his_api_controller.go Zobrazit soubor

@@ -225,7 +225,7 @@ func (c *HisApiController) ReadCard() {
225 225
 	case 1:
226 226
 		if miConfig.MdtrtareaAdmvs == "421300" {
227 227
 			var res ResultTwo
228
-			api := "http://192.168.3.5:9533/" + "hbyb/1101?cert_no=" + "" +
228
+			api := "http://192.168.3.5:9532/" + "hbyb/1101?cert_no=" + "" +
229 229
 				"&org_name=" + miConfig.OrgName + "&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code +
230 230
 				"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(id_card_type, 10) + "&card_sn=" + "" + "&certificates=" + strconv.FormatInt(certificates, 10)
231 231
 			resp, requestErr := http.Get(api)
@@ -249,6 +249,8 @@ func (c *HisApiController) ReadCard() {
249 249
 
250 250
 			respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
251 251
 			result, _ := json.Marshal(respJSON)
252
+			fmt.Println("log")
253
+			fmt.Println(string(result))
252 254
 
253 255
 			if err := json.Unmarshal([]byte(result), &res); err != nil {
254 256
 				utils.ErrorLog("解析失败:%v", err)
@@ -1813,7 +1815,7 @@ func (c *HisApiController) GetRegisterInfo() {
1813 1815
 	if config.IsOpen == 1 {
1814 1816
 		var res ResultTwo
1815 1817
 		if miConfig.MdtrtareaAdmvs == "421300" {
1816
-			api := "http://192.168.3.5:9533/" + "hbyb/1101?cert_no=" + id_card +
1818
+			api := "http://192.168.3.5:9532/" + "hbyb/1101?cert_no=" + id_card +
1817 1819
 				"&org_name=" + miConfig.OrgName + "&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code +
1818 1820
 				"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(id_card_type, 10) + "&card_sn=" + "" + "&certificates=" + strconv.FormatInt(certificates, 10)
1819 1821
 			resp, requestErr := http.Get(api)
@@ -1837,6 +1839,8 @@ func (c *HisApiController) GetRegisterInfo() {
1837 1839
 
1838 1840
 			respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
1839 1841
 			result, _ := json.Marshal(respJSON)
1842
+			fmt.Println("log")
1843
+			fmt.Println(string(result))
1840 1844
 
1841 1845
 			if err := json.Unmarshal([]byte(result), &res); err != nil {
1842 1846
 				utils.ErrorLog("解析失败:%v", err)
@@ -1951,7 +1955,7 @@ func (c *HisApiController) GetRegisterInfo() {
1951 1955
 			//insutype = "390"
1952 1956
 			var resThree ResultThree
1953 1957
 			if miConfig.MdtrtareaAdmvs == "421300" {
1954
-				api := "http://192.168.3.5:9533/" + "hbyb/2201?psn_no=" + res.Output.Baseinfo.PsnNo + "&insutype=" + insutype + "&cert_no=" + res.Output.Baseinfo.Certno + "&ipt_otp_no=" + ipt_otp_no +
1958
+				api := "http://192.168.3.5:9532/" + "hbyb/2201?psn_no=" + res.Output.Baseinfo.PsnNo + "&insutype=" + insutype + "&cert_no=" + res.Output.Baseinfo.Certno + "&ipt_otp_no=" + ipt_otp_no +
1955 1959
 					"&org_name=" + miConfig.OrgName + "&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code +
1956 1960
 					"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(id_card_type, 10) + "&dept_code=" + department.Number + "&dept=" + department.Name + "&doctor_id=" + doctor_id
1957 1961
 				resp, requestErr := http.Get(api)
@@ -1975,6 +1979,8 @@ func (c *HisApiController) GetRegisterInfo() {
1975 1979
 
1976 1980
 				respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
1977 1981
 				result, _ := json.Marshal(respJSON)
1982
+				fmt.Println("log")
1983
+				fmt.Println(string(result))
1978 1984
 
1979 1985
 				if err := json.Unmarshal([]byte(result), &resThree); err != nil {
1980 1986
 					utils.ErrorLog("解析失败:%v", err)
@@ -2179,7 +2185,7 @@ func (c *HisApiController) GetUploadInfo() {
2179 2185
 			data["dept"] = department.ID
2180 2186
 			data["config"] = config
2181 2187
 			bytesData, _ := json.Marshal(data)
2182
-			req, _ := http.NewRequest("POST", "http://192.168.3.5:9533/"+"hbyb/2203", bytes.NewReader(bytesData))
2188
+			req, _ := http.NewRequest("POST", "http://192.168.3.5:9532/"+"hbyb/2203", bytes.NewReader(bytesData))
2183 2189
 			resp, _ := client.Do(req)
2184 2190
 			defer resp.Body.Close()
2185 2191
 			body, ioErr := ioutil.ReadAll(resp.Body)
@@ -2197,6 +2203,8 @@ func (c *HisApiController) GetUploadInfo() {
2197 2203
 
2198 2204
 			respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
2199 2205
 			userJSONBytes, _ := json.Marshal(respJSON)
2206
+			fmt.Println("log")
2207
+			fmt.Println(string(userJSONBytes))
2200 2208
 
2201 2209
 			if err := json.Unmarshal(userJSONBytes, &res2); err != nil {
2202 2210
 				utils.ErrorLog("解析失败:%v", err)
@@ -2329,7 +2337,7 @@ func (c *HisApiController) GetUploadInfo() {
2329 2337
 				if miConfig.MdtrtareaAdmvs == "421300" {
2330 2338
 
2331 2339
 					bytesData, _ := json.Marshal(data)
2332
-					req, _ := http.NewRequest("POST", "http://192.168.3.5:9533/"+"hbyb/2204", bytes.NewReader(bytesData))
2340
+					req, _ := http.NewRequest("POST", "http://192.168.3.5:9532/"+"hbyb/2204", bytes.NewReader(bytesData))
2333 2341
 					resp, _ := client.Do(req)
2334 2342
 					defer resp.Body.Close()
2335 2343
 					body, ioErr := ioutil.ReadAll(resp.Body)
@@ -2347,7 +2355,8 @@ func (c *HisApiController) GetUploadInfo() {
2347 2355
 
2348 2356
 					respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
2349 2357
 					userJSONBytes, _ := json.Marshal(respJSON)
2350
-
2358
+					fmt.Println("log")
2359
+					fmt.Println(string(userJSONBytes))
2351 2360
 					if err := json.Unmarshal(userJSONBytes, &res); err != nil {
2352 2361
 						utils.ErrorLog("解析失败:%v", err)
2353 2362
 						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -2550,7 +2559,7 @@ func (c *HisApiController) GetUploadInfo() {
2550 2559
 						var result2 string
2551 2560
 						if miConfig.MdtrtareaAdmvs == "441300" {
2552 2561
 
2553
-							api := "http://127.0.0.1:9533/" + "hbyb/2207?psn_no=" + his.PsnNo + "&mdtrt_id=" +
2562
+							api := "http://127.0.0.1:9532/" + "hbyb/2207?psn_no=" + his.PsnNo + "&mdtrt_id=" +
2554 2563
 								his.Number + "&chrg_bchno=" + chrg_bchno + "&org_name=" + miConfig.OrgName +
2555 2564
 								"&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code +
2556 2565
 								"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
@@ -2788,7 +2797,7 @@ func (c *HisApiController) GetUploadInfo() {
2788 2797
 			var result2 string
2789 2798
 
2790 2799
 			if miConfig.MdtrtareaAdmvs == "421300" {
2791
-				api := "http://192.168.3.5:9533/" + "hbyb/2207?psn_no=" + his.PsnNo + "&mdtrt_id=" +
2800
+				api := "http://192.168.3.5:9532/" + "hbyb/2207?psn_no=" + his.PsnNo + "&mdtrt_id=" +
2792 2801
 					his.Number + "&chrg_bchno=" + chrg_bchno + "&org_name=" + miConfig.OrgName +
2793 2802
 					"&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code +
2794 2803
 					"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
@@ -2817,7 +2826,8 @@ func (c *HisApiController) GetUploadInfo() {
2817 2826
 
2818 2827
 				respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
2819 2828
 				result, _ := json.Marshal(respJSON)
2820
-
2829
+				fmt.Println("log")
2830
+				fmt.Println(string(result))
2821 2831
 				if err := json.Unmarshal([]byte(result), &res); err != nil {
2822 2832
 					utils.ErrorLog("解析失败:%v", err)
2823 2833
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -3540,7 +3550,7 @@ func (c *HisApiController) GetPreUploadInfo() {
3540 3550
 		data["config"] = config
3541 3551
 
3542 3552
 		bytesData, _ := json.Marshal(data)
3543
-		req, _ := http.NewRequest("POST", "http://192.168.3.5:9533/"+"hbyb/2203", bytes.NewReader(bytesData))
3553
+		req, _ := http.NewRequest("POST", "http://192.168.3.5:9532/"+"hbyb/2203", bytes.NewReader(bytesData))
3544 3554
 		resp, _ := client.Do(req)
3545 3555
 		defer resp.Body.Close()
3546 3556
 		body, ioErr := ioutil.ReadAll(resp.Body)
@@ -3558,7 +3568,8 @@ func (c *HisApiController) GetPreUploadInfo() {
3558 3568
 
3559 3569
 		respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
3560 3570
 		userJSONBytes, _ := json.Marshal(respJSON)
3561
-
3571
+		fmt.Println("log")
3572
+		fmt.Println(string(userJSONBytes))
3562 3573
 		if err := json.Unmarshal(userJSONBytes, &res2); err != nil {
3563 3574
 			utils.ErrorLog("解析失败:%v", err)
3564 3575
 			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -3679,7 +3690,7 @@ func (c *HisApiController) GetPreUploadInfo() {
3679 3690
 			var res ResultFour
3680 3691
 			if miConfig.MdtrtareaAdmvs == "421300" {
3681 3692
 				bytesData, _ := json.Marshal(data)
3682
-				req, _ := http.NewRequest("POST", "http://192.168.3.5:9533/"+"hbyb/2204", bytes.NewReader(bytesData))
3693
+				req, _ := http.NewRequest("POST", "http://192.168.3.5:9532/"+"hbyb/2204", bytes.NewReader(bytesData))
3683 3694
 				resp, _ := client.Do(req)
3684 3695
 				defer resp.Body.Close()
3685 3696
 				body, ioErr := ioutil.ReadAll(resp.Body)
@@ -3697,7 +3708,8 @@ func (c *HisApiController) GetPreUploadInfo() {
3697 3708
 
3698 3709
 				respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
3699 3710
 				userJSONBytes, _ := json.Marshal(respJSON)
3700
-
3711
+				fmt.Println("log")
3712
+				fmt.Println(string(userJSONBytes))
3701 3713
 				if err := json.Unmarshal(userJSONBytes, &res); err != nil {
3702 3714
 					utils.ErrorLog("解析失败:%v", err)
3703 3715
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -3888,7 +3900,7 @@ func (c *HisApiController) GetPreUploadInfo() {
3888 3900
 
3889 3901
 					if miConfig.MdtrtareaAdmvs == "421300" {
3890 3902
 
3891
-						api := "http://192.168.3.5:9533/" + "hbyb/2206?psn_no=" + his.PsnNo + "&mdtrt_id=" +
3903
+						api := "http://192.168.3.5:9532/" + "hbyb/2206?psn_no=" + his.PsnNo + "&mdtrt_id=" +
3892 3904
 							his.Number + "&chrg_bchno=" + chrg_bchno + "&org_name=" + miConfig.OrgName +
3893 3905
 							"&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code +
3894 3906
 							"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
@@ -3916,7 +3928,8 @@ func (c *HisApiController) GetPreUploadInfo() {
3916 3928
 
3917 3929
 						respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
3918 3930
 						result, _ := json.Marshal(respJSON)
3919
-
3931
+						fmt.Println("log")
3932
+						fmt.Println(string(result))
3920 3933
 						if err := json.Unmarshal([]byte(result), &res); err != nil {
3921 3934
 							utils.ErrorLog("解析失败:%v", err)
3922 3935
 							c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -4298,7 +4311,7 @@ func (c *HisApiController) Refund() {
4298 4311
 		var result string
4299 4312
 
4300 4313
 		if miConfig.MdtrtareaAdmvs == "421300" {
4301
-			api3 := "http://192.168.3.5:9533/" + "hbyb/2208?psn_no=" + order.PsnNo +
4314
+			api3 := "http://192.168.3.5:9532/" + "hbyb/2208?psn_no=" + order.PsnNo +
4302 4315
 				"&mdtrt_id=" + order.Number + "&setl_id=" + order.SetlId + "&doctor=" + roles.UserName + "&org_name=" + miConfig.OrgName + "&fixmedins_code=" + miConfig.Code +
4303 4316
 				"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
4304 4317
 			resp3, requestErr3 := http.Get(api3)
@@ -4321,7 +4334,8 @@ func (c *HisApiController) Refund() {
4321 4334
 
4322 4335
 			respJSON3 = respJSON3["data"].(map[string]interface{})["pre"].(map[string]interface{})
4323 4336
 			userJSONBytes3, _ := json.Marshal(respJSON3)
4324
-
4337
+			fmt.Println("log")
4338
+			fmt.Println(string(userJSONBytes3))
4325 4339
 			if err := json.Unmarshal(userJSONBytes3, &res); err != nil {
4326 4340
 				utils.ErrorLog("解析失败:%v", err)
4327 4341
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -4350,7 +4364,7 @@ func (c *HisApiController) Refund() {
4350 4364
 
4351 4365
 			if miConfig.MdtrtareaAdmvs == "421300" {
4352 4366
 
4353
-				api3 := "http://192.168.3.5:9533/" + "hbyb/2205?psn_no=" + order.PsnNo +
4367
+				api3 := "http://192.168.3.5:9532/" + "hbyb/2205?psn_no=" + order.PsnNo +
4354 4368
 					"&mdtrt_id=" + order.Number + "&chrg_bchno=" + order.Number + "&doctor=" + roles.UserName + "&org_name=" + miConfig.OrgName + "&fixmedins_code=" + miConfig.Code +
4355 4369
 					"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
4356 4370
 				resp3, requestErr3 := http.Get(api3)
@@ -4373,7 +4387,8 @@ func (c *HisApiController) Refund() {
4373 4387
 
4374 4388
 				respJSON3 = respJSON3["data"].(map[string]interface{})["pre"].(map[string]interface{})
4375 4389
 				userJSONBytes3, _ := json.Marshal(respJSON3)
4376
-
4390
+				fmt.Println("log")
4391
+				fmt.Println(string(userJSONBytes3))
4377 4392
 				if err := json.Unmarshal(userJSONBytes3, &res2); err != nil {
4378 4393
 					utils.ErrorLog("解析失败:%v", err)
4379 4394
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -4463,7 +4478,7 @@ func (c *HisApiController) RefundNumber() {
4463 4478
 		var res2 ResultSix
4464 4479
 		if miConfig.MdtrtareaAdmvs == "421300" {
4465 4480
 
4466
-			api3 := "http://192.168.3.5:9533/" + "hbyb/2202?psn_no=" + his.PsnNo +
4481
+			api3 := "http://192.168.3.5:9532/" + "hbyb/2202?psn_no=" + his.PsnNo +
4467 4482
 				"&mdtrt_id=" + his.Number + "&ipt_otp_no=" + his.IptOtpNo + "&doctor=" + roles.UserName + "&org_name=" + miConfig.OrgName + "&fixmedins_code=" + miConfig.Code +
4468 4483
 				"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
4469 4484
 			resp3, requestErr3 := http.Get(api3)
@@ -4487,7 +4502,8 @@ func (c *HisApiController) RefundNumber() {
4487 4502
 
4488 4503
 			respJSON3 = respJSON3["data"].(map[string]interface{})["pre"].(map[string]interface{})
4489 4504
 			userJSONBytes3, _ := json.Marshal(respJSON3)
4490
-
4505
+			fmt.Println("log")
4506
+			fmt.Println(string(userJSONBytes3))
4491 4507
 			if err := json.Unmarshal(userJSONBytes3, &res2); err != nil {
4492 4508
 				utils.ErrorLog("解析失败:%v", err)
4493 4509
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -5233,7 +5249,7 @@ func (c *HisApiController) GetSettleAccounts() {
5233 5249
 	if config.IsOpen == 1 {
5234 5250
 		if miConfig.MdtrtareaAdmvs == "421300" {
5235 5251
 
5236
-			api := "http://192.168.3.5:9533/" + "hbyb/5203?psn_no=" + businessParams.PsnNo + "&mdtrt_id=" + businessParams.MdtrtId + "&setl_id=" + businessParams.SetlId +
5252
+			api := "http://192.168.3.5:9532/" + "hbyb/5203?psn_no=" + businessParams.PsnNo + "&mdtrt_id=" + businessParams.MdtrtId + "&setl_id=" + businessParams.SetlId +
5237 5253
 				"&org_name=" + miConfig.OrgName + "&doctor=" + baseParams.Doctor + "&fixmedins_code=" + miConfig.Code +
5238 5254
 				"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
5239 5255
 			resp, requestErr := http.Get(api)
@@ -5257,7 +5273,8 @@ func (c *HisApiController) GetSettleAccounts() {
5257 5273
 
5258 5274
 			respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
5259 5275
 			result, _ := json.Marshal(respJSON)
5260
-
5276
+			fmt.Println("log")
5277
+			fmt.Println(string(result))
5261 5278
 			if err := json.Unmarshal([]byte(result), &res); err != nil {
5262 5279
 				utils.ErrorLog("解析失败:%v", err)
5263 5280
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)