hbyb_controller.go 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. package hb
  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 HBybController struct {
  13. controllers.BaseAuthAPIController
  14. }
  15. func HbybRegistRouters() {
  16. beego.Router("/hbyb/1101", &HBybController{}, "get:PostOne")
  17. beego.Router("/hbyb/2201", &HBybController{}, "get:PostTwo")
  18. beego.Router("/hbyb/2202", &HBybController{}, "get:PostThree")
  19. beego.Router("/hbyb/2203", &HBybController{}, "post:PostFour")
  20. beego.Router("/hbyb/2204", &HBybController{}, "post:PostFive")
  21. beego.Router("/hbyb/2205", &HBybController{}, "get:PostSix")
  22. beego.Router("/hbyb/2206", &HBybController{}, "get:PostSeven")
  23. beego.Router("/hbyb/2207", &HBybController{}, "get:PostEight")
  24. beego.Router("/hbyb/2208", &HBybController{}, "get:PostNine")
  25. beego.Router("/hbyb/5203", &HBybController{}, "get:PostTen")
  26. beego.Router("/hbyb/2001", &HBybController{}, "get:Post2001")
  27. beego.Router("/hbyb/3202", &HBybController{}, "post:Post3202a")
  28. beego.Router("/hbyb/4101", &HBybController{}, "post:Post4101")
  29. beego.Router("/hbyb/5262", &HBybController{}, "post:Post5262")
  30. beego.Router("/hbyb/5267", &HBybController{}, "post:Post5267")
  31. }
  32. func (c *HBybController)Post5262(){
  33. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  34. var respJSON map[string]interface{}
  35. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  36. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  37. return
  38. }
  39. userJSONBytes, _ := json.Marshal(respJSON["bps"])
  40. var bps models.BusinessParams5262
  41. if err := json.Unmarshal(userJSONBytes, &bps); err != nil {
  42. utils.ErrorLog("解析失败:%v", err)
  43. return
  44. }
  45. var baseParams models.BaseParams
  46. baseParams.InsuplcAdmdvs = respJSON["insuplc_admdvs"].(string)
  47. baseParams.MdtrtareaAdmvs = respJSON["mdtrtarea_admvs"].(string)
  48. baseParams.OrgName = respJSON["org_name"].(string)
  49. baseParams.Doctor = respJSON["doctor"].(string)
  50. baseParams.FixmedinsCode = respJSON["fixmedins_code"].(string)
  51. page := respJSON["page"].(string)
  52. limit := respJSON["limit"].(string)
  53. result := service.Hbyb5262(baseParams, bps,page,limit)
  54. var dat map[string]interface{}
  55. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  56. fmt.Println(dat)
  57. } else {
  58. fmt.Println(err)
  59. }
  60. c.ServeSuccessJSON(map[string]interface{}{
  61. "pre": dat,
  62. })
  63. }
  64. func (c *HBybController)Post5267(){
  65. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  66. var respJSON map[string]interface{}
  67. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  68. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  69. return
  70. }
  71. userJSONBytes, _ := json.Marshal(respJSON["bps"])
  72. var bps models.BusinessParams5262
  73. if err := json.Unmarshal(userJSONBytes, &bps); err != nil {
  74. utils.ErrorLog("解析失败:%v", err)
  75. return
  76. }
  77. var baseParams models.BaseParams
  78. baseParams.InsuplcAdmdvs = respJSON["insuplc_admdvs"].(string)
  79. baseParams.MdtrtareaAdmvs = respJSON["mdtrtarea_admvs"].(string)
  80. baseParams.OrgName = respJSON["org_name"].(string)
  81. baseParams.Doctor = respJSON["doctor"].(string)
  82. baseParams.FixmedinsCode = respJSON["fixmedins_code"].(string)
  83. page := respJSON["page"].(string)
  84. limit := respJSON["limit"].(string)
  85. result := service.Hbyb5267(baseParams, bps,page,limit)
  86. var dat map[string]interface{}
  87. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  88. fmt.Println(dat)
  89. } else {
  90. fmt.Println(err)
  91. }
  92. c.ServeSuccessJSON(map[string]interface{}{
  93. "pre": dat,
  94. })
  95. }
  96. func (c *HBybController) Post3202a() {
  97. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  98. var respJSON map[string]interface{}
  99. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  100. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  101. return
  102. }
  103. userJSONBytes, _ := json.Marshal(respJSON["bps"])
  104. var bps []*models.BusinessParamsTwo
  105. if err := json.Unmarshal(userJSONBytes, &bps); err != nil {
  106. utils.ErrorLog("解析失败:%v", err)
  107. return
  108. }
  109. var baseParams models.BaseParams
  110. baseParams.InsuplcAdmdvs = respJSON["insuplc_admdvs"].(string)
  111. baseParams.MdtrtareaAdmvs = respJSON["mdtrtarea_admvs"].(string)
  112. baseParams.OrgName = respJSON["org_name"].(string)
  113. baseParams.Doctor = respJSON["doctor"].(string)
  114. baseParams.FixmedinsCode = respJSON["fixmedins_code"].(string)
  115. result := service.Hbyb3202a(baseParams, bps)
  116. var dat map[string]interface{}
  117. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  118. fmt.Println(dat)
  119. } else {
  120. fmt.Println(err)
  121. }
  122. c.ServeSuccessJSON(map[string]interface{}{
  123. "pre": dat,
  124. })
  125. }
  126. func (c *HBybController) Post4101() {
  127. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  128. var respJSON map[string]interface{}
  129. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  130. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  131. return
  132. }
  133. userJSONBytes, _ := json.Marshal(respJSON["struct4101"])
  134. var struct4101 service.Struct4101
  135. if err := json.Unmarshal(userJSONBytes, &struct4101); err != nil {
  136. utils.ErrorLog("解析失败:%v", err)
  137. return
  138. }
  139. result, inputLog := service.Hbyb4101(struct4101, respJSON["secret_key"].(string), respJSON["org_name"].(string), respJSON["opera"].(string), respJSON["code"].(string), respJSON["insuplc_admdvs"].(string), respJSON["mdtrtarea_admvs"].(string))
  140. var dat map[string]interface{}
  141. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  142. } else {
  143. }
  144. var dat2 map[string]interface{}
  145. if err := json.Unmarshal([]byte(inputLog), &dat2); err == nil {
  146. } else {
  147. }
  148. c.ServeSuccessJSON(map[string]interface{}{
  149. "pre": dat,
  150. "log": dat2,
  151. })
  152. }
  153. func (c *HBybController) Post2001() {
  154. org_name := c.GetString("org_name")
  155. doctor := c.GetString("doctor")
  156. fixmedins_code := c.GetString("fixmedins_code")
  157. insuplc_admdvs := c.GetString("insuplc_admdvs")
  158. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  159. secret_key := c.GetString("secret_key")
  160. psn_no := c.GetString("psn_no")
  161. insutype := c.GetString("insutype")
  162. med_type := c.GetString("med_type")
  163. result, inputLog := service.Hbyb2001(secret_key, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, psn_no, insutype, med_type)
  164. fmt.Println(result)
  165. fmt.Println(inputLog)
  166. var dat map[string]interface{}
  167. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  168. } else {
  169. }
  170. var dat2 map[string]interface{}
  171. if err := json.Unmarshal([]byte(inputLog), &dat2); err == nil {
  172. } else {
  173. }
  174. c.ServeSuccessJSON(map[string]interface{}{
  175. "pre": dat,
  176. "log": dat2,
  177. })
  178. }
  179. func (c *HBybController) PostOne() {
  180. certNo := c.GetString("cert_no")
  181. org_name := c.GetString("org_name")
  182. doctor := c.GetString("doctor")
  183. fixmedins_code := c.GetString("fixmedins_code")
  184. insuplc_admdvs := c.GetString("insuplc_admdvs")
  185. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  186. secret_key := c.GetString("secret_key")
  187. id_card_type, _ := c.GetInt64("id_card_type")
  188. card_sn := c.GetString("card_sn")
  189. certificates := c.GetString("certificates")
  190. fmt.Println(certNo)
  191. fmt.Println(org_name)
  192. fmt.Println(doctor)
  193. fmt.Println(fixmedins_code)
  194. fmt.Println(insuplc_admdvs)
  195. fmt.Println(mdtrtarea_admvs)
  196. fmt.Println(secret_key)
  197. fmt.Println(id_card_type)
  198. fmt.Println(card_sn)
  199. fmt.Println(certificates)
  200. result, inputLog := service.Hbyb1101(certNo, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type, card_sn, certificates)
  201. fmt.Println(result)
  202. fmt.Println(inputLog)
  203. var dat map[string]interface{}
  204. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  205. } else {
  206. }
  207. var dat2 map[string]interface{}
  208. if err := json.Unmarshal([]byte(inputLog), &dat2); err == nil {
  209. } else {
  210. }
  211. c.ServeSuccessJSON(map[string]interface{}{
  212. "pre": dat,
  213. "log": dat2,
  214. })
  215. }
  216. func (c *HBybController) PostTwo() {
  217. psnNo := c.GetString("psn_no")
  218. insutype := c.GetString("insutype")
  219. certNo := c.GetString("cert_no")
  220. org_name := c.GetString("org_name")
  221. doctor := c.GetString("doctor")
  222. ipt_otp_no := c.GetString("ipt_otp_no")
  223. dept := c.GetString("dept")
  224. fixmedins_code := c.GetString("fixmedins_code")
  225. opter := c.GetString("opter")
  226. dept_code := c.GetString("dept_code")
  227. doctor_id := c.GetString("doctor_id")
  228. doctor_name := c.GetString("doctor_name")
  229. insuplc_admdvs := c.GetString("insuplc_admdvs")
  230. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  231. secret_key := c.GetString("secret_key")
  232. id_card_type, _ := c.GetInt64("id_card_type")
  233. result, _ := service.Hbyb2201(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, opter, doctor_name)
  234. var dat map[string]interface{}
  235. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  236. //fmt.Println(dat["status"])
  237. } else {
  238. }
  239. c.ServeSuccessJSON(map[string]interface{}{
  240. "pre": dat,
  241. })
  242. }
  243. func (c *HBybController) PostThree() {
  244. psnNo := c.GetString("psn_no")
  245. mdtrtId := c.GetString("mdtrt_id")
  246. iptOtpNo := c.GetString("ipt_otp_no")
  247. org_name := c.GetString("org_name")
  248. doctor := c.GetString("doctor")
  249. insuplc_admdvs := c.GetString("insuplc_admdvs")
  250. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  251. secret_key := c.GetString("secret_key")
  252. fixmedins_code := c.GetString("fixmedins_code")
  253. result, requestLog := service.Hbyb2202(psnNo, mdtrtId, iptOtpNo, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code)
  254. var dat map[string]interface{}
  255. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  256. } else {
  257. }
  258. c.ServeSuccessJSON(map[string]interface{}{
  259. "pre": dat,
  260. "request_log": requestLog,
  261. })
  262. }
  263. func (c *HBybController) PostFour() {
  264. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  265. var respJSON map[string]interface{}
  266. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  267. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  268. return
  269. }
  270. userJSONBytes, _ := json.Marshal(respJSON["config"])
  271. var config []*models.HisXtDiagnoseConfig
  272. if err := json.Unmarshal(userJSONBytes, &config); err != nil {
  273. utils.ErrorLog("解析失败:%v", err)
  274. return
  275. }
  276. psnNo := respJSON["psn_no"].(string)
  277. mdtrtId := respJSON["mdtrt_id"].(string)
  278. opter := respJSON["opter"].(string)
  279. org_name := respJSON["org_name"].(string)
  280. med_type := respJSON["med_type"].(string)
  281. doctor_id := respJSON["doctor_id"].(string)
  282. doctor_name := respJSON["doctor_name"].(string)
  283. department := respJSON["department"].(string)
  284. fixmedins_code := respJSON["fixmedins_code"].(string)
  285. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  286. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  287. secret_key := respJSON["secret_key"].(string)
  288. sick_code := respJSON["sick_code"].(string)
  289. sick_name := respJSON["sick_name"].(string)
  290. dept := respJSON["dept"].(string)
  291. begin_time := respJSON["begin_time"].(string)
  292. result, request_log := service.Hbyb2203(psnNo, mdtrtId, dept, department, org_name, med_type, doctor_id, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, sick_code, sick_name, dept, config, begin_time, doctor_name, opter)
  293. fmt.Println(request_log)
  294. var dat map[string]interface{}
  295. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  296. } else {
  297. }
  298. c.ServeSuccessJSON(map[string]interface{}{
  299. "pre": dat,
  300. })
  301. }
  302. type All struct {
  303. HisPrescription HisPrescription
  304. mdtrt_id string
  305. psn_no string
  306. }
  307. type HisPrescription struct {
  308. ID int64 `gorm:"column:id" json:"id" form:"id"`
  309. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  310. RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
  311. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  312. HisPatientId int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
  313. Status int64 `gorm:"column:status" json:"status" form:"status"`
  314. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  315. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  316. Number string `gorm:"column:number" json:"number" form:"number"`
  317. Type int64 `gorm:"column:type" json:"type" form:"type"`
  318. Doctor int64 `gorm:"column:doctor" json:"doctor" form:"doctor"`
  319. Creator int64 `gorm:"column:creator" json:"creator" form:"creator"`
  320. Modifier int64 `gorm:"column:modifier" json:"modifier" form:"modifier"`
  321. HisDoctorAdviceInfo []*models.HisDoctorAdviceInfo `gorm:"ForeignKey:PatientId,RecordDate,PrescriptionId;AssociationForeignKey:PatientId,RecordDate,ID" json:"advices"`
  322. HisPrescriptionProject []*models.HisPrescriptionProject `gorm:"ForeignKey:PatientId,RecordDate,PrescriptionId;AssociationForeignKey:PatientId,RecordDate,ID" json:"project"`
  323. }
  324. func (c *HBybController) PostFive() {
  325. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  326. var respJSON map[string]interface{}
  327. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  328. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  329. return
  330. }
  331. userJSONBytes, _ := json.Marshal(respJSON["pre"])
  332. var hp []*models.HisPrescription
  333. if err := json.Unmarshal(userJSONBytes, &hp); err != nil {
  334. utils.ErrorLog("解析失败:%v", err)
  335. return
  336. }
  337. fmt.Println(respJSON["psn_no"].(string))
  338. fmt.Println(respJSON["mdtrt_id"].(string))
  339. fmt.Println(respJSON["chrg_bchno"].(string))
  340. fmt.Println(respJSON["org_name"].(string))
  341. fmt.Println(respJSON["doctor"].(string))
  342. fmt.Println(respJSON["doctor_id"].(string))
  343. fmt.Println(respJSON["dept"].(string))
  344. fmt.Println(respJSON["fixmedins_code"].(string))
  345. fmt.Println(respJSON["dept_code"].(string))
  346. fmt.Println(respJSON["balance_accounts_type"].(string))
  347. fmt.Println("1111111")
  348. fmt.Println(respJSON["opter"].(string))
  349. fmt.Println(respJSON["insuplc_admdvs"].(string))
  350. fmt.Println(respJSON["mdtrtarea_admvs"].(string))
  351. fmt.Println(respJSON["secret_key"].(string))
  352. result, requestLog := service.Hbyb2204(respJSON["psn_no"].(string), respJSON["mdtrt_id"].(string), hp, respJSON["chrg_bchno"].(string), respJSON["org_name"].(string),
  353. 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), respJSON["opter"].(string))
  354. var dat map[string]interface{}
  355. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  356. fmt.Println(dat)
  357. } else {
  358. fmt.Println(err)
  359. }
  360. var dat2 map[string]interface{}
  361. if err := json.Unmarshal([]byte(requestLog), &dat2); err == nil {
  362. fmt.Println(dat2)
  363. } else {
  364. fmt.Println(err)
  365. }
  366. c.ServeSuccessJSON(map[string]interface{}{
  367. "pre": dat,
  368. "request_log": requestLog,
  369. })
  370. }
  371. func (c *HBybController) PostSix() {
  372. psnNo := c.GetString("psn_no")
  373. mdtrtId := c.GetString("mdtrt_id")
  374. chrgBchno := c.GetString("chrg_bchno")
  375. org_name := c.GetString("org_name")
  376. doctor := c.GetString("doctor")
  377. insuplc_admdvs := c.GetString("insuplc_admdvs")
  378. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  379. secret_key := c.GetString("secret_key")
  380. fixmedins_code := c.GetString("fixmedins_code")
  381. result, requestlog := service.Hbyb2205(psnNo, mdtrtId, chrgBchno, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code)
  382. fmt.Println(requestlog)
  383. var dat map[string]interface{}
  384. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  385. fmt.Println(dat)
  386. } else {
  387. fmt.Println(err)
  388. }
  389. c.ServeSuccessJSON(map[string]interface{}{
  390. "pre": dat,
  391. })
  392. }
  393. func (c *HBybController) PostSeven() {
  394. psnNo := c.GetString("psn_no")
  395. mdtrtId := c.GetString("mdtrt_id")
  396. chrgBchno := c.GetString("chrg_bchno")
  397. certNo := c.GetString("cert_no")
  398. insutype := c.GetString("insutype")
  399. total := c.GetString("total")
  400. org_name := c.GetString("org_name")
  401. doctor := c.GetString("doctor")
  402. fixmedins_code := c.GetString("fixmedins_code")
  403. insuplc_admdvs := c.GetString("insuplc_admdvs")
  404. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  405. secret_key := c.GetString("secret_key")
  406. med_type := c.GetString("med_type")
  407. id_card_type, _ := c.GetInt64("id_card_type")
  408. certificates, _ := c.GetInt64("certificates")
  409. result, requestlog := service.Hbyb2206(psnNo, mdtrtId, chrgBchno, certNo, insutype, total, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, med_type, id_card_type, 0, 0, 0, 0, certificates)
  410. fmt.Println(requestlog)
  411. var dat map[string]interface{}
  412. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  413. fmt.Println(dat)
  414. } else {
  415. fmt.Println(err)
  416. }
  417. c.ServeSuccessJSON(map[string]interface{}{
  418. "pre": dat,
  419. })
  420. }
  421. func (c *HBybController) PostEight() {
  422. psnNo := c.GetString("psn_no")
  423. mdtrtId := c.GetString("mdtrt_id")
  424. chrgBchno := c.GetString("chrg_bchno")
  425. certNo := c.GetString("cert_no")
  426. insutype := c.GetString("insutype")
  427. total := c.GetString("total")
  428. org_name := c.GetString("org_name")
  429. doctor := c.GetString("doctor")
  430. fixmedins_code := c.GetString("fixmedins_code")
  431. insuplc_admdvs := c.GetString("insuplc_admdvs")
  432. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  433. secret_key := c.GetString("secret_key")
  434. med_type := c.GetString("med_type")
  435. id_card_type, _ := c.GetInt64("id_card_type")
  436. certificates, _ := c.GetInt64("certificates")
  437. fulamt_ownpay_amt, _ := c.GetFloat("fulamt_ownpay_amt")
  438. overlmt_selfpay, _ := c.GetFloat("overlmt_selfpay")
  439. preselfpay_amt, _ := c.GetFloat("preselfpay_amt")
  440. inscp_scp_amt, _ := c.GetFloat("inscp_scp_amt")
  441. acct_used_flag, _ := c.GetInt64("acct_used_flag")
  442. result, srcRequest := service.Hbyb2207(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, certificates, acct_used_flag)
  443. var dat map[string]interface{}
  444. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  445. fmt.Println(dat)
  446. } else {
  447. fmt.Println(err)
  448. }
  449. var dat2 map[string]interface{}
  450. if err := json.Unmarshal([]byte(srcRequest), &dat2); err == nil {
  451. fmt.Println(dat2)
  452. } else {
  453. fmt.Println(err)
  454. }
  455. c.ServeSuccessJSON(map[string]interface{}{
  456. "pre": dat,
  457. "pre2": dat2,
  458. })
  459. }
  460. func (c *HBybController) PostNine() {
  461. psnNo := c.GetString("psn_no")
  462. mdtrtId := c.GetString("mdtrt_id")
  463. setlId := c.GetString("setl_id")
  464. org_name := c.GetString("org_name")
  465. doctor := c.GetString("doctor")
  466. secret_key := c.GetString("secret_key")
  467. fixmedins_code := c.GetString("fixmedins_code")
  468. insuplc_admdvs := c.GetString("insuplc_admdvs")
  469. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  470. result, src_request := service.Hbyb2208(psnNo, mdtrtId, setlId, org_name, doctor, secret_key, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
  471. fmt.Println(src_request)
  472. var dat map[string]interface{}
  473. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  474. fmt.Println(dat)
  475. } else {
  476. fmt.Println(err)
  477. }
  478. c.ServeSuccessJSON(map[string]interface{}{
  479. "pre": dat,
  480. })
  481. }
  482. func (c *HBybController) PostTen() {
  483. psnNo := c.GetString("psn_no")
  484. mdtrtId := c.GetString("mdtrt_id")
  485. setlId := c.GetString("setl_id")
  486. org_name := c.GetString("org_name")
  487. doctor := c.GetString("doctor")
  488. med_type := c.GetString("med_type")
  489. secret_key := c.GetString("secret_key")
  490. fixmedins_code := c.GetString("fixmedins_code")
  491. insuplc_admdvs := c.GetString("insuplc_admdvs")
  492. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  493. baseParams := models.BaseParams{
  494. SecretKey: secret_key,
  495. FixmedinsCode: fixmedins_code,
  496. InsuplcAdmdvs: insuplc_admdvs,
  497. MdtrtareaAdmvs: mdtrtarea_admvs,
  498. OrgName: org_name,
  499. Doctor: doctor,
  500. }
  501. businessParams := models.BusinessParams{
  502. PsnNo: psnNo,
  503. MdtrtId: mdtrtId,
  504. SetlId: setlId,
  505. }
  506. result := service.Hbyb5203(baseParams, businessParams, med_type)
  507. var dat map[string]interface{}
  508. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  509. fmt.Println(dat)
  510. } else {
  511. fmt.Println(err)
  512. }
  513. c.ServeSuccessJSON(map[string]interface{}{
  514. "pre": dat,
  515. })
  516. }