Ver código fonte

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

csx 1 ano atrás
pai
commit
957a8e7e30
6 arquivos alterados com 2325 adições e 2087 exclusões
  1. 5 5
      conf/app.conf
  2. 132 0
      controllers/sg/his_api_controller.go
  3. 3 0
      models/his_models.go
  4. 2 5
      routers/router.go
  5. 2182 2076
      service/fj_service.go
  6. 1 1
      service/gdyb_service.go

+ 5 - 5
conf/app.conf Ver arquivo

@@ -45,7 +45,7 @@ appsecret="61ee2e6268497d5aa9de0b0187c39aea"
45 45
 
46 46
 
47 47
 [prod]
48
-org_id = 9919
48
+org_id = 10191
49 49
 mobile_token_expiration_second = 86400
50 50
 httpdomain = https://api.xt.kuyicloud.com
51 51
 sso_domain = https://sso.kuyicloud.com
@@ -53,21 +53,21 @@ call_domain = https://hf.sgjyun.com
53 53
 front_end_domain = "https://xt.kuyicloud.com/#"
54 54
 #url  = "http://192.168.1.228:17001/szsi-portal/transData"
55 55
 #url = "http://192.168.1.88:6666/szsi-portal/transData"
56
-gdyb_url = "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/"
57
-#gdyb_url="http://igb.hsa.gdgov.cn/ebus/sz_prd/hsa/hgs/"
56
+# gdyb_url = "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/"
57
+gdyb_url="http://igb.hsa.gdgov.cn/ebus/sz_prd/hsa/hgs/"
58 58
 # gdyb_url = "http://10.97.240.206/ebus/sztest_hosp/poc/hsa/hgs/"
59 59
 #内蒙古
60 60
 # http://tyjk.nm.hsip.gov.cn:8090/uif-hsaf-med-api/api/medical/service
61 61
 # gdyb_url = "http://tyjk.nm.hsip.gov.cn:8090/uif-hsaf-med-api/api/medical/service"
62 62
 # gdyb_url = "http://19.15.78.136:20001/ebus/gdyb_inf/poc/hsa/hgs/gzzq/"
63 63
 #韶关
64
-gdyb_paasid = "sg03_prd"
64
+# gdyb_paasid = "sg03_prd"
65 65
 #江门
66 66
 #gdyb_paasid = "jm_sc_yjyy"
67 67
 #珠海
68 68
 # gdyb_paasid="zh_prd_yrojyy"
69 69
 #深圳
70
-# gdyb_paasid = "sz_prd_yjyy"
70
+gdyb_paasid = "sz_prd_yjyy"
71 71
 #肇庆
72 72
 # gdyb_paasid = "zq_prd_yjyy"
73 73
 # gdyb_paasid = "sztest_hosp"

+ 132 - 0
controllers/sg/his_api_controller.go Ver arquivo

@@ -1381,6 +1381,71 @@ func (c *HisApiController) ReadCard() {
1381 1381
 
1382 1382
 			}
1383 1383
 
