jsyb_controller.go 98KB

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