Sfoglia il codice sorgente

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

csx 3 anni fa
parent
commit
aa6ba98def
3 ha cambiato i file con 15 aggiunte e 17 eliminazioni
  1. 1 1
      controllers/js/jsyb_controller.go
  2. 6 6
      main.go
  3. 8 10
      service/jsyb_service.go

+ 1 - 1
controllers/js/jsyb_controller.go Vedi File

@@ -252,7 +252,7 @@ func (c *JSybController) PostFive() {
252 252
 	}
253 253
 	//fmt.Println("2203A的time_stamp=" + respJSON["time_stamp"].(string))
254 254
 	result, request_log := service.Jsyb2204(respJSON["psn_no"].(string), respJSON["mdtrt_id"].(string), hp, respJSON["chrg_bchno"].(string), respJSON["org_name"].(string),
255
-		respJSON["doctor"].(string), respJSON["dept"].(string), respJSON["fixmedins_code"].(string), respJSON["dept_code"].(string), respJSON["doctor_id"].(string), respJSON["insuplc_admdvs"].(string), respJSON["mdtrtarea_admvs"].(string), respJSON["diag_code"].(string), respJSON["secret_key"].(string), respJSON["balance_accounts_type"].(string), respJSON["url"].(string), respJSON["ak"].(string), respJSON["new_doctor_name"].(string), "")
255
+		respJSON["doctor"].(string), respJSON["dept"].(string), respJSON["fixmedins_code"].(string), respJSON["dept_code"].(string), respJSON["doctor_id"].(string), respJSON["insuplc_admdvs"].(string), respJSON["mdtrtarea_admvs"].(string), respJSON["secret_key"].(string), respJSON["balance_accounts_type"].(string), respJSON["diag_code"].(string), respJSON["url"].(string), respJSON["ak"].(string), respJSON["new_doctor_name"].(string), "")
256 256
 
257 257
 	var dat map[string]interface{}
258 258
 	if err := json.Unmarshal([]byte(result), &dat); err == nil {

+ 6 - 6
main.go Vedi File

@@ -7,7 +7,7 @@ import (
7 7
 	_ "gdyb/routers"
8 8
 	"gdyb/service"
9 9
 
10
-	//"gdyb/service"
10
+	"gdyb/service"
11 11
 	"github.com/astaxie/beego"
12 12
 	"github.com/qiniu/api.v7/auth/qbox"
13 13
 	"github.com/qiniu/api.v7/storage"
@@ -17,11 +17,11 @@ import (
17 17
 )
18 18
 
19 19
 func init() {
20
-	service.ConnectDB()
21
-	org_id, _ := beego.AppConfig.Int64("org_id")
22
-	miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
23
-	CreateLog(miConfig)
24
-	UploadLog(miConfig)
20
+	//service.ConnectDB()
21
+	//org_id, _ := beego.AppConfig.Int64("org_id")
22
+	//miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
23
+	//CreateLog(miConfig)
24
+	//UploadLog(miConfig)
25 25
 
26 26
 }
27 27
 func main() {

+ 8 - 10
service/jsyb_service.go Vedi File

@@ -305,13 +305,14 @@ func Jsyb2203A(psnNo string, mdtrtId string, doctor string, department string, o
305 305
 //  门诊费用明细信息上传
306 306
 func Jsyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescription, chrg_bchno string, org_name string, doctor string, dept string, fixmedins_code string, dept_code string, doctor_id string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, balance_accounts_type string, diag_code string, request_url string, access_key string, new_doctor_name string, time_stamp_2203 string) (string, string) {
307 307
 	// 生成签名
308
+	//timestamp := time.Now().Unix()
308 309
 	timestamp := time.Now().Unix()
309
-	tempTime := time.Unix(timestamp, 0)
310
-	//timeFormat := tempTime.Format("20060102150405")
310
+
311
+	timestamp2 := time.Now().Unix()
312
+
313
+	tempTime := time.Unix(timestamp2, 0)
311 314
 	timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
312
-	//chrgBchno := rand.Intn(100000) + 10000
313 315
 	var customs []*Custom
314
-
315 316
 	for _, item := range hisPrescription {
316 317
 
317 318
 		if item.Type == 1 { //药品
@@ -405,7 +406,7 @@ func Jsyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
405 406
 	}
406 407
 
407 408
 	// 生成输入报文
408
-	inputMessage := SetJSInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
409
+	inputMessage := SetJSInputMessage(timestamp2, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
409 410
 	input := make(map[string]interface{})
410 411
 	feedetail := make([]map[string]interface{}, 0)
411 412
 	inputMessage["infno"] = "2204" // 交易编码
@@ -469,21 +470,18 @@ func Jsyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
469 470
 		feedetailInfo["expContent"] = subfeedetailInfo
470 471
 		feedetail = append(feedetail, feedetailInfo)
471 472
 	}
473
+
472 474
 	input["feedetail"] = feedetail
473 475
 	inputMessage["input"] = input //交易输入
474 476
 	var requestLog string
475 477
 	bytesData, err := json.Marshal(inputMessage)
476
-	fmt.Println("----------")
477
-	fmt.Println(string(bytesData))
478
-	fmt.Println("----------")
479
-	requestLog = string(bytesData)
478
+
480 479
 	if err != nil {
481 480
 		fmt.Println(err.Error())
482 481
 		return "", ""
483 482
 	}
484 483
 
485 484
 	request_url = request_url + "2204"
486
-	//time_stamp, _ := strconv.ParseInt(time_stamp_2203, 10, 64)
487 485
 	return HttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData)), requestLog
488 486
 }
489 487