Przeglądaj źródła

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

csx 1 rok temu
rodzic
commit
2ee2375181

+ 6 - 5
conf/app.conf Wyświetl plik

@@ -45,7 +45,7 @@ appsecret="61ee2e6268497d5aa9de0b0187c39aea"
45 45
 
46 46
 
47 47
 [prod]
48
-org_id = 10028
48
+org_id = 10318
49 49
 mobile_token_expiration_second = 86400
50 50
 httpdomain = https://api.xt.kuyicloud.com
51 51
 sso_domain = https://sso.kuyicloud.com
@@ -54,11 +54,12 @@ front_end_domain = "https://xt.kuyicloud.com/#"
54 54
 #url  = "http://192.168.1.228:17001/szsi-portal/transData"
55 55
 #url = "http://192.168.1.88:6666/szsi-portal/transData"
56 56
 # gdyb_url = "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/"
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
 # gdyb_url = "http://10.97.240.206/ebus/sztest_hosp/poc/hsa/hgs/"
59 59
 #内蒙古
60 60
 # http://tyjk.nm.hsip.gov.cn:8090/uif-hsaf-med-api/api/medical/service
61 61
 # gdyb_url = "http://tyjk.nm.hsip.gov.cn:8090/uif-hsaf-med-api/api/medical/service"
62
+gdyb_url = "http://19.15.78.136:20001/ebus/gdyb_inf/poc/hsa/hgs/gzzq/"
62 63
 #韶关
63 64
 # gdyb_paasid = "sg03_prd"
64 65
 #江门
@@ -66,12 +67,12 @@ gdyb_url="http://igb.hsa.gdgov.cn/ebus/sz_prd/hsa/hgs/"
66 67
 #珠海
67 68
 # gdyb_paasid="zh_prd_yrojyy"
68 69
 #深圳
69
-gdyb_paasid = "sz_prd_yjyy"
70
+# gdyb_paasid = "sz_prd_yjyy"
70 71
 #肇庆
71 72
 # gdyb_paasid = "zq_prd_yjyy"
72
-
73 73
 # gdyb_paasid = "sztest_hosp"
74
-
74
+#广州
75
+# gdyb_paasid = "gdyb_inf"
75 76
 
76 77
 
77 78
 readmysqlhost = shengws1.mysql.rds.aliyuncs.com

+ 134 - 134
controllers/nm/nm_controller.go Wyświetl plik