1384
+		} else if miConfig.MdtrtareaAdmvs == "350500" {
1385
+			cardnum, cardCode, id_card_no, name, errmsg := c.GetFjBasBaseInfo()
1386
+			fmt.Println(cardnum)
1387
+			fmt.Println(cardCode)
1388
+			fmt.Println(id_card_no)
1389
+			fmt.Println(name)
1390
+			fmt.Println(errmsg)
1391
+			basStr := cardnum + "|" + cardCode + "|" + id_card_no + "|" + name
1392
+			result, _ := service.FJyb1101(cardnum, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, id_card_type, cardCode, certificates, miConfig.Url, miConfig.Code, miConfig.AppSecret, miConfig.SignKey, miConfig.EncKey)
1393
+			var dat map[string]interface{}
1394
+			if err := json.Unmarshal([]byte(result), &dat); err == nil {
1395
+				fmt.Println(dat)
1396
+			} else {
1397
+				fmt.Println(err)
1398
+			}
1399
+
1400
+			userJSONBytes, _ := json.Marshal(dat)
1401
+			var res ResultTwo
1402
+			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
1403
+				utils.ErrorLog("解析失败:%v", err)
1404
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
1405
+				return
1406
+			}
1407
+
1408
+			if res.Infcode == 0 {
1409
+				patient, err := service.GetPatientByNumber(id_card_no, c.GetAdminUserInfo().CurrentOrgId)
1410
+				if err == gorm.ErrRecordNotFound {
1411
+					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNoPateintException)
1412
+					return
1413
+				} else if err != nil {
1414
+					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
1415
+					return
1416
+
1417
+				} else {
1418
+					Iinfos, _ := json.Marshal(res.Output.Iinfo)
1419
+					Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
1420
+					infoStr := string(Iinfos)
1421
+					idetinfoStr := string(Idetinfos)
1422
+					psn := &models.HisPsn{
1423
+						PsnNo:        res.Output.Baseinfo.PsnNo,
1424
+						Age:          res.Output.Baseinfo.Age,
1425
+						PatientId:    patient.ID,
1426
+						Certno:       res.Output.Baseinfo.Certno,
1427
+						Brdy:         res.Output.Baseinfo.Brdy,
1428
+						Gend:         res.Output.Baseinfo.Gend,
1429
+						Naty:         res.Output.Baseinfo.Naty,
1430
+						PsnCertType:  res.Output.Baseinfo.PsnCertType,
1431
+						PsnName:      res.Output.Baseinfo.PsnName,
1432
+						Idetinfo:     idetinfoStr,
1433
+						Insuinfo:     infoStr,
1434
+						UserOrgId:    c.GetAdminUserInfo().CurrentOrgId,
1435
+						CardInfo:     basStr,
1436
+						VerifyNumber: "",
1437
+					}
1438
+					service.CreateHisPsn(psn)
1439
+
1440
+					c.ServeSuccessJSON(map[string]interface{}{
1441
+						"patient": patient,
1442
+						"number":  cardnum,
1443
+					})
1444
+				}
1445
+			} else {
1446
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
1447
+				return
1448
+			}
1384 1449
 		} else {
1385 1450
 			if initFlag == 0 {
1386 1451
 				c.TestGetBasBaseInit()
@@ -1875,6 +1940,37 @@ func (c *HisApiController) GetBasBaseInfo() string {
1875 1940
 	return string(str)
1876 1941
 }
1877 1942
 
1943
+func (c *HisApiController) GetFjBasBaseInfo() (string, string, string, string, string) {
1944
+	DllDef := syscall.MustLoadDLL("chs_fjs_standard.dll")
1945
+	readCard := DllDef.MustFindProc("read_cardinfo")
1946
+	if readCard == nil {
1947
+		fmt.Println("readcard is nil")
1948
+		readCard = DllDef.MustFindProc("read_cardinfo")
1949
+	}
1950
+	str := make([]byte, 1024)  //卡号
1951
+	str1 := make([]byte, 1024) //卡识别码
1952
+	str2 := make([]byte, 1024) //身份证号
1953
+	str3 := make([]byte, 1024) //姓名
1954
+	str4 := make([]byte, 1024) //错误信息
1955
+
1956
+	ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&str[0])), uintptr(1024), (uintptr)(unsafe.Pointer(&str1[0])), (uintptr)(unsafe.Pointer(&str2[0])), (uintptr)(unsafe.Pointer(&str3[0])), (uintptr)(unsafe.Pointer(&str4[0])))
1957
+	fmt.Println(string(str1))
1958
+	fmt.Println(string(str))
1959
+	fmt.Println(string(str2))
1960
+	fmt.Println(string(str3))
1961
+	fmt.Println(string(str4))
1962
+	fmt.Println(":", ConvertToString(string(str1), "gbk", "utf-8"))
1963
+	fmt.Println(":", ConvertToString(string(str), "gbk", "utf-8"))
1964
+	fmt.Println(":", ConvertToString(string(str2), "gbk", "utf-8"))
1965
+	fmt.Println(":", ConvertToString(string(str3), "gbk", "utf-8"))
1966
+	fmt.Println(":", ConvertToString(string(str4), "gbk", "utf-8"))
1967
+
1968
+	if ret2 != 0 {
1969
+		return "", "", "", "", ""
1970
+	}
1971
+	return string(str), string(str1), string(str2), string(str3), string(str4)
1972
+}
1973
+
1878 1974
 type CustomFundPay struct {
1879 1975
 	FundPayType string  `json:"fund_pay_type"`
1880 1976
 	FundPayamt  float64 `json:"fund_payamt"`
@@ -4972,6 +5068,21 @@ func (c *HisApiController) GetRegisterInfo() {
4972 5068
 			infocode = 0
4973 5069
 			verify_number = psn_info.VerifyNumber
4974 5070
 
5071
+		} else if miConfig.MdtrtareaAdmvs == "350500" {
5072
+			psn_info, _ := service.GetPsnByPatientId(id)
5073
+			PsnNo = psn_info.PsnNo
5074
+			PsnCertType = psn_info.PsnCertType
5075
+			Certno = psn_info.Certno
5076
+			PsnName = psn_info.PsnName
5077
+			Gend = psn_info.Gend
5078
+			Naty = psn_info.Naty
5079
+			Brdy = psn_info.Brdy
5080
+			Age = psn_info.Age
5081
+			infoStr = psn_info.Insuinfo
5082
+			idetinfoStr = psn_info.Idetinfo
5083
+			infocode = 0
5084
+			verify_number = psn_info.VerifyNumber
5085
+
4975 5086
 		} else {
4976 5087
 			var result string
4977 5088
 			var requestLog string
@@ -5242,6 +5353,27 @@ func (c *HisApiController) GetRegisterInfo() {
5242 5353
 
5243 5354
 				resThree.InfRefmsgid = resThree10265.InfRefmsgid
5244 5355
 
5356
+				infocode, _ = strconv.ParseInt(resThree10265.Infcode, 10, 64)
5357
+			} else if miConfig.MdtrtareaAdmvs == "350500" {
5358
+				result, requestLog := service.FJyb2201(res.Output.Baseinfo.PsnNo, insutype, IdCardNo, miConfig.OrgName, doctor_info.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_id, insuplc_admdvs_temp, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, roles.UserName, doctor_info.UserName, miConfig.Url, miConfig.Code, miConfig.AppSecret, miConfig.SignKey, miConfig.EncKey)
5359
+				saveLog(result, requestLog, "2201", "挂号")
5360
+				if miConfig.Code == "H15049901371" {
5361
+
5362
+					if err := json.Unmarshal([]byte(result), &resThree10265); err != nil {
5363
+						utils.ErrorLog("解析失败:%v", err)
5364
+						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
5365
+						return
5366
+					}
5367
+					resThree.ErrMsg = resThree10265.ErrMsg
5368
+					resThree.Output = resThree10265.Output
5369
+					resThree.InfRefmsgid = resThree10265.InfRefmsgid
5370
+				} else {
5371
+					if err := json.Unmarshal([]byte(result), &resThree); err != nil {
5372
+						utils.ErrorLog("解析失败:%v", err)
5373
+						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
5374
+						return
5375
+					}
5376
+				}
5245 5377
 				infocode, _ = strconv.ParseInt(resThree10265.Infcode, 10, 64)
5246 5378
 			} else {
5247 5379
 				result, requestLog := service.Gdyb2201A(res.Output.Baseinfo.PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_id, insuplc_admdvs_temp, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName, record_time)

+ 3 - 0
models/his_models.go Ver arquivo

@@ -863,6 +863,9 @@ type MedicalInsuranceOrgConfig struct {
863 863
 	Url            string `gorm:"column:url" json:"url" form:"url"`
864 864
 	AccessKey      string `gorm:"column:access_key" json:"access_key" form:"access_key"`
865 865
 	Cainfo         string `gorm:"column:cainfo" json:"cainfo" form:"cainfo"`
866
+	AppSecret      string `gorm:"column:app_secret" json:"app_secret" form:"app_secret"`
867
+	SignKey        string `gorm:"column:sign_key" json:"sign_key" form:"sign_key"`
868
+	EncKey         string `gorm:"column:enc_key" json:"enc_key" form:"enc_key"`
866 869
 }
867 870
 
868 871
 func (MedicalInsuranceOrgConfig) TableName() string {

+ 2 - 5
routers/router.go Ver arquivo

@@ -1,10 +1,7 @@
1 1
 package routers
2 2
 
3 3
 import (
4
-	"gdyb/controllers/nm"
5 4
 	"gdyb/controllers/sg"
6
-	"gdyb/controllers/zh"
7
-
8 5
 	//"gdyb/controllers/sz"
9 6
 	//"gdyb/controllers/sz"
10 7
 	//admin_api "XT_New/controllers/admin_api_controllers"
@@ -26,9 +23,9 @@ func init() {
26 23
 	sg.GdybRegistRouters()
27 24
 	//hb.HbybRegistRouters()
28 25
 	//sz.SZHisManagerApiRegistRouters()
29
-	zh.ZHHisManagerApiRegistRouters()
26
+	//zh.ZHHisManagerApiRegistRouters()
30 27
 	//js.JSybRegistRouters()
31
-	nm.NmybRegistRouters()
28
+	//nm.NmybRegistRouters()
32 29
 	//coordinate.CoordinateRegistRouters()
33 30
 
34 31
 }

Diferenças do arquivo suprimidas por serem muito extensas
+ 2182 - 2076
service/fj_service.go


+ 1 - 1
service/gdyb_service.go Ver arquivo

@@ -4606,7 +4606,7 @@ func Gdyb1101D(certNo string, org_name string, doctor string, fixmedins_code str
4606 4606
 
4607 4607
 	inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
4608 4608
 	inputData["begntime"] = ""          // 开始时间
4609
-	inputData["psn_name"] = psn_name    // 人员姓名
4609
+	inputData["psn_name"] = ""          // 人员姓名
4610 4610
 	input["data"] = inputData
4611 4611
 	inputMessage["input"] = input //交易输入
4612 4612