Browse Source

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

csx 3 years ago
parent
commit
182cce1d8f
4 changed files with 96 additions and 23 deletions
  1. 3 3
      conf/app.conf
  2. 81 11
      controllers/sg/his_api_controller.go
  3. 11 9
      service/gdyb_service.go
  4. 1 0
      service/jsyb_service.go

+ 3 - 3
conf/app.conf View File

45
 
45
 
46
 
46
 
47
 [prod]
47
 [prod]
48
-org_id = 10215
48
+org_id = 10188
49
 mobile_token_expiration_second = 86400
49
 mobile_token_expiration_second = 86400
50
 httpdomain = https://api.xt.kuyicloud.com
50
 httpdomain = https://api.xt.kuyicloud.com
51
 sso_domain = https://sso.kuyicloud.com
51
 sso_domain = https://sso.kuyicloud.com
57
 # gdyb_url="http://igb.hsa.gdgov.cn/ebus/sz_prd/hsa/hgs/"
57
 # gdyb_url="http://igb.hsa.gdgov.cn/ebus/sz_prd/hsa/hgs/"
58
 #内蒙古
58
 #内蒙古
59
 # gdyb_url = "http://10.38.23.105:8090/uif-hsaf-med-api/api/medical/service/"
59
 # gdyb_url = "http://10.38.23.105:8090/uif-hsaf-med-api/api/medical/service/"
60
-# gdyb_paasid = "sg03_prd"
60
+gdyb_paasid = "sg03_prd"
61
 # gdyb_paasid = "jm_sc_yjyy"
61
 # gdyb_paasid = "jm_sc_yjyy"
62
 #gdyb_paasid="zh_prd_yrojyy"
62
 #gdyb_paasid="zh_prd_yrojyy"
63
 #gdyb_paasid = "sz_prd_yjyy"
63
 #gdyb_paasid = "sz_prd_yjyy"
64
-gdyb_paasid = "zq_prd_yjyy"
64
+# gdyb_paasid = "zq_prd_yjyy"
65
 
65
 
66
 
66
 
67
 
67
 

+ 81 - 11
controllers/sg/his_api_controller.go View File

3558
 			fmt.Println("log")
3558
 			fmt.Println("log")
3559
 			fmt.Println(string(userJSONBytes))
3559
 			fmt.Println(string(userJSONBytes))
3560
 
3560
 
3561
-			if err := json.Unmarshal(userJSONBytes, &res2); err != nil {
3561
+			if err := json.Unmarshal(userJSONBytes, &ressix10265); err != nil {
3562
 				utils.ErrorLog("解析失败:%v", err)
3562
 				utils.ErrorLog("解析失败:%v", err)
3563
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
3563
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
3564
 				return
3564
 				return
3565
 			}
3565
 			}
3566
+			res2.InfRefmsgid = ressix10265.InfRefmsgid
3567
+			res2.Output = ressix10265.Output
3568
+			res2.ErrMsg = ressix10265.ErrMsg
3569
+			res2.Cainfo = ressix10265.Cainfo
3570
+			res2.WarnMsg = ressix10265.WarnMsg
3571
+			infocode, _ := strconv.ParseInt(ressix10265.Infcode, 10, 64)
3572
+			res2.Infcode = infocode
3566
 
3573
 
