Преглед изворни кода

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

csx пре 2 година
родитељ
комит
be52d2338e

+ 1 - 1
conf/app.conf Прегледај датотеку

45
 
45
 
46
 
46
 
47
 [prod]
47
 [prod]
48
-org_id = 10106
48
+org_id = 10188
49
 mobile_token_expiration_second = 86400
49
 mobile_token_expiration_second = 86400
50
 httpdomain = https://api.xt.kuyicloud.com
50
 httpdomain = https://api.xt.kuyicloud.com
51
 sso_domain = https://sso.kuyicloud.com
51
 sso_domain = https://sso.kuyicloud.com

+ 2 - 1
controllers/nm/nm_controller.go Прегледај датотеку

466
 	secret_key := c.GetString("secret_key")
466
 	secret_key := c.GetString("secret_key")
467
 	org_name := c.GetString("org_name")
467
 	org_name := c.GetString("org_name")
468
 	fapiao_number := c.GetString("fapiao_number")
468
 	fapiao_number := c.GetString("fapiao_number")
469
+	acct_used_flag := c.GetString("acct_used_flag")
469
 
470
 
470
-	result, src_resquest := service.ZHGdyb2304(psn_no, mdtrt_id, chrg_bchno, cert_no, insutype_type, allTotal, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, "0", id_card_type, 0, 0, 0, 0, certificates, fapiao_number)
471
+	result, src_resquest := service.ZHGdyb2304(psn_no, mdtrt_id, chrg_bchno, cert_no, insutype_type, allTotal, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, "0", id_card_type, 0, 0, 0, 0, certificates, fapiao_number, acct_used_flag)
471
 	saveJsLog(result, src_resquest, "2304", "住院结算", org_name)
472
 	saveJsLog(result, src_resquest, "2304", "住院结算", org_name)
472
 	var dat2 map[string]interface{}
473
 	var dat2 map[string]interface{}
473
 	if err := json.Unmarshal([]byte(src_resquest), &dat2); err == nil {
474
 	if err := json.Unmarshal([]byte(src_resquest), &dat2); err == nil {

+ 7 - 6
controllers/sg/his_api_controller.go Прегледај датотеку

906
 		})
906
 		})
907
 		return
907
 		return
908
 	} else {
908
 	} else {
909
-		if res.Output.Result.CheckStat == "0" {
909
+		if res.Output.Result.SscnoCheckStat == "0" {
910
 			var msg string
910
 			var msg string
911
 			switch res.Output.Result.CardStat {
911
 			switch res.Output.Result.CardStat {
912
 			case "00":
912
 			case "00":
4489
 	Infcode     int64  `json:"infcode"`
4489
 	Infcode     int64  `json:"infcode"`
4490
 	Output      struct {
4490
 	Output      struct {
4491
 		Result struct {
4491
 		Result struct {
4492
-			PsnNo     string `json:"psn_no"`
4493
-			CardStat  string `json:"card_stat"`
4494
-			Certno    string `json:"certno"`
4495
-			PsnName   string `json:"psn_name"`
4496
-			CheckStat string `json:"check_stat"`
4492
+			PsnNo          string `json:"psn_no"`
4493
+			CardStat       string `json:"card_stat"`
4494
+			Certno         string `json:"certno"`
4495
+			PsnName        string `json:"psn_name"`
4496
+			CheckStat      string `json:"check_stat"`
4497
+			SscnoCheckStat string `json:"sscno_check_stat"`
4497
 		} `json:"result"`
4498
 		} `json:"result"`
4498
 	} `json:"output"`
4499
 	} `json:"output"`
4499
 	RefmsgTime  string      `json:"refmsg_time"`
4500
 	RefmsgTime  string      `json:"refmsg_time"`

+ 9 - 2
controllers/zh/zh_his_api_controller.go Прегледај датотеку

1478
 		} else {
1478
 		} else {
1479
 			mdtrt_cert_no = record.Certno
1479
 			mdtrt_cert_no = record.Certno
1480
 		}
1480
 		}
1481
+		var acct_used_flag string
1482
+		if pay_way == 5 {
1483
+			acct_used_flag = "1"
1484
+		} else {
1485
+			acct_used_flag = "0"
1486
+		}
1487
+
1481
 		//请求内网数据
1488
 		//请求内网数据
1482
 		api := "http://172.16.13.254:9532/" + "nmyb/2304?psn_no=" + record.PsnNo + "&mdtrt_id=" + record.Number + "&chrg_bchno=" + chrg_bchno +
1489
 		api := "http://172.16.13.254:9532/" + "nmyb/2304?psn_no=" + record.PsnNo + "&mdtrt_id=" + record.Number + "&chrg_bchno=" + chrg_bchno +
1483
 			"&insutype_type=" + record.InsutypeType + "&total=" + allTotal +
1490
 			"&insutype_type=" + record.InsutypeType + "&total=" + allTotal +
1484
 			"&org_name=" + miConfig.OrgName + "&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code +
1491
 			"&org_name=" + miConfig.OrgName + "&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code +
1485
-			"&insuplc_admdvs=" + record.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(record.IdCardType, 10) + "&card_sn=" + "" + "&certificates=" + strconv.FormatInt(record.Certificates, 10) + "&name=" + record.Name + "&cert_no=" + mdtrt_cert_no + "&fapiao_number=" + fapiao_number
1492
+			"&insuplc_admdvs=" + record.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(record.IdCardType, 10) + "&card_sn=" + "" + "&certificates=" + strconv.FormatInt(record.Certificates, 10) + "&name=" + record.Name + "&cert_no=" + mdtrt_cert_no + "&fapiao_number=" + fapiao_number + "&acct_used_flag=" + acct_used_flag
1486
 		resp, requestErr := http.Get(api)
1493
 		resp, requestErr := http.Get(api)
1487
 		if requestErr != nil {
1494
 		if requestErr != nil {
1488
 			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
1495
 			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
1509
 
1516
 
1510
 	} else {
1517
 	} else {
1511
 
1518
 
1512
-		result, src_resquest = service.ZHGdyb2304(record.PsnNo, record.Number, chrg_bchno, cert_no, record.InsutypeType, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, record.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, "0", record.IdCardType, 0, 0, 0, 0, record.Certificates, "")
1519
+		result, src_resquest = service.ZHGdyb2304(record.PsnNo, record.Number, chrg_bchno, cert_no, record.InsutypeType, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, record.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, "0", record.IdCardType, 0, 0, 0, 0, record.Certificates, "", "1")
1513
 		saveLog(result, src_resquest, "2304", "住院结算")
1520
 		saveLog(result, src_resquest, "2304", "住院结算")
1514
 	}
1521
 	}
1515
 
1522
 

+ 7 - 7
main.go Прегледај датотеку

5
 	"fmt"
5
 	"fmt"
6
 	"gdyb/models"
6
 	"gdyb/models"
7
 	_ "gdyb/routers"
7
 	_ "gdyb/routers"
8
-	"gdyb/service"
8
+	//"gdyb/service"
9
 	"github.com/astaxie/beego"
9
 	"github.com/astaxie/beego"
10
 	"github.com/qiniu/api.v7/auth/qbox"
10
 	"github.com/qiniu/api.v7/auth/qbox"
11
 	"github.com/qiniu/api.v7/storage"
11
 	"github.com/qiniu/api.v7/storage"
15
 )
15
 )
16
 
16
 
17
 func init() {
17
 func init() {
18
-	service.ConnectDB()
19
-	org_id, _ := beego.AppConfig.Int64("org_id")
20
-
21
-	miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
22
-	CreateLog(miConfig)
23
-	UploadLog(miConfig)
18
+	//service.ConnectDB()
19
+	//org_id, _ := beego.AppConfig.Int64("org_id")
20
+	//
21
+	//miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
22
+	//CreateLog(miConfig)
23
+	//UploadLog(miConfig)
24
 
24
 
25
 	//UploadSettleList(org_id)
25
 	//UploadSettleList(org_id)
26
 }
26
 }

+ 2 - 0
service/jsyb_service.go Прегледај датотеку

1341
 	patientDtosinputData["fsi_encounter_dtos"] = fisEncounterDtosData
1341
 	patientDtosinputData["fsi_encounter_dtos"] = fisEncounterDtosData
1342
 	inputData["syscode"] = "LinkDialysis"
1342
 	inputData["syscode"] = "LinkDialysis"
1343
 	inputData["trig_scen"] = trig_scen
1343
 	inputData["trig_scen"] = trig_scen
1344
+	inputData["rule_ids"] = ""
1345
+
1344
 	inputData["patient_dtos"] = patientDtosinputData
1346
 	inputData["patient_dtos"] = patientDtosinputData
1345
 	input["data"] = inputData
1347
 	input["data"] = inputData
1346
 	inputMessage["infno"] = "3101"
1348
 	inputMessage["infno"] = "3101"

+ 8 - 8
service/zh_his_service.go Прегледај датотеку

957
 }
