Browse Source

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

csx 2 years ago
parent
commit
0e23dc30ef
1 changed files with 49 additions and 49 deletions
  1. 49 49
      controllers/zh/zh_his_api_controller.go

+ 49 - 49
controllers/zh/zh_his_api_controller.go View File

@@ -2441,55 +2441,55 @@ func (c *ZHHisApiController) ReadCard() {
2441 2441
 
2442 2442
 	switch id_card_type {
2443 2443
 	case 1:
2444
-		if initFlag == 0 {
2445
-			c.TestGetBasBaseInit()
2446
-		}
2447
-		basStr := c.GetBasBaseInfo(miConfig.Code, miConfig.MdtrtareaAdmvs, roles.UserName, strconv.FormatInt(roles.ID, 64), miConfig.OrgName)
2448
-		if len(basStr) == 0 {
2449
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
2450
-			return
2451
-		}
2452
-		fmt.Println(basStr)
2453
-		bas := strings.Split(basStr, "|")
2454
-		basNumber := bas[1]
2455
-		fmt.Println(basNumber)
2456
-		card_sn := bas[3]
2457
-		fmt.Println(card_sn)
2458
-		result := service.Gdyb1101B(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, certificates)
2459
-		var dat map[string]interface{}
2460
-		if err := json.Unmarshal([]byte(result), &dat); err == nil {
2461
-			fmt.Println(dat)
2462
-		} else {
2463
-			fmt.Println(err)
2464
-		}
2465
-
2466
-		userJSONBytes, _ := json.Marshal(dat)
2467
-		var res ResultTwo
2468
-		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
2469
-			utils.ErrorLog("解析失败:%v", err)
2470
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2471
-			return
2472
-		}
2473
-
2474
-		if res.Infcode == 0 {
2475
-			patient, err := service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
2476
-			if err == gorm.ErrRecordNotFound {
2477
-				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNoPateintException)
2478
-				return
2479
-			} else if err != nil {
2480
-				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2481
-				return
2482
-
2483
-			} else {
2484
-				c.ServeSuccessJSON(map[string]interface{}{
2485
-					"patient": patient,
2486
-					"number":  basNumber,
2487
-				})
2488
-			}
2489
-		} else {
2490
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
2491
-			return
2492
-		}
2444
+		//if initFlag == 0 {
2445
+		//	c.TestGetBasBaseInit()
2446
+		//}
2447
+		//basStr := c.GetBasBaseInfo(miConfig.Code, miConfig.MdtrtareaAdmvs, roles.UserName, strconv.FormatInt(roles.ID, 64), miConfig.OrgName)
2448
+		//if len(basStr) == 0 {
2449
+		//	c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
2450
+		//	return
2451
+		//}
2452
+		//fmt.Println(basStr)
2453
+		//bas := strings.Split(basStr, "|")
2454
+		//basNumber := bas[1]
2455
+		//fmt.Println(basNumber)
2456
+		//card_sn := bas[3]
2457
+		//fmt.Println(card_sn)
2458
+		//result := service.Gdyb1101B(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, certificates)
2459
+		//var dat map[string]interface{}
2460
+		//if err := json.Unmarshal([]byte(result), &dat); err == nil {
2461
+		//	fmt.Println(dat)
2462
+		//} else {
2463
+		//	fmt.Println(err)
2464
+		//}
2465
+		//
2466
+		//userJSONBytes, _ := json.Marshal(dat)
2467
+		//var res ResultTwo
2468
+		//if err := json.Unmarshal(userJSONBytes, &res); err != nil {
2469
+		//	utils.ErrorLog("解析失败:%v", err)
2470
+		//	c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2471
+		//	return
2472
+		//}
2473
+		//
2474
+		//if res.Infcode == 0 {
2475
+		//	patient, err := service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
2476
+		//	if err == gorm.ErrRecordNotFound {
2477
+		//		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNoPateintException)
2478
+		//		return
2479
+		//	} else if err != nil {
2480
+		//		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2481
+		//		return
2482
+		//
2483
+		//	} else {
2484
+		//		c.ServeSuccessJSON(map[string]interface{}{
2485
+		//			"patient": patient,
2486
+		//			"number":  basNumber,
2487
+		//		})
2488
+		//	}
2489
+		//} else {
2490
+		//	c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
2491
+		//	return
2492
+		//}
2493 2493
 		break
2494 2494
 	case 2:
2495 2495
 		SFZStr := c.GetSFZBaseInfo()