@@ -38,7 +38,7 @@ func NmybRegistRouters() {
38 38
 
39 39
 	beego.Router("/nmyb/5203", &NmController{}, "get:Post5203")
40 40
 
41
-	beego.Router("/nmyb/readcard", &NmController{}, "get:ReadCard")
41
+	//beego.Router("/nmyb/readcard", &NmController{}, "get:ReadCard")
42 42
 
43 43
 	beego.Router("/nmyb/3201", &NmController{}, "get:Get3201")
44 44
 	beego.Router("/nmyb/2202", &NmController{}, "get:Post2202")
@@ -540,139 +540,139 @@ func (c *NmController) Get2503() {
540 540
 
541 541
 }
542 542
 
543
-func (c *NmController) ReadCard() {
544
-	fixmedins_code := c.GetString("fixmedins_code")
545
-	secret_key := c.GetString("secret_key")
546
-	org_name := c.GetString("org_name")
547
-	insuplc_admdvs := c.GetString("insuplc_admdvs")
548
-	mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
549
-	id_card_type := c.GetString("id_card_type")
550
-	operator_id := c.GetString("operator_id")
551
-	operator := c.GetString("operator")
552
-
553
-	if initFlag == 0 {
554
-		c.TestGetBasBaseInit()
555
-	}
556
-	switch id_card_type {
557
-	case "1":
558
-		pBusiCardInfo := c.GetBasBaseInfo(fixmedins_code, mdtrtarea_admvs, operator, operator_id, org_name)
559
-		basStr := Remove0000(pBusiCardInfo)
560
-
561
-		if len(basStr) == 0 {
562
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
563
-			return
564
-		}
565
-
566
-		var dat2 map[string]interface{}
567
-		if err := json.Unmarshal([]byte(basStr), &dat2); err == nil {
568
-			fmt.Println(dat2)
569
-		} else {
570
-			fmt.Println(err)
571
-		}
572
-
573
-		userJSONBytes, _ := json.Marshal(dat2)
574
-		var res ReadCardResult
575
-		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
576
-			utils.ErrorLog("解析失败:%v", err)
577
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
578
-			return
579
-		}
580
-
581
-		fmt.Println(basStr)
582
-		bas := strings.Split(res.Output.CardInfo, "|")
583
-		basNumber := bas[1]
584
-		fmt.Println(basNumber)
585
-		card_sn := bas[3]
586
-		fmt.Println(card_sn)
587
-		cardNumber := bas[2]
588
-		name := bas[4]
589
-
590
-		result := service.Gdyb1101G(basNumber, org_name, operator, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, 1, card_sn, 1, name, cardNumber)
591
-		var dat map[string]interface{}
592
-		if err := json.Unmarshal([]byte(result), &dat); err == nil {
593
-			fmt.Println(dat)
594
-		} else {
595
-			fmt.Println(err)
596
-		}
597
-
598
-		userJSONBytes2, _ := json.Marshal(dat)
599
-		var res2 ResultTwo
600
-		if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
601
-			utils.ErrorLog("解析失败:%v", err)
602
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
603
-			return
604
-		}
605
-		infocode, _ := strconv.ParseInt(res2.Infcode, 10, 64)
606
-
607
-		if infocode == 0 {
608
-			c.ServeSuccessJSON(map[string]interface{}{
609
-				"status":         "0",
610
-				"card_info":      res.Output.CardInfo,
611
-				"busi_card_info": pBusiCardInfo,
612
-				"result":         res2,
613
-				"type":           "1",
614
-			})
615
-
616
-		} else {
617
-			c.ServeSuccessJSON(map[string]interface{}{
618
-				"status": "-1",
619
-			})
620
-		}
621
-
622
-		break
623
-	case "4": //电子凭证
624
-		_, pBusiCardInfo := c.GetELeInfo(fixmedins_code, operator_id, operator)
625
-
626
-		var ele ELeData
627
-		err := json.Unmarshal([]byte(pBusiCardInfo), &ele)
628
-		if err != nil {
629
-			utils.ErrorLog("解析失败:%v", err)
630
-		}
631
-		token := ele.Data.EcToken
632
-		fmt.Println(token)
633
-		if len(token) > 0 {
634
-			result := service.Gdyb1101ForEleCert("", org_name, operator, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, token, "")
635
-			var dat map[string]interface{}
636
-			if err := json.Unmarshal([]byte(result), &dat); err == nil {
637
-				fmt.Println(dat)
638
-			} else {
639
-				fmt.Println(err)
640
-			}
641
-			userJSONBytes, _ := json.Marshal(dat)
642
-			var res ResultTwo
643
-			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
644
-				utils.ErrorLog("解析失败:%v", err)
645
-				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
646
-				return
647
-			}
648
-
649
-			infocode, _ := strconv.ParseInt(res.Infcode, 10, 64)
650
-
651
-			if infocode == 0 {
652
-
653
-				c.ServeSuccessJSON(map[string]interface{}{
654
-					"status":         "0",
655
-					"card_info":      pBusiCardInfo,
656
-					"busi_card_info": pBusiCardInfo,
657
-					"token":          token,
658
-					"result":         dat,
659
-				})
660
-
661
-			} else {
662
-				c.ServeSuccessJSON(map[string]interface{}{
663
-					"status": "-1",
664
-				})
665
-
666
-			}
667
-		} else {
668
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
669
-			return
670
-		}
671
-		break
672
-
673
-	}
674
-
675
-}
543
+//func (c *NmController) ReadCard() {
544
+//	fixmedins_code := c.GetString("fixmedins_code")
545
+//	secret_key := c.GetString("secret_key")
546
+//	org_name := c.GetString("org_name")
547
+//	insuplc_admdvs := c.GetString("insuplc_admdvs")
548
+//	mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
549
+//	id_card_type := c.GetString("id_card_type")
550
+//	operator_id := c.GetString("operator_id")
551
+//	operator := c.GetString("operator")
552
+//
553
+//	if initFlag == 0 {
554
+//		c.TestGetBasBaseInit()
555
+//	}
556
+//	switch id_card_type {
557
+//	case "1":
558
+//		pBusiCardInfo := c.GetBasBaseInfo(fixmedins_code, mdtrtarea_admvs, operator, operator_id, org_name)
559
+//		basStr := Remove0000(pBusiCardInfo)
560
+//
561
+//		if len(basStr) == 0 {
562
+//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
563
+//			return
564
+//		}
565
+//
566
+//		var dat2 map[string]interface{}
567
+//		if err := json.Unmarshal([]byte(basStr), &dat2); err == nil {
568
+//			fmt.Println(dat2)
569
+//		} else {
570
+//			fmt.Println(err)
571
+//		}
572
+//
573
+//		userJSONBytes, _ := json.Marshal(dat2)
574
+//		var res ReadCardResult
575
+//		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
576
+//			utils.ErrorLog("解析失败:%v", err)
577
+//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
578
+//			return
579
+//		}
580
+//
581
+//		fmt.Println(basStr)
582
+//		bas := strings.Split(res.Output.CardInfo, "|")
583
+//		basNumber := bas[1]
584
+//		fmt.Println(basNumber)
585
+//		card_sn := bas[3]
586
+//		fmt.Println(card_sn)
587
+//		cardNumber := bas[2]
588
+//		name := bas[4]
589
+//
590
+//		result := service.Gdyb1101G(basNumber, org_name, operator, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, 1, card_sn, 1, name, cardNumber)
591
+//		var dat map[string]interface{}
592
+//		if err := json.Unmarshal([]byte(result), &dat); err == nil {
593
+//			fmt.Println(dat)
594
+//		} else {
595
+//			fmt.Println(err)
596
+//		}
597
+//
598
+//		userJSONBytes2, _ := json.Marshal(dat)
599
+//		var res2 ResultTwo
600
+//		if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
601
+//			utils.ErrorLog("解析失败:%v", err)
602
+//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
603
+//			return
604
+//		}
605
+//		infocode, _ := strconv.ParseInt(res2.Infcode, 10, 64)
606
+//
607
+//		if infocode == 0 {
608
+//			c.ServeSuccessJSON(map[string]interface{}{
609
+//				"status":         "0",
610
+//				"card_info":      res.Output.CardInfo,
611
+//				"busi_card_info": pBusiCardInfo,
612
+//				"result":         res2,
613
+//				"type":           "1",
614
+//			})
615
+//
616
+//		} else {
617
+//			c.ServeSuccessJSON(map[string]interface{}{
618
+//				"status": "-1",
619
+//			})
620
+//		}
621
+//
622
+//		break
623
+//	case "4": //电子凭证
624
+//		_, pBusiCardInfo := c.GetELeInfo(fixmedins_code, operator_id, operator)
625
+//
626
+//		var ele ELeData
627
+//		err := json.Unmarshal([]byte(pBusiCardInfo), &ele)
628
+//		if err != nil {
629
+//			utils.ErrorLog("解析失败:%v", err)
630
+//		}
631
+//		token := ele.Data.EcToken
632
+//		fmt.Println(token)
633
+//		if len(token) > 0 {
634
+//			result := service.Gdyb1101ForEleCert("", org_name, operator, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, token, "")
635
+//			var dat map[string]interface{}
636
+//			if err := json.Unmarshal([]byte(result), &dat); err == nil {
637
+//				fmt.Println(dat)
638
+//			} else {
639
+//				fmt.Println(err)
640
+//			}
641
+//			userJSONBytes, _ := json.Marshal(dat)
642
+//			var res ResultTwo
643
+//			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
644
+//				utils.ErrorLog("解析失败:%v", err)
645
+//				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
646
+//				return
647
+//			}
648
+//
649
+//			infocode, _ := strconv.ParseInt(res.Infcode, 10, 64)
650
+//
651
+//			if infocode == 0 {
652
+//
653
+//				c.ServeSuccessJSON(map[string]interface{}{
654
+//					"status":         "0",
655
+//					"card_info":      pBusiCardInfo,
656
+//					"busi_card_info": pBusiCardInfo,
657
+//					"token":          token,
658
+//					"result":         dat,
659
+//				})
660
+//
661
+//			} else {
662
+//				c.ServeSuccessJSON(map[string]interface{}{
663
+//					"status": "-1",
664
+//				})
665
+//
666
+//			}
667
+//		} else {
668
+//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
669
+//			return
670
+//		}
671
+//		break
672
+//
673
+//	}
674
+//
675
+//}
676 676
 
