test_user 1 gadu atpakaļ
vecāks
revīzija
213ea37739

+ 148 - 152
controllers/gz/new_his_api_controller.go Parādīt failu

@@ -71,10 +71,6 @@ func NewHisManagerApiRegistRouters() {
71 71
 	beego.Router("/api/batchsettlelist/get", &HisApiController{}, "get:GetBatchSettleList")
72 72
 	beego.Router("/api/psn/info", &HisApiController{}, "get:GetPsnNcdsInfo")
73 73
 
74
-	beego.Router("/api/allopatry/get", &HisApiController{}, "get:GetAllopatry")
75
-	beego.Router("/api/comfirmallopatry/post", &HisApiController{}, "post:ComfirmAllopatry")
76
-	beego.Router("/api/allopatry/refund", &HisApiController{}, "post:RefundAllopatry")
77
-
78 74
 	beego.Router("/api/check", &HisApiController{}, "get:Check")
79 75
 	beego.Router("/api/check3101", &HisApiController{}, "get:Check3101")
80 76
 	beego.Router("/api/check3102", &HisApiController{}, "get:Check3102")
@@ -11829,155 +11825,155 @@ func (c *HisApiController) ReversalData() {
11829 11825
 	}
11830 11826
 }
11831 11827
 
11832
-func (c *HisApiController) GetAllopatry() {
11833
-	year := c.GetString("year")
11834
-	month := c.GetString("month")
11835
-	admin_user_id, _ := c.GetInt64("admin_user_id")
11836
-	adminUser := c.GetAdminUserInfo()
11837
-	miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
11838
-	roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
11839
-	result, _ := service.Gdyb9001(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, 1669)
11840
-
11841
-	var dat map[string]interface{}
11842
-	if err := json.Unmarshal([]byte(result), &dat); err == nil {
11843
-		fmt.Println(dat)
11844
-	} else {
11845
-		fmt.Println(err)
11846
-	}
11847
-	userJSONBytes, _ := json.Marshal(dat)
11848
-	var res models.Result9001
11849
-	if err := json.Unmarshal(userJSONBytes, &res); err != nil {
11850
-		utils.ErrorLog("解析失败:%v", err)
11851
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
11852
-		return
11853
-	}
11854
-
11855
-	result2, _ := service.Gdyb3260(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, year, month, "")
11856
-	var dat2 map[string]interface{}
11857
-	if err := json.Unmarshal([]byte(result2), &dat2); err == nil {
11858
-		fmt.Println(dat)
11859
-	} else {
11860
-		fmt.Println(err)
11861
-	}
11862
-	userJSONBytes2, _ := json.Marshal(dat2)
11863
-	var res2 models.Result3260
11864
-	if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
11865
-		utils.ErrorLog("解析失败:%v", err)
11866
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
11867
-		return
11868
-	}
11869
-	if res2.Infcode == 0 {
11870
-		c.ServeSuccessJSON(map[string]interface{}{
11871
-			"list": res2.Output.Data,
11872
-		})
11873
-		return
11874
-	} else {
11875
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
11876
-		return
11877
-	}
11878
-
11879
-}
11880
-
11881
-func (c *HisApiController) ComfirmAllopatry() {
11882
-	year := c.GetString("year")
11883
-	month := c.GetString("month")
11884
-	admin_user_id, _ := c.GetInt64("admin_user_id")
11885
-	adminUser := c.GetAdminUserInfo()
11886
-	miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
11887
-	roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
11888
-	result, _ := service.Gdyb9001(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, 1669)
11889
-	var dat map[string]interface{}
11890
-	if err := json.Unmarshal([]byte(result), &dat); err == nil {
11891
-		fmt.Println(dat)
11892
-	} else {
11893
-		fmt.Println(err)
11894
-	}
11895
-	userJSONBytes, _ := json.Marshal(dat)
11896
-	var res models.Result9001
11897
-	if err := json.Unmarshal(userJSONBytes, &res); err != nil {
11898
-		utils.ErrorLog("解析失败:%v", err)
11899
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
11900
-		return
11901
-	}
11902
-
11903
-	result2, _ := service.Gdyb3260(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, year, month, "")
11904
-	var dat2 map[string]interface{}
11905
-	if err := json.Unmarshal([]byte(result2), &dat2); err == nil {
11906
-		fmt.Println(dat)
11907
-	} else {
11908
-		fmt.Println(err)
11909
-	}
11910
-	userJSONBytes2, _ := json.Marshal(dat2)
11911
-	var res2 models.Result3260
11912
-	if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
11913
-		utils.ErrorLog("解析失败:%v", err)
11914
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
11915
-		return
11916
-	}
11917
-
11918
-	if res2.Infcode == 0 {
11919
-		result, _, msgId := service.Gdyb3261(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, year, month, res2)
11920
-		var dat map[string]interface{}
11921
-		if err := json.Unmarshal([]byte(result), &dat); err == nil {
11922
-			fmt.Println(dat)
11923
-		} else {
11924
-			fmt.Println(err)
11925
-		}
11926
-		userJSONBytes, _ := json.Marshal(dat)
11927
-		var res3 models.Result3261
11928
-		if err := json.Unmarshal(userJSONBytes, &res3); err != nil {
11929
-			utils.ErrorLog("解析失败:%v", err)
11930
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
11931
-			return
11932
-		}
11933
-
11934
-		if res3.Infcode == 0 {
11935
-			record := &models.HisYidiClearRecord{
11936
-				UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
11937
-				Ctime:     time.Now().Unix(),
11938
-				Mtime:     time.Now().Unix(),
11939
-				Status:    1,
11940
-				MsgId:     msgId,
11941
-			}
11942
-			service.SaveClearRecord(record)
11943
-			c.ServeSuccessJSON(map[string]interface{}{
11944
-				"msg": "提取成功",
11945
-			})
11946
-		}
11947
-	}
11948
-}
11949
-
11950
-func (c *HisApiController) RefundAllopatry() {
11951
-	year := c.GetString("year")
11952
-	month := c.GetString("month")
11953
-	id, _ := c.GetInt64("id")
11954
-	admin_user_id, _ := c.GetInt64("admin_user_id")
11955
-	adminUser := c.GetAdminUserInfo()
11956
-	miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
11957
-	roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
11958
-	record, _ := service.GetClearRecordById(id)
11959
-	result, _ := service.Gdyb3262(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, year, month, record.MsgId)
11828
+//func (c *HisApiController) GetAllopatry() {
11829
+//	year := c.GetString("year")
11830
+//	month := c.GetString("month")
11831
+//	admin_user_id, _ := c.GetInt64("admin_user_id")
11832
+//	adminUser := c.GetAdminUserInfo()
11833
+//	miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
11834
+//	roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
11835
+//	result, _ := service.Gdyb9001(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, 1669)
11836
+//
11837
+//	var dat map[string]interface{}
11838
+//	if err := json.Unmarshal([]byte(result), &dat); err == nil {
11839
+//		fmt.Println(dat)
11840
+//	} else {
11841
+//		fmt.Println(err)
11842
+//	}
11843
+//	userJSONBytes, _ := json.Marshal(dat)
11844
+//	var res models.Result9001
11845
+//	if err := json.Unmarshal(userJSONBytes, &res); err != nil {
11846
+//		utils.ErrorLog("解析失败:%v", err)
11847
+//		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
11848
+//		return
11849
+//	}
11850
+//
11851
+//	result2, _ := service.Gdyb3260(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, year, month, "")
11852
+//	var dat2 map[string]interface{}
11853
+//	if err := json.Unmarshal([]byte(result2), &dat2); err == nil {
11854
+//		fmt.Println(dat)
11855
+//	} else {
11856
+//		fmt.Println(err)
11857
+//	}
11858
+//	userJSONBytes2, _ := json.Marshal(dat2)
11859
+//	var res2 models.Result3260
11860
+//	if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
11861
+//		utils.ErrorLog("解析失败:%v", err)
11862
+//		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
11863
+//		return
11864
+//	}
11865
+//	if res2.Infcode == 0 {
11866
+//		c.ServeSuccessJSON(map[string]interface{}{
11867
+//			"list": res2.Output.Data,
11868
+//		})
11869
+//		return
11870
+//	} else {
11871
+//		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
11872
+//		return
11873
+//	}
11874
+//
11875
+//}
11960 11876
 
11961
-	var dat map[string]interface{}
11962
-	if err := json.Unmarshal([]byte(result), &dat); err == nil {
11963
-		fmt.Println(dat)
11964
-	} else {
11965
-		fmt.Println(err)
11966
-	}
11967
-	userJSONBytes, _ := json.Marshal(dat)
11968
-	var empty ResultFourteen
11969
-	if err := json.Unmarshal(userJSONBytes, &empty); err != nil {
11970
-		utils.ErrorLog("解析失败:%v", err)
11971
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
11972
-		return
11973
-	}
11974
-	if empty.Infcode == 0 {
11975
-		c.ServeSuccessJSON(map[string]interface{}{
11976
-			"msg": "撤销成功",
11977
-		})
11978
-		return
11979
-	}
11980
-}
11877
+//func (c *HisApiController) ComfirmAllopatry() {
11878
+//	year := c.GetString("year")
11879
+//	month := c.GetString("month")
11880
+//	admin_user_id, _ := c.GetInt64("admin_user_id")
11881
+//	adminUser := c.GetAdminUserInfo()
11882
+//	miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
11883
+//	roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
11884
+//	result, _ := service.Gdyb9001(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, 1669)
11885
+//	var dat map[string]interface{}
11886
+//	if err := json.Unmarshal([]byte(result), &dat); err == nil {
11887
+//		fmt.Println(dat)
11888
+//	} else {
11889
+//		fmt.Println(err)
11890
+//	}
11891
+//	userJSONBytes, _ := json.Marshal(dat)
11892
+//	var res models.Result9001
11893
+//	if err := json.Unmarshal(userJSONBytes, &res); err != nil {
11894
+//		utils.ErrorLog("解析失败:%v", err)
11895
+//		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
11896
+//		return
11897
+//	}
11898
+//
11899
+//	result2, _ := service.Gdyb3260(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, year, month, "")
11900
+//	var dat2 map[string]interface{}
11901
+//	if err := json.Unmarshal([]byte(result2), &dat2); err == nil {
11902
+//		fmt.Println(dat)
11903
+//	} else {
11904
+//		fmt.Println(err)
11905
+//	}
11906
+//	userJSONBytes2, _ := json.Marshal(dat2)
11907
+//	var res2 models.Result3260
11908
+//	if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
11909
+//		utils.ErrorLog("解析失败:%v", err)
11910
+//		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
11911
+//		return
11912
+//	}
11913
+//
11914
+//	if res2.Infcode == 0 {
11915
+//		result, _, msgId := service.Gdyb3261(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, year, month, res2)
11916
+//		var dat map[string]interface{}
11917
+//		if err := json.Unmarshal([]byte(result), &dat); err == nil {
11918
+//			fmt.Println(dat)
11919
+//		} else {
11920
+//			fmt.Println(err)
11921
+//		}
11922
+//		userJSONBytes, _ := json.Marshal(dat)
11923
+//		var res3 models.Result3261
11924
+//		if err := json.Unmarshal(userJSONBytes, &res3); err != nil {
11925
+//			utils.ErrorLog("解析失败:%v", err)
11926
+//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
11927
+//			return
11928
+//		}
11929
+//
11930
+//		if res3.Infcode == 0 {
11931
+//			record := &models.HisYidiClearRecord{
11932
+//				UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
11933
+//				Ctime:     time.Now().Unix(),
11934
+//				Mtime:     time.Now().Unix(),
11935
+//				Status:    1,
11936
+//				MsgId:     msgId,
11937
+//			}
11938
+//			service.SaveClearRecord(record)
11939
+//			c.ServeSuccessJSON(map[string]interface{}{
11940
+//				"msg": "提取成功",
11941
+//			})
11942
+//		}
11943
+//	}
11944
+//}
11945
+//
11946
+//func (c *HisApiController) RefundAllopatry() {
11947
+//	year := c.GetString("year")
11948
+//	month := c.GetString("month")
11949
+//	id, _ := c.GetInt64("id")
11950
+//	admin_user_id, _ := c.GetInt64("admin_user_id")
11951
+//	adminUser := c.GetAdminUserInfo()
11952
+//	miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
11953
+//	roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
11954
+//	record, _ := service.GetClearRecordById(id)
11955
+//	result, _ := service.Gdyb3262(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, year, month, record.MsgId)
11956
+//
11957
+//	var dat map[string]interface{}
11958
+//	if err := json.Unmarshal([]byte(result), &dat); err == nil {
11959
+//		fmt.Println(dat)
11960
+//	} else {
11961
+//		fmt.Println(err)
11962
+//	}
11963
+//	userJSONBytes, _ := json.Marshal(dat)
11964
+//	var empty ResultFourteen
11965
+//	if err := json.Unmarshal(userJSONBytes, &empty); err != nil {
11966
+//		utils.ErrorLog("解析失败:%v", err)
11967
+//		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
11968
+//		return
11969
+//	}
11970
+//	if empty.Infcode == 0 {
11971
+//		c.ServeSuccessJSON(map[string]interface{}{
11972
+//			"msg": "撤销成功",
11973
+//		})
11974
+//		return
11975
+//	}
11976
+//}
11981 11977
 
