jsyb_controller.go 76KB

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