csx 4 years ago
parent
commit
f2c855c521
3 changed files with 11 additions and 5 deletions
  1. 2 1
      controllers/gdyb_controller.go
  2. 3 1
      controllers/his_api_controller.go
  3. 6 3
      service/gdyb_service.go

+ 2 - 1
controllers/gdyb_controller.go View File

@@ -76,8 +76,9 @@ func (c *GdybController) PostOne() {
76 76
 
77 77
 	secret_key := c.GetString("secret_key")
78 78
 	id_card_type, _ := c.GetInt64("id_card_type")
79
+	card_sn := c.GetString("card_sn")
79 80
 
80
-	result := service.Gdyb1101(certNo, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type)
81
+	result := service.Gdyb1101(certNo, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type, card_sn)
81 82
 
82 83
 	var dat map[string]interface{}
83 84
 	if err := json.Unmarshal([]byte(result), &dat); err == nil {

+ 3 - 1
controllers/his_api_controller.go View File

@@ -151,11 +151,13 @@ func (c *HisApiController) Sscard() {
151 151
 			} else {
152 152
 
153 153
 				bas := strings.Split(basStr, "|")
154
+
154 155
 				basNumber := bas[1]
156
+				card_sn := bas[0]
155 157
 
156 158
 				appRole, _ := service.GetAppRole(adminUser.CurrentOrgId)
157 159
 
158
-				api := "http://127.0.0.1:9532/" + "gdyb/one?cert_no=" + basNumber + "&org_name=" + miConfig.OrgName + "&doctor=" + appRole.UserName + "&fixmedins_code=" + miConfig.Code + "&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(int64(id_card_type), 10)
160
+				api := "http://127.0.0.1:9532/" + "gdyb/one?cert_no=" + basNumber + "&org_name=" + miConfig.OrgName + "&doctor=" + appRole.UserName + "&fixmedins_code=" + miConfig.Code + "&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(int64(id_card_type), 10) + "&card_sn=" + card_sn
159 161
 				resp, requestErr := http.Get(api)
160 162
 				if requestErr != nil {
161 163
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)

+ 6 - 3
service/gdyb_service.go View File

@@ -25,7 +25,7 @@ const (
25 25
 )
26 26
 
27 27
 // 人员基本信息
28
-func Gdyb1101(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, id_card_type int64) string {
28
+func Gdyb1101(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, id_card_type int64, card_sn string) string {
29 29
 	// 生成签名
30 30
 	nonce := GetRandomString(32)
31 31
 	timestamp := time.Now().Unix()
@@ -39,14 +39,17 @@ func Gdyb1101(certNo string, org_name string, doctor string, fixmedins_code stri
39 39
 
40 40
 	if id_card_type == 1 {
41 41
 		inputData["mdtrt_cert_type"] = "03" // 就诊凭证类型
42
+		inputData["card_sn"] = card_sn      // 卡识别码
43
+
42 44
 	} else if id_card_type == 2 {
43 45
 		inputData["mdtrt_cert_type"] = "02" // 就诊凭证类型
46
+		inputData["card_sn"] = ""           // 卡识别码
47
+
44 48
 	}
45 49
 
46 50
 	inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
47
-	inputData["card_sn"] = ""           // 卡识别码
48 51
 	inputData["begntime"] = ""          // 开始时间
49
-	inputData["psn_cert_type"] = "1"    // 人员证件类型
52
+	inputData["psn_cert_type"] = ""     // 人员证件类型
50 53
 	inputData["certno"] = certNo        // 证件号码
51 54
 	inputData["psn_name"] = ""          // 人员姓名
52 55
 	input["data"] = inputData