Browse Source

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

csx 2 years ago
parent
commit
d6e65c0ffa
3 changed files with 38 additions and 23 deletions
  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 View File

45
 
45
 
46
 
46
 
47
 [prod]
47
 [prod]
48
-org_id = 10106
48
+org_id = 10088
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
72
 #深圳
72
 #深圳
73
 # gdyb_paasid = "sz_prd_yjyy"
73
 # gdyb_paasid = "sz_prd_yjyy"
74
 #肇庆
74
 #肇庆
75
-# gdyb_paasid = "zq_prd_yjyy"
75
+gdyb_paasid = "zq_prd_yjyy"
76
 # gdyb_paasid = "sztest_hosp"
76
 # gdyb_paasid = "sztest_hosp"
77
 #广州
77
 #广州
78
 #gdyb_paasid = "gdyb_inf"
78
 #gdyb_paasid = "gdyb_inf"

+ 29 - 14
controllers/sg/his_api_controller.go View File

13113
 	var medfee_sumamt float64
13113
 	var medfee_sumamt float64
13114
 	var acct_pay float64
13114
 	var acct_pay float64
13115
 	var fund_pay_sumamt float64
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
 	for _, item := range orders {
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
 	var medfee_sumamt_two float64
13127
 	var medfee_sumamt_two float64
13123
 	var acct_pay_two float64
13128
 	var acct_pay_two float64
13124
 	var fund_pay_sumamt_two float64
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
 	for _, item := range orders_two {
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
 	//var user_name string
13140
 	//var user_name string
13139
 	if config.IsOpen == 1 {
13148
 	if config.IsOpen == 1 {
13140
 		var bps []models.BusinessParams
13149
 		var bps []models.BusinessParams
13141
 		var bp models.BusinessParams
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
 		bp.Insutype = "390"
13158
 		bp.Insutype = "390"
13146
 		bp.StmtBegndate = start_time
13159
 		bp.StmtBegndate = start_time
13147
 		bp.ClrType = clr_type
13160
 		bp.ClrType = clr_type
13149
 		bp.StmtEnddate = end_time
13162
 		bp.StmtEnddate = end_time
13150
 		bps = append(bps, bp)
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
 		var bp2 models.BusinessParams
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
 		bp2.Insutype = "310"
13173
 		bp2.Insutype = "310"
13157
 		bp2.StmtBegndate = start_time
13174
 		bp2.StmtBegndate = start_time
13158
 		bp2.StmtEnddate = end_time
13175
 		bp2.StmtEnddate = end_time
13189
 
13206
 
13190
 			respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
13207
 			respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
13191
 			userJSONBytes, _ := json.Marshal(respJSON)
13208
 			userJSONBytes, _ := json.Marshal(respJSON)
13192
-			fmt.Println("log")
13193
-			fmt.Println(string(userJSONBytes))
13194
 			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
13209
 			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
13195
 				utils.ErrorLog("解析失败:%v", err)
13210
 				utils.ErrorLog("解析失败:%v", err)
13196
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
13211
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)

+ 7 - 7
main.go View File

22
 
22
 
23
 func init() {
23
 func init() {
24
 	service.ConnectDB()
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
 func main() {
33
 func main() {
34
 	beego.Run()
34
 	beego.Run()