Procházet zdrojové kódy

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

csx před 3 roky
rodič
revize
93d43f27ca
2 změnil soubory, kde provedl 49 přidání a 14 odebrání
  1. 5 5
      conf/app.conf
  2. 44 9
      controllers/sg/his_api_controller.go

+ 5 - 5
conf/app.conf Zobrazit soubor

@@ -45,7 +45,7 @@ appsecret="61ee2e6268497d5aa9de0b0187c39aea"
45 45
 
46 46
 
47 47
 [prod]
48
-org_id = 10028
48
+org_id = 10265
49 49
 mobile_token_expiration_second = 86400
50 50
 httpdomain = https://api.xt.kuyicloud.com
51 51
 sso_domain = https://sso.kuyicloud.com
@@ -54,13 +54,13 @@ 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 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/"
57
+#gdyb_url="http://igb.hsa.gdgov.cn/ebus/sz_prd/hsa/hgs/"
58 58
 #内蒙古
59
-#gdyb_url = "http://10.38.23.105:8090/uif-hsaf-med-api/api/medical/service/"
60
-#gdyb_paasid = "sg03_prd"
59
+gdyb_url = "http://10.38.23.105:8090/uif-hsaf-med-api/api/medical/service/"
60
+gdyb_paasid = "sg03_prd"
61 61
 #gdyb_paasid = "jm_sc_yjyy"
62 62
 #gdyb_paasid="zh_prd_yjyy"
63
-gdyb_paasid = "sz_prd_yjyy"
63
+#gdyb_paasid = "sz_prd_yjyy"
64 64
 #gdyb_paasid = "zq_prd_yjyy"
65 65
 
66 66
 

+ 44 - 9
controllers/sg/his_api_controller.go Zobrazit soubor

@@ -2640,6 +2640,18 @@ type ResultFourteen struct {
2640 2640
 	WarnInfo    interface{} `json:"warn_info"`
2641 2641
 }
2642 2642
 
2643
+type ResultFourteen10265 struct {
2644
+	ErrMsg      string `json:"err_msg"`
2645
+	InfRefmsgid string `json:"inf_refmsgid"`
2646
+	Infcode     string `json:"infcode"`
2647
+	Output      struct {
2648
+	} `json:"output"`
2649
+	RefmsgTime  string      `json:"refmsg_time"`
2650
+	RespondTime string      `json:"respond_time"`
2651
+	Signtype    interface{} `json:"signtype"`
2652
+	WarnInfo    interface{} `json:"warn_info"`
2653
+}
2654
+
2643 2655
 type ResultSixteen struct {
2644 2656
 	Cainfo      string `json:"cainfo"`
2645 2657
 	ErrMsg      string `json:"err_msg"`
@@ -7900,6 +7912,11 @@ func (c *HisApiController) PsnPutUnNCDSOnRecord() {
7900 7912
 	//} else {
7901 7913
 	//	user_name = role.UserName
7902 7914
 	//}
7915
+	psn_record, _ := service.GetPsnNCDSRecordById(id)
7916
+	if psn_record.ID == 0 {
7917
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorPsnRecordNoExistWrong)
7918
+		return
7919
+	}
7903 7920
 	result, _ := service.Gdyb1101(patient.IdCardNo, miConfig.OrgName, role.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, 2, "", "0", patient.Name)
7904 7921
 	var res ResultTwo
7905 7922
 	var res10265 ResultTwo10265
@@ -7965,6 +7982,7 @@ func (c *HisApiController) PsnPutUnNCDSOnRecord() {
7965 7982
 	if len(insutypes) == 0 {
7966 7983
 		insutype = "310"
7967 7984
 	}
7985
+	insutype = psn_record.Insutype
7968 7986
 
7969 7987
 	for _, item := range rf {
7970 7988
 		if item.Insutype == insutype {
@@ -7972,11 +7990,6 @@ func (c *HisApiController) PsnPutUnNCDSOnRecord() {
7972 7990
 		}
7973 7991
 	}
7974 7992
 
7975
-	psn_record, _ := service.GetPsnNCDSRecordById(id)
7976
-	if psn_record.ID == 0 {
7977
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorPsnRecordNoExistWrong)
7978
-		return
7979
-	}
7980 7993
 	if config.IsOpen == 1 {
7981 7994
 		result := service.Gdyb2504(psn_record.PsnNo, miConfig.OrgName, role.UserName, miConfig.Code, insuplc_admdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, psn_record.TrtDclaDetlSn)
7982 7995
 		var dat map[string]interface{}
@@ -7988,11 +8001,33 @@ func (c *HisApiController) PsnPutUnNCDSOnRecord() {
7988 8001
 
7989 8002
 		userJSONBytes, _ := json.Marshal(dat)
7990 8003
 		var res ResultFourteen
7991
-		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
7992
-			utils.ErrorLog("解析失败:%v", err)
7993
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
7994
-			return
8004
+		var res10265 ResultFourteen10265
8005
+
8006
+		if miConfig.Code == "H15049901371" {
8007
+			if err := json.Unmarshal(userJSONBytes, &res10265); err != nil {
8008
+				utils.ErrorLog("解析失败:%v", err)
8009
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8010
+				return
8011
+			}
8012
+			res.ErrMsg = res10265.ErrMsg
8013
+			infocode, _ := strconv.ParseInt(res10265.Infcode, 10, 64)
8014
+			res.Infcode = infocode
8015
+			res.Output = res10265.Output
8016
+			res.InfRefmsgid = res10265.InfRefmsgid
8017
+
8018
+		} else {
8019
+			if err := json.Unmarshal([]byte(result), &res); err != nil {
8020
+				utils.ErrorLog("解析失败:%v", err)
8021
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8022
+				return
8023
+			}
7995 8024
 		}
8025
+
8026
+		//if err := json.Unmarshal(userJSONBytes, &res); err != nil {
8027
+		//	utils.ErrorLog("解析失败:%v", err)
8028
+		//	c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8029
+		//	return
8030
+		//}
7996 8031
 		if res.Infcode == 0 {
7997 8032
 			psn_record.IsCancel = 2
7998 8033
 			service.CreatePsnNCDSRecord(&psn_record)