gdyb_controller.go 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  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. result := service.Gdyb1101(certNo, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type, card_sn, certificates)
  76. var dat map[string]interface{}
  77. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  78. } else {
  79. }
  80. c.ServeSuccessJSON(map[string]interface{}{
  81. "pre": dat,
  82. })
  83. }
  84. func (c *GdybController) PostTwo() {
  85. psnNo := c.GetString("psn_no")
  86. insutype := c.GetString("insutype")
  87. certNo := c.GetString("cert_no")
  88. org_name := c.GetString("org_name")
  89. doctor := c.GetString("doctor")
  90. ipt_otp_no := c.GetString("ipt_otp_no")
  91. dept := c.GetString("dept")
  92. fixmedins_code := c.GetString("fixmedins_code")
  93. dept_code := c.GetString("dept_code")
  94. doctor_id := c.GetString("doctor_id")
  95. insuplc_admdvs := c.GetString("insuplc_admdvs")
  96. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  97. secret_key := c.GetString("secret_key")
  98. id_card_type, _ := c.GetInt64("id_card_type")
  99. 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)
  100. var dat map[string]interface{}
  101. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  102. //fmt.Println(dat["status"])
  103. } else {
  104. }
  105. c.ServeSuccessJSON(map[string]interface{}{
  106. "pre": dat,
  107. })
  108. }
  109. func (c *GdybController) PostThree() {
  110. psnNo := c.GetString("psn_no")
  111. mdtrtId := c.GetString("mdtrt_id")
  112. iptOtpNo := c.GetString("ipt_otp_no")
  113. org_name := c.GetString("org_name")
  114. doctor := c.GetString("doctor")
  115. insuplc_admdvs := c.GetString("insuplc_admdvs")
  116. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  117. secret_key := c.GetString("secret_key")
  118. fixmedins_code := c.GetString("fixmedins_code")
  119. result := service.Gdyb2202(psnNo, mdtrtId, iptOtpNo, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code)
  120. var dat map[string]interface{}
  121. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  122. } else {
  123. }
  124. c.ServeSuccessJSON(map[string]interface{}{
  125. "pre": dat,
  126. })
  127. }
  128. func (c *GdybController) PostFour() {
  129. psnNo := c.GetString("psn_no")
  130. mdtrtId := c.GetString("mdtrt_id")
  131. doctor := c.GetString("doctor")
  132. department := c.GetString("department")
  133. diag := c.GetString("diag")
  134. org_name := c.GetString("org_name")
  135. med_type := c.GetString("med_type")
  136. doctor_id, _ := c.GetInt64("doctor_id", 0)
  137. fixmedins_code := c.GetString("fixmedins_code")
  138. diag_code := c.GetString("diag_code")
  139. sick_code := c.GetString("sick_code")
  140. sick_name := c.GetString("sick_name")
  141. fmt.Println(sick_code)
  142. fmt.Println(sick_name)
  143. insuplc_admdvs := c.GetString("insuplc_admdvs")
  144. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  145. secret_key := c.GetString("secret_key")
  146. var result string
  147. if insuplc_admdvs == "440781" { //
  148. 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)
  149. } else {
  150. 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)
  151. }
  152. var dat map[string]interface{}
  153. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  154. } else {
  155. }
  156. c.ServeSuccessJSON(map[string]interface{}{
  157. "pre": dat,
  158. })
  159. }
  160. type All struct {
  161. HisPrescription HisPrescription
  162. mdtrt_id string
  163. psn_no string
  164. }
  165. type HisPrescription struct {
  166. ID int64 `gorm:"column:id" json:"id" form:"id"`
  167. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  168. RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
  169. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  170. HisPatientId int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
  171. Status int64 `gorm:"column:status" json:"status" form:"status"`
  172. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  173. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  174. Number string `gorm:"column:number" json:"number" form:"number"`
  175. Type int64 `gorm:"column:type" json:"type" form:"type"`
  176. Doctor int64 `gorm:"column:doctor" json:"doctor" form:"doctor"`
  177. Creator int64 `gorm:"column:creator" json:"creator" form:"creator"`
  178. Modifier int64 `gorm:"column:modifier" json:"modifier" form:"modifier"`
  179. HisDoctorAdviceInfo []*models.HisDoctorAdviceInfo `gorm:"ForeignKey:PatientId,RecordDate,PrescriptionId;AssociationForeignKey:PatientId,RecordDate,ID" json:"advices"`
  180. HisPrescriptionProject []*models.HisPrescriptionProject `gorm:"ForeignKey:PatientId,RecordDate,PrescriptionId;AssociationForeignKey:PatientId,RecordDate,ID" json:"project"`
  181. }
  182. func (c *GdybController) PostFive() {
  183. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  184. var respJSON map[string]interface{}
  185. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  186. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  187. return
  188. }
  189. userJSONBytes, _ := json.Marshal(respJSON["pre"])
  190. var hp []*models.HisPrescription
  191. if err := json.Unmarshal(userJSONBytes, &hp); err != nil {
  192. utils.ErrorLog("解析失败:%v", err)
  193. return
  194. }
  195. fmt.Println(respJSON["psn_no"].(string))
  196. fmt.Println(respJSON["mdtrt_id"].(string))
  197. fmt.Println(respJSON["chrg_bchno"].(string))
  198. fmt.Println(respJSON["org_name"].(string))
  199. fmt.Println(respJSON["doctor"].(string))
  200. fmt.Println(respJSON["dept"].(string))
  201. fmt.Println(respJSON["fixmedins_code"].(string))
  202. fmt.Println(respJSON["dept_code"].(string))
  203. fmt.Println(respJSON["doctor_id"].(string))
  204. fmt.Println(respJSON["insuplc_admdvs"].(string))
  205. fmt.Println(respJSON["mdtrtarea_admvs"].(string))
  206. fmt.Println(respJSON["secret_key"].(string))
  207. result := service.Gdyb2204(respJSON["psn_no"].(string), respJSON["mdtrt_id"].(string), hp, respJSON["chrg_bchno"].(string), respJSON["org_name"].(string),
  208. 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))
  209. var dat map[string]interface{}
  210. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  211. fmt.Println(dat)
  212. } else {
  213. fmt.Println(err)
  214. }
  215. c.ServeSuccessJSON(map[string]interface{}{
  216. "pre": dat,
  217. })
  218. }
  219. func (c *GdybController) PostSix() {
  220. psnNo := c.GetString("psn_no")
  221. mdtrtId := c.GetString("mdtrt_id")
  222. chrgBchno := c.GetString("chrg_bchno")
  223. org_name := c.GetString("org_name")
  224. doctor := c.GetString("doctor")
  225. insuplc_admdvs := c.GetString("insuplc_admdvs")
  226. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  227. secret_key := c.GetString("secret_key")
  228. fixmedins_code := c.GetString("fixmedins_code")
  229. result := service.Gdyb2205(psnNo, mdtrtId, chrgBchno, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code)
  230. var dat map[string]interface{}
  231. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  232. fmt.Println(dat)
  233. } else {
  234. fmt.Println(err)
  235. }
  236. c.ServeSuccessJSON(map[string]interface{}{
  237. "pre": result,
  238. })
  239. }
  240. func (c *GdybController) PostSeven() {
  241. psnNo := c.GetString("psn_no")
  242. mdtrtId := c.GetString("mdtrt_id")
  243. chrgBchno := c.GetString("chrg_bchno")
  244. certNo := c.GetString("cert_no")
  245. insutype := c.GetString("insutype")
  246. total := c.GetString("total")
  247. org_name := c.GetString("org_name")
  248. doctor := c.GetString("doctor")
  249. fixmedins_code := c.GetString("fixmedins_code")
  250. insuplc_admdvs := c.GetString("insuplc_admdvs")
  251. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  252. secret_key := c.GetString("secret_key")
  253. med_type := c.GetString("med_type")
  254. id_card_type, _ := c.GetInt64("id_card_type")
  255. //result := service.Gdyb2206(psnNo/**/, mdtrtId, chrgBchno, certNo, insutype, total, org_name, doctor, secret_key)
  256. 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)
  257. var dat map[string]interface{}
  258. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  259. fmt.Println(dat)
  260. } else {
  261. fmt.Println(err)
  262. }
  263. c.ServeSuccessJSON(map[string]interface{}{
  264. "pre": dat,
  265. })
  266. }
  267. func (c *GdybController) PostEight() {
  268. psnNo := c.GetString("psn_no")
  269. mdtrtId := c.GetString("mdtrt_id")
  270. chrgBchno := c.GetString("chrg_bchno")
  271. certNo := c.GetString("cert_no")
  272. insutype := c.GetString("insutype")
  273. total := c.GetString("total")
  274. org_name := c.GetString("org_name")
  275. doctor := c.GetString("doctor")
  276. fixmedins_code := c.GetString("fixmedins_code")
  277. insuplc_admdvs := c.GetString("insuplc_admdvs")
  278. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  279. secret_key := c.GetString("secret_key")
  280. med_type := c.GetString("med_type")
  281. id_card_type, _ := c.GetInt64("id_card_type")
  282. fulamt_ownpay_amt, _ := c.GetFloat("fulamt_ownpay_amt")
  283. overlmt_selfpay, _ := c.GetFloat("overlmt_selfpay")
  284. preselfpay_amt, _ := c.GetFloat("preselfpay_amt")
  285. inscp_scp_amt, _ := c.GetFloat("inscp_scp_amt")
  286. 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)
  287. var dat map[string]interface{}
  288. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  289. fmt.Println(dat)
  290. } else {
  291. fmt.Println(err)
  292. }
  293. var dat2 map[string]interface{}
  294. if err := json.Unmarshal([]byte(srcRequest), &dat2); err == nil {
  295. fmt.Println(dat2)
  296. } else {
  297. fmt.Println(err)
  298. }
  299. c.ServeSuccessJSON(map[string]interface{}{
  300. "pre": dat,
  301. "pre2": dat2,
  302. })
  303. }
  304. //func (c *GdybController) PostNine() {
  305. // psnNo := c.GetString("psn_no")
  306. // mdtrtId := c.GetString("mdtrt_id")
  307. // setlId := c.GetString("setl_id")
  308. // org_name := c.GetString("org_name")
  309. // doctor := c.GetString("doctor")
  310. // secret_key := c.GetString("secret_key")
  311. // fixmedins_code := c.GetString("fixmedins_code")
  312. // insuplc_admdvs := c.GetString("insuplc_admdvs")
  313. // mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  314. // //result, src_request := service.Gdyb2208(psnNo, mdtrtId, setlId, org_name, doctor, secret_key, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
  315. //
  316. //}
  317. func (c *GdybController) PostTen() {
  318. fmt.Println("11222333-----")
  319. insutype := c.GetString("insutype")
  320. clrType := c.GetString("clr_type")
  321. setlOptins := c.GetString("setl_optins")
  322. stmtBegndate := c.GetString("stmt_begndate")
  323. stmtEnddate := c.GetString("stm_enddate")
  324. medfeeSumamt, _ := c.GetFloat("medfee_sumamt", 0)
  325. fundPaySumamt, _ := c.GetFloat("fund_pay_sumamt", 0)
  326. acctPay, _ := c.GetFloat("acct_pay", 0)
  327. fixmedinsSetlCnt, _ := c.GetInt64("fixmedins_setl_cnt", 0)
  328. fixmedins_code := c.GetString("fixmedins_code")
  329. insuplc_admdvs := c.GetString("insuplc_admdvs")
  330. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  331. secret_key := c.GetString("secret_key")
  332. org_name := c.GetString("org_name")
  333. doctor := c.GetString("doctor")
  334. fmt.Println(insutype)
  335. fmt.Println(clrType)
  336. fmt.Println(setlOptins)
  337. fmt.Println(stmtBegndate)
  338. fmt.Println(stmtEnddate)
  339. fmt.Println(medfeeSumamt)
  340. baseParams := models.BaseParams{
  341. SecretKey: secret_key,
  342. FixmedinsCode: fixmedins_code,
  343. InsuplcAdmdvs: insuplc_admdvs,
  344. MdtrtareaAdmvs: mdtrtarea_admvs,
  345. OrgName: org_name,
  346. Doctor: doctor,
  347. }
  348. businessParams := models.BusinessParams{
  349. Insutype: insutype,
  350. ClrType: clrType,
  351. SetlOptins: setlOptins,
  352. StmtBegndate: stmtBegndate,
  353. StmtEnddate: stmtEnddate,
  354. MedfeeSumamt: medfeeSumamt,
  355. FundPaySumamt: fundPaySumamt,
  356. AcctPay: acctPay,
  357. FixmedinsSetlCnt: fixmedinsSetlCnt,
  358. }
  359. fmt.Println(baseParams)
  360. fmt.Println(businessParams)
  361. fmt.Println("11222333--33333---")
  362. result := service.Gdyb3201(baseParams, businessParams)
  363. fmt.Println("11222333--33333---555555")
  364. var dat map[string]interface{}
  365. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  366. fmt.Println(dat)
  367. } else {
  368. fmt.Println(err)
  369. }
  370. c.ServeSuccessJSON(map[string]interface{}{
  371. "pre": dat,
  372. })
  373. }
  374. func (c *GdybController) PostEleven() {
  375. //fmt.Println("777777666666-----")
  376. //
  377. //file_byte := c.GetString("file_byte")
  378. //file_name := c.GetString("file_name")
  379. //fixmedins_code := c.GetString("fixmedins_code")
  380. //insuplc_admdvs := c.GetString("insuplc_admdvs")
  381. //mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  382. //secret_key := c.GetString("secret_key")
  383. //org_name := c.GetString("org_name")
  384. //doctor := c.GetString("doctor")
  385. //
  386. //baseParams := models.BaseParams{
  387. // SecretKey: secret_key,
  388. // FixmedinsCode: fixmedins_code,
  389. // InsuplcAdmdvs: insuplc_admdvs,
  390. // MdtrtareaAdmvs: mdtrtarea_admvs,
  391. // OrgName: org_name,
  392. // Doctor: doctor,
  393. //}
  394. //x := (*[2]uintptr)(unsafe.Pointer(&file_byte))
  395. //h := [3]uintptr{x[0], x[1], x[1]}
  396. //bytes := *(*[]byte)(unsafe.Pointer(&h))
  397. //result := service.Gdyb9101(baseParams, file_name, []byte(file_byte))
  398. //var dat map[string]interface{}
  399. //if err := json.Unmarshal([]byte(result), &dat); err == nil {
  400. // fmt.Println(dat)
  401. //} else {
  402. // fmt.Println(err)
  403. //}
  404. //c.ServeSuccessJSON(map[string]interface{}{
  405. // "pre": dat,
  406. //})
  407. }
  408. func (c *GdybController) PostTwelve() {
  409. fileQuryNo := c.GetString("file_qury_no")
  410. setlOptins := c.GetString("setl_optins")
  411. stmtBegndate := c.GetString("stmt_begndate")
  412. stmtEnddate := c.GetString("stm_enddate")
  413. medfeeSumamt, _ := c.GetFloat("medfee_sumamt", 0)
  414. fundPaySumamt, _ := c.GetFloat("fund_pay_sumamt", 0)
  415. fixmedinsSetlCnt, _ := c.GetInt64("fixmedins_setl_cnt", 0)
  416. fixmedins_code := c.GetString("fixmedins_code")
  417. insuplc_admdvs := c.GetString("insuplc_admdvs")
  418. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  419. secret_key := c.GetString("secret_key")
  420. org_name := c.GetString("org_name")
  421. doctor := c.GetString("doctor")
  422. cashPayamt, _ := c.GetFloat("cash_payamt", 0)
  423. baseParams := models.BaseParams{
  424. SecretKey: secret_key,
  425. FixmedinsCode: fixmedins_code,
  426. InsuplcAdmdvs: insuplc_admdvs,
  427. MdtrtareaAdmvs: mdtrtarea_admvs,
  428. OrgName: org_name,
  429. Doctor: doctor,
  430. }
  431. businessParams := models.BusinessParams{
  432. FileQuryNo: fileQuryNo,
  433. SetlOptins: setlOptins,
  434. StmtBegndate: stmtBegndate,
  435. StmtEnddate: stmtEnddate,
  436. MedfeeSumamt: medfeeSumamt,
  437. FundPaySumamt: fundPaySumamt,
  438. FixmedinsSetlCnt: fixmedinsSetlCnt,
  439. CashPayamt: cashPayamt,
  440. }
  441. result := service.Gdyb3202(baseParams, businessParams)
  442. var dat map[string]interface{}
  443. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  444. fmt.Println(dat)
  445. } else {
  446. fmt.Println(err)
  447. }
  448. c.ServeSuccessJSON(map[string]interface{}{
  449. "pre": dat,
  450. })
  451. }
  452. func (c *GdybController) PostZHFive() {
  453. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  454. var respJSON map[string]interface{}
  455. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  456. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  457. return
  458. }
  459. userJSONBytes, _ := json.Marshal(respJSON["pre"])
  460. var hp []*models.HisPrescription
  461. if err := json.Unmarshal(userJSONBytes, &hp); err != nil {
  462. utils.ErrorLog("解析失败:%v", err)
  463. return
  464. }
  465. fmt.Println(respJSON["psn_no"].(string))
  466. fmt.Println(respJSON["mdtrt_id"].(string))
  467. fmt.Println(respJSON["chrg_bchno"].(string))
  468. fmt.Println(respJSON["org_name"].(string))
  469. fmt.Println(respJSON["doctor"].(string))
  470. fmt.Println(respJSON["dept"].(string))
  471. fmt.Println(respJSON["fixmedins_code"].(string))
  472. fmt.Println(respJSON["dept_code"].(string))
  473. fmt.Println(respJSON["doctor_id"].(string))
  474. fmt.Println(respJSON["insuplc_admdvs"].(string))
  475. fmt.Println(respJSON["mdtrtarea_admvs"].(string))
  476. fmt.Println(respJSON["secret_key"].(string))
  477. result := service.ZHGdyb2301(respJSON["psn_no"].(string), respJSON["mdtrt_id"].(string), hp, respJSON["chrg_bchno"].(string), respJSON["org_name"].(string),
  478. 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))
  479. var dat map[string]interface{}
  480. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  481. fmt.Println(dat)
  482. } else {
  483. fmt.Println(err)
  484. }
  485. c.ServeSuccessJSON(map[string]interface{}{
  486. "pre": dat,
  487. })
  488. }