Browse Source

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

csx 3 years ago
parent
commit
c762066e35
2 changed files with 15 additions and 8 deletions
  1. 9 2
      controllers/sg/his_api_controller.go
  2. 6 6
      main.go

+ 9 - 2
controllers/sg/his_api_controller.go View File

@@ -369,7 +369,8 @@ func (c *HisApiController) ReadCard() {
369 369
 			if status == "0" { //读卡成功
370 370
 				var card_info string //卡信息
371 371
 				var busi_card_info string
372
-				var res ResultTwo //1101结果
372
+				var res ResultTwo           //1101结果
373
+				var res10265 ResultTwo10265 //1101结果
373 374
 
374 375
 				card_info = respJSON["data"].(map[string]interface{})["card_info"].(string)
375 376
 				busi_card_info = respJSON["data"].(map[string]interface{})["busi_card_info"].(string)
@@ -379,11 +380,17 @@ func (c *HisApiController) ReadCard() {
379 380
 
380 381
 				respJSON = respJSON["data"].(map[string]interface{})["result"].(map[string]interface{})
381 382
 				result, _ := json.Marshal(respJSON)
382
-				if err := json.Unmarshal([]byte(result), &res); err != nil {
383
+
384
+				if err := json.Unmarshal([]byte(result), &res10265); err != nil {
383 385
 					utils.ErrorLog("解析失败:%v", err)
384 386
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
385 387
 					return
386 388
 				}
389
+				res.ErrMsg = res10265.ErrMsg
390
+				infocode, _ := strconv.ParseInt(res10265.Infcode, 10, 64)
391
+				res.Infcode = infocode
392
+				res.Output = res10265.Output
393
+				res.InfRefmsgid = res10265.InfRefmsgid
387 394
 
388 395
 				if res.Infcode == 0 {
389 396
 					patient, err := service.GetPatientByIDCard(res.Output.Baseinfo.Certno, c.GetAdminUserInfo().CurrentOrgId)

+ 6 - 6
main.go View File

@@ -5,7 +5,7 @@ import (
5 5
 	"fmt"
6 6
 	"gdyb/models"
7 7
 	_ "gdyb/routers"
8
-	//"gdyb/service"
8
+	"gdyb/service"
9 9
 	"github.com/astaxie/beego"
10 10
 	"github.com/qiniu/api.v7/auth/qbox"
11 11
 	"github.com/qiniu/api.v7/storage"
@@ -15,11 +15,11 @@ import (
15 15
 )
16 16
 
17 17
 func init() {
18
-	//service.ConnectDB()
19
-	//org_id, _ := beego.AppConfig.Int64("org_id")
20
-	//miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
21
-	//CreateLog(miConfig)
22
-	//UploadLog(miConfig)
18
+	service.ConnectDB()
19
+	org_id, _ := beego.AppConfig.Int64("org_id")
20
+	miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
21
+	CreateLog(miConfig)
22
+	UploadLog(miConfig)
23 23
 
24 24
 }
25 25
 func main() {