jsyb_controller.go 108KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336
  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. if mdtrtarea_admvs == "320830"{
  1945. pCardInfo, pBusiCardInfo := c.GetBasBaseInfo()
  1946. pBusiCardInfo = Remove0000(pBusiCardInfo)
  1947. pCardInfo = Remove0000(pCardInfo)
  1948. fmt.Println(":", ConvertToString(pCardInfo, "gbk", "utf-8"))
  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. }else{
  1976. pCardInfo, pBusiCardInfo := c.GetBasBaseInfo()
  1977. pBusiCardInfo = Remove0000(pBusiCardInfo)
  1978. pCardInfo = Remove0000(pCardInfo)
  1979. fmt.Println(":", ConvertToString(pCardInfo, "gbk", "utf-8"))
  1980. fmt.Println(pBusiCardInfo)
  1981. fmt.Println(pCardInfo)
  1982. bas := strings.Split(pCardInfo, "|")
  1983. basNumber := bas[2]
  1984. id_card_no := bas[1]
  1985. card_sn := bas[3]
  1986. id_card_type_int, _ := strconv.ParseInt(id_card_type, 10, 64)
  1987. if len(pCardInfo) > 0 && len(pBusiCardInfo) > 0 {
  1988. 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)
  1989. var dat map[string]interface{}
  1990. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  1991. fmt.Println(dat)
  1992. } else {
  1993. fmt.Println(err)
  1994. }
  1995. c.ServeSuccessJSON(map[string]interface{}{
  1996. "status": "0",
  1997. "card_info": pCardInfo,
  1998. "busi_card_info": pBusiCardInfo,
  1999. "result": dat,
  2000. "type": "1",
  2001. })
  2002. } else {
  2003. c.ServeSuccessJSON(map[string]interface{}{
  2004. "status": "-1",
  2005. })
  2006. }
  2007. }
  2008. break
  2009. case "3": //电子社保卡
  2010. _, pBusiCardInfo := c.GetELeInfo(fixmedins_code, operator_id, operator)
  2011. //fmt.Println(pCardInfo)
  2012. fmt.Println(pBusiCardInfo)
  2013. pBusiCardInfo = Remove0000(pBusiCardInfo)
  2014. //pCardInfo = Remove0000(pCardInfo)
  2015. var ele ELeData
  2016. err := json.Unmarshal([]byte(pBusiCardInfo), &ele)
  2017. if err != nil {
  2018. utils.ErrorLog("解析失败:%v", err)
  2019. }
  2020. token := ele.Data.EcCardToken
  2021. if len(token) > 0 {
  2022. result, _ := service.Jsyb1101B(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, token, cainfo, ele.Data.IdNo)
  2023. var dat map[string]interface{}
  2024. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2025. fmt.Println(dat)
  2026. } else {
  2027. fmt.Println(err)
  2028. }
  2029. c.ServeSuccessJSON(map[string]interface{}{
  2030. "status": "0",
  2031. //"card_info": pCardInfo,
  2032. "busi_card_info": pBusiCardInfo,
  2033. "token": token,
  2034. "result": dat,
  2035. "type": "2",
  2036. })
  2037. } else {
  2038. c.ServeSuccessJSON(map[string]interface{}{
  2039. "status": "-1",
  2040. })
  2041. }
  2042. break
  2043. case "4": //电子凭证
  2044. fmt.Println(operator_id)
  2045. fmt.Println(operator)
  2046. _, pBusiCardInfo := c.GetELeCertInfoFour(fixmedins_code, operator_id, operator)
  2047. fmt.Println(pBusiCardInfo)
  2048. pBusiCardInfo = Remove0000(pBusiCardInfo)
  2049. var ele ELeCertData
  2050. err := json.Unmarshal([]byte(pBusiCardInfo), &ele)
  2051. if err != nil {
  2052. utils.ErrorLog("解析失败:%v", err)
  2053. }
  2054. token := ele.Data.EcToken
  2055. fmt.Println(token)
  2056. if len(token) > 0 {
  2057. userName := ele.Data.UserName
  2058. fmt.Println(userName)
  2059. userName = Remove0000(userName)
  2060. userName = DeleteExtraSpace(userName)
  2061. fmt.Println(userName)
  2062. enc := mahonia.NewEncoder("gbk")
  2063. fmt.Println(enc.ConvertString(userName))
  2064. result, _ := service.Jsyb1101ForEleCert(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, token, cainfo, ele.Data.IDNo, userName)
  2065. var dat map[string]interface{}
  2066. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2067. fmt.Println(dat)
  2068. } else {
  2069. fmt.Println(err)
  2070. }
  2071. c.ServeSuccessJSON(map[string]interface{}{
  2072. "status": "0",
  2073. "card_info": "",
  2074. "busi_card_info": pBusiCardInfo,
  2075. "token": token,
  2076. "result": dat,
  2077. })
  2078. } else {
  2079. c.ServeSuccessJSON(map[string]interface{}{
  2080. "status": "-1",
  2081. })
  2082. }
  2083. break
  2084. }
  2085. }
  2086. func (c *JSybController) ReadCard() {
  2087. fixmedins_code := c.GetString("fixmedins_code")
  2088. secret_key := c.GetString("secret_key")
  2089. ak := c.GetString("ak")
  2090. org_name := c.GetString("org_name")
  2091. doctor := c.GetString("doctor")
  2092. insuplc_admdvs := c.GetString("insuplc_admdvs")
  2093. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  2094. url := c.GetString("url")
  2095. cainfo := c.GetString("cainfo")
  2096. id_card_type := c.GetString("id_card_type")
  2097. operator_id := c.GetString("operator_id")
  2098. operator := c.GetString("operator")
  2099. //result, request := service.Jsyb9001(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, 1, url, cainfo, ak)
  2100. //fmt.Println(request)
  2101. //fmt.Println(result)
  2102. c.TestGetBasBaseInit(fixmedins_code, secret_key, ak)
  2103. switch id_card_type {
  2104. case "1":
  2105. if mdtrtarea_admvs == "320830"{
  2106. pCardInfo, pBusiCardInfo := c.GetBasBaseInfo()
  2107. pBusiCardInfo = Remove0000(pBusiCardInfo)
  2108. pCardInfo = Remove0000(pCardInfo)
  2109. fmt.Println(":", ConvertToString(pCardInfo, "gbk", "utf-8"))
  2110. fmt.Println(pBusiCardInfo)
  2111. fmt.Println(pCardInfo)
  2112. bas := strings.Split(pCardInfo, "|")
  2113. basNumber := bas[2]
  2114. id_card_no := bas[1]
  2115. card_sn := bas[3]
  2116. id_card_type_int, _ := strconv.ParseInt(id_card_type, 10, 64)
  2117. if len(pCardInfo) > 0 && len(pBusiCardInfo) > 0 {
  2118. 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)
  2119. var dat map[string]interface{}
  2120. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2121. fmt.Println(dat)
  2122. } else {
  2123. fmt.Println(err)
  2124. }
  2125. c.ServeSuccessJSON(map[string]interface{}{
  2126. "status": "0",
  2127. "card_info": pCardInfo,
  2128. "busi_card_info": pBusiCardInfo,
  2129. "result": dat,
  2130. "type": "1",
  2131. })
  2132. } else {
  2133. c.ServeSuccessJSON(map[string]interface{}{
  2134. "status": "-1",
  2135. })
  2136. }
  2137. }else{
  2138. pCardInfo, pBusiCardInfo := c.GetBasBaseInfo()
  2139. pBusiCardInfo = Remove0000(pBusiCardInfo)
  2140. pCardInfo = Remove0000(pCardInfo)
  2141. fmt.Println(":", ConvertToString(pCardInfo, "gbk", "utf-8"))
  2142. fmt.Println(pBusiCardInfo)
  2143. fmt.Println(pCardInfo)
  2144. bas := strings.Split(pCardInfo, "|")
  2145. basNumber := bas[2]
  2146. id_card_no := bas[1]
  2147. card_sn := bas[3]
  2148. id_card_type_int, _ := strconv.ParseInt(id_card_type, 10, 64)
  2149. if len(pCardInfo) > 0 && len(pBusiCardInfo) > 0 {
  2150. 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)
  2151. var dat map[string]interface{}
  2152. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2153. fmt.Println(dat)
  2154. } else {
  2155. fmt.Println(err)
  2156. }
  2157. c.ServeSuccessJSON(map[string]interface{}{
  2158. "status": "0",
  2159. "card_info": pCardInfo,
  2160. "busi_card_info": pBusiCardInfo,
  2161. "result": dat,
  2162. "type": "1",
  2163. })
  2164. } else {
  2165. c.ServeSuccessJSON(map[string]interface{}{
  2166. "status": "-1",
  2167. })
  2168. }
  2169. }
  2170. break
  2171. case "3": //电子社保卡
  2172. _, pBusiCardInfo := c.GetELeInfo(fixmedins_code, operator_id, operator)
  2173. //fmt.Println(pCardInfo)
  2174. fmt.Println(pBusiCardInfo)
  2175. pBusiCardInfo = Remove0000(pBusiCardInfo)
  2176. //pCardInfo = Remove0000(pCardInfo)
  2177. var ele ELeData
  2178. err := json.Unmarshal([]byte(pBusiCardInfo), &ele)
  2179. if err != nil {
  2180. utils.ErrorLog("解析失败:%v", err)
  2181. }
  2182. token := ele.Data.EcCardToken
  2183. if len(token) > 0 {
  2184. result, _ := service.Jsyb1101B(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, token, cainfo, ele.Data.IdNo)
  2185. var dat map[string]interface{}
  2186. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2187. fmt.Println(dat)
  2188. } else {
  2189. fmt.Println(err)
  2190. }
  2191. c.ServeSuccessJSON(map[string]interface{}{
  2192. "status": "0",
  2193. //"card_info": pCardInfo,
  2194. "busi_card_info": pBusiCardInfo,
  2195. "token": token,
  2196. "result": dat,
  2197. "type": "2",
  2198. })
  2199. } else {
  2200. c.ServeSuccessJSON(map[string]interface{}{
  2201. "status": "-1",
  2202. })
  2203. }
  2204. break
  2205. case "4": //电子凭证
  2206. fmt.Println(operator_id)
  2207. fmt.Println(operator)
  2208. _, pBusiCardInfo := c.GetELeCertInfoTwo(fixmedins_code, operator_id, operator)
  2209. fmt.Println(pBusiCardInfo)
  2210. pBusiCardInfo = Remove0000(pBusiCardInfo)
  2211. var ele ELeCertData
  2212. err := json.Unmarshal([]byte(pBusiCardInfo), &ele)
  2213. if err != nil {
  2214. utils.ErrorLog("解析失败:%v", err)
  2215. }
  2216. token := ele.Data.EcToken
  2217. fmt.Println(token)
  2218. if len(token) > 0 {
  2219. userName := ele.Data.UserName
  2220. fmt.Println(userName)
  2221. userName = Remove0000(userName)
  2222. userName = DeleteExtraSpace(userName)
  2223. fmt.Println(userName)
  2224. enc := mahonia.NewEncoder("gbk")
  2225. fmt.Println(enc.ConvertString(userName))
  2226. result, _ := service.Jsyb1101ForEleCert(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, token, cainfo, ele.Data.IDNo, userName)
  2227. var dat map[string]interface{}
  2228. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2229. fmt.Println(dat)
  2230. } else {
  2231. fmt.Println(err)
  2232. }
  2233. c.ServeSuccessJSON(map[string]interface{}{
  2234. "status": "0",
  2235. "card_info": "",
  2236. "busi_card_info": pBusiCardInfo,
  2237. "token": token,
  2238. "result": dat,
  2239. })
  2240. } else {
  2241. c.ServeSuccessJSON(map[string]interface{}{
  2242. "status": "-1",
  2243. })
  2244. }
  2245. break
  2246. case "5": //电子凭证
  2247. fmt.Println(operator_id)
  2248. fmt.Println(operator)
  2249. _, pBusiCardInfo := c.GetELeCertInfoByFace(fixmedins_code, operator_id, operator, "01101")
  2250. fmt.Println(pBusiCardInfo)
  2251. pBusiCardInfo = Remove0000(pBusiCardInfo)
  2252. var eletwo ELeCertDatatwo
  2253. json.Unmarshal([]byte(pBusiCardInfo), &eletwo)
  2254. _, pBusiCardInfotwo := GetELeCertInfoByFacetwo(fixmedins_code, operator_id, operator, eletwo.Data.AuthNo, eletwo.Data.OutBizNo, "01301")
  2255. var ele ELeCertDatathree
  2256. err2 := json.Unmarshal([]byte(pBusiCardInfotwo), &ele)
  2257. if err2 != nil {
  2258. utils.ErrorLog("解析失败:%v", err2)
  2259. }
  2260. token := ele.Data.EcToken
  2261. fmt.Println(token)
  2262. if len(token) > 0 {
  2263. userName := ele.Data.UserName
  2264. fmt.Println(userName)
  2265. userName = Remove0000(userName)
  2266. userName = DeleteExtraSpace(userName)
  2267. fmt.Println(userName)
  2268. enc := mahonia.NewEncoder("gbk")
  2269. fmt.Println(enc.ConvertString(userName))
  2270. result, _ := service.Jsyb1101ForEleCert(org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, url, ak, token, cainfo, ele.Data.IDNo, userName)
  2271. var dat map[string]interface{}
  2272. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2273. fmt.Println(dat)
  2274. } else {
  2275. fmt.Println(err)
  2276. }
  2277. c.ServeSuccessJSON(map[string]interface{}{
  2278. "status": "0",
  2279. "card_info": "",
  2280. "busi_card_info": pBusiCardInfotwo,
  2281. "token": token,
  2282. "result": dat,
  2283. "eletwo": pBusiCardInfo,
  2284. })
  2285. } else {
  2286. c.ServeSuccessJSON(map[string]interface{}{
  2287. "status": "-1",
  2288. })
  2289. }
  2290. break
  2291. }
  2292. }
  2293. func (c *JSybController) TestGetBasBaseInit(code string, secret_key string, ak string) {
  2294. DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")
  2295. Iinit := DllDef.MustFindProc("Init")
  2296. //miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
  2297. str := make([]byte, 2048)
  2298. inputData := make(map[string]interface{})
  2299. if code == "H32083002114"{
  2300. inputData["IP"] = "10.58.73.212"
  2301. inputData["EC_URL"] = "http://10.58.33.207:10086/localcfc/api/hsecfc/localQrCodeQuery"
  2302. }else{
  2303. inputData["IP"] = "10.58.65.240"
  2304. inputData["EC_URL"] = "http://10.58.33.207:10086/localcfc/api/hsecfc/localQrCodeQuery"
  2305. }
  2306. inputData["PORT"] = "8086"
  2307. inputData["TIMEOUT"] = "180"
  2308. inputData["LOG_PATH"] = "C:\\log\\"
  2309. //inputData["EC_URL"] = "http://10.58.33.207:10086/localcfc/api/hsecfc/localQrCodeQuery"
  2310. inputData["CARD_PASSTYPE"] = "1"
  2311. inputData["API_NAME"] = "hssServives"
  2312. inputData["API_VERSION"] = "1.0.0"
  2313. inputData["ACCESS_KEY"] = ak
  2314. inputData["SECRETKEY"] = secret_key
  2315. inputData["ORG_ID"] = code
  2316. inputData["EXT"] = ""
  2317. bytesData, _ := json.Marshal(inputData)
  2318. fmt.Println(inputData)
  2319. fmt.Println(bytesData)
  2320. ret, _, err := Iinit.Call((uintptr)(unsafe.Pointer(&bytesData[0])), (uintptr)(unsafe.Pointer(&str[0])))
  2321. if ret != 0 {
  2322. fmt.Println("SSCard的报错原因:", err)
  2323. fmt.Println("SSCard的运算结果为:", ret)
  2324. fmt.Println("SSCard的返回结果为:", string(str))
  2325. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
  2326. return
  2327. }
  2328. fmt.Println("SSCard的返回结果为:", string(str))
  2329. result := int(ret)
  2330. fmt.Println("SSCard的运算结果为1:", result)
  2331. //initFlag = 1
  2332. return
  2333. }
  2334. func (c *JSybController) GetjsBasBaseInfo() string {
  2335. DllDef := syscall.MustLoadDLL("SSCardDriver.dll")
  2336. readCard := DllDef.MustFindProc("iReadCardBas")
  2337. if readCard == nil {
  2338. fmt.Println("readcard is nil")
  2339. readCard = DllDef.MustFindProc("iReadCardBas")
  2340. }
  2341. //str := make([]byte, 1024)
  2342. str1 := make([]byte, 1024)
  2343. ret2, _, _ := readCard.Call(uintptr(3), (uintptr)(unsafe.Pointer(&str1[0])))
  2344. //file, err := os.Open("C:\\Users\\Administrator\\Desktop\\11\\Power-Card\\SSCardDriver\\api.log")
  2345. //if err != nil {
  2346. // fmt.Println("Error opening file:", err)
  2347. //}
  2348. //defer file.Close()
  2349. //
  2350. //var lastProgram Program
  2351. //scanner := bufio.NewScanner(file)
  2352. //inProgram := false
  2353. //
  2354. //for scanner.Scan() {
  2355. // line := scanner.Text()
  2356. // if strings.Contains(line, "<program>") {
  2357. // inProgram = true
  2358. // programXML := "<program>"
  2359. // for scanner.Scan() {
  2360. // line = scanner.Text()
  2361. // programXML += line
  2362. // if strings.Contains(line, "</program>") {
  2363. // programXML += "</program>"
  2364. // break
  2365. // }
  2366. // }
  2367. // if err := xml.Unmarshal([]byte(programXML), &lastProgram); err == nil {
  2368. // // 解析成功,更新最后的 Program
  2369. // }
  2370. // inProgram = false
  2371. // }
  2372. //}
  2373. //
  2374. // fmt.Println("Error reading file:", inProgram)
  2375. //
  2376. //if err := scanner.Err(); err != nil {
  2377. // fmt.Println("Error reading file:", err)
  2378. //}
  2379. // 输出最后一次的 Program
  2380. //fmt.Printf("最后一次的 <program>:\n")
  2381. //fmt.Printf("<program>\n")
  2382. //fmt.Printf(" <function_id>%s</function_id>\n", lastProgram.FunctionID)
  2383. //fmt.Printf(" <cardinfo>%s</cardinfo>\n", lastProgram.CardInfo)
  2384. //fmt.Printf(" <user>%s</user>\n", lastProgram.User)
  2385. //fmt.Printf("</program>\n")
  2386. fmt.Println(string(str1))
  2387. fmt.Println(":", ConvertToString(string(str1), "gbk", "utf-8"))
  2388. if ret2 != 0 {
  2389. return ""
  2390. }
  2391. return string(str1)
  2392. }
  2393. func (c *JSybController) GetBasBaseInfo() (string, string) {
  2394. DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")
  2395. readCard := DllDef.MustFindProc("ReadCardBas")
  2396. fmt.Println(readCard)
  2397. fmt.Println("!!!!!")
  2398. pCardInfo := make([]byte, 2048)
  2399. pBusiCardInfo := make([]byte, 8192)
  2400. ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&pCardInfo[0])), (uintptr)(unsafe.Pointer(&pBusiCardInfo[0])))
  2401. fmt.Println(ret2)
  2402. fmt.Println(DeleteExtraSpace(string(pCardInfo)))
  2403. fmt.Println(DeleteExtraSpace(string(pBusiCardInfo)))
  2404. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pCardInfo)), "gbk", "utf-8"))
  2405. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pBusiCardInfo)), "gbk", "utf-8"))
  2406. if ret2 != 0 {
  2407. return "", ""
  2408. }
  2409. return DeleteExtraSpace(string(pCardInfo)), DeleteExtraSpace(string(pBusiCardInfo))
  2410. }
  2411. func (c *JSybController) GetELeInfo(code string, operator_id string, operator_name string) (string, string) {
  2412. DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")
  2413. readCard := DllDef.MustFindProc("EcCardQuery")
  2414. fmt.Println(readCard)
  2415. fmt.Println("!!!!!")
  2416. //pCardInfo := make([]byte, 8192)
  2417. pBusiCardInfo := make([]byte, 8192)
  2418. //data := make(map[string]interface{})
  2419. //pData := make(map[string]interface{})
  2420. //inputData := make(map[string]interface{})
  2421. //inputData["orgId"] = code
  2422. //inputData["businessType"] = "01101"
  2423. //inputData["operatorId"] = operator_id
  2424. //inputData["operatorName"] = operator_name
  2425. //inputData["officeId"] = "001"
  2426. //inputData["officeName"] = "血透室"
  2427. //data["data"] = inputData
  2428. //data["transType"] = "ec.query"
  2429. //data["orgId"] = code
  2430. //bytesData, _ := json.Marshal(data)
  2431. //pCardInfo = bytesData
  2432. ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&pBusiCardInfo[0])))
  2433. fmt.Println(ret2)
  2434. //fmt.Println(DeleteExtraSpace(string(bytesData)))
  2435. fmt.Println(DeleteExtraSpace(string(pBusiCardInfo)))
  2436. //fmt.Println(":", ConvertToString(DeleteExtraSpace(string(bytesData)), "gbk", "utf-8"))
  2437. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pBusiCardInfo)), "gbk", "utf-8"))
  2438. if ret2 != 0 {
  2439. return "", ""
  2440. }
  2441. return DeleteExtraSpace(""), DeleteExtraSpace(string(pBusiCardInfo))
  2442. }
  2443. func (c *JSybController) GetELeCertInfoFour1(code string, operator_id string, operator_name string) (string, string) {
  2444. DllDef := syscall.MustLoadDLL("NationEcCode.dll")
  2445. readCard := DllDef.MustFindProc("EcQuery")
  2446. pCardInfo := make([]byte, 8192)
  2447. pBusiCardInfo := make([]byte, 8192)
  2448. data := make(map[string]interface{})
  2449. inputData := make(map[string]interface{})
  2450. inputData["orgId"] = code
  2451. inputData["businessType"] = "01301"
  2452. inputData["operatorId"] = operator_id
  2453. inputData["operatorName"] = operator_name
  2454. inputData["officeId"] = "001"
  2455. inputData["officeName"] = "xuetou"
  2456. data["data"] = inputData
  2457. data["transType"] = "ec.query"
  2458. data["orgId"] = code
  2459. bytesData, _ := json.Marshal(data)
  2460. pCardInfo = bytesData
  2461. pCardInfo = []byte(ConvertByte2String(pCardInfo, GB18030))
  2462. ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&pCardInfo[0])), (uintptr)(unsafe.Pointer(&pBusiCardInfo[0])))
  2463. fmt.Println(ret2)
  2464. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(bytesData)), "gbk", "utf-8"))
  2465. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pBusiCardInfo)), "gbk", "utf-8"))
  2466. if ret2 != 0 {
  2467. return "", ""
  2468. }
  2469. return ConvertByte2String([]byte(DeleteExtraSpace(string(bytesData))), GB18030), ConvertByte2String([]byte(DeleteExtraSpace(string(pBusiCardInfo))), GB18030)
  2470. }
  2471. func (c *JSybController) GetELeCertInfoFour(code string, operator_id string, operator_name string) (string, string) {
  2472. DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")
  2473. readCard := DllDef.MustFindProc("GetPersonInfo")
  2474. pCardInfo := make([]byte, 8192)
  2475. pBusiCardInfo := make([]byte, 8192)
  2476. data := make(map[string]interface{})
  2477. inputData := make(map[string]interface{})
  2478. inputData["orgId"] = code
  2479. inputData["businessType"] = "01301"
  2480. inputData["operatorId"] = operator_id
  2481. inputData["operatorName"] = operator_name
  2482. inputData["officeId"] = "001"
  2483. inputData["officeName"] = "xuetou"
  2484. data["data"] = inputData
  2485. data["transType"] = "ec.query"
  2486. data["orgId"] = code
  2487. bytesData, _ := json.Marshal(data)
  2488. pCardInfo = bytesData
  2489. pCardInfo = []byte(ConvertByte2String(pCardInfo, GB18030))
  2490. ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&pCardInfo[0])), (uintptr)(unsafe.Pointer(&pBusiCardInfo[0])))
  2491. fmt.Println(ret2)
  2492. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(bytesData)), "gbk", "utf-8"))
  2493. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pBusiCardInfo)), "gbk", "utf-8"))
  2494. if ret2 != 0 {
  2495. return "", ""
  2496. }
  2497. return ConvertByte2String([]byte(DeleteExtraSpace(string(bytesData))), GB18030), ConvertByte2String([]byte(DeleteExtraSpace(string(pBusiCardInfo))), GB18030)
  2498. }
  2499. func (c *JSybController) GetELeCertInfoFour2223(code string, operator_id string, operator_name string) (string, string) {
  2500. DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")
  2501. readCard := DllDef.MustFindProc("GetPersonInfo")
  2502. pCardInfo := make([]byte, 8192)
  2503. pBusiCardInfo := make([]byte, 8192)
  2504. data := make(map[string]interface{})
  2505. inputData := make(map[string]interface{})
  2506. inputData["orgId"] = code
  2507. inputData["businessType"] = "01101"
  2508. inputData["operatorId"] = operator_id
  2509. inputData["operatorName"] = operator_name
  2510. inputData["officeId"] = "001"
  2511. inputData["officeName"] = "xuetou"
  2512. data["data"] = inputData
  2513. data["transType"] = "ec.query"
  2514. data["orgId"] = code
  2515. bytesData, _ := json.Marshal(data)
  2516. pCardInfo = bytesData
  2517. pCardInfo = []byte(ConvertByte2String(pCardInfo, GB18030))
  2518. ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&pCardInfo[0])), (uintptr)(unsafe.Pointer(&pBusiCardInfo[0])))
  2519. fmt.Println(ret2)
  2520. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(bytesData)), "gbk", "utf-8"))
  2521. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pBusiCardInfo)), "gbk", "utf-8"))
  2522. if ret2 != 0 {
  2523. return "", ""
  2524. }
  2525. return ConvertByte2String([]byte(DeleteExtraSpace(string(bytesData))), GB18030), ConvertByte2String([]byte(DeleteExtraSpace(string(pBusiCardInfo))), GB18030)
  2526. }
  2527. func (c *JSybController) GetELeCertInfoByFace(code string, operator_id string, operator_name string, businessType string) (string, string) {
  2528. // WebSocket服务器地址
  2529. serverURL := "ws://127.0.0.1:8899"
  2530. // 解析WebSocket服务器地址
  2531. u, err := url.Parse(serverURL)
  2532. if err != nil {
  2533. log.Fatal(err)
  2534. }
  2535. // 建立WebSocket连接
  2536. conn, _, err := websocket.DefaultDialer.Dial(u.String(), nil)
  2537. if err != nil {
  2538. log.Fatal(err)
  2539. }
  2540. defer conn.Close()
  2541. input2 := make(map[string]interface{})
  2542. input := make(map[string]interface{})
  2543. inputData := make(map[string]interface{})
  2544. inputData["orgId"] = code
  2545. inputData["outBizNo"] = time.Now().Unix()
  2546. inputData["businessType"] = businessType
  2547. inputData["operatorId"] = operator_id
  2548. inputData["operatorName"] = operator_name
  2549. inputData["officeId"] = "001"
  2550. inputData["officeName"] = "血透室"
  2551. inputData["deviceType"] = ""
  2552. input["data"] = inputData
  2553. input["orgId"] = code
  2554. input["transType"] = "cn.nhsa.ec.auth"
  2555. input2["url"] = "http://10.58.33.207:10086/localcfc/api/hsecfc/localQrCodeQuery"
  2556. input2["indata"] = input
  2557. bytesData, _ := json.Marshal(input2)
  2558. err = conn.WriteMessage(websocket.TextMessage, bytesData)
  2559. if err != nil {
  2560. fmt.Println(err)
  2561. }
  2562. // 接收消息
  2563. _, receivedMessage, err := conn.ReadMessage()
  2564. if err != nil {
  2565. fmt.Println(err)
  2566. }
  2567. return "", string(receivedMessage)
  2568. }
  2569. func GetELeCertInfoByFacetwo(code string, operator_id string, operator_name string, authNo string, outBizNo string, businessType string) (string, string) {
  2570. // // WebSocket服务器地址
  2571. serverURL := "ws://127.0.0.1:8899"
  2572. // 解析WebSocket服务器地址
  2573. u, err := url.Parse(serverURL)
  2574. if err != nil {
  2575. log.Fatal(err)
  2576. }
  2577. // 建立WebSocket连接
  2578. conn, _, err := websocket.DefaultDialer.Dial(u.String(), nil)
  2579. if err != nil {
  2580. log.Fatal(err)
  2581. }
  2582. defer conn.Close()
  2583. input2 := make(map[string]interface{})
  2584. input := make(map[string]interface{})
  2585. inputData := make(map[string]interface{})
  2586. inputData["orgId"] = code
  2587. inputData["outBizNo"] = outBizNo
  2588. inputData["authNo"] = authNo
  2589. inputData["businessType"] = businessType
  2590. inputData["operatorId"] = operator_id
  2591. inputData["operatorName"] = operator_name
  2592. inputData["officeId"] = "001"
  2593. inputData["officeName"] = "血透室"
  2594. inputData["deviceType"] = ""
  2595. input["data"] = inputData
  2596. input["orgId"] = code
  2597. input["transType"] = "cn.nhsa.auth.check"
  2598. input2["url"] = "http://10.58.33.207:10086/localcfc/api/hsecfc/localQrCodeQuery"
  2599. input2["indata"] = input
  2600. bytesData, _ := json.Marshal(input2)
  2601. err = conn.WriteMessage(websocket.TextMessage, bytesData)
  2602. if err != nil {
  2603. fmt.Println(err)
  2604. }
  2605. // 接收消息
  2606. _, receivedMessage, err := conn.ReadMessage()
  2607. if err != nil {
  2608. fmt.Println(err)
  2609. }
  2610. return "", string(receivedMessage)
  2611. }
  2612. func (c *JSybController) GetELeCertInfoTwo(code string, operator_id string, operator_name string) (string, string) {
  2613. // WebSocket服务器地址
  2614. serverURL := "ws://127.0.0.1:8899"
  2615. // 解析WebSocket服务器地址
  2616. u, err := url.Parse(serverURL)
  2617. if err != nil {
  2618. log.Fatal(err)
  2619. }
  2620. // 建立WebSocket连接
  2621. conn, _, err := websocket.DefaultDialer.Dial(u.String(), nil)
  2622. if err != nil {
  2623. log.Fatal(err)
  2624. }
  2625. defer conn.Close()
  2626. input2 := make(map[string]interface{})
  2627. input := make(map[string]interface{})
  2628. inputData := make(map[string]interface{})
  2629. inputData["orgId"] = code
  2630. inputData["businessType"] = "01101"
  2631. inputData["operatorId"] = operator_id
  2632. inputData["operatorName"] = operator_name
  2633. inputData["officeId"] = "001"
  2634. inputData["officeName"] = "血透室"
  2635. inputData["deviceType"] = ""
  2636. input["data"] = inputData
  2637. input["orgId"] = code
  2638. input["transType"] = "ec.query"
  2639. input2["url"] = "http://10.58.33.207:10086/localcfc/api/hsecfc/localQrCodeQuery"
  2640. input2["indata"] = input
  2641. bytesData, _ := json.Marshal(input2)
  2642. err = conn.WriteMessage(websocket.TextMessage, bytesData)
  2643. if err != nil {
  2644. fmt.Println(err)
  2645. }
  2646. // 接收消息
  2647. _, receivedMessage, err := conn.ReadMessage()
  2648. if err != nil {
  2649. fmt.Println(err)
  2650. }
  2651. return "", string(receivedMessage)
  2652. }
  2653. func (c *JSybController) GetELeCertInfoThree(code string, operator_id string, operator_name string) (string, string) {
  2654. // WebSocket服务器地址
  2655. serverURL := "ws://127.0.0.1:8899"
  2656. // 解析WebSocket服务器地址
  2657. u, err := url.Parse(serverURL)
  2658. if err != nil {
  2659. log.Fatal(err)
  2660. }
  2661. // 建立WebSocket连接
  2662. conn, _, err := websocket.DefaultDialer.Dial(u.String(), nil)
  2663. if err != nil {
  2664. log.Fatal(err)
  2665. }
  2666. defer conn.Close()
  2667. input2 := make(map[string]interface{})
  2668. input := make(map[string]interface{})
  2669. inputData := make(map[string]interface{})
  2670. inputData["orgId"] = code
  2671. inputData["businessType"] = "01301"
  2672. inputData["operatorId"] = operator_id
  2673. inputData["operatorName"] = operator_name
  2674. inputData["officeId"] = "001"
  2675. inputData["officeName"] = "血透室"
  2676. inputData["deviceType"] = ""
  2677. input["data"] = inputData
  2678. input["orgId"] = code
  2679. input["transType"] = "ec.query"
  2680. input2["url"] = "http://10.58.33.207:10086/localcfc/api/hsecfc/localQrCodeQuery"
  2681. input2["indata"] = input
  2682. bytesData, _ := json.Marshal(input2)
  2683. err = conn.WriteMessage(websocket.TextMessage, bytesData)
  2684. if err != nil {
  2685. fmt.Println(err)
  2686. }
  2687. // 接收消息
  2688. _, receivedMessage, err := conn.ReadMessage()
  2689. if err != nil {
  2690. fmt.Println(err)
  2691. }
  2692. return "", string(receivedMessage)
  2693. }
  2694. func GetELeCertInfoSettle(code string, operator_id string, operator_name string) (string, string) {
  2695. DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")
  2696. readCard := DllDef.MustFindProc("GetPersonInfo")
  2697. pCardInfo := make([]byte, 8192)
  2698. pBusiCardInfo := make([]byte, 8192)
  2699. data := make(map[string]interface{})
  2700. inputData := make(map[string]interface{})
  2701. inputData["orgId"] = code
  2702. inputData["businessType"] = "01301"
  2703. inputData["operatorId"] = "1"
  2704. inputData["operatorName"] = "admin"
  2705. inputData["officeId"] = "001"
  2706. inputData["officeName"] = "admin"
  2707. data["data"] = inputData
  2708. data["transType"] = "ec.query"
  2709. data["orgId"] = code
  2710. bytesData, _ := json.Marshal(data)
  2711. pCardInfo = bytesData
  2712. pCardInfo = []byte(ConvertByte2String(pCardInfo, GB18030))
  2713. ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&pCardInfo[0])), (uintptr)(unsafe.Pointer(&pBusiCardInfo[0])))
  2714. fmt.Println(ret2)
  2715. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(bytesData)), "gbk", "utf-8"))
  2716. fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pBusiCardInfo)), "gbk", "utf-8"))
  2717. if ret2 != 0 {
  2718. return "", ""
  2719. }
  2720. return ConvertByte2String([]byte(DeleteExtraSpace(string(bytesData))), GB18030), ConvertByte2String([]byte(DeleteExtraSpace(string(pBusiCardInfo))), GB18030)
  2721. }
  2722. func IntPtr(n int) uintptr {
  2723. return uintptr(n)
  2724. }
  2725. func StrPtr(s string) uintptr {
  2726. return uintptr(unsafe.Pointer(syscall.StringBytePtr(s)))
  2727. }
  2728. type Charset string
  2729. const (
  2730. UTF8 = Charset("UTF-8")
  2731. GB18030 = Charset("GB18030")
  2732. )
  2733. func ConvertToString(src string, srcCode string, tagCode string) string {
  2734. srcCoder := mahonia.NewDecoder(srcCode)
  2735. srcResult := srcCoder.ConvertString(src)
  2736. tagCoder := mahonia.NewDecoder(tagCode)
  2737. _, cdata, _ := tagCoder.Translate([]byte(srcResult), true)
  2738. result := string(cdata)
  2739. return result
  2740. }
  2741. func DeleteExtraSpace(s string) string {
  2742. //删除字符串中的多余空格,有多个空格时,仅保留一个空格
  2743. s1 := strings.Replace(s, " ", " ", -1) //替换tab为空格
  2744. regstr := "\\s{2,}" //两个及两个以上空格的正则表达式
  2745. reg, _ := regexp.Compile(regstr) //编译正则表达式
  2746. s2 := make([]byte, len(s1)) //定义字符数组切片
  2747. copy(s2, s1) //将字符串复制到切片
  2748. spc_index := reg.FindStringIndex(string(s2)) //在字符串中搜索
  2749. for len(spc_index) > 0 { //找到适配项
  2750. s2 = append(s2[:spc_index[0]+1], s2[spc_index[1]:]...) //删除多余空格
  2751. spc_index = reg.FindStringIndex(string(s2)) //继续在字符串中搜索
  2752. }
  2753. return string(s2)
  2754. }
  2755. func Remove0000(s string) string {
  2756. str := make([]rune, 0, len(s))
  2757. for _, v := range []rune(s) {
  2758. if v == 0 {
  2759. continue
  2760. }
  2761. str = append(str, v)
  2762. }
  2763. return string(str)
  2764. }
  2765. func saveJsLog(result string, request string, infno string, desc string, org_name string) {
  2766. //org_id, _ := beego.AppConfig.Int64("org_id")
  2767. //miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
  2768. dir := org_name + "日志"
  2769. utils.Mkdir(dir)
  2770. month := time.Unix(1557042972, 0).Format("1")
  2771. year := time.Now().Format("2006")
  2772. month = time.Now().Format("01")
  2773. day := time.Now().Format("02")
  2774. hour := time.Now().Format("15")
  2775. min := time.Now().Format("04")
  2776. sec := time.Now().Format("05")
  2777. result_time := year + "-" + month + "-" + day + " " + hour + ":" + min + ":" + sec
  2778. file := org_name + "_" + year + month + day + "_log"
  2779. file_name := file + ".txt"
  2780. file_path := org_name + "日志" + "/" + file_name
  2781. exist, _ := utils.PathExists(file_path)
  2782. if exist { //存在
  2783. fmt.Println("存在")
  2784. f, err := os.OpenFile(file_path, os.O_WRONLY, 0644)
  2785. if err != nil {
  2786. fmt.Println("read fail")
  2787. }
  2788. content := "\r\n" + "\r\n" + "\r\n" + result_time + " " + "【 " + desc + infno + "入参" + " 】:" + "\r\n" + request + "\r\n" + result_time + " " + "【 " + desc + infno + "出参" + " 】:" + "\r\n" + result
  2789. n, _ := f.Seek(0, 2)
  2790. _, err = f.WriteAt([]byte(content), n)
  2791. } else { //不存在
  2792. fmt.Println("文件不存在,创建文件")
  2793. f, err := os.Create(org_name + "日志" + "/" + file_name)
  2794. defer f.Close()
  2795. if err != nil {
  2796. } else {
  2797. _, err = f.Write([]byte("记录日志"))
  2798. }
  2799. }
  2800. }
  2801. func (c *JSybController) Get3101() {
  2802. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  2803. var respJSON map[string]interface{}
  2804. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  2805. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  2806. return
  2807. }
  2808. pdUserJSONBytes, _ := json.Marshal(respJSON["pd"])
  2809. var pd models.PatientDtos
  2810. if err := json.Unmarshal(pdUserJSONBytes, &pd); err != nil {
  2811. utils.ErrorLog("解析失败:%v", err)
  2812. return
  2813. }
  2814. fedUserJSONBytes, _ := json.Marshal(respJSON["fed"])
  2815. var fed models.FsiEncounterDtos
  2816. if err := json.Unmarshal(fedUserJSONBytes, &fed); err != nil {
  2817. utils.ErrorLog("解析失败:%v", err)
  2818. return
  2819. }
  2820. fddUserJSONBytes, _ := json.Marshal(respJSON["fdd"])
  2821. var fdd []*models.FsiDiagnoseDtos
  2822. if err := json.Unmarshal(fddUserJSONBytes, &fdd); err != nil {
  2823. utils.ErrorLog("解析失败:%v", err)
  2824. return
  2825. }
  2826. fodUserJSONBytes, _ := json.Marshal(respJSON["fod"])
  2827. var fod []*models.FsiOrderDtos
  2828. if err := json.Unmarshal(fodUserJSONBytes, &fod); err != nil {
  2829. utils.ErrorLog("解析失败:%v", err)
  2830. return
  2831. }
  2832. fopdUserJSONBytes, _ := json.Marshal(respJSON["fopd"])
  2833. var fopd []*models.FsiOperationDtosData
  2834. if err := json.Unmarshal(fopdUserJSONBytes, &fopd); err != nil {
  2835. utils.ErrorLog("解析失败:%v", err)
  2836. return
  2837. }
  2838. ppUserJSONBytes, _ := json.Marshal(respJSON["pp"])
  2839. var pp models.PublicParams
  2840. if err := json.Unmarshal(ppUserJSONBytes, &pp); err != nil {
  2841. utils.ErrorLog("解析失败:%v", err)
  2842. return
  2843. }
  2844. request, result := service.Jsyb3101(pd, fed, fdd, fod, fopd, pp, respJSON["trig_scen"].(string))
  2845. var dat map[string]interface{}
  2846. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2847. fmt.Println(dat)
  2848. } else {
  2849. fmt.Println(err)
  2850. }
  2851. var dat2 map[string]interface{}
  2852. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  2853. fmt.Println(dat2)
  2854. } else {
  2855. fmt.Println(err)
  2856. }
  2857. saveJsLog(result, request, "3101", "事前", pp.FixmedinsName)
  2858. c.ServeSuccessJSON(map[string]interface{}{
  2859. "pre": dat,
  2860. "request_log": dat2,
  2861. })
  2862. }
  2863. func (c *JSybController) Get3102() {
  2864. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  2865. var respJSON map[string]interface{}
  2866. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  2867. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  2868. return
  2869. }
  2870. pdUserJSONBytes, _ := json.Marshal(respJSON["pd"])
  2871. var pd models.PatientDtos
  2872. if err := json.Unmarshal(pdUserJSONBytes, &pd); err != nil {
  2873. utils.ErrorLog("解析失败:%v", err)
  2874. return
  2875. }
  2876. fedUserJSONBytes, _ := json.Marshal(respJSON["fed"])
  2877. var fed models.FsiEncounterDtos
  2878. if err := json.Unmarshal(fedUserJSONBytes, &fed); err != nil {
  2879. utils.ErrorLog("解析失败:%v", err)
  2880. return
  2881. }
  2882. fddUserJSONBytes, _ := json.Marshal(respJSON["fdd"])
  2883. var fdd []*models.FsiDiagnoseDtos
  2884. if err := json.Unmarshal(fddUserJSONBytes, &fdd); err != nil {
  2885. utils.ErrorLog("解析失败:%v", err)
  2886. return
  2887. }
  2888. fodUserJSONBytes, _ := json.Marshal(respJSON["fod"])
  2889. var fod []*models.FsiOrderDtos
  2890. if err := json.Unmarshal(fodUserJSONBytes, &fod); err != nil {
  2891. utils.ErrorLog("解析失败:%v", err)
  2892. return
  2893. }
  2894. fopdUserJSONBytes, _ := json.Marshal(respJSON["fopd"])
  2895. var fopd []*models.FsiOperationDtosData
  2896. if err := json.Unmarshal(fopdUserJSONBytes, &fopd); err != nil {
  2897. utils.ErrorLog("解析失败:%v", err)
  2898. return
  2899. }
  2900. ppUserJSONBytes, _ := json.Marshal(respJSON["pp"])
  2901. var pp models.PublicParams
  2902. if err := json.Unmarshal(ppUserJSONBytes, &pp); err != nil {
  2903. utils.ErrorLog("解析失败:%v", err)
  2904. return
  2905. }
  2906. request, result := service.Jsyb3102(pd, fed, fdd, fod, fopd, pp, respJSON["trig_scen"].(string))
  2907. var dat map[string]interface{}
  2908. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2909. fmt.Println(dat)
  2910. } else {
  2911. fmt.Println(err)
  2912. }
  2913. var dat2 map[string]interface{}
  2914. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  2915. fmt.Println(dat2)
  2916. } else {
  2917. fmt.Println(err)
  2918. }
  2919. saveJsLog(result, request, "3102", "事后", pp.FixmedinsName)
  2920. c.ServeSuccessJSON(map[string]interface{}{
  2921. "pre": dat,
  2922. "request_log": dat2,
  2923. })
  2924. }
  2925. func (c *JSybController) Get4101() {
  2926. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  2927. var respJSON map[string]interface{}
  2928. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  2929. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  2930. return
  2931. }
  2932. struct4101UserJSONBytes, _ := json.Marshal(respJSON["struct4101"])
  2933. var struct4101 service.Struct4101
  2934. if err := json.Unmarshal(struct4101UserJSONBytes, &struct4101); err != nil {
  2935. utils.ErrorLog("解析失败:%v", err)
  2936. return
  2937. }
  2938. ppUserJSONBytes, _ := json.Marshal(respJSON["pp"])
  2939. var pp models.PublicParams
  2940. if err := json.Unmarshal(ppUserJSONBytes, &pp); err != nil {
  2941. utils.ErrorLog("解析失败:%v", err)
  2942. return
  2943. }
  2944. request, result := service.Jsyb4101(struct4101, pp)
  2945. var dat map[string]interface{}
  2946. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  2947. fmt.Println(dat)
  2948. } else {
  2949. fmt.Println(err)
  2950. }
  2951. var dat2 map[string]interface{}
  2952. if err := json.Unmarshal([]byte(request), &dat2); err == nil {
  2953. fmt.Println(dat2)
  2954. } else {
  2955. fmt.Println(err)
  2956. }
  2957. saveJsLog(result, request, "4101", "上传明细清单", pp.FixmedinsName)
  2958. c.ServeSuccessJSON(map[string]interface{}{
  2959. "pre": dat,
  2960. "request_log": dat2,
  2961. })
  2962. }
  2963. func ConvertByte2String(byte []byte, charset Charset) string {
  2964. var str string
  2965. switch charset {
  2966. case GB18030:
  2967. decodeBytes, _ := simplifiedchinese.GB18030.NewDecoder().Bytes(byte)
  2968. str = string(decodeBytes)
  2969. case UTF8:
  2970. fallthrough
  2971. default:
  2972. str = string(byte)
  2973. }
  2974. return str
  2975. }