Pārlūkot izejas kodu

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

csx 2 gadus atpakaļ
vecāks
revīzija
6f8fd043af

+ 26 - 1
controllers/sg/his_api_controller.go Parādīt failu

244
 	roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
244
 	roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
245
 	miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
245
 	miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
246
 	his, _ := service.GetNewHisPatientInfoFour(c.GetAdminUserInfo().CurrentOrgId, his_patient_id)
246
 	his, _ := service.GetNewHisPatientInfoFour(c.GetAdminUserInfo().CurrentOrgId, his_patient_id)
247
-	result := service.Gdyb90991(his.PsnNo, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, card_pwd)
247
+	psn, _ := service.GetPsnByPatientId(his.PatientId)
248
+	bas := strings.Split(psn.CardInfo, "|")
249
+	basNumber := bas[2]
250
+	result := service.Gdyb90991(his.PsnNo, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, card_pwd, basNumber)
248
 
251
 
249
 	var dat map[string]interface{}
252
 	var dat map[string]interface{}
250
 	if err := json.Unmarshal([]byte(result), &dat); err == nil {
253
 	if err := json.Unmarshal([]byte(result), &dat); err == nil {
616
 					return
619
 					return
617
 
620
 
618
 				} else {
621
 				} else {
622
+					Iinfos, _ := json.Marshal(res.Output.Iinfo)
623
+					Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
624
+					infoStr := string(Iinfos)
625
+					idetinfoStr := string(Idetinfos)
626
+					psn := &models.HisPsn{
627
+						PsnNo:        res.Output.Baseinfo.PsnNo,
628
+						Age:          res.Output.Baseinfo.Age,
629
+						PatientId:    patient.ID,
630
+						Certno:       res.Output.Baseinfo.Certno,
631
+						Brdy:         res.Output.Baseinfo.Brdy,
632
+						Gend:         res.Output.Baseinfo.Gend,
633
+						Naty:         res.Output.Baseinfo.Naty,
634
+						PsnCertType:  res.Output.Baseinfo.PsnCertType,
635
+						PsnName:      res.Output.Baseinfo.PsnName,
636
+						Idetinfo:     idetinfoStr,
637
+						Insuinfo:     infoStr,
638
+						UserOrgId:    c.GetAdminUserInfo().CurrentOrgId,
639
+						CardInfo:     basStr,
640
+						VerifyNumber: "",
641
+					}
642
+					service.CreateHisPsn(psn)
643
+
619
 					c.ServeSuccessJSON(map[string]interface{}{
644
 					c.ServeSuccessJSON(map[string]interface{}{
620
 						"patient": patient,
645
 						"patient": patient,
621
 						"number":  basNumber,
646
 						"number":  basNumber,

+ 1 - 1
controllers/zh/zh_his_api_controller.go Parādīt failu

944
 			data["struct_2401"] = struct2401
944
 			data["struct_2401"] = struct2401
945
 			var req *http.Request
945
 			var req *http.Request
946
 			bytesData, _ := json.Marshal(data)
946
 			bytesData, _ := json.Marshal(data)
947
-			req, _ = http.NewRequest("POST", "http://172.16.13.254:9532/"+"jsyb/2401", bytes.NewReader(bytesData))
947
+			req, _ = http.NewRequest("POST", "http://172.16.13.254:9532/"+"nmyb/2401", bytes.NewReader(bytesData))
948
 			client := &http.Client{}
948
 			client := &http.Client{}
949
 			resp, _ := client.Do(req)
949
 			resp, _ := client.Do(req)
950
 			defer resp.Body.Close()
950
 			defer resp.Body.Close()

Binārs
gdyb Parādīt failu


+ 3 - 1
service/gdyb_service.go Parādīt failu

3858
 	return uintptr(unsafe.Pointer(syscall.StringBytePtr(s)))
3858
 	return uintptr(unsafe.Pointer(syscall.StringBytePtr(s)))
3859
 }
3859
 }
3860
 
3860
 
3861
-func Gdyb90991(psn_no string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, pwd string) string {
3861
+func Gdyb90991(psn_no string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, pwd string, card_number string) string {
3862
 	//生成签名
3862
 	//生成签名
3863
 	nonce := GetRandomString(32)
3863
 	nonce := GetRandomString(32)
3864
 	timestamp := time.Now().Unix()
3864
 	timestamp := time.Now().Unix()
3872
 	inputData["fixmedins_code"] = fixmedins_code // 就诊凭证编号
3872
 	inputData["fixmedins_code"] = fixmedins_code // 就诊凭证编号
3873
 	inputData["psn_no"] = psn_no                 // 开始时间
3873
 	inputData["psn_no"] = psn_no                 // 开始时间
3874
 	inputData["card_pwd"] = pwd                  // 人员姓名
3874
 	inputData["card_pwd"] = pwd                  // 人员姓名
3875
+	inputData["sscno"] = card_number             // 人员姓名
3876
+
3875
 	input["data"] = inputData
3877
 	input["data"] = inputData
3876
 	inputMessage["input"] = input //交易输入
3878
 	inputMessage["input"] = input //交易输入
3877
 
3879