Explorar el Código

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

csx hace 3 años
padre
commit
940bd236cf
Se han modificado 2 ficheros con 37 adiciones y 41 borrados
  1. 0 3
      conf/app.conf
  2. 37 38
      service/gdyb_service.go

+ 0 - 3
conf/app.conf Ver fichero

@@ -3,9 +3,6 @@ httpport = 9532
3 3
 runmode = prod
4 4
 
5 5
 
6
-
7
-            ###
8
-
9 6
 #
10 7
 copyrequestbody = true
11 8
 sessionon = true

+ 37 - 38
service/gdyb_service.go Ver fichero

@@ -8,8 +8,11 @@ import (
8 8
 	"fmt"
9 9
 	"gdyb/models"
10 10
 	"github.com/astaxie/beego"
11
+	"github.com/go-ole/go-ole"
12
+	"github.com/go-ole/go-ole/oleutil"
11 13
 	"io"
12 14
 	"io/ioutil"
15
+	"log"
13 16
 	"math/rand"
14 17
 	"mime/multipart"
15 18
 	"net/http"
@@ -60,14 +63,18 @@ func Gdyb1201(certNo string, org_name string, doctor string, fixmedins_code stri
60 63
 
61 64
 	//var x interface{}
62 65
 	//s3 := make([]byte, 256)
63
-	//ole.CoInitialize(0)
64
-	//unknown, err := oleutil.CreateObject("yinhai.yh_hb_sctr")
65
-	//if err != nil {
66
-	//	log.Fatal("CreateObject: ", err)
67
-	//}
68
-	//
69
-	//xxxx := unknown.MustQueryInterface(ole.IID_IDispatch)
70
-	//
66
+	ole.CoInitialize(0)
67
+	unknown, err := oleutil.CreateObject("yinhai.yh_hb_sctr")
68
+	if err != nil {
69
+		log.Fatal("CreateObject: ", err)
70
+	}
71
+
72
+	xxxx := unknown.MustQueryInterface(ole.IID_IDispatch)
73
+
74
+	var str6 map[string]interface{}
75
+
76
+	//str6 = ""
77
+
71 78
 	////p := (*string)(unsafe.Pointer(str))
72 79
 	////var str6 *string
73 80
 	//var str6 *ole.VARIANT
@@ -76,16 +83,16 @@ func Gdyb1201(certNo string, org_name string, doctor string, fixmedins_code stri
76 83
 	//	log.Fatal("QueryInterface: ", err)
77 84
 	//}
78 85
 	//
79
-	//r, err1 := xxxx.CallMethod("yh_hb_call", "1201", string(bytesData), str6)
86
+	r, err1 := xxxx.CallMethod("yh_hb_call", "1201", string(bytesData), str6)
80 87
 	////result := oleutil.MustGetProperty(xxxx, "astr_jysc")
81 88
 	//
82
-	//if err1 != nil {
83
-	//	log.Fatal("CallMethod: ", err1, " | ", r)
84
-	//}
85
-	//fmt.Println("~~~~~~~")
89
+	if err1 != nil {
90
+		log.Fatal("CallMethod: ", err1, " | ", r)
91
+	}
92
+	fmt.Println("~~~~~~~")
86 93
 	//fmt.Println(str6.ToString())
87
-	//fmt.Println(r.ToString())
88
-	//fmt.Println("~~~~~~~")
94
+	fmt.Println(r.ToString())
95
+	fmt.Println("~~~~~~~")
89 96
 	//
90 97
 	//xxxx.Release()
91 98
 	//
@@ -219,7 +226,7 @@ func Gdyb1101(certNo string, org_name string, doctor string, fixmedins_code stri
219 226
 			fmt.Println("error:", err.Error())
220 227
 		}
221 228
 		fmt.Println(string(out))
222
-		return string(out), inputLog
229
+		return hex.EncodeToString(out), inputLog
223 230
 	} else {
224 231
 
225 232
 		//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
@@ -297,7 +304,7 @@ func Gdyb1101A(certNo string, org_name string, doctor string, fixmedins_code str
297 304
 			fmt.Println("error:", err.Error())
298 305
 		}
299 306
 		fmt.Println(string(out))
300
-		return string(out)
307
+		return hex.EncodeToString(out)
301 308
 	} else {
302 309
 		request, err := http.NewRequest("POST", url, reader)
303 310
 		if err != nil {
@@ -391,7 +398,7 @@ func Gdyb2201(psnNo string, insutype string, certNo string, org_name string, doc
391 398
 		}
392 399
 		fmt.Println(string(out))
393 400
 
394
-		return string(out), requestLog
401
+		return hex.EncodeToString(out), requestLog
395 402
 	} else {
396 403
 		request, err := http.NewRequest("POST", url, reader)
397 404
 		if err != nil {
@@ -471,7 +478,7 @@ func Gdyb2202(psnNo string, mdtrtId string, ipt_otp_no string, org_name string,
471 478
 		}
472 479
 		fmt.Println(string(out))
473 480
 
474
-		return string(out), requestLog
481
+		return hex.EncodeToString(out), requestLog
475 482
 	} else {
476 483
 
477 484
 		request, err := http.NewRequest("POST", url, reader)
@@ -574,7 +581,7 @@ func Gdyb2203(psnNo string, mdtrtId string, doctor string, department string, or
574 581
 		}
575 582
 		fmt.Println(string(out))
576 583
 
577
-		return string(out), requestLog
584
+		return hex.EncodeToString(out), requestLog
578 585
 	} else {
579 586
 		request, err := http.NewRequest("POST", url, reader)
580 587
 		if err != nil {
@@ -682,7 +689,7 @@ func Gdyb2203A(psnNo string, mdtrtId string, doctor string, department string, o
682 689
 		}
683 690
 		fmt.Println(string(out))
684 691
 
685
-		return string(out), requestLog
692
+		return hex.EncodeToString(out), requestLog
686 693
 	} else {
687 694
 
688 695
 		request, err := http.NewRequest("POST", url, reader)
@@ -955,7 +962,7 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
955 962
 		}
956 963
 		fmt.Println(string(out))
957 964
 
958
-		return string(out), requestLog
965
+		return hex.EncodeToString(out), requestLog
959 966
 	} else {
960 967
 
961 968
 		request, err := http.NewRequest("POST", url, reader)
@@ -1040,7 +1047,7 @@ func Gdyb2205(psnNo string, mdtrtId string, chrgBchno string, org_name string, d
1040 1047
 		}
1041 1048
 		fmt.Println(string(out))
1042 1049
 
1043
-		return string(out), requestLog
1050
+		return hex.EncodeToString(out), requestLog
1044 1051
 	} else {
1045 1052
 		request, err := http.NewRequest("POST", url, reader)
1046 1053
 		fmt.Println(err)
@@ -1106,15 +1113,11 @@ func Gdyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
1106 1113
 	if insuplc_admdvs == "421300" {
1107 1114
 		if med_type == "11" {
1108 1115
 			inputData["med_type"] = "110104" // 医疗类别 11 普通门诊  12 门诊挂号
1109
-
1110
-		} else {
1111
-
1112
-			inputData["med_type"] = med_type // 医疗类别 11 普通门诊  12 门诊挂号
1116
+		} else if med_type == "14" {
1117
+			inputData["med_type"] = "140110" // 医疗类别 11 普通门诊  12 门诊挂号
1113 1118
 		}
1114
-
1115 1119
 	} else {
1116 1120
 		inputData["med_type"] = med_type // 医疗类别 11 普通门诊  12 门诊挂号
1117
-
1118 1121
 	}
1119 1122
 
1120 1123
 	inputData["medfee_sumamt"] = total  // 医疗费总额
@@ -1160,7 +1163,7 @@ func Gdyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
1160 1163
 		}
1161 1164
 		fmt.Println(string(out))
1162 1165
 
1163
-		return string(out), requestLog
1166
+		return hex.EncodeToString(out), requestLog
1164 1167
 	} else {
1165 1168
 		request, err := http.NewRequest("POST", url, reader)
1166 1169
 		if err != nil {
@@ -1222,15 +1225,11 @@ func Gdyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
1222 1225
 	if insuplc_admdvs == "421300" {
1223 1226
 		if med_type == "11" {
1224 1227
 			inputData["med_type"] = "110104" // 医疗类别 11 普通门诊  12 门诊挂号
1225
-
1226
-		} else {
1227
-
1228
-			inputData["med_type"] = med_type // 医疗类别 11 普通门诊  12 门诊挂号
1228
+		} else if med_type == "14" {
1229
+			inputData["med_type"] = "140110" // 医疗类别 11 普通门诊  12 门诊挂号
1229 1230
 		}
1230
-
1231 1231
 	} else {
1232 1232
 		inputData["med_type"] = med_type // 医疗类别 11 普通门诊  12 门诊挂号
1233
-
1234 1233
 	}
1235 1234
 	inputData["medfee_sumamt"] = total  // 医疗费总额
1236 1235
 	inputData["psn_setlway"] = "01"     // 个人结算方式 01 按项目结 02 按定额结算
@@ -1277,7 +1276,7 @@ func Gdyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
1277 1276
 		str2 := string(mjson)
1278 1277
 		fmt.Println(string(out))
1279 1278
 
1280
-		return string(out), str2
1279
+		return hex.EncodeToString(out), str2
1281 1280
 	} else {
1282 1281
 
1283 1282
 		request, err := http.NewRequest("POST", url, reader)
@@ -1363,7 +1362,7 @@ func Gdyb2208(psnNo string, mdtrtId string, setlId string, org_name string, doct
1363 1362
 		str2 := string(mjson)
1364 1363
 		fmt.Println(string(out))
1365 1364
 
1366
-		return string(out), str2
1365
+		return hex.EncodeToString(out), str2
1367 1366
 	} else {
1368 1367
 		request, err := http.NewRequest("POST", url, reader)
1369 1368
 		if err != nil {