jsyb_controller.go 90KB

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