957
 }
958
 
958
 
959
 //  住院结算
959
 //  住院结算
960
-func ZHGdyb2304(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, mid_setl_flag string, id_card_type int64, fulamt_ownpay_amt float64, overlmt_selfpay float64, preselfpay_amt float64, inscp_scp_amt float64, certificates int64, fapiao_number string) (string, string) {
960
+func ZHGdyb2304(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, mid_setl_flag string, id_card_type int64, fulamt_ownpay_amt float64, overlmt_selfpay float64, preselfpay_amt float64, inscp_scp_amt float64, certificates int64, fapiao_number string, acct_used_flag string) (string, string) {
961
 	// 生成签名
961
 	// 生成签名
962
 	nonce := GetRandomString(32)
962
 	nonce := GetRandomString(32)
963
 	timestamp := time.Now().Unix()
963
 	timestamp := time.Now().Unix()
982
 		}
982
 		}
983
 	}
983
 	}
984
 	inputData["mdtrt_cert_sn"] = ""
984
 	inputData["mdtrt_cert_sn"] = ""
985
-	inputData["mid_setl_flag"] = mid_setl_flag // 中途退费标志
986
-	inputData["medfee_sumamt"] = total         // 医疗费总额
987
-	inputData["psn_setlway"] = "01"            // 个人结算方式 01 按项目结 02 按定额结算
988
-	inputData["mdtrt_id"] = mdtrtId            // 就诊 ID(来自2201接口返回)
989
-	inputData["acct_used_flag"] = "1"          // 个人账户使用标志 0否 1是
990
-	inputData["insutype"] = insutype           // 险种类型
991
-	inputData["invono"] = fapiao_number        // 发票号
985
+	inputData["mid_setl_flag"] = mid_setl_flag   // 中途退费标志
986
+	inputData["medfee_sumamt"] = total           // 医疗费总额
987
+	inputData["psn_setlway"] = "01"              // 个人结算方式 01 按项目结 02 按定额结算
988
+	inputData["mdtrt_id"] = mdtrtId              // 就诊 ID(来自2201接口返回)
989
+	inputData["acct_used_flag"] = acct_used_flag // 个人账户使用标志 0否 1是
990
+	inputData["insutype"] = insutype             // 险种类型
991
+	inputData["invono"] = fapiao_number          // 发票号
992
 
992
 
993
 	input["data"] = inputData
993
 	input["data"] = inputData
994
 	inputMessage["input"] = input //交易输入
994
 	inputMessage["input"] = input //交易输入