gdyb_controller.go 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  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, inputLog := 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. var dat2 map[string]interface{}
  81. if err := json.Unmarshal([]byte(inputLog), &dat2); err == nil {
  82. } else {
  83. }
  84. c.ServeSuccessJSON(map[string]interface{}{
  85. "pre": dat,
  86. "log": dat2,
  87. })
  88. }
  89. func (c *GdybController) PostTwo() {
  90. psnNo := c.GetString("psn_no")
  91. insutype := c.GetString("insutype")
  92. certNo := c.GetString("cert_no")
  93. org_name := c.GetString("org_name")
  94. doctor := c.GetString("doctor")
  95. ipt_otp_no := c.GetString("ipt_otp_no")
  96. dept := c.GetString("dept")
  97. fixmedins_code := c.GetString("fixmedins_code")
  98. dept_code := c.GetString("dept_code")
  99. doctor_id := c.GetString("doctor_id")
  100. insuplc_admdvs := c.GetString("insuplc_admdvs")
  101. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  102. secret_key := c.GetString("secret_key")
  103. id_card_type, _ := c.GetInt64("id_card_type")
  104. 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, "")
  105. var dat map[string]interface{}
  106. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  107. //fmt.Println(dat["status"])
  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. fmt.Println(respJSON["chrg_bchno"].(string))
  207. fmt.Println(respJSON["org_name"].(string))
  208. fmt.Println(respJSON["doctor"].(string))
  209. fmt.Println(respJSON["dept"].(string))
  210. fmt.Println(respJSON["fixmedins_code"].(string))
  211. fmt.Println(respJSON["dept_code"].(string))
  212. fmt.Println(respJSON["doctor_id"].(string))
  213. fmt.Println(respJSON["insuplc_admdvs"].(string))
  214. fmt.Println(respJSON["mdtrtarea_admvs"].(string))
  215. fmt.Println(respJSON["secret_key"].(string))
  216. result, requestLog := service.Gdyb2204(respJSON["psn_no"].(string), respJSON["mdtrt_id"].(string), hp, respJSON["chrg_bchno"].(string), respJSON["org_name"].(string),
  217. 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))
  218. var dat map[string]interface{}
  219. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  220. fmt.Println(dat)
  221. } else {
  222. fmt.Println(err)
  223. }
  224. var dat2 map[string]interface{}
  225. if err := json.Unmarshal([]byte(requestLog), &dat2); err == nil {
  226. fmt.Println(dat2)
  227. } else {
  228. fmt.Println(err)
  229. }
  230. c.ServeSuccessJSON(map[string]interface{}{
  231. "pre": dat,
  232. "request_log": requestLog,
  233. })
  234. }
  235. func (c *GdybController) PostSix() {
  236. psnNo := c.GetString("psn_no")
  237. mdtrtId := c.GetString("mdtrt_id")
  238. chrgBchno := c.GetString("chrg_bchno")
  239. org_name := c.GetString("org_name")
  240. doctor := c.GetString("doctor")
  241. insuplc_admdvs := c.GetString("insuplc_admdvs")
  242. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  243. secret_key := c.GetString("secret_key")
  244. fixmedins_code := c.GetString("fixmedins_code")
  245. result, requestlog := service.Gdyb2205(psnNo, mdtrtId, chrgBchno, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code)
  246. fmt.Println(requestlog)
  247. var dat map[string]interface{}
  248. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  249. fmt.Println(dat)
  250. } else {
  251. fmt.Println(err)
  252. }
  253. c.ServeSuccessJSON(map[string]interface{}{
  254. "pre": result,
  255. })
  256. }
  257. //func (c *GdybController) PostSeven() {
  258. // psnNo := c.GetString("psn_no")
  259. // mdtrtId := c.GetString("mdtrt_id")
  260. // chrgBchno := c.GetString("chrg_bchno")
  261. // certNo := c.GetString("cert_no")
  262. // insutype := c.GetString("insutype")
  263. // total := c.GetString("total")
  264. // org_name := c.GetString("org_name")
  265. // doctor := c.GetString("doctor")
  266. // fixmedins_code := c.GetString("fixmedins_code")
  267. // insuplc_admdvs := c.GetString("insuplc_admdvs")
  268. // mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  269. // secret_key := c.GetString("secret_key")
  270. // med_type := c.GetString("med_type")
  271. // id_card_type, _ := c.GetInt64("id_card_type")
  272. //
  273. // //result := service.Gdyb2206(psnNo/**/, mdtrtId, chrgBchno, certNo, insutype, total, org_name, doctor, secret_key)
  274. //
  275. // 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)
  276. //
  277. // var dat map[string]interface{}
  278. // if err := json.Unmarshal([]byte(result), &dat); err == nil {
  279. // fmt.Println(dat)
  280. // } else {
  281. // fmt.Println(err)
  282. // }
  283. // c.ServeSuccessJSON(map[string]interface{}{
  284. // "pre": dat,
  285. // })
  286. //}
  287. func (c *GdybController) PostEight() {
  288. psnNo := c.GetString("psn_no")
  289. mdtrtId := c.GetString("mdtrt_id")
  290. chrgBchno := c.GetString("chrg_bchno")
  291. certNo := c.GetString("cert_no")
  292. insutype := c.GetString("insutype")
  293. total := c.GetString("total")
  294. org_name := c.GetString("org_name")
  295. doctor := c.GetString("doctor")
  296. fixmedins_code := c.GetString("fixmedins_code")
  297. insuplc_admdvs := c.GetString("insuplc_admdvs")
  298. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  299. secret_key := c.GetString("secret_key")
  300. med_type := c.GetString("med_type")
  301. id_card_type, _ := c.GetInt64("id_card_type")
  302. fulamt_ownpay_amt, _ := c.GetFloat("fulamt_ownpay_amt")
  303. overlmt_selfpay, _ := c.GetFloat("overlmt_selfpay")
  304. preselfpay_amt, _ := c.GetFloat("preselfpay_amt")
  305. inscp_scp_amt, _ := c.GetFloat("inscp_scp_amt")
  306. 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)
  307. var dat map[string]interface{}
  308. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  309. fmt.Println(dat)
  310. } else {
  311. fmt.Println(err)
  312. }
  313. var dat2 map[string]interface{}
  314. if err := json.Unmarshal([]byte(srcRequest), &dat2); err == nil {
  315. fmt.Println(dat2)
  316. } else {
  317. fmt.Println(err)
  318. }
  319. c.ServeSuccessJSON(map[string]interface{}{
  320. "pre": dat,
  321. "pre2": dat2,
  322. })
  323. }
  324. //func (c *GdybController) PostNine() {
  325. // psnNo := c.GetString("psn_no")
  326. // mdtrtId := c.GetString("mdtrt_id")
  327. // setlId := c.GetString("setl_id")
  328. // org_name := c.GetString("org_name")
  329. // doctor := c.GetString("doctor")
  330. // secret_key := c.GetString("secret_key")
  331. // fixmedins_code := c.GetString("fixmedins_code")
  332. // insuplc_admdvs := c.GetString("insuplc_admdvs")
  333. // mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  334. // //result, src_request := service.Gdyb2208(psnNo, mdtrtId, setlId, org_name, doctor, secret_key, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
  335. //
  336. //}
  337. func (c *GdybController) PostTen() {
  338. fmt.Println("11222333-----")
  339. insutype := c.GetString("insutype")
  340. clrType := c.GetString("clr_type")
  341. setlOptins := c.GetString("setl_optins")
  342. stmtBegndate := c.GetString("stmt_begndate")
  343. stmtEnddate := c.GetString("stm_enddate")
  344. medfeeSumamt, _ := c.GetFloat("medfee_sumamt", 0)
  345. fundPaySumamt, _ := c.GetFloat("fund_pay_sumamt", 0)
  346. acctPay, _ := c.GetFloat("acct_pay", 0)
  347. fixmedinsSetlCnt, _ := c.GetInt64("fixmedins_setl_cnt", 0)
  348. fixmedins_code := c.GetString("fixmedins_code")
  349. insuplc_admdvs := c.GetString("insuplc_admdvs")
  350. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  351. secret_key := c.GetString("secret_key")
  352. org_name := c.GetString("org_name")
  353. doctor := c.GetString("doctor")
  354. fmt.Println(insutype)
  355. fmt.Println(clrType)
  356. fmt.Println(setlOptins)
  357. fmt.Println(stmtBegndate)
  358. fmt.Println(stmtEnddate)
  359. fmt.Println(medfeeSumamt)
  360. baseParams := models.BaseParams{
  361. SecretKey: secret_key,
  362. FixmedinsCode: fixmedins_code,
  363. InsuplcAdmdvs: insuplc_admdvs,
  364. MdtrtareaAdmvs: mdtrtarea_admvs,
  365. OrgName: org_name,
  366. Doctor: doctor,
  367. }
  368. businessParams := models.BusinessParams{
  369. Insutype: insutype,
  370. ClrType: clrType,
  371. SetlOptins: setlOptins,
  372. StmtBegndate: stmtBegndate,
  373. StmtEnddate: stmtEnddate,
  374. MedfeeSumamt: medfeeSumamt,
  375. FundPaySumamt: fundPaySumamt,
  376. AcctPay: acctPay,
  377. FixmedinsSetlCnt: fixmedinsSetlCnt,
  378. }
  379. fmt.Println(baseParams)
  380. fmt.Println(businessParams)
  381. fmt.Println("11222333--33333---")
  382. result := service.Gdyb3201(baseParams, businessParams)
  383. fmt.Println("11222333--33333---555555")
  384. var dat map[string]interface{}
  385. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  386. fmt.Println(dat)
  387. } else {
  388. fmt.Println(err)
  389. }
  390. c.ServeSuccessJSON(map[string]interface{}{
  391. "pre": dat,
  392. })
  393. }
  394. func (c *GdybController) PostEleven() {
  395. //fmt.Println("777777666666-----")
  396. //
  397. //file_byte := c.GetString("file_byte")
  398. //file_name := c.GetString("file_name")
  399. //fixmedins_code := c.GetString("fixmedins_code")
  400. //insuplc_admdvs := c.GetString("insuplc_admdvs")
  401. //mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  402. //secret_key := c.GetString("secret_key")
  403. //org_name := c.GetString("org_name")
  404. //doctor := c.GetString("doctor")
  405. //
  406. //baseParams := models.BaseParams{
  407. // SecretKey: secret_key,
  408. // FixmedinsCode: fixmedins_code,
  409. // InsuplcAdmdvs: insuplc_admdvs,
  410. // MdtrtareaAdmvs: mdtrtarea_admvs,
  411. // OrgName: org_name,
  412. // Doctor: doctor,
  413. //}
  414. //x := (*[2]uintptr)(unsafe.Pointer(&file_byte))
  415. //h := [3]uintptr{x[0], x[1], x[1]}
  416. //bytes := *(*[]byte)(unsafe.Pointer(&h))
  417. //result := service.Gdyb9101(baseParams, file_name, []byte(file_byte))
  418. //var dat map[string]interface{}
  419. //if err := json.Unmarshal([]byte(result), &dat); err == nil {
  420. // fmt.Println(dat)
  421. //} else {
  422. // fmt.Println(err)
  423. //}
  424. //c.ServeSuccessJSON(map[string]interface{}{
  425. // "pre": dat,
  426. //})
  427. }
  428. func (c *GdybController) PostTwelve() {
  429. fileQuryNo := c.GetString("file_qury_no")
  430. setlOptins := c.GetString("setl_optins")
  431. stmtBegndate := c.GetString("stmt_begndate")
  432. stmtEnddate := c.GetString("stm_enddate")
  433. medfeeSumamt, _ := c.GetFloat("medfee_sumamt", 0)
  434. fundPaySumamt, _ := c.GetFloat("fund_pay_sumamt", 0)
  435. fixmedinsSetlCnt, _ := c.GetInt64("fixmedins_setl_cnt", 0)
  436. fixmedins_code := c.GetString("fixmedins_code")
  437. insuplc_admdvs := c.GetString("insuplc_admdvs")
  438. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  439. secret_key := c.GetString("secret_key")
  440. org_name := c.GetString("org_name")
  441. doctor := c.GetString("doctor")
  442. cashPayamt, _ := c.GetFloat("cash_payamt", 0)
  443. baseParams := models.BaseParams{
  444. SecretKey: secret_key,
  445. FixmedinsCode: fixmedins_code,
  446. InsuplcAdmdvs: insuplc_admdvs,
  447. MdtrtareaAdmvs: mdtrtarea_admvs,
  448. OrgName: org_name,
  449. Doctor: doctor,
  450. }
  451. businessParams := models.BusinessParams{
  452. FileQuryNo: fileQuryNo,
  453. SetlOptins: setlOptins,
  454. StmtBegndate: stmtBegndate,
  455. StmtEnddate: stmtEnddate,
  456. MedfeeSumamt: medfeeSumamt,
  457. FundPaySumamt: fundPaySumamt,
  458. FixmedinsSetlCnt: fixmedinsSetlCnt,
  459. CashPayamt: cashPayamt,
  460. }
  461. result := service.Gdyb3202(baseParams, businessParams)
  462. var dat map[string]interface{}
  463. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  464. fmt.Println(dat)
  465. } else {
  466. fmt.Println(err)
  467. }
  468. c.ServeSuccessJSON(map[string]interface{}{
  469. "pre": dat,
  470. })
  471. }
  472. func (c *GdybController) PostZHFive() {
  473. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  474. var respJSON map[string]interface{}
  475. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  476. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  477. return
  478. }
  479. userJSONBytes, _ := json.Marshal(respJSON["pre"])
  480. var hp []*models.NewCustom
  481. if err := json.Unmarshal(userJSONBytes, &hp); err != nil {
  482. utils.ErrorLog("解析失败:%v", err)
  483. return
  484. }
  485. fmt.Println(respJSON["psn_no"].(string))
  486. fmt.Println(respJSON["mdtrt_id"].(string))
  487. fmt.Println(respJSON["chrg_bchno"].(string))
  488. fmt.Println(respJSON["org_name"].(string))
  489. fmt.Println(respJSON["doctor"].(string))
  490. fmt.Println(respJSON["dept"].(string))
  491. fmt.Println(respJSON["fixmedins_code"].(string))
  492. fmt.Println(respJSON["dept_code"].(string))
  493. fmt.Println(respJSON["doctor_id"].(string))
  494. fmt.Println(respJSON["insuplc_admdvs"].(string))
  495. fmt.Println(respJSON["mdtrtarea_admvs"].(string))
  496. fmt.Println(respJSON["secret_key"].(string))
  497. result := service.ZHGdyb2301(respJSON["psn_no"].(string), respJSON["mdtrt_id"].(string), hp, respJSON["chrg_bchno"].(string), respJSON["org_name"].(string),
  498. 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))
  499. var dat map[string]interface{}
  500. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  501. fmt.Println(dat)
  502. } else {
  503. fmt.Println(err)
  504. }
  505. c.ServeSuccessJSON(map[string]interface{}{
  506. "pre": dat,
  507. })
  508. }