|
@@ -80,6 +80,8 @@ func HisManagerApiRegistRouters() {
|
80
|
80
|
beego.Router("/api/check3101", &HisApiController{}, "get:Check3101")
|
81
|
81
|
beego.Router("/api/check3102", &HisApiController{}, "get:Check3102")
|
82
|
82
|
|
|
83
|
+ beego.Router("/90990", &HisApiController{}, "get:CheckCardPWDTwo")
|
|
84
|
+
|
83
|
85
|
}
|
84
|
86
|
func (c *HisApiController) Check3101() {
|
85
|
87
|
patient_id, _ := c.GetInt64("patient_id")
|
|
@@ -972,6 +974,93 @@ func (c *HisApiController) CheckCardPWD() {
|
972
|
974
|
}
|
973
|
975
|
|
974
|
976
|
}
|
|
977
|
+
|
|
978
|
+func (c *HisApiController) CheckCardPWDTwo() {
|
|
979
|
+ //card_pwd := c.GetString("card_pwd")
|
|
980
|
+ //his_patient_id, _ := c.GetInt64("his_patient_id")
|
|
981
|
+ admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
982
|
+ roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
|
983
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
|
984
|
+
|
|
985
|
+ result := service.Gdyb90991("44030000000629690364", miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, "000000", "220881198702101914")
|
|
986
|
+
|
|
987
|
+ var dat map[string]interface{}
|
|
988
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
989
|
+ fmt.Println(dat)
|
|
990
|
+ } else {
|
|
991
|
+ fmt.Println(err)
|
|
992
|
+ }
|
|
993
|
+
|
|
994
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
995
|
+ var res Result90991
|
|
996
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
997
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
998
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
999
|
+ return
|
|
1000
|
+ }
|
|
1001
|
+
|
|
1002
|
+ if res.Infcode != 0 {
|
|
1003
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1004
|
+ "failed_code": -10,
|
|
1005
|
+ "msg": res.ErrMsg,
|
|
1006
|
+ })
|
|
1007
|
+ return
|
|
1008
|
+ } else {
|
|
1009
|
+ if res.Output.Result.SscnoCheckStat == "0" {
|
|
1010
|
+ var msg string
|
|
1011
|
+ switch res.Output.Result.CardStat {
|
|
1012
|
+ case "00":
|
|
1013
|
+ msg = "未激活"
|
|
1014
|
+ break
|
|
1015
|
+ case "10":
|
|
1016
|
+ msg = "激活"
|
|
1017
|
+ break
|
|
1018
|
+ case "20":
|
|
1019
|
+ msg = "窗口挂失"
|
|
1020
|
+ break
|
|
1021
|
+ case "21":
|
|
1022
|
+ msg = "电话挂失"
|
|
1023
|
+ break
|
|
1024
|
+ case "22":
|
|
1025
|
+ msg = "单位网上申报挂失"
|
|
1026
|
+ break
|
|
1027
|
+ case "23":
|
|
1028
|
+ msg = "保健办挂失"
|
|
1029
|
+
|
|
1030
|
+ break
|
|
1031
|
+ case "24":
|
|
1032
|
+ msg = "个人网上挂失"
|
|
1033
|
+
|
|
1034
|
+ break
|
|
1035
|
+ case "25":
|
|
1036
|
+ msg = "网上服务大厅挂失"
|
|
1037
|
+ break
|
|
1038
|
+ case "30":
|
|
1039
|
+ msg = "注销"
|
|
1040
|
+ break
|
|
1041
|
+ case "40":
|
|
1042
|
+ msg = "回收"
|
|
1043
|
+ break
|
|
1044
|
+ case "99":
|
|
1045
|
+ msg = "制卡中(无效卡)"
|
|
1046
|
+ break
|
|
1047
|
+ }
|
|
1048
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1049
|
+ "failed_code": -10,
|
|
1050
|
+ "msg": msg,
|
|
1051
|
+ })
|
|
1052
|
+ return
|
|
1053
|
+
|
|
1054
|
+ } else {
|
|
1055
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1056
|
+ "msg": "校验成功",
|
|
1057
|
+ })
|
|
1058
|
+ return
|
|
1059
|
+ }
|
|
1060
|
+ }
|
|
1061
|
+
|
|
1062
|
+}
|
|
1063
|
+
|
975
|
1064
|
func (c *HisApiController) ReadCard() {
|
976
|
1065
|
id_card_type, _ := c.GetInt64("id_card_type")
|
977
|
1066
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
@@ -9033,6 +9122,60 @@ func (c *HisApiController) GetCheckAccount() {
|
9033
|
9122
|
infocode, _ := strconv.ParseInt(res10188.Infcode, 10, 64)
|
9034
|
9123
|
res.Infcode = infocode
|
9035
|
9124
|
|
|
9125
|
+ } else if miConfig.MdtrtareaAdmvs == "150499" {
|
|
9126
|
+
|
|
9127
|
+ api := "http://172.16.13.254:9532/" + "nmyb/3201?" +
|
|
9128
|
+ "insutype=" + insutype +
|
|
9129
|
+ "&clr_type=" + "11" +
|
|
9130
|
+ "&setl_optins=" + clr_org +
|
|
9131
|
+ "&stmt_begndate=" + start_time +
|
|
9132
|
+ "&stm_enddate=" + end_time +
|
|
9133
|
+ "&medfee_sumamt=" + fmt.Sprintf("%.4f", medfee_sumamt) +
|
|
9134
|
+ "&fund_pay_sumamt=" + fmt.Sprintf("%.4f", fund_pay_sumamt) +
|
|
9135
|
+ "&acct_pay=" + fmt.Sprintf("%.4f", acct_pay) +
|
|
9136
|
+ "&fixmedins_setl_cnt=" + strconv.FormatInt(fixmedins_setl_cnt, 10) +
|
|
9137
|
+ "&fixmedins_code=" + miConfig.Code +
|
|
9138
|
+ "&insuplc_admdvs=" + miConfig.InsuplcAdmdvs +
|
|
9139
|
+ "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
|
|
9140
|
+ "&secret_key=" + miConfig.SecretKey +
|
|
9141
|
+ "&org_name=" + miConfig.OrgName +
|
|
9142
|
+ "&doctor=" + user_name
|
|
9143
|
+ resp, requestErr := http.Get(api)
|
|
9144
|
+ if requestErr != nil {
|
|
9145
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
9146
|
+ return
|
|
9147
|
+ }
|
|
9148
|
+ body, ioErr := ioutil.ReadAll(resp.Body)
|
|
9149
|
+ if ioErr != nil {
|
|
9150
|
+ utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
|
|
9151
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
9152
|
+ return
|
|
9153
|
+ }
|
|
9154
|
+ var respJSON map[string]interface{}
|
|
9155
|
+ if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
|
|
9156
|
+ utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
9157
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
9158
|
+ return
|
|
9159
|
+ }
|
|
9160
|
+
|
|
9161
|
+ respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
|
|
9162
|
+ result, _ := json.Marshal(respJSON)
|
|
9163
|
+ fmt.Println("log")
|
|
9164
|
+ fmt.Println(string(result))
|
|
9165
|
+ if err := json.Unmarshal([]byte(result), &res10188); err != nil {
|
|
9166
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
9167
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
9168
|
+ return
|
|
9169
|
+ }
|
|
9170
|
+
|
|
9171
|
+ res.InfRefmsgid = res10188.InfRefmsgid
|
|
9172
|
+ res.Output = res10188.Output
|
|
9173
|
+ res.ErrMsg = res10188.ErrMsg
|
|
9174
|
+ res.Cainfo = res10188.Cainfo
|
|
9175
|
+ res.WarnMsg = res10188.WarnMsg
|
|
9176
|
+ infocode, _ := strconv.ParseInt(res10188.Infcode, 10, 64)
|
|
9177
|
+ res.Infcode = infocode
|
|
9178
|
+
|
9036
|
9179
|
} else {
|
9037
|
9180
|
api := "http://127.0.0.1:9532/" + "gdyb/ten?" +
|
9038
|
9181
|
"insutype=" + insutype +
|
|
@@ -9103,7 +9246,6 @@ func (c *HisApiController) GetCheckAccount() {
|
9103
|
9246
|
"stmt_rslt": res.Output.Stmtinfo.StmtRslt,
|
9104
|
9247
|
"stmt_rslt_dscr": res.Output.Stmtinfo.StmtRsltDscr,
|
9105
|
9248
|
})
|
9106
|
|
-
|
9107
|
9249
|
} else {
|
9108
|
9250
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
9109
|
9251
|
}
|