Bläddra i källkod

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

csx 3 år sedan
förälder
incheckning
86c65cddd6
2 ändrade filer med 14 tillägg och 18 borttagningar
  1. 1 1
      controllers/sg/gdyb_controller.go
  2. 13 17
      controllers/sg/his_api_controller.go

+ 1 - 1
controllers/sg/gdyb_controller.go Visa fil

@@ -145,7 +145,7 @@ func (c *GdybController) PostThree() {
145 145
 	secret_key := c.GetString("secret_key")
146 146
 	fixmedins_code := c.GetString("fixmedins_code")
147 147
 	result, requestLog := service.Gdyb2202(psnNo, mdtrtId, iptOtpNo, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code)
148
-	saveLog(result, requestLog)
148
+	saveLog(result, requestLog, "2202")
149 149
 	var dat map[string]interface{}
150 150
 	if err := json.Unmarshal([]byte(result), &dat); err == nil {
151 151
 	} else {

+ 13 - 17
controllers/sg/his_api_controller.go Visa fil

@@ -1260,7 +1260,6 @@ type ResultSix struct {
1260 1260
 	Signtype    interface{} `json:"signtype"`
1261 1261
 	WarnMsg     interface{} `json:"warn_msg"`
1262 1262
 }
1263
-
1264 1263
 type ResultSeven struct {
1265 1264
 	Cainfo      string `json:"cainfo"`
1266 1265
 	ErrMsg      string `json:"err_msg"`
@@ -1318,7 +1317,6 @@ type ResultSeven struct {
1318 1317
 	Signtype    interface{} `json:"signtype"`
1319 1318
 	WarnMsg     interface{} `json:"warn_msg"`
1320 1319
 }
1321
-
1322 1320
 type ResultEight struct {
1323 1321
 	Cainfo      string `json:"cainfo"`
1324 1322
 	ErrMsg      string `json:"err_msg"`
@@ -1336,7 +1334,6 @@ type ResultEight struct {
1336 1334
 	Signtype    interface{} `json:"signtype"`
1337 1335
 	WarnMsg     interface{} `json:"warn_msg"`
1338 1336
 }
1339
-
1340 1337
 type ResultNine struct {
1341 1338
 	Cainfo      string `json:"cainfo"`
1342 1339
 	ErrMsg      string `json:"err_msg"`
@@ -1350,7 +1347,6 @@ type ResultNine struct {
1350 1347
 	Signtype    interface{} `json:"signtype"`
1351 1348
 	WarnMsg     interface{} `json:"warn_msg"`
1352 1349
 }
1353
-
1354 1350
 type ResultTen struct {
1355 1351
 	Cainfo      string `json:"cainfo"`
1356 1352
 	ErrMsg      string `json:"err_msg"`
@@ -1762,7 +1758,7 @@ func (c *HisApiController) GetRegisterInfo() {
1762 1758
 	if config.IsOpen == 1 {
1763 1759
 		//service.Gdyb1201("", miConfig.OrgName, "1122", miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, 1, "")
1764 1760
 		result, requestLog := service.Gdyb1101(patient.IdCardNo, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, "", strconv.FormatInt(certificates, 10))
1765
-		saveLog(result, requestLog)
1761
+		saveLog(result, requestLog, "1101")
1766 1762
 		//register_log = requestLog + "\r\n" + "\r\n" + "\r\n" + result
1767 1763
 		var res ResultTwo
1768 1764
 		if err := json.Unmarshal([]byte(result), &res); err != nil {
@@ -1866,7 +1862,7 @@ func (c *HisApiController) GetRegisterInfo() {
1866 1862
 			//insutype = "390"
1867 1863
 
1868 1864
 			result, requestLog := service.Gdyb2201(res.Output.Baseinfo.PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_id, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type)
1869
-			saveLog(result, requestLog)
1865
+			saveLog(result, requestLog, "2201")
1870 1866
 			//register_log = register_log + requestLog + "\r\n" + "\r\n" + "\r\n" + result + "\r\n" + "\r\n" + "\r\n"
1871 1867
 			//saveRegisterLog(register_log)
1872 1868
 
@@ -2049,7 +2045,7 @@ func (c *HisApiController) GetUploadInfo() {
2049 2045
 
2050 2046
 		}
2051 2047
 
2052
-		saveLog(result, requestLog)
2048
+		saveLog(result, requestLog, "2203")
2053 2049
 
2054 2050
 		var respJSON2 map[string]interface{}
2055 2051
 		if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
@@ -2186,7 +2182,7 @@ func (c *HisApiController) GetUploadInfo() {
2186 2182
 				request_respJSON := respJSON["data"].(map[string]interface{})["request_log"].(map[string]interface{})
2187 2183
 				requestJSONBytes, _ := json.Marshal(request_respJSON)
2188 2184
 
2189
-				saveLog(string(userJSONBytes), string(requestJSONBytes))
2185
+				saveLog(string(userJSONBytes), string(requestJSONBytes), "2204")
2190 2186
 
2191 2187
 				var res ResultFour
2192 2188
 				if err := json.Unmarshal(userJSONBytes, &res); err != nil {
@@ -2377,7 +2373,7 @@ func (c *HisApiController) GetUploadInfo() {
2377 2373
 							fmt.Println(err)
2378 2374
 						}
2379 2375
 
2380
-						saveLog(result, src_resquest)
2376
+						saveLog(result, src_resquest, "2207")
2381 2377
 
2382 2378
 						userJSONBytes, _ := json.Marshal(dat)
2383 2379
 
@@ -2573,7 +2569,7 @@ func (c *HisApiController) GetUploadInfo() {
2573 2569
 				fmt.Println(err)
2574 2570
 			}
2575 2571
 
2576
-			saveLog(result, src_resquest)
2572
+			saveLog(result, src_resquest, "2207")
2577 2573
 
2578 2574
 			userJSONBytes, _ := json.Marshal(dat)
2579 2575
 
@@ -3266,7 +3262,7 @@ func (c *HisApiController) GetPreUploadInfo() {
3266 3262
 
3267 3263
 	}
3268 3264
 
3269
-	saveLog(result, requestLog)
3265
+	saveLog(result, requestLog, "2203")
3270 3266
 
3271 3267
 	var respJSON2 map[string]interface{}
3272 3268
 	if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
@@ -3392,7 +3388,7 @@ func (c *HisApiController) GetPreUploadInfo() {
3392 3388
 			request_respJSON := respJSON["data"].(map[string]interface{})["request_log"].(map[string]interface{})
3393 3389
 			requestJSONBytes, _ := json.Marshal(request_respJSON)
3394 3390
 
3395
-			saveLog(string(userJSONBytes), string(requestJSONBytes))
3391
+			saveLog(string(userJSONBytes), string(requestJSONBytes), "2204")
3396 3392
 
3397 3393
 			var res ResultFour
3398 3394
 			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
@@ -3572,7 +3568,7 @@ func (c *HisApiController) GetPreUploadInfo() {
3572 3568
 						fmt.Println(err)
3573 3569
 					}
3574 3570
 
3575
-					saveLog(result, request_log)
3571
+					saveLog(result, request_log, "2206")
3576 3572
 
3577 3573
 					userJSONBytes, _ := json.Marshal(dat)
3578 3574
 
@@ -3943,7 +3939,7 @@ func (c *HisApiController) Refund() {
3943 3939
 		} else {
3944 3940
 			fmt.Println(err)
3945 3941
 		}
3946
-		saveLog(result, src_resquest)
3942
+		saveLog(result, src_resquest, "2208")
3947 3943
 
3948 3944
 		userJSONBytes, _ := json.Marshal(dat)
3949 3945
 
@@ -3962,7 +3958,7 @@ func (c *HisApiController) Refund() {
3962 3958
 				fmt.Println(err)
3963 3959
 			}
3964 3960
 
3965
-			saveLog(result, src_request)
3961
+			saveLog(result, src_request, "2205")
3966 3962
 
3967 3963
 			userJSONBytes, _ := json.Marshal(dat)
3968 3964
 
@@ -6122,7 +6118,7 @@ func saveRegisterLog(result string) {
6122 6118
 
6123 6119
 }
6124 6120
 
6125
-func saveLog(result string, request string) {
6121
+func saveLog(result string, request string, infno string) {
6126 6122
 
6127 6123
 	org_id, _ := beego.AppConfig.Int64("org_id")
6128 6124
 	miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
@@ -6142,7 +6138,7 @@ func saveLog(result string, request string) {
6142 6138
 		if err != nil {
6143 6139
 			fmt.Println("read fail")
6144 6140
 		}
6145
-		content := "\r\n" + "\r\n" + "\r\n" + "\r\n" + request + "\r\n" + "\r\n" + "\r\n" + "\r\n" + result
6141
+		content := infno + "\r\n" + "\r\n" + "\r\n" + "\r\n" + request + "\r\n" + "\r\n" + "\r\n" + "\r\n" + result
6146 6142
 		n, _ := f.Seek(0, 2)
6147 6143
 		_, err = f.WriteAt([]byte(content), n)
6148 6144