11982 11978
 func (c *HisApiController) ReversalOtherData() {
11983 11979
 	var customData []*CustomData

+ 194 - 120
controllers/sg/his_api_controller.go Parādīt failu

@@ -100,6 +100,12 @@ func HisManagerApiRegistRouters() {
100 100
 	beego.Router("/api/4209", &HisApiController{}, "get:Get4209")
101 101
 	//
102 102
 
103
+	beego.Router("/api/allopatry/get", &HisApiController{}, "get:GetAllopatry")
104
+	beego.Router("/api/comfirmallopatry/post", &HisApiController{}, "post:ComfirmAllopatry")
105
+	beego.Router("/api/allopatry/refund", &HisApiController{}, "post:RefundAllopatry")
106
+
107
+	//beego.Router("/api/2205", &HisApiController{}, "get:Get2205")
108
+
103 109
 }
104 110
 
105 111
 func (c *HisApiController) Get2505() {
@@ -3066,6 +3072,12 @@ func (c *HisApiController) ReadCard() {
3066 3072
 			patient, _ := service.GetPatientByIDCard(id_card_no, miConfig.UserOrgId)
3067 3073
 
3068 3074
 			basStr := cardnum + "|" + cardCode + "|" + id_card_no + "|" + name
3075
+
3076
+			result2, requestLog2, errMsgLog2 := service.FJybidcomfirm(cardnum, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, id_card_type, cardCode, certificates, miConfig.Url, miConfig.Cainfo, miConfig.AppSecret, miConfig.SignKey, miConfig.EncKey, patient.Name)
3077
+			fmt.Println(result2)
3078
+			fmt.Println(requestLog2)
3079
+			fmt.Println(errMsgLog2)
3080
+
3069 3081
 			result, requestLog, errMsgLog := service.FJyb1101(cardnum, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, id_card_type, cardCode, certificates, miConfig.Url, miConfig.Cainfo, miConfig.AppSecret, miConfig.SignKey, miConfig.EncKey, patient.Name)
3070 3082
 			saveLog(result, requestLog, "1101", "获取人员信息")
3071 3083
 			fmt.Println(errMsgLog)
@@ -3432,7 +3444,7 @@ func (c *HisApiController) ReadCard() {
3432 3444
 			fmt.Println(cardNumber)
3433 3445
 			patient, _ := service.GetPatientByIDCard(basNumber, miConfig.UserOrgId)
3434 3446
 
3435
-			result := service.Gdyb1101B(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, bas[0], miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, certificates, patient.Name, cardNumber)
3447
+			result := service.Gdyb1101f(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, bas[0], miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, certificates, patient.Name, cardNumber)
3436 3448
 			var dat map[string]interface{}
3437 3449
 			if err := json.Unmarshal([]byte(result), &dat); err == nil {
3438 3450
 				fmt.Println(dat)
@@ -3500,7 +3512,7 @@ func (c *HisApiController) ReadCard() {
3500 3512
 						insutype = "310"
3501 3513
 					}
3502 3514
 					if len(insutypes) == 0 {
3503
-						insutype = "390"
3515
+						insutype = "310"
3504 3516
 					}
3505 3517
 					for _, item := range rf {
3506 3518
 						if item.Insutype == insutype {
@@ -8358,7 +8370,7 @@ func (c *HisApiController) GetRegisterInfo() {
8358 8370
 			var result string
8359 8371
 			var requestLog string
8360 8372
 			if miConfig.UserOrgId == 10138 {
8361
-				if id_card_type != 4 || id_card_type != 2 {
8373
+				if id_card_type != 4 || id_card_type != 1 {
8362 8374
 					var insa string
8363 8375
 					if len(patient.InsuplcAdmdvs) > 0 {
8364 8376
 						insa = patient.InsuplcAdmdvs
@@ -8857,6 +8869,45 @@ func (c *HisApiController) GetRegisterInfo() {
8857 8869
 				psn_info, _ := service.GetPsnByPatientId(id)
8858 8870
 				if id_card_type == 4 || id_card_type == 1 {
8859 8871
 					insuplc_admdvs_temp = psn_info.InsuplcAdmdvs
8872
+
8873
+				}
8874
+				var rf []*ResultFive
8875
+				json.Unmarshal([]byte(psn_info.Insuinfo), &rf)
8876
+				var insutypes []*ResultFive
8877
+				var insutype string
8878
+				var is390 int = 0
8879
+				var is310 int = 0
8880
+
8881
+				for _, item := range rf {
8882
+					if (item.Insutype == "390" && item.PsnInsuStas == "1") || (item.Insutype == "310" && item.PsnInsuStas == "1") {
8883
+						insutypes = append(insutypes, item)
8884
+					}
8885
+				}
8886
+
8887
+				if len(insutypes) == 1 {
8888
+					insutype = insutypes[0].Insutype
8889
+					insuplc_admdvs = insutypes[0].InsuplcAdmdvs
8890
+				} else {
8891
+					for _, i := range insutypes {
8892
+						if i.Insutype == "390" {
8893
+							is390 = 1
8894
+						}
8895
+
8896
+						if i.Insutype == "310" {
8897
+							is310 = 1
8898
+						}
8899
+					}
8900
+				}
8901
+				if is390 == 1 {
8902
+					insutype = "390"
8903
+				}
8904
+
8905
+				if is310 == 1 {
8906
+					insutype = "310"
8907
+				}
8908
+
8909
+				if len(insutypes) == 0 {
8910
+					insutype = "310"
8860 8911
 				}
8861 8912
 
8862 8913
 				result, requestLog := service.Gdyb2201A(PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_info.DoctorNumber, insuplc_admdvs_temp, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName, record_time, psn_info.VerifyNumber)
@@ -9234,6 +9285,11 @@ func (c *HisApiController) GetUploadInfo() {
9234 9285
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
9235 9286
 				return
9236 9287
 			}
9288
+
9289
+			result2, src_request, _ := service.FJyb2205(his.PsnNo, his.Number, "0000", miConfig.OrgName, roles.UserName, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, miConfig.Code, miConfig.Url, miConfig.Code, miConfig.AppSecret, miConfig.SignKey, miConfig.EncKey)
9290
+			fmt.Println(result2)
9291
+			fmt.Println(src_request)
9292
+
9237 9293
 		} else {
9238 9294
 			if miConfig.MdtrtareaAdmvs == "440781" { //
9239 9295
 				result, requestLog = service.Gdyb2203A(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), doctor_info.DoctorNumber, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.ContentCode, sickConfig.ClassName, roles.UserName, config, begin_time)
@@ -10059,6 +10115,7 @@ func (c *HisApiController) GetUploadInfo() {
10059 10115
 							order.CvlservFlag = res.Output.Setlinfo.CvlservFlag
10060 10116
 							order.SetlTime = res.Output.Setlinfo.SetlTime
10061 10117
 							order.MdtrtCertType = res.Output.Setlinfo.MdtrtCertType
10118
+
10062 10119
 							if res.Output.Setlinfo.MedType == "140101" {
10063 10120
 								order.MedType = "14"
10064 10121
 
@@ -10562,6 +10619,14 @@ func (c *HisApiController) GetUploadInfo() {
10562 10619
 				order.CvlservFlag = res.Output.Setlinfo.CvlservFlag
10563 10620
 				order.SetlTime = res.Output.Setlinfo.SetlTime
10564 10621
 				order.MdtrtCertType = res.Output.Setlinfo.MdtrtCertType
10622
+				order.PayWays = pay_ways
10623
+				order.AcctUsedFlag = acct_used_flag
10624
+				order.WechatPay = wechat_pay
10625
+				order.AliPay = ali_pay
10626
+				order.JifenPay = jifen_pay
10627
+				order.BandCardPay = band_card_pay
10628
+				order.CashPay = cash_pay
10629
+				order.OthDesc = oth_desc
10565 10630
 				//order.MedType = res.Output.Setlinfo.MedType
10566 10631
 				if reg_type == 1112 {
10567 10632
 					order.MedType = "1112"
@@ -13428,7 +13493,7 @@ func (c *HisApiController) GetCheckAccount() {
13428 13493
 			}
13429 13494
 			api := "http://172.16.13.254:9532/" + "nmyb/3201?" +
13430 13495
 				"insutype=" + insutype +
13431
-				"&clr_type=" + "51" +
13496
+				"&clr_type=" + clr_type +
13432 13497
 				"&setl_optins=" + clr_org +
13433 13498
 				"&stmt_begndate=" + start_time +
13434 13499
 				"&stm_enddate=" + end_time +
@@ -15969,123 +16034,132 @@ func (c *HisApiController) ReversalData() {
15969 16034
 	}
15970 16035
 }
15971 16036
 
15972
-//func (c *HisApiController) GetAllopatry() {
15973
-//	year := c.GetString("year")
15974
-//	month := c.GetString("month")
15975
-//	admin_user_id, _ := c.GetInt64("admin_user_id")
15976
-//	adminUser := c.GetAdminUserInfo()
15977
-//	miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
15978
-//	roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
15979
-//	result, _ := service.Gdyb9001(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, 1669)
15980
-//
15981
-//	var dat map[string]interface{}
15982
-//	if err := json.Unmarshal([]byte(result), &dat); err == nil {
15983
-//		fmt.Println(dat)
15984
-//	} else {
15985
-//		fmt.Println(err)
15986
-//	}
15987
-//	userJSONBytes, _ := json.Marshal(dat)
15988
-//	var res models.Result9001
15989
-//	if err := json.Unmarshal(userJSONBytes, &res); err != nil {
15990
-//		utils.ErrorLog("解析失败:%v", err)
15991
-//		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
15992
-//		return
15993
-//	}
15994
-//
15995
-//	result2, _ := service.Gdyb3260(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, year, month, res.Output.Signinoutb.SignNo)
15996
-//	var dat2 map[string]interface{}
15997
-//	if err := json.Unmarshal([]byte(result2), &dat2); err == nil {
15998
-//		fmt.Println(dat)
15999
-//	} else {
16000
-//		fmt.Println(err)
16001
-//	}
16002
-//	userJSONBytes2, _ := json.Marshal(dat2)
16003
-//	var res2 models.Result3260
16004
-//	if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
16005
-//		utils.ErrorLog("解析失败:%v", err)
16006
-//		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
16007
-//		return
16008
-//	}
16009
-//	if res2.Infcode == 0 {
16010
-//		c.ServeSuccessJSON(map[string]interface{}{
16011
-//			"list": res2.Output.Data,
16012
-//		})
16013
-//		return
16014
-//	} else {
16015
-//		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
16016
-//		return
16017
-//	}
16018
-//
16019
-//}
16037
+func (c *HisApiController) GetAllopatry() {
16038
+	year := c.GetString("year")
16039
+	month := c.GetString("month")
16040
+	admin_user_id, _ := c.GetInt64("admin_user_id")
16041
+	adminUser := c.GetAdminUserInfo()
16042
+	miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
16043
+	roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
16044
+	result, _ := service.Gdyb9001Two(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, admin_user_id)
16020 16045
 
16021
-//func (c *HisApiController) ComfirmAllopatry() {
16022
-//	year := c.GetString("year")
16023
-//	month := c.GetString("month")
16024
-//	admin_user_id, _ := c.GetInt64("admin_user_id")
16025
-//	adminUser := c.GetAdminUserInfo()
16026
-//	miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
16027
-//	roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
16028
-//	result, _ := service.Gdyb9001(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, 1669)
16029
-//	var dat map[string]interface{}
16030
-//	if err := json.Unmarshal([]byte(result), &dat); err == nil {
16031
-//		fmt.Println(dat)
16032
-//	} else {
16033
-//		fmt.Println(err)
16034
-//	}
16035
-//	userJSONBytes, _ := json.Marshal(dat)
16036
-//	var res models.Result9001
16037
-//	if err := json.Unmarshal(userJSONBytes, &res); err != nil {
16038
-//		utils.ErrorLog("解析失败:%v", err)
16039
-//		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
16040
-//		return
16041
-//	}
16042
-//
16043
-//	result2, _ := service.Gdyb3260(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, year, month, res.Output.Signinoutb.SignNo)
16044
-//	var dat2 map[string]interface{}
16045
-//	if err := json.Unmarshal([]byte(result2), &dat2); err == nil {
16046
-//		fmt.Println(dat)
16047
-//	} else {
16048
-//		fmt.Println(err)
16049
-//	}
16050
-//	userJSONBytes2, _ := json.Marshal(dat2)
16051
-//	var res2 models.Result3260
16052
-//	if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
16053
-//		utils.ErrorLog("解析失败:%v", err)
16054
-//		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
16055
-//		return
16056
-//	}
16057
-//
16058
-//	if res2.Infcode == 0 {
16059
-//		result, _, msgId := service.Gdyb3261(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, year, month, res2)
16060
-//		var dat map[string]interface{}
16061
-//		if err := json.Unmarshal([]byte(result), &dat); err == nil {
16062
-//			fmt.Println(dat)
16063
-//		} else {
16064
-//			fmt.Println(err)
16065
-//		}
16066
-//		userJSONBytes, _ := json.Marshal(dat)
16067
-//		var res3 models.Result3261
16068
-//		if err := json.Unmarshal(userJSONBytes, &res3); err != nil {
16069
-//			utils.ErrorLog("解析失败:%v", err)
16070
-//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
16071
-//			return
16072
-//		}
16073
-//
16074
-//		if res3.Infcode == 0 {
16075
-//			record := &models.HisYidiClearRecord{
16076
-//				UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
16077
-//				Ctime:     time.Now().Unix(),
16078
-//				Mtime:     time.Now().Unix(),
16079
-//				Status:    1,
16080
-//				MsgId:     msgId,
16081
-//			}
16082
-//			service.SaveClearRecord(record)
16083
-//			c.ServeSuccessJSON(map[string]interface{}{
16084
-//				"msg": "提取成功",
16085
-//			})
16086
-//		}
16087
-//	}
16088
-//}
16046
+	var dat map[string]interface{}
16047
+	if err := json.Unmarshal([]byte(result), &dat); err == nil {
16048
+		fmt.Println(dat)
16049
+	} else {
16050
+		fmt.Println(err)
16051
+	}
16052
+	userJSONBytes, _ := json.Marshal(dat)
16053
+	var res models.Result9001
16054
+	if err := json.Unmarshal(userJSONBytes, &res); err != nil {
16055
+		utils.ErrorLog("解析失败:%v", err)
16056
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
16057
+		return
16058
+	}
16059
+	fmt.Println(res.Output.Signinoutb)
16060
+	fmt.Println(res.Output.Signinoutb.SignNo)
16061
+	fmt.Println(string(userJSONBytes))
16062
+
16063
+	result2, _ := service.Gdyb3260(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, year, month, res.Output.Signinoutb.SignNo)
16064
+	var dat2 map[string]interface{}
16065
+	if err := json.Unmarshal([]byte(result2), &dat2); err == nil {
16066
+		fmt.Println(dat)
16067
+	} else {
16068
+		fmt.Println(err)
16069
+	}
16070
+	userJSONBytes2, _ := json.Marshal(dat2)
16071
+	var res2 models.Result3260
16072
+	if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
16073
+		utils.ErrorLog("解析失败:%v", err)
16074
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
16075
+		return
16076
+	}
16077
+	if res2.Infcode == 0 {
16078
+		result3, _, _ := service.Gdyb3261(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, year, month, res2)
16079
+		var dat2 map[string]interface{}
16080
+		if err := json.Unmarshal([]byte(result3), &dat2); err == nil {
16081
+			fmt.Println(dat)
16082
+		} else {
16083
+			fmt.Println(err)
16084
+		}
16085
+		c.ServeSuccessJSON(map[string]interface{}{
16086
+			"list": res2.Output.Data,
16087
+		})
16088
+		return
16089
+	} else {
16090
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
16091
+		return
16092
+	}
16093
+}
16094
+
16095
+func (c *HisApiController) ComfirmAllopatry() {
16096
+	year := c.GetString("year")
16097
+	month := c.GetString("month")
16098
+	admin_user_id, _ := c.GetInt64("admin_user_id")
16099
+	adminUser := c.GetAdminUserInfo()
16100
+	miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
16101
+	roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
16102
+	result, _ := service.Gdyb9001Two(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, admin_user_id)
16103
+	var dat map[string]interface{}
16104
+	if err := json.Unmarshal([]byte(result), &dat); err == nil {
16105
+		fmt.Println(dat)
16106
+	} else {
16107
+		fmt.Println(err)
16108
+	}
16109
+	userJSONBytes, _ := json.Marshal(dat)
16110
+	var res models.Result9001
16111
+	if err := json.Unmarshal(userJSONBytes, &res); err != nil {
16112
+		utils.ErrorLog("解析失败:%v", err)
16113
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
16114
+		return
16115
+	}
16116
+
16117
+	result2, _ := service.Gdyb3260(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, year, month, res.Output.Signinoutb.SignNo)
16118
+	var dat2 map[string]interface{}
16119
+	if err := json.Unmarshal([]byte(result2), &dat2); err == nil {
16120
+		fmt.Println(dat)
16121
+	} else {
16122
+		fmt.Println(err)
16123
+	}
16124
+	userJSONBytes2, _ := json.Marshal(dat2)
16125
+	var res2 models.Result3260
16126
+	if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
16127
+		utils.ErrorLog("解析失败:%v", err)
16128
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
16129
+		return
16130
+	}
16131
+
16132
+	if res2.Infcode == 0 {
16133
+		result, _, msgId := service.Gdyb3261(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, year, month, res2)
16134
+		var dat map[string]interface{}
16135
+		if err := json.Unmarshal([]byte(result), &dat); err == nil {
16136
+			fmt.Println(dat)
16137
+		} else {
16138
+			fmt.Println(err)
16139
+		}
16140
+		userJSONBytes, _ := json.Marshal(dat)
16141
+		var res3 models.Result3261
16142
+		if err := json.Unmarshal(userJSONBytes, &res3); err != nil {
16143
+			utils.ErrorLog("解析失败:%v", err)
16144
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
16145
+			return
16146
+		}
16147
+
16148
+		if res3.Infcode == 0 {
16149
+			record := &models.HisYidiClearRecord{
16150
+				UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
16151
+				Ctime:     time.Now().Unix(),
16152
+				Mtime:     time.Now().Unix(),
16153
+				Status:    1,
16154
+				MsgId:     msgId,
16155
+			}
16156
+			service.SaveClearRecord(record)
16157
+			c.ServeSuccessJSON(map[string]interface{}{
16158
+				"msg": "提取成功",
16159
+			})
16160
+		}
16161
+	}
16162
+}
16089 16163
 
16090 16164
 func (c *HisApiController) RefundAllopatry() {
16091 16165
 	year := c.GetString("year")

+ 2 - 2
models/yb_models.go Parādīt failu

@@ -47,10 +47,10 @@ type Result9001 struct {
47 47
 	InfRefmsgid string `json:"inf_refmsgid"`
48 48
 	Infcode     int64  `json:"infcode"`
49 49
 	Output      struct {
50
-		Result struct {
50
+		Signinoutb struct {
51 51
 			SignNo   string `json:"sign_no"`
52 52
 			SignTime string `json:"sign_time"`
53
-		} `json:"result"`
53
+		} `json:"signinoutb"`
54 54
 	} `json:"output"`
55 55
 	RefmsgTime  string      `json:"refmsg_time"`
56 56
 	RespondTime string      `json:"respond_time"`

+ 35 - 1
service/fj_service.go Parādīt failu

@@ -36,7 +36,7 @@ func FJyb1101(certNo string, org_name string, doctor string, fixmedins_code stri
36 36
 	timestamp := time.Now().Unix()
37 37
 	//生成输入报文
38 38
 
39
-	inputMessage := SetFjInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, app_id, app_secret, sign_key, enc_key)
39
+	inputMessage := SetFjInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, "", mdtrtarea_admvs, url, app_id, app_secret, sign_key, enc_key)
40 40
 	input := make(map[string]interface{})
41 41
 	inputData := make(map[string]interface{})
42 42
 	inputMessage["infno"] = "1101" // 交易编码
@@ -86,6 +86,40 @@ func FJyb1101(certNo string, org_name string, doctor string, fixmedins_code stri
86 86
 	output, err_msg := GetFjBusinessHandleInfo([]byte(enc.ConvertString(string(bytesData))))
87 87
 	return output, inputLog, err_msg
88 88
 }
89
+func FJybidcomfirm(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, id_card_type int64, card_sn string, certificates int64, url string, app_id string, app_secret string, sign_key string, enc_key string, name string) (string, string, string) {
90
+	//生成签名
91
+	//nonce := GetRandomString(32)
92
+	//timestamp := time.Now().Unix()
93
+	//生成输入报文
94
+
95
+	//i nputMessage := SetFjInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, app_id, app_secret, sign_key, enc_key)
96
+	//input := make(map[string]interface{})
97
+	inputMessage := make(map[string]interface{})
98
+
99
+	inputData := make(map[string]interface{})
100
+	inputMessage["funid"] = "yb04.10.01.16" // 交易编码
101
+	inputMessage["info"] = ""               // 交易编码
102
+
103
+	inputData["bkz543"] = ""         // 就诊凭证类型
104
+	inputData["aaz501"] = card_sn    // 卡识别码
105
+	inputData["bke284"] = "01"       // 人员证件类型
106
+	inputData["aaz500"] = certNo     // 就诊凭证编号
107
+	inputData["aac002"] = certNo     // 证件号码
108
+	inputData["aac003"] = name       // 人员姓名
109
+	inputMessage["data"] = inputData //交易输入
110
+
111
+	var inputLog string
112
+	bytesData, err := json.Marshal(inputMessage)
113
+	inputLog = string(bytesData)
114
+	fmt.Println(string(bytesData))
115
+	if err != nil {
116
+		fmt.Println(err.Error())
117
+		return err.Error(), "", ""
118
+	}
119
+	enc := mahonia.NewEncoder("gbk")
120
+	output, err_msg := GetFjBusinessHandleInfo([]byte(enc.ConvertString(string(bytesData))))
121
+	return output, inputLog, err_msg
122
+}
89 123
 
90 124
 func FJyb1101ForEleToken(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, id_card_type int64, card_sn string, certificates int64, url string, app_id string, app_secret string, sign_key string, enc_key string, token string, name string) (string, string, string) {
91 125
 	//生成签名

+ 187 - 2
service/gdyb_service.go Parādīt failu

@@ -3435,7 +3435,7 @@ func SetInputMessageTwo(nonce string, timestamp int64, org_name string, doctor s
3435 3435
 	if mdtrtarea_admvs == "440100" {
3436 3436
 		inputMessage["sign_no"] = GetSignInInfo(fixmedins_code) //交易签到流水号
3437 3437
 	} else {
3438
-		inputMessage["sign_no"] = "" //交易签到流水号
3438
+		inputMessage["sign_no"] = sign_no //交易签到流水号
3439 3439
 	}
3440 3440
 	return inputMessage
3441 3441
 }
@@ -3808,6 +3808,108 @@ func Gdyb1101B(certNo string, org_name string, doctor string, fixmedins_code str
3808 3808
 	return str
3809 3809
 }
3810 3810
 
3811
+func Gdyb1101f(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, id_card_type int64, card_sn string, certificates int64, name string, cardNumber string) string {
3812
+	//生成签名
3813
+	nonce := GetRandomString(32)
3814
+	timestamp := time.Now().Unix()
3815
+	signature := setSignature(timestamp, nonce, secret_key)
3816
+	//生成输入报文
3817
+	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
3818
+	input := make(map[string]interface{})
3819
+	inputData := make(map[string]interface{})
3820
+	inputMessage["infno"] = "1101" // 交易编码
3821
+
3822
+	if certificates == 3 {
3823
+		inputData["mdtrt_cert_type"] = "99"     // 就诊凭证类型
3824
+		inputData["certno"] = "01836483"        // 证件号码
3825
+		inputData["psn_cert_type"] = "01"       // 人员证件类型
3826
+		inputData["mdtrt_cert_no"] = "01836483" // 就诊凭证编号
3827
+
3828
+	} else {
3829
+		if certificates == 1 {
3830
+			if id_card_type == 1 {
3831
+				inputData["mdtrt_cert_type"] = "03" // 就诊凭证类型
3832
+				inputData["card_sn"] = ""           // 卡识别码
3833
+				inputData["certno"] = certNo        // 证件号码
3834
+				inputData["psn_cert_type"] = "01"   // 人员证件类型
3835
+				inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
3836
+
3837
+			} else {
3838
+				inputData["mdtrt_cert_type"] = "02" // 就诊凭证类型
3839
+				inputData["card_sn"] = ""           // 卡识别码
3840
+				inputData["certno"] = certNo        // 证件号码
3841
+				inputData["psn_cert_type"] = ""     // 人员证件类型
3842
+				inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
3843
+
3844
+			}
3845
+
3846
+		} else if certificates == 6 {
3847
+			inputData["mdtrt_cert_type"] = "03" // 就诊凭证类型
3848
+			inputData["card_sn"] = ""           // 卡识别码
3849
+			inputData["certno"] = certNo        // 证件号码
3850
+			inputData["psn_cert_type"] = "17"   // 人员证件类型
3851
+			inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
3852
+
3853
+		}
3854
+
3855
+	}
3856
+
3857
+	inputData["begntime"] = "" // 开始时间
3858
+	inputData["psn_name"] = "" // 人员姓名
3859
+	input["data"] = inputData
3860
+	inputMessage["input"] = input //交易输入
3861
+
3862
+	bytesData, err := json.Marshal(inputMessage)
3863
+	fmt.Println(string(bytesData))
3864
+	if err != nil {
3865
+		fmt.Println(err.Error())
3866
+		return err.Error()
3867
+	}
3868
+	reader := bytes.NewReader(bytesData)
3869
+	gdyb_url := beego.AppConfig.String("gdyb_url")
3870
+	gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
3871
+
3872
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/1101"
3873
+	//url := gdyb_url + "1101"
3874
+	var url string
3875
+	if fixmedins_code == "H15049901371" {
3876
+		url = gdyb_url
3877
+	} else {
3878
+		url = gdyb_url + "1101"
3879
+	}
3880
+
3881
+	fmt.Println(url)
3882
+	fmt.Println(gdyb_paasid)
3883
+	fmt.Println(secret_key)
3884
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
3885
+	request, err := http.NewRequest("POST", url, reader)
3886
+	if err != nil {
3887
+		fmt.Println(err.Error())
3888
+		return err.Error()
3889
+	}
3890
+
3891
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
3892
+	request.Header.Set("x-tif-paasid", gdyb_paasid)
3893
+	request.Header.Set("x-tif-signature", signature)
3894
+	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
3895
+	request.Header.Set("x-tif-nonce", nonce)
3896
+
3897
+	client := http.Client{}
3898
+	resp, err := client.Do(request)
3899
+	if err != nil {
3900
+		fmt.Println(err.Error())
3901
+		return err.Error()
3902
+	}
3903
+	respBytes, err := ioutil.ReadAll(resp.Body)
3904
+	if err != nil {
3905
+		fmt.Println(err.Error())
3906
+		return err.Error()
3907
+	}
3908
+	fmt.Println(string(respBytes))
3909
+	str := string(respBytes)
3910
+	return str
3911
+}
3912
+
3811 3913
 func Gdyb1101G(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, id_card_type int64, card_sn string, certificates int64, name string, cardNumber string) string {
3812 3914
 	//生成签名
3813 3915
 	nonce := GetRandomString(32)
@@ -4206,7 +4308,7 @@ func Gdyb3260(org_name string, doctor string, fixmedins_code string, insuplc_adm
4206 4308
 	input := make(map[string]interface{})
4207 4309
 	inputData := make(map[string]interface{})
4208 4310
 	inputMessage["infno"] = "3260" // 交易编码
4209
-
4311
+	inputData["sign"] = sign       // 就诊凭证编号
4210 4312
 	inputData["trt_year"] = year   // 就诊凭证编号
4211 4313
 	inputData["trt_month"] = month // 开始时间
4212 4314
 	inputData["startrow"] = "100"  // 人员姓名
@@ -4555,6 +4657,89 @@ func Gdyb9001(org_name string, doctor string, fixmedins_code string, insuplc_adm
4555 4657
 
4556 4658
 }
4557 4659
 
4660
+func Gdyb9001Two(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, admin_user_id int64) (string, string) {
4661
+	//生成签名
4662
+	nonce := GetRandomString(32)
4663
+	timestamp := time.Now().Unix()
4664
+	signature := setSignature(timestamp, nonce, secret_key)
4665
+	//生成输入报文
4666
+	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
4667
+	input := make(map[string]interface{})
4668
+	inputData := make(map[string]interface{})
4669
+	inputMessage["infno"] = "9001"        // 交易编码
4670
+	inputData["opter_no"] = admin_user_id // 就诊凭证编号
4671
+	inputData["mac"] = GetMac()           // 开始时间
4672
+	inputData["ip"] = GetLocalIp()
4673
+	input["signIn"] = inputData
4674
+	inputMessage["input"] = input //交易输入
4675
+	var inputLog string
4676
+	bytesData, err := json.Marshal(inputMessage)
4677
+	inputLog = string(bytesData)
4678
+	fmt.Println(string(bytesData))
4679
+	if err != nil {
4680
+		fmt.Println(err.Error())
4681
+		return err.Error(), ""
4682
+	}
4683
+	reader := bytes.NewReader(bytesData)
4684
+	gdyb_url := beego.AppConfig.String("gdyb_url")
4685
+	gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
4686
+
4687
+	var url string
4688
+	if fixmedins_code == "H15049901371" {
4689
+		url = gdyb_url
4690
+	} else {
4691
+		url = gdyb_url + "9001"
4692
+	}
4693
+
4694
+	if insuplc_admdvs == "421300" {
4695
+		var json2 string
4696
+		cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "1101", string(bytesData), json2)
4697
+		out, err := cmd.Output()
4698
+		if err != nil {
4699
+			fmt.Println("error:", err.Error())
4700
+		}
4701
+		fmt.Println(string(out))
4702
+		return hex.EncodeToString(out), inputLog
4703
+	} else {
4704
+
4705
+		//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
4706
+
4707
+		request, err := http.NewRequest("POST", url, reader)
4708
+		if err != nil {
4709
+			fmt.Println(err.Error())
4710
+			return err.Error(), ""
4711
+		}
4712
+
4713
+		request.Header.Set("Content-Type", "application/json;charset=UTF-8")
4714
+		request.Header.Set("x-tif-paasid", gdyb_paasid)
4715
+		request.Header.Set("x-tif-signature", signature)
4716
+		request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
4717
+		request.Header.Set("x-tif-nonce", nonce)
4718
+
4719
+		fmt.Println(string(bytesData))
4720
+		fmt.Println(gdyb_url)
4721
+		fmt.Println(gdyb_paasid)
4722
+		fmt.Println(request.Header)
4723
+
4724
+		client := http.Client{}
4725
+		resp, err := client.Do(request)
4726
+		if err != nil {
4727
+			fmt.Println(err.Error())
4728
+			return err.Error(), ""
4729
+		}
4730
+		respBytes, err := ioutil.ReadAll(resp.Body)
4731
+		if err != nil {
4732
+			fmt.Println(err.Error())
4733
+			return err.Error(), ""
4734
+		}
4735
+		fmt.Println(string(respBytes))
4736
+		str := string(respBytes)
4737
+		return str, inputLog
4738
+
4739
+	}
4740
+
4741
+}
4742
+
4558 4743
 //获取本机ip
4559 4744
 func GetLocalIp() string {
4560 4745
 	addrs, err := net.InterfaceAddrs()