gdyb_controller.go 22KB

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