677 677
 var initFlag int64 = 0
678 678
 

Plik diff jest za duży
+ 786 - 787
controllers/sg/his_api_controller.go


+ 4 - 9
routers/router.go Wyświetl plik

@@ -1,12 +1,7 @@
1 1
 package routers
2 2
 
3 3
 import (
4
-	"gdyb/controllers/hb"
5
-	"gdyb/controllers/js"
6
-	"gdyb/controllers/nm"
7 4
 	"gdyb/controllers/sg"
8
-	"gdyb/controllers/zh"
9
-
10 5
 	//"gdyb/controllers/sz"
11 6
 	//"gdyb/controllers/sz"
12 7
 	//admin_api "XT_New/controllers/admin_api_controllers"
@@ -26,11 +21,11 @@ func init() {
26 21
 	}))
27 22
 	sg.HisManagerApiRegistRouters()
28 23
 	sg.GdybRegistRouters()
29
-	hb.HbybRegistRouters()
24
+	//hb.HbybRegistRouters()
30 25
 	//sz.SZHisManagerApiRegistRouters()
31
-	zh.ZHHisManagerApiRegistRouters()
32
-	js.JSybRegistRouters()
33
-	nm.NmybRegistRouters()
26
+	//zh.ZHHisManagerApiRegistRouters()
27
+	//js.JSybRegistRouters()
28
+	//nm.NmybRegistRouters()
34 29
 	//coordinate.CoordinateRegistRouters()
