123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271 |
- package nm
-
- import (
- "bytes"
- "encoding/json"
- "fmt"
- "gdyb/controllers"
- "gdyb/enums"
- "gdyb/models"
- "gdyb/service"
- "gdyb/utils"
- "github.com/astaxie/beego"
- "github.com/axgle/mahonia"
- "github.com/gorilla/websocket"
- "golang.org/x/text/encoding/simplifiedchinese"
- "io/ioutil"
- "log"
- "net/http"
- "net/url"
- "os"
- "regexp"
- "strconv"
- "strings"
- "syscall"
- "time"
- "unsafe"
- )
-
- type NmController struct {
- controllers.BaseAuthAPIController
- }
-
- func NmybRegistRouters() {
- beego.Router("/nmyb/1101", &NmController{}, "get:Post1101")
- beego.Router("/nmyb/2401", &NmController{}, "post:Post2401")
- beego.Router("/nmyb/2402", &NmController{}, "post:Post2402")
- beego.Router("/nmyb/2404", &NmController{}, "get:Post2404")
- beego.Router("/nmyb/2405", &NmController{}, "get:Post2405")
- beego.Router("/nmyb/2301", &NmController{}, "post:Post2301")
- beego.Router("/nmyb/2302", &NmController{}, "get:Post2302")
- beego.Router("/nmyb/2303", &NmController{}, "get:Post2303")
- beego.Router("/nmyb/2304", &NmController{}, "get:Post2304")
- beego.Router("/nmyb/2305", &NmController{}, "get:Post2305")
- beego.Router("/nmyb/5203", &NmController{}, "get:Post5203")
- beego.Router("/nmyb/readcard", &NmController{}, "get:ReadCard")
- beego.Router("/nmyb/3201", &NmController{}, "get:Get3201")
- beego.Router("/nmyb/4101", &NmController{}, "post:Post4101")
- beego.Router("/nmyb/2601", &NmController{}, "get:Get2601")
- beego.Router("/api/token", &NmController{}, "get:GetToken")
- //beego.Router("/api/eleinfo", &NmController{}, "get:GetNewELeInfo")
- beego.Router("/nmyb/4102", &NmController{}, "get:Post4102")
- beego.Router("/nmyb/4103", &NmController{}, "get:Post4103")
-
- beego.Router("/nmyb/2201", &NmController{}, "get:Post2201")
- beego.Router("/nmyb/2202", &NmController{}, "get:Post2202")
- beego.Router("/nmyb/2203", &NmController{}, "post:Post2203")
- beego.Router("/nmyb/2203C", &NmController{}, "post:Post2203C")
-
- beego.Router("/nmyb/2204", &NmController{}, "post:Post2204")
- beego.Router("/nmyb/2205", &NmController{}, "get:Post2205")
- beego.Router("/nmyb/2206", &NmController{}, "get:Post2206")
- beego.Router("/nmyb/2207", &NmController{}, "get:Post2207")
- beego.Router("/nmyb/2208", &NmController{}, "get:Post2208")
-
- beego.Router("/nmyb/2503", &NmController{}, "get:Post2503")
-
- beego.Router("/nmyb/3501", &NmController{}, "get:Post3501")
- beego.Router("/nmyb/3502", &NmController{}, "get:Post3502")
- beego.Router("/nmyb/3503", &NmController{}, "get:Post3503")
- beego.Router("/nmyb/3504", &NmController{}, "get:Post3504")
- beego.Router("/nmyb/3505", &NmController{}, "post:Post3505")
- beego.Router("/nmyb/3506", &NmController{}, "get:Post3506")
- beego.Router("/nmyb/3507", &NmController{}, "get:Post3507")
- beego.Router("/nmyb/3508", &NmController{}, "get:Post3508")
- beego.Router("/nmyb/3509", &NmController{}, "get:Post3509")
- beego.Router("/nmyb/3510", &NmController{}, "get:Post3510")
- beego.Router("/nmyb/3511", &NmController{}, "get:Post3511")
- beego.Router("/nmyb/3512", &NmController{}, "get:Post3512")
- beego.Router("/nmyb/3513", &NmController{}, "get:Post3513")
-
- }
- func (c *NmController) Post3501() {
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
-
- userJSONBytes, _ := json.Marshal(respJSON["struct_3501s"])
- var struct3501 models.Struct3501
- if err := json.Unmarshal(userJSONBytes, &struct3501); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
-
- result, request_log := service.NMyb3501(struct3501, struct3501.SecretKey)
- saveJsLog(result, request_log, "3501", "库存盘点", struct3501.OrgName)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
-
- }
- func (c *NmController) Post3502() {
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
-
- userJSONBytes, _ := json.Marshal(respJSON["struct_3502s"])
- var struct3502s models.Struct3502
- if err := json.Unmarshal(userJSONBytes, &struct3502s); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
-
- result, request_log := service.NMyb3502(struct3502s, struct3502s.SecretKey)
- saveJsLog(result, request_log, "3502", "库存变更", struct3502s.OrgName)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
-
- }
- func (c *NmController) Post3503() {
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
-
- userJSONBytes, _ := json.Marshal(respJSON["struct_3503s"])
- var struct3503 models.Struct3503
- if err := json.Unmarshal(userJSONBytes, &struct3503); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
- fmt.Println(struct3503)
-
- result, request_log := service.NMyb3503(struct3503, struct3503.SecretKey)
- saveJsLog(result, request_log, "3503", "库存采购", struct3503.OrgName)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
- }
-
- func (c *NmController) Post3504() {
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
-
- userJSONBytes, _ := json.Marshal(respJSON["struct_3504s"])
- var struct3504 []models.Struct3504
- if err := json.Unmarshal(userJSONBytes, &struct3504); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
-
- result, request_log := service.NMyb3504(struct3504[0], struct3504[0].SecretKey)
- saveJsLog(result, request_log, "3504", "库存盘点", struct3504[0].OrgName)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
-
- }
- func (c *NmController) Post3505() {
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
-
- userJSONBytes, _ := json.Marshal(respJSON["struct_3505s"])
- var struct3505 models.Struct3505
- if err := json.Unmarshal(userJSONBytes, &struct3505); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
-
- result, request_log := service.NMyb3505(struct3505, struct3505.SecretKey)
- saveJsLog(result, request_log, "3505", "销售", struct3505.OrgName)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
- }
- func (c *NmController) Post3506() {
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
-
- userJSONBytes, _ := json.Marshal(respJSON["struct_3506s"])
- var struct3506 models.Struct3506
- if err := json.Unmarshal(userJSONBytes, &struct3506); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
-
- result, request_log := service.NMyb3506(struct3506, struct3506.SecretKey)
- saveJsLog(result, request_log, "3506", "销售退库", struct3506.OrgName)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
-
- }
- func (c *NmController) Post3507() {
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
-
- userJSONBytes, _ := json.Marshal(respJSON["struct_3507s"])
- var struct3507 models.Struct3507
- if err := json.Unmarshal(userJSONBytes, &struct3507); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
-
- result, request_log := service.NMyb3507(struct3507, struct3507.SecretKey)
- saveJsLog(result, request_log, "3507", "库存盘点", struct3507.OrgName)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
-
- }
-
- func (c *NmController) Post3508() {
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
-
- userJSONBytes, _ := json.Marshal(respJSON["struct_3508s"])
- var struct3508 models.Struct3508
- if err := json.Unmarshal(userJSONBytes, &struct3508); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
-
- result, request_log := service.NMyb3508(struct3508, struct3508.SecretKey)
- saveJsLog(result, request_log, "3508", "库存查询", struct3508.OrgName)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
-
- }
-
- func (c *NmController) Post3509() {
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
-
- userJSONBytes, _ := json.Marshal(respJSON["struct_3509s"])
- var struct3509 models.Struct3509
- if err := json.Unmarshal(userJSONBytes, &struct3509); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
-
- result, request_log := service.NMyb3509(struct3509, struct3509.SecretKey)
- saveJsLog(result, request_log, "3509", "库存盘点", struct3509.OrgName)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
-
- }
-
- func (c *NmController) Post3510() {
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
-
- userJSONBytes, _ := json.Marshal(respJSON["struct_3510s"])
- var struct3510 models.Struct3510
- if err := json.Unmarshal(userJSONBytes, &struct3510); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
-
- result, request_log := service.NMyb3510(struct3510, struct3510.SecretKey)
- saveJsLog(result, request_log, "3510", "库存盘点", struct3510.OrgName)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
-
- }
-
- func (c *NmController) Post3511() {
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
-
- userJSONBytes, _ := json.Marshal(respJSON["struct_3511s"])
- var struct3511 models.Struct3511
- if err := json.Unmarshal(userJSONBytes, &struct3511); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
-
- result, request_log := service.NMyb3511(struct3511, struct3511.SecretKey)
- saveJsLog(result, request_log, "3511", "库存查询", struct3511.OrgName)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
-
- }
-
- func (c *NmController) Post3512() {
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
-
- userJSONBytes, _ := json.Marshal(respJSON["struct_3512s"])
- var struct3512 models.Struct3512
- if err := json.Unmarshal(userJSONBytes, &struct3512); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
-
- result, request_log := service.NMyb3512(struct3512, struct3512.SecretKey)
- saveJsLog(result, request_log, "3512", "库存盘点", struct3512.OrgName)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
-
- }
-
- func (c *NmController) Post3513() {
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
-
- userJSONBytes, _ := json.Marshal(respJSON["struct_3513s"])
- var struct3513 models.Struct3513
- if err := json.Unmarshal(userJSONBytes, &struct3513); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
-
- result, request_log := service.NMyb3513(struct3513, struct3513.SecretKey)
- saveJsLog(result, request_log, "3513", "库存查询", struct3513.OrgName)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
-
- }
-
- func (c *NmController) Post2201() {
- psnNo := c.GetString("psn_no")
- insutype := c.GetString("insutype")
- certNo := c.GetString("cert_no")
- org_name := c.GetString("org_name")
- ipt_otp_no := c.GetString("ipt_otp_no")
- dept := c.GetString("dept")
- verify_number := c.GetString("verify_number")
- fixmedins_code := c.GetString("fixmedins_code")
- dept_code := c.GetString("dept_code")
- doctor_id := c.GetString("doctor_id")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- secret_key := c.GetString("secret_key")
- id_card_type, _ := c.GetInt64("id_card_type")
- doctor_name := c.GetString("doctor_name")
- cainfo := c.GetString("cainfo")
- opter := c.GetString("opter")
-
- result, request_log := service.Nmyb2201(psnNo, insutype, certNo, org_name, opter, ipt_otp_no, dept, fixmedins_code, dept_code, doctor_id, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type, doctor_name, verify_number, cainfo)
- saveJsLog(result, request_log, "2201", "挂号", org_name)
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
- }
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- } else {
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
- }
- func (c *NmController) Post2202() {
- psnNo := c.GetString("psn_no")
- mdtrtId := c.GetString("mdtrt_id")
- iptOtpNo := c.GetString("ipt_otp_no")
- org_name := c.GetString("org_name")
- doctor := c.GetString("doctor")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- secret_key := c.GetString("secret_key")
- fixmedins_code := c.GetString("fixmedins_code")
- cainfo := c.GetString("cainfo")
-
- result, request_log := service.Nmyb2202(psnNo, mdtrtId, iptOtpNo, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code, cainfo)
- saveJsLog(result, request_log, "2202", "退号", org_name)
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
- }
-
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
-
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
- }
- func (c *NmController) Post2203() {
-
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
- userJSONBytes, _ := json.Marshal(respJSON["config"])
- var config []*models.HisXtDiagnoseConfig
- if err := json.Unmarshal(userJSONBytes, &config); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
- fmt.Println(respJSON["psn_no"].(string))
- fmt.Println(respJSON["mdtrt_id"].(string))
-
- psnNo := respJSON["psn_no"].(string)
- mdtrtId := respJSON["mdtrt_id"].(string)
- doctor := respJSON["doctor"].(string)
- department := respJSON["department"].(string)
-
- org_name := respJSON["org_name"].(string)
- med_type := respJSON["med_type"].(string)
- doctor_id := respJSON["doctor_id"].(string)
- fixmedins_code := respJSON["fixmedins_code"].(string)
- sick_code := respJSON["sick_code"].(string)
- sick_name := respJSON["sick_name"].(string)
- dept := respJSON["dept"].(string)
-
- insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
- mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
- secret_key := respJSON["secret_key"].(string)
-
- begin_time := respJSON["begin_time"].(string)
- cainfo := respJSON["cainfo"].(string)
-
- //cainfo := c.GetString("cainfo")
-
- result, request_log := service.Nmyb2203(psnNo, mdtrtId, doctor, department, org_name, med_type, doctor_id, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, sick_code, sick_name, dept, config, begin_time, cainfo)
- saveJsLog(result, request_log, "2203", "上传就诊信息", org_name)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
-
- } else {
-
- }
-
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
-
- } else {
-
- }
-
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
- }
- func (c *NmController) Post2203C() {
-
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
- userJSONBytes, _ := json.Marshal(respJSON["config"])
- var config []*models.HisXtDiagnoseConfig
- if err := json.Unmarshal(userJSONBytes, &config); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
- fmt.Println(respJSON["psn_no"].(string))
- fmt.Println(respJSON["mdtrt_id"].(string))
-
- psnNo := respJSON["psn_no"].(string)
- mdtrtId := respJSON["mdtrt_id"].(string)
- doctor := respJSON["doctor"].(string)
- department := respJSON["department"].(string)
-
- org_name := respJSON["org_name"].(string)
- med_type := respJSON["med_type"].(string)
- doctor_id := respJSON["doctor_id"].(string)
- fixmedins_code := respJSON["fixmedins_code"].(string)
- sick_code := respJSON["sick_code"].(string)
- sick_name := respJSON["sick_name"].(string)
- dept := respJSON["dept"].(string)
-
- insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
- mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
- secret_key := respJSON["secret_key"].(string)
-
- begin_time := respJSON["begin_time"].(string)
- cainfo := respJSON["cainfo"].(string)
- //is_vaild := respJSON["is_vaild"].(string)
-
- //cainfo := c.GetString("cainfo")
-
- result, request_log := service.Nmyb2203C(psnNo, mdtrtId, doctor, department, org_name, med_type, doctor_id, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, sick_code, sick_name, dept, config, begin_time, cainfo)
- saveJsLog(result, request_log, "2203", "上传就诊信息", org_name)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
-
- } else {
-
- }
-
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
-
- } else {
-
- }
-
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
- }
-
- func (c *NmController) Post2204() {
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
- userJSONBytes, _ := json.Marshal(respJSON["pre"])
- var hp []*models.HisPrescription
- if err := json.Unmarshal(userJSONBytes, &hp); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
- //fmt.Println("2203A的time_stamp=" + respJSON["time_stamp"].(string))
- result, request_log := service.Nmyb2204(respJSON["psn_no"].(string), respJSON["mdtrt_id"].(string), hp, respJSON["chrg_bchno"].(string), respJSON["org_name"].(string),
- 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))
-
- saveJsLog(result, request_log, "2204", "上传明细", respJSON["org_name"].(string))
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- fmt.Println(dat)
- } else {
- fmt.Println(err)
- }
-
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- fmt.Println(dat2)
- } else {
- fmt.Println(err)
- }
-
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
- }
- func (c *NmController) Post2205() {
- psnNo := c.GetString("psn_no")
- mdtrtId := c.GetString("mdtrt_id")
- chrgBchno := c.GetString("chrg_bchno")
- org_name := c.GetString("org_name")
- doctor := c.GetString("doctor")
-
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
-
- secret_key := c.GetString("secret_key")
- fixmedins_code := c.GetString("fixmedins_code")
- url := c.GetString("url")
- ak := c.GetString("ak")
- cainfo := c.GetString("cainfo")
-
- result, request_log := service.Nmyb2205(psnNo, mdtrtId, chrgBchno, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code, url, ak, cainfo)
- fmt.Println(request_log)
- saveJsLog(result, request_log, "2205", "撤销明细", org_name)
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- fmt.Println(dat)
- } else {
- fmt.Println(err)
- }
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- fmt.Println(dat2)
- } else {
- fmt.Println(err)
- }
-
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
- }
- func (c *NmController) Post2206() {
- psnNo := c.GetString("psn_no")
- mdtrtId := c.GetString("mdtrt_id")
- chrgBchno := c.GetString("chrg_bchno")
- certNo := c.GetString("cert_no")
- insutype := c.GetString("insutype")
- total := c.GetString("total")
- org_name := c.GetString("org_name")
- doctor := c.GetString("doctor")
- fixmedins_code := c.GetString("fixmedins_code")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- secret_key := c.GetString("secret_key")
- med_type := c.GetString("med_type")
- id_card_type, _ := c.GetInt64("id_card_type")
- certificates, _ := c.GetInt64("certificates")
- verify_number := c.GetString("verify_number")
- cainfo := c.GetString("cainfo")
- mdtrt_grp_type := c.GetString("mdtrt_grp_type")
-
- url := c.GetString("url")
- ak := c.GetString("ak")
-
- var result string
- var request_log string
-
- result, request_log = service.Nmyb2206(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)
-
- saveJsLog(result, request_log, "2206", "预结算", org_name)
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- fmt.Println(dat)
- } else {
- fmt.Println(err)
- }
-
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- fmt.Println(dat2)
- } else {
- fmt.Println(err)
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
- }
- func (c *NmController) Post2207() {
- psnNo := c.GetString("psn_no")
- mdtrtId := c.GetString("mdtrt_id")
- chrgBchno := c.GetString("chrg_bchno")
- certNo := c.GetString("cert_no")
- insutype := c.GetString("insutype")
- total := c.GetString("total")
- org_name := c.GetString("org_name")
- doctor := c.GetString("doctor")
- fixmedins_code := c.GetString("fixmedins_code")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- secret_key := c.GetString("secret_key")
- med_type := c.GetString("med_type")
- id_card_type, _ := c.GetInt64("id_card_type")
- certificates, _ := c.GetInt64("certificates")
-
- fulamt_ownpay_amt, _ := c.GetFloat("fulamt_ownpay_amt")
- overlmt_selfpay, _ := c.GetFloat("overlmt_selfpay")
- preselfpay_amt, _ := c.GetFloat("preselfpay_amt")
- inscp_scp_amt, _ := c.GetFloat("inscp_scp_amt")
-
- acct_used_flag := c.GetString("acct_used_flag")
-
- url := c.GetString("url")
- ak := c.GetString("ak")
- verify_number := c.GetString("verify_number")
- cainfo := c.GetString("cainfo")
- mdtrt_grp_type := c.GetString("mdtrt_grp_type")
-
- var result string
- var request_log string
-
- result, request_log = service.Nmyb2207(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)
-
- saveJsLog(result, request_log, "2207", "结算", org_name)
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- fmt.Println(dat)
- } else {
- fmt.Println(err)
- }
-
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- fmt.Println(dat2)
- } else {
- fmt.Println(err)
- }
-
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
- }
- func (c *NmController) Post2208() {
- psnNo := c.GetString("psn_no")
- mdtrtId := c.GetString("mdtrt_id")
- setlId := c.GetString("setl_id")
- org_name := c.GetString("org_name")
- doctor := c.GetString("doctor")
- secret_key := c.GetString("secret_key")
- fixmedins_code := c.GetString("fixmedins_code")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- url := c.GetString("url")
- ak := c.GetString("ak")
- cainfo := c.GetString("cainfo")
-
- result, request_log := service.Nmyb2208(psnNo, mdtrtId, setlId, org_name, doctor, secret_key, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, url, ak, cainfo)
- saveJsLog(result, request_log, "2208", "退费", org_name)
- fmt.Println(request_log)
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- fmt.Println(dat)
- } else {
- fmt.Println(err)
- }
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- fmt.Println(dat2)
- } else {
- fmt.Println(err)
- }
-
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
- }
- func (c *NmController) Post2503() {
- psnNo := c.GetString("psn_no")
- insutype := c.GetString("insutype")
- opera := c.GetString("opera")
- org_name := c.GetString("org_name")
- doctor := c.GetString("doctor")
- doctor_id := c.GetString("doctor_id")
- secret_key := c.GetString("secret_key")
- fixmedins_code := c.GetString("fixmedins_code")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- sick_name := c.GetString("sick_name")
- sick_code := c.GetString("sick_code")
- start_time := c.GetString("start_time")
- end_time := c.GetString("end_time")
- check_time := c.GetString("check_time")
- hospital_name := c.GetString("hospital_name")
- hospital_code := c.GetString("hospital_code")
-
- result := service.Nmyb2503(psnNo, insutype, org_name, opera, doctor, fixmedins_code, doctor_id, insuplc_admdvs, mdtrtarea_admvs, secret_key, sick_name, sick_code, start_time, end_time, check_time, hospital_code, hospital_name)
-
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- fmt.Println(dat)
- } else {
- fmt.Println(err)
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- })
- }
-
- // func (c *NmController) GetNewELeInfo() {
- // token := c.GetString("token")
- // user_name := c.GetString("user_name")
- // id_card_no := c.GetString("id_card_no")
- //
- // result, _ := service.Gdyb1101ForEleCert("赤峰费森血液透析中心", "关学丽", "H15049901371", "150499", "150499", "MSDBYGxXm1Mtyi3PtOUB7n1ktcxwyW57", token, user_name, id_card_no)
- // var dat map[string]interface{}
- // if err := json.Unmarshal([]byte(result), &dat); err == nil {
- // fmt.Println(dat)
- // } else {
- // fmt.Println(err)
- // }
- // userJSONBytes, _ := json.Marshal(dat)
- // var res ResultTwo
- //
- // if err := json.Unmarshal(userJSONBytes, &res); err != nil {
- // utils.ErrorLog("解析失败:%v", err)
- // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
- // return
- // }
- //
- // infocode, _ := strconv.ParseInt(res.Infcode, 10, 64)
- // if infocode == 0 {
- // data := make(map[string]interface{})
- // data["token"] = token
- // data["result"] = dat
- // var req *http.Request
- // bytesData, _ := json.Marshal(data)
- // req, _ = http.NewRequest("POST", "http://172.16.13.253:9532/"+"api/ele/info", bytes.NewReader(bytesData))
- // client := &http.Client{}
- // resp, _ := client.Do(req)
- // defer resp.Body.Close()
- // body, ioErr := ioutil.ReadAll(resp.Body)
- // if ioErr != nil {
- // utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
- // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
- // return
- // }
- // var respJSON map[string]interface{}
- // if err := json.Unmarshal([]byte(body), &respJSON); err != nil {
- // utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
- // return
- // }
- // c.ServeSuccessJSON(map[string]interface{}{
- // "msg": "成功",
- // })
- //
- // }
- // }
- func (c *NmController) GetToken() {
- token := c.GetString("token")
- results := strings.Split(token, "-")
- fmt.Println(token)
- result_code := results[0]
- result_info := results[1]
- if result_code == "0000" {
-
- var ele2 ELeData2
- err := json.Unmarshal([]byte(result_info), &ele2)
- if err != nil {
- utils.ErrorLog("解析失败:%v", err)
- }
-
- if ele2.Code != -2 {
- var ele ELeData
- err := json.Unmarshal([]byte(result_info), &ele)
- if err != nil {
- utils.ErrorLog("解析失败:%v", err)
- }
- token := ele.Data.EcToken
-
- if len(token) > 0 {
- data := make(map[string]interface{})
- data["token"] = token
- data["id_card_no"] = ele.Data.IdNo
- fmt.Println(data)
- var req *http.Request
- fmt.Println(req)
-
- bytesData, _ := json.Marshal(data)
- fmt.Println(bytesData)
-
- req, _ = http.NewRequest("POST", "http://172.16.13.253:9532/"+"api/token/get", bytes.NewReader(bytesData))
- fmt.Println(req)
- client := &http.Client{}
- resp, _ := client.Do(req)
- fmt.Println(resp)
-
- defer resp.Body.Close()
- body, ioErr := ioutil.ReadAll(resp.Body)
- fmt.Println(resp.Body)
- fmt.Println(body)
- fmt.Println(ioErr)
- if ioErr != nil {
- utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
- return
- }
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(body), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
- return
- }
-
- } else {
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
- return
- }
-
- }
-
- } else {
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
- return
- }
-
- }
-
- type ReadCardResult struct {
- Output struct {
- CardInfo string `json:"cardInfo"`
- RegionCode string `json:"regionCode"`
- } `json:"output"`
- Code string `json:"CODE"`
- ErrMsg string `json:"ERRMSG"`
- }
-
- type ELeData2 struct {
- Code int `json:"code"`
- Message string `json:"message"`
- }
- type ELeData struct {
- Data struct {
- IdNo string `json:"idNo"`
- IdType string `json:"idType"`
- UserName string `json:"userName"`
- EcToken string `json:"ecToken"`
- InsuOrg string `json:"insuOrg"`
- Gender string `json:"gender"`
- Birthday string `json:"birthday"`
- Nationality string `json:"nationality"`
- Email string `json:"email"`
- Extra string `json:"extra"`
- } `json:"data"`
- Code int `json:"code"`
- Message string `json:"message"`
- }
-
- type ResultTwo struct {
- ErrMsg string `json:"err_msg"`
- InfRefmsgid string `json:"inf_refmsgid"`
- Infcode string `json:"infcode"`
- Output struct {
- Baseinfo struct {
- Age float64 `json:"age"`
- Brdy string `json:"brdy"`
- Certno string `json:"certno"`
- Gend string `json:"gend"`
- Naty string `json:"naty"`
- PsnCertType string `json:"psn_cert_type"`
- PsnName string `json:"psn_name"`
- PsnNo string `json:"psn_no"`
- } `json:"baseinfo"`
- Idetinfo []interface{} `json:"idetinfo"`
- Iinfo []struct {
- Balc float64 `json:"balc"`
- CvlservFlag string `json:"cvlserv_flag"`
- EmpName string `json:"emp_name"`
- InsuplcAdmdvs string `json:"insuplc_admdvs"`
- Insutype string `json:"insutype"`
- PausInsuDansuplcAdmdvs string `json:"paus_insu_dansuplc_admdvs"`
- PausInsuDate string `json:"paus_insu_date"`
- PsnInsuDate string `json:"psn_insu_date"`
- PsnInsuStas string `json:"psn_insu_stas"`
- PsnType string `json:"psn_type"`
- } `json:"insuinfo"`
- } `json:"output"`
- RefmsgTime string `json:"refmsg_time"`
- RespondTime string `json:"respond_time"`
- Signtype interface{} `json:"signtype"`
- WarnInfo interface{} `json:"warn_info"`
- }
- type ResultTwo10265 struct {
- ErrMsg string `json:"err_msg"`
- InfRefmsgid string `json:"inf_refmsgid"`
- Infcode string `json:"infcode"`
- Output struct {
- Baseinfo struct {
- Age float64 `json:"age"`
- Brdy string `json:"brdy"`
- Certno string `json:"certno"`
- Gend string `json:"gend"`
- Naty string `json:"naty"`
- PsnCertType string `json:"psn_cert_type"`
- PsnName string `json:"psn_name"`
- PsnNo string `json:"psn_no"`
- } `json:"baseinfo"`
- Idetinfo []interface{} `json:"idetinfo"`
- Iinfo []struct {
- Balc float64 `json:"balc"`
- CvlservFlag string `json:"cvlserv_flag"`
- EmpName string `json:"emp_name"`
- InsuplcAdmdvs string `json:"insuplc_admdvs"`
- Insutype string `json:"insutype"`
- PausInsuDansuplcAdmdvs string `json:"paus_insu_dansuplc_admdvs"`
- PausInsuDate string `json:"paus_insu_date"`
- PsnInsuDate string `json:"psn_insu_date"`
- PsnInsuStas string `json:"psn_insu_stas"`
- PsnType string `json:"psn_type"`
- } `json:"insuinfo"`
- } `json:"output"`
- RefmsgTime string `json:"refmsg_time"`
- RespondTime string `json:"respond_time"`
- Signtype interface{} `json:"signtype"`
- WarnInfo interface{} `json:"warn_info"`
- }
-
- func (c *NmController) Post4101() {
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
- struct4101UserJSONBytes, _ := json.Marshal(respJSON["struct4101"])
- var struct4101 service.Struct4101
- if err := json.Unmarshal(struct4101UserJSONBytes, &struct4101); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
- ppUserJSONBytes, _ := json.Marshal(respJSON["pp"])
- var pp models.PublicParams
- if err := json.Unmarshal(ppUserJSONBytes, &pp); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
- result, _ := service.Gdyb4101fornm(struct4101, pp.SecretKey, pp.FixmedinsName, pp.OpterName, pp.FixmedinsCode, pp.InsuplcAdmdvs, pp.MdtrtareaAdmvs, 0, 0)
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- fmt.Println(dat)
- } else {
- fmt.Println(err)
- }
-
- saveJsLog(result, "", "4101", "上传明细清单", pp.FixmedinsName)
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- })
- }
-
- func (c *NmController) Post5203() {
- fmt.Println("------")
- org_name := c.GetString("org_name")
- doctor := c.GetString("doctor")
- fixmedins_code := c.GetString("fixmedins_code")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- secret_key := c.GetString("secret_key")
- psn_no := c.GetString("psn_no")
- mdtrt_id := c.GetString("mdtrt_id")
- setl_id := c.GetString("setl_id")
- fmt.Println("------")
- bp := models.BaseParams{
- SecretKey: secret_key,
- FixmedinsCode: fixmedins_code,
- InsuplcAdmdvs: insuplc_admdvs,
- MdtrtareaAdmvs: mdtrtarea_admvs,
- OrgName: org_name,
- Doctor: doctor,
- }
- bps := models.BusinessParams{
- PsnNo: psn_no,
- MdtrtId: mdtrt_id,
- SetlId: setl_id,
- }
- result := service.ZHyb5203(bp, bps)
- saveJsLog(result, "", "5203", "结算单", org_name)
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
-
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- })
- }
- func (c *NmController) Post4102() {
- org_name := c.GetString("org_name")
- doctor := c.GetString("doctor")
- fixmedins_code := c.GetString("fixmedins_code")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- secret_key := c.GetString("secret_key")
- psn_no := c.GetString("psn_no")
- mdtrt_id := c.GetString("mdtrt_id")
- setl_id := c.GetString("setl_id")
- stas_type := c.GetString("stas_type")
-
- bp := models.BaseParams{
- SecretKey: secret_key,
- FixmedinsCode: fixmedins_code,
- InsuplcAdmdvs: insuplc_admdvs,
- MdtrtareaAdmvs: mdtrtarea_admvs,
- OrgName: org_name,
- Doctor: doctor,
- }
- bps := models.BusinessParams{
- PsnNo: psn_no,
- MdtrtId: mdtrt_id,
- SetlId: setl_id,
- StasType: stas_type,
- }
- result := service.ZHyb4102(bp, bps)
- saveJsLog(result, "", "4102", "确认结算清单", org_name)
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
-
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- })
- }
- func (c *NmController) Post4103() {
- org_name := c.GetString("org_name")
- doctor := c.GetString("doctor")
- fixmedins_code := c.GetString("fixmedins_code")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- secret_key := c.GetString("secret_key")
- psn_no := c.GetString("psn_no")
- mdtrt_id := c.GetString("mdtrt_id")
- setl_id := c.GetString("setl_id")
- bp := models.BaseParams{
- SecretKey: secret_key,
- FixmedinsCode: fixmedins_code,
- InsuplcAdmdvs: insuplc_admdvs,
- MdtrtareaAdmvs: mdtrtarea_admvs,
- OrgName: org_name,
- Doctor: doctor,
- }
- bps := models.BusinessParams{
- PsnNo: psn_no,
- MdtrtId: mdtrt_id,
- SetlId: setl_id,
- }
- result := service.ZHyb4103(bp, bps)
- result2 := service.ZHyb4104(bp, bps)
-
- saveJsLog(result, "", "4103", "查询结算清单", org_name)
- saveJsLog(result2, "", "4104", "指控结算清单", org_name)
-
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
-
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- })
- }
- func (c *NmController) Post4104() {
- org_name := c.GetString("org_name")
- doctor := c.GetString("doctor")
- fixmedins_code := c.GetString("fixmedins_code")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- secret_key := c.GetString("secret_key")
- psn_no := c.GetString("psn_no")
- mdtrt_id := c.GetString("mdtrt_id")
- setl_id := c.GetString("setl_id")
- bp := models.BaseParams{
- SecretKey: secret_key,
- FixmedinsCode: fixmedins_code,
- InsuplcAdmdvs: insuplc_admdvs,
- MdtrtareaAdmvs: mdtrtarea_admvs,
- OrgName: org_name,
- Doctor: doctor,
- }
- bps := models.BusinessParams{
- PsnNo: psn_no,
- MdtrtId: mdtrt_id,
- SetlId: setl_id,
- }
- result := service.ZHyb4104(bp, bps)
- saveJsLog(result, "", "4104", "质控结算清单结果", org_name)
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
-
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- })
- }
-
- func (c *NmController) Post1101() {
- certNo := c.GetString("cert_no")
- org_name := c.GetString("org_name")
- doctor := c.GetString("doctor")
- fixmedins_code := c.GetString("fixmedins_code")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- secret_key := c.GetString("secret_key")
- id_card_type, _ := c.GetInt64("id_card_type")
- card_sn := c.GetString("card_sn")
- certificates := c.GetString("certificates")
- name := c.GetString("name")
- certificate, _ := strconv.ParseInt(certificates, 10, 64)
- result, request_log, result_log := service.ZHGdyb1101(certNo, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type, card_sn, certificate, name, 0)
-
- saveJsLog(result_log, request_log, "1101", "查询个人信息", org_name)
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
-
- } else {
-
- }
-
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
-
- } else {
-
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "log": dat2,
- })
-
- }
-
- func (c *NmController) Post2401() {
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
- userJSONBytes, _ := json.Marshal(respJSON["struct_2401"])
- var struct2401 service.Struct2401
- if err := json.Unmarshal(userJSONBytes, &struct2401); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
- org_name := respJSON["org_name"].(string)
- fixmedins_code := respJSON["fixmedins_code"].(string)
- doctor := respJSON["doctor"].(string)
- insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
- mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
- secret_key := respJSON["secret_key"].(string)
- result, request_log := service.Hbyb2401(struct2401, secret_key, org_name, fixmedins_code, doctor, insuplc_admdvs, mdtrtarea_admvs)
- saveJsLog(result, request_log, "2401", "入院登记", org_name)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
-
- }
-
- func (c *NmController) Post2404() {
- mdtrt_id := c.GetString("mdtrt_id")
- psn_no := c.GetString("psn_no")
- doctor := c.GetString("doctor")
- fixmedins_code := c.GetString("fixmedins_code")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- secret_key := c.GetString("secret_key")
- org_name := c.GetString("org_name")
-
- result, requestLog := service.Hbyb2404(mdtrt_id, psn_no, secret_key, org_name, fixmedins_code, doctor, insuplc_admdvs, mdtrtarea_admvs)
- saveJsLog(result, requestLog, "2404", "入院登记撤销", org_name)
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
- }
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(requestLog), &dat2); err == nil {
- } else {
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "log": dat2,
- })
-
- }
- func (c *NmController) Post2405() {
- mdtrt_id := c.GetString("mdtrt_id")
- psn_no := c.GetString("psn_no")
- doctor := c.GetString("doctor")
- fixmedins_code := c.GetString("fixmedins_code")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- secret_key := c.GetString("secret_key")
- org_name := c.GetString("org_name")
-
- result, requestLog := service.Hb2405(mdtrt_id, psn_no, secret_key, org_name, fixmedins_code, doctor, insuplc_admdvs, mdtrtarea_admvs)
- saveJsLog(result, requestLog, "2405", "出院登记撤销", org_name)
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
- }
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(requestLog), &dat2); err == nil {
- } else {
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "log": dat2,
- })
-
- }
- func (c *NmController) Post2402() {
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
- userJSONBytes, _ := json.Marshal(respJSON["struct_2402"])
- var struct2402 service.Struct2402
- if err := json.Unmarshal(userJSONBytes, &struct2402); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
- org_name := respJSON["org_name"].(string)
- fixmedins_code := respJSON["fixmedins_code"].(string)
- doctor := respJSON["doctor"].(string)
- insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
- mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
- secret_key := respJSON["secret_key"].(string)
- result, request_log := service.Hb2402(struct2402, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code)
- saveJsLog(result, request_log, "2402", "出院", org_name)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(request_log), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
- }
- func (c *NmController) Post2301() {
-
- body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
- var respJSON map[string]interface{}
- if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
- return
- }
- userJSONBytes, _ := json.Marshal(respJSON["customs"])
- var customs []*models.NewCustom
- if err := json.Unmarshal(userJSONBytes, &customs); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- return
- }
-
- number := respJSON["number"].(string)
-
- chrg_bchno := respJSON["chrg_bchno"].(string)
- dept := respJSON["dept"].(string)
- dept_code := respJSON["dept_code"].(string)
- doctor_code := respJSON["doctor_code"].(string)
-
- doctor_name := respJSON["doctor_name"].(string)
- opertor := respJSON["opertor"].(string)
-
- org_name := respJSON["org_name"].(string)
- fixmedins_code := respJSON["fixmedins_code"].(string)
- insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
- mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
- secret_key := respJSON["secret_key"].(string)
- med_type := respJSON["med_type"].(string)
- //med_type := strconv.FormatInt(int64(respJSON["med_type"].(float64)), 10)
- psn_no := respJSON["psn_no"].(string)
-
- result, requestLog := service.Hb2301A(psn_no, number, customs, chrg_bchno, org_name, doctor_name, dept, fixmedins_code, dept_code, doctor_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, med_type, opertor)
- saveJsLog(result, requestLog, "2301", "上传明细", org_name)
-
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(requestLog), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
- }
- func (c *NmController) Post2302() {
- mdtrt_id := c.GetString("mdtrtId")
- psn_no := c.GetString("psn_no")
- number := c.GetString("feedetl_sn")
- doctor := c.GetString("doctor")
- fixmedins_code := c.GetString("fixmedins_code")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- secret_key := c.GetString("secret_key")
- org_name := c.GetString("org_name")
- refund_type, _ := c.GetInt64("refund_type")
-
- result, requestLog := service.Hb2302(psn_no, mdtrt_id, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code, number, refund_type)
- saveJsLog(result, requestLog, "2302", "退明细", org_name)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(requestLog), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
- }
- func (c *NmController) Post2303() {
- mdtrt_id := c.GetString("mdtrt_id")
- psn_no := c.GetString("psn_no")
- chrg_bchno := c.GetString("chrg_bchno")
- cert_no := c.GetString("cert_no")
- insutype_type := c.GetString("insutype_type")
-
- allTotal := c.GetString("total")
- id_card_type, _ := c.GetInt64("id_card_type")
-
- doctor := c.GetString("doctor")
- certificates, _ := c.GetInt64("certificates")
-
- fixmedins_code := c.GetString("fixmedins_code")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- secret_key := c.GetString("secret_key")
- org_name := c.GetString("org_name")
-
- result, src_resquest := service.Hb2303(psn_no, mdtrt_id, chrg_bchno, cert_no, insutype_type, allTotal, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, "0", id_card_type, 0, 0, 0, 0, certificates)
- saveJsLog(result, src_resquest, "2303", "预结算", org_name)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(src_resquest), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
- }
- func (c *NmController) Post2304() {
- mdtrt_id := c.GetString("mdtrt_id")
- psn_no := c.GetString("psn_no")
- chrg_bchno := c.GetString("chrg_bchno")
- cert_no := c.GetString("cert_no")
- insutype_type := c.GetString("insutype_type")
-
- allTotal := c.GetString("total")
- id_card_type, _ := c.GetInt64("id_card_type")
-
- doctor := c.GetString("doctor")
- certificates, _ := c.GetInt64("certificates")
-
- fixmedins_code := c.GetString("fixmedins_code")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- secret_key := c.GetString("secret_key")
- org_name := c.GetString("org_name")
- fapiao_number := c.GetString("fapiao_number")
- acct_used_flag := c.GetString("acct_used_flag")
-
- result, src_resquest := service.Hb2304(psn_no, mdtrt_id, chrg_bchno, cert_no, insutype_type, allTotal, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, "0", id_card_type, 0, 0, 0, 0, certificates, fapiao_number, acct_used_flag)
- saveJsLog(result, src_resquest, "2304", "住院结算", org_name)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(src_resquest), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
- }
- func (c *NmController) Post2305() {
- mdtrt_id := c.GetString("mdtrt_id")
- psn_no := c.GetString("psn_no")
- doctor := c.GetString("doctor")
- setl_id := c.GetString("setl_id")
-
- fixmedins_code := c.GetString("fixmedins_code")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- secret_key := c.GetString("secret_key")
- org_name := c.GetString("org_name")
-
- result, requestLog := service.Hb2305(psn_no, mdtrt_id, setl_id, org_name, doctor, secret_key, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
- saveJsLog(result, requestLog, "2305", "退费", org_name)
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(requestLog), &dat2); err == nil {
- } else {
- }
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- } else {
- }
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- "request_log": dat2,
- })
- }
-
- func (c *NmController) Get2503() {
-
- }
-
- func (c *NmController) ReadCard() {
- fixmedins_code := c.GetString("fixmedins_code")
- secret_key := c.GetString("secret_key")
- org_name := c.GetString("org_name")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- id_card_type := c.GetString("id_card_type")
- operator_id := c.GetString("operator_id")
- operator := c.GetString("operator")
- is_settle := c.GetString("is_settle")
-
- switch id_card_type {
- case "1":
- if initFlag == 0 {
- c.TestGetBasBaseInit()
- }
- pBusiCardInfo := c.GetBasBaseInfo(fixmedins_code, mdtrtarea_admvs, operator, operator_id, org_name)
- basStr := Remove0000(pBusiCardInfo)
-
- if len(basStr) == 0 {
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
- return
- }
-
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(basStr), &dat2); err == nil {
- fmt.Println(dat2)
- } else {
- fmt.Println(err)
- }
-
- userJSONBytes, _ := json.Marshal(dat2)
- var res ReadCardResult
- if err := json.Unmarshal(userJSONBytes, &res); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
- return
- }
-
- fmt.Println(basStr)
- bas := strings.Split(res.Output.CardInfo, "|")
- basNumber := bas[1]
- fmt.Println(basNumber)
- card_sn := bas[3]
- fmt.Println(card_sn)
- cardNumber := bas[2]
- name := bas[4]
-
- result := service.Gdyb1101G(basNumber, org_name, operator, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, 1, card_sn, 1, name, cardNumber)
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- fmt.Println(dat)
- } else {
- fmt.Println(err)
- }
-
- userJSONBytes2, _ := json.Marshal(dat)
- var res2 ResultTwo
- if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
- return
- }
- infocode, _ := strconv.ParseInt(res2.Infcode, 10, 64)
-
- if infocode == 0 {
- c.ServeSuccessJSON(map[string]interface{}{
- "status": "0",
- "card_info": res.Output.CardInfo,
- "busi_card_info": pBusiCardInfo,
- "result": res2,
- "type": "1",
- })
-
- } else {
- c.ServeSuccessJSON(map[string]interface{}{
- "status": "-1",
- })
- }
-
- break
- case "4": //电子凭证
- //c.GetELeInfo()
- var result_info string
- if len(is_settle) > 0 {
- _, result_info = c.GetELeInfo(fixmedins_code, operator_id, operator)
- } else {
- _, result_info = c.GetELeInfoThree(fixmedins_code, operator_id, operator)
- }
- //if result_code == "0000" {
- var ele ELeData
- err := json.Unmarshal([]byte(result_info), &ele)
- if err != nil {
- utils.ErrorLog("解析失败:%v", err)
- }
- token := ele.Data.EcToken
- fmt.Println(token)
- if len(token) > 0 {
- result, _ := service.Gdyb1101ForEleCert(org_name, operator, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, token, ele.Data.UserName, ele.Data.IdNo)
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- fmt.Println(dat)
- } else {
- fmt.Println(err)
- }
- userJSONBytes, _ := json.Marshal(dat)
- var res ResultTwo
- if err := json.Unmarshal(userJSONBytes, &res); err != nil {
- utils.ErrorLog("解析失败:%v", err)
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
- return
- }
-
- infocode, _ := strconv.ParseInt(res.Infcode, 10, 64)
-
- if infocode == 0 {
- c.ServeSuccessJSON(map[string]interface{}{
- "status": "0",
- "card_info": result_info,
- "busi_card_info": result_info,
- "token": token,
- "result": dat,
- })
- } else {
- c.ServeSuccessJSON(map[string]interface{}{
- "status": "-1",
- })
-
- }
- } else {
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
- return
- }
-
- break
- case "5": //电子凭证
- //c.GetELeInfoTwo(fixmedins_code, operator_id, operator)
- //_, pBusiCardInfo := c.GetELeInfoTwo(fixmedins_code, operator_id, operator)
-
- //var ele ELeData
- //err := json.Unmarshal([]byte(pBusiCardInfo), &ele)
- //if err != nil {
- // utils.ErrorLog("解析失败:%v", err)
- //}
- //token := ele.Data.EcToken
- //fmt.Println(token)
- //if len(token) > 0 {
- // result, _ := service.Gdyb1101ForEleCert(org_name, operator, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, token, ele.Data.IdNo, ele.Data.UserName)
- // var dat map[string]interface{}
- // if err := json.Unmarshal([]byte(result), &dat); err == nil {
- // fmt.Println(dat)
- // } else {
- // fmt.Println(err)
- // }
- // userJSONBytes, _ := json.Marshal(dat)
- // var res ResultTwo
- // if err := json.Unmarshal(userJSONBytes, &res); err != nil {
- // utils.ErrorLog("解析失败:%v", err)
- // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
- // return
- // }
- //
- // infocode, _ := strconv.ParseInt(res.Infcode, 10, 64)
- //
- // if infocode == 0 {
- //
- // c.ServeSuccessJSON(map[string]interface{}{
- // "status": "0",
- // "card_info": pBusiCardInfo,
- // "busi_card_info": pBusiCardInfo,
- // "token": token,
- // "result": dat,
- // })
- //
- // } else {
- // c.ServeSuccessJSON(map[string]interface{}{
- // "status": "-1",
- // })
- //
- // }
- //} else {
- // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
- // return
- //}
- //break
-
- }
-
- }
-
- var initFlag int64 = 0
-
- func (c *NmController) GetELeInfoTwo(code string, operator_id string, operator_name string) (string, string) {
- DllDef := syscall.MustLoadDLL("NationECCode.dll")
- readCard := DllDef.MustFindProc("NationEcTrans")
- fmt.Println(readCard)
- fmt.Println("!!!!!")
- pBusiCardInfo := make([]byte, 1024*10)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputData["orgId"] = code
- inputData["businessType"] = "01101"
- inputData["operatorId"] = operator_id
- inputData["operatorName"] = operator_name
- inputData["officeId"] = "001"
- inputData["officeName"] = "血透室"
- inputData["deviceType"] = ""
- input["data"] = inputData
- input["orgId"] = code
- input["transType"] = "ec.query"
-
- bytesData, _ := json.Marshal(input)
- //gdyb_url := beego.AppConfig.String("gdyb_url")
- fmt.Println(string(bytesData))
- url := "http://10.38.22.15:8081" + "/localcfc/api/hsecfc/localQrCodeQuery"
- ret2, aa, bb := readCard.Call(StrPtr(url), (uintptr)(unsafe.Pointer(&bytesData[0])), (uintptr)(unsafe.Pointer(&pBusiCardInfo[0])))
- fmt.Println(aa)
- fmt.Println(bb)
-
- fmt.Println(ret2)
- fmt.Println(DeleteExtraSpace(string(pBusiCardInfo)))
- fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pBusiCardInfo)), "gbk", "utf-8"))
- if ret2 != 0 {
- return "", ""
- }
- return DeleteExtraSpace(""), DeleteExtraSpace(string(pBusiCardInfo))
- }
-
- func (c *NmController) TestGetBasBaseInit() {
- DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")
- Iinit := DllDef.MustFindProc("Init")
- //miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
- str := make([]byte, 2048)
- inputData := make(map[string]interface{})
- inputData["IP"] = "tyjk.nm.hsip.gov.cn"
- inputData["PORT"] = 8090
- inputData["TIMEOUT"] = 180
- inputData["LOG_PATH"] = "C:\\log\\"
- //inputData["SFZ_DRIVER_TYPE"] = 0
- inputData["URL"] = "/uif-hsaf-med-api/api/medical/service"
-
- bytesData, _ := json.Marshal(inputData)
- fmt.Println(inputData)
- fmt.Println(bytesData)
-
- ret, _, err := Iinit.Call((uintptr)(unsafe.Pointer(&bytesData[0])), (uintptr)(unsafe.Pointer(&str[0])))
- if ret != 0 {
- fmt.Println("SSCard的报错原因:", err)
- fmt.Println("SSCard的运算结果为:", ret)
- fmt.Println("SSCard的返回结果为:", string(str))
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
- return
- }
- fmt.Println("SSCard的返回结果为:", string(str))
-
- result := int(ret)
- fmt.Println("SSCard的运算结果为1:", result)
- //initFlag = 1
- return
- }
- func (c *NmController) GetSFZBaseInfo() string {
- DllDef := syscall.MustLoadDLL("SSCard.dll")
- readCard := DllDef.MustFindProc("ReadSFZ")
- if readCard == nil {
- fmt.Println("readcard is nil")
- readCard = DllDef.MustFindProc("ReadSFZ")
- }
-
- str := make([]byte, 256)
- str1 := make([]byte, 256)
- r, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&str[0])), IntPtr(1024), (uintptr)(unsafe.Pointer(&str1[0])), IntPtr(1024))
-
- fmt.Println(r)
- return string(str)
- }
- func (c *NmController) GetBasBaseInfo(fixmedins_code string, mdtrtarea_admvs string, opter_name string, opter_id string, fixmedins_name string) string {
- DllDef := syscall.MustLoadDLL("HeaSecReadInfo.dll")
- readCard := DllDef.MustFindProc("ReadCardBas")
- fmt.Println(readCard)
- fmt.Println("!!!!!")
-
- month := time.Unix(1557042972, 0).Format("1")
- year := time.Now().Format("2006")
- month = time.Now().Format("01")
- day := time.Now().Format("02")
-
- hour := time.Now().Format("15")
- min := time.Now().Format("04")
- sec := time.Now().Format("05")
-
- msec := time.Now().Format("000")
- timestamp := time.Now().Unix()
-
- tempTime := time.Unix(timestamp, 0)
- //timeFormat := tempTime.Format("20060102150405")
- timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
- //randNum := rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(10000)
-
- inputData := make(map[string]interface{})
- inputData["infno"] = "1199"
- //inputData["msgid"] = "7021"
- inputData["msgid"] = fixmedins_code + year + month + day + hour + min + sec + msec + "0" // 发送方报文 ID
- inputData["mdtrtarea_admvs"] = mdtrtarea_admvs
- inputData["insuplc_admdvs"] = "" // 发送方报文 ID
- // 发送方报文 ID
- inputData["recer_sys_code"] = "01"
- inputData["dev_no"] = ""
- inputData["dev_safe_info"] = ""
- inputData["cainfo"] = ""
- inputData["signtype"] = "SM3"
- inputData["infver"] = "V1.0"
- inputData["opter_type"] = "1"
- inputData["opter"] = opter_id
- inputData["opter_name"] = opter_name
- inputData["inf_time"] = timeFormatOne
- inputData["fixmedins_code"] = fixmedins_code
- inputData["fixmedins_name"] = fixmedins_name
- inputData["sign_no"] = ""
-
- bytesData, _ := json.Marshal(inputData)
- fmt.Println(string(bytesData))
- pBusiCardInfo := make([]byte, 8192)
- ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&bytesData[0])), (uintptr)(unsafe.Pointer(&pBusiCardInfo[0])))
- fmt.Println(ret2)
- fmt.Println(DeleteExtraSpace(string(pBusiCardInfo)))
- fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pBusiCardInfo)), "gbk", "utf-8"))
- if ret2 != 0 {
- return ""
- }
- return DeleteExtraSpace(string(pBusiCardInfo))
- }
- func (c *NmController) GetELeInfo(code string, operator_id string, operator_name string) (string, string) {
- // WebSocket服务器地址
- serverURL := "ws://127.0.0.1:8899"
-
- // 解析WebSocket服务器地址
- u, err := url.Parse(serverURL)
- if err != nil {
- log.Fatal(err)
- }
-
- // 建立WebSocket连接
- conn, _, err := websocket.DefaultDialer.Dial(u.String(), nil)
- if err != nil {
- log.Fatal(err)
- }
- defer conn.Close()
- input2 := make(map[string]interface{})
-
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputData["orgId"] = code
- inputData["businessType"] = "01101"
- inputData["operatorId"] = operator_id
- inputData["operatorName"] = operator_name
- inputData["officeId"] = "001"
- inputData["officeName"] = "血透室"
- inputData["deviceType"] = ""
- input["data"] = inputData
- input["orgId"] = code
- input["transType"] = "ec.query"
- input2["url"] = "http://10.38.22.15:8081/localcfc/api/hsecfc/localQrCodeQuery"
- input2["indata"] = input
-
- bytesData, _ := json.Marshal(input2)
- err = conn.WriteMessage(websocket.TextMessage, bytesData)
- if err != nil {
- fmt.Println(err)
- }
-
- // 接收消息
- _, receivedMessage, err := conn.ReadMessage()
- if err != nil {
- fmt.Println(err)
- }
-
- return "", string(receivedMessage)
- }
- func (c *NmController) GetELeInfoThree(code string, operator_id string, operator_name string) (string, string) {
- // WebSocket服务器地址
- serverURL := "ws://127.0.0.1:8899"
-
- // 解析WebSocket服务器地址
- u, err := url.Parse(serverURL)
- if err != nil {
- log.Fatal(err)
- }
-
- // 建立WebSocket连接
- conn, _, err := websocket.DefaultDialer.Dial(u.String(), nil)
- if err != nil {
- log.Fatal(err)
- }
- defer conn.Close()
- input2 := make(map[string]interface{})
-
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputData["orgId"] = code
- inputData["businessType"] = "01301"
- inputData["operatorId"] = operator_id
- inputData["operatorName"] = operator_name
- inputData["officeId"] = "001"
- inputData["officeName"] = "血透室"
- inputData["deviceType"] = ""
- input["data"] = inputData
- input["orgId"] = code
- input["transType"] = "ec.query"
- input2["url"] = "http://10.38.22.15:8081/localcfc/api/hsecfc/localQrCodeQuery"
- input2["indata"] = input
-
- bytesData, _ := json.Marshal(input2)
- err = conn.WriteMessage(websocket.TextMessage, bytesData)
- if err != nil {
- fmt.Println(err)
- }
-
- // 接收消息
- _, receivedMessage, err := conn.ReadMessage()
- if err != nil {
- fmt.Println(err)
- }
-
- return "", string(receivedMessage)
- }
-
- func IntPtr(n int) uintptr {
- return uintptr(n)
- }
- func StrPtr(s string) uintptr {
- return uintptr(unsafe.Pointer(syscall.StringBytePtr(s)))
- }
-
- type Charset string
-
- const (
- UTF8 = Charset("UTF-8")
- GB18030 = Charset("GB18030")
- )
-
- func ConvertToString(src string, srcCode string, tagCode string) string {
- srcCoder := mahonia.NewDecoder(srcCode)
- srcResult := srcCoder.ConvertString(src)
- tagCoder := mahonia.NewDecoder(tagCode)
- _, cdata, _ := tagCoder.Translate([]byte(srcResult), true)
- result := string(cdata)
- return result
- }
- func DeleteExtraSpace(s string) string {
- //删除字符串中的多余空格,有多个空格时,仅保留一个空格
- s1 := strings.Replace(s, " ", " ", -1) //替换tab为空格
- regstr := "\\s{2,}" //两个及两个以上空格的正则表达式
- reg, _ := regexp.Compile(regstr) //编译正则表达式
- s2 := make([]byte, len(s1)) //定义字符数组切片
- copy(s2, s1) //将字符串复制到切片
- spc_index := reg.FindStringIndex(string(s2)) //在字符串中搜索
- for len(spc_index) > 0 { //找到适配项
- s2 = append(s2[:spc_index[0]+1], s2[spc_index[1]:]...) //删除多余空格
- spc_index = reg.FindStringIndex(string(s2)) //继续在字符串中搜索
- }
- return string(s2)
- }
- func Remove0000(s string) string {
- str := make([]rune, 0, len(s))
- for _, v := range []rune(s) {
- if v == 0 {
- continue
- }
- str = append(str, v)
- }
- return string(str)
- }
- func saveJsLog(result string, request string, infno string, desc string, org_name string) {
-
- //org_id, _ := beego.AppConfig.Int64("org_id")
- //miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
- dir := org_name + "日志"
- utils.Mkdir(dir)
- month := time.Unix(1557042972, 0).Format("1")
- year := time.Now().Format("2006")
- month = time.Now().Format("01")
- day := time.Now().Format("02")
- hour := time.Now().Format("15")
- min := time.Now().Format("04")
- sec := time.Now().Format("05")
-
- result_time := year + "-" + month + "-" + day + " " + hour + ":" + min + ":" + sec
-
- file := org_name + "_" + year + month + day + "_log"
- file_name := file + ".txt"
- file_path := org_name + "日志" + "/" + file_name
- exist, _ := utils.PathExists(file_path)
- if exist { //存在
- fmt.Println("存在")
- f, err := os.OpenFile(file_path, os.O_WRONLY, 0644)
- if err != nil {
- fmt.Println("read fail")
- }
- content := "\r\n" + "\r\n" + "\r\n" + result_time + " " + "【 " + desc + infno + "入参" + " 】:" + "\r\n" + request + "\r\n" + result_time + " " + "【 " + desc + infno + "出参" + " 】:" + "\r\n" + result
- n, _ := f.Seek(0, 2)
- _, err = f.WriteAt([]byte(content), n)
-
- } else { //不存在
- fmt.Println("文件不存在,创建文件")
- f, err := os.Create(org_name + "日志" + "/" + file_name)
- defer f.Close()
- if err != nil {
- } else {
- _, err = f.Write([]byte("记录日志"))
- }
- }
-
- }
-
- func (c *NmController) Get3201() {
- insutype := c.GetString("insutype")
- clrType := c.GetString("clr_type")
- setlOptins := c.GetString("setl_optins")
- stmtBegndate := c.GetString("stmt_begndate")
- stmtEnddate := c.GetString("stm_enddate")
- medfeeSumamt, _ := c.GetFloat("medfee_sumamt", 0)
- fundPaySumamt, _ := c.GetFloat("fund_pay_sumamt", 0)
- acctPay, _ := c.GetFloat("acct_pay", 0)
- fixmedinsSetlCnt, _ := c.GetInt64("fixmedins_setl_cnt", 0)
- fixmedins_code := c.GetString("fixmedins_code")
- insuplc_admdvs := c.GetString("insuplc_admdvs")
- mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
- secret_key := c.GetString("secret_key")
- org_name := c.GetString("org_name")
- doctor := c.GetString("doctor")
-
- baseParams := models.BaseParams{
- SecretKey: secret_key,
- FixmedinsCode: fixmedins_code,
- InsuplcAdmdvs: insuplc_admdvs,
- MdtrtareaAdmvs: mdtrtarea_admvs,
- OrgName: org_name,
- Doctor: doctor,
- }
- businessParams := models.BusinessParams{
- Insutype: insutype,
- ClrType: clrType,
- SetlOptins: setlOptins,
- StmtBegndate: stmtBegndate,
- StmtEnddate: stmtEnddate,
- MedfeeSumamt: medfeeSumamt,
- FundPaySumamt: fundPaySumamt,
- AcctPay: acctPay,
- FixmedinsSetlCnt: fixmedinsSetlCnt,
- }
- result := service.Gdyb3201(baseParams, businessParams, 0)
- saveJsLog(result, "", "3201", "对总账", org_name)
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- fmt.Println(dat)
- } else {
- fmt.Println(err)
- }
-
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- })
- }
- func (c *NmController) Get2601() {
- result := service.Gdyb26011("150000CFSJM100000100135084", "H15049901371202210111721190000", "2305", "赤峰费森血液透析中心", "李彩星", "H15049901371", "150402", "150499", "MSDBYGxXm1Mtyi3PtOUB7n1ktcxwyW57\n")
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
- fmt.Println(dat)
- } else {
- fmt.Println(err)
- }
- result2 := service.Gdyb26011("150000CFSJM100000100135084", "H15049901371202209281143070000", "2304", "赤峰费森血液透析中心", "李彩星", "H15049901371", "150402", "150499", "MSDBYGxXm1Mtyi3PtOUB7n1ktcxwyW57\n")
- var dat2 map[string]interface{}
- if err := json.Unmarshal([]byte(result2), &dat2); err == nil {
- fmt.Println(dat2)
- } else {
- fmt.Println(err)
- }
-
- c.ServeSuccessJSON(map[string]interface{}{
- "pre": dat,
- })
- }
- func ConvertByte2String(byte []byte, charset Charset) string {
-
- var str string
- switch charset {
- case GB18030:
- decodeBytes, _ := simplifiedchinese.GB18030.NewDecoder().Bytes(byte)
- str = string(decodeBytes)
- case UTF8:
- fallthrough
- default:
- str = string(byte)
- }
-
- return str
- }
|