瀏覽代碼

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

XMLWAN 3 年之前
父節點
當前提交
f3894c65fc
共有 3 個文件被更改,包括 122 次插入7 次删除
  1. 2 2
      conf/app.conf
  2. 115 1
      controllers/sg/his_api_controller.go
  3. 5 4
      routers/router.go

+ 2 - 2
conf/app.conf 查看文件

@@ -1,6 +1,6 @@
1 1
 appname = 血透
2 2
 httpport = 9532
3
-runmode = dev
3
+runmode = prod
4 4
 
5 5
 #
6 6
 copyrequestbody = true
@@ -44,7 +44,7 @@ appsecret="61ee2e6268497d5aa9de0b0187c39aea"
44 44
 
45 45
 
46 46
 [prod]
47
-org_id = 3877
47
+org_id = 9919
48 48
 mobile_token_expiration_second = 86400
49 49
 httpdomain = https://api.xt.kuyicloud.com
50 50
 sso_domain = https://sso.kuyicloud.com

+ 115 - 1
controllers/sg/his_api_controller.go 查看文件

@@ -47,12 +47,15 @@ func HisManagerApiRegistRouters() {
47 47
 	beego.Router("/api/org/info", &HisApiController{}, "get:GetOrgInfo")
48 48
 	beego.Router("/api/testcard", &HisApiController{}, "get:TestGetBasBaseInfo")
49 49
 
50
-	beego.Router("/api/testpay", &HisApiController{}, "get:TestPay")
50
+	//beego.Router("/api/testpay", &HisApiController{}, "get:TestPay")
51 51
 
52 52
 	beego.Router("/api/pre_upload/get", &HisApiController{}, "get:GetPreUploadInfo")
53 53
 
54 54
 	beego.Router("/api/settle/get", &HisApiController{}, "get:GetSettleInfo")
55 55
 
56
+	beego.Router("/api/310", &HisApiController{}, "get:Check310")
57
+	beego.Router("/api/390", &HisApiController{}, "get:Check390")
58
+
56 59
 }
57 60
 
58 61
 //func (c *HisApiController) TestPay() {
@@ -2845,6 +2848,117 @@ func (c *HisApiController) GetCheckAccount() {
2845 2848
 	}
2846 2849
 }
2847 2850
 
2851
+func (c *HisApiController) Check310() {
2852
+
2853
+	adminUser := c.GetAdminUserInfo()
2854
+	miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
2855
+
2856
+	var user_name string
2857
+	user_name = "张俊杰"
2858
+	api := "http://127.0.0.1:9532/" + "gdyb/ten?" +
2859
+		"insutype=" + "310" +
2860
+		"&clr_type=" + "11" +
2861
+		"&setl_optins=" + "定点医保中心" +
2862
+		"&stmt_begndate=" + "2021-03-01" +
2863
+		"&stm_enddate=" + "2021-03-31" +
2864
+		"&medfee_sumamt=" + "11521" +
2865
+		"&fund_pay_sumamt=" + "10166.66" +
2866
+		"&acct_pay=" + "0" +
2867
+		"&fixmedins_setl_cnt=" + "7" +
2868
+		"&fixmedins_code=" + miConfig.Code +
2869
+		"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs +
2870
+		"&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
2871
+		"&secret_key=" + miConfig.SecretKey +
2872
+		"&org_name=" + miConfig.OrgName +
2873
+		"&doctor=" + user_name
2874
+
2875
+	fmt.Println(api)
2876
+	resp, requestErr := http.Get(api)
2877
+	if requestErr != nil {
2878
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2879
+		return
2880
+	}
2881
+	body, ioErr := ioutil.ReadAll(resp.Body)
2882
+	fmt.Println(body)
2883
+	if ioErr != nil {
2884
+		utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
2885
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2886
+		return
2887
+	}
2888
+	var respJSON map[string]interface{}
2889
+	if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
2890
+		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
2891
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2892
+		return
2893
+	}
2894
+
2895
+	respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
2896
+	userJSONBytes, _ := json.Marshal(respJSON)
2897
+
2898
+	var res ResultEight
2899
+	if err := json.Unmarshal(userJSONBytes, &res); err != nil {
2900
+		utils.ErrorLog("解析失败:%v", err)
2901
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2902
+		return
2903
+	}
2904
+
2905
+}
2906
+func (c *HisApiController) Check390() {
2907
+
2908
+	adminUser := c.GetAdminUserInfo()
2909
+	miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
2910
+
2911
+	var user_name string
2912
+	user_name = "张俊杰"
2913
+	api := "http://127.0.0.1:9532/" + "gdyb/ten?" +
2914
+		"insutype=" + "390" +
2915
+		"&clr_type=" + "11" +
2916
+		"&setl_optins=" + "定点医保中心" +
2917
+		"&stmt_begndate=" + "2021-03-01" +
2918
+		"&stm_enddate=" + "2021-03-31" +
2919
+		"&medfee_sumamt=" + "209318.43" +
2920
+		"&fund_pay_sumamt=" + "188029.12" +
2921
+		"&acct_pay=" + "0" +
2922
+		"&fixmedins_setl_cnt=" + "48" +
2923
+		"&fixmedins_code=" + miConfig.Code +
2924
+		"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs +
2925
+		"&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
2926
+		"&secret_key=" + miConfig.SecretKey +
2927
+		"&org_name=" + miConfig.OrgName +
2928
+		"&doctor=" + user_name
2929
+
2930
+	fmt.Println(api)
2931
+	resp, requestErr := http.Get(api)
2932
+	if requestErr != nil {
2933
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2934
+		return
2935
+	}
2936
+	body, ioErr := ioutil.ReadAll(resp.Body)
2937
+	fmt.Println(body)
2938
+	if ioErr != nil {
2939
+		utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
2940
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2941
+		return
2942
+	}
2943
+	var respJSON map[string]interface{}
2944
+	if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
2945
+		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
2946
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2947
+		return
2948
+	}
2949
+
2950
+	respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
2951
+	userJSONBytes, _ := json.Marshal(respJSON)
2952
+
2953
+	var res ResultEight
2954
+	if err := json.Unmarshal(userJSONBytes, &res); err != nil {
2955
+		utils.ErrorLog("解析失败:%v", err)
2956
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2957
+		return
2958
+	}
2959
+
2960
+}
2961
+
2848 2962
 //对账明细
2849 2963
 func (c *HisApiController) GetCheckDetailAccount() {
2850 2964
 	start_time := c.GetString("start_time")

+ 5 - 4
routers/router.go 查看文件

@@ -1,7 +1,8 @@
1 1
 package routers
2 2
 
3 3
 import (
4
-	"gdyb/controllers/sz"
4
+	"gdyb/controllers/sg"
5
+	//"gdyb/controllers/sz"
5 6
 	//"gdyb/controllers/sz"
6 7
 	//admin_api "XT_New/controllers/admin_api_controllers"
7 8
 	"github.com/astaxie/beego"
@@ -19,8 +20,8 @@ func init() {
19 20
 		AllowCredentials: true,
20 21
 	}))
21 22
 
22
-	//sg.HisManagerApiRegistRouters()
23
-	//sg.GdybRegistRouters()
24
-	sz.SZHisManagerApiRegistRouters()
23
+	sg.HisManagerApiRegistRouters()
24
+	sg.GdybRegistRouters()
25
+	//sz.SZHisManagerApiRegistRouters()
25 26
 
26 27
 }