Kaynağa Gözat

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

csx 3 yıl önce
ebeveyn
işleme
2162843fb7

+ 3 - 7
controllers/sg/his_api_controller.go Dosyayı Görüntüle

@@ -48,18 +48,12 @@ func HisManagerApiRegistRouters() {
48 48
 	//beego.Router("/api/patient/info", &HisApiController{}, "get:GetHisPatientInfo")
49 49
 	beego.Router("/api/org/info", &HisApiController{}, "get:GetOrgInfo")
50 50
 	//beego.Router("/api/testcard", &HisApiController{}, "get:TestGetBasBaseInfo")
51
-
52 51
 	beego.Router("/api/readcard", &HisApiController{}, "get:ReadCard")
53
-
54 52
 	//beego.Router("/api/testpay", &HisApiController{}, "get:TestPay")
55 53
 	beego.Router("/api/presettle/get", &HisApiController{}, "get:GetPreUploadInfo")
56
-
57 54
 	//beego.Router("/api/settle/get", &HisApiController{}, "get:GetSettleInfo")
58
-
59 55
 	beego.Router("/api/310", &HisApiController{}, "get:Check310")
60
-
61 56
 	beego.Router("/api/390", &HisApiController{}, "get:Check390")
62
-
63 57
 	beego.Router("/api/patient/info", &HisApiController{}, "get:GetPatientInfo")
64 58
 	//备案撤销相关接口
65 59
 	beego.Router("/api/checkcode/get", &HisApiController{}, "get:GetCheckCode")
@@ -6396,6 +6390,8 @@ func (c *HisApiController) GetCheckAccount() {
6396 6390
 	end_time := c.GetString("end_time")
6397 6391
 	insutype := c.GetString("insutype")
6398 6392
 	clr_type := c.GetString("clr_type")
6393
+	clr_org := c.GetString("clr_optins")
6394
+
6399 6395
 	admin_user_id, _ := c.GetInt64("admin_user_id")
6400 6396
 
6401 6397
 	adminUser := c.GetAdminUserInfo()
@@ -6406,7 +6402,7 @@ func (c *HisApiController) GetCheckAccount() {
6406 6402
 	loc, _ := time.LoadLocation("Local")
6407 6403
 	startime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
6408 6404
 	endtime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
6409
-	orders, _ := service.GetOrderByTime(startime.Unix(), endtime.Unix(), adminUser.CurrentOrgId, insutype, clr_type)
6405
+	orders, _ := service.GetOrderByTime(startime.Unix(), endtime.Unix(), adminUser.CurrentOrgId, insutype, clr_org)
6410 6406
 	//orders_two, _ := service.GetOrderByTimeThree(startime.Unix(), endtime.Unix(), adminUser.CurrentOrgId, insutype, clr_type)
6411 6407
 	fixmedins_setl_cnt := int64(len(orders))
6412 6408
 	//

+ 3 - 1
controllers/zh/zh_his_api_controller.go Dosyayı Görüntüle

@@ -622,7 +622,9 @@ func (c *ZHHisApiController) GetZHInHospitalCheck() {
622 622
 
623 623
 	miConfig, _ := service.FindMedicalInsuranceInfo(adminInfo.CurrentOrgId)
624 624
 	role, _ := service.GetAdminUserInfoByID(adminInfo.CurrentOrgId, admin_user_id)
625
-	result := service.ZHGdyb1101(patient.IdCardNo, miConfig.OrgName, role.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, "", certificates, name)
625
+	result, request_log, result_log := service.ZHGdyb1101(patient.IdCardNo, miConfig.OrgName, role.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, "", certificates, name)
626
+	fmt.Println(request_log)
627
+	fmt.Println(result_log)
626 628
 
627 629
 	doctorInfo, _ := service.GetAdminUserInfoByID(adminInfo.CurrentOrgId, doctor)
628 630
 

+ 6 - 2
service/his_service.go Dosyayı Görüntüle

@@ -964,8 +964,12 @@ func GetHisOrderInfoByNumberThree(order_number string) (order []*models.HisOrder
964 964
 	return
965 965
 }
966 966
 
967
-func GetOrderByTime(start_time int64, end_time int64, org_id int64, insutype string, clr_type string) (orders []*models.HisOrder, err error) {
968
-	err = readDb.Model(&models.HisOrder{}).Where("user_org_id = ? AND status = 1 AND order_status = 2 AND is_medicine_insurance = 1 AND UNIX_TIMESTAMP(setl_time)  <= ? AND UNIX_TIMESTAMP(setl_time) >= ? AND insutype = ?", org_id, end_time, start_time, insutype).Find(&orders).Error
967
+func GetOrderByTime(start_time int64, end_time int64, org_id int64, insutype string, clr_org string) (orders []*models.HisOrder, err error) {
968
+	if len(clr_org) > 0 {
969
+		err = readDb.Model(&models.HisOrder{}).Where("user_org_id = ? AND status = 1 AND order_status = 2 AND is_medicine_insurance = 1 AND UNIX_TIMESTAMP(setl_time)  <= ? AND UNIX_TIMESTAMP(setl_time) >= ? AND insutype = ? AND clr_org = ?", org_id, end_time, start_time, insutype, clr_org).Find(&orders).Error
970
+	} else {
971
+		err = readDb.Model(&models.HisOrder{}).Where("user_org_id = ? AND status = 1 AND order_status = 2 AND is_medicine_insurance = 1 AND UNIX_TIMESTAMP(setl_time)  <= ? AND UNIX_TIMESTAMP(setl_time) >= ? AND insutype = ? ", org_id, end_time, start_time, insutype).Find(&orders).Error
972
+	}
969 973
 	return
970 974
 }
971 975
 

+ 10 - 6
service/zh_his_service.go Dosyayı Görüntüle

@@ -15,8 +15,10 @@ import (
15 15
 )
16 16
 
17 17
 // 人员基本信息
18
-func ZHGdyb1101(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, id_card_type int64, card_sn string, certificates int64, name string) string {
18
+func ZHGdyb1101(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, id_card_type int64, card_sn string, certificates int64, name string) (string, string, string) {
19 19
 	//生成签名
20
+	var requestLog string
21
+	var resultLog string
20 22
 	nonce := GetRandomString(32)
21 23
 	timestamp := time.Now().Unix()
22 24
 	signature := setSignature(timestamp, nonce, secret_key)
@@ -54,9 +56,10 @@ func ZHGdyb1101(certNo string, org_name string, doctor string, fixmedins_code st
54 56
 
55 57
 	bytesData, err := json.Marshal(inputMessage)
56 58
 	fmt.Println(string(bytesData))
59
+	requestLog = string(bytesData)
57 60
 	if err != nil {
58 61
 		fmt.Println(err.Error())
59
-		return err.Error()
62
+		return err.Error(), "", ""
60 63
 	}
61 64
 	reader := bytes.NewReader(bytesData)
62 65
 	gdyb_url := beego.AppConfig.String("gdyb_url")
@@ -71,7 +74,7 @@ func ZHGdyb1101(certNo string, org_name string, doctor string, fixmedins_code st
71 74
 	request, err := http.NewRequest("POST", url, reader)
72 75
 	if err != nil {
73 76
 		fmt.Println(err.Error())
74
-		return err.Error()
77
+		return err.Error(), "", ""
75 78
 	}
76 79
 
77 80
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
@@ -84,16 +87,17 @@ func ZHGdyb1101(certNo string, org_name string, doctor string, fixmedins_code st
84 87
 	resp, err := client.Do(request)
85 88
 	if err != nil {
86 89
 		fmt.Println(err.Error())
87
-		return err.Error()
90
+		return err.Error(), "", ""
88 91
 	}
89 92
 	respBytes, err := ioutil.ReadAll(resp.Body)
90 93
 	if err != nil {
91 94
 		fmt.Println(err.Error())
92
-		return err.Error()
95
+		return err.Error(), "", ""
93 96
 	}
94 97
 	fmt.Println(string(respBytes))
95 98
 	str := string(respBytes)
96
-	return str
99
+	resultLog = str
100
+	return str, requestLog, resultLog
97 101
 }
98 102
 
99 103
 type DiseinfoStruct struct {