jsyb_controller.go 104KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178
  1. package js
  2. import (
  3. "encoding/json"
  4. "fmt"
  5. "gdyb/controllers"
  6. "gdyb/enums"
  7. "gdyb/models"
  8. "gdyb/service"
  9. "gdyb/utils"
  10. "github.com/astaxie/beego"
  11. "github.com/axgle/mahonia"
  12. "github.com/gorilla/websocket"
  13. "golang.org/x/text/encoding/simplifiedchinese"
  14. "io/ioutil"
  15. "log"
  16. "net/url"
  17. "os"
  18. "regexp"
  19. "strconv"
  20. "strings"
  21. "syscall"
  22. "time"
  23. "unsafe"
  24. )
  25. type JSybController struct {
  26. controllers.BaseAuthAPIController
  27. }
  28. func JSybRegistRouters() {
  29. beego.Router("/jsyb/1101", &JSybController{}, "get:PostOne")
  30. beego.Router("/jsyb/1101D", &JSybController{}, "get:PostOneD")
  31. beego.Router("/jsyb/1101c", &JSybController{}, "get:PostOnec")
  32. beego.Router("/jsyb/2201c", &JSybController{}, "get:Posttwoc")
  33. beego.Router("/jsyb/2201", &JSybController{}, "get:PostTwo")
  34. beego.Router("/jsyb/2202", &JSybController{}, "get:PostThree")
  35. beego.Router("/jsyb/2203", &JSybController{}, "post:PostFour")
  36. beego.Router("/jsyb/2204", &JSybController{}, "post:PostFive")
  37. beego.Router("/jsyb/2205", &JSybController{}, "get:PostSix")
  38. beego.Router("/jsyb/2206", &JSybController{}, "get:PostSeven")
  39. beego.Router("/jsyb/2207", &JSybController{}, "get:PostEight")
  40. beego.Router("/jsyb/2208", &JSybController{}, "get:PostNine")
  41. beego.Router("/jsyb/5203", &JSybController{}, "get:PostTen")
  42. beego.Router("/jsyb/5301", &JSybController{}, "get:Get5301")
  43. beego.Router("/jsyb/3201", &JSybController{}, "get:Get3201")
  44. beego.Router("/jsyb/9001", &JSybController{}, "get:Get9001")
  45. beego.Router("/jsyb/3101", &JSybController{}, "post:Get3101")
  46. beego.Router("/jsyb/3102", &JSybController{}, "post:Get3102")
  47. beego.Router("/jsyb/4101", &JSybController{}, "post:Get4101")
  48. beego.Router("/jsyb/readcard", &JSybController{}, "get:ReadCard")
  49. beego.Router("/jsyb/readcardcharge", &JSybController{}, "get:Readcardcharge")
  50. beego.Router("/jsyb/readcardchargeother", &JSybController{}, "get:Readcardchargeother")
  51. beego.Router("/jsyb/readcardface", &JSybController{}, "get:Readcardface")
  52. beego.Router("/jsyb/3260", &JSybController{}, "get:Get3260")
  53. beego.Router("/jsyb/3261", &JSybController{}, "get:Get3261")
  54. beego.Router("/jsyb/3262", &JSybController{}, "post:Get3262")
  55. beego.Router("/jsyb/3263", &JSybController{}, "post:Get3263")
  56. beego.Router("/jsyb/3264", &JSybController{}, "post:Get3264")
  57. beego.Router("/jsyb/3265", &JSybController{}, "post:Get3265")
  58. beego.Router("/jsyb/3266", &JSybController{}, "post:Get3266")
  59. beego.Router("/jsyb/3267", &JSybController{}, "post:Get3267")
  60. beego.Router("/jsyb/3268", &JSybController{}, "post:Get3268")
  61. beego.Router("/jsyb/3269", &JSybController{}, "post:Get3269")
  62. beego.Router("/jsyb/3270", &JSybController{}, "post:Get3270")
  63. beego.Router("/jsyb/3271", &JSybController{}, "post:Get3271")
  64. beego.Router("/jsyb/3272", &JSybController{}, "post:Get3272")
  65. beego.Router("/jsyb/3273", &JSybController{}, "post:Get3273")
  66. beego.Router("/jsyb/3274", &JSybController{}, "post:Get3274")
  67. beego.Router("/jsyb/3275", &JSybController{}, "post:Get3275")
  68. beego.Router("/jsyb/3501", &JSybController{}, "post:Get3501")
  69. beego.Router("/jsyb/3502", &JSybController{}, "post:Get3502")
  70. beego.Router("/jsyb/3503", &JSybController{}, "post:Get3503")
  71. beego.Router("/jsyb/3504", &JSybController{}, "post:Get3504")
  72. beego.Router("/jsyb/3505", &JSybController{}, "post:Get3505")
  73. beego.Router("/jsyb/3506", &JSybController{}, "post:Get3506")
  74. beego.Router("/jsyb/3507", &JSybController{}, "post:Get3507")
  75. beego.Router("/jsyb/3508", &JSybController{}, "post:Get3508")
  76. beego.Router("/jsyb/3509", &JSybController{}, "post:Get3509")
  77. beego.Router("/jsyb/3510", &JSybController{}, "post:Get3510")
  78. beego.Router("/jsyb/3511", &JSybController{}, "post:Get3511")
  79. beego.Router("/jsyb/3512", &JSybController{}, "post:Get3512")
  80. beego.Router("/jsyb/3513", &JSybController{}, "post:Get3513")
  81. beego.Router("/jsyb/1318", &JSybController{}, "get:Get1318")
  82. //beego.Router("/jsyb/3276", &JSybController{}, "post:Get3276")
  83. //beego.Router("/jsyb/3277", &JSybController{}, "post:Get3277")
  84. }
  85. func (c *JSybController) Get1318() {
  86. org_name := c.GetString("org_name")
  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. url := c.GetString("url")
  93. ak := c.GetString("ak")
  94. h_code := c.GetString("h_code")
  95. cainfo := c.GetString("cainfo")
  96. result, request := service.Jsyb1318(h_code, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, cainfo)
  97. var dat2 map[string]interface{}
  98. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  99. } else {
  100. }
  101. var dat map[string]interface{}
  102. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  103. } else {
  104. }
  105. c.ServeSuccessJSON(map[string]interface{}{
  106. "pre": dat,
  107. "request_log": dat2,
  108. })
  109. }
  110. func (c *JSybController) Get3260() {
  111. org_name := c.GetString("org_name")
  112. doctor := c.GetString("doctor")
  113. fixmedins_code := c.GetString("fixmedins_code")
  114. insuplc_admdvs := c.GetString("insuplc_admdvs")
  115. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  116. secret_key := c.GetString("secret_key")
  117. url := c.GetString("url")
  118. ak := c.GetString("ak")
  119. cainfo := c.GetString("cainfo")
  120. fmt.Println(org_name)
  121. fmt.Println(doctor)
  122. fmt.Println(fixmedins_code)
  123. fmt.Println(insuplc_admdvs)
  124. fmt.Println(mdtrtarea_admvs)
  125. fmt.Println(secret_key)
  126. fmt.Println(url)
  127. fmt.Println(ak)
  128. fmt.Println(cainfo)
  129. result, request := service.Jxyb3260(mdtrtarea_admvs, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo)
  130. saveJsLog(result, request, "3260", "3260", org_name)
  131. var dat2 map[string]interface{}
  132. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  133. } else {
  134. }
  135. var dat map[string]interface{}
  136. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  137. } else {
  138. }
  139. c.ServeSuccessJSON(map[string]interface{}{
  140. "pre": dat,
  141. "request_log": dat2,
  142. })
  143. }
  144. func (c *JSybController) Get3261() {
  145. org_name := c.GetString("org_name")
  146. doctor := c.GetString("doctor")
  147. fixmedins_code := c.GetString("fixmedins_code")
  148. insuplc_admdvs := c.GetString("insuplc_admdvs")
  149. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  150. secret_key := c.GetString("secret_key")
  151. url := c.GetString("url")
  152. ak := c.GetString("ak")
  153. cainfo := c.GetString("cainfo")
  154. setl_mon := c.GetString("month")
  155. result, request := service.Jxyb3261(setl_mon, mdtrtarea_admvs, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo)
  156. saveJsLog(result, request, "3261", "3261", org_name)
  157. var dat2 map[string]interface{}
  158. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  159. } else {
  160. }
  161. var dat map[string]interface{}
  162. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  163. } else {
  164. }
  165. c.ServeSuccessJSON(map[string]interface{}{
  166. "pre": dat,
  167. "request_log": dat2,
  168. })
  169. }
  170. func (c *JSybController) Get3262() {
  171. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  172. var respJSON map[string]interface{}
  173. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  174. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  175. return
  176. }
  177. userJSONBytes, _ := json.Marshal(respJSON["datas"])
  178. var hp []models.FixMonRecDetailFileInTwo
  179. if err := json.Unmarshal(userJSONBytes, &hp); err != nil {
  180. utils.ErrorLog("解析失败:%v", err)
  181. return
  182. }
  183. fmt.Println(hp)
  184. userJSONBytes2, _ := json.Marshal(respJSON["fund"])
  185. var fund []models.Fund
  186. if err := json.Unmarshal(userJSONBytes2, &fund); err != nil {
  187. utils.ErrorLog("解析失败:%v", err)
  188. return
  189. }
  190. org_name := respJSON["org_name"].(string)
  191. doctor := respJSON["doctor"].(string)
  192. fixmedins_code := respJSON["fixmedins_code"].(string)
  193. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  194. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  195. secret_key := respJSON["secret_key"].(string)
  196. url := respJSON["url"].(string)
  197. ak := respJSON["ak"].(string)
  198. cainfo := respJSON["cainfo"].(string)
  199. upld_btch := respJSON["upld_btch"].(string)
  200. fix_fill_dept := respJSON["fix_fill_dept"].(string)
  201. fix_fill_psn_id := respJSON["fix_fill_psn_id"].(string)
  202. fix_fill_psn := respJSON["fix_fill_psn"].(string)
  203. fix_fill_date := respJSON["fix_fill_date"].(string)
  204. stmt_loc := respJSON["stmt_loc"].(string)
  205. setl_mon := respJSON["setl_mon"].(string)
  206. result, request := service.Jxyb3262(setl_mon, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo, upld_btch, fix_fill_dept, fix_fill_psn_id, fix_fill_psn, fix_fill_date, stmt_loc, hp, fund)
  207. saveJsLog(result, request, "3262", "3262", org_name)
  208. var dat2 map[string]interface{}
  209. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  210. } else {
  211. }
  212. var dat map[string]interface{}
  213. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  214. } else {
  215. }
  216. c.ServeSuccessJSON(map[string]interface{}{
  217. "pre": dat,
  218. "request_log": dat2,
  219. })
  220. }
  221. func (c *JSybController) Get3263() {
  222. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  223. var respJSON map[string]interface{}
  224. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  225. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  226. return
  227. }
  228. org_name := respJSON["org_name"].(string)
  229. doctor := respJSON["doctor"].(string)
  230. fixmedins_code := respJSON["fixmedins_code"].(string)
  231. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  232. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  233. secret_key := respJSON["secret_key"].(string)
  234. url := respJSON["url"].(string)
  235. ak := respJSON["ak"].(string)
  236. cainfo := respJSON["cainfo"].(string)
  237. upld_btch := respJSON["upld_btch"].(string)
  238. stmt_loc := respJSON["stmt_loc"].(string)
  239. setl_mon := respJSON["setl_mon"].(string)
  240. result, request := service.Jxyb3263(setl_mon, stmt_loc, upld_btch, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo)
  241. saveJsLog(result, request, "3263", "3263", org_name)
  242. var dat2 map[string]interface{}
  243. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  244. } else {
  245. }
  246. var dat map[string]interface{}
  247. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  248. } else {
  249. }
  250. c.ServeSuccessJSON(map[string]interface{}{
  251. "pre": dat,
  252. "request_log": dat2,
  253. })
  254. }
  255. func (c *JSybController) Get3264() {
  256. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  257. var respJSON map[string]interface{}
  258. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  259. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  260. return
  261. }
  262. userJSONBytes, _ := json.Marshal(respJSON["solidify_id"])
  263. var hp []string
  264. if err := json.Unmarshal(userJSONBytes, &hp); err != nil {
  265. utils.ErrorLog("解析失败:%v", err)
  266. return
  267. }
  268. org_name := respJSON["org_name"].(string)
  269. doctor := respJSON["doctor"].(string)
  270. fixmedins_code := respJSON["fixmedins_code"].(string)
  271. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  272. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  273. secret_key := respJSON["secret_key"].(string)
  274. url := respJSON["url"].(string)
  275. ak := respJSON["ak"].(string)
  276. cainfo := respJSON["cainfo"].(string)
  277. upld_btch := respJSON["upld_btch"].(string)
  278. stmt_loc := respJSON["stmt_loc"].(string)
  279. setl_mon := respJSON["setl_mon"].(string)
  280. result, request := service.Jxyb3264(setl_mon, stmt_loc, upld_btch, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo, hp)
  281. saveJsLog(result, request, "3264", "3264", org_name)
  282. var dat2 map[string]interface{}
  283. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  284. } else {
  285. }
  286. var dat map[string]interface{}
  287. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  288. } else {
  289. }
  290. c.ServeSuccessJSON(map[string]interface{}{
  291. "pre": dat,
  292. "request_log": dat2,
  293. })
  294. }
  295. func (c *JSybController) Get3265() {
  296. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  297. var respJSON map[string]interface{}
  298. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  299. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  300. return
  301. }
  302. userJSONBytes, _ := json.Marshal(respJSON["solidify_id"])
  303. var hp []string
  304. if err := json.Unmarshal(userJSONBytes, &hp); err != nil {
  305. utils.ErrorLog("解析失败:%v", err)
  306. return
  307. }
  308. org_name := respJSON["org_name"].(string)
  309. doctor := respJSON["doctor"].(string)
  310. fixmedins_code := respJSON["fixmedins_code"].(string)
  311. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  312. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  313. secret_key := respJSON["secret_key"].(string)
  314. url := respJSON["url"].(string)
  315. ak := respJSON["ak"].(string)
  316. cainfo := respJSON["cainfo"].(string)
  317. upld_btch := respJSON["upld_btch"].(string)
  318. stmt_loc := respJSON["stmt_loc"].(string)
  319. setl_mon := respJSON["setl_mon"].(string)
  320. fix_fill_dept := respJSON["fix_fill_dept"].(string)
  321. fix_fill_psn_id := respJSON["fix_fill_psn_id"].(string)
  322. fix_fill_psn := respJSON["fix_fill_psn"].(string)
  323. fix_fill_date := respJSON["fix_fill_date"].(string)
  324. result, request := service.Jxyb3265(setl_mon, fix_fill_dept, fix_fill_psn_id, fix_fill_psn, fix_fill_date, stmt_loc, upld_btch, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo, hp)
  325. saveJsLog(result, request, "3265", "3265", org_name)
  326. var dat2 map[string]interface{}
  327. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  328. } else {
  329. }
  330. var dat map[string]interface{}
  331. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  332. } else {
  333. }
  334. c.ServeSuccessJSON(map[string]interface{}{
  335. "pre": dat,
  336. "request_log": dat2,
  337. })
  338. }
  339. func (c *JSybController) Get3266() {
  340. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  341. var respJSON map[string]interface{}
  342. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  343. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  344. return
  345. }
  346. org_name := respJSON["org_name"].(string)
  347. doctor := respJSON["doctor"].(string)
  348. fixmedins_code := respJSON["fixmedins_code"].(string)
  349. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  350. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  351. secret_key := respJSON["secret_key"].(string)
  352. url := respJSON["url"].(string)
  353. ak := respJSON["ak"].(string)
  354. cainfo := respJSON["cainfo"].(string)
  355. upld_btch := respJSON["upld_btch"].(string)
  356. stmt_loc := respJSON["stmt_loc"].(string)
  357. stmt_mon := respJSON["setl_mon"].(string)
  358. fix_fill_dept := respJSON["fix_fill_dept"].(string)
  359. fix_fill_psn_id := respJSON["fix_fill_psn_id"].(string)
  360. fix_fill_psn := respJSON["fix_fill_psn"].(string)
  361. fix_fill_date := respJSON["fix_fill_date"].(string)
  362. result, request := service.Jxyb3266(stmt_mon, fix_fill_dept, fix_fill_psn_id, fix_fill_psn, fix_fill_date, stmt_loc, upld_btch, mdtrtarea_admvs, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo)
  363. saveJsLog(result, request, "3265", "3265", org_name)
  364. var dat2 map[string]interface{}
  365. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  366. } else {
  367. }
  368. var dat map[string]interface{}
  369. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  370. } else {
  371. }
  372. c.ServeSuccessJSON(map[string]interface{}{
  373. "pre": dat,
  374. "request_log": dat2,
  375. })
  376. }
  377. func (c *JSybController) Get3267() {
  378. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  379. var respJSON map[string]interface{}
  380. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  381. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  382. return
  383. }
  384. org_name := respJSON["org_name"].(string)
  385. doctor := respJSON["doctor"].(string)
  386. fixmedins_code := respJSON["fixmedins_code"].(string)
  387. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  388. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  389. secret_key := respJSON["secret_key"].(string)
  390. url := respJSON["url"].(string)
  391. ak := respJSON["ak"].(string)
  392. cainfo := respJSON["cainfo"].(string)
  393. upld_btch := respJSON["upld_btch"].(string)
  394. stmt_loc := respJSON["stmt_loc"].(string)
  395. setl_mon := respJSON["setl_mon"].(string)
  396. result, request := service.Jxyb3267(setl_mon, stmt_loc, upld_btch, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo)
  397. saveJsLog(result, request, "3267", "3267", org_name)
  398. var dat2 map[string]interface{}
  399. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  400. } else {
  401. }
  402. var dat map[string]interface{}
  403. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  404. } else {
  405. }
  406. c.ServeSuccessJSON(map[string]interface{}{
  407. "pre": dat,
  408. "request_log": dat2,
  409. })
  410. }
  411. func (c *JSybController) Get3268() {
  412. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  413. var respJSON map[string]interface{}
  414. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  415. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  416. return
  417. }
  418. userJSONBytes, _ := json.Marshal(respJSON["datas"])
  419. var hp []models.FixMonRecDetailFileInTwo
  420. if err := json.Unmarshal(userJSONBytes, &hp); err != nil {
  421. utils.ErrorLog("解析失败:%v", err)
  422. return
  423. }
  424. userJSONBytes2, _ := json.Marshal(respJSON["fund"])
  425. var fund []models.Fund
  426. if err := json.Unmarshal(userJSONBytes2, &fund); err != nil {
  427. utils.ErrorLog("解析失败:%v", err)
  428. return
  429. }
  430. org_name := respJSON["org_name"].(string)
  431. doctor := respJSON["doctor"].(string)
  432. fixmedins_code := respJSON["fixmedins_code"].(string)
  433. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  434. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  435. secret_key := respJSON["secret_key"].(string)
  436. url := respJSON["url"].(string)
  437. ak := respJSON["ak"].(string)
  438. cainfo := respJSON["cainfo"].(string)
  439. upld_btch := respJSON["upld_btch"].(string)
  440. fix_fill_dept := respJSON["fix_fill_dept"].(string)
  441. fix_fill_psn_id := respJSON["fix_fill_psn_id"].(string)
  442. fix_fill_psn := respJSON["fix_fill_psn"].(string)
  443. fix_fill_date := respJSON["fix_fill_date"].(string)
  444. stmt_loc := respJSON["stmt_loc"].(string)
  445. setl_mon := respJSON["setl_mon"].(string)
  446. result, request := service.Jxyb3268(setl_mon, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo, upld_btch, fix_fill_dept, fix_fill_psn_id, fix_fill_psn, fix_fill_date, stmt_loc, hp, fund)
  447. saveJsLog(result, request, "3268", "3268", org_name)
  448. var dat2 map[string]interface{}
  449. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  450. } else {
  451. }
  452. var dat map[string]interface{}
  453. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  454. } else {
  455. }
  456. c.ServeSuccessJSON(map[string]interface{}{
  457. "pre": dat,
  458. "request_log": dat2,
  459. })
  460. }
  461. func (c *JSybController) Get3269() {
  462. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  463. var respJSON map[string]interface{}
  464. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  465. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  466. return
  467. }
  468. org_name := respJSON["org_name"].(string)
  469. doctor := respJSON["doctor"].(string)
  470. fixmedins_code := respJSON["fixmedins_code"].(string)
  471. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  472. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  473. secret_key := respJSON["secret_key"].(string)
  474. url := respJSON["url"].(string)
  475. ak := respJSON["ak"].(string)
  476. cainfo := respJSON["cainfo"].(string)
  477. stmt_loc := respJSON["stmt_loc"].(string)
  478. setl_mon := respJSON["setl_mon"].(string)
  479. result, request := service.Jxyb3269(setl_mon, stmt_loc, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo)
  480. saveJsLog(result, request, "3269", "3269", org_name)
  481. var dat2 map[string]interface{}
  482. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  483. } else {
  484. }
  485. var dat map[string]interface{}
  486. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  487. } else {
  488. }
  489. c.ServeSuccessJSON(map[string]interface{}{
  490. "pre": dat,
  491. "request_log": dat2,
  492. })
  493. }
  494. func (c *JSybController) Get3270() {
  495. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  496. var respJSON map[string]interface{}
  497. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  498. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  499. return
  500. }
  501. userJSONBytes, _ := json.Marshal(respJSON["solidify_id"])
  502. var hp []string
  503. if err := json.Unmarshal(userJSONBytes, &hp); err != nil {
  504. utils.ErrorLog("解析失败:%v", err)
  505. return
  506. }
  507. org_name := respJSON["org_name"].(string)
  508. doctor := respJSON["doctor"].(string)
  509. fixmedins_code := respJSON["fixmedins_code"].(string)
  510. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  511. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  512. secret_key := respJSON["secret_key"].(string)
  513. url := respJSON["url"].(string)
  514. ak := respJSON["ak"].(string)
  515. cainfo := respJSON["cainfo"].(string)
  516. stmt_loc := respJSON["stmt_loc"].(string)
  517. //stmt_mon := respJSON["setl_mon"].(string)
  518. setl_mon := respJSON["setl_mon"].(string)
  519. result, request := service.Jxyb3270(setl_mon, stmt_loc, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo, hp)
  520. saveJsLog(result, request, "3270", "3270", org_name)
  521. var dat2 map[string]interface{}
  522. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  523. } else {
  524. }
  525. var dat map[string]interface{}
  526. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  527. } else {
  528. }
  529. c.ServeSuccessJSON(map[string]interface{}{
  530. "pre": dat,
  531. "request_log": dat2,
  532. })
  533. }
  534. func (c *JSybController) Get3271() {
  535. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  536. var respJSON map[string]interface{}
  537. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  538. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  539. return
  540. }
  541. userJSONBytes, _ := json.Marshal(respJSON["solidify_id"])
  542. var hp []string
  543. if err := json.Unmarshal(userJSONBytes, &hp); err != nil {
  544. utils.ErrorLog("解析失败:%v", err)
  545. return
  546. }
  547. org_name := respJSON["org_name"].(string)
  548. doctor := respJSON["doctor"].(string)
  549. fixmedins_code := respJSON["fixmedins_code"].(string)
  550. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  551. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  552. secret_key := respJSON["secret_key"].(string)
  553. url := respJSON["url"].(string)
  554. ak := respJSON["ak"].(string)
  555. cainfo := respJSON["cainfo"].(string)
  556. stmt_loc := respJSON["stmt_loc"].(string)
  557. fix_fill_dept := respJSON["fix_fill_dept"].(string)
  558. fix_fill_psn_id := respJSON["fix_fill_psn_id"].(string)
  559. fix_fill_psn := respJSON["fix_fill_psn"].(string)
  560. fix_fill_date := respJSON["fix_fill_date"].(string)
  561. setl_mon := respJSON["setl_mon"].(string)
  562. result, request := service.Jxyb3271(setl_mon, fix_fill_dept, fix_fill_psn_id, fix_fill_psn, fix_fill_date, stmt_loc, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo, hp)
  563. saveJsLog(result, request, "3271", "3271", org_name)
  564. var dat2 map[string]interface{}
  565. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  566. } else {
  567. }
  568. var dat map[string]interface{}
  569. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  570. } else {
  571. }
  572. c.ServeSuccessJSON(map[string]interface{}{
  573. "pre": dat,
  574. "request_log": dat2,
  575. })
  576. }
  577. func (c *JSybController) Get3272() {
  578. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  579. var respJSON map[string]interface{}
  580. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  581. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  582. return
  583. }
  584. org_name := respJSON["org_name"].(string)
  585. doctor := respJSON["doctor"].(string)
  586. fixmedins_code := respJSON["fixmedins_code"].(string)
  587. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  588. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  589. secret_key := respJSON["secret_key"].(string)
  590. url := respJSON["url"].(string)
  591. ak := respJSON["ak"].(string)
  592. cainfo := respJSON["cainfo"].(string)
  593. stmt_loc := respJSON["stmt_loc"].(string)
  594. setl_mon := respJSON["setl_mon"].(string)
  595. fix_fill_dept := respJSON["fix_fill_dept"].(string)
  596. fix_fill_psn_id := respJSON["fix_fill_psn_id"].(string)
  597. fix_fill_psn := respJSON["fix_fill_psn"].(string)
  598. fix_fill_date := respJSON["fix_fill_date"].(string)
  599. result, request := service.Jxyb3272(setl_mon, fix_fill_dept, fix_fill_psn_id, fix_fill_psn, fix_fill_date, stmt_loc, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo)
  600. saveJsLog(result, request, "3272", "3272", org_name)
  601. var dat2 map[string]interface{}
  602. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  603. } else {
  604. }
  605. var dat map[string]interface{}
  606. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  607. } else {
  608. }
  609. c.ServeSuccessJSON(map[string]interface{}{
  610. "pre": dat,
  611. "request_log": dat2,
  612. })
  613. }
  614. func (c *JSybController) Get3273() {
  615. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  616. var respJSON map[string]interface{}
  617. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  618. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  619. return
  620. }
  621. org_name := respJSON["org_name"].(string)
  622. doctor := respJSON["doctor"].(string)
  623. fixmedins_code := respJSON["fixmedins_code"].(string)
  624. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  625. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  626. secret_key := respJSON["secret_key"].(string)
  627. url := respJSON["url"].(string)
  628. ak := respJSON["ak"].(string)
  629. cainfo := respJSON["cainfo"].(string)
  630. stmt_loc := respJSON["stmt_loc"].(string)
  631. //stmt_mon := respJSON["stmt_mon"].(string)
  632. setl_mon := respJSON["setl_mon"].(string)
  633. result, request := service.Jxyb3273(setl_mon, stmt_loc, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo)
  634. saveJsLog(result, request, "3273", "3273", org_name)
  635. var dat2 map[string]interface{}
  636. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  637. } else {
  638. }
  639. var dat map[string]interface{}
  640. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  641. } else {
  642. }
  643. c.ServeSuccessJSON(map[string]interface{}{
  644. "pre": dat,
  645. "request_log": dat2,
  646. })
  647. }
  648. func (c *JSybController) Get3274() {
  649. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  650. var respJSON map[string]interface{}
  651. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  652. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  653. return
  654. }
  655. org_name := respJSON["org_name"].(string)
  656. doctor := respJSON["doctor"].(string)
  657. fixmedins_code := respJSON["fixmedins_code"].(string)
  658. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  659. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  660. secret_key := respJSON["secret_key"].(string)
  661. url := respJSON["url"].(string)
  662. ak := respJSON["ak"].(string)
  663. cainfo := respJSON["cainfo"].(string)
  664. stmt_loc := respJSON["stmt_loc"].(string)
  665. stmt_mon := respJSON["stmt_mon"].(string)
  666. fix_fill_dept := respJSON["fix_fill_dept"].(string)
  667. fix_fill_psn_id := respJSON["fix_fill_psn_id"].(string)
  668. fix_fill_psn := respJSON["fix_fill_psn"].(string)
  669. fix_fill_date := respJSON["fix_fill_date"].(string)
  670. upld_btch := respJSON["upld_btch"].(string)
  671. result, request := service.Jxyb3274(stmt_mon, fix_fill_dept, fix_fill_psn_id, fix_fill_psn, fix_fill_date, stmt_loc, upld_btch, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo)
  672. saveJsLog(result, request, "3273", "3273", org_name)
  673. var dat2 map[string]interface{}
  674. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  675. } else {
  676. }
  677. var dat map[string]interface{}
  678. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  679. } else {
  680. }
  681. c.ServeSuccessJSON(map[string]interface{}{
  682. "pre": dat,
  683. "request_log": dat2,
  684. })
  685. }
  686. func (c *JSybController) Get3275() {
  687. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  688. var respJSON map[string]interface{}
  689. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  690. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  691. return
  692. }
  693. org_name := respJSON["org_name"].(string)
  694. doctor := respJSON["doctor"].(string)
  695. fixmedins_code := respJSON["fixmedins_code"].(string)
  696. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  697. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  698. secret_key := respJSON["secret_key"].(string)
  699. url := respJSON["url"].(string)
  700. ak := respJSON["ak"].(string)
  701. cainfo := respJSON["cainfo"].(string)
  702. result, request := service.Jxyb3275(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo)
  703. saveJsLog(result, request, "3275", "3275", org_name)
  704. var dat2 map[string]interface{}
  705. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  706. } else {
  707. }
  708. var dat map[string]interface{}
  709. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  710. } else {
  711. }
  712. c.ServeSuccessJSON(map[string]interface{}{
  713. "pre": dat,
  714. "request_log": dat2,
  715. })
  716. }
  717. //func (c *JSybController) Get3276() {
  718. // org_name := respJSON["org_name"].(string)
  719. // doctor := respJSON["doctor"].(string)
  720. // fixmedins_code := respJSON["fixmedins_code"].(string)
  721. // insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  722. // mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  723. // secret_key := respJSON["secret_key"].(string)
  724. // url := respJSON["url"].(string)
  725. // ak := respJSON["ak"].(string)
  726. // cainfo := respJSON["cainfo"].(string)
  727. // upld_btch := respJSON["upld_btch"].(string)
  728. // stmt_loc := respJSON["stmt_loc"].(string)
  729. // stmt_mon := respJSON["stmt_mon"].(string)
  730. // fix_fill_dept := respJSON["fix_fill_dept"].(string)
  731. // fix_fill_psn_id := respJSON["fix_fill_psn_id"].(string)
  732. // fix_fill_psn := respJSON["fix_fill_psn"].(string)
  733. // fix_fill_date := respJSON["fix_fill_date"].(string)
  734. // result, request := service.Jxyb3266(stmt_mon, fix_fill_dept, fix_fill_psn_id, fix_fill_psn, fix_fill_date, stmt_loc, upld_btch, mdtrtarea_admvs, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo)
  735. // saveJsLog(result, request, "3265", "3265", org_name)
  736. // var dat2 map[string]interface{}
  737. // if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  738. // } else {
  739. // }
  740. // var dat map[string]interface{}
  741. // if err := json.Unmarshal([]byte(result), &dat); err == nil {
  742. // } else {
  743. //
  744. // }
  745. // c.ServeSuccessJSON(map[string]interface{}{
  746. // "pre": dat,
  747. // "request_log": dat2,
  748. // })
  749. //
  750. //}
  751. //func (c *JSybController) Get3277() {
  752. // org_name := respJSON["org_name"].(string)
  753. // doctor := respJSON["doctor"].(string)
  754. // fixmedins_code := respJSON["fixmedins_code"].(string)
  755. // insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  756. // mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  757. // secret_key := respJSON["secret_key"].(string)
  758. // url := respJSON["url"].(string)
  759. // ak := respJSON["ak"].(string)
  760. // cainfo := respJSON["cainfo"].(string)
  761. // upld_btch := respJSON["upld_btch"].(string)
  762. // stmt_loc := respJSON["stmt_loc"].(string)
  763. // stmt_mon := respJSON["stmt_mon"].(string)
  764. // fix_fill_dept := respJSON["fix_fill_dept"].(string)
  765. // fix_fill_psn_id := respJSON["fix_fill_psn_id"].(string)
  766. // fix_fill_psn := respJSON["fix_fill_psn"].(string)
  767. // fix_fill_date := respJSON["fix_fill_date"].(string)
  768. // result, request := service.Jxyb3266(stmt_mon, fix_fill_dept, fix_fill_psn_id, fix_fill_psn, fix_fill_date, stmt_loc, upld_btch, mdtrtarea_admvs, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo)
  769. // saveJsLog(result, request, "3265", "3265", org_name)
  770. // var dat2 map[string]interface{}
  771. // if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  772. // } else {
  773. // }
  774. // var dat map[string]interface{}
  775. // if err := json.Unmarshal([]byte(result), &dat); err == nil {
  776. // } else {
  777. //
  778. // }
  779. // c.ServeSuccessJSON(map[string]interface{}{
  780. // "pre": dat,
  781. // "request_log": dat2,
  782. // })
  783. //}
  784. func (c *JSybController) Get3501() {
  785. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  786. var respJSON map[string]interface{}
  787. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  788. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  789. return
  790. }
  791. userJSONBytes, _ := json.Marshal(respJSON["struct_3501s"])
  792. var struct3501 models.Struct3501
  793. if err := json.Unmarshal(userJSONBytes, &struct3501); err != nil {
  794. utils.ErrorLog("解析失败:%v", err)
  795. return
  796. }
  797. result, request_log := service.Jsyb3501(struct3501)
  798. saveJsLog(result, request_log, "3501", "库存盘点", struct3501.OrgName)
  799. var dat2 map[string]interface{}
  800. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  801. } else {
  802. }
  803. var dat map[string]interface{}
  804. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  805. } else {
  806. }
  807. c.ServeSuccessJSON(map[string]interface{}{
  808. "pre": dat,
  809. "request_log": dat2,
  810. })
  811. }
  812. func (c *JSybController) Get3502() {
  813. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  814. var respJSON map[string]interface{}
  815. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  816. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  817. return
  818. }
  819. userJSONBytes, _ := json.Marshal(respJSON["struct_3502s"])
  820. var struct3502s models.Struct3502
  821. if err := json.Unmarshal(userJSONBytes, &struct3502s); err != nil {
  822. utils.ErrorLog("解析失败:%v", err)
  823. return
  824. }
  825. result, request_log := service.Jsyb3502(struct3502s)
  826. saveJsLog(result, request_log, "3502", "库存变更", struct3502s.OrgName)
  827. var dat2 map[string]interface{}
  828. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  829. } else {
  830. }
  831. var dat map[string]interface{}
  832. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  833. } else {
  834. }
  835. c.ServeSuccessJSON(map[string]interface{}{
  836. "pre": dat,
  837. "request_log": dat2,
  838. })
  839. }
  840. func (c *JSybController) Get3503() {
  841. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  842. var respJSON map[string]interface{}
  843. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  844. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  845. return
  846. }
  847. userJSONBytes, _ := json.Marshal(respJSON["struct_3503s"])
  848. var struct3503 models.Struct3503
  849. if err := json.Unmarshal(userJSONBytes, &struct3503); err != nil {
  850. utils.ErrorLog("解析失败:%v", err)
  851. return
  852. }
  853. fmt.Println(struct3503)
  854. result, request_log := service.Jsyb3503(struct3503)
  855. saveJsLog(result, request_log, "3503", "库存采购", struct3503.OrgName)
  856. var dat2 map[string]interface{}
  857. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  858. } else {
  859. }
  860. var dat map[string]interface{}
  861. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  862. } else {
  863. }
  864. c.ServeSuccessJSON(map[string]interface{}{
  865. "pre": dat,
  866. "request_log": dat2,
  867. })
  868. }
  869. func (c *JSybController) Get3504() {
  870. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  871. var respJSON map[string]interface{}
  872. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  873. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  874. return
  875. }
  876. userJSONBytes, _ := json.Marshal(respJSON["struct_3504s"])
  877. var struct3504 []models.Struct3504
  878. if err := json.Unmarshal(userJSONBytes, &struct3504); err != nil {
  879. utils.ErrorLog("解析失败:%v", err)
  880. return
  881. }
  882. result, request_log := service.Jsyb3504(struct3504[0])
  883. saveJsLog(result, request_log, "3504", "库存盘点", struct3504[0].OrgName)
  884. var dat2 map[string]interface{}
  885. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  886. } else {
  887. }
  888. var dat map[string]interface{}
  889. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  890. } else {
  891. }
  892. c.ServeSuccessJSON(map[string]interface{}{
  893. "pre": dat,
  894. "request_log": dat2,
  895. })
  896. }
  897. func (c *JSybController) Get3505() {
  898. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  899. var respJSON map[string]interface{}
  900. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  901. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  902. return
  903. }
  904. userJSONBytes, _ := json.Marshal(respJSON["struct_3505s"])
  905. var struct3505 models.Struct3505
  906. if err := json.Unmarshal(userJSONBytes, &struct3505); err != nil {
  907. utils.ErrorLog("解析失败:%v", err)
  908. return
  909. }
  910. result, request_log := service.Jsyb3505(struct3505)
  911. saveJsLog(result, request_log, "3505", "销售", struct3505.OrgName)
  912. var dat2 map[string]interface{}
  913. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  914. } else {
  915. }
  916. var dat map[string]interface{}
  917. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  918. } else {
  919. }
  920. c.ServeSuccessJSON(map[string]interface{}{
  921. "pre": dat,
  922. "request_log": dat2,
  923. })
  924. }
  925. func (c *JSybController) Get3506() {
  926. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  927. var respJSON map[string]interface{}
  928. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  929. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  930. return
  931. }
  932. userJSONBytes, _ := json.Marshal(respJSON["struct_3506s"])
  933. var struct3506 models.Struct3506
  934. if err := json.Unmarshal(userJSONBytes, &struct3506); err != nil {
  935. utils.ErrorLog("解析失败:%v", err)
  936. return
  937. }
  938. result, request_log := service.Jsyb3506(struct3506)
  939. saveJsLog(result, request_log, "3506", "销售退库", struct3506.OrgName)
  940. var dat2 map[string]interface{}
  941. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  942. } else {
  943. }
  944. var dat map[string]interface{}
  945. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  946. } else {
  947. }
  948. c.ServeSuccessJSON(map[string]interface{}{
  949. "pre": dat,
  950. "request_log": dat2,
  951. })
  952. }
  953. func (c *JSybController) Get3507() {
  954. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  955. var respJSON map[string]interface{}
  956. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  957. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  958. return
  959. }
  960. userJSONBytes, _ := json.Marshal(respJSON["struct_3507s"])
  961. var struct3507 models.Struct3507
  962. if err := json.Unmarshal(userJSONBytes, &struct3507); err != nil {
  963. utils.ErrorLog("解析失败:%v", err)
  964. return
  965. }
  966. result, request_log := service.Jsyb3507(struct3507)
  967. saveJsLog(result, request_log, "3507", "库存盘点", struct3507.OrgName)
  968. var dat2 map[string]interface{}
  969. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  970. } else {
  971. }
  972. var dat map[string]interface{}
  973. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  974. } else {
  975. }
  976. c.ServeSuccessJSON(map[string]interface{}{
  977. "pre": dat,
  978. "request_log": dat2,
  979. })
  980. }
  981. func (c *JSybController) Get3508() {
  982. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  983. var respJSON map[string]interface{}
  984. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  985. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  986. return
  987. }
  988. userJSONBytes, _ := json.Marshal(respJSON["struct_3508s"])
  989. var struct3508 models.Struct3508
  990. if err := json.Unmarshal(userJSONBytes, &struct3508); err != nil {
  991. utils.ErrorLog("解析失败:%v", err)
  992. return
  993. }
  994. result, request_log := service.Jsyb3508(struct3508)
  995. saveJsLog(result, request_log, "3508", "库存查询", struct3508.OrgName)
  996. var dat2 map[string]interface{}
  997. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  998. } else {
  999. }
  1000. var dat map[string]interface{}
  1001. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1002. } else {
  1003. }
  1004. c.ServeSuccessJSON(map[string]interface{}{
  1005. "pre": dat,
  1006. "request_log": dat2,
  1007. })
  1008. }
  1009. func (c *JSybController) Get3509() {
  1010. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  1011. var respJSON map[string]interface{}
  1012. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  1013. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  1014. return
  1015. }
  1016. userJSONBytes, _ := json.Marshal(respJSON["struct_3509s"])
  1017. var struct3509 models.Struct3509
  1018. if err := json.Unmarshal(userJSONBytes, &struct3509); err != nil {
  1019. utils.ErrorLog("解析失败:%v", err)
  1020. return
  1021. }
  1022. result, request_log := service.Jsyb3509(struct3509)
  1023. saveJsLog(result, request_log, "3509", "库存查询", struct3509.OrgName)
  1024. var dat2 map[string]interface{}
  1025. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  1026. } else {
  1027. }
  1028. var dat map[string]interface{}
  1029. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1030. } else {
  1031. }
  1032. c.ServeSuccessJSON(map[string]interface{}{
  1033. "pre": dat,
  1034. "request_log": dat2,
  1035. })
  1036. }
  1037. func (c *JSybController) Get3510() {
  1038. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  1039. var respJSON map[string]interface{}
  1040. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  1041. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  1042. return
  1043. }
  1044. userJSONBytes, _ := json.Marshal(respJSON["struct_3510s"])
  1045. var struct3510 models.Struct3510
  1046. if err := json.Unmarshal(userJSONBytes, &struct3510); err != nil {
  1047. utils.ErrorLog("解析失败:%v", err)
  1048. return
  1049. }
  1050. result, request_log := service.Jsyb3510(struct3510)
  1051. saveJsLog(result, request_log, "3510", "库存盘点", struct3510.OrgName)
  1052. var dat2 map[string]interface{}
  1053. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  1054. } else {
  1055. }
  1056. var dat map[string]interface{}
  1057. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1058. } else {
  1059. }
  1060. c.ServeSuccessJSON(map[string]interface{}{
  1061. "pre": dat,
  1062. "request_log": dat2,
  1063. })
  1064. }
  1065. func (c *JSybController) Get3511() {
  1066. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  1067. var respJSON map[string]interface{}
  1068. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  1069. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  1070. return
  1071. }
  1072. userJSONBytes, _ := json.Marshal(respJSON["struct_3511s"])
  1073. var struct3511 models.Struct3511
  1074. if err := json.Unmarshal(userJSONBytes, &struct3511); err != nil {
  1075. utils.ErrorLog("解析失败:%v", err)
  1076. return
  1077. }
  1078. result, request_log := service.Jsyb3511(struct3511)
  1079. saveJsLog(result, request_log, "3511", "库存查询", struct3511.OrgName)
  1080. var dat2 map[string]interface{}
  1081. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  1082. } else {
  1083. }
  1084. var dat map[string]interface{}
  1085. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1086. } else {
  1087. }
  1088. c.ServeSuccessJSON(map[string]interface{}{
  1089. "pre": dat,
  1090. "request_log": dat2,
  1091. })
  1092. }
  1093. func (c *JSybController) Get3512() {
  1094. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  1095. var respJSON map[string]interface{}
  1096. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  1097. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  1098. return
  1099. }
  1100. userJSONBytes, _ := json.Marshal(respJSON["struct_3512s"])
  1101. var struct3512 models.Struct3512
  1102. if err := json.Unmarshal(userJSONBytes, &struct3512); err != nil {
  1103. utils.ErrorLog("解析失败:%v", err)
  1104. return
  1105. }
  1106. result, request_log := service.Jsyb3512(struct3512)
  1107. saveJsLog(result, request_log, "3512", "3512查询", struct3512.OrgName)
  1108. var dat2 map[string]interface{}
  1109. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  1110. } else {
  1111. }
  1112. var dat map[string]interface{}
  1113. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1114. } else {
  1115. }
  1116. c.ServeSuccessJSON(map[string]interface{}{
  1117. "pre": dat,
  1118. "request_log": dat2,
  1119. })
  1120. }
  1121. func (c *JSybController) Get3513() {
  1122. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  1123. var respJSON map[string]interface{}
  1124. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  1125. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  1126. return
  1127. }
  1128. userJSONBytes, _ := json.Marshal(respJSON["struct_3513s"])
  1129. var struct3513 models.Struct3513
  1130. if err := json.Unmarshal(userJSONBytes, &struct3513); err != nil {
  1131. utils.ErrorLog("解析失败:%v", err)
  1132. return
  1133. }
  1134. result, request_log := service.Jsyb3513(struct3513)
  1135. saveJsLog(result, request_log, "3513", "库存盘点", struct3513.OrgName)
  1136. var dat2 map[string]interface{}
  1137. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  1138. } else {
  1139. }
  1140. var dat map[string]interface{}
  1141. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1142. } else {
  1143. }
  1144. c.ServeSuccessJSON(map[string]interface{}{
  1145. "pre": dat,
  1146. "request_log": dat2,
  1147. })
  1148. }
  1149. func (c *JSybController) Get9001() {
  1150. }
  1151. func (c *JSybController) PostOnec() {
  1152. result, inputLog := service.Jsyb1101F()
  1153. fmt.Println(result)
  1154. fmt.Println(inputLog)
  1155. }
  1156. func (c *JSybController) Posttwoc() {
  1157. //result, request_log := service.2201F()
  1158. //saveJsLog(result, request_log, "2201", "挂号", "盐城响水悦达血液透析中心有限公司")
  1159. }
  1160. func (c *JSybController) Get5301() {
  1161. psn_no := c.GetString("psn_no")
  1162. org_name := c.GetString("org_name")
  1163. doctor := c.GetString("doctor")
  1164. fixmedins_code := c.GetString("fixmedins_code")
  1165. insuplc_admdvs := c.GetString("insuplc_admdvs")
  1166. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  1167. secret_key := c.GetString("secret_key")
  1168. url := c.GetString("url")
  1169. ak := c.GetString("ak")
  1170. cainfo := c.GetString("cainfo")
  1171. result, inputLog := service.Jsyb5301(psn_no, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, cainfo)
  1172. //saveJsLog()
  1173. saveJsLog(result, inputLog, "5301", "查询备案", org_name)
  1174. var dat map[string]interface{}
  1175. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1176. } else {
  1177. }
  1178. var dat2 map[string]interface{}
  1179. if err := json.Unmarshal([]byte(inputLog), &dat2); err == nil {
  1180. } else {
  1181. }
  1182. c.ServeSuccessJSON(map[string]interface{}{
  1183. "pre": dat,
  1184. "log": dat2,
  1185. })
  1186. }
  1187. func (c *JSybController) PostOne() {
  1188. certNo := c.GetString("cert_no")
  1189. org_name := c.GetString("org_name")
  1190. doctor := c.GetString("doctor")
  1191. fixmedins_code := c.GetString("fixmedins_code")
  1192. insuplc_admdvs := c.GetString("insuplc_admdvs")
  1193. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  1194. secret_key := c.GetString("secret_key")
  1195. id_card_type, _ := c.GetInt64("id_card_type")
  1196. card_sn := c.GetString("card_sn")
  1197. certificates := c.GetString("certificates")
  1198. url := c.GetString("url")
  1199. ak := c.GetString("ak")
  1200. cainfo := c.GetString("cainfo")
  1201. result, inputLog := service.Jsyb1101(certNo, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type, card_sn, certificates, url, ak, cainfo)
  1202. fmt.Println(result)
  1203. fmt.Println(inputLog)
  1204. saveJsLog(result, inputLog, "1101", "查询个人信息", org_name)
  1205. var dat map[string]interface{}
  1206. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1207. } else {
  1208. }
  1209. var dat2 map[string]interface{}
  1210. if err := json.Unmarshal([]byte(inputLog), &dat2); err == nil {
  1211. } else {
  1212. }
  1213. c.ServeSuccessJSON(map[string]interface{}{
  1214. "pre": dat,
  1215. "log": dat2,
  1216. })
  1217. }
  1218. func (c *JSybController) PostOneD() {
  1219. result, inputLog := service.Jsyb1101F()
  1220. fmt.Println(result)
  1221. fmt.Println(inputLog)
  1222. saveJsLog(result, inputLog, "1101", "查询个人信息", "盐城响水悦达血液透析中心有限公司")
  1223. var dat map[string]interface{}
  1224. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1225. } else {
  1226. }
  1227. var dat2 map[string]interface{}
  1228. if err := json.Unmarshal([]byte(inputLog), &dat2); err == nil {
  1229. } else {
  1230. }
  1231. c.ServeSuccessJSON(map[string]interface{}{
  1232. "pre": dat,
  1233. "log": dat2,
  1234. })
  1235. }
  1236. func (c *JSybController) PostTwo() {
  1237. psnNo := c.GetString("psn_no")
  1238. insutype := c.GetString("insutype")
  1239. certNo := c.GetString("cert_no")
  1240. org_name := c.GetString("org_name")
  1241. doctor := c.GetString("doctor")
  1242. ipt_otp_no := c.GetString("ipt_otp_no")
  1243. dept := c.GetString("dept")
  1244. verify_number := c.GetString("verify_number")
  1245. fixmedins_code := c.GetString("fixmedins_code")
  1246. dept_code := c.GetString("dept_code")
  1247. doctor_id := c.GetString("doctor_id")
  1248. insuplc_admdvs := c.GetString("insuplc_admdvs")
  1249. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  1250. secret_key := c.GetString("secret_key")
  1251. id_card_type, _ := c.GetInt64("id_card_type")
  1252. url := c.GetString("url")
  1253. ak := c.GetString("ak")
  1254. doctor_name := c.GetString("doctor_name")
  1255. cainfo := c.GetString("cainfo")
  1256. result, request_log := service.Jsyb2201(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, doctor_name, url, ak, verify_number, cainfo)
  1257. saveJsLog(result, request_log, "2201", "挂号", org_name)
  1258. var dat map[string]interface{}
  1259. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1260. } else {
  1261. }
  1262. var dat2 map[string]interface{}
  1263. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  1264. } else {
  1265. }
  1266. c.ServeSuccessJSON(map[string]interface{}{
  1267. "pre": dat,
  1268. "request_log": dat2,
  1269. })
  1270. }
  1271. func (c *JSybController) PostThree() {
  1272. psnNo := c.GetString("psn_no")
  1273. mdtrtId := c.GetString("mdtrt_id")
  1274. iptOtpNo := c.GetString("ipt_otp_no")
  1275. org_name := c.GetString("org_name")
  1276. doctor := c.GetString("doctor")
  1277. insuplc_admdvs := c.GetString("insuplc_admdvs")
  1278. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  1279. secret_key := c.GetString("secret_key")
  1280. fixmedins_code := c.GetString("fixmedins_code")
  1281. url := c.GetString("url")
  1282. ak := c.GetString("ak")
  1283. cainfo := c.GetString("cainfo")
  1284. result, request_log := service.Jsyb2202(psnNo, mdtrtId, iptOtpNo, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code, url, ak, cainfo)
  1285. saveJsLog(result, request_log, "2202", "退号", org_name)
  1286. var dat map[string]interface{}
  1287. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1288. } else {
  1289. }
  1290. var dat2 map[string]interface{}
  1291. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  1292. } else {
  1293. }
  1294. c.ServeSuccessJSON(map[string]interface{}{
  1295. "pre": dat,
  1296. "request_log": dat2,
  1297. })
  1298. }
  1299. func (c *JSybController) PostFour() {
  1300. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  1301. var respJSON map[string]interface{}
  1302. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  1303. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  1304. return
  1305. }
  1306. userJSONBytes, _ := json.Marshal(respJSON["config"])
  1307. var config []*models.HisXtDiagnoseConfig
  1308. if err := json.Unmarshal(userJSONBytes, &config); err != nil {
  1309. utils.ErrorLog("解析失败:%v", err)
  1310. return
  1311. }
  1312. fmt.Println(respJSON["psn_no"].(string))
  1313. fmt.Println(respJSON["mdtrt_id"].(string))
  1314. psnNo := respJSON["psn_no"].(string)
  1315. mdtrtId := respJSON["mdtrt_id"].(string)
  1316. doctor := respJSON["doctor"].(string)
  1317. department := respJSON["department"].(string)
  1318. org_name := respJSON["org_name"].(string)
  1319. med_type := respJSON["med_type"].(string)
  1320. doctor_id := respJSON["doctor_id"].(string)
  1321. fixmedins_code := respJSON["fixmedins_code"].(string)
  1322. sick_code := respJSON["sick_code"].(string)
  1323. sick_name := respJSON["sick_name"].(string)
  1324. dept := respJSON["dept"].(string)
  1325. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  1326. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  1327. secret_key := respJSON["secret_key"].(string)
  1328. url := respJSON["url"].(string)
  1329. ak := respJSON["ak"].(string)
  1330. begin_time := respJSON["begin_time"].(string)
  1331. cainfo := respJSON["cainfo"].(string)
  1332. //cainfo := c.GetString("cainfo")
  1333. result, request_log, timeStamp := service.Jsyb2203(psnNo, mdtrtId, doctor, department, org_name, med_type, doctor_id, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, sick_code, sick_name, dept, config, url, ak, begin_time, cainfo)
  1334. saveJsLog(result, request_log, "2203", "上传就诊信息", org_name)
  1335. var dat2 map[string]interface{}
  1336. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  1337. } else {
  1338. }
  1339. var dat map[string]interface{}
  1340. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1341. } else {
  1342. }
  1343. var dat3 int64
  1344. if err := json.Unmarshal([]byte(strconv.FormatInt(timeStamp, 10)), &dat3); err == nil {
  1345. } else {
  1346. }
  1347. c.ServeSuccessJSON(map[string]interface{}{
  1348. "pre": dat,
  1349. "request_log": dat2,
  1350. "time_stamp": dat3,
  1351. })
  1352. }
  1353. type All struct {
  1354. HisPrescription HisPrescription
  1355. mdtrt_id string
  1356. psn_no string
  1357. }
  1358. type HisPrescription struct {
  1359. ID int64 `gorm:"column:id" json:"id" form:"id"`
  1360. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  1361. RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
  1362. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  1363. HisPatientId int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
  1364. Status int64 `gorm:"column:status" json:"status" form:"status"`
  1365. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  1366. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  1367. Number string `gorm:"column:number" json:"number" form:"number"`
  1368. Type int64 `gorm:"column:type" json:"type" form:"type"`
  1369. Doctor int64 `gorm:"column:doctor" json:"doctor" form:"doctor"`
  1370. Creator int64 `gorm:"column:creator" json:"creator" form:"creator"`
  1371. Modifier int64 `gorm:"column:modifier" json:"modifier" form:"modifier"`
  1372. HisDoctorAdviceInfo []*models.HisDoctorAdviceInfo `gorm:"ForeignKey:PatientId,RecordDate,PrescriptionId;AssociationForeignKey:PatientId,RecordDate,ID" json:"advices"`
  1373. HisPrescriptionProject []*models.HisPrescriptionProject `gorm:"ForeignKey:PatientId,RecordDate,PrescriptionId;AssociationForeignKey:PatientId,RecordDate,ID" json:"project"`
  1374. }
  1375. func (c *JSybController) PostFive() {
  1376. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  1377. var respJSON map[string]interface{}
  1378. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  1379. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  1380. return
  1381. }
  1382. userJSONBytes, _ := json.Marshal(respJSON["pre"])
  1383. var hp []*models.HisPrescription
  1384. if err := json.Unmarshal(userJSONBytes, &hp); err != nil {
  1385. utils.ErrorLog("解析失败:%v", err)
  1386. return
  1387. }
  1388. //fmt.Println("2203A的time_stamp=" + respJSON["time_stamp"].(string))
  1389. result, request_log := service.Jsyb2204(respJSON["psn_no"].(string), respJSON["mdtrt_id"].(string), hp, respJSON["chrg_bchno"].(string), respJSON["org_name"].(string),
  1390. respJSON["opter"].(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["url"].(string), respJSON["ak"].(string), respJSON["new_doctor_name"].(string), "", respJSON["cainfo"].(string))
  1391. saveJsLog(result, request_log, "2204", "上传明细", respJSON["org_name"].(string))
  1392. var dat map[string]interface{}
  1393. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1394. fmt.Println(dat)
  1395. } else {
  1396. fmt.Println(err)
  1397. }
  1398. var dat2 map[string]interface{}
  1399. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  1400. fmt.Println(dat2)
  1401. } else {
  1402. fmt.Println(err)
  1403. }
  1404. c.ServeSuccessJSON(map[string]interface{}{
  1405. "pre": dat,
  1406. "request_log": dat2,
  1407. })
  1408. }
  1409. func (c *JSybController) PostSix() {
  1410. psnNo := c.GetString("psn_no")
  1411. mdtrtId := c.GetString("mdtrt_id")
  1412. chrgBchno := c.GetString("chrg_bchno")
  1413. org_name := c.GetString("org_name")
  1414. doctor := c.GetString("doctor")
  1415. insuplc_admdvs := c.GetString("insuplc_admdvs")
  1416. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  1417. secret_key := c.GetString("secret_key")
  1418. fixmedins_code := c.GetString("fixmedins_code")
  1419. url := c.GetString("url")
  1420. ak := c.GetString("ak")
  1421. cainfo := c.GetString("cainfo")
  1422. result, request_log := service.Jsyb2205(psnNo, mdtrtId, chrgBchno, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code, url, ak, cainfo)
  1423. fmt.Println(request_log)
  1424. saveJsLog(result, request_log, "2205", "撤销明细", org_name)
  1425. var dat map[string]interface{}
  1426. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1427. fmt.Println(dat)
  1428. } else {
  1429. fmt.Println(err)
  1430. }
  1431. var dat2 map[string]interface{}
  1432. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  1433. fmt.Println(dat2)
  1434. } else {
  1435. fmt.Println(err)
  1436. }
  1437. c.ServeSuccessJSON(map[string]interface{}{
  1438. "pre": dat,
  1439. "request_log": dat2,
  1440. })
  1441. }
  1442. func (c *JSybController) PostSeven() {
  1443. psnNo := c.GetString("psn_no")
  1444. mdtrtId := c.GetString("mdtrt_id")
  1445. chrgBchno := c.GetString("chrg_bchno")
  1446. certNo := c.GetString("cert_no")
  1447. insutype := c.GetString("insutype")
  1448. total := c.GetString("total")
  1449. org_name := c.GetString("org_name")
  1450. doctor := c.GetString("doctor")
  1451. fixmedins_code := c.GetString("fixmedins_code")
  1452. insuplc_admdvs := c.GetString("insuplc_admdvs")
  1453. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  1454. secret_key := c.GetString("secret_key")
  1455. med_type := c.GetString("med_type")
  1456. id_card_type, _ := c.GetInt64("id_card_type")
  1457. certificates, _ := c.GetInt64("certificates")
  1458. verify_number := c.GetString("verify_number")
  1459. cainfo := c.GetString("cainfo")
  1460. mdtrt_grp_type := c.GetString("mdtrt_grp_type")
  1461. url := c.GetString("url")
  1462. ak := c.GetString("ak")
  1463. var result string
  1464. var request_log string
  1465. result, request_log = service.Jsyb2206(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, url, ak, verify_number, cainfo, mdtrt_grp_type)
  1466. saveJsLog(result, request_log, "2206", "预结算", org_name)
  1467. var dat map[string]interface{}
  1468. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1469. fmt.Println(dat)
  1470. } else {
  1471. fmt.Println(err)
  1472. }
  1473. var dat2 map[string]interface{}
  1474. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  1475. fmt.Println(dat2)
  1476. } else {
  1477. fmt.Println(err)
  1478. }
  1479. c.ServeSuccessJSON(map[string]interface{}{
  1480. "pre": dat,
  1481. "request_log": dat2,
  1482. })
  1483. }
  1484. func (c *JSybController) PostEight() {
  1485. psnNo := c.GetString("psn_no")
  1486. mdtrtId := c.GetString("mdtrt_id")
  1487. chrgBchno := c.GetString("chrg_bchno")
  1488. certNo := c.GetString("cert_no")
  1489. insutype := c.GetString("insutype")
  1490. total := c.GetString("total")
  1491. org_name := c.GetString("org_name")
  1492. doctor := c.GetString("doctor")
  1493. fixmedins_code := c.GetString("fixmedins_code")
  1494. insuplc_admdvs := c.GetString("insuplc_admdvs")
  1495. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  1496. secret_key := c.GetString("secret_key")
  1497. med_type := c.GetString("med_type")
  1498. id_card_type, _ := c.GetInt64("id_card_type")
  1499. certificates, _ := c.GetInt64("certificates")
  1500. fulamt_ownpay_amt, _ := c.GetFloat("fulamt_ownpay_amt")
  1501. overlmt_selfpay, _ := c.GetFloat("overlmt_selfpay")
  1502. preselfpay_amt, _ := c.GetFloat("preselfpay_amt")
  1503. inscp_scp_amt, _ := c.GetFloat("inscp_scp_amt")
  1504. acct_used_flag := c.GetString("acct_used_flag")
  1505. url := c.GetString("url")
  1506. ak := c.GetString("ak")
  1507. verify_number := c.GetString("verify_number")
  1508. cainfo := c.GetString("cainfo")
  1509. mdtrt_grp_type := c.GetString("mdtrt_grp_type")
  1510. var result string
  1511. var request_log string
  1512. if id_card_type == 4 {
  1513. //_, pBusiCardInfo := GetELeCertInfoSettle(fixmedins_code, "", "")
  1514. //pBusiCardInfo = Remove0000(pBusiCardInfo)
  1515. //var ele ELeData
  1516. //err := json.Unmarshal([]byte(pBusiCardInfo), &ele)
  1517. //if err != nil {
  1518. // utils.ErrorLog("解析失败:%v", err)
  1519. //}
  1520. //token := ele.Data.EcCardToken
  1521. //if len(token) > 0 {
  1522. result, request_log = service.Jsyb2207(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, url, ak, verify_number, cainfo, mdtrt_grp_type)
  1523. //}
  1524. } else {
  1525. result, request_log = service.Jsyb2207(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, url, ak, verify_number, cainfo, mdtrt_grp_type)
  1526. }
  1527. saveJsLog(result, request_log, "2207", "结算", org_name)
  1528. var dat map[string]interface{}
  1529. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1530. fmt.Println(dat)
  1531. } else {
  1532. fmt.Println(err)
  1533. }
  1534. var dat2 map[string]interface{}
  1535. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  1536. fmt.Println(dat2)
  1537. } else {
  1538. fmt.Println(err)
  1539. }
  1540. c.ServeSuccessJSON(map[string]interface{}{
  1541. "pre": dat,
  1542. "request_log": dat2,
  1543. })
  1544. }
  1545. func (c *JSybController) PostNine() {
  1546. psnNo := c.GetString("psn_no")
  1547. mdtrtId := c.GetString("mdtrt_id")
  1548. setlId := c.GetString("setl_id")
  1549. org_name := c.GetString("org_name")
  1550. doctor := c.GetString("doctor")
  1551. secret_key := c.GetString("secret_key")
  1552. fixmedins_code := c.GetString("fixmedins_code")
  1553. insuplc_admdvs := c.GetString("insuplc_admdvs")
  1554. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  1555. url := c.GetString("url")
  1556. ak := c.GetString("ak")
  1557. cainfo := c.GetString("cainfo")
  1558. result, request_log := service.Jsyb2208(psnNo, mdtrtId, setlId, org_name, doctor, secret_key, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, cainfo)
  1559. saveJsLog(result, request_log, "2208", "退费", org_name)
  1560. fmt.Println(request_log)
  1561. var dat map[string]interface{}
  1562. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1563. fmt.Println(dat)
  1564. } else {
  1565. fmt.Println(err)
  1566. }
  1567. var dat2 map[string]interface{}
  1568. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  1569. fmt.Println(dat2)
  1570. } else {
  1571. fmt.Println(err)
  1572. }
  1573. c.ServeSuccessJSON(map[string]interface{}{
  1574. "pre": dat,
  1575. "request_log": dat2,
  1576. })
  1577. }
  1578. func (c *JSybController) PostTen() {
  1579. psnNo := c.GetString("psn_no")
  1580. mdtrtId := c.GetString("mdtrt_id")
  1581. setlId := c.GetString("setl_id")
  1582. org_name := c.GetString("org_name")
  1583. doctor := c.GetString("doctor")
  1584. secret_key := c.GetString("secret_key")
  1585. fixmedins_code := c.GetString("fixmedins_code")
  1586. insuplc_admdvs := c.GetString("insuplc_admdvs")
  1587. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  1588. url := c.GetString("url")
  1589. ak := c.GetString("ak")
  1590. cainfo := c.GetString("cainfo")
  1591. baseParams := models.BaseParams{
  1592. SecretKey: secret_key,
  1593. FixmedinsCode: fixmedins_code,
  1594. InsuplcAdmdvs: insuplc_admdvs,
  1595. MdtrtareaAdmvs: mdtrtarea_admvs,
  1596. OrgName: org_name,
  1597. Doctor: doctor,
  1598. RequestUrl: url,
  1599. AccessKey: ak,
  1600. Cainfo: cainfo,
  1601. }
  1602. businessParams := models.BusinessParams{
  1603. PsnNo: psnNo,
  1604. MdtrtId: mdtrtId,
  1605. SetlId: setlId,
  1606. }
  1607. result, request_log := service.Jsyb5203(baseParams, businessParams)
  1608. saveJsLog(result, request_log, "5203", "结算单", org_name)
  1609. var dat map[string]interface{}
  1610. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1611. fmt.Println(dat)
  1612. } else {
  1613. fmt.Println(err)
  1614. }
  1615. var dat2 map[string]interface{}
  1616. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  1617. fmt.Println(dat2)
  1618. } else {
  1619. fmt.Println(err)
  1620. }
  1621. c.ServeSuccessJSON(map[string]interface{}{
  1622. "pre": dat,
  1623. "request_log": dat2,
  1624. })
  1625. }
  1626. func (c *JSybController) Get2503() {
  1627. psnNo := c.GetString("psn_no")
  1628. insutype := c.GetString("insutype")
  1629. sick_code := c.GetString("sick_code")
  1630. sick_name := c.GetString("sick_name")
  1631. insuplc_admdvs := c.GetString("insuplc_admdvs")
  1632. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  1633. secret_key := c.GetString("secret_key")
  1634. access_key := c.GetString("access_key")
  1635. fixmedins_code := c.GetString("fixmedins_code")
  1636. org_name := c.GetString("org_name")
  1637. check_time := c.GetString("check_time")
  1638. doctor_id := c.GetString("doctor_id")
  1639. doctor := c.GetString("doctor")
  1640. start_time := c.GetString("start_time")
  1641. end_time := c.GetString("end_time")
  1642. url := c.GetString("url")
  1643. cainfo := c.GetString("cainfo")
  1644. service.Jsyb2503(psnNo, insutype, org_name, doctor, fixmedins_code, doctor_id, insuplc_admdvs, mdtrtarea_admvs, secret_key, sick_name, sick_code, start_time, end_time, check_time, url, access_key, cainfo)
  1645. }
  1646. func (c *JSybController) Get3201() {
  1647. insutype := c.GetString("insutype")
  1648. clrType := c.GetString("clr_type")
  1649. setlOptins := c.GetString("setl_optins")
  1650. stmtBegndate := c.GetString("stmt_begndate")
  1651. stmtEnddate := c.GetString("stm_enddate")
  1652. medfeeSumamt, _ := c.GetFloat("medfee_sumamt", 0)
  1653. fundPaySumamt, _ := c.GetFloat("fund_pay_sumamt", 0)
  1654. acctPay, _ := c.GetFloat("acct_pay", 0)
  1655. fixmedinsSetlCnt, _ := c.GetInt64("fixmedins_setl_cnt", 0)
  1656. fixmedins_code := c.GetString("fixmedins_code")
  1657. insuplc_admdvs := c.GetString("insuplc_admdvs")
  1658. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  1659. secret_key := c.GetString("secret_key")
  1660. org_name := c.GetString("org_name")
  1661. doctor := c.GetString("doctor")
  1662. url := c.GetString("url")
  1663. ak := c.GetString("ak")
  1664. cainfo := c.GetString("cainfo")
  1665. result, request_log := service.Jsyb3201(fixmedinsSetlCnt, acctPay, fundPaySumamt, medfeeSumamt, stmtBegndate, stmtEnddate, setlOptins, clrType, insutype, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, secret_key, cainfo)
  1666. saveJsLog(result, request_log, "3201", "对总账", org_name)
  1667. var dat map[string]interface{}
  1668. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1669. fmt.Println(dat)
  1670. } else {
  1671. fmt.Println(err)
  1672. }
  1673. var dat2 map[string]interface{}
  1674. if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
  1675. fmt.Println(dat2)
  1676. } else {
  1677. fmt.Println(err)
  1678. }
  1679. c.ServeSuccessJSON(map[string]interface{}{
  1680. "pre": dat,
  1681. "request_log": dat2,
  1682. })
  1683. }
  1684. type ELeData struct {
  1685. Data struct {
  1686. SiNo string `json:"si_no"`
  1687. SiCardNo string `json:"si_card_no"`
  1688. SiCardIssueArea string `json:"si_card_issue_area"`
  1689. Name string `json:"name"`
  1690. Gender string `json:"gender"`
  1691. IdType string `json:"id_type"`
  1692. IdNo string `json:"id_no"`
  1693. EcCardToken string `json:"ecCardToken"`
  1694. } `json:"data"`
  1695. Code int `json:"code"`
  1696. Message string `json:"message"`
  1697. }
  1698. type ELeCertData struct {
  1699. Data struct {
  1700. Extra string `json:"extra"`
  1701. IDNo string `json:"idNo"`
  1702. IDType string `json:"idType"`
  1703. EcToken string `json:"ecToken"`
  1704. InsuOrg string `json:"insuOrg"`
  1705. UserName string `json:"userName"`
  1706. EcIndexNo string `json:"ecIndexNo"`
  1707. Gender string `json:"gender"`
  1708. Birthday string `json:"birthday"`
  1709. Nationality string `json:"nationality"`
  1710. Email string `json:"email"`
  1711. } `json:"data"`
  1712. Code int `json:"code"`
  1713. Message string `json:"message"`
  1714. }
  1715. type ELeCertDatathree struct {
  1716. Data struct {
  1717. AuthNo string `json:"authNo"`
  1718. Extra string `json:"extra"`
  1719. IDNo string `json:"idNo"`
  1720. IDType string `json:"idType"`
  1721. EcToken string `json:"ecToken"`
  1722. InsuOrg string `json:"insuOrg"`
  1723. UserName string `json:"userName"`
  1724. EcIndexNo string `json:"ecIndexNo"`
  1725. Gender string `json:"gender"`
  1726. Birthday string `json:"birthday"`
  1727. Nationality string `json:"nationality"`
  1728. Email string `json:"email"`
  1729. } `json:"data"`
  1730. Code int `json:"code"`
  1731. Message string `json:"message"`
  1732. }
  1733. type ELeCertDatatwo struct {
  1734. Data struct {
  1735. AuthNo string `json:"authNo"`
  1736. OutBizNo string `json:"outBizNo"`
  1737. } `json:"data"`
  1738. Code int `json:"code"`
  1739. Message string `json:"message"`
  1740. }
  1741. func (c *JSybController) Readcardface() {
  1742. fixmedins_code := c.GetString("fixmedins_code")
  1743. secret_key := c.GetString("secret_key")
  1744. ak := c.GetString("ak")
  1745. org_name := c.GetString("org_name")
  1746. doctor := c.GetString("doctor")
  1747. insuplc_admdvs := c.GetString("insuplc_admdvs")
  1748. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  1749. url := c.GetString("url")
  1750. cainfo := c.GetString("cainfo")
  1751. operator_id := c.GetString("operator_id")
  1752. operator := c.GetString("operator")
  1753. fmt.Println(operator_id)
  1754. fmt.Println(operator)
  1755. _, pBusiCardInfo := c.GetELeCertInfoByFace(fixmedins_code, operator_id, operator, "01301")
  1756. fmt.Println(pBusiCardInfo)
  1757. pBusiCardInfo = Remove0000(pBusiCardInfo)
  1758. var eletwo ELeCertDatatwo
  1759. json.Unmarshal([]byte(pBusiCardInfo), &eletwo)
  1760. _, pBusiCardInfotwo := GetELeCertInfoByFacetwo(fixmedins_code, operator_id, operator, eletwo.Data.AuthNo, eletwo.Data.OutBizNo, "01301")
  1761. var ele ELeCertDatathree
  1762. err2 := json.Unmarshal([]byte(pBusiCardInfotwo), &ele)
  1763. if err2 != nil {
  1764. utils.ErrorLog("解析失败:%v", err2)
  1765. }
  1766. token := ele.Data.EcToken
  1767. fmt.Println(token)
  1768. if len(token) > 0 {
  1769. userName := ele.Data.UserName
  1770. fmt.Println(userName)
  1771. userName = Remove0000(userName)
  1772. userName = DeleteExtraSpace(userName)
  1773. fmt.Println(userName)
  1774. enc := mahonia.NewEncoder("gbk")
  1775. fmt.Println(enc.ConvertString(userName))
  1776. result, _ := service.Jsyb1101ForEleCert(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, token, cainfo, ele.Data.IDNo, userName)
  1777. var dat map[string]interface{}
  1778. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1779. fmt.Println(dat)
  1780. } else {
  1781. fmt.Println(err)
  1782. }
  1783. c.ServeSuccessJSON(map[string]interface{}{
  1784. "status": "0",
  1785. "card_info": "",
  1786. "busi_card_info": pBusiCardInfotwo,
  1787. "token": token,
  1788. "result": dat,
  1789. "eletwo": pBusiCardInfo,
  1790. })
  1791. } else {
  1792. c.ServeSuccessJSON(map[string]interface{}{
  1793. "status": "-1",
  1794. })
  1795. }
  1796. }
  1797. func (c *JSybController) Readcardcharge() {
  1798. fixmedins_code := c.GetString("fixmedins_code")
  1799. secret_key := c.GetString("secret_key")
  1800. ak := c.GetString("ak")
  1801. org_name := c.GetString("org_name")
  1802. doctor := c.GetString("doctor")
  1803. insuplc_admdvs := c.GetString("insuplc_admdvs")
  1804. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  1805. url := c.GetString("url")
  1806. cainfo := c.GetString("cainfo")
  1807. id_card_type := c.GetString("id_card_type")
  1808. operator_id := c.GetString("operator_id")
  1809. operator := c.GetString("operator")
  1810. //result, request := service.Jsyb9001(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, 1, url, cainfo, ak)
  1811. //fmt.Println(request)
  1812. //fmt.Println(result)
  1813. c.TestGetBasBaseInit(fixmedins_code, secret_key, ak)
  1814. switch id_card_type {
  1815. case "1":
  1816. pCardInfo, pBusiCardInfo := c.GetBasBaseInfo()
  1817. pBusiCardInfo = Remove0000(pBusiCardInfo)
  1818. pCardInfo = Remove0000(pCardInfo)
  1819. fmt.Println(":", ConvertToString(pCardInfo, "gbk", "utf-8"))
  1820. fmt.Println(pBusiCardInfo)
  1821. fmt.Println(pCardInfo)
  1822. bas := strings.Split(pCardInfo, "|")
  1823. basNumber := bas[2]
  1824. id_card_no := bas[1]
  1825. card_sn := bas[3]
  1826. id_card_type_int, _ := strconv.ParseInt(id_card_type, 10, 64)
  1827. if len(pCardInfo) > 0 && len(pBusiCardInfo) > 0 {
  1828. result, _ := service.Jsyb1101A(basNumber, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type_int, card_sn, "1", url, ak, pBusiCardInfo, id_card_no, cainfo)
  1829. var dat map[string]interface{}
  1830. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1831. fmt.Println(dat)
  1832. } else {
  1833. fmt.Println(err)
  1834. }
  1835. c.ServeSuccessJSON(map[string]interface{}{
  1836. "status": "0",
  1837. "card_info": pCardInfo,
  1838. "busi_card_info": pBusiCardInfo,
  1839. "result": dat,
  1840. "type": "1",
  1841. })
  1842. } else {
  1843. c.ServeSuccessJSON(map[string]interface{}{
  1844. "status": "-1",
  1845. })
  1846. }
  1847. break
  1848. case "3": //电子社保卡
  1849. _, pBusiCardInfo := c.GetELeInfo(fixmedins_code, operator_id, operator)
  1850. //fmt.Println(pCardInfo)
  1851. fmt.Println(pBusiCardInfo)
  1852. pBusiCardInfo = Remove0000(pBusiCardInfo)
  1853. //pCardInfo = Remove0000(pCardInfo)
  1854. var ele ELeData
  1855. err := json.Unmarshal([]byte(pBusiCardInfo), &ele)
  1856. if err != nil {
  1857. utils.ErrorLog("解析失败:%v", err)
  1858. }
  1859. token := ele.Data.EcCardToken
  1860. if len(token) > 0 {
  1861. result, _ := service.Jsyb1101B(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, token, cainfo, ele.Data.IdNo)
  1862. var dat map[string]interface{}
  1863. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1864. fmt.Println(dat)
  1865. } else {
  1866. fmt.Println(err)
  1867. }
  1868. c.ServeSuccessJSON(map[string]interface{}{
  1869. "status": "0",
  1870. //"card_info": pCardInfo,
  1871. "busi_card_info": pBusiCardInfo,
  1872. "token": token,
  1873. "result": dat,
  1874. "type": "2",
  1875. })
  1876. } else {
  1877. c.ServeSuccessJSON(map[string]interface{}{
  1878. "status": "-1",
  1879. })
  1880. }
  1881. break
  1882. case "4": //电子凭证
  1883. fmt.Println(operator_id)
  1884. fmt.Println(operator)
  1885. _, pBusiCardInfo := c.GetELeCertInfoThree(fixmedins_code, operator_id, operator)
  1886. fmt.Println(pBusiCardInfo)
  1887. pBusiCardInfo = Remove0000(pBusiCardInfo)
  1888. var ele ELeCertData
  1889. err := json.Unmarshal([]byte(pBusiCardInfo), &ele)
  1890. if err != nil {
  1891. utils.ErrorLog("解析失败:%v", err)
  1892. }
  1893. token := ele.Data.EcToken
  1894. fmt.Println(token)
  1895. if len(token) > 0 {
  1896. userName := ele.Data.UserName
  1897. fmt.Println(userName)
  1898. userName = Remove0000(userName)
  1899. userName = DeleteExtraSpace(userName)
  1900. fmt.Println(userName)
  1901. enc := mahonia.NewEncoder("gbk")
  1902. fmt.Println(enc.ConvertString(userName))
  1903. result, _ := service.Jsyb1101ForEleCert(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, token, cainfo, ele.Data.IDNo, userName)
  1904. var dat map[string]interface{}
  1905. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1906. fmt.Println(dat)
  1907. } else {
  1908. fmt.Println(err)
  1909. }
  1910. c.ServeSuccessJSON(map[string]interface{}{
  1911. "status": "0",
  1912. "card_info": "",
  1913. "busi_card_info": pBusiCardInfo,
  1914. "token": token,
  1915. "result": dat,
  1916. })
  1917. } else {
  1918. c.ServeSuccessJSON(map[string]interface{}{
  1919. "status": "-1",
  1920. })
  1921. }
  1922. break
  1923. }
  1924. }
  1925. func (c *JSybController) Readcardchargeother() {
  1926. fixmedins_code := c.GetString("fixmedins_code")
  1927. secret_key := c.GetString("secret_key")
  1928. ak := c.GetString("ak")
  1929. org_name := c.GetString("org_name")
  1930. doctor := c.GetString("doctor")
  1931. insuplc_admdvs := c.GetString("insuplc_admdvs")
  1932. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  1933. url := c.GetString("url")
  1934. cainfo := c.GetString("cainfo")
  1935. id_card_type := c.GetString("id_card_type")
  1936. operator_id := c.GetString("operator_id")
  1937. operator := c.GetString("operator")
  1938. //result, request := service.Jsyb9001(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, 1, url, cainfo, ak)
  1939. //fmt.Println(request)
  1940. //fmt.Println(result)
  1941. c.TestGetBasBaseInit(fixmedins_code, secret_key, ak)
  1942. switch id_card_type {
  1943. case "1":
  1944. pCardInfo, pBusiCardInfo := c.GetBasBaseInfo()
  1945. pBusiCardInfo = Remove0000(pBusiCardInfo)
  1946. pCardInfo = Remove0000(pCardInfo)
  1947. fmt.Println(":", ConvertToString(pCardInfo, "gbk", "utf-8"))
  1948. fmt.Println(pBusiCardInfo)
  1949. fmt.Println(pCardInfo)
  1950. bas := strings.Split(pCardInfo, "|")
  1951. basNumber := bas[2]
  1952. id_card_no := bas[1]
  1953. card_sn := bas[3]
  1954. id_card_type_int, _ := strconv.ParseInt(id_card_type, 10, 64)
  1955. if len(pCardInfo) > 0 && len(pBusiCardInfo) > 0 {
  1956. result, _ := service.Jsyb1101A(basNumber, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type_int, card_sn, "1", url, ak, pBusiCardInfo, id_card_no, cainfo)
  1957. var dat map[string]interface{}
  1958. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1959. fmt.Println(dat)
  1960. } else {
  1961. fmt.Println(err)
  1962. }
  1963. c.ServeSuccessJSON(map[string]interface{}{
  1964. "status": "0",
  1965. "card_info": pCardInfo,
  1966. "busi_card_info": pBusiCardInfo,
  1967. "result": dat,
  1968. "type": "1",
  1969. })
  1970. } else {
  1971. c.ServeSuccessJSON(map[string]interface{}{
  1972. "status": "-1",
  1973. })
  1974. }
  1975. break
  1976. case "3": //电子社保卡
  1977. _, pBusiCardInfo := c.GetELeInfo(fixmedins_code, operator_id, operator)
  1978. //fmt.Println(pCardInfo)
  1979. fmt.Println(pBusiCardInfo)
  1980. pBusiCardInfo = Remove0000(pBusiCardInfo)
  1981. //pCardInfo = Remove0000(pCardInfo)
  1982. var ele ELeData
  1983. err := json.Unmarshal([]byte(pBusiCardInfo), &ele)
  1984. if err != nil {
  1985. utils.ErrorLog("解析失败:%v", err)
  1986. }
  1987. token := ele.Data.EcCardToken
  1988. if len(token) > 0 {
  1989. result, _ := service.Jsyb1101B(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, token, cainfo, ele.Data.IdNo)
  1990. var dat map[string]interface{}
  1991. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1992. fmt.Println(dat)
  1993. } else {
  1994. fmt.Println(err)
  1995. }
  1996. c.ServeSuccessJSON(map[string]interface{}{
  1997. "status": "0",
  1998. //"card_info": pCardInfo,
  1999. "busi_card_info": pBusiCardInfo,
  2000. "token": token,
  2001. "result": dat,
  2002. "type": "2",
  2003. })
  2004. } else {
  2005. c.ServeSuccessJSON(map[string]interface{}{
  2006. "status": "-1",
  2007. })
  2008. }
  2009. break
  2010. case "4": //电子凭证
  2011. fmt.Println(operator_id)
  2012. fmt.Println(operator)
  2013. _, pBusiCardInfo := c.GetELeCertInfoFour(fixmedins_code, operator_id, operator)
  2014. fmt.Println(pBusiCardInfo)
  2015. pBusiCardInfo = Remove0000(pBusiCardInfo)
  2016. var ele ELeCertData
  2017. err := json.Unmarshal([]byte(pBusiCardInfo), &ele)
  2018. if err != nil {
  2019. utils.ErrorLog("解析失败:%v", err)
  2020. }
  2021. token := ele.Data.EcToken
  2022. fmt.Println(token)
  2023. if len(token) > 0 {
  2024. userName := ele.Data.UserName
  2025. fmt.Println(userName)
  2026. userName = Remove0000(userName)
  2027. userName = DeleteExtraSpace(userName)
  2028. fmt.Println(userName)
  2029. enc := mahonia.NewEncoder("gbk")
  2030. fmt.Println(enc.ConvertString(userName))
  2031. result, _ := service.Jsyb1101ForEleCert(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, token, cainfo, ele.Data.IDNo, userName)
  2032. var dat map[string]interface{}
  2033. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2034. fmt.Println(dat)
  2035. } else {
  2036. fmt.Println(err)
  2037. }
  2038. c.ServeSuccessJSON(map[string]interface{}{
  2039. "status": "0",
  2040. "card_info": "",
  2041. "busi_card_info": pBusiCardInfo,
  2042. "token": token,
  2043. "result": dat,
  2044. })
  2045. } else {
  2046. c.ServeSuccessJSON(map[string]interface{}{
  2047. "status": "-1",
  2048. })
  2049. }
  2050. break
  2051. }
  2052. }
  2053. func (c *JSybController) ReadCard() {
  2054. fixmedins_code := c.GetString("fixmedins_code")
  2055. secret_key := c.GetString("secret_key")
  2056. ak := c.GetString("ak")
  2057. org_name := c.GetString("org_name")
  2058. doctor := c.GetString("doctor")
  2059. insuplc_admdvs := c.GetString("insuplc_admdvs")
  2060. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  2061. url := c.GetString("url")
  2062. cainfo := c.GetString("cainfo")
  2063. id_card_type := c.GetString("id_card_type")
  2064. operator_id := c.GetString("operator_id")
  2065. operator := c.GetString("operator")
  2066. //result, request := service.Jsyb9001(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, 1, url, cainfo, ak)
  2067. //fmt.Println(request)
  2068. //fmt.Println(result)
  2069. c.TestGetBasBaseInit(fixmedins_code, secret_key, ak)
  2070. switch id_card_type {
  2071. case "1":
  2072. pCardInfo, pBusiCardInfo := c.GetBasBaseInfo()
  2073. pBusiCardInfo = Remove0000(pBusiCardInfo)
  2074. pCardInfo = Remove0000(pCardInfo)
  2075. fmt.Println(":", ConvertToString(pCardInfo, "gbk", "utf-8"))
  2076. fmt.Println(pBusiCardInfo)
  2077. fmt.Println(pCardInfo)
  2078. bas := strings.Split(pCardInfo, "|")
  2079. basNumber := bas[2]
  2080. id_card_no := bas[1]
  2081. card_sn := bas[3]
  2082. id_card_type_int, _ := strconv.ParseInt(id_card_type, 10, 64)
  2083. if len(pCardInfo) > 0 && len(pBusiCardInfo) > 0 {
  2084. result, _ := service.Jsyb1101A(basNumber, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type_int, card_sn, "1", url, ak, pBusiCardInfo, id_card_no, cainfo)
  2085. var dat map[string]interface{}
  2086. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2087. fmt.Println(dat)
  2088. } else {
  2089. fmt.Println(err)
  2090. }
  2091. c.ServeSuccessJSON(map[string]interface{}{
  2092. "status": "0",
  2093. "card_info": pCardInfo,
  2094. "busi_card_info": pBusiCardInfo,
  2095. "result": dat,
  2096. "type": "1",
  2097. })
  2098. } else {
  2099. c.ServeSuccessJSON(map[string]interface{}{
  2100. "status": "-1",
  2101. })
  2102. }
  2103. break
  2104. case "3": //电子社保卡
  2105. _, pBusiCardInfo := c.GetELeInfo(fixmedins_code, operator_id, operator)
  2106. //fmt.Println(pCardInfo)
  2107. fmt.Println(pBusiCardInfo)
  2108. pBusiCardInfo = Remove0000(pBusiCardInfo)
  2109. //pCardInfo = Remove0000(pCardInfo)
  2110. var ele ELeData
  2111. err := json.Unmarshal([]byte(pBusiCardInfo), &ele)
  2112. if err != nil {
  2113. utils.ErrorLog("解析失败:%v", err)
  2114. }
  2115. token := ele.Data.EcCardToken
  2116. if len(token) > 0 {
  2117. result, _ := service.Jsyb1101B(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, token, cainfo, ele.Data.IdNo)
  2118. var dat map[string]interface{}
  2119. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2120. fmt.Println(dat)
  2121. } else {
  2122. fmt.Println(err)
  2123. }
  2124. c.ServeSuccessJSON(map[string]interface{}{
  2125. "status": "0",
  2126. //"card_info": pCardInfo,
  2127. "busi_card_info": pBusiCardInfo,
  2128. "token": token,
  2129. "result": dat,
  2130. "type": "2",
  2131. })
  2132. } else {
  2133. c.ServeSuccessJSON(map[string]interface{}{
  2134. "status": "-1",
  2135. })
  2136. }
  2137. break
  2138. case "4": //电子凭证
  2139. fmt.Println(operator_id)
  2140. fmt.Println(operator)
  2141. _, pBusiCardInfo := c.GetELeCertInfoTwo(fixmedins_code, operator_id, operator)
  2142. fmt.Println(pBusiCardInfo)
  2143. pBusiCardInfo = Remove0000(pBusiCardInfo)
  2144. var ele ELeCertData
  2145. err := json.Unmarshal([]byte(pBusiCardInfo), &ele)
  2146. if err != nil {
  2147. utils.ErrorLog("解析失败:%v", err)
  2148. }
  2149. token := ele.Data.EcToken
  2150. fmt.Println(token)
  2151. if len(token) > 0 {
  2152. userName := ele.Data.UserName
  2153. fmt.Println(userName)
  2154. userName = Remove0000(userName)
  2155. userName = DeleteExtraSpace(userName)
  2156. fmt.Println(userName)
  2157. enc := mahonia.NewEncoder("gbk")
  2158. fmt.Println(enc.ConvertString(userName))
  2159. result, _ := service.Jsyb1101ForEleCert(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, token, cainfo, ele.Data.IDNo, userName)
  2160. var dat map[string]interface{}
  2161. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2162. fmt.Println(dat)
  2163. } else {
  2164. fmt.Println(err)
  2165. }
  2166. c.ServeSuccessJSON(map[string]interface{}{
  2167. "status": "0",
  2168. "card_info": "",
  2169. "busi_card_info": pBusiCardInfo,
  2170. "token": token,
  2171. "result": dat,
  2172. })
  2173. } else {
  2174. c.ServeSuccessJSON(map[string]interface{}{
  2175. "status": "-1",
  2176. })
  2177. }
  2178. break
  2179. case "5": //电子凭证
  2180. fmt.Println(operator_id)
  2181. fmt.Println(operator)
  2182. _, pBusiCardInfo := c.GetELeCertInfoByFace(fixmedins_code, operator_id, operator, "01101")
  2183. fmt.Println(pBusiCardInfo)
  2184. pBusiCardInfo = Remove0000(pBusiCardInfo)
  2185. var eletwo ELeCertDatatwo
  2186. json.Unmarshal([]byte(pBusiCardInfo), &eletwo)
  2187. _, pBusiCardInfotwo := GetELeCertInfoByFacetwo(fixmedins_code, operator_id, operator, eletwo.Data.AuthNo, eletwo.Data.OutBizNo, "01301")
  2188. var ele ELeCertDatathree
  2189. err2 := json.Unmarshal([]byte(pBusiCardInfotwo), &ele)
  2190. if err2 != nil {
  2191. utils.ErrorLog("解析失败:%v", err2)
  2192. }
  2193. token := ele.Data.EcToken
  2194. fmt.Println(token)
  2195. if len(token) > 0 {
  2196. userName := ele.Data.UserName
  2197. fmt.Println(userName)
  2198. userName = Remove0000(userName)
  2199. userName = DeleteExtraSpace(userName)
  2200. fmt.Println(userName)
  2201. enc := mahonia.NewEncoder("gbk")
  2202. fmt.Println(enc.ConvertString(userName))
  2203. result, _ := service.Jsyb1101ForEleCert(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, token, cainfo, ele.Data.IDNo, userName)
  2204. var dat map[string]interface{}
  2205. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2206. fmt.Println(dat)
  2207. } else {
  2208. fmt.Println(err)
  2209. }
  2210. c.ServeSuccessJSON(map[string]interface{}{
  2211. "status": "0",
  2212. "card_info": "",
  2213. "busi_card_info": pBusiCardInfotwo,
  2214. "token": token,
  2215. "result": dat,
  2216. "eletwo": pBusiCardInfo,
  2217. })
  2218. } else {
  2219. c.ServeSuccessJSON(map[string]interface{}{
  2220. "status": "-1",
  2221. })
  2222. }
  2223. break
  2224. }
  2225. }
  2226. func (c *JSybController) TestGetBasBaseInit(code string, secret_key string, ak string) {
  2227. DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")
  2228. Iinit := DllDef.MustFindProc("Init")
  2229. //miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
  2230. str := make([]byte, 2048)
  2231. inputData := make(map[string]interface{})
  2232. inputData["IP"] = "10.58.65.240"
  2233. inputData["PORT"] = "8086"
  2234. inputData["TIMEOUT"] = "180"
  2235. inputData["LOG_PATH"] = "C:\\log\\"
  2236. //inputData["EC_URL"] = "http://10.58.33.207:10086/localcfc/api/hsecfc/localQrCodeQuery"
  2237. inputData["EC_URL"] = "http://10.58.33.207:10086/localcfc/api/hsecfc/localQrCodeQuery"
  2238. inputData["CARD_PASSTYPE"] = "1"
  2239. inputData["API_NAME"] = "hssServives"
  2240. inputData["API_VERSION"] = "1.0.0"
  2241. inputData["ACCESS_KEY"] = ak
  2242. inputData["SECRETKEY"] = secret_key
  2243. inputData["ORG_ID"] = code
  2244. inputData["EXT"] = ""
  2245. bytesData, _ := json.Marshal(inputData)
  2246. fmt.Println(inputData)
  2247. fmt.Println(bytesData)
  2248. ret, _, err := Iinit.Call((uintptr)(unsafe.Pointer(&bytesData[0])), (uintptr)(unsafe.Pointer(&str[0])))
  2249. if ret != 0 {
  2250. fmt.Println("SSCard的报错原因:", err)
  2251. fmt.Println("SSCard的运算结果为:", ret)
  2252. fmt.Println("SSCard的返回结果为:", string(str))
  2253. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
  2254. return
  2255. }
  2256. fmt.Println("SSCard的返回结果为:", string(str))
  2257. result := int(ret)
  2258. fmt.Println("SSCard的运算结果为1:", result)
  2259. //initFlag = 1
  2260. return
  2261. }
  2262. func (c *JSybController) GetBasBaseInfo() (string, string) {
  2263. DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")
  2264. readCard := DllDef.MustFindProc("ReadCardBas")
  2265. fmt.Println(readCard)
  2266. fmt.Println("!!!!!")
  2267. pCardInfo := make([]byte, 2048)
  2268. pBusiCardInfo := make([]byte, 8192)
  2269. ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&pCardInfo[0])), (uintptr)(unsafe.Pointer(&pBusiCardInfo[0])))
  2270. fmt.Println(ret2)
  2271. fmt.Println(DeleteExtraSpace(string(pCardInfo)))
  2272. fmt.Println(DeleteExtraSpace(string(pBusiCardInfo)))
  2273. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pCardInfo)), "gbk", "utf-8"))
  2274. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pBusiCardInfo)), "gbk", "utf-8"))
  2275. if ret2 != 0 {
  2276. return "", ""
  2277. }
  2278. return DeleteExtraSpace(string(pCardInfo)), DeleteExtraSpace(string(pBusiCardInfo))
  2279. }
  2280. func (c *JSybController) GetELeInfo(code string, operator_id string, operator_name string) (string, string) {
  2281. DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")
  2282. readCard := DllDef.MustFindProc("EcCardQuery")
  2283. fmt.Println(readCard)
  2284. fmt.Println("!!!!!")
  2285. //pCardInfo := make([]byte, 8192)
  2286. pBusiCardInfo := make([]byte, 8192)
  2287. //data := make(map[string]interface{})
  2288. //pData := make(map[string]interface{})
  2289. //inputData := make(map[string]interface{})
  2290. //inputData["orgId"] = code
  2291. //inputData["businessType"] = "01101"
  2292. //inputData["operatorId"] = operator_id
  2293. //inputData["operatorName"] = operator_name
  2294. //inputData["officeId"] = "001"
  2295. //inputData["officeName"] = "血透室"
  2296. //data["data"] = inputData
  2297. //data["transType"] = "ec.query"
  2298. //data["orgId"] = code
  2299. //bytesData, _ := json.Marshal(data)
  2300. //pCardInfo = bytesData
  2301. ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&pBusiCardInfo[0])))
  2302. fmt.Println(ret2)
  2303. //fmt.Println(DeleteExtraSpace(string(bytesData)))
  2304. fmt.Println(DeleteExtraSpace(string(pBusiCardInfo)))
  2305. //fmt.Println(":", ConvertToString(DeleteExtraSpace(string(bytesData)), "gbk", "utf-8"))
  2306. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pBusiCardInfo)), "gbk", "utf-8"))
  2307. if ret2 != 0 {
  2308. return "", ""
  2309. }
  2310. return DeleteExtraSpace(""), DeleteExtraSpace(string(pBusiCardInfo))
  2311. }
  2312. func (c *JSybController) GetELeCertInfoFour1(code string, operator_id string, operator_name string) (string, string) {
  2313. DllDef := syscall.MustLoadDLL("NationEcCode.dll")
  2314. readCard := DllDef.MustFindProc("EcQuery")
  2315. pCardInfo := make([]byte, 8192)
  2316. pBusiCardInfo := make([]byte, 8192)
  2317. data := make(map[string]interface{})
  2318. inputData := make(map[string]interface{})
  2319. inputData["orgId"] = code
  2320. inputData["businessType"] = "01301"
  2321. inputData["operatorId"] = operator_id
  2322. inputData["operatorName"] = operator_name
  2323. inputData["officeId"] = "001"
  2324. inputData["officeName"] = "xuetou"
  2325. data["data"] = inputData
  2326. data["transType"] = "ec.query"
  2327. data["orgId"] = code
  2328. bytesData, _ := json.Marshal(data)
  2329. pCardInfo = bytesData
  2330. pCardInfo = []byte(ConvertByte2String(pCardInfo, GB18030))
  2331. ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&pCardInfo[0])), (uintptr)(unsafe.Pointer(&pBusiCardInfo[0])))
  2332. fmt.Println(ret2)
  2333. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(bytesData)), "gbk", "utf-8"))
  2334. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pBusiCardInfo)), "gbk", "utf-8"))
  2335. if ret2 != 0 {
  2336. return "", ""
  2337. }
  2338. return ConvertByte2String([]byte(DeleteExtraSpace(string(bytesData))), GB18030), ConvertByte2String([]byte(DeleteExtraSpace(string(pBusiCardInfo))), GB18030)
  2339. }
  2340. func (c *JSybController) GetELeCertInfoFour(code string, operator_id string, operator_name string) (string, string) {
  2341. DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")
  2342. readCard := DllDef.MustFindProc("GetPersonInfo")
  2343. pCardInfo := make([]byte, 8192)
  2344. pBusiCardInfo := make([]byte, 8192)
  2345. data := make(map[string]interface{})
  2346. inputData := make(map[string]interface{})
  2347. inputData["orgId"] = code
  2348. inputData["businessType"] = "01301"
  2349. inputData["operatorId"] = operator_id
  2350. inputData["operatorName"] = operator_name
  2351. inputData["officeId"] = "001"
  2352. inputData["officeName"] = "xuetou"
  2353. data["data"] = inputData
  2354. data["transType"] = "ec.query"
  2355. data["orgId"] = code
  2356. bytesData, _ := json.Marshal(data)
  2357. pCardInfo = bytesData
  2358. pCardInfo = []byte(ConvertByte2String(pCardInfo, GB18030))
  2359. ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&pCardInfo[0])), (uintptr)(unsafe.Pointer(&pBusiCardInfo[0])))
  2360. fmt.Println(ret2)
  2361. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(bytesData)), "gbk", "utf-8"))
  2362. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pBusiCardInfo)), "gbk", "utf-8"))
  2363. if ret2 != 0 {
  2364. return "", ""
  2365. }
  2366. return ConvertByte2String([]byte(DeleteExtraSpace(string(bytesData))), GB18030), ConvertByte2String([]byte(DeleteExtraSpace(string(pBusiCardInfo))), GB18030)
  2367. }
  2368. func (c *JSybController) GetELeCertInfoFour2223(code string, operator_id string, operator_name string) (string, string) {
  2369. DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")
  2370. readCard := DllDef.MustFindProc("GetPersonInfo")
  2371. pCardInfo := make([]byte, 8192)
  2372. pBusiCardInfo := make([]byte, 8192)
  2373. data := make(map[string]interface{})
  2374. inputData := make(map[string]interface{})
  2375. inputData["orgId"] = code
  2376. inputData["businessType"] = "01101"
  2377. inputData["operatorId"] = operator_id
  2378. inputData["operatorName"] = operator_name
  2379. inputData["officeId"] = "001"
  2380. inputData["officeName"] = "xuetou"
  2381. data["data"] = inputData
  2382. data["transType"] = "ec.query"
  2383. data["orgId"] = code
  2384. bytesData, _ := json.Marshal(data)
  2385. pCardInfo = bytesData
  2386. pCardInfo = []byte(ConvertByte2String(pCardInfo, GB18030))
  2387. ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&pCardInfo[0])), (uintptr)(unsafe.Pointer(&pBusiCardInfo[0])))
  2388. fmt.Println(ret2)
  2389. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(bytesData)), "gbk", "utf-8"))
  2390. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pBusiCardInfo)), "gbk", "utf-8"))
  2391. if ret2 != 0 {
  2392. return "", ""
  2393. }
  2394. return ConvertByte2String([]byte(DeleteExtraSpace(string(bytesData))), GB18030), ConvertByte2String([]byte(DeleteExtraSpace(string(pBusiCardInfo))), GB18030)
  2395. }
  2396. func (c *JSybController) GetELeCertInfoByFace(code string, operator_id string, operator_name string, businessType string) (string, string) {
  2397. // WebSocket服务器地址
  2398. serverURL := "ws://127.0.0.1:8899"
  2399. // 解析WebSocket服务器地址
  2400. u, err := url.Parse(serverURL)
  2401. if err != nil {
  2402. log.Fatal(err)
  2403. }
  2404. // 建立WebSocket连接
  2405. conn, _, err := websocket.DefaultDialer.Dial(u.String(), nil)
  2406. if err != nil {
  2407. log.Fatal(err)
  2408. }
  2409. defer conn.Close()
  2410. input2 := make(map[string]interface{})
  2411. input := make(map[string]interface{})
  2412. inputData := make(map[string]interface{})
  2413. inputData["orgId"] = code
  2414. inputData["outBizNo"] = time.Now().Unix()
  2415. inputData["businessType"] = businessType
  2416. inputData["operatorId"] = operator_id
  2417. inputData["operatorName"] = operator_name
  2418. inputData["officeId"] = "001"
  2419. inputData["officeName"] = "血透室"
  2420. inputData["deviceType"] = ""
  2421. input["data"] = inputData
  2422. input["orgId"] = code
  2423. input["transType"] = "cn.nhsa.ec.auth"
  2424. input2["url"] = "http://10.58.33.207:10086/localcfc/api/hsecfc/localQrCodeQuery"
  2425. input2["indata"] = input
  2426. bytesData, _ := json.Marshal(input2)
  2427. err = conn.WriteMessage(websocket.TextMessage, bytesData)
  2428. if err != nil {
  2429. fmt.Println(err)
  2430. }
  2431. // 接收消息
  2432. _, receivedMessage, err := conn.ReadMessage()
  2433. if err != nil {
  2434. fmt.Println(err)
  2435. }
  2436. return "", string(receivedMessage)
  2437. }
  2438. func GetELeCertInfoByFacetwo(code string, operator_id string, operator_name string, authNo string, outBizNo string, businessType string) (string, string) {
  2439. // // WebSocket服务器地址
  2440. serverURL := "ws://127.0.0.1:8899"
  2441. // 解析WebSocket服务器地址
  2442. u, err := url.Parse(serverURL)
  2443. if err != nil {
  2444. log.Fatal(err)
  2445. }
  2446. // 建立WebSocket连接
  2447. conn, _, err := websocket.DefaultDialer.Dial(u.String(), nil)
  2448. if err != nil {
  2449. log.Fatal(err)
  2450. }
  2451. defer conn.Close()
  2452. input2 := make(map[string]interface{})
  2453. input := make(map[string]interface{})
  2454. inputData := make(map[string]interface{})
  2455. inputData["orgId"] = code
  2456. inputData["outBizNo"] = outBizNo
  2457. inputData["authNo"] = authNo
  2458. inputData["businessType"] = businessType
  2459. inputData["operatorId"] = operator_id
  2460. inputData["operatorName"] = operator_name
  2461. inputData["officeId"] = "001"
  2462. inputData["officeName"] = "血透室"
  2463. inputData["deviceType"] = ""
  2464. input["data"] = inputData
  2465. input["orgId"] = code
  2466. input["transType"] = "cn.nhsa.auth.check"
  2467. input2["url"] = "http://10.58.33.207:10086/localcfc/api/hsecfc/localQrCodeQuery"
  2468. input2["indata"] = input
  2469. bytesData, _ := json.Marshal(input2)
  2470. err = conn.WriteMessage(websocket.TextMessage, bytesData)
  2471. if err != nil {
  2472. fmt.Println(err)
  2473. }
  2474. // 接收消息
  2475. _, receivedMessage, err := conn.ReadMessage()
  2476. if err != nil {
  2477. fmt.Println(err)
  2478. }
  2479. return "", string(receivedMessage)
  2480. }
  2481. func (c *JSybController) GetELeCertInfoTwo(code string, operator_id string, operator_name string) (string, string) {
  2482. // WebSocket服务器地址
  2483. serverURL := "ws://127.0.0.1:8899"
  2484. // 解析WebSocket服务器地址
  2485. u, err := url.Parse(serverURL)
  2486. if err != nil {
  2487. log.Fatal(err)
  2488. }
  2489. // 建立WebSocket连接
  2490. conn, _, err := websocket.DefaultDialer.Dial(u.String(), nil)
  2491. if err != nil {
  2492. log.Fatal(err)
  2493. }
  2494. defer conn.Close()
  2495. input2 := make(map[string]interface{})
  2496. input := make(map[string]interface{})
  2497. inputData := make(map[string]interface{})
  2498. inputData["orgId"] = code
  2499. inputData["businessType"] = "01101"
  2500. inputData["operatorId"] = operator_id
  2501. inputData["operatorName"] = operator_name
  2502. inputData["officeId"] = "001"
  2503. inputData["officeName"] = "血透室"
  2504. inputData["deviceType"] = ""
  2505. input["data"] = inputData
  2506. input["orgId"] = code
  2507. input["transType"] = "ec.query"
  2508. input2["url"] = "http://10.58.33.207:10086/localcfc/api/hsecfc/localQrCodeQuery"
  2509. input2["indata"] = input
  2510. bytesData, _ := json.Marshal(input2)
  2511. err = conn.WriteMessage(websocket.TextMessage, bytesData)
  2512. if err != nil {
  2513. fmt.Println(err)
  2514. }
  2515. // 接收消息
  2516. _, receivedMessage, err := conn.ReadMessage()
  2517. if err != nil {
  2518. fmt.Println(err)
  2519. }
  2520. return "", string(receivedMessage)
  2521. }
  2522. func (c *JSybController) GetELeCertInfoThree(code string, operator_id string, operator_name string) (string, string) {
  2523. // WebSocket服务器地址
  2524. serverURL := "ws://127.0.0.1:8899"
  2525. // 解析WebSocket服务器地址
  2526. u, err := url.Parse(serverURL)
  2527. if err != nil {
  2528. log.Fatal(err)
  2529. }
  2530. // 建立WebSocket连接
  2531. conn, _, err := websocket.DefaultDialer.Dial(u.String(), nil)
  2532. if err != nil {
  2533. log.Fatal(err)
  2534. }
  2535. defer conn.Close()
  2536. input2 := make(map[string]interface{})
  2537. input := make(map[string]interface{})
  2538. inputData := make(map[string]interface{})
  2539. inputData["orgId"] = code
  2540. inputData["businessType"] = "01301"
  2541. inputData["operatorId"] = operator_id
  2542. inputData["operatorName"] = operator_name
  2543. inputData["officeId"] = "001"
  2544. inputData["officeName"] = "血透室"
  2545. inputData["deviceType"] = ""
  2546. input["data"] = inputData
  2547. input["orgId"] = code
  2548. input["transType"] = "ec.query"
  2549. input2["url"] = "http://10.58.33.207:10086/localcfc/api/hsecfc/localQrCodeQuery"
  2550. input2["indata"] = input
  2551. bytesData, _ := json.Marshal(input2)
  2552. err = conn.WriteMessage(websocket.TextMessage, bytesData)
  2553. if err != nil {
  2554. fmt.Println(err)
  2555. }
  2556. // 接收消息
  2557. _, receivedMessage, err := conn.ReadMessage()
  2558. if err != nil {
  2559. fmt.Println(err)
  2560. }
  2561. return "", string(receivedMessage)
  2562. }
  2563. func GetELeCertInfoSettle(code string, operator_id string, operator_name string) (string, string) {
  2564. DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")
  2565. readCard := DllDef.MustFindProc("GetPersonInfo")
  2566. pCardInfo := make([]byte, 8192)
  2567. pBusiCardInfo := make([]byte, 8192)
  2568. data := make(map[string]interface{})
  2569. inputData := make(map[string]interface{})
  2570. inputData["orgId"] = code
  2571. inputData["businessType"] = "01301"
  2572. inputData["operatorId"] = "1"
  2573. inputData["operatorName"] = "admin"
  2574. inputData["officeId"] = "001"
  2575. inputData["officeName"] = "admin"
  2576. data["data"] = inputData
  2577. data["transType"] = "ec.query"
  2578. data["orgId"] = code
  2579. bytesData, _ := json.Marshal(data)
  2580. pCardInfo = bytesData
  2581. pCardInfo = []byte(ConvertByte2String(pCardInfo, GB18030))
  2582. ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&pCardInfo[0])), (uintptr)(unsafe.Pointer(&pBusiCardInfo[0])))
  2583. fmt.Println(ret2)
  2584. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(bytesData)), "gbk", "utf-8"))
  2585. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pBusiCardInfo)), "gbk", "utf-8"))
  2586. if ret2 != 0 {
  2587. return "", ""
  2588. }
  2589. return ConvertByte2String([]byte(DeleteExtraSpace(string(bytesData))), GB18030), ConvertByte2String([]byte(DeleteExtraSpace(string(pBusiCardInfo))), GB18030)
  2590. }
  2591. func IntPtr(n int) uintptr {
  2592. return uintptr(n)
  2593. }
  2594. func StrPtr(s string) uintptr {
  2595. return uintptr(unsafe.Pointer(syscall.StringBytePtr(s)))
  2596. }
  2597. type Charset string
  2598. const (
  2599. UTF8 = Charset("UTF-8")
  2600. GB18030 = Charset("GB18030")
  2601. )
  2602. func ConvertToString(src string, srcCode string, tagCode string) string {
  2603. srcCoder := mahonia.NewDecoder(srcCode)
  2604. srcResult := srcCoder.ConvertString(src)
  2605. tagCoder := mahonia.NewDecoder(tagCode)
  2606. _, cdata, _ := tagCoder.Translate([]byte(srcResult), true)
  2607. result := string(cdata)
  2608. return result
  2609. }
  2610. func DeleteExtraSpace(s string) string {
  2611. //删除字符串中的多余空格,有多个空格时,仅保留一个空格
  2612. s1 := strings.Replace(s, " ", " ", -1) //替换tab为空格
  2613. regstr := "\\s{2,}" //两个及两个以上空格的正则表达式
  2614. reg, _ := regexp.Compile(regstr) //编译正则表达式
  2615. s2 := make([]byte, len(s1)) //定义字符数组切片
  2616. copy(s2, s1) //将字符串复制到切片
  2617. spc_index := reg.FindStringIndex(string(s2)) //在字符串中搜索
  2618. for len(spc_index) > 0 { //找到适配项
  2619. s2 = append(s2[:spc_index[0]+1], s2[spc_index[1]:]...) //删除多余空格
  2620. spc_index = reg.FindStringIndex(string(s2)) //继续在字符串中搜索
  2621. }
  2622. return string(s2)
  2623. }
  2624. func Remove0000(s string) string {
  2625. str := make([]rune, 0, len(s))
  2626. for _, v := range []rune(s) {
  2627. if v == 0 {
  2628. continue
  2629. }
  2630. str = append(str, v)
  2631. }
  2632. return string(str)
  2633. }
  2634. func saveJsLog(result string, request string, infno string, desc string, org_name string) {
  2635. //org_id, _ := beego.AppConfig.Int64("org_id")
  2636. //miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
  2637. dir := org_name + "日志"
  2638. utils.Mkdir(dir)
  2639. month := time.Unix(1557042972, 0).Format("1")
  2640. year := time.Now().Format("2006")
  2641. month = time.Now().Format("01")
  2642. day := time.Now().Format("02")
  2643. hour := time.Now().Format("15")
  2644. min := time.Now().Format("04")
  2645. sec := time.Now().Format("05")
  2646. result_time := year + "-" + month + "-" + day + " " + hour + ":" + min + ":" + sec
  2647. file := org_name + "_" + year + month + day + "_log"
  2648. file_name := file + ".txt"
  2649. file_path := org_name + "日志" + "/" + file_name
  2650. exist, _ := utils.PathExists(file_path)
  2651. if exist { //存在
  2652. fmt.Println("存在")
  2653. f, err := os.OpenFile(file_path, os.O_WRONLY, 0644)
  2654. if err != nil {
  2655. fmt.Println("read fail")
  2656. }
  2657. content := "\r\n" + "\r\n" + "\r\n" + result_time + " " + "【 " + desc + infno + "入参" + " 】:" + "\r\n" + request + "\r\n" + result_time + " " + "【 " + desc + infno + "出参" + " 】:" + "\r\n" + result
  2658. n, _ := f.Seek(0, 2)
  2659. _, err = f.WriteAt([]byte(content), n)
  2660. } else { //不存在
  2661. fmt.Println("文件不存在,创建文件")
  2662. f, err := os.Create(org_name + "日志" + "/" + file_name)
  2663. defer f.Close()
  2664. if err != nil {
  2665. } else {
  2666. _, err = f.Write([]byte("记录日志"))
  2667. }
  2668. }
  2669. }
  2670. func (c *JSybController) Get3101() {
  2671. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  2672. var respJSON map[string]interface{}
  2673. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  2674. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  2675. return
  2676. }
  2677. pdUserJSONBytes, _ := json.Marshal(respJSON["pd"])
  2678. var pd models.PatientDtos
  2679. if err := json.Unmarshal(pdUserJSONBytes, &pd); err != nil {
  2680. utils.ErrorLog("解析失败:%v", err)
  2681. return
  2682. }
  2683. fedUserJSONBytes, _ := json.Marshal(respJSON["fed"])
  2684. var fed models.FsiEncounterDtos
  2685. if err := json.Unmarshal(fedUserJSONBytes, &fed); err != nil {
  2686. utils.ErrorLog("解析失败:%v", err)
  2687. return
  2688. }
  2689. fddUserJSONBytes, _ := json.Marshal(respJSON["fdd"])
  2690. var fdd []*models.FsiDiagnoseDtos
  2691. if err := json.Unmarshal(fddUserJSONBytes, &fdd); err != nil {
  2692. utils.ErrorLog("解析失败:%v", err)
  2693. return
  2694. }
  2695. fodUserJSONBytes, _ := json.Marshal(respJSON["fod"])
  2696. var fod []*models.FsiOrderDtos
  2697. if err := json.Unmarshal(fodUserJSONBytes, &fod); err != nil {
  2698. utils.ErrorLog("解析失败:%v", err)
  2699. return
  2700. }
  2701. fopdUserJSONBytes, _ := json.Marshal(respJSON["fopd"])
  2702. var fopd []*models.FsiOperationDtosData
  2703. if err := json.Unmarshal(fopdUserJSONBytes, &fopd); err != nil {
  2704. utils.ErrorLog("解析失败:%v", err)
  2705. return
  2706. }
  2707. ppUserJSONBytes, _ := json.Marshal(respJSON["pp"])
  2708. var pp models.PublicParams
  2709. if err := json.Unmarshal(ppUserJSONBytes, &pp); err != nil {
  2710. utils.ErrorLog("解析失败:%v", err)
  2711. return
  2712. }
  2713. request, result := service.Jsyb3101(pd, fed, fdd, fod, fopd, pp, respJSON["trig_scen"].(string))
  2714. var dat map[string]interface{}
  2715. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2716. fmt.Println(dat)
  2717. } else {
  2718. fmt.Println(err)
  2719. }
  2720. var dat2 map[string]interface{}
  2721. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  2722. fmt.Println(dat2)
  2723. } else {
  2724. fmt.Println(err)
  2725. }
  2726. saveJsLog(result, request, "3101", "事前", pp.FixmedinsName)
  2727. c.ServeSuccessJSON(map[string]interface{}{
  2728. "pre": dat,
  2729. "request_log": dat2,
  2730. })
  2731. }
  2732. func (c *JSybController) Get3102() {
  2733. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  2734. var respJSON map[string]interface{}
  2735. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  2736. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  2737. return
  2738. }
  2739. pdUserJSONBytes, _ := json.Marshal(respJSON["pd"])
  2740. var pd models.PatientDtos
  2741. if err := json.Unmarshal(pdUserJSONBytes, &pd); err != nil {
  2742. utils.ErrorLog("解析失败:%v", err)
  2743. return
  2744. }
  2745. fedUserJSONBytes, _ := json.Marshal(respJSON["fed"])
  2746. var fed models.FsiEncounterDtos
  2747. if err := json.Unmarshal(fedUserJSONBytes, &fed); err != nil {
  2748. utils.ErrorLog("解析失败:%v", err)
  2749. return
  2750. }
  2751. fddUserJSONBytes, _ := json.Marshal(respJSON["fdd"])
  2752. var fdd []*models.FsiDiagnoseDtos
  2753. if err := json.Unmarshal(fddUserJSONBytes, &fdd); err != nil {
  2754. utils.ErrorLog("解析失败:%v", err)
  2755. return
  2756. }
  2757. fodUserJSONBytes, _ := json.Marshal(respJSON["fod"])
  2758. var fod []*models.FsiOrderDtos
  2759. if err := json.Unmarshal(fodUserJSONBytes, &fod); err != nil {
  2760. utils.ErrorLog("解析失败:%v", err)
  2761. return
  2762. }
  2763. fopdUserJSONBytes, _ := json.Marshal(respJSON["fopd"])
  2764. var fopd []*models.FsiOperationDtosData
  2765. if err := json.Unmarshal(fopdUserJSONBytes, &fopd); err != nil {
  2766. utils.ErrorLog("解析失败:%v", err)
  2767. return
  2768. }
  2769. ppUserJSONBytes, _ := json.Marshal(respJSON["pp"])
  2770. var pp models.PublicParams
  2771. if err := json.Unmarshal(ppUserJSONBytes, &pp); err != nil {
  2772. utils.ErrorLog("解析失败:%v", err)
  2773. return
  2774. }
  2775. request, result := service.Jsyb3102(pd, fed, fdd, fod, fopd, pp, respJSON["trig_scen"].(string))
  2776. var dat map[string]interface{}
  2777. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2778. fmt.Println(dat)
  2779. } else {
  2780. fmt.Println(err)
  2781. }
  2782. var dat2 map[string]interface{}
  2783. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  2784. fmt.Println(dat2)
  2785. } else {
  2786. fmt.Println(err)
  2787. }
  2788. saveJsLog(result, request, "3102", "事后", pp.FixmedinsName)
  2789. c.ServeSuccessJSON(map[string]interface{}{
  2790. "pre": dat,
  2791. "request_log": dat2,
  2792. })
  2793. }
  2794. func (c *JSybController) Get4101() {
  2795. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  2796. var respJSON map[string]interface{}
  2797. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  2798. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  2799. return
  2800. }
  2801. struct4101UserJSONBytes, _ := json.Marshal(respJSON["struct4101"])
  2802. var struct4101 service.Struct4101
  2803. if err := json.Unmarshal(struct4101UserJSONBytes, &struct4101); err != nil {
  2804. utils.ErrorLog("解析失败:%v", err)
  2805. return
  2806. }
  2807. ppUserJSONBytes, _ := json.Marshal(respJSON["pp"])
  2808. var pp models.PublicParams
  2809. if err := json.Unmarshal(ppUserJSONBytes, &pp); err != nil {
  2810. utils.ErrorLog("解析失败:%v", err)
  2811. return
  2812. }
  2813. request, result := service.Jsyb4101(struct4101, pp)
  2814. var dat map[string]interface{}
  2815. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2816. fmt.Println(dat)
  2817. } else {
  2818. fmt.Println(err)
  2819. }
  2820. var dat2 map[string]interface{}
  2821. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  2822. fmt.Println(dat2)
  2823. } else {
  2824. fmt.Println(err)
  2825. }
  2826. saveJsLog(result, request, "4101", "上传明细清单", pp.FixmedinsName)
  2827. c.ServeSuccessJSON(map[string]interface{}{
  2828. "pre": dat,
  2829. "request_log": dat2,
  2830. })
  2831. }
  2832. func ConvertByte2String(byte []byte, charset Charset) string {
  2833. var str string
  2834. switch charset {
  2835. case GB18030:
  2836. decodeBytes, _ := simplifiedchinese.GB18030.NewDecoder().Bytes(byte)
  2837. str = string(decodeBytes)
  2838. case UTF8:
  2839. fallthrough
  2840. default:
  2841. str = string(byte)
  2842. }
  2843. return str
  2844. }