hbyb_controller.go 38KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158
  1. package hb
  2. import (
  3. "encoding/json"
  4. "fmt"
  5. "time"
  6. "os"
  7. "gdyb/controllers"
  8. "gdyb/models"
  9. "gdyb/service"
  10. "gdyb/utils"
  11. "github.com/astaxie/beego"
  12. "io/ioutil"
  13. )
  14. type HBybController struct {
  15. controllers.BaseAuthAPIController
  16. }
  17. func HbybRegistRouters() {
  18. beego.Router("/hbyb/1101", &HBybController{}, "get:PostOne")
  19. beego.Router("/hbyb/2201", &HBybController{}, "get:PostTwo")
  20. beego.Router("/hbyb/2202", &HBybController{}, "get:PostThree")
  21. beego.Router("/hbyb/2203", &HBybController{}, "post:PostFour")
  22. beego.Router("/hbyb/2204", &HBybController{}, "post:PostFive")
  23. beego.Router("/hbyb/2205", &HBybController{}, "get:PostSix")
  24. beego.Router("/hbyb/2206", &HBybController{}, "get:PostSeven")
  25. beego.Router("/hbyb/2207", &HBybController{}, "get:PostEight")
  26. beego.Router("/hbyb/2208", &HBybController{}, "get:PostNine")
  27. beego.Router("/hbyb/5203", &HBybController{}, "get:PostTen")
  28. beego.Router("/hbyb/2001", &HBybController{}, "get:Post2001")
  29. beego.Router("/hbyb/3202", &HBybController{}, "post:Post3202a")
  30. beego.Router("/hbyb/1608", &HBybController{}, "post:Post1608")
  31. beego.Router("/hbyb/3202b", &HBybController{}, "post:Post3202b")
  32. //beego.Router("/hbyb/3202c", &HBybController{}, "post:Post3202")
  33. beego.Router("/hbyb/4101", &HBybController{}, "post:Post4101")
  34. beego.Router("/hbyb/5262", &HBybController{}, "post:Post5262")
  35. beego.Router("/hbyb/5267", &HBybController{}, "post:Post5267")
  36. beego.Router("/hbyb/5301", &HBybController{}, "get:Post5301")
  37. beego.Router("/hbyb/2401", &HBybController{}, "post:Post2401")
  38. beego.Router("/hbyb/2402", &HBybController{}, "post:Post2402")
  39. beego.Router("/hbyb/2404", &HBybController{}, "get:Post2404")
  40. beego.Router("/hbyb/2405", &HBybController{}, "get:Post2405")
  41. beego.Router("/hbyb/2301", &HBybController{}, "post:Post2301")
  42. beego.Router("/hbyb/2302", &HBybController{}, "get:Post2302")
  43. beego.Router("/hbyb/2303", &HBybController{}, "get:Post2303")
  44. beego.Router("/hbyb/2304", &HBybController{}, "get:Post2304")
  45. beego.Router("/hbyb/2305", &HBybController{}, "get:Post2305")
  46. beego.Router("/hbyb/3204", &HBybController{}, "post:Post3204")
  47. beego.Router("/hbyb/8404", &HBybController{}, "post:Post8404")
  48. beego.Router("/hbyb/3204a", &HBybController{}, "post:Post3204a")
  49. }
  50. func (c *HBybController) Post2401() {
  51. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  52. var respJSON map[string]interface{}
  53. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  54. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  55. return
  56. }
  57. userJSONBytes, _ := json.Marshal(respJSON["struct_2401"])
  58. var struct2401 service.Struct2401
  59. if err := json.Unmarshal(userJSONBytes, &struct2401); err != nil {
  60. utils.ErrorLog("解析失败:%v", err)
  61. return
  62. }
  63. org_name := respJSON["org_name"].(string)
  64. fixmedins_code := respJSON["fixmedins_code"].(string)
  65. doctor := respJSON["doctor"].(string)
  66. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  67. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  68. secret_key := respJSON["secret_key"].(string)
  69. result, request_log := service.Hbyb2401(struct2401, secret_key, org_name, fixmedins_code, doctor, insuplc_admdvs, mdtrtarea_admvs)
  70. saveJsLog(result, request_log, "2401", "入院登记", org_name)
  71. var dat2 map[string]interface{}
  72. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  73. } else {
  74. }
  75. var dat map[string]interface{}
  76. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  77. } else {
  78. }
  79. c.ServeSuccessJSON(map[string]interface{}{
  80. "pre": dat,
  81. "request_log": dat2,
  82. })
  83. }
  84. func (c *HBybController) Post2404() {
  85. mdtrt_id := c.GetString("mdtrt_id")
  86. psn_no := c.GetString("psn_no")
  87. doctor := c.GetString("doctor")
  88. fixmedins_code := c.GetString("fixmedins_code")
  89. insuplc_admdvs := c.GetString("insuplc_admdvs")
  90. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  91. secret_key := c.GetString("secret_key")
  92. org_name := c.GetString("org_name")
  93. result, requestLog := service.Hbyb2404(mdtrt_id, psn_no, secret_key, org_name, fixmedins_code, doctor, insuplc_admdvs, mdtrtarea_admvs)
  94. saveJsLog(result, requestLog, "2404", "入院登记撤销", org_name)
  95. var dat map[string]interface{}
  96. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  97. } else {
  98. }
  99. var dat2 map[string]interface{}
  100. if err := json.Unmarshal([]byte(requestLog), &dat2); err == nil {
  101. } else {
  102. }
  103. c.ServeSuccessJSON(map[string]interface{}{
  104. "pre": dat,
  105. "log": dat2,
  106. })
  107. }
  108. func (c *HBybController) Post2405() {
  109. mdtrt_id := c.GetString("mdtrt_id")
  110. psn_no := c.GetString("psn_no")
  111. doctor := c.GetString("doctor")
  112. fixmedins_code := c.GetString("fixmedins_code")
  113. insuplc_admdvs := c.GetString("insuplc_admdvs")
  114. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  115. secret_key := c.GetString("secret_key")
  116. org_name := c.GetString("org_name")
  117. result, requestLog := service.Hb2405(mdtrt_id, psn_no, secret_key, org_name, fixmedins_code, doctor, insuplc_admdvs, mdtrtarea_admvs)
  118. saveJsLog(result, requestLog, "2405", "出院登记撤销", org_name)
  119. var dat map[string]interface{}
  120. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  121. } else {
  122. }
  123. var dat2 map[string]interface{}
  124. if err := json.Unmarshal([]byte(requestLog), &dat2); err == nil {
  125. } else {
  126. }
  127. c.ServeSuccessJSON(map[string]interface{}{
  128. "pre": dat,
  129. "log": dat2,
  130. })
  131. }
  132. func (c *HBybController) Post2402() {
  133. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  134. var respJSON map[string]interface{}
  135. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  136. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  137. return
  138. }
  139. userJSONBytes, _ := json.Marshal(respJSON["struct_2402"])
  140. var struct2402 service.Struct2402
  141. if err := json.Unmarshal(userJSONBytes, &struct2402); err != nil {
  142. utils.ErrorLog("解析失败:%v", err)
  143. return
  144. }
  145. org_name := respJSON["org_name"].(string)
  146. fixmedins_code := respJSON["fixmedins_code"].(string)
  147. doctor := respJSON["doctor"].(string)
  148. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  149. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  150. secret_key := respJSON["secret_key"].(string)
  151. result, request_log := service.Hb2402(struct2402, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code)
  152. saveJsLog(result, request_log, "2402", "出院", org_name)
  153. var dat2 map[string]interface{}
  154. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  155. } else {
  156. }
  157. var dat map[string]interface{}
  158. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  159. } else {
  160. }
  161. c.ServeSuccessJSON(map[string]interface{}{
  162. "pre": dat,
  163. "request_log": dat2,
  164. })
  165. }
  166. func (c *HBybController) Post2301() {
  167. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  168. var respJSON map[string]interface{}
  169. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  170. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  171. return
  172. }
  173. userJSONBytes, _ := json.Marshal(respJSON["customs"])
  174. var customs []*models.NewCustom
  175. if err := json.Unmarshal(userJSONBytes, &customs); err != nil {
  176. utils.ErrorLog("解析失败:%v", err)
  177. return
  178. }
  179. number := respJSON["number"].(string)
  180. chrg_bchno := respJSON["chrg_bchno"].(string)
  181. dept := respJSON["dept"].(string)
  182. dept_code := respJSON["dept_code"].(string)
  183. doctor_code := respJSON["doctor_code"].(string)
  184. doctor_name := respJSON["doctor_name"].(string)
  185. opertor := respJSON["opertor"].(string)
  186. org_name := respJSON["org_name"].(string)
  187. fixmedins_code := respJSON["fixmedins_code"].(string)
  188. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  189. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  190. secret_key := respJSON["secret_key"].(string)
  191. med_type := respJSON["med_type"].(string)
  192. //med_type := strconv.FormatInt(int64(respJSON["med_type"].(float64)), 10)
  193. psn_no := respJSON["psn_no"].(string)
  194. result, requestLog := service.Hb2301A(psn_no, number, customs, chrg_bchno, org_name, doctor_name, dept, fixmedins_code, dept_code, doctor_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, med_type, opertor)
  195. saveJsLog(result, requestLog, "2301", "上传明细", org_name)
  196. var dat2 map[string]interface{}
  197. if err := json.Unmarshal([]byte(requestLog), &dat2); err == nil {
  198. } else {
  199. }
  200. var dat map[string]interface{}
  201. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  202. } else {
  203. }
  204. c.ServeSuccessJSON(map[string]interface{}{
  205. "pre": dat,
  206. "request_log": dat2,
  207. })
  208. }
  209. func (c *HBybController) Post2302() {
  210. mdtrt_id := c.GetString("mdtrtId")
  211. psn_no := c.GetString("psn_no")
  212. number := c.GetString("feedetl_sn")
  213. doctor := c.GetString("doctor")
  214. fixmedins_code := c.GetString("fixmedins_code")
  215. insuplc_admdvs := c.GetString("insuplc_admdvs")
  216. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  217. secret_key := c.GetString("secret_key")
  218. org_name := c.GetString("org_name")
  219. refund_type, _ := c.GetInt64("refund_type")
  220. result, requestLog := service.Hb2302(psn_no, mdtrt_id, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code, number, refund_type)
  221. saveJsLog(result, requestLog, "2302", "退明细", org_name)
  222. var dat2 map[string]interface{}
  223. if err := json.Unmarshal([]byte(requestLog), &dat2); err == nil {
  224. } else {
  225. }
  226. var dat map[string]interface{}
  227. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  228. } else {
  229. }
  230. c.ServeSuccessJSON(map[string]interface{}{
  231. "pre": dat,
  232. "request_log": dat2,
  233. })
  234. }
  235. func (c *HBybController) Post2303() {
  236. mdtrt_id := c.GetString("mdtrt_id")
  237. psn_no := c.GetString("psn_no")
  238. chrg_bchno := c.GetString("chrg_bchno")
  239. cert_no := c.GetString("cert_no")
  240. insutype_type := c.GetString("insutype_type")
  241. allTotal := c.GetString("total")
  242. id_card_type, _ := c.GetInt64("id_card_type")
  243. doctor := c.GetString("doctor")
  244. certificates, _ := c.GetInt64("certificates")
  245. fixmedins_code := c.GetString("fixmedins_code")
  246. insuplc_admdvs := c.GetString("insuplc_admdvs")
  247. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  248. secret_key := c.GetString("secret_key")
  249. org_name := c.GetString("org_name")
  250. result, src_resquest := service.Hb2303(psn_no, mdtrt_id, chrg_bchno, cert_no, insutype_type, allTotal, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, "0", id_card_type, 0, 0, 0, 0, certificates)
  251. saveJsLog(result, src_resquest, "2303", "预结算", org_name)
  252. var dat2 map[string]interface{}
  253. if err := json.Unmarshal([]byte(src_resquest), &dat2); err == nil {
  254. } else {
  255. }
  256. var dat map[string]interface{}
  257. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  258. } else {
  259. }
  260. c.ServeSuccessJSON(map[string]interface{}{
  261. "pre": dat,
  262. "request_log": dat2,
  263. })
  264. }
  265. func (c *HBybController) Post2304() {
  266. mdtrt_id := c.GetString("mdtrt_id")
  267. psn_no := c.GetString("psn_no")
  268. chrg_bchno := c.GetString("chrg_bchno")
  269. cert_no := c.GetString("cert_no")
  270. insutype_type := c.GetString("insutype_type")
  271. allTotal := c.GetString("total")
  272. id_card_type, _ := c.GetInt64("id_card_type")
  273. doctor := c.GetString("doctor")
  274. certificates, _ := c.GetInt64("certificates")
  275. fixmedins_code := c.GetString("fixmedins_code")
  276. insuplc_admdvs := c.GetString("insuplc_admdvs")
  277. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  278. secret_key := c.GetString("secret_key")
  279. org_name := c.GetString("org_name")
  280. fapiao_number := c.GetString("fapiao_number")
  281. acct_used_flag := c.GetString("acct_used_flag")
  282. result, src_resquest := service.Hb2304(psn_no, mdtrt_id, chrg_bchno, cert_no, insutype_type, allTotal, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, "0", id_card_type, 0, 0, 0, 0, certificates, fapiao_number, acct_used_flag)
  283. saveJsLog(result, src_resquest, "2304", "住院结算", org_name)
  284. var dat2 map[string]interface{}
  285. if err := json.Unmarshal([]byte(src_resquest), &dat2); err == nil {
  286. } else {
  287. }
  288. var dat map[string]interface{}
  289. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  290. } else {
  291. }
  292. c.ServeSuccessJSON(map[string]interface{}{
  293. "pre": dat,
  294. "request_log": dat2,
  295. })
  296. }
  297. func (c *HBybController) Post2305() {
  298. mdtrt_id := c.GetString("mdtrt_id")
  299. psn_no := c.GetString("psn_no")
  300. doctor := c.GetString("doctor")
  301. setl_id := c.GetString("setl_id")
  302. fixmedins_code := c.GetString("fixmedins_code")
  303. insuplc_admdvs := c.GetString("insuplc_admdvs")
  304. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  305. secret_key := c.GetString("secret_key")
  306. org_name := c.GetString("org_name")
  307. result, requestLog := service.Hb2305(psn_no, mdtrt_id, setl_id, org_name, doctor, secret_key, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
  308. saveJsLog(result, requestLog, "2305", "退费", org_name)
  309. var dat2 map[string]interface{}
  310. if err := json.Unmarshal([]byte(requestLog), &dat2); err == nil {
  311. } else {
  312. }
  313. var dat map[string]interface{}
  314. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  315. } else {
  316. }
  317. c.ServeSuccessJSON(map[string]interface{}{
  318. "pre": dat,
  319. "request_log": dat2,
  320. })
  321. }
  322. func (c *HBybController)Post5301(){
  323. org_name := c.GetString("org_name")
  324. doctor := c.GetString("doctor")
  325. fixmedins_code := c.GetString("fixmedins_code")
  326. insuplc_admdvs := c.GetString("insuplc_admdvs")
  327. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  328. secret_key := c.GetString("secret_key")
  329. psn_no := c.GetString("psn_no")
  330. result := service.Hbyb5301(psn_no,"",org_name, doctor,fixmedins_code,"",insuplc_admdvs,mdtrtarea_admvs,secret_key,"","")
  331. var dat map[string]interface{}
  332. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  333. fmt.Println(dat)
  334. } else {
  335. fmt.Println(err)
  336. }
  337. c.ServeSuccessJSON(map[string]interface{}{
  338. "pre": dat,
  339. })
  340. }
  341. func (c *HBybController)Post5262(){
  342. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  343. var respJSON map[string]interface{}
  344. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  345. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  346. return
  347. }
  348. userJSONBytes, _ := json.Marshal(respJSON["bps"])
  349. var bps models.BusinessParams5262
  350. if err := json.Unmarshal(userJSONBytes, &bps); err != nil {
  351. utils.ErrorLog("解析失败:%v", err)
  352. return
  353. }
  354. var baseParams models.BaseParams
  355. baseParams.InsuplcAdmdvs = respJSON["insuplc_admdvs"].(string)
  356. baseParams.MdtrtareaAdmvs = respJSON["mdtrtarea_admvs"].(string)
  357. baseParams.OrgName = respJSON["org_name"].(string)
  358. baseParams.Doctor = respJSON["doctor"].(string)
  359. baseParams.FixmedinsCode = respJSON["fixmedins_code"].(string)
  360. page := respJSON["page"].(string)
  361. limit := respJSON["limit"].(string)
  362. result := service.Hbyb5262(baseParams, bps,page,limit)
  363. var dat map[string]interface{}
  364. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  365. fmt.Println(dat)
  366. } else {
  367. fmt.Println(err)
  368. }
  369. c.ServeSuccessJSON(map[string]interface{}{
  370. "pre": dat,
  371. })
  372. }
  373. func (c *HBybController)Post5267(){
  374. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  375. var respJSON map[string]interface{}
  376. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  377. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  378. return
  379. }
  380. userJSONBytes, _ := json.Marshal(respJSON["bps"])
  381. var bps models.BusinessParams5262
  382. if err := json.Unmarshal(userJSONBytes, &bps); err != nil {
  383. utils.ErrorLog("解析失败:%v", err)
  384. return
  385. }
  386. var baseParams models.BaseParams
  387. baseParams.InsuplcAdmdvs = respJSON["insuplc_admdvs"].(string)
  388. baseParams.MdtrtareaAdmvs = respJSON["mdtrtarea_admvs"].(string)
  389. baseParams.OrgName = respJSON["org_name"].(string)
  390. baseParams.Doctor = respJSON["doctor"].(string)
  391. baseParams.FixmedinsCode = respJSON["fixmedins_code"].(string)
  392. page := respJSON["page"].(string)
  393. limit := respJSON["limit"].(string)
  394. result := service.Hbyb5267(baseParams, bps,page,limit)
  395. var dat map[string]interface{}
  396. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  397. fmt.Println(dat)
  398. } else {
  399. fmt.Println(err)
  400. }
  401. c.ServeSuccessJSON(map[string]interface{}{
  402. "pre": dat,
  403. })
  404. }
  405. func (c *HBybController) Post3202a() {
  406. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  407. var respJSON map[string]interface{}
  408. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  409. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  410. return
  411. }
  412. userJSONBytes, _ := json.Marshal(respJSON["bps"])
  413. var bps []*models.BusinessParamsTwo
  414. if err := json.Unmarshal(userJSONBytes, &bps); err != nil {
  415. utils.ErrorLog("解析失败:%v", err)
  416. return
  417. }
  418. var baseParams models.BaseParams
  419. baseParams.InsuplcAdmdvs = respJSON["insuplc_admdvs"].(string)
  420. baseParams.MdtrtareaAdmvs = respJSON["mdtrtarea_admvs"].(string)
  421. baseParams.OrgName = respJSON["org_name"].(string)
  422. baseParams.Doctor = respJSON["doctor"].(string)
  423. baseParams.FixmedinsCode = respJSON["fixmedins_code"].(string)
  424. result := service.Hbyb3202a(baseParams, bps)
  425. var dat map[string]interface{}
  426. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  427. fmt.Println(dat)
  428. } else {
  429. fmt.Println(err)
  430. }
  431. c.ServeSuccessJSON(map[string]interface{}{
  432. "pre": dat,
  433. })
  434. }
  435. func (c *HBybController) Post3204a() {
  436. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  437. var respJSON map[string]interface{}
  438. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  439. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  440. return
  441. }
  442. userJSONBytes, _ := json.Marshal(respJSON["bps"])
  443. var bps []*models.BusinessParamsTwo
  444. if err := json.Unmarshal(userJSONBytes, &bps); err != nil {
  445. utils.ErrorLog("解析失败:%v", err)
  446. return
  447. }
  448. var baseParams models.BaseParams
  449. baseParams.InsuplcAdmdvs = respJSON["insuplc_admdvs"].(string)
  450. baseParams.MdtrtareaAdmvs = respJSON["mdtrtarea_admvs"].(string)
  451. baseParams.OrgName = respJSON["org_name"].(string)
  452. baseParams.Doctor = respJSON["doctor"].(string)
  453. baseParams.FixmedinsCode = respJSON["fixmedins_code"].(string)
  454. result := service.Hbyb3204a(baseParams, bps)
  455. var dat map[string]interface{}
  456. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  457. fmt.Println(dat)
  458. } else {
  459. fmt.Println(err)
  460. }
  461. c.ServeSuccessJSON(map[string]interface{}{
  462. "pre": dat,
  463. })
  464. }
  465. func (c *HBybController) Post3204() {
  466. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  467. var respJSON map[string]interface{}
  468. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  469. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  470. return
  471. }
  472. var baseParams models.BaseParams
  473. baseParams.InsuplcAdmdvs = respJSON["insuplc_admdvs"].(string)
  474. baseParams.MdtrtareaAdmvs = respJSON["mdtrtarea_admvs"].(string)
  475. baseParams.OrgName = respJSON["org_name"].(string)
  476. baseParams.Doctor = respJSON["doctor"].(string)
  477. baseParams.FixmedinsCode = respJSON["fixmedins_code"].(string)
  478. result := service.Hbyb3204(baseParams, respJSON["id"].(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. }
  489. func (c *HBybController) Post8404() {
  490. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  491. var respJSON map[string]interface{}
  492. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  493. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  494. return
  495. }
  496. var baseParams models.BaseParams
  497. baseParams.InsuplcAdmdvs = respJSON["insuplc_admdvs"].(string)
  498. baseParams.MdtrtareaAdmvs = respJSON["mdtrtarea_admvs"].(string)
  499. baseParams.OrgName = respJSON["org_name"].(string)
  500. baseParams.Doctor = respJSON["doctor"].(string)
  501. baseParams.FixmedinsCode = respJSON["fixmedins_code"].(string)
  502. result := service.Hbyb8404(baseParams,respJSON["month"].(string))
  503. var dat map[string]interface{}
  504. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  505. fmt.Println(dat)
  506. } else {
  507. fmt.Println(err)
  508. }
  509. c.ServeSuccessJSON(map[string]interface{}{
  510. "pre": dat,
  511. })
  512. }
  513. func (c *HBybController) Post1608() {
  514. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  515. var respJSON map[string]interface{}
  516. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  517. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  518. return
  519. }
  520. var baseParams models.BaseParams
  521. baseParams.InsuplcAdmdvs = respJSON["insuplc_admdvs"].(string)
  522. baseParams.MdtrtareaAdmvs = respJSON["mdtrtarea_admvs"].(string)
  523. baseParams.OrgName = respJSON["org_name"].(string)
  524. baseParams.Doctor = respJSON["doctor"].(string)
  525. baseParams.FixmedinsCode = respJSON["fixmedins_code"].(string)
  526. cnt := respJSON["cnt"].(string)
  527. medfee_sumamt := respJSON["medfee_sumamt"].(string)
  528. func_smamt := respJSON["func_smamt"].(string)
  529. start_time := respJSON["start_time"].(string)
  530. end_time := respJSON["end_time"].(string)
  531. result := service.Hbyb1608(baseParams,cnt,medfee_sumamt,start_time,end_time,func_smamt)
  532. var dat map[string]interface{}
  533. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  534. fmt.Println(dat)
  535. } else {
  536. fmt.Println(err)
  537. }
  538. c.ServeSuccessJSON(map[string]interface{}{
  539. "pre": dat,
  540. })
  541. }
  542. func (c *HBybController) Post3202b() {
  543. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  544. var respJSON map[string]interface{}
  545. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  546. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  547. return
  548. }
  549. userJSONBytes, _ := json.Marshal(respJSON["bps"])
  550. var bps []*models.BusinessParamsTwo
  551. if err := json.Unmarshal(userJSONBytes, &bps); err != nil {
  552. utils.ErrorLog("解析失败:%v", err)
  553. return
  554. }
  555. var baseParams models.BaseParams
  556. baseParams.InsuplcAdmdvs = respJSON["insuplc_admdvs"].(string)
  557. baseParams.MdtrtareaAdmvs = respJSON["mdtrtarea_admvs"].(string)
  558. baseParams.OrgName = respJSON["org_name"].(string)
  559. baseParams.Doctor = respJSON["doctor"].(string)
  560. baseParams.FixmedinsCode = respJSON["fixmedins_code"].(string)
  561. result := service.Hbyb3202b(baseParams, bps)
  562. var dat map[string]interface{}
  563. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  564. fmt.Println(dat)
  565. } else {
  566. fmt.Println(err)
  567. }
  568. c.ServeSuccessJSON(map[string]interface{}{
  569. "pre": dat,
  570. })
  571. }
  572. func (c *HBybController) Post4101() {
  573. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  574. var respJSON map[string]interface{}
  575. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  576. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  577. return
  578. }
  579. userJSONBytes, _ := json.Marshal(respJSON["struct4101"])
  580. var struct4101 service.Struct4101
  581. if err := json.Unmarshal(userJSONBytes, &struct4101); err != nil {
  582. utils.ErrorLog("解析失败:%v", err)
  583. return
  584. }
  585. 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))
  586. var dat map[string]interface{}
  587. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  588. } else {
  589. }
  590. var dat2 map[string]interface{}
  591. if err := json.Unmarshal([]byte(inputLog), &dat2); err == nil {
  592. } else {
  593. }
  594. c.ServeSuccessJSON(map[string]interface{}{
  595. "pre": dat,
  596. "log": dat2,
  597. })
  598. }
  599. func (c *HBybController) Post2001() {
  600. org_name := c.GetString("org_name")
  601. doctor := c.GetString("doctor")
  602. fixmedins_code := c.GetString("fixmedins_code")
  603. insuplc_admdvs := c.GetString("insuplc_admdvs")
  604. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  605. secret_key := c.GetString("secret_key")
  606. psn_no := c.GetString("psn_no")
  607. insutype := c.GetString("insutype")
  608. med_type := c.GetString("med_type")
  609. result, inputLog := service.Hbyb2001(secret_key, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, psn_no, insutype, med_type)
  610. fmt.Println(result)
  611. fmt.Println(inputLog)
  612. var dat map[string]interface{}
  613. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  614. } else {
  615. }
  616. var dat2 map[string]interface{}
  617. if err := json.Unmarshal([]byte(inputLog), &dat2); err == nil {
  618. } else {
  619. }
  620. c.ServeSuccessJSON(map[string]interface{}{
  621. "pre": dat,
  622. "log": dat2,
  623. })
  624. }
  625. func (c *HBybController) PostOne() {
  626. certNo := c.GetString("cert_no")
  627. org_name := c.GetString("org_name")
  628. doctor := c.GetString("doctor")
  629. fixmedins_code := c.GetString("fixmedins_code")
  630. insuplc_admdvs := c.GetString("insuplc_admdvs")
  631. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  632. secret_key := c.GetString("secret_key")
  633. id_card_type, _ := c.GetInt64("id_card_type")
  634. card_sn := c.GetString("card_sn")
  635. certificates := c.GetString("certificates")
  636. fmt.Println(certNo)
  637. fmt.Println(org_name)
  638. fmt.Println(doctor)
  639. fmt.Println(fixmedins_code)
  640. fmt.Println(insuplc_admdvs)
  641. fmt.Println(mdtrtarea_admvs)
  642. fmt.Println(secret_key)
  643. fmt.Println(id_card_type)
  644. fmt.Println(card_sn)
  645. fmt.Println(certificates)
  646. result, inputLog := service.Hbyb1101(certNo, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type, card_sn, certificates)
  647. fmt.Println(result)
  648. fmt.Println(inputLog)
  649. var dat map[string]interface{}
  650. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  651. } else {
  652. }
  653. var dat2 map[string]interface{}
  654. if err := json.Unmarshal([]byte(inputLog), &dat2); err == nil {
  655. } else {
  656. }
  657. c.ServeSuccessJSON(map[string]interface{}{
  658. "pre": dat,
  659. "log": dat2,
  660. })
  661. }
  662. func (c *HBybController) PostTwo() {
  663. psnNo := c.GetString("psn_no")
  664. insutype := c.GetString("insutype")
  665. certNo := c.GetString("cert_no")
  666. org_name := c.GetString("org_name")
  667. doctor := c.GetString("doctor")
  668. ipt_otp_no := c.GetString("ipt_otp_no")
  669. dept := c.GetString("dept")
  670. fixmedins_code := c.GetString("fixmedins_code")
  671. opter := c.GetString("opter")
  672. dept_code := c.GetString("dept_code")
  673. doctor_id := c.GetString("doctor_id")
  674. doctor_name := c.GetString("doctor_name")
  675. insuplc_admdvs := c.GetString("insuplc_admdvs")
  676. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  677. secret_key := c.GetString("secret_key")
  678. id_card_type, _ := c.GetInt64("id_card_type")
  679. 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)
  680. var dat map[string]interface{}
  681. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  682. //fmt.Println(dat["status"])
  683. } else {
  684. }
  685. c.ServeSuccessJSON(map[string]interface{}{
  686. "pre": dat,
  687. })
  688. }
  689. func (c *HBybController) PostThree() {
  690. psnNo := c.GetString("psn_no")
  691. mdtrtId := c.GetString("mdtrt_id")
  692. iptOtpNo := c.GetString("ipt_otp_no")
  693. org_name := c.GetString("org_name")
  694. doctor := c.GetString("doctor")
  695. insuplc_admdvs := c.GetString("insuplc_admdvs")
  696. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  697. secret_key := c.GetString("secret_key")
  698. fixmedins_code := c.GetString("fixmedins_code")
  699. result, requestLog := service.Hbyb2202(psnNo, mdtrtId, iptOtpNo, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code)
  700. var dat map[string]interface{}
  701. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  702. } else {
  703. }
  704. c.ServeSuccessJSON(map[string]interface{}{
  705. "pre": dat,
  706. "request_log": requestLog,
  707. })
  708. }
  709. func (c *HBybController) PostFour() {
  710. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  711. var respJSON map[string]interface{}
  712. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  713. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  714. return
  715. }
  716. userJSONBytes, _ := json.Marshal(respJSON["config"])
  717. var config []*models.HisXtDiagnoseConfig
  718. if err := json.Unmarshal(userJSONBytes, &config); err != nil {
  719. utils.ErrorLog("解析失败:%v", err)
  720. return
  721. }
  722. psnNo := respJSON["psn_no"].(string)
  723. mdtrtId := respJSON["mdtrt_id"].(string)
  724. opter := respJSON["opter"].(string)
  725. org_name := respJSON["org_name"].(string)
  726. med_type := respJSON["med_type"].(string)
  727. doctor_id := respJSON["doctor_id"].(string)
  728. doctor_name := respJSON["doctor_name"].(string)
  729. department := respJSON["department"].(string)
  730. fixmedins_code := respJSON["fixmedins_code"].(string)
  731. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  732. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  733. secret_key := respJSON["secret_key"].(string)
  734. sick_code := respJSON["sick_code"].(string)
  735. sick_name := respJSON["sick_name"].(string)
  736. dept := respJSON["dept"].(string)
  737. begin_time := respJSON["begin_time"].(string)
  738. 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)
  739. fmt.Println(request_log)
  740. var dat map[string]interface{}
  741. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  742. } else {
  743. }
  744. c.ServeSuccessJSON(map[string]interface{}{
  745. "pre": dat,
  746. })
  747. }
  748. type All struct {
  749. HisPrescription HisPrescription
  750. mdtrt_id string
  751. psn_no string
  752. }
  753. type HisPrescription struct {
  754. ID int64 `gorm:"column:id" json:"id" form:"id"`
  755. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  756. RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
  757. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  758. HisPatientId int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
  759. Status int64 `gorm:"column:status" json:"status" form:"status"`
  760. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  761. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  762. Number string `gorm:"column:number" json:"number" form:"number"`
  763. Type int64 `gorm:"column:type" json:"type" form:"type"`
  764. Doctor int64 `gorm:"column:doctor" json:"doctor" form:"doctor"`
  765. Creator int64 `gorm:"column:creator" json:"creator" form:"creator"`
  766. Modifier int64 `gorm:"column:modifier" json:"modifier" form:"modifier"`
  767. HisDoctorAdviceInfo []*models.HisDoctorAdviceInfo `gorm:"ForeignKey:PatientId,RecordDate,PrescriptionId;AssociationForeignKey:PatientId,RecordDate,ID" json:"advices"`
  768. HisPrescriptionProject []*models.HisPrescriptionProject `gorm:"ForeignKey:PatientId,RecordDate,PrescriptionId;AssociationForeignKey:PatientId,RecordDate,ID" json:"project"`
  769. }
  770. func (c *HBybController) PostFive() {
  771. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  772. var respJSON map[string]interface{}
  773. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  774. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  775. return
  776. }
  777. userJSONBytes, _ := json.Marshal(respJSON["pre"])
  778. var hp []*models.HisPrescription
  779. if err := json.Unmarshal(userJSONBytes, &hp); err != nil {
  780. utils.ErrorLog("解析失败:%v", err)
  781. return
  782. }
  783. fmt.Println(respJSON["psn_no"].(string))
  784. fmt.Println(respJSON["mdtrt_id"].(string))
  785. fmt.Println(respJSON["chrg_bchno"].(string))
  786. fmt.Println(respJSON["org_name"].(string))
  787. fmt.Println(respJSON["doctor"].(string))
  788. fmt.Println(respJSON["doctor_id"].(string))
  789. fmt.Println(respJSON["dept"].(string))
  790. fmt.Println(respJSON["fixmedins_code"].(string))
  791. fmt.Println(respJSON["dept_code"].(string))
  792. fmt.Println(respJSON["balance_accounts_type"].(string))
  793. fmt.Println("1111111")
  794. fmt.Println(respJSON["opter"].(string))
  795. fmt.Println(respJSON["insuplc_admdvs"].(string))
  796. fmt.Println(respJSON["mdtrtarea_admvs"].(string))
  797. fmt.Println(respJSON["secret_key"].(string))
  798. result, requestLog := service.Hbyb2204(respJSON["psn_no"].(string), respJSON["mdtrt_id"].(string), hp, respJSON["chrg_bchno"].(string), respJSON["org_name"].(string),
  799. 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))
  800. var dat map[string]interface{}
  801. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  802. fmt.Println(dat)
  803. } else {
  804. fmt.Println(err)
  805. }
  806. var dat2 map[string]interface{}
  807. if err := json.Unmarshal([]byte(requestLog), &dat2); err == nil {
  808. fmt.Println(dat2)
  809. } else {
  810. fmt.Println(err)
  811. }
  812. c.ServeSuccessJSON(map[string]interface{}{
  813. "pre": dat,
  814. "request_log": requestLog,
  815. })
  816. }
  817. func (c *HBybController) PostSix() {
  818. psnNo := c.GetString("psn_no")
  819. mdtrtId := c.GetString("mdtrt_id")
  820. chrgBchno := c.GetString("chrg_bchno")
  821. org_name := c.GetString("org_name")
  822. doctor := c.GetString("doctor")
  823. insuplc_admdvs := c.GetString("insuplc_admdvs")
  824. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  825. secret_key := c.GetString("secret_key")
  826. fixmedins_code := c.GetString("fixmedins_code")
  827. result, requestlog := service.Hbyb2205(psnNo, mdtrtId, chrgBchno, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code)
  828. fmt.Println(requestlog)
  829. var dat map[string]interface{}
  830. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  831. fmt.Println(dat)
  832. } else {
  833. fmt.Println(err)
  834. }
  835. c.ServeSuccessJSON(map[string]interface{}{
  836. "pre": dat,
  837. })
  838. }
  839. func (c *HBybController) PostSeven() {
  840. psnNo := c.GetString("psn_no")
  841. mdtrtId := c.GetString("mdtrt_id")
  842. chrgBchno := c.GetString("chrg_bchno")
  843. certNo := c.GetString("cert_no")
  844. insutype := c.GetString("insutype")
  845. total := c.GetString("total")
  846. org_name := c.GetString("org_name")
  847. doctor := c.GetString("doctor")
  848. fixmedins_code := c.GetString("fixmedins_code")
  849. insuplc_admdvs := c.GetString("insuplc_admdvs")
  850. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  851. secret_key := c.GetString("secret_key")
  852. med_type := c.GetString("med_type")
  853. id_card_type, _ := c.GetInt64("id_card_type")
  854. certificates, _ := c.GetInt64("certificates")
  855. 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)
  856. fmt.Println(requestlog)
  857. var dat map[string]interface{}
  858. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  859. fmt.Println(dat)
  860. } else {
  861. fmt.Println(err)
  862. }
  863. c.ServeSuccessJSON(map[string]interface{}{
  864. "pre": dat,
  865. })
  866. }
  867. func (c *HBybController) PostEight() {
  868. psnNo := c.GetString("psn_no")
  869. mdtrtId := c.GetString("mdtrt_id")
  870. chrgBchno := c.GetString("chrg_bchno")
  871. certNo := c.GetString("cert_no")
  872. insutype := c.GetString("insutype")
  873. total := c.GetString("total")
  874. org_name := c.GetString("org_name")
  875. doctor := c.GetString("doctor")
  876. fixmedins_code := c.GetString("fixmedins_code")
  877. insuplc_admdvs := c.GetString("insuplc_admdvs")
  878. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  879. secret_key := c.GetString("secret_key")
  880. med_type := c.GetString("med_type")
  881. id_card_type, _ := c.GetInt64("id_card_type")
  882. certificates, _ := c.GetInt64("certificates")
  883. fulamt_ownpay_amt, _ := c.GetFloat("fulamt_ownpay_amt")
  884. overlmt_selfpay, _ := c.GetFloat("overlmt_selfpay")
  885. preselfpay_amt, _ := c.GetFloat("preselfpay_amt")
  886. inscp_scp_amt, _ := c.GetFloat("inscp_scp_amt")
  887. acct_used_flag, _ := c.GetInt64("acct_used_flag")
  888. 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)
  889. var dat map[string]interface{}
  890. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  891. fmt.Println(dat)
  892. } else {
  893. fmt.Println(err)
  894. }
  895. var dat2 map[string]interface{}
  896. if err := json.Unmarshal([]byte(srcRequest), &dat2); err == nil {
  897. fmt.Println(dat2)
  898. } else {
  899. fmt.Println(err)
  900. }
  901. c.ServeSuccessJSON(map[string]interface{}{
  902. "pre": dat,
  903. "pre2": dat2,
  904. })
  905. }
  906. func (c *HBybController) PostNine() {
  907. psnNo := c.GetString("psn_no")
  908. mdtrtId := c.GetString("mdtrt_id")
  909. setlId := c.GetString("setl_id")
  910. org_name := c.GetString("org_name")
  911. doctor := c.GetString("doctor")
  912. secret_key := c.GetString("secret_key")
  913. fixmedins_code := c.GetString("fixmedins_code")
  914. insuplc_admdvs := c.GetString("insuplc_admdvs")
  915. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  916. result, src_request := service.Hbyb2208(psnNo, mdtrtId, setlId, org_name, doctor, secret_key, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
  917. fmt.Println(src_request)
  918. var dat map[string]interface{}
  919. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  920. fmt.Println(dat)
  921. } else {
  922. fmt.Println(err)
  923. }
  924. c.ServeSuccessJSON(map[string]interface{}{
  925. "pre": dat,
  926. })
  927. }
  928. func (c *HBybController) PostTen() {
  929. psnNo := c.GetString("psn_no")
  930. mdtrtId := c.GetString("mdtrt_id")
  931. setlId := c.GetString("setl_id")
  932. org_name := c.GetString("org_name")
  933. doctor := c.GetString("doctor")
  934. med_type := c.GetString("med_type")
  935. secret_key := c.GetString("secret_key")
  936. fixmedins_code := c.GetString("fixmedins_code")
  937. insuplc_admdvs := c.GetString("insuplc_admdvs")
  938. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  939. baseParams := models.BaseParams{
  940. SecretKey: secret_key,
  941. FixmedinsCode: fixmedins_code,
  942. InsuplcAdmdvs: insuplc_admdvs,
  943. MdtrtareaAdmvs: mdtrtarea_admvs,
  944. OrgName: org_name,
  945. Doctor: doctor,
  946. }
  947. businessParams := models.BusinessParams{
  948. PsnNo: psnNo,
  949. MdtrtId: mdtrtId,
  950. SetlId: setlId,
  951. }
  952. var result string
  953. if mdtrtarea_admvs == "421182" || mdtrtarea_admvs == "420902"{
  954. result = service.Hbyb5203(baseParams, businessParams,med_type)
  955. }else{
  956. result = service.Hbyb5203aa(baseParams, businessParams)
  957. }
  958. var dat map[string]interface{}
  959. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  960. fmt.Println(dat)
  961. } else {
  962. fmt.Println(err)
  963. }
  964. c.ServeSuccessJSON(map[string]interface{}{
  965. "pre": dat,
  966. })
  967. }
  968. func saveJsLog(result string, request string, infno string, desc string, org_name string) {
  969. //org_id, _ := beego.AppConfig.Int64("org_id")
  970. //miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
  971. dir := org_name + "日志"
  972. utils.Mkdir(dir)
  973. month := time.Unix(1557042972, 0).Format("1")
  974. year := time.Now().Format("2006")
  975. month = time.Now().Format("01")
  976. day := time.Now().Format("02")
  977. hour := time.Now().Format("15")
  978. min := time.Now().Format("04")
  979. sec := time.Now().Format("05")
  980. result_time := year + "-" + month + "-" + day + " " + hour + ":" + min + ":" + sec
  981. file := org_name + "_" + year + month + day + "_log"
  982. file_name := file + ".txt"
  983. file_path := org_name + "日志" + "/" + file_name
  984. exist, _ := utils.PathExists(file_path)
  985. if exist { //存在
  986. fmt.Println("存在")
  987. f, err := os.OpenFile(file_path, os.O_WRONLY, 0644)
  988. if err != nil {
  989. fmt.Println("read fail")
  990. }
  991. content := "\r\n" + "\r\n" + "\r\n" + result_time + " " + "【 " + desc + infno + "入参" + " 】:" + "\r\n" + request + "\r\n" + result_time + " " + "【 " + desc + infno + "出参" + " 】:" + "\r\n" + result
  992. n, _ := f.Seek(0, 2)
  993. _, err = f.WriteAt([]byte(content), n)
  994. } else { //不存在
  995. fmt.Println("文件不存在,创建文件")
  996. f, err := os.Create(org_name + "日志" + "/" + file_name)
  997. defer f.Close()
  998. if err != nil {
  999. } else {
  1000. _, err = f.Write([]byte("记录日志"))
  1001. }
  1002. }
  1003. }