jsyb_controller.go 77KB

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