gdyb_controller.go 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. package sg
  2. import (
  3. "encoding/json"
  4. "fmt"
  5. "gdyb/controllers"
  6. "gdyb/models"
  7. "gdyb/service"
  8. "gdyb/utils"
  9. "github.com/astaxie/beego"
  10. "io/ioutil"
  11. )
  12. type GdybController struct {
  13. controllers.BaseAuthAPIController
  14. }
  15. func GdybRegistRouters() {
  16. beego.Router("/gdyb/one", &GdybController{}, "get:PostOne")
  17. beego.Router("/gdyb/two", &GdybController{}, "get:PostTwo")
  18. beego.Router("/gdyb/three", &GdybController{}, "get:PostThree")
  19. //beego.Router("/gdyb/four", &GdybController{}, "get:PostFour")
  20. //beego.Router("/gdyb/five", &GdybController{}, "post:PostFive")
  21. beego.Router("/gdyb/six", &GdybController{}, "get:PostSix")
  22. //beego.Router("/gdyb/seven", &GdybController{}, "get:PostSeven")
  23. beego.Router("/gdyb/eight", &GdybController{}, "get:PostEight")
  24. //beego.Router("/gdyb/nine", &GdybController{}, "get:PostNine")
  25. beego.Router("/gdyb/ten", &GdybController{}, "get:PostTen")
  26. beego.Router("/gdyb/eleven", &GdybController{}, "get:PostEleven")
  27. beego.Router("/gdyb/twelve", &GdybController{}, "get:PostTwelve")
  28. beego.Router("/gdyb/zh/five", &GdybController{}, "post:PostZHFive")
  29. }
  30. type Result struct {
  31. ErrMsg interface{} `json:"err_msg"`
  32. InfRefmsgid string `json:"inf_refmsgid"`
  33. Infcode int64 `json:"infcode"`
  34. Output struct {
  35. Baseinfo struct {
  36. Age float64 `json:"age"`
  37. Brdy string `json:"brdy"`
  38. Certno string `json:"certno"`
  39. Gend string `json:"gend"`
  40. Naty string `json:"naty"`
  41. PsnCertType string `json:"psn_cert_type"`
  42. PsnName string `json:"psn_name"`
  43. PsnNo string `json:"psn_no"`
  44. } `json:"baseinfo"`
  45. Idetinfo []interface{} `json:"idetinfo"`
  46. Iinfo []struct {
  47. Balc int64 `json:"balc"`
  48. CvlservFlag string `json:"cvlserv_flag"`
  49. EmpName string `json:"emp_name"`
  50. InsuplcAdmdvs string `json:"insuplc_admdvs"`
  51. Insutype string `json:"insutype"`
  52. PausInsuDansuplcAdmdvs string `json:"paus_insu_dansuplc_admdvs"`
  53. PausInsuDate interface{} `json:"paus_insu_date"`
  54. PsnInsuDate string `json:"psn_insu_date"`
  55. PsnInsuStas string `json:"psn_insu_stas"`
  56. PsnType string `json:"psn_type"`
  57. } `json:"iinfo"`
  58. } `json:"output"`
  59. RefmsgTime string `json:"refmsg_time"`
  60. RespondTime string `json:"respond_time"`
  61. Signtype interface{} `json:"signtype"`
  62. WarnInfo interface{} `json:"warn_info"`
  63. }
  64. func (c *GdybController) PostOne() {
  65. certNo := c.GetString("cert_no")
  66. org_name := c.GetString("org_name")
  67. doctor := c.GetString("doctor")
  68. fixmedins_code := c.GetString("fixmedins_code")
  69. insuplc_admdvs := c.GetString("insuplc_admdvs")
  70. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  71. secret_key := c.GetString("secret_key")
  72. id_card_type, _ := c.GetInt64("id_card_type")
  73. card_sn := c.GetString("card_sn")
  74. certificates := c.GetString("certificates")
  75. psn_name := c.GetString("name")
  76. result, inputLog := service.Gdyb1101(certNo, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type, card_sn, certificates, psn_name)
  77. var dat map[string]interface{}
  78. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  79. } else {
  80. }
  81. var dat2 map[string]interface{}
  82. if err := json.Unmarshal([]byte(inputLog), &dat2); err == nil {
  83. } else {
  84. }
  85. c.ServeSuccessJSON(map[string]interface{}{
  86. "pre": dat,
  87. "log": dat2,
  88. })
  89. }
  90. func (c *GdybController) PostTwo() {
  91. psnNo := c.GetString("psn_no")
  92. insutype := c.GetString("insutype")
  93. certNo := c.GetString("cert_no")
  94. org_name := c.GetString("org_name")
  95. doctor := c.GetString("doctor")
  96. ipt_otp_no := c.GetString("ipt_otp_no")
  97. dept := c.GetString("dept")
  98. fixmedins_code := c.GetString("fixmedins_code")
  99. dept_code := c.GetString("dept_code")
  100. doctor_id := c.GetString("doctor_id")
  101. insuplc_admdvs := c.GetString("insuplc_admdvs")
  102. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  103. secret_key := c.GetString("secret_key")
  104. id_card_type, _ := c.GetInt64("id_card_type")
  105. result, _ := service.Gdyb2201(psnNo, insutype, certNo, org_name, doctor, ipt_otp_no, dept, fixmedins_code, dept_code, doctor_id, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type, "")
  106. var dat map[string]interface{}
  107. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  108. } else {
  109. }
  110. c.ServeSuccessJSON(map[string]interface{}{
  111. "pre": dat,
  112. })
  113. }
  114. func (c *GdybController) PostThree() {
  115. psnNo := c.GetString("psn_no")
  116. mdtrtId := c.GetString("mdtrt_id")
  117. iptOtpNo := c.GetString("ipt_otp_no")
  118. org_name := c.GetString("org_name")
  119. doctor := c.GetString("doctor")
  120. insuplc_admdvs := c.GetString("insuplc_admdvs")
  121. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  122. secret_key := c.GetString("secret_key")
  123. fixmedins_code := c.GetString("fixmedins_code")
  124. result, requestLog := service.Gdyb2202(psnNo, mdtrtId, iptOtpNo, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code)
  125. saveLog(result, requestLog, "2202", "退号")
  126. var dat map[string]interface{}
  127. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  128. } else {
  129. }
  130. c.ServeSuccessJSON(map[string]interface{}{
  131. "pre": dat,
  132. })
  133. }
  134. //func (c *GdybController) PostFour() {
  135. // psnNo := c.GetString("psn_no")
  136. // mdtrtId := c.GetString("mdtrt_id")
  137. // doctor := c.GetString("doctor")
  138. // department := c.GetString("department")
  139. // diag := c.GetString("diag")
  140. // org_name := c.GetString("org_name")
  141. // med_type := c.GetString("med_type")
  142. // doctor_id, _ := c.GetInt64("doctor_id", 0)
  143. // fixmedins_code := c.GetString("fixmedins_code")
  144. // diag_code := c.GetString("diag_code")
  145. // sick_code := c.GetString("sick_code")
  146. // sick_name := c.GetString("sick_name")
  147. // dept := c.GetString("dept")
  148. //
  149. // insuplc_admdvs := c.GetString("insuplc_admdvs")
  150. // mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  151. // secret_key := c.GetString("secret_key")
  152. //
  153. // var result string
  154. // if insuplc_admdvs == "440781" { //
  155. // result = service.Gdyb2203A(psnNo, mdtrtId, doctor, department, diag, org_name, med_type, doctor_id, fixmedins_code, diag_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, sick_code, sick_name, dept)
  156. // } else {
  157. // result = service.Gdyb2203(psnNo, mdtrtId, doctor, department, diag, org_name, med_type, doctor_id, fixmedins_code, diag_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, sick_code, sick_name, dept)
  158. // }
  159. // var dat map[string]interface{}
  160. // if err := json.Unmarshal([]byte(result), &dat); err == nil {
  161. //
  162. // } else {
  163. //
  164. // }
  165. // c.ServeSuccessJSON(map[string]interface{}{
  166. // "pre": dat,
  167. // })
  168. //}
  169. type All struct {
  170. HisPrescription HisPrescription
  171. mdtrt_id string
  172. psn_no string
  173. }
  174. type HisPrescription struct {
  175. ID int64 `gorm:"column:id" json:"id" form:"id"`
  176. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  177. RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
  178. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  179. HisPatientId int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
  180. Status int64 `gorm:"column:status" json:"status" form:"status"`
  181. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  182. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  183. Number string `gorm:"column:number" json:"number" form:"number"`
  184. Type int64 `gorm:"column:type" json:"type" form:"type"`
  185. Doctor int64 `gorm:"column:doctor" json:"doctor" form:"doctor"`
  186. Creator int64 `gorm:"column:creator" json:"creator" form:"creator"`
  187. Modifier int64 `gorm:"column:modifier" json:"modifier" form:"modifier"`
  188. HisDoctorAdviceInfo []*models.HisDoctorAdviceInfo `gorm:"ForeignKey:PatientId,RecordDate,PrescriptionId;AssociationForeignKey:PatientId,RecordDate,ID" json:"advices"`
  189. HisPrescriptionProject []*models.HisPrescriptionProject `gorm:"ForeignKey:PatientId,RecordDate,PrescriptionId;AssociationForeignKey:PatientId,RecordDate,ID" json:"project"`
  190. }
  191. //func (c *GdybController) PostFive() {
  192. // body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  193. // var respJSON map[string]interface{}
  194. // if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  195. // utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  196. // return
  197. // }
  198. // userJSONBytes, _ := json.Marshal(respJSON["pre"])
  199. // var hp []*models.HisPrescription
  200. // if err := json.Unmarshal(userJSONBytes, &hp); err != nil {
  201. // utils.ErrorLog("解析失败:%v", err)
  202. // return
  203. // }
  204. // fmt.Println(respJSON["psn_no"].(string))
  205. // fmt.Println(respJSON["mdtrt_id"].(string))
  206. //
  207. // fmt.Println(respJSON["chrg_bchno"].(string))
  208. // fmt.Println(respJSON["org_name"].(string))
  209. // fmt.Println(respJSON["doctor"].(string))
  210. // fmt.Println(respJSON["dept"].(string))
  211. //
  212. // fmt.Println(respJSON["fixmedins_code"].(string))
  213. // fmt.Println(respJSON["dept_code"].(string))
  214. // fmt.Println(respJSON["doctor_id"].(string))
  215. //
  216. // fmt.Println(respJSON["insuplc_admdvs"].(string))
  217. // fmt.Println(respJSON["mdtrtarea_admvs"].(string))
  218. // fmt.Println(respJSON["secret_key"].(string))
  219. //
  220. // result, requestLog := service.Gdyb2204(respJSON["psn_no"].(string), respJSON["mdtrt_id"].(string), hp, respJSON["chrg_bchno"].(string), respJSON["org_name"].(string),
  221. // 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))
  222. //
  223. // var dat map[string]interface{}
  224. // if err := json.Unmarshal([]byte(result), &dat); err == nil {
  225. // fmt.Println(dat)
  226. // } else {
  227. // fmt.Println(err)
  228. // }
  229. //
  230. // var dat2 map[string]interface{}
  231. // if err := json.Unmarshal([]byte(requestLog), &dat2); err == nil {
  232. // fmt.Println(dat2)
  233. // } else {
  234. // fmt.Println(err)
  235. // }
  236. //
  237. // c.ServeSuccessJSON(map[string]interface{}{
  238. // "pre": dat,
  239. // "request_log": requestLog,
  240. // })
  241. //}
  242. func (c *GdybController) PostSix() {
  243. psnNo := c.GetString("psn_no")
  244. mdtrtId := c.GetString("mdtrt_id")
  245. chrgBchno := c.GetString("chrg_bchno")
  246. org_name := c.GetString("org_name")
  247. doctor := c.GetString("doctor")
  248. insuplc_admdvs := c.GetString("insuplc_admdvs")
  249. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  250. secret_key := c.GetString("secret_key")
  251. fixmedins_code := c.GetString("fixmedins_code")
  252. result, requestlog := service.Gdyb2205(psnNo, mdtrtId, chrgBchno, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code)
  253. fmt.Println(requestlog)
  254. var dat map[string]interface{}
  255. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  256. fmt.Println(dat)
  257. } else {
  258. fmt.Println(err)
  259. }
  260. c.ServeSuccessJSON(map[string]interface{}{
  261. "pre": result,
  262. })
  263. }
  264. //func (c *GdybController) PostSeven() {
  265. // psnNo := c.GetString("psn_no")
  266. // mdtrtId := c.GetString("mdtrt_id")
  267. // chrgBchno := c.GetString("chrg_bchno")
  268. // certNo := c.GetString("cert_no")
  269. // insutype := c.GetString("insutype")
  270. // total := c.GetString("total")
  271. // org_name := c.GetString("org_name")
  272. // doctor := c.GetString("doctor")
  273. // fixmedins_code := c.GetString("fixmedins_code")
  274. // insuplc_admdvs := c.GetString("insuplc_admdvs")
  275. // mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  276. // secret_key := c.GetString("secret_key")
  277. // med_type := c.GetString("med_type")
  278. // id_card_type, _ := c.GetInt64("id_card_type")
  279. //
  280. // //result := service.Gdyb2206(psnNo/**/, mdtrtId, chrgBchno, certNo, insutype, total, org_name, doctor, secret_key)
  281. //
  282. // result := service.Gdyb2206(psnNo, mdtrtId, chrgBchno, certNo, insutype, total, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, med_type, id_card_type)
  283. //
  284. // var dat map[string]interface{}
  285. // if err := json.Unmarshal([]byte(result), &dat); err == nil {
  286. // fmt.Println(dat)
  287. // } else {
  288. // fmt.Println(err)
  289. // }
  290. // c.ServeSuccessJSON(map[string]interface{}{
  291. // "pre": dat,
  292. // })
  293. //}
  294. func (c *GdybController) PostEight() {
  295. psnNo := c.GetString("psn_no")
  296. mdtrtId := c.GetString("mdtrt_id")
  297. chrgBchno := c.GetString("chrg_bchno")
  298. certNo := c.GetString("cert_no")
  299. insutype := c.GetString("insutype")
  300. total := c.GetString("total")
  301. org_name := c.GetString("org_name")
  302. doctor := c.GetString("doctor")
  303. fixmedins_code := c.GetString("fixmedins_code")
  304. insuplc_admdvs := c.GetString("insuplc_admdvs")
  305. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  306. secret_key := c.GetString("secret_key")
  307. med_type := c.GetString("med_type")
  308. id_card_type, _ := c.GetInt64("id_card_type")
  309. fulamt_ownpay_amt, _ := c.GetFloat("fulamt_ownpay_amt")
  310. overlmt_selfpay, _ := c.GetFloat("overlmt_selfpay")
  311. preselfpay_amt, _ := c.GetFloat("preselfpay_amt")
  312. inscp_scp_amt, _ := c.GetFloat("inscp_scp_amt")
  313. result, srcRequest := service.Gdyb2207(psnNo, mdtrtId, chrgBchno, certNo, insutype, total, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, med_type, id_card_type, fulamt_ownpay_amt, overlmt_selfpay, preselfpay_amt, inscp_scp_amt, 1, "0", "")
  314. var dat map[string]interface{}
  315. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  316. fmt.Println(dat)
  317. } else {
  318. fmt.Println(err)
  319. }
  320. var dat2 map[string]interface{}
  321. if err := json.Unmarshal([]byte(srcRequest), &dat2); err == nil {
  322. fmt.Println(dat2)
  323. } else {
  324. fmt.Println(err)
  325. }
  326. c.ServeSuccessJSON(map[string]interface{}{
  327. "pre": dat,
  328. "pre2": dat2,
  329. })
  330. }
  331. //func (c *GdybController) PostNine() {
  332. // psnNo := c.GetString("psn_no")
  333. // mdtrtId := c.GetString("mdtrt_id")
  334. // setlId := c.GetString("setl_id")
  335. // org_name := c.GetString("org_name")
  336. // doctor := c.GetString("doctor")
  337. // secret_key := c.GetString("secret_key")
  338. // fixmedins_code := c.GetString("fixmedins_code")
  339. // insuplc_admdvs := c.GetString("insuplc_admdvs")
  340. // mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  341. // //result, src_request := service.Gdyb2208(psnNo, mdtrtId, setlId, org_name, doctor, secret_key, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
  342. //
  343. //}
  344. func (c *GdybController) PostTen() {
  345. fmt.Println("11222333-----")
  346. insutype := c.GetString("insutype")
  347. clrType := c.GetString("clr_type")
  348. setlOptins := c.GetString("setl_optins")
  349. stmtBegndate := c.GetString("stmt_begndate")
  350. stmtEnddate := c.GetString("stm_enddate")
  351. medfeeSumamt, _ := c.GetFloat("medfee_sumamt", 0)
  352. fundPaySumamt, _ := c.GetFloat("fund_pay_sumamt", 0)
  353. acctPay, _ := c.GetFloat("acct_pay", 0)
  354. fixmedinsSetlCnt, _ := c.GetInt64("fixmedins_setl_cnt", 0)
  355. fixmedins_code := c.GetString("fixmedins_code")
  356. insuplc_admdvs := c.GetString("insuplc_admdvs")
  357. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  358. secret_key := c.GetString("secret_key")
  359. org_name := c.GetString("org_name")
  360. doctor := c.GetString("doctor")
  361. fmt.Println(insutype)
  362. fmt.Println(clrType)
  363. fmt.Println(setlOptins)
  364. fmt.Println(stmtBegndate)
  365. fmt.Println(stmtEnddate)
  366. fmt.Println(medfeeSumamt)
  367. baseParams := models.BaseParams{
  368. SecretKey: secret_key,
  369. FixmedinsCode: fixmedins_code,
  370. InsuplcAdmdvs: insuplc_admdvs,
  371. MdtrtareaAdmvs: mdtrtarea_admvs,
  372. OrgName: org_name,
  373. Doctor: doctor,
  374. }
  375. businessParams := models.BusinessParams{
  376. Insutype: insutype,
  377. ClrType: clrType,
  378. SetlOptins: setlOptins,
  379. StmtBegndate: stmtBegndate,
  380. StmtEnddate: stmtEnddate,
  381. MedfeeSumamt: medfeeSumamt,
  382. FundPaySumamt: fundPaySumamt,
  383. AcctPay: acctPay,
  384. FixmedinsSetlCnt: fixmedinsSetlCnt,
  385. }
  386. fmt.Println(baseParams)
  387. fmt.Println(businessParams)
  388. result := service.Gdyb3201(baseParams, businessParams)
  389. var dat map[string]interface{}
  390. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  391. fmt.Println(dat)
  392. } else {
  393. fmt.Println(err)
  394. }
  395. c.ServeSuccessJSON(map[string]interface{}{
  396. "pre": dat,
  397. })
  398. }
  399. func (c *GdybController) PostEleven() {
  400. //fmt.Println("777777666666-----")
  401. //
  402. //file_byte := c.GetString("file_byte")
  403. //file_name := c.GetString("file_name")
  404. //fixmedins_code := c.GetString("fixmedins_code")
  405. //insuplc_admdvs := c.GetString("insuplc_admdvs")
  406. //mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  407. //secret_key := c.GetString("secret_key")
  408. //org_name := c.GetString("org_name")
  409. //doctor := c.GetString("doctor")
  410. //
  411. //baseParams := models.BaseParams{
  412. // SecretKey: secret_key,
  413. // FixmedinsCode: fixmedins_code,
  414. // InsuplcAdmdvs: insuplc_admdvs,
  415. // MdtrtareaAdmvs: mdtrtarea_admvs,
  416. // OrgName: org_name,
  417. // Doctor: doctor,
  418. //}
  419. //x := (*[2]uintptr)(unsafe.Pointer(&file_byte))
  420. //h := [3]uintptr{x[0], x[1], x[1]}
  421. //bytes := *(*[]byte)(unsafe.Pointer(&h))
  422. //result := service.Gdyb9101(baseParams, file_name, []byte(file_byte))
  423. //var dat map[string]interface{}
  424. //if err := json.Unmarshal([]byte(result), &dat); err == nil {
  425. // fmt.Println(dat)
  426. //} else {
  427. // fmt.Println(err)
  428. //}
  429. //c.ServeSuccessJSON(map[string]interface{}{
  430. // "pre": dat,
  431. //})
  432. }
  433. func (c *GdybController) PostTwelve() {
  434. fileQuryNo := c.GetString("file_qury_no")
  435. setlOptins := c.GetString("setl_optins")
  436. stmtBegndate := c.GetString("stmt_begndate")
  437. stmtEnddate := c.GetString("stm_enddate")
  438. medfeeSumamt, _ := c.GetFloat("medfee_sumamt", 0)
  439. fundPaySumamt, _ := c.GetFloat("fund_pay_sumamt", 0)
  440. fixmedinsSetlCnt, _ := c.GetInt64("fixmedins_setl_cnt", 0)
  441. fixmedins_code := c.GetString("fixmedins_code")
  442. insuplc_admdvs := c.GetString("insuplc_admdvs")
  443. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  444. secret_key := c.GetString("secret_key")
  445. org_name := c.GetString("org_name")
  446. doctor := c.GetString("doctor")
  447. cashPayamt, _ := c.GetFloat("cash_payamt", 0)
  448. baseParams := models.BaseParams{
  449. SecretKey: secret_key,
  450. FixmedinsCode: fixmedins_code,
  451. InsuplcAdmdvs: insuplc_admdvs,
  452. MdtrtareaAdmvs: mdtrtarea_admvs,
  453. OrgName: org_name,
  454. Doctor: doctor,
  455. }
  456. businessParams := models.BusinessParams{
  457. FileQuryNo: fileQuryNo,
  458. SetlOptins: setlOptins,
  459. StmtBegndate: stmtBegndate,
  460. StmtEnddate: stmtEnddate,
  461. MedfeeSumamt: medfeeSumamt,
  462. FundPaySumamt: fundPaySumamt,
  463. FixmedinsSetlCnt: fixmedinsSetlCnt,
  464. CashPayamt: cashPayamt,
  465. }
  466. result := service.Gdyb3202(baseParams, businessParams)
  467. var dat map[string]interface{}
  468. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  469. fmt.Println(dat)
  470. } else {
  471. fmt.Println(err)
  472. }
  473. c.ServeSuccessJSON(map[string]interface{}{
  474. "pre": dat,
  475. })
  476. }
  477. func (c *GdybController) PostZHFive() {
  478. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  479. var respJSON map[string]interface{}
  480. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  481. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  482. return
  483. }
  484. userJSONBytes, _ := json.Marshal(respJSON["pre"])
  485. var hp []*models.NewCustom
  486. if err := json.Unmarshal(userJSONBytes, &hp); err != nil {
  487. utils.ErrorLog("解析失败:%v", err)
  488. return
  489. }
  490. fmt.Println(respJSON["psn_no"].(string))
  491. fmt.Println(respJSON["mdtrt_id"].(string))
  492. fmt.Println(respJSON["chrg_bchno"].(string))
  493. fmt.Println(respJSON["org_name"].(string))
  494. fmt.Println(respJSON["doctor"].(string))
  495. fmt.Println(respJSON["dept"].(string))
  496. fmt.Println(respJSON["fixmedins_code"].(string))
  497. fmt.Println(respJSON["dept_code"].(string))
  498. fmt.Println(respJSON["doctor_id"].(string))
  499. fmt.Println(respJSON["insuplc_admdvs"].(string))
  500. fmt.Println(respJSON["mdtrtarea_admvs"].(string))
  501. fmt.Println(respJSON["secret_key"].(string))
  502. //result := service.ZHGdyb2301(respJSON["psn_no"].(string), respJSON["mdtrt_id"].(string), hp, respJSON["chrg_bchno"].(string), respJSON["org_name"].(string),
  503. // 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["med_type"].(string))
  504. //var dat map[string]interface{}
  505. //if err := json.Unmarshal([]byte(result), &dat); err == nil {
  506. // fmt.Println(dat)
  507. //} else {
  508. // fmt.Println(err)
  509. //}
  510. c.ServeSuccessJSON(map[string]interface{}{
  511. "pre": "",
  512. })
  513. }