Selaa lähdekoodia

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

csx 3 vuotta sitten
vanhempi
commit
ed1349a323
3 muutettua tiedostoa jossa 33 lisäystä ja 14 poistoa
  1. 23 5
      controllers/sg/his_api_controller.go
  2. 2 1
      main.go
  3. 8 8
      service/gdyb_service.go

+ 23 - 5
controllers/sg/his_api_controller.go Näytä tiedosto

@@ -2617,6 +2617,12 @@ func (c *HisApiController) GetUploadInfo() {
2617 2617
 						var res ResultSeven
2618 2618
 						var src_resquest string
2619 2619
 						var result2 string
2620
+						var acct_used_flag string
2621
+						if pay_way == 5 {
2622
+							acct_used_flag = "1"
2623
+						} else {
2624
+							acct_used_flag = "0"
2625
+						}
2620 2626
 						if miConfig.MdtrtareaAdmvs == "421300" {
2621 2627
 
2622 2628
 							api := "http://192.168.124.4:9532/" + "hbyb/2207?psn_no=" + his.PsnNo + "&mdtrt_id=" +
@@ -2625,7 +2631,7 @@ func (c *HisApiController) GetUploadInfo() {
2625 2631
 								"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
2626 2632
 								"&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(his.IdCardType, 10) +
2627 2633
 								"&certificates=" + strconv.FormatInt(his.IdType, 10) + "&cert_no=" + cert_no +
2628
-								"&insutype=" + insutype + "&total=" + allTotal + "&med_type=" + strconv.FormatInt(reg_type, 10)
2634
+								"&insutype=" + insutype + "&total=" + allTotal + "&med_type=" + strconv.FormatInt(reg_type, 10) + "&acct_used_flag=" + acct_used_flag
2629 2635
 
2630 2636
 							resp, requestErr := http.Get(api)
2631 2637
 							if requestErr != nil {
@@ -2656,7 +2662,7 @@ func (c *HisApiController) GetUploadInfo() {
2656 2662
 							}
2657 2663
 
2658 2664
 						} else {
2659
-							result2, src_resquest = service.Gdyb2207(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, strconv.FormatInt(reg_type, 10), his.IdCardType, 0, 0, 0, 0, his.IdType)
2665
+							result2, src_resquest = service.Gdyb2207(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, strconv.FormatInt(reg_type, 10), his.IdCardType, 0, 0, 0, 0, his.IdType, acct_used_flag)
2660 2666
 							var dat map[string]interface{}
2661 2667
 							if err := json.Unmarshal([]byte(result2), &dat); err == nil {
2662 2668
 								fmt.Println(dat)
@@ -2859,6 +2865,13 @@ func (c *HisApiController) GetUploadInfo() {
2859 2865
 			var res ResultSeven
2860 2866
 			var src_resquest string
2861 2867
 			var result2 string
2868
+			var acct_used_flag string
2869
+
2870
+			if pay_way == 5 {
2871
+				acct_used_flag = "1"
2872
+			} else {
2873
+				acct_used_flag = "0"
2874
+			}
2862 2875
 
2863 2876
 			if miConfig.MdtrtareaAdmvs == "421300" {
2864 2877
 				api := "http://192.168.124.4:9532/" + "hbyb/2207?psn_no=" + his.PsnNo + "&mdtrt_id=" +
@@ -2867,7 +2880,7 @@ func (c *HisApiController) GetUploadInfo() {
2867 2880
 					"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
2868 2881
 					"&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(his.IdCardType, 10) +
2869 2882
 					"&certificates=" + strconv.FormatInt(his.IdType, 10) + "&cert_no=" + cert_no +
2870
-					"&insutype=" + insutype + "&total=" + allTotal + "&med_type=" + strconv.FormatInt(reg_type, 10)
2883
+					"&insutype=" + insutype + "&total=" + allTotal + "&med_type=" + strconv.FormatInt(reg_type, 10) + "&acct_used_flag=" + acct_used_flag
2871 2884
 
2872 2885
 				resp, requestErr := http.Get(api)
2873 2886
 				if requestErr != nil {
@@ -2900,7 +2913,7 @@ func (c *HisApiController) GetUploadInfo() {
2900 2913
 
2901 2914
 			} else {
2902 2915
 
2903
-				result2, src_resquest = service.Gdyb2207(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, strconv.FormatInt(reg_type, 10), his.IdCardType, tempOrder.FulamtOwnpayAmt, tempOrder.OverlmtSelfPay, tempOrder.PreselfpayAmt, tempOrder.InscpScpAmt, his.IdType)
2916
+				result2, src_resquest = service.Gdyb2207(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, strconv.FormatInt(reg_type, 10), his.IdCardType, tempOrder.FulamtOwnpayAmt, tempOrder.OverlmtSelfPay, tempOrder.PreselfpayAmt, tempOrder.InscpScpAmt, his.IdType, acct_used_flag)
2904 2917
 				var dat map[string]interface{}
2905 2918
 				if err := json.Unmarshal([]byte(result2), &dat); err == nil {
2906 2919
 					fmt.Println(dat)
@@ -4056,7 +4069,12 @@ func (c *HisApiController) GetPreUploadInfo() {
4056 4069
 						order.CvlservFlag = res.Output.Setlinfo.CvlservFlag
4057 4070
 						order.SetlTime = res.Output.Setlinfo.SetlTime
4058 4071
 						order.MdtrtCertType = res.Output.Setlinfo.MdtrtCertType
4059
-						order.MedType = res.Output.Setlinfo.MedType
4072
+						if res.Output.Setlinfo.MedType == "140101" {
4073
+							order.MedType = "14"
4074
+
4075
+						} else {
4076
+							order.MedType = res.Output.Setlinfo.MedType
4077
+						}
4060 4078
 						order.MedfeeSumamt = res.Output.Setlinfo.MedfeeSumamt
4061 4079
 						order.FulamtOwnpayAmt = res.Output.Setlinfo.FulamtOwnpayAmt
4062 4080
 						order.OverlmtSelfPay = res.Output.Setlinfo.OverlmtSelfpay

+ 2 - 1
main.go Näytä tiedosto

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

+ 8 - 8
service/gdyb_service.go Näytä tiedosto

@@ -1198,7 +1198,7 @@ func Gdyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
1198 1198
 }
1199 1199
 
1200 1200
 //  门诊结算
1201
-func Gdyb2207(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, med_type string, id_card_type int64, fulamt_ownpay_amt float64, overlmt_selfpay float64, preselfpay_amt float64, inscp_scp_amt float64, certificates int64) (string, string) {
1201
+func Gdyb2207(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, med_type string, id_card_type int64, fulamt_ownpay_amt float64, overlmt_selfpay float64, preselfpay_amt float64, inscp_scp_amt float64, certificates int64, acct_used_flag string) (string, string) {
1202 1202
 	// 生成签名
1203 1203
 	nonce := GetRandomString(32)
1204 1204
 	timestamp := time.Now().Unix()
@@ -1232,13 +1232,13 @@ func Gdyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
1232 1232
 	} else {
1233 1233
 		inputData["med_type"] = med_type // 医疗类别 11 普通门诊  12 门诊挂号
1234 1234
 	}
1235
-	inputData["medfee_sumamt"] = total  // 医疗费总额
1236
-	inputData["psn_setlway"] = "01"     // 个人结算方式 01 按项目结 02 按定额结算
1237
-	inputData["mdtrt_id"] = mdtrtId     // 就诊 ID(来自2201接口返回)
1238
-	inputData["chrg_bchno"] = chrgBchno // 收费批次号(来自2204生成的)
1239
-	inputData["acct_used_flag"] = "0"   // 个人账户使用标志 0否 1是
1240
-	inputData["insutype"] = insutype    // 险种类型
1241
-	inputData["invono"] = ""            // 发票号
1235
+	inputData["medfee_sumamt"] = total           // 医疗费总额
1236
+	inputData["psn_setlway"] = "01"              // 个人结算方式 01 按项目结 02 按定额结算
1237
+	inputData["mdtrt_id"] = mdtrtId              // 就诊 ID(来自2201接口返回)
1238
+	inputData["chrg_bchno"] = chrgBchno          // 收费批次号(来自2204生成的)
1239
+	inputData["acct_used_flag"] = acct_used_flag // 个人账户使用标志 0否 1是
1240
+	inputData["insutype"] = insutype             // 险种类型
1241
+	inputData["invono"] = ""                     // 发票号
1242 1242
 
1243 1243
 	inputData["fulamt_ownpay_amt"] = fulamt_ownpay_amt //
1244 1244
 	inputData["overlmt_selfpay"] = overlmt_selfpay     //