3567
 		} else {
3574
 		} else {
3568
 			if miConfig.MdtrtareaAdmvs == "440781" { //
3575
 			if miConfig.MdtrtareaAdmvs == "440781" { //
3781
 					userJSONBytes, _ := json.Marshal(respJSON)
3788
 					userJSONBytes, _ := json.Marshal(respJSON)
3782
 					fmt.Println("log")
3789
 					fmt.Println("log")
3783
 					fmt.Println(string(userJSONBytes))
3790
 					fmt.Println(string(userJSONBytes))
3784
-					if err := json.Unmarshal(userJSONBytes, &res); err != nil {
3791
+					if err := json.Unmarshal(userJSONBytes, &resFour10265); err != nil {
3785
 						utils.ErrorLog("解析失败:%v", err)
3792
 						utils.ErrorLog("解析失败:%v", err)
3786
 						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
3793
 						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
3787
 						return
3794
 						return
3788
 					}
3795
 					}
3796
+					res.InfRefmsgid = resFour10265.InfRefmsgid
3797
+					res.Output = resFour10265.Output
3798
+					res.ErrMsg = resFour10265.ErrMsg
3799
+					res.Cainfo = resFour10265.Cainfo
3800
+					res.WarnMsg = resFour10265.WarnMsg
3801
+					infocode, _ := strconv.ParseInt(resFour10265.Infcode, 10, 64)
3802
+					res.Infcode = infocode
3789
 
3803
 
3790
 				} else {
3804
 				} else {
3791
 
3805
 
4126
 							respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
4140
 							respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
4127
 							result, _ := json.Marshal(respJSON)
4141
 							result, _ := json.Marshal(respJSON)
4128
 
4142
 
4129
-							if err := json.Unmarshal([]byte(result), &res); err != nil {
4143
+							if err := json.Unmarshal([]byte(result), &resSeven10265); err != nil {
4130
 								utils.ErrorLog("解析失败:%v", err)
4144
 								utils.ErrorLog("解析失败:%v", err)
4131
 								c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4145
 								c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4132
 								return
4146
 								return
4133
 							}
4147
 							}
4134
 
4148
 
4149
+							res.InfRefmsgid = resSeven10265.InfRefmsgid
4150
+							res.Output = resSeven10265.Output
4151
+							res.ErrMsg = resSeven10265.ErrMsg
4152
+							res.Cainfo = resSeven10265.Cainfo
4153
+							res.WarnMsg = resSeven10265.WarnMsg
4154
+							infocode, _ := strconv.ParseInt(resSeven10265.Infcode, 10, 64)
4155
+							res.Infcode = infocode
4156
+
4135
 						} else {
4157
 						} else {
4136
 							if miConfig.Code == "H15049901371" {
4158
 							if miConfig.Code == "H15049901371" {
4137
 								//赤峰地区国家医保医疗类别
4159
 								//赤峰地区国家医保医疗类别
4469
 				result, _ := json.Marshal(respJSON)
4491
 				result, _ := json.Marshal(respJSON)
4470
 				fmt.Println("log")
4492
 				fmt.Println("log")
4471
 				fmt.Println(string(result))
4493
 				fmt.Println(string(result))
4472
-				if err := json.Unmarshal([]byte(result), &res); err != nil {
4494
+				if err := json.Unmarshal([]byte(result), &resSeven10265); err != nil {
4473
 					utils.ErrorLog("解析失败:%v", err)
4495
 					utils.ErrorLog("解析失败:%v", err)
4474
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4496
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4475
 					return
4497
 					return
4476
 				}
4498
 				}
4477
 
4499
 
4500
+				res.InfRefmsgid = resSeven10265.InfRefmsgid
4501
+				res.Output = resSeven10265.Output
4502
+				res.ErrMsg = resSeven10265.ErrMsg
4503
+				res.Cainfo = resSeven10265.Cainfo
4504
+				res.WarnMsg = resSeven10265.WarnMsg
4505
+				infocode, _ := strconv.ParseInt(resSeven10265.Infcode, 10, 64)
4506
+				res.Infcode = infocode
4507
+
4478
 			} else {
4508
 			} else {
4479
 
4509
 
4480
 				var src_resquest string
4510
 				var src_resquest string
6258
 
6288
 
6259
 			respJSON3 = respJSON3["data"].(map[string]interface{})["pre"].(map[string]interface{})
6289
 			respJSON3 = respJSON3["data"].(map[string]interface{})["pre"].(map[string]interface{})
6260
 			userJSONBytes3, _ := json.Marshal(respJSON3)
6290
 			userJSONBytes3, _ := json.Marshal(respJSON3)
6261
-			if err := json.Unmarshal(userJSONBytes3, &res); err != nil {
6291
+			if err := json.Unmarshal(userJSONBytes3, &resSixteen10265); err != nil {
6262
 				utils.ErrorLog("解析失败:%v", err)
6292
 				utils.ErrorLog("解析失败:%v", err)
6263
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
6293
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
6264
 				return
6294
 				return
6265
 			}
6295
 			}
6266
 
6296
 
6297
+			res.InfRefmsgid = resSixteen10265.InfRefmsgid
6298
+			res.Output = resSixteen10265.Output
6299
+			res.ErrMsg = resSixteen10265.ErrMsg
6300
+			res.Cainfo = resSixteen10265.Cainfo
6301
+			res.WarnMsg = resSixteen10265.WarnMsg
6302
+			infocode, _ := strconv.ParseInt(resSixteen10265.Infcode, 10, 64)
6303
+			res.Infcode = infocode
6304
+
6267
 		} else {
6305
 		} else {
6268
 
6306
 
6269
 			if miConfig.Code == "H15049901371" {
6307
 			if miConfig.Code == "H15049901371" {
6375
 				userJSONBytes3, _ := json.Marshal(respJSON3)
6413
 				userJSONBytes3, _ := json.Marshal(respJSON3)
6376
 				fmt.Println("log")
6414
 				fmt.Println("log")
6377
 				fmt.Println(string(userJSONBytes3))
6415
 				fmt.Println(string(userJSONBytes3))
6378
-				if err := json.Unmarshal(userJSONBytes3, &res2); err != nil {
6416
+				if err := json.Unmarshal(userJSONBytes3, &resSix10265); err != nil {
6379
 					utils.ErrorLog("解析失败:%v", err)
6417
 					utils.ErrorLog("解析失败:%v", err)
6380
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
6418
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
6381
 					return
6419
 					return
6382
 				}
6420
 				}
6383
 
6421
 
6422
+				res2.InfRefmsgid = resSix10265.InfRefmsgid
6423
+				res2.Output = resSix10265.Output
6424
+				res2.ErrMsg = resSix10265.ErrMsg
6425
+				res2.Cainfo = resSix10265.Cainfo
6426
+				res2.WarnMsg = resSix10265.WarnMsg
6427
+				infocode, _ := strconv.ParseInt(resSix10265.Infcode, 10, 64)
6428
+				res2.Infcode = infocode
6429
+
6384
 			} else {
6430
 			} else {
6385
 
6431
 
6386
 				if miConfig.Code == "H15049901371" {
6432
 				if miConfig.Code == "H15049901371" {
6548
 
6594
 
6549
 			respJSON3 = respJSON3["data"].(map[string]interface{})["pre"].(map[string]interface{})
6595
 			respJSON3 = respJSON3["data"].(map[string]interface{})["pre"].(map[string]interface{})
6550
 			userJSONBytes3, _ := json.Marshal(respJSON3)
6596
 			userJSONBytes3, _ := json.Marshal(respJSON3)
6551
-			fmt.Println("log")
6552
-			fmt.Println(string(userJSONBytes3))
6553
-			if err := json.Unmarshal(userJSONBytes3, &res2); err != nil {
6597
+			if err := json.Unmarshal(userJSONBytes3, &resSix10265); err != nil {
6554
 				utils.ErrorLog("解析失败:%v", err)
6598
 				utils.ErrorLog("解析失败:%v", err)
6555
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
6599
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
6556
 				return
6600
 				return
6557
 			}
6601
 			}
6558
 
6602
 
6603
+			res2.InfRefmsgid = resSix10265.InfRefmsgid
6604
+			res2.Output = resSix10265.Output
6605
+			res2.ErrMsg = resSix10265.ErrMsg
6606
+			res2.Cainfo = resSix10265.Cainfo
6607
+			res2.WarnMsg = resSix10265.WarnMsg
6608
+			infocode, _ := strconv.ParseInt(resSix10265.Infcode, 10, 64)
6609
+			res2.Infcode = infocode
6610
+
6559
 		} else {
6611
 		} else {
6560
 			var api3 string
6612
 			var api3 string
6561
 
6613
 
6731
 				return
6783
 				return
6732
 			}
6784
 			}
6733
 		} else if miConfig.MdtrtareaAdmvs == "320921" {
6785
 		} else if miConfig.MdtrtareaAdmvs == "320921" {
6786
+			var resSix10265 ResultSix10265
6787
+
6734
 			api3 := "http://192.168.3.111:9532/" + "jsyb/2205?psn_no=" + order.PsnNo +
6788
 			api3 := "http://192.168.3.111:9532/" + "jsyb/2205?psn_no=" + order.PsnNo +
6735
 				"&mdtrt_id=" + order.MdtrtId + "&chrg_bchno=" + order.Number + "&doctor=" + patientPrescription.Doctor + "&org_name=" + miConfig.OrgName + "&fixmedins_code=" + miConfig.Code +
6789
 				"&mdtrt_id=" + order.MdtrtId + "&chrg_bchno=" + order.Number + "&doctor=" + patientPrescription.Doctor + "&org_name=" + miConfig.OrgName + "&fixmedins_code=" + miConfig.Code +
6736
 				"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&url=" + miConfig.Url + "&ak=" + miConfig.ChannelNumber
6790
 				"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&url=" + miConfig.Url + "&ak=" + miConfig.ChannelNumber
6756
 			userJSONBytes3, _ := json.Marshal(respJSON3)
6810
 			userJSONBytes3, _ := json.Marshal(respJSON3)
6757
 			fmt.Println("log")
6811
 			fmt.Println("log")
6758
 			fmt.Println(string(userJSONBytes3))
6812
 			fmt.Println(string(userJSONBytes3))
6759
-			if err := json.Unmarshal(userJSONBytes3, &res2); err != nil {
6813
+			if err := json.Unmarshal(userJSONBytes3, &resSix10265); err != nil {
6760
 				utils.ErrorLog("解析失败:%v", err)
6814
 				utils.ErrorLog("解析失败:%v", err)
6761
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
6815
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
6762
 				return
6816
 				return
6763
 			}
6817
 			}
6764
 
6818
 
6819
+			res2.InfRefmsgid = resSix10265.InfRefmsgid
6820
+			res2.Output = resSix10265.Output
6821
+			res2.ErrMsg = resSix10265.ErrMsg
6822
+			res2.Cainfo = resSix10265.Cainfo
6823
+			res2.WarnMsg = resSix10265.WarnMsg
6824
+			infocode, _ := strconv.ParseInt(resSix10265.Infcode, 10, 64)
6825
+			res2.Infcode = infocode
6826
+
6765
 			err := service.UpdataOrderStatus(order_id, number, adminUser.CurrentOrgId, "", "")
6827
 			err := service.UpdataOrderStatus(order_id, number, adminUser.CurrentOrgId, "", "")
6766
 			if err == nil {
6828
 			if err == nil {
6767
 				c.ServeSuccessJSON(map[string]interface{}{
6829
 				c.ServeSuccessJSON(map[string]interface{}{
7492
 			result, _ := json.Marshal(respJSON)
7554
 			result, _ := json.Marshal(respJSON)
7493
 			fmt.Println("log")
7555
 			fmt.Println("log")
7494
 			fmt.Println(string(result))
7556
 			fmt.Println(string(result))
7495
-			if err := json.Unmarshal([]byte(result), &res); err != nil {
7557
+			if err := json.Unmarshal([]byte(result), &resEleven10265); err != nil {
7496
 				utils.ErrorLog("解析失败:%v", err)
7558
 				utils.ErrorLog("解析失败:%v", err)
7497
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
7559
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
7498
 				return
7560
 				return
7499
 			}
7561
 			}
7500
 
7562
 
7563
+			res.InfRefmsgid = resEleven10265.InfRefmsgid
7564
+			res.Output = resEleven10265.Output
7565
+			res.ErrMsg = resEleven10265.ErrMsg
7566
+			res.Cainfo = resEleven10265.Cainfo
7567
+			res.WarnMsg = resEleven10265.WarnMsg
7568
+			infocode, _ := strconv.ParseInt(resEleven10265.Infcode, 10, 64)
7569
+			res.Infcode = infocode
7570
+
7501
 		} else {
7571
 		} else {
7502
 			result2 := service.Gdyb5204(baseParams, businessParams)
7572
 			result2 := service.Gdyb5204(baseParams, businessParams)
7503
 			saveLog(result2, "", "5204", "查询")
7573
 			saveLog(result2, "", "5204", "查询")

+ 11 - 9
service/gdyb_service.go View File

772
 }
772
 }
773
 
773
 
774
 type Custom struct {
774
 type Custom struct {
775
-	DetItemFeeSumamt string
776
-	Cut              string
777
-	FeedetlSn        string
778
-	Price            string
779
-	MedListCodg      string
780
-	LmtUsedFlag      int64
781
-	HospApprFlag     int64
782
-	DoctorNumber     string
783
-	DoctorName       string
775
+	DetItemFeeSumamt        string
776
+	Cut                     string
777
+	FeedetlSn               string
778
+	Price                   string
779
+	MedListCodg             string
780
+	LmtUsedFlag             int64
781
+	HospApprFlag            int64
782
+	DoctorNumber            string
783
+	DoctorName              string
784
+	ProvinceDrugMedListCodg string
785
+	ProvinceGoodMedListCodg string
784
 }
786
 }
785
 
787
 
786
 type RequestResult struct {
788
 type RequestResult struct {

+ 1 - 0
service/jsyb_service.go View File

329
 						HospApprFlag:     subItem.HospApprFlag,
329
 						HospApprFlag:     subItem.HospApprFlag,
330
 						DoctorNumber:     doctor_id,
330
 						DoctorNumber:     doctor_id,
331
 						DoctorName:       new_doctor_name,
331
 						DoctorName:       new_doctor_name,
332
+						//ProvinceDrugMedListCodg:  subItem.BaseDrugLib.
332
 					}
333
 					}
333
 
334
 
334
 					customs = append(customs, cus)
335
 					customs = append(customs, cus)