35 30
 
36 31
 }

+ 19 - 2
service/gdyb_service.go Wyświetl plik

@@ -2,6 +2,7 @@ package service
2 2
 
3 3
 import (
4 4
 	"bytes"
5
+	"crypto/md5"
5 6
 	"crypto/sha256"
6 7
 	"encoding/hex"
7 8
 	"encoding/json"
@@ -4427,8 +4428,24 @@ func Gdyb9001(org_name string, doctor string, fixmedins_code string, insuplc_adm
4427 4428
 	inputData := make(map[string]interface{})
4428 4429
 	inputMessage["infno"] = "9001"        // 交易编码
4429 4430
 	inputData["opter_no"] = admin_user_id // 就诊凭证编号
4430
-	inputData["mac"] = GetMac()           // 开始时间
4431
-	inputData["ip"] = GetLocalIp()
4431
+	inputData["mac"] = "11-11-11-11-11"   // 开始时间
4432
+	inputData["ip"] = "11.11.11.11"
4433
+	inputData["userid"] = "H44010400081"
4434
+
4435
+	month := time.Unix(1557042972, 0).Format("1")
4436
+	year := time.Now().Format("2006")
4437
+	month = time.Now().Format("01")
4438
+	day := time.Now().Format("02")
4439
+	hour := time.Now().Format("15")
4440
+	min := time.Now().Format("04")
4441
+	sec := time.Now().Format("05")
4442
+
4443
+	inputData["currenttime"] = year + month + day + hour + min + sec
4444
+	var psd string
4445
+	psd = year + month + day + hour + min + sec + "Gzyb$867"
4446
+	h := md5.New()
4447
+	h.Write([]byte(psd))
4448
+	inputData["password"] = hex.EncodeToString(h.Sum(nil))
4432 4449
 	input["signIn"] = inputData
4433 4450
 	inputMessage["input"] = input //交易输入
4434 4451
 	var inputLog string