Ver código fonte

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

csx 1 ano atrás
pai
commit
d6e65c0ffa
3 arquivos alterados com 38 adições e 23 exclusões
  1. 2 2
      conf/app.conf
  2. 29 14
      controllers/sg/his_api_controller.go
  3. 7 7
      main.go

+ 2 - 2
conf/app.conf Ver arquivo

@@ -45,7 +45,7 @@ appsecret="61ee2e6268497d5aa9de0b0187c39aea"
45 45
 
46 46
 
47 47
 [prod]
48
-org_id = 10106
48
+org_id = 10088
49 49
 mobile_token_expiration_second = 86400
50 50
 httpdomain = https://api.xt.kuyicloud.com
51 51
 sso_domain = https://sso.kuyicloud.com
@@ -72,7 +72,7 @@ gdyb_url = "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/"
72 72
 #深圳
73 73
 # gdyb_paasid = "sz_prd_yjyy"
74 74
 #肇庆
75
-# gdyb_paasid = "zq_prd_yjyy"
75
+gdyb_paasid = "zq_prd_yjyy"
76 76
 # gdyb_paasid = "sztest_hosp"
77 77
 #广州
78 78
 #gdyb_paasid = "gdyb_inf"

+ 29 - 14
controllers/sg/his_api_controller.go Ver arquivo

@@ -13113,19 +13113,28 @@ func (c *HisApiController) Post3202() {
13113 13113
 	var medfee_sumamt float64
13114 13114
 	var acct_pay float64
13115 13115
 	var fund_pay_sumamt float64
13116
+
13117
+	var medfee_sumamt_str string
13118
+	var acct_pay_str string
13119
+	var fund_pay_sumamt_str string
13116 13120
 	for _, item := range orders {
13117
-		medfee_sumamt = medfee_sumamt + item.MedfeeSumamt
13118
-		acct_pay = acct_pay + item.AcctPay
13119
-		fund_pay_sumamt = fund_pay_sumamt + item.FundPaySumamt
13121
+		medfee_sumamt_str = fmt.Sprintf("%.4f", medfee_sumamt+item.MedfeeSumamt)
13122
+		acct_pay_str = fmt.Sprintf("%.4f", acct_pay+item.AcctPay)
13123
+		fund_pay_sumamt_str = fmt.Sprintf("%.4f", fund_pay_sumamt+item.FundPaySumamt)
13124
+
13120 13125
 	}
13121 13126
 
13122 13127
 	var medfee_sumamt_two float64
13123 13128
 	var acct_pay_two float64
13124 13129
 	var fund_pay_sumamt_two float64
13130
+
13131
+	var medfee_sumamt_two_str string
13132
+	var acct_pay_two_str string
13133
+	var fund_pay_sumamt_two_str string
13125 13134
 	for _, item := range orders_two {
13126
-		medfee_sumamt_two = medfee_sumamt_two + item.MedfeeSumamt
13127
-		acct_pay_two = acct_pay_two + item.AcctPay
13128
-		fund_pay_sumamt_two = fund_pay_sumamt_two + item.FundPaySumamt
13135
+		medfee_sumamt_two_str = fmt.Sprintf("%.4f", medfee_sumamt_two+item.MedfeeSumamt)
13136
+		acct_pay_two_str = fmt.Sprintf("%.4f", acct_pay_two+item.AcctPay)
13137
+		fund_pay_sumamt_two_str = fmt.Sprintf("%.4f", fund_pay_sumamt_two+item.FundPaySumamt)
13129 13138
 	}
13130 13139
 
13131 13140
 	//var user_name string
@@ -13139,9 +13148,13 @@ func (c *HisApiController) Post3202() {
13139 13148
 	if config.IsOpen == 1 {
13140 13149
 		var bps []models.BusinessParams
13141 13150
 		var bp models.BusinessParams
13142
-		bp.MedfeeSumamt = medfee_sumamt
13143
-		bp.AcctPay = acct_pay
13144
-		bp.FundPaySumamt = fund_pay_sumamt
13151
+		ms, _ := strconv.ParseFloat(medfee_sumamt_str, 64)
13152
+		ap, _ := strconv.ParseFloat(acct_pay_str, 64)
13153
+		fp, _ := strconv.ParseFloat(fund_pay_sumamt_str, 64)
13154
+
13155
+		bp.MedfeeSumamt = ms
13156
+		bp.AcctPay = ap
13157
+		bp.FundPaySumamt = fp
13145 13158
 		bp.Insutype = "390"
13146 13159
 		bp.StmtBegndate = start_time
13147 13160
 		bp.ClrType = clr_type
@@ -13149,10 +13162,14 @@ func (c *HisApiController) Post3202() {
13149 13162
 		bp.StmtEnddate = end_time
13150 13163
 		bps = append(bps, bp)
13151 13164
 
13165
+		mst, _ := strconv.ParseFloat(medfee_sumamt_two_str, 64)
13166
+		apt, _ := strconv.ParseFloat(acct_pay_two_str, 64)
13167
+		fpt, _ := strconv.ParseFloat(fund_pay_sumamt_two_str, 64)
13168
+
13152 13169
 		var bp2 models.BusinessParams
13153
-		bp2.MedfeeSumamt = medfee_sumamt_two
13154
-		bp2.AcctPay = acct_pay_two
13155
-		bp2.FundPaySumamt = fund_pay_sumamt_two
13170
+		bp2.MedfeeSumamt = mst
13171
+		bp2.AcctPay = apt
13172
+		bp2.FundPaySumamt = fpt
13156 13173
 		bp2.Insutype = "310"
13157 13174
 		bp2.StmtBegndate = start_time
13158 13175
 		bp2.StmtEnddate = end_time
@@ -13189,8 +13206,6 @@ func (c *HisApiController) Post3202() {
13189 13206
 
13190 13207
 			respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
13191 13208
 			userJSONBytes, _ := json.Marshal(respJSON)
13192
-			fmt.Println("log")
13193
-			fmt.Println(string(userJSONBytes))
13194 13209
 			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
13195 13210
 				utils.ErrorLog("解析失败:%v", err)
13196 13211
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)

+ 7 - 7
main.go Ver arquivo

@@ -22,13 +22,13 @@ import (
22 22
 
23 23
 func init() {
24 24
 	service.ConnectDB()
25
-	//org_id, _ := beego.AppConfig.Int64("org_id")
26
-	//miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
27
-	////CreateLog(miConfig)
28
-	////UploadLog(miConfig)
29
-	//if org_id == 10191 {
30
-	//	service.GetFjAuthorizationInfo(miConfig.Code)
31
-	//}
25
+	org_id, _ := beego.AppConfig.Int64("org_id")
26
+	miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
27
+	//CreateLog(miConfig)
28
+	//UploadLog(miConfig)
29
+	if org_id == 10191 {
30
+		service.GetFjAuthorizationInfo(miConfig.Code)
31
+	}
32 32
 }
33 33
 func main() {
34 34
 	beego.Run()