pbl.js 263 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697
  1. // ROUTES FOR OUR APIselectClassStudent
  2. // =============================================================================
  3. var express = require("express");
  4. var request = require("request");
  5. var bcrypt = require("bcryptjs");
  6. var router = express.Router(); // get an instance of the express Router
  7. const querystring = require("querystring");
  8. var mysql = require("./mysql");
  9. // const _mysqlLabor = ["123.58.32.151", "pbl"]; //edu數據庫信息
  10. // const _mysqluser = ["123.58.32.151", "cocorobouser"]; //用户数据库信息
  11. // const _getmysqlLabor = ["123.58.32.152", "pbl"]; //edu數據庫信息
  12. // const _getmysqluser = ["123.58.32.152", "cocorobouser"]; //edu數據庫信息
  13. const _mysqlLabor = ["172.16.12.5", "pbl"]; //edu數據庫信息
  14. const _mysqluser = ["172.16.12.5", "cocorobouser"]; //edu數據庫信息
  15. // const _getmysqlLabor = ["172.16.12.5", "pbl"]; //edu數據庫信息
  16. // const _getmysqluser = ["172.16.12.5", "cocorobouser"]; //edu數據庫信息
  17. const _getmysqlLabor2 = ["172.16.12.7", "pbl"]; //edu數據庫信息
  18. const _getmysqlLabor = ["172.16.12.7", "pbl"]; //edu數據庫信息
  19. const _getmysqluser = ["172.16.12.7", "cocorobouser"]; //edu數據庫信息
  20. var crypto = require("crypto");
  21. var https = require("https");
  22. const { Pool } = require('pg');
  23. const axios = require('axios');
  24. const pool = new Pool({
  25. user: 'cocorobo',
  26. host: '34.228.204.21',
  27. database: 'cocorobo-postgres',
  28. password: 'cocorobo',
  29. port: 5433,
  30. max: 20000, // 设置最大连接数
  31. idleTimeoutMillis: 30000 // 设置空闲连接超时时间
  32. });
  33. async function calculateVectors(content) {
  34. try {
  35. const response = await axios.post('http://34.228.204.21:11434/api/embeddings', {
  36. "model": "smartcreation/bge-large-zh-v1.5",
  37. "prompt": `${content}`
  38. });
  39. const contentVector = response.data.embedding;
  40. return contentVector;
  41. } catch (error) {
  42. console.error('Error calculating vectors:', content);
  43. return null;
  44. }
  45. }
  46. async function findMatchingContents(discipline, content) {
  47. const contentVector = await calculateVectors(content);
  48. const formattedContentVector = contentVector.length > 0 ? `[` + contentVector.join(', ') + `]` : null;
  49. const client = await pool.connect();
  50. try {
  51. // 使用余弦相似度进行内容向量匹配
  52. const query = `
  53. SELECT title, id, content, file_url,
  54. 1 - (content_vector <#> $1::vector) AS contentSimilarity
  55. FROM (select file_url, title, id, content, content_vector from knowledgefiles as a where top_dir_id in (select id from directory_files where $2 = '' or folder_name = ANY(string_to_array($2, ',')))) as a
  56. ORDER BY contentSimilarity DESC
  57. LIMIT 5;
  58. `;
  59. const result = await client.query(query, [formattedContentVector, discipline]);
  60. /*
  61. console.log(result.rows);
  62. // 将查询结果转换为匹配对象
  63. const matches = result.rows.map(row => ({
  64. id: row.id,
  65. contentSimilarity: row.contentsimilarity
  66. }));
  67. console.log(matches);
  68. */
  69. return result.rows; // 返回匹配结果
  70. } catch (error) {
  71. console.error('Error finding matching contents:', error);
  72. return [];
  73. } finally {
  74. client.release(); // 确保释放数据库连接
  75. }
  76. }
  77. async function findMatchingContentsPage(discipline, content, page) {
  78. const contentVector = await calculateVectors(content);
  79. const formattedContentVector = contentVector.length > 0 ? `[` + contentVector.join(', ') + `]` : null;
  80. const offset = ((page || 1) - 1) * 5;
  81. const client = await pool.connect();
  82. try {
  83. // 使用余弦相似度进行内容向量匹配
  84. const query = `
  85. SELECT title, id, content, file_url,
  86. 1 - (content_vector <#> $1::vector) AS contentSimilarity
  87. FROM (select file_url, title, id, content, content_vector from knowledgefiles as a where top_dir_id in (select id from directory_files where $2 = '' or folder_name = ANY(string_to_array($2, ',')))) as a
  88. ORDER BY contentSimilarity DESC
  89. LIMIT 5 OFFSET $3;
  90. `;
  91. const result = await client.query(query, [formattedContentVector, discipline, offset]);
  92. return result.rows; // 返回匹配结果
  93. } catch (error) {
  94. console.error('Error finding matching contents:', error);
  95. return [];
  96. } finally {
  97. client.release(); // 确保释放数据库连接
  98. }
  99. }
  100. /*检索文件*/
  101. router.route("/findMatchingContents").all(async (req, res, next) => {
  102. var json = queryString(req.url);
  103. console.log(json["type"], json["string"])
  104. const titleMatches = await findMatchingContents(json["type"], json["string"]);
  105. res.end(JSON.stringify(titleMatches));
  106. });
  107. /*检索文件*/
  108. router.route("/findMatchingContentsPage").all(async (req, res, next) => {
  109. var json = queryString(req.url);
  110. console.log(json["type"], json["string"])
  111. const titleMatches = await findMatchingContentsPage(json["type"], json["string"], json["page"]);
  112. res.end(JSON.stringify(titleMatches));
  113. });
  114. //統壹處理區域
  115. router.use(async function(req, res, next) {
  116. await asynnext(req, res, next);
  117. //// make sure we go to the next routes and don't stop here
  118. //res.end("");
  119. });
  120. /**
  121. * @des 參數解釋同上
  122. */
  123. function asynnext(req, res, next) {
  124. //異步處理
  125. return new Promise(async(resolve, reject) => {
  126. next();
  127. //resolve(true);aa
  128. });
  129. }
  130. /*測試*/
  131. router.route("/a").all((req, res, next) => {
  132. var json = queryString(req.url);
  133. getmysql(req, res, "a", json["ph"], json["pa"]);
  134. });
  135. router.route("/b").all((req, res, next) => {
  136. var json = queryString(req.url);
  137. getmysql(req, res, "b", json["ph"], json["pa"]);
  138. });
  139. /* 注册接口 */
  140. router.route("/register").post(function(req, res, next) {
  141. //mode的处理
  142. if (req.body[0]) {
  143. // 0 用户名 1 用户密码 2用户身份 3 第三方id(可有可无)
  144. p = Object.values(req.body[0]); //获取用户密码
  145. //没有第三方id的处理
  146. // if (p.length < 4) {
  147. // p.push("")
  148. // }
  149. p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
  150. //密码加密
  151. // bcrypt.hash(p[1], 10, function (err, hash) {
  152. // if (err) {
  153. // return next(err);
  154. // }
  155. // p[1] = hash;
  156. // });
  157. //参数拼接,注册
  158. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "register");
  159. //返回注册用户数据
  160. // mysql.usselect(p, function (ret) {
  161. // res.end(ret);
  162. // });
  163. mysql.usselect(p, function(ret) {
  164. res.end(JSON.stringify(ret));
  165. });
  166. }
  167. });
  168. /*登录接口*/
  169. router.route("/login").all((req, res, next) => {
  170. //mode的处理
  171. if (req.body[0]) {
  172. // 0 用户名 1 用户密码
  173. c = Object.values(req.body[0]); //获取用户密码
  174. p = [c[0]];
  175. // p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
  176. var _password = [c[0]];
  177. _password.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectPassword");
  178. mysql.usselect(_password, function(ret) {
  179. var _ret = ret;
  180. var paJ = _ret[0][0].userpassword;
  181. bcrypt.compare(c[1], paJ, function(err, result) {
  182. // console.log(result)
  183. if (result) {
  184. //参数拼接,登录
  185. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectLogin");
  186. //执行存储过程
  187. mysql.usselect(p, function(ret) {
  188. res.end(JSON.stringify({ status: "1", ...ret }));
  189. });
  190. } else {
  191. res.end(JSON.stringify([{ status: "0" }]));
  192. }
  193. });
  194. });
  195. // console.log(isEqual)
  196. }
  197. });
  198. /*手机登录接口*/
  199. router.route("/phoneLogin").all((req, res, next) => {
  200. //mode的处理
  201. if (req.body[0]) {
  202. // 0 用户名 1 用户密码
  203. c = Object.values(req.body[0]); //获取用户密码
  204. p = [c[0]];
  205. // p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
  206. var _password = [c[0]];
  207. _password.unshift(_mysqluser[0], _mysqluser[1], "selectPassword");
  208. mysql.usselect(_password, function(ret) {
  209. if (ret[0].length) {
  210. var _ret = ret;
  211. var paJ = _ret[0][0].password;
  212. let uid = _ret[0][0].userid;
  213. let duid = [uid];
  214. bcrypt.compare(c[1], paJ, function(err, result) {
  215. // console.log(result)
  216. if (result) {
  217. //参数拼接,登录
  218. duid.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
  219. //执行存储过程
  220. mysql.usselect(duid, function(ret) {
  221. res.end(JSON.stringify({ status: "1", ...ret }));
  222. });
  223. } else {
  224. res.end(JSON.stringify([{ status: "0" }]));
  225. }
  226. });
  227. } else {
  228. res.end(JSON.stringify([{ status: "0" }]));
  229. }
  230. });
  231. // console.log(isEqual)
  232. }
  233. });
  234. // 图片转base64
  235. router.route("/imgToBase64").all((req, res, next) => {
  236. var json = queryString(req.url);
  237. //mode的处理
  238. https.get(json["img"], function(res2) {
  239. var chunks = [];
  240. var size = 0;
  241. res2.on("data", function(chunk) {
  242. chunks.push(chunk);
  243. size += chunk.length; //累加缓冲数据的长度
  244. });
  245. res2.on("end", function(err) {
  246. var data = Buffer.concat(chunks, size);
  247. var base64Img = data.toString("base64");
  248. res.end(JSON.stringify([{ img: `data:image/png;base64,${base64Img}` }]));
  249. });
  250. });
  251. });
  252. router.route("/download").all(async(req, res, next) => {
  253. var json = queryString(req.url);
  254. // 查询文件名和下载链接
  255. const fileName = json["name"];
  256. const link = json["url"];
  257. // 发送下载请求
  258. request.get(link, (err, response) => {
  259. if (err) {
  260. res.status(500).end("Internal Server Error");
  261. return;
  262. }
  263. https.get(link, function(res2) {
  264. var chunks = [];
  265. var size = 0;
  266. res2.on("data", function(chunk) {
  267. chunks.push(chunk);
  268. size += chunk.length; //累加缓冲数据的长度
  269. });
  270. res2.on("end", function(err) {
  271. var data = Buffer.concat(chunks, size);
  272. var base64Img = data.toString("base64");
  273. res.end(JSON.stringify({ response, data }));
  274. });
  275. });
  276. });
  277. });
  278. // 罗湖get
  279. router.route("/luohugetTeacherInfo").all((req, res, next) => {
  280. var json = queryString(req.url);
  281. //mode的处理
  282. https.get("https://web.luohuedu.net/tx/userinfo.aspx?code=" + json['code'], function(res2) {
  283. let data = '';
  284. res2.on("data", function(chunk) {
  285. data += chunk; // 累加获取的数据
  286. });
  287. res2.on("end", function() {
  288. res.end(data); // 将获取的值传参给前端
  289. });
  290. });
  291. });
  292. /*登录接口*/
  293. router.route("/loginRace").all((req, res, next) => {
  294. //mode的处理
  295. if (req.body[0]) {
  296. // 0 用户名 1 用户密码
  297. c = Object.values(req.body[0]); //获取用户密码
  298. p = [c[0]];
  299. // p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
  300. var _password = [c[0]];
  301. _password.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectPasswordRace");
  302. mysql.usselect(_password, function(ret) {
  303. var _ret = ret;
  304. var paJ = _ret[0][0].password;
  305. bcrypt.compare(c[1], paJ, function(err, result) {
  306. // console.log(result)
  307. if (result) {
  308. //参数拼接,登录
  309. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectLoginRace");
  310. //执行存储过程
  311. mysql.usselect(p, function(ret) {
  312. res.end(JSON.stringify({ status: "1", ...ret }));
  313. });
  314. } else {
  315. res.end(JSON.stringify([{ status: "0" }]));
  316. }
  317. });
  318. });
  319. // console.log(isEqual)
  320. }
  321. });
  322. /* 修改密码接口 */
  323. router.route("/updatePassword").post(function(req, res, next) {
  324. //mode的处理
  325. if (req.body[0]) {
  326. let p = [req.body[0].userid];
  327. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "getPassword"); //執行存儲過程
  328. mysql.usselect(p, function(ret) {
  329. var paJ = ret[0][0].password;
  330. var op = bcrypt.hashSync(req.body[0].opassword, bcrypt.genSaltSync(10));
  331. bcrypt.compare(req.body[0].opassword, paJ, function(err, result) {
  332. // console.log(result)
  333. if (result) {
  334. let p2 = [
  335. req.body[0].userid,
  336. bcrypt.hashSync(req.body[0].password, bcrypt.genSaltSync(10)),
  337. ];
  338. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updatePassword"); //執行存儲過程
  339. mysql.usselect(p2, function(ret) {
  340. res.end(JSON.stringify([{ success: 1 }]));
  341. });
  342. } else {
  343. res.end(JSON.stringify([{ success: 0 }]));
  344. }
  345. });
  346. });
  347. }
  348. });
  349. /* 赛事修改密码 */
  350. router.route("/updatePassword1").post(function(req, res, next) {
  351. //mode的处理
  352. if (req.body[0]) {
  353. let p = [req.body[0].userid];
  354. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "getPassword1"); //執行存儲過程
  355. mysql.usselect(p, function(ret) {
  356. var paJ = ret[0][0].password;
  357. var op = bcrypt.hashSync(req.body[0].opassword, bcrypt.genSaltSync(10));
  358. bcrypt.compare(req.body[0].opassword, paJ, function(err, result) {
  359. // console.log(result)
  360. if (result) {
  361. let p2 = [
  362. req.body[0].userid,
  363. bcrypt.hashSync(req.body[0].password, bcrypt.genSaltSync(10)),
  364. ];
  365. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updatePassword1"); //執行存儲過程
  366. mysql.usselect(p2, function(ret) {
  367. res.end(JSON.stringify([{ success: 1 }]));
  368. });
  369. } else {
  370. res.end(JSON.stringify([{ success: 0 }]));
  371. }
  372. });
  373. });
  374. }
  375. });
  376. /* 找寻重复手机号 */
  377. router.route("/findPhone").all((req, res, next) => {
  378. var json = queryString(req.url);
  379. getmysql(req, res, "findPhone", json["un"]);
  380. });
  381. /* 找寻是否有此账号 */
  382. router.route("/findUsername").all((req, res, next) => {
  383. var json = queryString(req.url);
  384. getmysql(req, res, "findUsername", json["un"]);
  385. });
  386. /* 找寻重复邮箱 */
  387. router.route("/findMail").all((req, res, next) => {
  388. var json = queryString(req.url);
  389. usergetmysql(req, res, "findMail", json["un"]);
  390. });
  391. /* 找寻重复学号 */
  392. router.route("/findSid").all((req, res, next) => {
  393. var json = queryString(req.url);
  394. getmysql(req, res, "findSid", json["un"]);
  395. });
  396. /* 新增班级 修1 */
  397. router.route("/insertClass").get((req, res, next) => {
  398. var json = queryString(req.url);
  399. getmysql2(req, res, "insertClass", json["name"], json["oid"], json["uid"]);
  400. });
  401. /* 新增教研室 修1 */
  402. router.route("/insertTeacherOffice").get((req, res, next) => {
  403. var json = queryString(req.url);
  404. getmysql2(req, res, "insertTeacherOffice", json["name"], json["oid"], json["uid"]);
  405. });
  406. /* 新增年级 修1 */
  407. router.route("/insertGrade").get((req, res, next) => {
  408. var json = queryString(req.url);
  409. getmysql2(req, res, "insertGrade", json["name"], json["oid"], json["uid"]);
  410. });
  411. /* 修改班级 修1 */
  412. router.route("/updateClass").get((req, res, next) => {
  413. var json = queryString(req.url);
  414. getmysql2(req, res, "updateClass", json["id"], json["n"], json["oid"]);
  415. });
  416. // 修改教研室 修1
  417. router.route("/updateTeacherOffice").get((req, res, next) => {
  418. var json = queryString(req.url);
  419. getmysql2(req, res, "updateTeacherOffice", json["id"], json["n"], json["oid"]);
  420. });
  421. // 修改教研室 修2
  422. router.route("/updateTeacherOffice2").get((req, res, next) => {
  423. var json = queryString(req.url);
  424. getmysql2(req, res, "updateTeacherOffice2", json["id"], json["n"], json["oid"], json["pid"]);
  425. });
  426. /* 修改年级 修1 */
  427. router.route("/updateGrade").get((req, res, next) => {
  428. var json = queryString(req.url);
  429. getmysql2(req, res, "updateGrade", json["id"], json["n"], json["oid"]);
  430. });
  431. /* 查询班级 */
  432. router.route("/selectClass").all((req, res, next) => {
  433. var json = queryString(req.url);
  434. getmysql(req, res, "selectClass", json["cu"], json["oid"], json["cn"], json["page"], 10);
  435. });
  436. // 教研室查询
  437. router.route("/selectTeacherOffice").all((req, res, next) => {
  438. var json = queryString(req.url);
  439. getmysql(req, res, "selectTeacherOffice", json["cu"], json["oid"], json["cn"], json["page"], 10);
  440. });
  441. /* 查询班级 */
  442. router.route("/selectClass2").all((req, res, next) => {
  443. var json = queryString(req.url);
  444. getmysql(req, res, "selectClass2", json["cid"], json["oid"], json["cn"], json["page"], 10);
  445. });
  446. /* 查询年级 */
  447. router.route("/selectGrade").all((req, res, next) => {
  448. var json = queryString(req.url);
  449. getmysql(req, res, "selectGrade", json["cu"], json["oid"], json["cn"], json["page"], 10);
  450. });
  451. /* 删除1班级 */
  452. router.route("/deleteClass").all((req, res, next) => {
  453. var json = queryString(req.url);
  454. getmysql2(req, res, "deleteClass", json["id"]);
  455. });
  456. /* 删除1年级 */
  457. router.route("/deleteGrade").all((req, res, next) => {
  458. var json = queryString(req.url);
  459. getmysql2(req, res, "deleteGrade", json["id"]);
  460. });
  461. /* 查询学校 */
  462. router.route("/selectOrg").all((req, res, next) => {
  463. var json = queryString(req.url);
  464. getmysql(req, res, "selectOrg");
  465. });
  466. /* 查询组织 */
  467. router.route("/selectorg2").all((req, res, next) => {
  468. var json = queryString(req.url);
  469. getmysql(req, res, "selectorg2");
  470. });
  471. /* 修改学校名称 修1 */
  472. router.route("/updateSN").get((req, res, next) => {
  473. var json = queryString(req.url);
  474. getmysql2(req, res, "updateSchoolName", json["oid"], json["n"]);
  475. });
  476. /* 教师端修改学校名称 修1 */
  477. router.route("/updateSchoolByOrg").get((req, res, next) => {
  478. var json = queryString(req.url);
  479. getmysql2(req, res, "updateSchoolByOrg", json["n"], json["d"], json["id"]);
  480. });
  481. /* 教师端查询未联结学校 */
  482. router.route("/selectNoCSchool").all((req, res, next) => {
  483. var json = queryString(req.url);
  484. getmysql(req, res, "selectNoCSchool");
  485. });
  486. /* 教师端新增或修改联结学校 修1 */
  487. router.route("/addNoSchool").get((req, res, next) => {
  488. var json = queryString(req.url);
  489. getmysql2(req, res, "addNoSchool", json["id"], json["coid"]);
  490. });
  491. /* 新增学生 修1 */
  492. router.route("/insertStudent").get((req, res, next) => {
  493. var json = queryString(req.url);
  494. json["userpassword"] = bcrypt.hashSync(
  495. json["userpassword"],
  496. bcrypt.genSaltSync(10)
  497. );
  498. getmysql2(
  499. req,
  500. res,
  501. "insertStudent",
  502. json["ph"],
  503. json["username"],
  504. json["userpassword"],
  505. json["type"],
  506. json["oid"],
  507. json["tid"],
  508. json["cid"]
  509. );
  510. });
  511. // /* 新增学生 */
  512. // router.route('/iStudent').all((req, res, next) => {
  513. // var json = queryString(req.url);
  514. // json['userpassword'] = bcrypt.hashSync(json['userpassword'], bcrypt.genSaltSync(10))
  515. // getmysql(req, res, "insertStudent", json['ph'], json['username'], json['userpassword'], json['type'], json['oid'], json['tid'], json['cid']);
  516. // });
  517. /* 查询学生 */
  518. router.route("/selectStudent").all((req, res, next) => {
  519. var json = queryString(req.url);
  520. getmysql(
  521. req,
  522. res,
  523. "selectStudent",
  524. json["oid"],
  525. json["cu"],
  526. json["cn"],
  527. json["page"],
  528. 10
  529. );
  530. });
  531. /* ppt根据学校查询学生 */
  532. router.route("/selectStudentByScoolPPt").all((req, res, next) => {
  533. var json = queryString(req.url);
  534. getmysql(req, res, "selectStudentByScoolPPt", json["oid"], json["cid"]);
  535. });
  536. /* 查询学校底下的所有学生 */
  537. router.route("/selectOrgStu").all((req, res, next) => {
  538. var json = queryString(req.url);
  539. getmysql(req, res, "selectOrgStu", json["oid"]);
  540. });
  541. /* 查询学生 */
  542. router.route("/selectStudentAdd").all((req, res, next) => {
  543. var json = queryString(req.url);
  544. getmysql(req, res, "selectStudentAdd", json["oid"], json["cu"], json["cn"]);
  545. });
  546. /* 查询老师 */
  547. router.route("/selectTeacherAdd").all((req, res, next) => {
  548. var json = queryString(req.url);
  549. getmysql(req, res, "selectTeacherAdd", json["oid"], json["cu"], json["cn"]);
  550. });
  551. /* 查询老师 */
  552. router.route("/selectTeacherAdd2").all((req, res, next) => {
  553. var json = queryString(req.url);
  554. getmysql(req, res, "selectTeacherAdd2", json["oid"], json["org"], json["cu"], json["cn"]);
  555. });
  556. /* 查询老师 */
  557. router.route("/selectTeacherAddOrg").all((req, res, next) => {
  558. var json = queryString(req.url);
  559. getmysql(
  560. req,
  561. res,
  562. "selectTeacherAddOrg",
  563. json["oid"],
  564. json["cu"],
  565. json["cn"]
  566. );
  567. });
  568. /* 查询学生 */
  569. router.route("/selectStudentAddOrg").all((req, res, next) => {
  570. var json = queryString(req.url);
  571. getmysql(
  572. req,
  573. res,
  574. "selectStudentAddOrg",
  575. json["oid"],
  576. json["cu"],
  577. json["cn"]
  578. );
  579. });
  580. /* 查询全部用户 */
  581. router.route("/selectUserAddOrg").all((req, res, next) => {
  582. var json = queryString(req.url);
  583. getmysql(req, res, "selectUserAddOrg", json["oid"], json["cu"], json["cn"]);
  584. });
  585. /* 查询全部用户 */
  586. router.route("/selectUserAdd").all((req, res, next) => {
  587. var json = queryString(req.url);
  588. getmysql(req, res, "selectUserAdd", json["oid"], json["cu"], json["cn"]);
  589. });
  590. /* 查询全部用户 */
  591. router.route("/selectUserByOidS").all((req, res, next) => {
  592. var json = queryString(req.url);
  593. getmysql(
  594. req,
  595. res,
  596. "selectUserByOidS",
  597. json["oid"],
  598. json["org"],
  599. json["cu"],
  600. json["cn"]
  601. );
  602. });
  603. /* 查询全部用户 */
  604. router.route("/selectUserByOidS2").all((req, res, next) => {
  605. var json = queryString(req.url);
  606. getmysql(
  607. req,
  608. res,
  609. "selectUserByOidS2",
  610. json["oid"],
  611. json["org"],
  612. json["cu"],
  613. json["cn"],
  614. json["page"],
  615. json["pageSize"]
  616. );
  617. });
  618. /* 查询全部用户 */
  619. router.route("/selectUserByOidS2Studio").all((req, res, next) => {
  620. var json = queryString(req.url);
  621. getmysql(
  622. req,
  623. res,
  624. "selectUserByOidS2Studio",
  625. json["oid"],
  626. json["org"],
  627. json["cu"],
  628. json["cn"],
  629. json["page"],
  630. json["pageSize"]
  631. );
  632. });
  633. /* 查询班级是否有重复 */
  634. router.route("/selectC").all((req, res, next) => {
  635. var json = queryString(req.url);
  636. getmysql(req, res, "selectC", json["className"]);
  637. });
  638. /* 查询学校是否有重复 */
  639. router.route("/selectS").all((req, res, next) => {
  640. var json = queryString(req.url);
  641. getmysql(req, res, "selectS", json["schoolName"]);
  642. });
  643. /* 修改个人信息 */
  644. router.route("/updateUser").all((req, res, next) => {
  645. postmysql(req, res, "updateUser");
  646. });
  647. //查询老师的信息
  648. router.route("/getUser").all((req, res, next) => {
  649. var json = queryString(req.url);
  650. getmysql(req, res, "selectUserDeail", json["uid"]);
  651. });
  652. //查询老师的信息
  653. router.route("/getRaceUser").all((req, res, next) => {
  654. var json = queryString(req.url);
  655. getmysql(req, res, "getRaceUser", json["uid"]);
  656. });
  657. router.route("/selectUser").all((req, res, next) => {
  658. var json = queryString(req.url);
  659. getmysql(req, res, "selectUser", json["userid"]);
  660. });
  661. //查询教师端消息
  662. router.route("/getNewsTeacher").all((req, res, next) => {
  663. var json = queryString(req.url);
  664. getmysql(req, res, "selectNew", json["uid"], json["page"], 10);
  665. });
  666. //查询教师端消息
  667. router.route("/selectNotice").all((req, res, next) => {
  668. var json = queryString(req.url);
  669. getmysql(
  670. req,
  671. res,
  672. "selectNotice",
  673. json["uid"],
  674. json["oid"],
  675. json["org"],
  676. json["page"],
  677. 10
  678. );
  679. });
  680. //查询教师端消息
  681. router.route("/selectNotice2").all((req, res, next) => {
  682. var json = queryString(req.url);
  683. getmysql(req, res, "selectNotice2", json["uid"], json["oid"], json["org"]);
  684. });
  685. //查询教师端消息
  686. router.route("/addNotice").all((req, res, next) => {
  687. postmysql(req, res, "addNotice");
  688. });
  689. //查询教师端消息
  690. router.route("/deleteNotice").all((req, res, next) => {
  691. postmysql(req, res, "deleteNotice");
  692. });
  693. //查询通知详情
  694. router.route("/selectNewDetail").all((req, res, next) => {
  695. var json = queryString(req.url);
  696. getmysql(req, res, "selectNewDetail", json["nid"]);
  697. });
  698. //查出分组分类
  699. router.route("/getGroup").all((req, res, next) => {
  700. getmysql(req, res, "selectGroupTeacher");
  701. });
  702. //查询这个老师底下的学生提交的作业
  703. router.route("/getWorks").all((req, res, next) => {
  704. //已经不用
  705. var json = queryString(req.url);
  706. getmysql(req, res, "selectWorks", json["cn"], json["cid"], json["page"], 10);
  707. });
  708. //查询项目
  709. router.route("/getProject").all((req, res, next) => {
  710. var json = queryString(req.url);
  711. getmysql(
  712. req,
  713. res,
  714. "selectProject",
  715. json["type"],
  716. json["uid"],
  717. json["oid"],
  718. json["cn"],
  719. json["page"],
  720. 10
  721. );
  722. });
  723. //新评价查询项目
  724. router.route("/getProject1").all((req, res, next) => {
  725. //已经不用
  726. var json = queryString(req.url);
  727. getmysql(
  728. req,
  729. res,
  730. "selectProject1",
  731. json["uid"],
  732. json["cid"],
  733. json["eid"],
  734. json["cn"],
  735. json["page"],
  736. 10
  737. );
  738. });
  739. //查询项目
  740. router.route("/getMyProject").all((req, res, next) => {
  741. var json = queryString(req.url);
  742. getmysql(req, res, "selectMyProject", json["uid"], json["page"], 10);
  743. });
  744. //查询项目成员
  745. router.route("/selectProjectStudent").all((req, res, next) => {
  746. var json = queryString(req.url);
  747. getmysql(req, res, "select_student", json["cn"], json["oid"], json["uid"]);
  748. });
  749. //查询Banner列表
  750. router.route("/selectBannerList").all((req, res, next) => {
  751. var json = queryString(req.url);
  752. getmysql(req, res, "selectBannerList", json["page"], 10);
  753. });
  754. //查询Banner列表
  755. router.route("/selectAllBanner").all((req, res, next) => {
  756. var json = queryString(req.url);
  757. getmysql(req, res, "selectAllBanner", json["t"]);
  758. });
  759. //新增Banner
  760. router.route("/insertBannerList").all((req, res, next) => {
  761. postmysql(req, res, "insertBannerList");
  762. });
  763. //删除提交的作业
  764. router.route("/deleteCourseWork").all((req, res, next) => {
  765. postmysql(req, res, "deleteCourseWork");
  766. });
  767. //删除提交的作业
  768. router.route("/deleteCourseWorkTwo").all((req, res, next) => {
  769. postmysql(req, res, "deleteCourseWorkTwo");
  770. });
  771. //删除提交的作业
  772. router.route("/deleteCourseWorkTwo2").all((req, res, next) => {
  773. postmysql(req, res, "deleteCourseWorkTwo2");
  774. });
  775. //查询课程管理导出pdf的数据 ym
  776. router.route("/selectStuCourseReportPdf").all((req, res, next) => {
  777. var json = queryString(req.url);
  778. getmysql(req, res, "selectStuCourseReportPdf", json["cid"], json["uid"], json["cla"]);
  779. });
  780. router.route("/selectStuCourseReportPdfTwo").all((req, res, next) => {
  781. var json = queryString(req.url);
  782. getmysql(req, res, "selectStuCourseReportPdfTwo", json["cid"], json["uid"], json["cla"]);
  783. });
  784. //删除提交的作业
  785. router.route("/deleteCourseWorkS").all((req, res, next) => {
  786. postmysql(req, res, "deleteCourseWorkS");
  787. });
  788. //删除1Banner
  789. router.route("/deleteBannerList").all((req, res, next) => {
  790. var json = queryString(req.url);
  791. getmysql2(req, res, "deleteBannerList", json["id"]);
  792. });
  793. //查询有没有重复的模板
  794. router.route("/selectTipsTemplateBE").all((req, res, next) => {
  795. var json = queryString(req.url);
  796. getmysql(req, res, "selectTipsTemplateBE", json["userid"], json["name"]);
  797. });
  798. router.route("/addTipsTemplate2E").all((req, res, next) => {
  799. postmysql(req, res, "addTipsTemplate2E");
  800. });
  801. //删除提示词模板
  802. router.route("/deleteTipsTemplateE").all((req, res, next) => {
  803. postmysql(req, res, "deleteTipsTemplateE");
  804. });
  805. //查询模板
  806. router.route("/selectTipsTemplateE").all((req, res, next) => {
  807. var json = queryString(req.url);
  808. getmysql(req, res, "selectTipsTemplateE", json["userid"], json["oid"], json["org"], json["type"], json["name"], json["stand"]);
  809. });
  810. //查询模板
  811. router.route("/selectTipsTemplateByIdE").all((req, res, next) => {
  812. var json = queryString(req.url);
  813. getmysql(req, res, "selectTipsTemplateByIdE", json["id"], json["stand"]);
  814. });
  815. //新增提示词
  816. router.route("/addTips").all((req, res, next) => {
  817. postmysql(req, res, "addTips");
  818. });
  819. //查询有没有重复的模板
  820. router.route("/selectTipsTemplateB").all((req, res, next) => {
  821. var json = queryString(req.url);
  822. getmysql(req, res, "selectTipsTemplateB", json["userid"], json["name"]);
  823. });
  824. //保存提示词模板
  825. router.route("/addTipsTemplate").all((req, res, next) => {
  826. postmysql(req, res, "addTipsTemplate");
  827. });
  828. router.route("/addTipsTemplate2").all((req, res, next) => {
  829. postmysql(req, res, "addTipsTemplate2");
  830. });
  831. //删除提示词模板
  832. router.route("/deleteTipsTemplate").all((req, res, next) => {
  833. postmysql(req, res, "deleteTipsTemplate");
  834. });
  835. //查询模板
  836. router.route("/selectTipsTemplate").all((req, res, next) => {
  837. var json = queryString(req.url);
  838. getmysql(req, res, "selectTipsTemplate", json["userid"], json["oid"], json["org"], json["type"], json["name"]);
  839. });
  840. //查询模板
  841. router.route("/selectTipsTemplateById").all((req, res, next) => {
  842. var json = queryString(req.url);
  843. getmysql(req, res, "selectTipsTemplateById", json["id"]);
  844. });
  845. //新增提示词
  846. router.route("/addTipsHK").all((req, res, next) => {
  847. postmysql(req, res, "addTipsHK");
  848. });
  849. //保存提示词模板
  850. router.route("/addTipsTemplateHK").all((req, res, next) => {
  851. postmysql(req, res, "addTipsTemplateHK");
  852. });
  853. router.route("/addTipsTemplateHK2").all((req, res, next) => {
  854. postmysql(req, res, "addTipsTemplateHK2");
  855. });
  856. //删除提示词模板
  857. router.route("/deleteTipsTemplateHK").all((req, res, next) => {
  858. postmysql(req, res, "deleteTipsTemplateHK");
  859. });
  860. //查询模板
  861. router.route("/selectTipsTemplateHK").all((req, res, next) => {
  862. var json = queryString(req.url);
  863. getmysql(req, res, "selectTipsTemplateHK", json["userid"], json["oid"], json["org"], json["type"], json["name"]);
  864. });
  865. //查询模板
  866. router.route("/selectTipsTemplateByIdHK").all((req, res, next) => {
  867. var json = queryString(req.url);
  868. getmysql(req, res, "selectTipsTemplateByIdHK", json["id"]);
  869. });
  870. //新增课程
  871. router.route("/addWork").all((req, res, next) => {
  872. postmysql(req, res, "insert_teacher_work");
  873. });
  874. //点赞评论
  875. router.route("/insertComment").all((req, res, next) => {
  876. postmysql(req, res, "insertComment");
  877. });
  878. //点赞评论
  879. router.route("/getComment").all((req, res, next) => {
  880. postmysql(req, res, "getComment");
  881. });
  882. //取消点赞 修1
  883. router.route("/deleteComment").get((req, res, next) => {
  884. var json = queryString(req.url);
  885. getmysql2(req, res, "deleteComment", json["wid"], json["lid"]);
  886. });
  887. //删除1评论
  888. router.route("/deleteComment2").all((req, res, next) => {
  889. var json = queryString(req.url);
  890. getmysql2(req, res, "deleteComment2", json["id"]);
  891. });
  892. //上传批注图片
  893. router.route("/updateCourseWorks").all((req, res, next) => {
  894. postmysql(req, res, "updateCourseWorks");
  895. });
  896. //上传文件
  897. router.route("/addCourseWorks").all((req, res, next) => {
  898. postmysql(req, res, "addCourseWorks");
  899. });
  900. //上传文件
  901. router.route("/addCourseWorksS").all((req, res, next) => {
  902. postmysql(req, res, "addCourseWorksS");
  903. });
  904. //上传文件
  905. router.route("/addCourseWorksS2").all((req, res, next) => {
  906. postmysql(req, res, "addCourseWorksS2");
  907. });
  908. //修改作业名字
  909. router.route("/updateSCourseName").all((req, res, next) => {
  910. postmysql(req, res, "updateSCourseName");
  911. });
  912. //可上传多个文件
  913. router.route("/addCourseWorksR").all((req, res, next) => {
  914. postmysql(req, res, "addCourseWorksR");
  915. });
  916. //可上传多个文件y
  917. router.route("/addCourseWorksR1").all((req, res, next) => {
  918. postmysql(req, res, "addCourseWorksR1");
  919. });
  920. //上传文件
  921. router.route("/addCourseWorksTeacher").all((req, res, next) => {
  922. postmysql(req, res, "addCourseWorksTeacher");
  923. });
  924. //上传文件
  925. router.route("/addCourseWorks2").all((req, res, next) => {
  926. var json = queryString(req.url);
  927. postmysql(
  928. req,
  929. res,
  930. "addCourseWorks",
  931. json["uid"],
  932. json["cid"],
  933. json["stage"],
  934. json["task"],
  935. json["tool"],
  936. json["content"],
  937. json["type"]
  938. );
  939. });
  940. //上传文件 修1
  941. router.route("/addCourseWorks3").get((req, res, next) => {
  942. var json = queryString(req.url);
  943. getmysql2(
  944. req,
  945. res,
  946. "addCourseWorks2",
  947. json["uid"],
  948. json["cid"],
  949. json["stage"],
  950. json["task"],
  951. json["tool"],
  952. json["content"],
  953. json["type"],
  954. json["atool"]
  955. );
  956. });
  957. //上传文件
  958. router.route("/addCourseWorks3-2").all((req, res, next) => {
  959. var json = queryString(req.url);
  960. postmysql(req, res, "addCourseWorks2");
  961. });
  962. //上传文件
  963. router.route("/addCourseWorks2Inter").all((req, res, next) => {
  964. var json = queryString(req.url);
  965. postmysql(req, res, "addCourseWorks2Inter");
  966. });
  967. //上传文件
  968. router.route("/addCourseWorks4").all((req, res, next) => {
  969. postmysql3(req, res, "addCourseWorks3");
  970. });
  971. //上传文件
  972. router.route("/addCourseWorks4-u").all((req, res, next) => {
  973. postmysql2(req, res, "addCourseWorks3");
  974. });
  975. //上传文件
  976. router.route("/addCourseWorks4E").all((req, res, next) => {
  977. postmysql3(req, res, "addCourseWorks3E");
  978. });
  979. //上传文件
  980. router.route("/addCourseWorks4s").all((req, res, next) => {
  981. postmysql3(req, res, "addCourseWorks4s");
  982. });
  983. //上传文件
  984. router.route("/addCourseWorks4s2").all((req, res, next) => {
  985. postmysql3(req, res, "addCourseWorks4s2");
  986. });
  987. //上传文件
  988. router.route("/addCourseWorks5").all((req, res, next) => {
  989. postmysql(req, res, "addCourseWorks3");
  990. });
  991. //上传批量文件
  992. router.route("/addCourseWorksPl").all((req, res, next) => {
  993. if (req.body[0]) {
  994. var p = Object.values(req.body[0]);
  995. let ateacher = p[0];
  996. let cid = p[1];
  997. let stage = p[2];
  998. let task = p[3];
  999. let tool = p[4];
  1000. let files = JSON.parse(decodeURIComponent(p[5]));
  1001. for (let i = 0; i < files.length; i++) {
  1002. var k = [
  1003. encodeURIComponent(files[i].username),
  1004. cid,
  1005. stage,
  1006. task,
  1007. tool,
  1008. encodeURIComponent(files[i].url),
  1009. encodeURIComponent(files[i].fileType),
  1010. ateacher,
  1011. "50",
  1012. ];
  1013. k.unshift(_mysqlLabor[0], _mysqlLabor[1], "addCourseWorksPl");
  1014. //執行存儲過程
  1015. mysql.usselect(k, function(ret) {
  1016. if (i == files.length - 1) {
  1017. res.end(JSON.stringify(ret));
  1018. }
  1019. });
  1020. }
  1021. }
  1022. });
  1023. //修改课程权限(学生是否能查看所有作业) 修1
  1024. router.route("/updateCourseSLook").get((req, res, next) => {
  1025. var json = queryString(req.url);
  1026. getmysql2(req, res, "updateCourseSLook", json["sopen"], json["cid"]);
  1027. });
  1028. //修改课程权限(学生是否能查看所有作业) 修1
  1029. router.route("/updateTrainCourseSLook").get((req, res, next) => {
  1030. var json = queryString(req.url);
  1031. getmysql2(req, res, "updateTrainCourseSLook", json["sopen"], json["cid"]);
  1032. });
  1033. //修改跟随模式阶段-任务
  1034. router.route("/updateCourseFollowC").all((req, res, next) => {
  1035. postmysql(req, res, "updateCourseFollowC");
  1036. });
  1037. //修改跟随模式阶段-任务
  1038. router.route("/updateTrainCourseFollowC").all((req, res, next) => {
  1039. postmysql(req, res, "updateTrainCourseFollowC");
  1040. });
  1041. //修改跟随模式
  1042. router.route("/updateCourseFollow").all((req, res, next) => {
  1043. postmysql(req, res, "updateCourseFollow");
  1044. });
  1045. //修改跟随模式
  1046. router.route("/updateTrainCourseFollow").all((req, res, next) => {
  1047. postmysql(req, res, "updateTrainCourseFollow");
  1048. });
  1049. //选人回答
  1050. router.route("/updateCoursePick").all((req, res, next) => {
  1051. postmysql(req, res, "updateCoursePick");
  1052. });
  1053. //删除
  1054. router.route("/deletePick").all((req, res, next) => {
  1055. postmysql(req, res, "deletePick");
  1056. });
  1057. //修改阶段锁定状态
  1058. router.route("/updateCourseLookOpen").all((req, res, next) => {
  1059. postmysql(req, res, "updateCourseLookOpen");
  1060. });
  1061. //修改阶段锁定状态
  1062. router.route("/updateTrainCourseLookOpen").all((req, res, next) => {
  1063. postmysql(req, res, "updateTrainCourseLookOpen");
  1064. });
  1065. //查看阶段锁定的状态
  1066. router.route("/getCourseState").all((req, res, next) => {
  1067. var json = queryString(req.url);
  1068. getmysql(req, res, "getCourseState", json["cid"]);
  1069. });
  1070. //添加锁定状态
  1071. router.route("/addCourseState").all((req, res, next) => {
  1072. postmysql(req, res, "addCourseState");
  1073. });
  1074. //修改锁定状态
  1075. router.route("/updateCourseSate").all((req, res, next) => {
  1076. postmysql(req, res, "updateCourseSate");
  1077. });
  1078. //修改课程管理模式
  1079. router.route("/updateCourseMode").all((req, res, next) => {
  1080. postmysql(req, res, "updateCourseMode");
  1081. });
  1082. //修改课程管理模式
  1083. router.route("/updateTrainCourseMode").all((req, res, next) => {
  1084. postmysql(req, res, "updateTrainCourseMode");
  1085. });
  1086. //查询课程权限(学生是否能查看所有作业)
  1087. router.route("/selectCourseSLook").all((req, res, next) => {
  1088. var json = queryString(req.url);
  1089. getmysql(req, res, "selectCourseSLook", json["cid"]);
  1090. });
  1091. //查询课程权限(学生是否能查看所有作业)
  1092. router.route("/selectTrainCourseSLook").all((req, res, next) => {
  1093. var json = queryString(req.url);
  1094. getmysql(req, res, "selectTrainCourseSLook", json["cid"]);
  1095. });
  1096. //查询被挑的人
  1097. router.route("/getPick").all((req, res, next) => {
  1098. var json = queryString(req.url);
  1099. getmysql(req, res, "getPick", json["cid"]);
  1100. });
  1101. //查询作业详情
  1102. router.route("/selectWorksDetail2").all((req, res, next) => {
  1103. var json = queryString(req.url);
  1104. getmysql(
  1105. req,
  1106. res,
  1107. "selectWorksDetail2",
  1108. json["uid"],
  1109. json["cid"],
  1110. json["stage"],
  1111. json["task"]
  1112. );
  1113. });
  1114. //查询作业详情
  1115. router.route("/selectWorksDetail2u").all((req, res, next) => {
  1116. //var json = queryString(req.url);//, json['uid'], json['cid'], json['stage'], json['task'], json['tool'], json['type'], json['atool']
  1117. postmysql2(req, res, "selectWorksDetail2u");
  1118. });
  1119. //查询课程全部作业详情
  1120. router.route("/selectWorksDetail3").all((req, res, next) => {
  1121. var json = queryString(req.url);
  1122. getmysql(req, res, "selectWorksDetail3", json["uid"], json["cid"]);
  1123. });
  1124. //查询课程所有作业详情
  1125. router.route("/selectAllWorksDetail").all((req, res, next) => {
  1126. var json = queryString(req.url);
  1127. getmysql(req, res, "selectAllWorksDetail", json["uid"], json["cid"]);
  1128. });
  1129. //查询多个课程全部作业详情
  1130. router.route("/selectWorksDetailMore").all((req, res, next) => {
  1131. var json = queryString(req.url);
  1132. getmysql(req, res, "selectWorksDetailMore", json["uid"], json["cid"]);
  1133. });
  1134. //一键重置作业分数
  1135. router.route("/allWorkEmptySco").all((req, res, next) => {
  1136. postmysql(req, res, "allWorkEmptySco");
  1137. });
  1138. //一键重置作业分数
  1139. router.route("/allWorkEmptyScoTwo").all((req, res, next) => {
  1140. postmysql(req, res, "allWorkEmptyScoTwo");
  1141. });
  1142. //查询课程某个阶段某个任务下的评价 修1 这个update,但标题查询
  1143. router.route("/updateWorksEva").get((req, res, next) => {
  1144. var json = queryString(req.url);
  1145. getmysql2(
  1146. req,
  1147. res,
  1148. "updateWorksEva",
  1149. json["cid"],
  1150. json["s"],
  1151. json["t"],
  1152. json["uid"],
  1153. json["rate"]
  1154. );
  1155. });
  1156. //查询课程某个阶段某个任务下的评价 修1 这个update,但标题查询
  1157. router.route("/updateWorksEvaTwo").get((req, res, next) => {
  1158. var json = queryString(req.url);
  1159. getmysql2(
  1160. req,
  1161. res,
  1162. "updateWorksEvaTwo",
  1163. json["cid"],
  1164. json["s"],
  1165. json["t"],
  1166. json["tool"],
  1167. json["uid"],
  1168. json["rate"]
  1169. );
  1170. });
  1171. //学习中心教师查询作业
  1172. router.route("/selectSWorks").all((req, res, next) => {
  1173. var json = queryString(req.url);
  1174. getmysql(req, res, "selectSWorks", json["cid"], json["s"], json["t"]);
  1175. });
  1176. //学习中心教师查询工具作业
  1177. router.route("/selectMarkDialogWorks").all((req, res, next) => {
  1178. var json = queryString(req.url);
  1179. getmysql(req, res, "selectMarkDialogWorks", json["uid"],json["cid"], json["s"], json["t"], json["g"]);
  1180. });
  1181. //学习中心教师查询工具作业
  1182. router.route("/selectMarkDialogWorksTwo").all((req, res, next) => {
  1183. var json = queryString(req.url);
  1184. getmysql(req, res, "selectMarkDialogWorksTwo", json["uid"],json["cid"], json["s"], json["t"], json["g"]);
  1185. });
  1186. //学习中心教师查询作业全部展示
  1187. router.route("/selectSWorks2").all((req, res, next) => {
  1188. var json = queryString(req.url);
  1189. getmysql(req, res, "selectSWorks2", json["cid"]);
  1190. });
  1191. //学习中心学生查询作业
  1192. router.route("/selectStudentWorks").all((req, res, next) => {
  1193. var json = queryString(req.url);
  1194. getmysql(
  1195. req,
  1196. res,
  1197. "selectStudentWorks",
  1198. json["uid"],
  1199. json["cid"],
  1200. json["s"],
  1201. json["t"]
  1202. );
  1203. });
  1204. //实时课堂作业评价
  1205. router.route("/updateStudentWork").all((req, res, next) => {
  1206. postmysql(req, res, "updateStudentWork");
  1207. });
  1208. //学习中心查询学生
  1209. router.route("/selectWorksStudent").all((req, res, next) => {
  1210. var json = queryString(req.url);
  1211. getmysql(req, res, "selectWorksStudent", json["oid"], json["cid"]);
  1212. });
  1213. //批量上传查询学生
  1214. router.route("/selectSnameByCid").all((req, res, next) => {
  1215. var json = queryString(req.url);
  1216. getmysql(req, res, "selectSnameByCid", json["cid"]);
  1217. });
  1218. //批量上传查询学生分页
  1219. router.route("/selectSnameByCidPage").all((req, res, next) => {
  1220. var json = queryString(req.url);
  1221. getmysql(
  1222. req,
  1223. res,
  1224. "selectSnameByCidPage",
  1225. json["cid"],
  1226. json["cn"],
  1227. json["page"],
  1228. json["num"]
  1229. );
  1230. });
  1231. //分组查询学生
  1232. router.route("/selectSnameByCidGroup").all((req, res, next) => {
  1233. var json = queryString(req.url);
  1234. getmysql(
  1235. req,
  1236. res,
  1237. "selectSnameByCidGroup",
  1238. json["cid"],
  1239. json["oid"],
  1240. json["cn"]
  1241. );
  1242. });
  1243. /* 查询学生 */
  1244. router.route("/selectStudent2").all((req, res, next) => {
  1245. var json = queryString(req.url);
  1246. getmysql(
  1247. req,
  1248. res,
  1249. "selectStudent2",
  1250. json["oid"],
  1251. json["cu"],
  1252. json["cn"],
  1253. json["cid"],
  1254. json["page"],
  1255. 10
  1256. );
  1257. });
  1258. /* 查询教师 */
  1259. router.route("/selectTeacher2").all((req, res, next) => {
  1260. var json = queryString(req.url);
  1261. getmysql(
  1262. req,
  1263. res,
  1264. "selectTeacher2",
  1265. json["oid"],
  1266. json["cu"],
  1267. json["cn"],
  1268. json["cid"],
  1269. json["page"],
  1270. 10
  1271. );
  1272. });
  1273. /* 查询教师 */
  1274. router.route("/selectTeacher").all((req, res, next) => {
  1275. var json = queryString(req.url);
  1276. getmysql(
  1277. req,
  1278. res,
  1279. "selectTeacher",
  1280. json["org"],
  1281. json["cu"],
  1282. json["cn"],
  1283. json["page"],
  1284. 10
  1285. );
  1286. });
  1287. /* 添加教师页面查询教师 */
  1288. router.route("/selectTcTeacher").all((req, res, next) => {
  1289. var json = queryString(req.url);
  1290. getmysql(
  1291. req,
  1292. res,
  1293. "selectTcTeacher",
  1294. json["org"],
  1295. json["oid"],
  1296. json["cu"],
  1297. json["cn"],
  1298. json["page"],
  1299. 10
  1300. );
  1301. });
  1302. /* 查询所有评价体系 */
  1303. router.route("/selectAllEvaluation").all((req, res, next) => {
  1304. var json = queryString(req.url);
  1305. getmysql(req, res, "selectAllEvaluation", json["oid"]);
  1306. });
  1307. /* 根据市级用户查询评审员 */
  1308. router.route("/selectReviewer").all((req, res, next) => {
  1309. var json = queryString(req.url);
  1310. getmysql(
  1311. req,
  1312. res,
  1313. "selectReviewer",
  1314. json["uid"],
  1315. json["cn"],
  1316. json["page"],
  1317. 10
  1318. );
  1319. });
  1320. /* 市级区县管理接口 */
  1321. router.route("/selectCReviewer").all((req, res, next) => {
  1322. var json = queryString(req.url);
  1323. getmysql(
  1324. req,
  1325. res,
  1326. "selectCReviewer",
  1327. json["uid"],
  1328. json["cn"],
  1329. json["page"],
  1330. 10
  1331. );
  1332. });
  1333. /* 修改评审员 修1 */
  1334. router.route("/updateReviewer").get((req, res, next) => {
  1335. var json = queryString(req.url);
  1336. getmysql2(
  1337. req,
  1338. res,
  1339. "updateReviewer",
  1340. json["n"],
  1341. json["p"],
  1342. json["t"],
  1343. json["s"],
  1344. json["uid"]
  1345. );
  1346. });
  1347. /* 删除1评审员 */
  1348. router.route("/deleteReviewer").all((req, res, next) => {
  1349. var json = queryString(req.url);
  1350. getmysql2(req, res, "deleteReviewer", json["uid"]);
  1351. });
  1352. /* 查询区县案例 */
  1353. router.route("/selecAnliBox").all((req, res, next) => {
  1354. var json = queryString(req.url);
  1355. getmysql(req, res, "selecAnliBox", json["title"]);
  1356. });
  1357. /* 查询市级案例 */
  1358. router.route("/selecAnliBox1").all((req, res, next) => {
  1359. var json = queryString(req.url);
  1360. getmysql(req, res, "selecAnliBox1", json["title"]);
  1361. });
  1362. /* 查询省级案例 */
  1363. router.route("/selecAnliBox2").all((req, res, next) => {
  1364. var json = queryString(req.url);
  1365. getmysql(req, res, "selecAnliBox2");
  1366. });
  1367. /* 案例征集查询通知公告 */
  1368. router.route("/selectRaceNotice").all((req, res, next) => {
  1369. var json = queryString(req.url);
  1370. getmysql(req, res, "selectRaceNotice", json["page"], 10);
  1371. });
  1372. /* 案例征集查询通知公告详情 */
  1373. router.route("/getRaceNoticeDetail").all((req, res, next) => {
  1374. var json = queryString(req.url);
  1375. getmysql(req, res, "getRaceNoticeDetail", json["nid"]);
  1376. });
  1377. /* 案例征集发送通知 修1 */
  1378. router.route("/insertRaceNote").get((req, res, next) => {
  1379. var json = queryString(req.url);
  1380. getmysql2(req, res, "insertRaceNote", json["t"], json["c"], json["uid"]);
  1381. });
  1382. /* 查看随机码是否重复 */
  1383. router.route("/selectInviteCode").all((req, res, next) => {
  1384. var json = queryString(req.url);
  1385. getmysql(req, res, "selectInviteCode", json["code"], json["oid"]);
  1386. });
  1387. /* 查看随机码是否重复 */
  1388. router.route("/selectInviteCode2").all((req, res, next) => {
  1389. var json = queryString(req.url);
  1390. getmysql(req, res, "selectInviteCode2", json["code"], json["oid"]);
  1391. });
  1392. /* 根据随机码获取学校 */
  1393. router.route("/selectCourseByIc").all((req, res, next) => {
  1394. var json = queryString(req.url);
  1395. getmysql(req, res, "selectCourseByIc", json["code"], json["oid"]);
  1396. });
  1397. /* 根据随机码获取学校 */
  1398. router.route("/selectCourseByIc2").all((req, res, next) => {
  1399. var json = queryString(req.url);
  1400. getmysql(req, res, "selectCourseByIc2", json["code"], json["oid"]);
  1401. });
  1402. /* 根据随机码获取学校 */
  1403. router.route("/selectCourseByIc2SZ").all((req, res, next) => {
  1404. var json = queryString(req.url);
  1405. getmysql(req, res, "selectCourseByIc2SZ", json["code"], json["oid"]);
  1406. });
  1407. router.route("/addWorkNew").all((req, res, next) => {
  1408. // postmysql(req, res, "insert_teacher_work_new");
  1409. if (req.body[0]) {
  1410. // p = Object.values(req.body[0]);
  1411. p = [
  1412. req.body[0].uid,
  1413. req.body[0].title,
  1414. req.body[0].brief,
  1415. req.body[0].cover,
  1416. req.body[0].astudent,
  1417. req.body[0].see,
  1418. req.body[0].chapters,
  1419. req.body[0].template,
  1420. ];
  1421. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new");
  1422. //執行存儲過程
  1423. mysql.usselect(p, function(ret) {
  1424. let course = req.body[0].courseType;
  1425. let courseId = ret[0][0].courseId;
  1426. let userid = req.body[0].uid;
  1427. delCourseType(course, courseId, userid);
  1428. res.end(
  1429. JSON.stringify({
  1430. ordernumber: ret[0][0].ordernumber,
  1431. courseId: ret[0][0].courseId,
  1432. success: 1,
  1433. })
  1434. );
  1435. // res.end(JSON.stringify(ret));
  1436. });
  1437. }
  1438. });
  1439. router.route("/addWorkNew2").all((req, res, next) => {
  1440. if (req.body[0]) {
  1441. p = [
  1442. req.body[0].uid,
  1443. req.body[0].title,
  1444. req.body[0].brief,
  1445. req.body[0].cover,
  1446. req.body[0].evaId,
  1447. req.body[0].astudent,
  1448. req.body[0].see,
  1449. req.body[0].chapters,
  1450. req.body[0].template,
  1451. req.body[0].ateacher,
  1452. ];
  1453. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2"); //執行存儲過程
  1454. mysql.usselect(p, function(ret) {
  1455. let course = req.body[0].courseType;
  1456. let courseId = ret[0][0].courseId;
  1457. let userid = req.body[0].uid;
  1458. delCourseType(course, courseId, userid);
  1459. res.end(
  1460. JSON.stringify({
  1461. ordernumber: ret[0][0].ordernumber,
  1462. courseId: ret[0][0].courseId,
  1463. success: 1,
  1464. })
  1465. );
  1466. });
  1467. }
  1468. });
  1469. router.route("/addWorkNew2AI").all((req, res, next) => {
  1470. if (req.body[0]) {
  1471. p = [
  1472. req.body[0].uid,
  1473. req.body[0].title,
  1474. req.body[0].brief,
  1475. req.body[0].cover,
  1476. req.body[0].evaId,
  1477. req.body[0].astudent,
  1478. req.body[0].see,
  1479. req.body[0].chapters,
  1480. req.body[0].template,
  1481. req.body[0].ateacher,
  1482. req.body[0].refile,
  1483. req.body[0].reBrief,
  1484. ];
  1485. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2_ai"); //執行存儲過程
  1486. mysql.usselect(p, function(ret) {
  1487. let course = req.body[0].courseType;
  1488. let courseId = ret[0][0].courseId;
  1489. let userid = req.body[0].uid;
  1490. delCourseType(course, courseId, userid);
  1491. res.end(
  1492. JSON.stringify({
  1493. ordernumber: ret[0][0].ordernumber,
  1494. courseId: ret[0][0].courseId,
  1495. success: 1,
  1496. })
  1497. );
  1498. });
  1499. }
  1500. });
  1501. router.route("/addWorkNew2AI2").all((req, res, next) => {
  1502. if (req.body[0]) {
  1503. p = [
  1504. req.body[0].uid,
  1505. req.body[0].title,
  1506. req.body[0].brief,
  1507. req.body[0].cover,
  1508. req.body[0].evaId,
  1509. req.body[0].astudent,
  1510. req.body[0].see,
  1511. req.body[0].chapters,
  1512. req.body[0].template,
  1513. req.body[0].ateacher,
  1514. req.body[0].refile,
  1515. req.body[0].reBrief,
  1516. req.body[0].cpote,
  1517. ];
  1518. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2_ai2"); //執行存儲過程
  1519. mysql.usselect(p, function(ret) {
  1520. let course = req.body[0].courseType;
  1521. let courseId = ret[0][0].courseId;
  1522. let userid = req.body[0].uid;
  1523. delCourseType(course, courseId, userid);
  1524. res.end(
  1525. JSON.stringify({
  1526. ordernumber: ret[0][0].ordernumber,
  1527. courseId: ret[0][0].courseId,
  1528. success: 1,
  1529. })
  1530. );
  1531. });
  1532. }
  1533. });
  1534. router.route("/addWorkNew2AI3").all((req, res, next) => {
  1535. if (req.body[0]) {
  1536. p = [
  1537. req.body[0].uid,
  1538. req.body[0].title,
  1539. req.body[0].brief,
  1540. req.body[0].cover,
  1541. req.body[0].evaId,
  1542. req.body[0].astudent,
  1543. req.body[0].see,
  1544. req.body[0].chapters,
  1545. req.body[0].template,
  1546. req.body[0].ateacher,
  1547. req.body[0].refile,
  1548. req.body[0].reBrief,
  1549. req.body[0].cpote,
  1550. req.body[0].setting,
  1551. req.body[0].iresearch,
  1552. ];
  1553. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2_ai3"); //執行存儲過程
  1554. mysql.usselect(p, function(ret) {
  1555. let course = req.body[0].courseType;
  1556. let courseId = ret[0][0].courseId;
  1557. let userid = req.body[0].uid;
  1558. delCourseType(course, courseId, userid);
  1559. res.end(
  1560. JSON.stringify({
  1561. ordernumber: ret[0][0].ordernumber,
  1562. courseId: ret[0][0].courseId,
  1563. success: 1,
  1564. })
  1565. );
  1566. });
  1567. }
  1568. });
  1569. router.route("/addWorkNew2New").all((req, res, next) => {
  1570. if (req.body[0]) {
  1571. p = [
  1572. req.body[0].uid,
  1573. req.body[0].title,
  1574. req.body[0].brief,
  1575. req.body[0].cover,
  1576. req.body[0].evaId,
  1577. req.body[0].astudent,
  1578. req.body[0].see,
  1579. req.body[0].chapters,
  1580. req.body[0].template,
  1581. req.body[0].ateacher,
  1582. req.body[0].highSetting,
  1583. req.body[0].courseState,
  1584. ];
  1585. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2New"); //執行存儲過程
  1586. mysql.usselect(p, function(ret) {
  1587. let course = req.body[0].courseType;
  1588. let courseId = ret[0][0].courseId;
  1589. let userid = req.body[0].uid;
  1590. delCourseType(course, courseId, userid);
  1591. res.end(
  1592. JSON.stringify({
  1593. ordernumber: ret[0][0].ordernumber,
  1594. courseId: ret[0][0].courseId,
  1595. success: 1,
  1596. })
  1597. );
  1598. });
  1599. }
  1600. });
  1601. router.route("/addTrainCourseNew2").all((req, res, next) => {
  1602. if (req.body[0]) {
  1603. p = [
  1604. req.body[0].uid,
  1605. req.body[0].title,
  1606. req.body[0].brief,
  1607. req.body[0].cover,
  1608. req.body[0].evaId,
  1609. req.body[0].astudent,
  1610. req.body[0].see,
  1611. req.body[0].chapters,
  1612. req.body[0].template,
  1613. req.body[0].ateacher,
  1614. ];
  1615. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTrainCourseNew2"); //執行存儲過程
  1616. mysql.usselect(p, function(ret) {
  1617. let course = req.body[0].courseType;
  1618. let courseId = ret[0][0].courseId;
  1619. let userid = req.body[0].uid;
  1620. delCourseType(course, courseId, userid);
  1621. res.end(
  1622. JSON.stringify({
  1623. ordernumber: ret[0][0].ordernumber,
  1624. courseId: ret[0][0].courseId,
  1625. success: 1,
  1626. })
  1627. );
  1628. });
  1629. }
  1630. });
  1631. router.route("/addTestCourse").all((req, res, next) => { //添加评测
  1632. if (req.body[0]) {
  1633. p = [
  1634. req.body[0].uid,
  1635. req.body[0].title,
  1636. req.body[0].brief,
  1637. req.body[0].cover,
  1638. req.body[0].evaId,
  1639. req.body[0].astudent,
  1640. req.body[0].see,
  1641. req.body[0].chapters,
  1642. req.body[0].template,
  1643. req.body[0].ateacher,
  1644. req.body[0].typeid,
  1645. req.body[0].overtime,
  1646. req.body[0].j2,
  1647. ];
  1648. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTestCourse"); //執行存儲過程
  1649. mysql.usselect(p, function(ret) {
  1650. let course = req.body[0].courseType;
  1651. let courseId = ret[0][0].courseId;
  1652. let userid = req.body[0].uid;
  1653. delCourseType(course, courseId, userid);
  1654. res.end(
  1655. JSON.stringify({
  1656. ordernumber: ret[0][0].ordernumber,
  1657. courseId: ret[0][0].courseId,
  1658. success: 1,
  1659. })
  1660. );
  1661. });
  1662. }
  1663. });
  1664. router.route("/addTestCourse2").all((req, res, next) => { //添加评测 类型
  1665. if (req.body[0]) {
  1666. p = [
  1667. req.body[0].uid,
  1668. req.body[0].title,
  1669. req.body[0].brief,
  1670. req.body[0].cover,
  1671. req.body[0].evaId,
  1672. req.body[0].astudent,
  1673. req.body[0].see,
  1674. req.body[0].chapters,
  1675. req.body[0].template,
  1676. req.body[0].ateacher,
  1677. req.body[0].typeid,
  1678. ];
  1679. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTestCourse2"); //執行存儲過程
  1680. mysql.usselect(p, function(ret) {
  1681. let course = req.body[0].courseType;
  1682. let courseId = ret[0][0].courseId;
  1683. let userid = req.body[0].uid;
  1684. delCourseType(course, courseId, userid);
  1685. res.end(
  1686. JSON.stringify({
  1687. ordernumber: ret[0][0].ordernumber,
  1688. courseId: ret[0][0].courseId,
  1689. success: 1,
  1690. })
  1691. );
  1692. });
  1693. }
  1694. });
  1695. router.route("/addTestCourse3").all((req, res, next) => { //添加评测
  1696. if (req.body[0]) {
  1697. p = [
  1698. req.body[0].uid,
  1699. req.body[0].title,
  1700. req.body[0].brief,
  1701. req.body[0].cover,
  1702. req.body[0].evaId,
  1703. req.body[0].astudent,
  1704. req.body[0].see,
  1705. req.body[0].chapters,
  1706. req.body[0].template,
  1707. req.body[0].ateacher,
  1708. req.body[0].typeid,
  1709. req.body[0].overtime,
  1710. req.body[0].j2,
  1711. req.body[0].j3,
  1712. ];
  1713. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTestCourse3"); //執行存儲過程
  1714. mysql.usselect(p, function(ret) {
  1715. let course = req.body[0].courseType;
  1716. let courseId = ret[0][0].courseId;
  1717. let userid = req.body[0].uid;
  1718. delCourseType(course, courseId, userid);
  1719. res.end(
  1720. JSON.stringify({
  1721. ordernumber: ret[0][0].ordernumber,
  1722. courseId: ret[0][0].courseId,
  1723. success: 1,
  1724. })
  1725. );
  1726. });
  1727. }
  1728. });
  1729. router.route("/addWorkNew2E").all((req, res, next) => {
  1730. if (req.body[0]) {
  1731. p = [
  1732. req.body[0].uid,
  1733. req.body[0].title,
  1734. req.body[0].brief,
  1735. req.body[0].cover,
  1736. req.body[0].evaId,
  1737. req.body[0].astudent,
  1738. req.body[0].see,
  1739. req.body[0].chapters,
  1740. req.body[0].template,
  1741. req.body[0].ateacher,
  1742. ];
  1743. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2E"); //執行存儲過程
  1744. mysql.usselect(p, function(ret) {
  1745. let course = req.body[0].courseType;
  1746. let courseId = ret[0][0].courseId;
  1747. let userid = req.body[0].uid;
  1748. delCourseType(course, courseId, userid);
  1749. res.end(
  1750. JSON.stringify({
  1751. ordernumber: ret[0][0].ordernumber,
  1752. courseId: ret[0][0].courseId,
  1753. success: 1,
  1754. })
  1755. );
  1756. });
  1757. }
  1758. });
  1759. router.route("/addWorkNew2T").all((req, res, next) => {
  1760. if (req.body[0]) {
  1761. p = [
  1762. req.body[0].uid,
  1763. req.body[0].title,
  1764. req.body[0].brief,
  1765. req.body[0].cover,
  1766. req.body[0].evaId,
  1767. req.body[0].astudent,
  1768. req.body[0].see,
  1769. req.body[0].chapters,
  1770. req.body[0].template,
  1771. req.body[0].ateacher,
  1772. ];
  1773. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2T"); //執行存儲過程
  1774. mysql.usselect(p, function(ret) {
  1775. let course = req.body[0].courseType;
  1776. let courseId = ret[0][0].courseId;
  1777. let userid = req.body[0].uid;
  1778. delCourseType(course, courseId, userid);
  1779. res.end(
  1780. JSON.stringify({
  1781. ordernumber: ret[0][0].ordernumber,
  1782. courseId: ret[0][0].courseId,
  1783. success: 1,
  1784. })
  1785. );
  1786. });
  1787. }
  1788. });
  1789. router.route("/addTrainCourseNew2T").all((req, res, next) => {
  1790. if (req.body[0]) {
  1791. p = [
  1792. req.body[0].uid,
  1793. req.body[0].title,
  1794. req.body[0].brief,
  1795. req.body[0].cover,
  1796. req.body[0].evaId,
  1797. req.body[0].astudent,
  1798. req.body[0].see,
  1799. req.body[0].chapters,
  1800. req.body[0].template,
  1801. req.body[0].ateacher,
  1802. ];
  1803. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTrainCourseNew2T"); //執行存儲過程
  1804. mysql.usselect(p, function(ret) {
  1805. let course = req.body[0].courseType;
  1806. let courseId = ret[0][0].courseId;
  1807. let userid = req.body[0].uid;
  1808. delCourseType(course, courseId, userid);
  1809. res.end(
  1810. JSON.stringify({
  1811. ordernumber: ret[0][0].ordernumber,
  1812. courseId: ret[0][0].courseId,
  1813. success: 1,
  1814. })
  1815. );
  1816. });
  1817. }
  1818. });
  1819. router.route("/addSynergyCourse").all((req, res, next) => {
  1820. if (req.body[0]) {
  1821. p = [
  1822. req.body[0].uid,
  1823. req.body[0].title,
  1824. req.body[0].brief,
  1825. req.body[0].cover,
  1826. req.body[0].evaId,
  1827. req.body[0].astudent,
  1828. req.body[0].see,
  1829. req.body[0].chapters,
  1830. req.body[0].template,
  1831. req.body[0].ateacher,
  1832. ];
  1833. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_synergy"); //執行存儲過程
  1834. mysql.usselect(p, function(ret) {
  1835. let course = req.body[0].courseType;
  1836. let courseId = ret[0][0].courseId;
  1837. let userid = req.body[0].uid;
  1838. delCourseType(course, courseId, userid);
  1839. res.end(
  1840. JSON.stringify({
  1841. ordernumber: ret[0][0].ordernumber,
  1842. courseId: ret[0][0].courseId,
  1843. success: 1,
  1844. })
  1845. );
  1846. });
  1847. }
  1848. });
  1849. router.route("/addSynergyCourse2").all((req, res, next) => {
  1850. if (req.body[0]) {
  1851. p = [
  1852. req.body[0].cid,
  1853. req.body[0].uid,
  1854. req.body[0].title,
  1855. req.body[0].brief,
  1856. req.body[0].cover,
  1857. req.body[0].evaId,
  1858. req.body[0].astudent,
  1859. req.body[0].see,
  1860. req.body[0].chapters,
  1861. req.body[0].template,
  1862. req.body[0].ateacher,
  1863. ];
  1864. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_synergy2"); //執行存儲過程
  1865. mysql.usselect(p, function(ret) {
  1866. let course = req.body[0].courseType;
  1867. let courseId = ret[0][0].courseId;
  1868. let userid = req.body[0].uid;
  1869. delCourseType(course, courseId, userid);
  1870. res.end(
  1871. JSON.stringify({
  1872. ordernumber: ret[0][0].ordernumber,
  1873. courseId: ret[0][0].courseId,
  1874. success: 1,
  1875. })
  1876. );
  1877. });
  1878. }
  1879. });
  1880. router.route("/addWorkNew4").all((req, res, next) => {
  1881. if (req.body[0]) {
  1882. p = [
  1883. req.body[0].uid,
  1884. req.body[0].title,
  1885. req.body[0].brief,
  1886. req.body[0].cover,
  1887. req.body[0].evaId,
  1888. req.body[0].astudent,
  1889. req.body[0].see,
  1890. req.body[0].chapters,
  1891. req.body[0].template,
  1892. req.body[0].ateacher,
  1893. req.body[0].inviteCode,
  1894. ];
  1895. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new4"); //執行存儲過程
  1896. mysql.usselect(p, function(ret) {
  1897. let course = req.body[0].courseType;
  1898. let courseId = ret[0][0].courseId;
  1899. let userid = req.body[0].uid;
  1900. delCourseType(course, courseId, userid);
  1901. res.end(
  1902. JSON.stringify({
  1903. ordernumber: ret[0][0].ordernumber,
  1904. courseId: ret[0][0].courseId,
  1905. success: 1,
  1906. })
  1907. );
  1908. });
  1909. }
  1910. });
  1911. router.route("/addCourseWorkNew2").all((req, res, next) => {
  1912. //学生
  1913. if (req.body[0]) {
  1914. p = [
  1915. req.body[0].uid,
  1916. req.body[0].title,
  1917. req.body[0].brief,
  1918. req.body[0].cover,
  1919. req.body[0].evaId,
  1920. req.body[0].astudent,
  1921. req.body[0].see,
  1922. req.body[0].chapters,
  1923. req.body[0].template,
  1924. req.body[0].ateacher,
  1925. ];
  1926. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addCourseWorkNew2"); //執行存儲過程
  1927. mysql.usselect(p, function(ret) {
  1928. let course = req.body[0].courseType;
  1929. let courseId = ret[0][0].courseId;
  1930. let userid = req.body[0].uid;
  1931. delCourseType(course, courseId, userid);
  1932. res.end(
  1933. JSON.stringify({
  1934. ordernumber: ret[0][0].ordernumber,
  1935. courseId: ret[0][0].courseId,
  1936. success: 1,
  1937. })
  1938. );
  1939. });
  1940. }
  1941. });
  1942. router.route("/addCourseWorkNew22").all((req, res, next) => {
  1943. //学生
  1944. if (req.body[0]) {
  1945. p = [
  1946. req.body[0].uid,
  1947. req.body[0].title,
  1948. req.body[0].brief,
  1949. req.body[0].cover,
  1950. req.body[0].evaId,
  1951. req.body[0].astudent,
  1952. req.body[0].see,
  1953. req.body[0].chapters,
  1954. req.body[0].template,
  1955. req.body[0].ateacher,
  1956. ];
  1957. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addCourseWorkNew2"); //執行存儲過程
  1958. mysql.usselect(p, function(ret) {
  1959. let course = req.body[0].courseType;
  1960. let courseId = ret[0][0].courseId;
  1961. let userid = req.body[0].uid;
  1962. delCourseTypeS(course, courseId, userid);
  1963. res.end(
  1964. JSON.stringify({
  1965. ordernumber: ret[0][0].ordernumber,
  1966. courseId: ret[0][0].courseId,
  1967. success: 1,
  1968. })
  1969. );
  1970. });
  1971. }
  1972. });
  1973. //新增赛事项目
  1974. router.route("/addRace").all((req, res, next) => {
  1975. if (req.body[0]) {
  1976. p = [
  1977. req.body[0].uid,
  1978. req.body[0].info,
  1979. req.body[0].over,
  1980. req.body[0].pro,
  1981. req.body[0].act,
  1982. req.body[0].exc,
  1983. req.body[0].res,
  1984. ];
  1985. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addRace"); //執行存儲過程
  1986. mysql.usselect(p, function(ret) {
  1987. let course = req.body[0].courseType;
  1988. let courseId = ret[0][0].id;
  1989. let userid = req.body[0].uid;
  1990. delCourseType1(course, courseId, userid);
  1991. res.end(JSON.stringify({ courseId: courseId, success: 1 }));
  1992. });
  1993. }
  1994. });
  1995. //新增赛事项目
  1996. router.route("/addRace2").all((req, res, next) => {
  1997. if (req.body[0]) {
  1998. p = [
  1999. req.body[0].uid,
  2000. req.body[0].info,
  2001. req.body[0].over,
  2002. req.body[0].pro,
  2003. req.body[0].act,
  2004. req.body[0].exc,
  2005. req.body[0].res,
  2006. ];
  2007. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addRace2"); //執行存儲過程
  2008. mysql.usselect(p, function(ret) {
  2009. let course = req.body[0].courseType;
  2010. let courseId = ret[0][0].id;
  2011. let userid = req.body[0].uid;
  2012. delCourseType1(course, courseId, userid);
  2013. res.end(JSON.stringify({ courseId: courseId, success: 1 }));
  2014. });
  2015. }
  2016. });
  2017. //新增赛事账号信息
  2018. router.route("/addRaceUser").all((req, res, next) => {
  2019. if (req.body[0]) {
  2020. p = [
  2021. req.body[0].reg,
  2022. req.body[0].res,
  2023. req.body[0].sch,
  2024. req.body[0].n,
  2025. req.body[0].p,
  2026. req.body[0].t,
  2027. req.body[0].parent,
  2028. ];
  2029. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addRaceUser"); //執行存儲過程
  2030. mysql.usselect(p, function(ret) {
  2031. let num = ret[0][0].num;
  2032. let userid = ret[0][0].userid;
  2033. if (num < 10) {
  2034. num = "SZ" + "00" + num + "@gdae.com";
  2035. } else if (num < 100) {
  2036. num = "SZ" + "0" + num + "@gdae.com";
  2037. } else if (num > 100) {
  2038. num = "SZ" + num + "@gdae.com";
  2039. }
  2040. y = [userid, num, bcrypt.hashSync("123456", bcrypt.genSaltSync(10))];
  2041. //参数拼接,注册
  2042. y.unshift(_mysqlLabor[0], _mysqlLabor[1], "upRaceUserNamePassword");
  2043. mysql.usselect(y, function(ret) {
  2044. res.end(JSON.stringify(ret));
  2045. });
  2046. res.end(JSON.stringify({ num: num, success: 1 }));
  2047. });
  2048. }
  2049. });
  2050. //修改赛事项目
  2051. router.route("/updateRace").all((req, res, next) => {
  2052. if (req.body[0]) {
  2053. p = [
  2054. req.body[0].id,
  2055. req.body[0].info,
  2056. req.body[0].over,
  2057. req.body[0].pro,
  2058. req.body[0].act,
  2059. req.body[0].exc,
  2060. req.body[0].res,
  2061. ];
  2062. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateRace"); //執行存儲過程
  2063. mysql.usselect(p, function(ret) {
  2064. let course = req.body[0].courseType;
  2065. let courseId = req.body[0].id;
  2066. let userid = req.body[0].uid;
  2067. delCourseType1(course, courseId, userid);
  2068. res.end(JSON.stringify({ success: 1 }));
  2069. });
  2070. }
  2071. });
  2072. router.route("/addWorkNew3").all((req, res, next) => {
  2073. if (req.body[0]) {
  2074. p = [
  2075. req.body[0].uid,
  2076. req.body[0].title,
  2077. req.body[0].brief,
  2078. req.body[0].cover,
  2079. req.body[0].astudent,
  2080. req.body[0].see,
  2081. req.body[0].chapters,
  2082. req.body[0].template,
  2083. req.body[0].ateacher,
  2084. ];
  2085. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new3"); //執行存儲過程
  2086. mysql.usselect(p, function(ret) {
  2087. let course = req.body[0].courseType;
  2088. let courseId = ret[0][0].courseId;
  2089. let userid = req.body[0].uid;
  2090. delCourseType(course, courseId, userid);
  2091. res.end(
  2092. JSON.stringify({
  2093. ordernumber: ret[0][0].ordernumber,
  2094. courseId: ret[0][0].courseId,
  2095. success: 1,
  2096. })
  2097. );
  2098. });
  2099. }
  2100. });
  2101. router.route("/addInviteCode").all((req, res, next) => {
  2102. if (req.body[0]) {
  2103. addCourseInviteCode(
  2104. req.body[0].courseId,
  2105. JSON.parse(decodeURIComponent(req.body[0].inviteCode))
  2106. );
  2107. }
  2108. });
  2109. function delCourseInviteCode(courseId, inviteCode) {
  2110. let _courseId = courseId;
  2111. var _userdata = [_courseId];
  2112. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_courseInviteCode");
  2113. mysql.usselect(_userdata, function(ret) {
  2114. // console.log(ret);
  2115. addCourseInviteCode(_courseId, inviteCode);
  2116. });
  2117. }
  2118. function delCourseType(course, courseId, userid) {
  2119. let _courseId = courseId;
  2120. var _userdata = [_courseId];
  2121. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_courseType");
  2122. mysql.usselect(_userdata, function(ret) {
  2123. // console.log(ret);
  2124. addCourseType(userid, course, _courseId);
  2125. });
  2126. // setTimeout(() => {
  2127. // }, 1000);
  2128. }
  2129. function delCourseType1(course, courseId, userid) {
  2130. let _courseId = courseId;
  2131. var _userdata = [_courseId];
  2132. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_courseType1");
  2133. mysql.usselect(_userdata, function(ret) {
  2134. // console.log(ret);
  2135. });
  2136. setTimeout(() => {
  2137. addCourseType1(userid, course, _courseId);
  2138. }, 1000);
  2139. }
  2140. function delCourseTypeS(course, courseId, userid) {
  2141. let _courseId = courseId;
  2142. var _userdata = [_courseId];
  2143. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_courseTypeS");
  2144. mysql.usselect(_userdata, function(ret) {
  2145. // console.log(ret);
  2146. addCourseTypeS(userid, course, _courseId);
  2147. });
  2148. // setTimeout(() => {
  2149. // }, 1000);
  2150. }
  2151. function addCourseInviteCode(courseId, inviteCode) {
  2152. var _courses = courseId;
  2153. var _tid = inviteCode;
  2154. for (let i = 0; i < _tid.length; i++) {
  2155. let _userdata = [_courses, _tid[i].cid, _tid[i].ic];
  2156. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_courseInviteCode");
  2157. setTimeout(() => {
  2158. mysql.usselect(_userdata, function(ret) {
  2159. // console.log(ret);
  2160. });
  2161. }, i * 500);
  2162. }
  2163. }
  2164. function addCourseType(userid, course, _courseId) {
  2165. var _uid = userid;
  2166. var _courses = _courseId;
  2167. var _tid = JSON.parse(decodeURIComponent(course));
  2168. for (let i = 0; i < _tid.length; i++) {
  2169. if (_tid[i] == "") {
  2170. continue;
  2171. }
  2172. var _userdata = [_courses, _tid[i], _uid];
  2173. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_courseType");
  2174. mysql.usselect(_userdata, function(ret) {
  2175. // console.log(ret);
  2176. });
  2177. }
  2178. }
  2179. function addCourseType1(userid, course, _courseId) {
  2180. var _uid = userid;
  2181. var _courses = _courseId;
  2182. var _tid = JSON.parse(decodeURIComponent(course));
  2183. for (let i = 0; i < _tid.length; i++) {
  2184. if (_tid[i] == "") {
  2185. continue;
  2186. }
  2187. var _userdata = [_courses, _tid[i], _uid];
  2188. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_courseType1");
  2189. mysql.usselect(_userdata, function(ret) {
  2190. // console.log(ret);
  2191. });
  2192. }
  2193. }
  2194. function addCourseTypeS(userid, course, _courseId) {
  2195. var _uid = userid;
  2196. var _courses = _courseId;
  2197. var _tid = JSON.parse(decodeURIComponent(course));
  2198. for (let i = 0; i < _tid.length; i++) {
  2199. if (_tid[i] == "") {
  2200. continue;
  2201. }
  2202. var _userdata = [_courses, _tid[i], _uid];
  2203. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_courseTypeS");
  2204. mysql.usselect(_userdata, function(ret) {
  2205. // console.log(ret);
  2206. });
  2207. }
  2208. }
  2209. //修改课程
  2210. // router.route('/updateWork').all((req, res, next) => {
  2211. // postmysql(req, res, "update_teacher_work");
  2212. // });
  2213. router.route("/updateWorkNew").all((req, res, next) => {
  2214. if (req.body[0]) {
  2215. // p = Object.values(req.body[0]);
  2216. p = [
  2217. req.body[0].cid,
  2218. req.body[0].title,
  2219. req.body[0].brief,
  2220. req.body[0].cover,
  2221. req.body[0].astudent,
  2222. req.body[0].see,
  2223. req.body[0].chapters,
  2224. req.body[0].template,
  2225. ];
  2226. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new");
  2227. //執行存儲過程
  2228. mysql.usselect(p, function(ret) {
  2229. let course = req.body[0].courseType;
  2230. let courseId = req.body[0].cid;
  2231. let userid = req.body[0].uid;
  2232. delCourseType(course, courseId, userid);
  2233. res.end(JSON.stringify({ success: 1 }));
  2234. // res.end(JSON.stringify(ret));
  2235. });
  2236. }
  2237. });
  2238. //查询课程
  2239. // router.route('/selectCourse').all((req, res, next) => {
  2240. // var json = queryString(req.url);
  2241. // getmysql(req, res, "select_course", json['type'], json['uid'], json['oid'], json['page'], 10);
  2242. // });
  2243. router.route("/updateWorkNew2").all((req, res, next) => {
  2244. if (req.body[0]) {
  2245. p = [
  2246. req.body[0].cid,
  2247. req.body[0].title,
  2248. req.body[0].brief,
  2249. req.body[0].cover,
  2250. req.body[0].evaId,
  2251. req.body[0].astudent,
  2252. req.body[0].see,
  2253. req.body[0].chapters,
  2254. req.body[0].template,
  2255. req.body[0].ateacher,
  2256. ];
  2257. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new2"); //執行存儲過程
  2258. mysql.usselect(p, function(ret) {
  2259. let course = req.body[0].courseType;
  2260. let courseId = req.body[0].cid;
  2261. let userid = req.body[0].uid;
  2262. delCourseType(course, courseId, userid);
  2263. res.end(JSON.stringify({ success: 1 }));
  2264. });
  2265. }
  2266. });
  2267. router.route("/updateWorkNew2AI").all((req, res, next) => {
  2268. if (req.body[0]) {
  2269. p = [
  2270. req.body[0].cid,
  2271. req.body[0].title,
  2272. req.body[0].brief,
  2273. req.body[0].cover,
  2274. req.body[0].evaId,
  2275. req.body[0].astudent,
  2276. req.body[0].see,
  2277. req.body[0].chapters,
  2278. req.body[0].template,
  2279. req.body[0].ateacher,
  2280. req.body[0].refile,
  2281. req.body[0].reBrief,
  2282. ];
  2283. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new2_ai"); //執行存儲過程
  2284. mysql.usselect(p, function(ret) {
  2285. let course = req.body[0].courseType;
  2286. let courseId = req.body[0].cid;
  2287. let userid = req.body[0].uid;
  2288. delCourseType(course, courseId, userid);
  2289. res.end(JSON.stringify({ success: 1 }));
  2290. });
  2291. }
  2292. });
  2293. router.route("/updateWorkNew2AI2").all((req, res, next) => {
  2294. if (req.body[0]) {
  2295. p = [
  2296. req.body[0].cid,
  2297. req.body[0].title,
  2298. req.body[0].brief,
  2299. req.body[0].cover,
  2300. req.body[0].evaId,
  2301. req.body[0].astudent,
  2302. req.body[0].see,
  2303. req.body[0].chapters,
  2304. req.body[0].template,
  2305. req.body[0].ateacher,
  2306. req.body[0].refile,
  2307. req.body[0].reBrief,
  2308. req.body[0].cpote,
  2309. ];
  2310. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new2_ai2"); //執行存儲過程
  2311. mysql.usselect(p, function(ret) {
  2312. let course = req.body[0].courseType;
  2313. let courseId = req.body[0].cid;
  2314. let userid = req.body[0].uid;
  2315. delCourseType(course, courseId, userid);
  2316. res.end(JSON.stringify({ success: 1 }));
  2317. });
  2318. }
  2319. });
  2320. router.route("/updateWorkNew2AI3").all((req, res, next) => {
  2321. if (req.body[0]) {
  2322. p = [
  2323. req.body[0].cid,
  2324. req.body[0].title,
  2325. req.body[0].brief,
  2326. req.body[0].cover,
  2327. req.body[0].evaId,
  2328. req.body[0].astudent,
  2329. req.body[0].see,
  2330. req.body[0].chapters,
  2331. req.body[0].template,
  2332. req.body[0].ateacher,
  2333. req.body[0].refile,
  2334. req.body[0].reBrief,
  2335. req.body[0].cpote,
  2336. req.body[0].setting,
  2337. req.body[0].iresearch,
  2338. ];
  2339. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new2_ai3"); //執行存儲過程
  2340. mysql.usselect(p, function(ret) {
  2341. let course = req.body[0].courseType;
  2342. let courseId = req.body[0].cid;
  2343. let userid = req.body[0].uid;
  2344. delCourseType(course, courseId, userid);
  2345. res.end(JSON.stringify({ success: 1 }));
  2346. });
  2347. }
  2348. });
  2349. router.route("/updateWorkNew2New").all((req, res, next) => {
  2350. if (req.body[0]) {
  2351. p = [
  2352. req.body[0].cid,
  2353. req.body[0].title,
  2354. req.body[0].brief,
  2355. req.body[0].cover,
  2356. req.body[0].evaId,
  2357. req.body[0].astudent,
  2358. req.body[0].see,
  2359. req.body[0].chapters,
  2360. req.body[0].template,
  2361. req.body[0].ateacher,
  2362. req.body[0].highSetting
  2363. ];
  2364. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new2New"); //執行存儲過程
  2365. mysql.usselect(p, function(ret) {
  2366. let course = req.body[0].courseType;
  2367. let courseId = req.body[0].cid;
  2368. let userid = req.body[0].uid;
  2369. delCourseType(course, courseId, userid);
  2370. res.end(JSON.stringify({ success: 1 }));
  2371. });
  2372. }
  2373. });
  2374. router.route("/updateTrainCourseNew2").all((req, res, next) => {
  2375. if (req.body[0]) {
  2376. p = [
  2377. req.body[0].cid,
  2378. req.body[0].title,
  2379. req.body[0].brief,
  2380. req.body[0].cover,
  2381. req.body[0].evaId,
  2382. req.body[0].astudent,
  2383. req.body[0].see,
  2384. req.body[0].chapters,
  2385. req.body[0].template,
  2386. req.body[0].ateacher,
  2387. ];
  2388. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTrainCourseNew2"); //執行存儲過程
  2389. mysql.usselect(p, function(ret) {
  2390. let course = req.body[0].courseType;
  2391. let courseId = req.body[0].cid;
  2392. let userid = req.body[0].uid;
  2393. delCourseType(course, courseId, userid);
  2394. res.end(JSON.stringify({ success: 1 }));
  2395. });
  2396. }
  2397. });
  2398. router.route("/updateTestCourse").all((req, res, next) => { //修改评测
  2399. if (req.body[0]) {
  2400. p = [
  2401. req.body[0].cid,
  2402. req.body[0].title,
  2403. req.body[0].brief,
  2404. req.body[0].cover,
  2405. req.body[0].evaId,
  2406. req.body[0].astudent,
  2407. req.body[0].see,
  2408. req.body[0].chapters,
  2409. req.body[0].template,
  2410. req.body[0].ateacher,
  2411. req.body[0].look,
  2412. req.body[0].typeid,
  2413. req.body[0].overtime,
  2414. req.body[0].j2,
  2415. ];
  2416. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTestCourse"); //執行存儲過程
  2417. mysql.usselect(p, function(ret) {
  2418. let course = req.body[0].courseType;
  2419. let courseId = req.body[0].cid;
  2420. let userid = req.body[0].uid;
  2421. delCourseType(course, courseId, userid);
  2422. res.end(JSON.stringify({ success: 1 }));
  2423. });
  2424. }
  2425. });
  2426. router.route("/updateTestCourse2").all((req, res, next) => { //修改评测
  2427. if (req.body[0]) {
  2428. p = [
  2429. req.body[0].cid,
  2430. req.body[0].title,
  2431. req.body[0].brief,
  2432. req.body[0].cover,
  2433. req.body[0].evaId,
  2434. req.body[0].astudent,
  2435. req.body[0].see,
  2436. req.body[0].chapters,
  2437. req.body[0].template,
  2438. req.body[0].ateacher,
  2439. req.body[0].look,
  2440. req.body[0].typeid,
  2441. ];
  2442. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTestCourse2"); //執行存儲過程
  2443. mysql.usselect(p, function(ret) {
  2444. let course = req.body[0].courseType;
  2445. let courseId = req.body[0].cid;
  2446. let userid = req.body[0].uid;
  2447. delCourseType(course, courseId, userid);
  2448. res.end(JSON.stringify({ success: 1 }));
  2449. });
  2450. }
  2451. });
  2452. router.route("/updateTestCourse3").all((req, res, next) => { //修改评测
  2453. if (req.body[0]) {
  2454. p = [
  2455. req.body[0].cid,
  2456. req.body[0].title,
  2457. req.body[0].brief,
  2458. req.body[0].cover,
  2459. req.body[0].evaId,
  2460. req.body[0].astudent,
  2461. req.body[0].see,
  2462. req.body[0].chapters,
  2463. req.body[0].template,
  2464. req.body[0].ateacher,
  2465. req.body[0].look,
  2466. req.body[0].typeid,
  2467. req.body[0].overtime,
  2468. req.body[0].j2,
  2469. req.body[0].j3,
  2470. ];
  2471. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTestCourse3"); //執行存儲過程
  2472. mysql.usselect(p, function(ret) {
  2473. let course = req.body[0].courseType;
  2474. let courseId = req.body[0].cid;
  2475. let userid = req.body[0].uid;
  2476. delCourseType(course, courseId, userid);
  2477. res.end(JSON.stringify({ success: 1 }));
  2478. });
  2479. }
  2480. });
  2481. router.route("/updateSynergy").all((req, res, next) => {
  2482. if (req.body[0]) {
  2483. p = [
  2484. req.body[0].cid,
  2485. req.body[0].title,
  2486. req.body[0].brief,
  2487. req.body[0].cover,
  2488. req.body[0].evaId,
  2489. req.body[0].astudent,
  2490. req.body[0].see,
  2491. req.body[0].chapters,
  2492. req.body[0].template,
  2493. req.body[0].ateacher,
  2494. ];
  2495. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_synergy"); //執行存儲過程
  2496. mysql.usselect(p, function(ret) {
  2497. let course = req.body[0].courseType;
  2498. let courseId = req.body[0].cid;
  2499. let userid = req.body[0].uid;
  2500. delCourseType(course, courseId, userid);
  2501. res.end(JSON.stringify({ success: 1 }));
  2502. });
  2503. }
  2504. });
  2505. router.route("/updateWorkNew5").all((req, res, next) => {
  2506. if (req.body[0]) {
  2507. p = [
  2508. req.body[0].cid,
  2509. req.body[0].title,
  2510. req.body[0].brief,
  2511. req.body[0].cover,
  2512. req.body[0].evaId,
  2513. req.body[0].astudent,
  2514. req.body[0].see,
  2515. req.body[0].chapters,
  2516. req.body[0].template,
  2517. req.body[0].ateacher,
  2518. req.body[0].inviteCode,
  2519. ];
  2520. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new5"); //執行存儲過程
  2521. mysql.usselect(p, function(ret) {
  2522. let course = req.body[0].courseType;
  2523. let courseId = req.body[0].cid;
  2524. let userid = req.body[0].uid;
  2525. delCourseType(course, courseId, userid);
  2526. res.end(JSON.stringify({ success: 1 }));
  2527. });
  2528. }
  2529. });
  2530. router.route("/updateStudentWorkNew2").all((req, res, next) => {
  2531. //学生
  2532. if (req.body[0]) {
  2533. p = [
  2534. req.body[0].cid,
  2535. req.body[0].title,
  2536. req.body[0].brief,
  2537. req.body[0].cover,
  2538. req.body[0].evaId,
  2539. req.body[0].astudent,
  2540. req.body[0].see,
  2541. req.body[0].chapters,
  2542. req.body[0].template,
  2543. req.body[0].ateacher,
  2544. ];
  2545. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew2"); //執行存儲過程
  2546. mysql.usselect(p, function(ret) {
  2547. let course = req.body[0].courseType;
  2548. let courseId = req.body[0].cid;
  2549. let userid = req.body[0].uid;
  2550. delCourseType(course, courseId, userid);
  2551. res.end(JSON.stringify({ success: 1 }));
  2552. });
  2553. }
  2554. });
  2555. router.route("/updateStudentWorkNew22").all((req, res, next) => {
  2556. //学生
  2557. if (req.body[0]) {
  2558. p = [
  2559. req.body[0].cid,
  2560. req.body[0].title,
  2561. req.body[0].brief,
  2562. req.body[0].cover,
  2563. req.body[0].evaId,
  2564. req.body[0].astudent,
  2565. req.body[0].see,
  2566. req.body[0].chapters,
  2567. req.body[0].template,
  2568. req.body[0].ateacher,
  2569. ];
  2570. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew2"); //執行存儲過程
  2571. mysql.usselect(p, function(ret) {
  2572. let course = req.body[0].courseType;
  2573. let courseId = req.body[0].cid;
  2574. let userid = req.body[0].uid;
  2575. delCourseTypeS(course, courseId, userid);
  2576. res.end(JSON.stringify({ success: 1 }));
  2577. });
  2578. }
  2579. });
  2580. router.route("/updateWorkNew3").all((req, res, next) => {
  2581. if (req.body[0]) {
  2582. p = [
  2583. req.body[0].cid,
  2584. req.body[0].title,
  2585. req.body[0].brief,
  2586. req.body[0].cover,
  2587. req.body[0].astudent,
  2588. req.body[0].see,
  2589. req.body[0].chapters,
  2590. req.body[0].template,
  2591. req.body[0].ateacher,
  2592. ];
  2593. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new3"); //執行存儲過程
  2594. mysql.usselect(p, function(ret) {
  2595. let course = req.body[0].courseType;
  2596. let courseId = req.body[0].cid;
  2597. let userid = req.body[0].uid;
  2598. delCourseType(course, courseId, userid);
  2599. res.end(JSON.stringify({ success: 1 }));
  2600. });
  2601. }
  2602. });
  2603. function guid() {
  2604. var _num,
  2605. i,
  2606. _guid = "";
  2607. for (i = 0; i < 32; i++) {
  2608. _guid += Math.floor(Math.random() * 16).toString(16); //随机0 - 16 的数字 转变为16进制的字符串
  2609. _num = Math.floor((i - 7) / 4); //计算 (i-7)除4
  2610. if (_num > -1 && _num < 4 && i == 7 + 4 * _num) {
  2611. //会使guid中间加 "-" 形式为xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  2612. _guid += "-";
  2613. }
  2614. }
  2615. return _guid;
  2616. }
  2617. router.route("/updateWorkNew4").all((req, res, next) => {
  2618. if (req.body[0]) {
  2619. let p = [req.body[0].cid];
  2620. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_course_detail"); //執行存儲過程
  2621. mysql.usselect(p, function(ret) {
  2622. let _unitIndex = parseInt(req.body[0].unitIndex);
  2623. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  2624. let _unitJson = JSON.parse(ret[0][0].chapters);
  2625. if (_unitJson.length - 1 < _unitIndex) {
  2626. let _i = _unitIndex - (_unitJson.length - 1);
  2627. for (let i = 0; i < _i; i++) {
  2628. _unitJson.push({
  2629. dyName: "", //单元标题
  2630. chapterInfo: [{
  2631. isread: false,
  2632. chapterid: guid(),
  2633. title: "",
  2634. courseName: "",
  2635. taskJson: [{
  2636. task: "",
  2637. taskDetail: "",
  2638. chapterData: [],
  2639. toolText: "",
  2640. toolChoose: [{
  2641. tool: [],
  2642. toolDetail: "",
  2643. toolType: 0,
  2644. askCount: 1,
  2645. askTitle: "",
  2646. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  2647. }, ],
  2648. isShowTools: false,
  2649. askCount: 1,
  2650. isFold: 0,
  2651. askTitle: "",
  2652. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  2653. checkJson: [{ checkCount: [], checkPerent: [] }],
  2654. homeworkList: [],
  2655. }, ],
  2656. itemCount: 1,
  2657. fileList1: [],
  2658. video: [],
  2659. testData: [],
  2660. pData: [],
  2661. templateArray: [],
  2662. }, ],
  2663. });
  2664. }
  2665. _unitJson[_unitIndex] = _chapters[_unitIndex];
  2666. } else {
  2667. _unitJson[_unitIndex] = _chapters[_unitIndex];
  2668. }
  2669. // console.log(_unitJson);
  2670. let p2 = [
  2671. req.body[0].cid,
  2672. // JSON.stringify(_unitJson).replaceAll(/%/g, "%25")
  2673. encodeURIComponent(JSON.stringify(_unitJson)),
  2674. ];
  2675. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new4"); //執行存儲過程
  2676. mysql.usselect(p2, function(ret) {
  2677. res.end(JSON.stringify({ success: 1 }));
  2678. });
  2679. // res.end(JSON.stringify({ success: 1 }));
  2680. });
  2681. }
  2682. });
  2683. router.route("/updateTrainCourseNew4").all((req, res, next) => {
  2684. if (req.body[0]) {
  2685. let p = [req.body[0].cid];
  2686. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_trainCourse_detail"); //執行存儲過程
  2687. mysql.usselect(p, function(ret) {
  2688. let _unitIndex = parseInt(req.body[0].unitIndex);
  2689. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  2690. let _unitJson = JSON.parse(ret[0][0].chapters);
  2691. if (_unitJson.length - 1 < _unitIndex) {
  2692. let _i = _unitIndex - (_unitJson.length - 1);
  2693. for (let i = 0; i < _i; i++) {
  2694. _unitJson.push({
  2695. dyName: "", //单元标题
  2696. chapterInfo: [{
  2697. isread: false,
  2698. chapterid: guid(),
  2699. title: "",
  2700. courseName: "",
  2701. taskJson: [{
  2702. task: "",
  2703. taskDetail: "",
  2704. chapterData: [],
  2705. toolText: "",
  2706. toolChoose: [{
  2707. tool: [],
  2708. toolDetail: "",
  2709. toolType: 0,
  2710. askCount: 1,
  2711. askTitle: "",
  2712. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  2713. }, ],
  2714. isShowTools: false,
  2715. askCount: 1,
  2716. isFold: 0,
  2717. askTitle: "",
  2718. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  2719. checkJson: [{ checkCount: [], checkPerent: [] }],
  2720. homeworkList: [],
  2721. }, ],
  2722. itemCount: 1,
  2723. fileList1: [],
  2724. video: [],
  2725. testData: [],
  2726. pData: [],
  2727. templateArray: [],
  2728. }, ],
  2729. });
  2730. }
  2731. _unitJson[_unitIndex] = _chapters[_unitIndex];
  2732. } else {
  2733. _unitJson[_unitIndex] = _chapters[_unitIndex];
  2734. }
  2735. // console.log(_unitJson);
  2736. let p2 = [
  2737. req.body[0].cid,
  2738. encodeURIComponent(JSON.stringify(_unitJson)),
  2739. ];
  2740. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTrainCourseNew4"); //執行存儲過程
  2741. mysql.usselect(p2, function(ret) {
  2742. res.end(JSON.stringify({ success: 1 }));
  2743. });
  2744. // res.end(JSON.stringify({ success: 1 }));
  2745. });
  2746. }
  2747. });
  2748. router.route("/updateStudentWorkNew4").all((req, res, next) => {
  2749. //学生
  2750. if (req.body[0]) {
  2751. let p = [req.body[0].cid];
  2752. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_student_course_detail2"); //執行存儲過程
  2753. mysql.usselect(p, function(ret) {
  2754. let _unitIndex = parseInt(req.body[0].unitIndex);
  2755. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  2756. let _unitJson = JSON.parse(ret[0][0].chapters);
  2757. if (_unitJson.length - 1 < _unitIndex) {
  2758. let _i = _unitIndex - (_unitJson.length - 1);
  2759. for (let i = 0; i < _i; i++) {
  2760. _unitJson.push({
  2761. dyName: "", //单元标题
  2762. chapterInfo: [{
  2763. isread: false,
  2764. chapterid: guid(),
  2765. title: "",
  2766. courseName: "",
  2767. taskJson: [{
  2768. task: "",
  2769. taskDetail: "",
  2770. chapterData: [],
  2771. toolText: "",
  2772. toolChoose: [{
  2773. tool: [],
  2774. toolDetail: "",
  2775. toolType: 0,
  2776. askCount: 1,
  2777. askTitle: "",
  2778. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  2779. }, ],
  2780. isShowTools: false,
  2781. askCount: 1,
  2782. isFold: 0,
  2783. askTitle: "",
  2784. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  2785. checkJson: [{ checkCount: [], checkPerent: [] }],
  2786. homeworkList: [],
  2787. }, ],
  2788. itemCount: 1,
  2789. fileList1: [],
  2790. video: [],
  2791. testData: [],
  2792. pData: [],
  2793. templateArray: [],
  2794. }, ],
  2795. });
  2796. }
  2797. _unitJson[_unitIndex] = _chapters[_unitIndex];
  2798. } else {
  2799. _unitJson[_unitIndex] = _chapters[_unitIndex];
  2800. }
  2801. // console.log(_unitJson);
  2802. let p2 = [
  2803. req.body[0].cid,
  2804. encodeURIComponent(JSON.stringify(_unitJson)),
  2805. ];
  2806. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew4"); //執行存儲過程
  2807. mysql.usselect(p2, function(ret) {
  2808. res.end(JSON.stringify({ success: 1 }));
  2809. });
  2810. // res.end(JSON.stringify({ success: 1 }));
  2811. });
  2812. }
  2813. });
  2814. //协同删除阶段
  2815. router.route("/deleteWork").all((req, res, next) => {
  2816. if (req.body[0]) {
  2817. let p = [req.body[0].cid];
  2818. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_course_detail"); //執行存儲過程
  2819. mysql.usselect(p, function(ret) {
  2820. let _chapid = req.body[0].chapid;
  2821. // console.log(_chapid);
  2822. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  2823. let _unitJson = JSON.parse(ret[0][0].chapters);
  2824. let _unitJson2 = [];
  2825. for (var i = 0; i < _unitJson.length; i++) {
  2826. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  2827. // console.log(1);
  2828. // _unitJson.splice(i, -1)
  2829. _unitJson2.push(_unitJson[i]);
  2830. // break;
  2831. }
  2832. }
  2833. // console.log(_unitJson2);
  2834. let p2 = [
  2835. req.body[0].cid,
  2836. encodeURIComponent(JSON.stringify(_unitJson2)),
  2837. ];
  2838. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new4"); //執行存儲過程
  2839. mysql.usselect(p2, function(ret) {
  2840. res.end(JSON.stringify({ success: 1 }));
  2841. });
  2842. // res.end(JSON.stringify({ success: 1 }));
  2843. });
  2844. }
  2845. });
  2846. router.route("/deletetrainCourseWork").all((req, res, next) => {
  2847. if (req.body[0]) {
  2848. let p = [req.body[0].cid];
  2849. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_trainCourse_detail"); //執行存儲過程
  2850. mysql.usselect(p, function(ret) {
  2851. let _chapid = req.body[0].chapid;
  2852. // console.log(_chapid);
  2853. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  2854. let _unitJson = JSON.parse(ret[0][0].chapters);
  2855. let _unitJson2 = [];
  2856. for (var i = 0; i < _unitJson.length; i++) {
  2857. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  2858. // console.log(1);
  2859. // _unitJson.splice(i, -1)
  2860. _unitJson2.push(_unitJson[i]);
  2861. // break;
  2862. }
  2863. }
  2864. // console.log(_unitJson2);
  2865. let p2 = [
  2866. req.body[0].cid,
  2867. encodeURIComponent(JSON.stringify(_unitJson2)),
  2868. ];
  2869. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTrainCourseNew4"); //執行存儲過程
  2870. mysql.usselect(p2, function(ret) {
  2871. res.end(JSON.stringify({ success: 1 }));
  2872. });
  2873. // res.end(JSON.stringify({ success: 1 }));
  2874. });
  2875. }
  2876. });
  2877. //协同删除阶段
  2878. router.route("/deleteStudentWork").all((req, res, next) => {
  2879. //学生
  2880. if (req.body[0]) {
  2881. let p = [req.body[0].cid];
  2882. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_student_course_detail2"); //執行存儲過程
  2883. mysql.usselect(p, function(ret) {
  2884. let _chapid = req.body[0].chapid;
  2885. // console.log(_chapid);
  2886. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  2887. let _unitJson = JSON.parse(ret[0][0].chapters);
  2888. let _unitJson2 = [];
  2889. for (var i = 0; i < _unitJson.length; i++) {
  2890. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  2891. // console.log(1);
  2892. // _unitJson.splice(i, -1)
  2893. _unitJson2.push(_unitJson[i]);
  2894. // break;
  2895. }
  2896. }
  2897. // console.log(_unitJson2);
  2898. let p2 = [
  2899. req.body[0].cid,
  2900. encodeURIComponent(JSON.stringify(_unitJson2)),
  2901. ];
  2902. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew4"); //執行存儲過程
  2903. mysql.usselect(p2, function(ret) {
  2904. res.end(JSON.stringify({ success: 1 }));
  2905. });
  2906. // res.end(JSON.stringify({ success: 1 }));
  2907. });
  2908. }
  2909. });
  2910. //协同恢复删除的阶段
  2911. router.route("/restoreWork").all((req, res, next) => {
  2912. if (req.body[0]) {
  2913. let p = [req.body[0].cid];
  2914. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_course_detail"); //執行存儲過程
  2915. mysql.usselect(p, function(ret) {
  2916. let _chapid = req.body[0].chapid;
  2917. // console.log(_chapid);
  2918. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  2919. let _unitJson = JSON.parse(ret[0][0].chapters);
  2920. let _unitJson2 = [];
  2921. let chpaindex;
  2922. for (var i = 0; i < _chapters.length; i++) {
  2923. if (_chapters[i].chapterInfo[0].chapterid == _chapid) {
  2924. chpaindex = i;
  2925. }
  2926. }
  2927. for (var i = 0; i < _unitJson.length; i++) {
  2928. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  2929. // console.log(1);
  2930. // _unitJson.splice(i, -1)
  2931. _unitJson2.push(_unitJson[i]);
  2932. // break;
  2933. }
  2934. }
  2935. _unitJson2.splice(chpaindex, 0, _chapters[chpaindex]);
  2936. // console.log(_unitJson2);
  2937. let p2 = [
  2938. req.body[0].cid,
  2939. encodeURIComponent(JSON.stringify(_unitJson2)),
  2940. ];
  2941. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new4"); //執行存儲過程
  2942. mysql.usselect(p2, function(ret) {
  2943. res.end(JSON.stringify({ success: 1 }));
  2944. });
  2945. // res.end(JSON.stringify({ success: 1 }));
  2946. });
  2947. }
  2948. });
  2949. //协同恢复删除的阶段
  2950. router.route("/restoreTrainCourse").all((req, res, next) => {
  2951. if (req.body[0]) {
  2952. let p = [req.body[0].cid];
  2953. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_trainCourse_detail"); //執行存儲過程
  2954. mysql.usselect(p, function(ret) {
  2955. let _chapid = req.body[0].chapid;
  2956. // console.log(_chapid);
  2957. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  2958. let _unitJson = JSON.parse(ret[0][0].chapters);
  2959. let _unitJson2 = [];
  2960. let chpaindex;
  2961. for (var i = 0; i < _chapters.length; i++) {
  2962. if (_chapters[i].chapterInfo[0].chapterid == _chapid) {
  2963. chpaindex = i;
  2964. }
  2965. }
  2966. for (var i = 0; i < _unitJson.length; i++) {
  2967. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  2968. // console.log(1);
  2969. // _unitJson.splice(i, -1)
  2970. _unitJson2.push(_unitJson[i]);
  2971. // break;
  2972. }
  2973. }
  2974. _unitJson2.splice(chpaindex, 0, _chapters[chpaindex]);
  2975. // console.log(_unitJson2);
  2976. let p2 = [
  2977. req.body[0].cid,
  2978. encodeURIComponent(JSON.stringify(_unitJson2)),
  2979. ];
  2980. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTrainCourseNew4"); //執行存儲過程
  2981. mysql.usselect(p2, function(ret) {
  2982. res.end(JSON.stringify({ success: 1 }));
  2983. });
  2984. // res.end(JSON.stringify({ success: 1 }));
  2985. });
  2986. }
  2987. });
  2988. //协同恢复删除的阶段
  2989. router.route("/restoreStudentWork").all((req, res, next) => {
  2990. //学生
  2991. if (req.body[0]) {
  2992. let p = [req.body[0].cid];
  2993. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_student_course_detail2"); //執行存儲過程
  2994. mysql.usselect(p, function(ret) {
  2995. let _chapid = req.body[0].chapid;
  2996. // console.log(_chapid);
  2997. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  2998. let _unitJson = JSON.parse(ret[0][0].chapters);
  2999. let _unitJson2 = [];
  3000. let chpaindex;
  3001. for (var i = 0; i < _chapters.length; i++) {
  3002. if (_chapters[i].chapterInfo[0].chapterid == _chapid) {
  3003. chpaindex = i;
  3004. }
  3005. }
  3006. for (var i = 0; i < _unitJson.length; i++) {
  3007. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  3008. // console.log(1);
  3009. // _unitJson.splice(i, -1)
  3010. _unitJson2.push(_unitJson[i]);
  3011. // break;
  3012. }
  3013. }
  3014. _unitJson2.splice(chpaindex, 0, _chapters[chpaindex]);
  3015. // console.log(_unitJson2);
  3016. let p2 = [
  3017. req.body[0].cid,
  3018. encodeURIComponent(JSON.stringify(_unitJson2)),
  3019. ];
  3020. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew4"); //執行存儲過程
  3021. mysql.usselect(p2, function(ret) {
  3022. res.end(JSON.stringify({ success: 1 }));
  3023. });
  3024. // res.end(JSON.stringify({ success: 1 }));
  3025. });
  3026. }
  3027. });
  3028. router.route("/selectCourseNew").all((req, res, next) => {
  3029. var json = queryString(req.url);
  3030. getmysql(
  3031. req,
  3032. res,
  3033. "select_course_new",
  3034. json["type"],
  3035. json["uid"],
  3036. json["oid"],
  3037. json["typea"],
  3038. json["typeb"],
  3039. json["typec"],
  3040. json["typed"],
  3041. json["typeE"],
  3042. json["cu"],
  3043. json["cn"],
  3044. json["page"],
  3045. 10
  3046. );
  3047. });
  3048. router.route("/selectCourseNew2").all((req, res, next) => {
  3049. var json = queryString(req.url);
  3050. getmysql(
  3051. req,
  3052. res,
  3053. "select_course_new2",
  3054. json["type"],
  3055. json["uid"],
  3056. json["oid"],
  3057. json["org"],
  3058. json["typea"],
  3059. json["typeb"],
  3060. json["typec"],
  3061. json["typed"],
  3062. json["typeE"],
  3063. json["cu"],
  3064. json["cn"],
  3065. json["page"],
  3066. json["pageSize"]
  3067. );
  3068. });
  3069. router.route("/selectTrainCourseNew2").all((req, res, next) => {
  3070. var json = queryString(req.url);
  3071. getmysql(
  3072. req,
  3073. res,
  3074. "selectTrainCourseNew2",
  3075. json["type"],
  3076. json["uid"],
  3077. json["oid"],
  3078. json["org"],
  3079. json["typea"],
  3080. json["typeb"],
  3081. json["typec"],
  3082. json["typed"],
  3083. json["typeE"],
  3084. json["cu"],
  3085. json["cn"],
  3086. json["page"],
  3087. json["pageSize"]
  3088. );
  3089. });
  3090. router.route("/selectSynergyCourse").all((req, res, next) => {
  3091. var json = queryString(req.url);
  3092. getmysql(
  3093. req,
  3094. res,
  3095. "selectSynergyCourse",
  3096. json["type"],
  3097. json["uid"],
  3098. json["oid"],
  3099. json["org"],
  3100. json["typea"],
  3101. json["typeb"],
  3102. json["typec"],
  3103. json["typed"],
  3104. json["typeE"],
  3105. json["cu"],
  3106. json["cn"],
  3107. json["page"],
  3108. json["pageSize"]
  3109. );
  3110. });
  3111. router.route("/selectStudentCourseNew2").all((req, res, next) => {
  3112. var json = queryString(req.url);
  3113. getmysql(
  3114. req,
  3115. res,
  3116. "selectStudentCourseNew2",
  3117. json["type"],
  3118. json["uid"],
  3119. json["oid"],
  3120. json["org"],
  3121. json["typea"],
  3122. json["typeb"],
  3123. json["typec"],
  3124. json["typed"],
  3125. json["typeE"],
  3126. json["cu"],
  3127. json["cn"],
  3128. json["page"],
  3129. 10
  3130. );
  3131. });
  3132. router.route("/selectStudentCourseNew22").all((req, res, next) => {
  3133. var json = queryString(req.url);
  3134. getmysql(
  3135. req,
  3136. res,
  3137. "selectStudentCourseNew22",
  3138. json["type"],
  3139. json["uid"],
  3140. json["oid"],
  3141. json["org"],
  3142. json["typea"],
  3143. json["typeb"],
  3144. json["typec"],
  3145. json["typed"],
  3146. json["typef"],
  3147. json["typeE"],
  3148. json["cu"],
  3149. json["cn"],
  3150. json["page"],
  3151. json["pageSize"]
  3152. );
  3153. });
  3154. router.route("/selectStudentCourseNew222").all((req, res, next) => {
  3155. var json = queryString(req.url);
  3156. getmysql(
  3157. req,
  3158. res,
  3159. "selectStudentCourseNew222",
  3160. json["type"],
  3161. json["uid"],
  3162. json["oid"],
  3163. json["org"],
  3164. json["typea"],
  3165. json["typeb"],
  3166. json["typec"],
  3167. json["typed"],
  3168. json["typef"],
  3169. json["typeE"],
  3170. json["cu"],
  3171. json["cn"],
  3172. json["page"],
  3173. json["pageSize"]
  3174. );
  3175. });
  3176. //查询评测
  3177. router.route("/selectTesttCourse").all((req, res, next) => {
  3178. var json = queryString(req.url);
  3179. getmysql(
  3180. req,
  3181. res,
  3182. "selectTesttCourse",
  3183. json["type"],
  3184. json["uid"],
  3185. json["oid"],
  3186. json["org"],
  3187. json["typea"],
  3188. json["typeb"],
  3189. json["typec"],
  3190. json["typed"],
  3191. json["typef"],
  3192. json["typeE"],
  3193. json["cu"],
  3194. json["cn"],
  3195. json["page"],
  3196. json["pageSize"]
  3197. );
  3198. });
  3199. //查询评测
  3200. router.route("/selectTesttCourse3").all((req, res, next) => {
  3201. var json = queryString(req.url);
  3202. getmysql(
  3203. req,
  3204. res,
  3205. "selectTesttCourse3",
  3206. json["type"],
  3207. json["uid"],
  3208. json["oid"],
  3209. json["org"],
  3210. json["typea"],
  3211. json["typeb"],
  3212. json["typec"],
  3213. json["typed"],
  3214. json["typef"],
  3215. json["typeE"],
  3216. json["cu"],
  3217. json["cn"],
  3218. json["page"],
  3219. json["pageSize"]
  3220. );
  3221. });
  3222. //查询评测
  3223. router.route("/selectTesttCourse2").all((req, res, next) => {
  3224. var json = queryString(req.url);
  3225. getmysql(
  3226. req,
  3227. res,
  3228. "selectTesttCourse2",
  3229. json["oid"],
  3230. json["org"],
  3231. json["type"],
  3232. json["cn"],
  3233. json["page"],
  3234. json["pageSize"]
  3235. );
  3236. });
  3237. //查询评测 评测中心
  3238. router.route("/selectTesttCourseCenter").all((req, res, next) => {
  3239. var json = queryString(req.url);
  3240. getmysql(
  3241. req,
  3242. res,
  3243. "selectTesttCourseCenter",
  3244. json["type"],
  3245. json["uid"],
  3246. json["oid"],
  3247. json["org"],
  3248. json["classid"],
  3249. json["typea"],
  3250. json["typeb"],
  3251. json["typec"],
  3252. json["typed"],
  3253. json["typef"],
  3254. json["typeE"],
  3255. json["cu"],
  3256. json["cn"],
  3257. json["page"],
  3258. json["pageSize"]
  3259. );
  3260. });
  3261. //查询评测 评测中心及作业
  3262. router.route("/selectTesttCourseCenter1").all((req, res, next) => {
  3263. var json = queryString(req.url);
  3264. getmysql(
  3265. req,
  3266. res,
  3267. "selectTesttCourseCenter1",
  3268. json["type"],
  3269. json["uid"],
  3270. json["oid"],
  3271. json["org"],
  3272. json["classid"],
  3273. json["typea"],
  3274. json["typeb"],
  3275. json["typec"],
  3276. json["typed"],
  3277. json["typef"],
  3278. json["typeE"],
  3279. json["cu"],
  3280. json["cn"],
  3281. json["page"],
  3282. json["pageSize"]
  3283. );
  3284. });
  3285. router.route("/selectStudentCourseNew22Mode").all((req, res, next) => {
  3286. var json = queryString(req.url);
  3287. getmysql(
  3288. req,
  3289. res,
  3290. "selectStudentCourseNew22Mode",
  3291. json["type"],
  3292. json["uid"],
  3293. json["oid"],
  3294. json["org"],
  3295. json["typea"],
  3296. json["typeb"],
  3297. json["typec"],
  3298. json["typed"],
  3299. json["typef"],
  3300. json["typeE"],
  3301. json["cu"],
  3302. json["cn"]
  3303. );
  3304. });
  3305. //查询协同编辑课程
  3306. router.route("/selectCourseTeam").all((req, res, next) => {
  3307. var json = queryString(req.url);
  3308. getmysql(req, res, "selectCourseTeam", json["uid"], json["oid"]);
  3309. });
  3310. //查询学校
  3311. router.route("/selectSchoolName").all((req, res, next) => {
  3312. var json = queryString(req.url);
  3313. getmysql(req, res, "selectOidName", json["cu"], json["cn"], json["page"], 10);
  3314. });
  3315. //查询组织
  3316. router.route("/selectOrgName").all((req, res, next) => {
  3317. var json = queryString(req.url);
  3318. getmysql(req, res, "selectOrgName", json["page"], 10);
  3319. });
  3320. //查询学校
  3321. router.route("/selectSchoolName2").all((req, res, next) => {
  3322. var json = queryString(req.url);
  3323. getmysql(req, res, "selectOidName2", json["oid"]);
  3324. });
  3325. //查询学校
  3326. router.route("/selectSchoolNameOrg").all((req, res, next) => {
  3327. var json = queryString(req.url);
  3328. getmysql(req, res, "selectSchoolNameOrg", json["org"], json["page"], 10);
  3329. });
  3330. //查询协同学校和被协同学校
  3331. router.route("/selectOrgType").all((req, res, next) => {
  3332. var json = queryString(req.url);
  3333. getmysql(req, res, "selectOrgType", json["t"], json["org"], json["page"], 10);
  3334. });
  3335. //新增批注
  3336. router.route("/addPz").all((req, res, next) => {
  3337. postmysql(req, res, "addPz");
  3338. });
  3339. //新增批注
  3340. router.route("/addPz2").all((req, res, next) => {
  3341. postmysql(req, res, "addPz2");
  3342. });
  3343. //新增回复
  3344. router.route("/addHf").all((req, res, next) => {
  3345. postmysql(req, res, "addHf");
  3346. });
  3347. //删除批注
  3348. router.route("/deletePz").all((req, res, next) => {
  3349. postmysql(req, res, "deletePz");
  3350. });
  3351. //删除回复
  3352. router.route("/deleteReply").all((req, res, next) => {
  3353. postmysql(req, res, "deleteReply");
  3354. });
  3355. //查询批注列表
  3356. router.route("/selectPzList").all((req, res, next) => {
  3357. var json = queryString(req.url);
  3358. getmysql(req, res, "selectPzList", json["cid"], json["s"], json["t"]);
  3359. });
  3360. //查询批注列表
  3361. router.route("/selectPzListType").all((req, res, next) => {
  3362. var json = queryString(req.url);
  3363. getmysql(req, res, "selectPzListType", json["cid"], json["s"], json["t"], json["type"], json["uid"]);
  3364. });
  3365. //评分
  3366. router.route("/scoreWork").all((req, res, next) => {
  3367. postmysql(req, res, "scoreWork");
  3368. });
  3369. //删除学生
  3370. router.route("/deleteStudent").all((req, res, next) => {
  3371. postmysql(req, res, "delete_student");
  3372. });
  3373. //查询学校底下的班级
  3374. router.route("/selectClassBySchool").all((req, res, next) => {
  3375. var json = queryString(req.url);
  3376. getmysql(req, res, "selectClassBySchool", json["oid"]);
  3377. });
  3378. //查询学校底下的教研室
  3379. router.route("/selectTeacherOfficeBySchool").all((req, res, next) => {
  3380. var json = queryString(req.url);
  3381. getmysql(req, res, "selectTeacherOfficeBySchool", json["oid"]);
  3382. });
  3383. //查询学校底下的年级
  3384. router.route("/selectGrageBySchool").all((req, res, next) => {
  3385. var json = queryString(req.url);
  3386. getmysql(req, res, "selectGrageBySchool", json["oid"]);
  3387. });
  3388. //查询学校底下的班级
  3389. router.route("/selectClassBySchoolSearch").all((req, res, next) => {
  3390. var json = queryString(req.url);
  3391. getmysql(req, res, "selectClassBySchoolSearch", json["oid"], json["cn"]);
  3392. });
  3393. //查询学校底下的班级
  3394. router.route("/selectClassBySchoolSearch2").all((req, res, next) => {
  3395. var json = queryString(req.url);
  3396. getmysql(req, res, "selectClassBySchoolSearch2", json["oid"], json["gid"], json["cn"]);
  3397. });
  3398. //查询组织底下的学校
  3399. router.route("/selectSchoolByOrg").all((req, res, next) => {
  3400. var json = queryString(req.url);
  3401. getmysql(req, res, "selectSchoolByOrg", json["org"]);
  3402. });
  3403. //学生注册接口
  3404. router.route("/register_student").post(function(req, res, next) {
  3405. //mode的处理
  3406. if (req.body[0]) {
  3407. // 0 用户名 1 用户密码 2用户身份 3 第三方id(可有可无)
  3408. p = Object.values(req.body[0]); //获取用户密码
  3409. //没有第三方id的处理
  3410. // if (p.length < 4) {
  3411. // p.push("")
  3412. // }
  3413. p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
  3414. //密码加密
  3415. // bcrypt.hash(p[1], 10, function (err, hash) {
  3416. // if (err) {
  3417. // return next(err);
  3418. // }
  3419. // p[1] = hash;
  3420. // });
  3421. //参数拼接,注册
  3422. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "register_student");
  3423. //返回注册用户数据
  3424. // mysql.usselect(p, function (ret) {
  3425. // res.end(ret);
  3426. // });
  3427. mysql.usselect(p, function(ret) {
  3428. res.end(JSON.stringify(ret));
  3429. });
  3430. }
  3431. });
  3432. //查询课程详情
  3433. router.route("/selectCourseDetail").all((req, res, next) => {
  3434. var json = queryString(req.url);
  3435. getmysql(req, res, "selectCourseDetail", json["courseId"]);
  3436. });
  3437. //查询课程详情
  3438. router.route("/selectTrainCourseDetail").all((req, res, next) => {
  3439. var json = queryString(req.url);
  3440. getmysql(req, res, "selectTrainCourseDetail", json["courseId"]);
  3441. });
  3442. //查询课程详情
  3443. router.route("/selectCourseDetail2").all((req, res, next) => {
  3444. var json = queryString(req.url);
  3445. getmysql(req, res, "selectCourseDetail2", json["courseId"]);
  3446. });
  3447. //查询课程详情
  3448. router.route("/selectTrainCourseDetail2").all((req, res, next) => {
  3449. var json = queryString(req.url);
  3450. getmysql(req, res, "selectTrainCourseDetail2", json["courseId"]);
  3451. });
  3452. //查询课程详情
  3453. router.route("/selectCourseDetail3").all((req, res, next) => {
  3454. var json = queryString(req.url);
  3455. getmysql(req, res, "selectCourseDetail3", json["courseId"]);
  3456. });
  3457. //查询课程详情
  3458. router.route("/selectTrainCourseDetail3").all((req, res, next) => {
  3459. var json = queryString(req.url);
  3460. getmysql(req, res, "selectTrainCourseDetail3", json["courseId"]);
  3461. });
  3462. //查询学校底下的所有赛事
  3463. router.route("/selectRaceByOid").all((req, res, next) => {
  3464. var json = queryString(req.url);
  3465. getmysql(req, res, "selectRaceByOid", json["sid"]);
  3466. });
  3467. //修改作业学生名称 修1
  3468. router.route("/updateCourseWorksName").get((req, res, next) => {
  3469. var json = queryString(req.url);
  3470. getmysql2(req, res, "updateCourseWorksName", json["n"], json["cid"]);
  3471. });
  3472. //查询课程详情
  3473. router.route("/selectStudentCourseDetail").all((req, res, next) => {
  3474. //学生
  3475. var json = queryString(req.url);
  3476. getmysql(req, res, "selectStudentCourseDetail", json["courseId"]);
  3477. });
  3478. //查询课程详情
  3479. router.route("/selectStudentCourseDetail3").all((req, res, next) => {
  3480. //学生
  3481. var json = queryString(req.url);
  3482. getmysql(req, res, "selectStudentCourseDetail3", json["courseId"]);
  3483. });
  3484. //查询课程详情
  3485. router.route("/selectStudentCourseDetail2").all((req, res, next) => {
  3486. //学生
  3487. var json = queryString(req.url);
  3488. getmysql(req, res, "selectStudentCourseDetail2", json["courseId"]);
  3489. });
  3490. //跳转阶段时,如果有课程就查询1返回,如果没有就插入 修1
  3491. router.route("/addUserR").get((req, res, next) => {
  3492. var json = queryString(req.url);
  3493. getmysql2(req, res, "insertUserR", json["uid"], json["cid"]);
  3494. });
  3495. //新增学生端作业
  3496. router.route("/addWorks").all((req, res, next) => {
  3497. postmysql(req, res, "add_works");
  3498. });
  3499. //查询已提交作业
  3500. router.route("/selectWork").all((req, res, next) => {
  3501. var json = queryString(req.url);
  3502. getmysql(
  3503. req,
  3504. res,
  3505. "selectWork",
  3506. json["cid"],
  3507. json["stage"],
  3508. json["task"],
  3509. json["uid"]
  3510. );
  3511. });
  3512. //查询作业详情
  3513. router.route("/selectWorksDetail").all((req, res, next) => {
  3514. var json = queryString(req.url);
  3515. getmysql(req, res, "selectWorksDetail", json["uid"], json["cid"]);
  3516. });
  3517. //新增作业评分 修1
  3518. router.route("/updateWorks").get((req, res, next) => {
  3519. var json = queryString(req.url);
  3520. getmysql2(req, res, "updateWorks", json["rate"], json["tuid"], json["id"]);
  3521. });
  3522. //新增素材信息 修1
  3523. router.route("/addMtl").get((req, res, next) => {
  3524. var json = queryString(req.url);
  3525. getmysql2(req, res, "add_mtl", json["cInfo"], json["t"], json["cBy"]);
  3526. });
  3527. //根据类型查询素材信息
  3528. router.route("/selectMtl").all((req, res, next) => {
  3529. var json = queryString(req.url);
  3530. getmysql(req, res, "selectMtl", json["t"], json["page"], 10);
  3531. });
  3532. //根据类型查询素材信息
  3533. router.route("/selectMtl2").all((req, res, next) => {
  3534. var json = queryString(req.url);
  3535. getmysql(req, res, "selectMtl2", json["t"], json["uid"], json["page"], 10);
  3536. });
  3537. //学习中心
  3538. //新增学习资源信息 修1
  3539. router.route("/addStuMtl").get((req, res, next) => {
  3540. var json = queryString(req.url);
  3541. getmysql2(req, res, "addStuMtl", json["cInfo"], json["t"], json["cBy"]);
  3542. });
  3543. //根据类型查询学习资料信息
  3544. router.route("/selectStuMtl").all((req, res, next) => {
  3545. var json = queryString(req.url);
  3546. getmysql(req, res, "selectStuMtl", json["t"], json["page"], 10);
  3547. });
  3548. //删除1素材
  3549. router.route("/deleteStuM").all((req, res, next) => {
  3550. var json = queryString(req.url);
  3551. getmysql2(req, res, "deleteStuM", json["id"]);
  3552. });
  3553. //查询学生信息
  3554. router.route("/selectSDetail").all((req, res, next) => {
  3555. var json = queryString(req.url);
  3556. getmysql(req, res, "selectStudentDetail", json["uid"]);
  3557. });
  3558. //查询个人课程
  3559. router.route("/selectMyCourse").all((req, res, next) => {
  3560. var json = queryString(req.url);
  3561. getmysql(req, res, "selectMyCourse", json["uid"]);
  3562. });
  3563. //查询个人课程groupby课程id
  3564. router.route("/selectMyCourseBycid").all((req, res, next) => {
  3565. var json = queryString(req.url);
  3566. getmysql(req, res, "selectMyCourseBycid", json["uid"]);
  3567. });
  3568. //查询所有课程
  3569. router.route("/selectAllCourse").all((req, res, next) => {
  3570. var json = queryString(req.url);
  3571. getmysql(req, res, "selectAllCourse", json["oid"], json["page"], 10);
  3572. });
  3573. //根据班级查询所有课程
  3574. router.route("/selectAllCourseByCid").all((req, res, next) => {
  3575. var json = queryString(req.url);
  3576. getmysql(
  3577. req,
  3578. res,
  3579. "selectAllCourseByCid",
  3580. json["oid"],
  3581. json["cid"],
  3582. json["page"],
  3583. 10
  3584. );
  3585. });
  3586. //根据分类查询所有课程
  3587. router.route("/selectTypeCourse").all((req, res, next) => {
  3588. var json = queryString(req.url);
  3589. getmysql(
  3590. req,
  3591. res,
  3592. "selectTypeCourse",
  3593. json["uid"],
  3594. json["oid"],
  3595. json["typea"],
  3596. json["typeb"],
  3597. json["typec"],
  3598. json["typed"],
  3599. json["typeE"],
  3600. json["cu"],
  3601. json["cn"],
  3602. json["classid"],
  3603. json["page"],
  3604. 10
  3605. );
  3606. });
  3607. //根据分类查询所有课程
  3608. router.route("/selectTypeCourse2").all((req, res, next) => {
  3609. var json = queryString(req.url);
  3610. getmysql(
  3611. req,
  3612. res,
  3613. "selectTypeCourse2",
  3614. json["uid"],
  3615. json["oid"],
  3616. json["typea"],
  3617. json["typeb"],
  3618. json["typec"],
  3619. json["typed"],
  3620. json["typeE"],
  3621. json["cu"],
  3622. json["cn"],
  3623. json["classid"],
  3624. json["org"],
  3625. json["page"],
  3626. json["pageSize"]
  3627. );
  3628. });
  3629. //根据分类查询所有课程
  3630. router.route("/selectTypeCourse22").all((req, res, next) => {
  3631. var json = queryString(req.url);
  3632. getmysql(
  3633. req,
  3634. res,
  3635. "selectTypeCourse22",
  3636. json["uid"],
  3637. json["oid"],
  3638. json["typea"],
  3639. json["typeb"],
  3640. json["typec"],
  3641. json["typed"],
  3642. json["typeE"],
  3643. json["cu"],
  3644. json["cn"],
  3645. json["classid"],
  3646. json["org"],
  3647. json["page"],
  3648. json["pageSize"],
  3649. json["orderBy"]
  3650. );
  3651. });
  3652. //根据分类查询所有课程
  3653. router.route("/selectTypeTrainCourse2").all((req, res, next) => {
  3654. var json = queryString(req.url);
  3655. getmysql(
  3656. req,
  3657. res,
  3658. "selectTypeTrainCourse2",
  3659. json["uid"],
  3660. json["oid"],
  3661. json["typea"],
  3662. json["typeb"],
  3663. json["typec"],
  3664. json["typed"],
  3665. json["typeE"],
  3666. json["cu"],
  3667. json["cn"],
  3668. json["classid"],
  3669. json["org"],
  3670. json["page"],
  3671. json["pageSize"]
  3672. );
  3673. });
  3674. //根据分类查询所有课程
  3675. router.route("/selectTypeCourse2Mode").all((req, res, next) => {
  3676. var json = queryString(req.url);
  3677. getmysql(
  3678. req,
  3679. res,
  3680. "selectTypeCourse2Mode",
  3681. json["uid"],
  3682. json["oid"],
  3683. json["typea"],
  3684. json["typeb"],
  3685. json["typec"],
  3686. json["typed"],
  3687. json["typeE"],
  3688. json["cu"],
  3689. json["cn"],
  3690. json["classid"],
  3691. json["org"]
  3692. );
  3693. });
  3694. //根据分类查询所有课程
  3695. router.route("/selectTypeCourse2Mode2").all((req, res, next) => {
  3696. var json = queryString(req.url);
  3697. getmysql(
  3698. req,
  3699. res,
  3700. "selectTypeCourse2Mode2",
  3701. json["uid"],
  3702. json["oid"],
  3703. json["typea"],
  3704. json["typeb"],
  3705. json["typec"],
  3706. json["typed"],
  3707. json["typeE"],
  3708. json["cu"],
  3709. json["cn"],
  3710. json["classid"],
  3711. json["org"],
  3712. json["orderBy"]
  3713. );
  3714. });
  3715. //根据分类查询所有课程
  3716. router.route("/selectTypeTrainCourse2Mode").all((req, res, next) => {
  3717. var json = queryString(req.url);
  3718. getmysql(
  3719. req,
  3720. res,
  3721. "selectTypeTrainCourse2Mode",
  3722. json["uid"],
  3723. json["oid"],
  3724. json["typea"],
  3725. json["typeb"],
  3726. json["typec"],
  3727. json["typed"],
  3728. json["typeE"],
  3729. json["cu"],
  3730. json["cn"],
  3731. json["classid"],
  3732. json["org"]
  3733. );
  3734. });
  3735. //根据分类查询所有课程
  3736. router.route("/selectTypeCourse2GM").all((req, res, next) => {
  3737. var json = queryString(req.url);
  3738. getmysql(
  3739. req,
  3740. res,
  3741. "selectTypeCourse2GM",
  3742. json["uid"],
  3743. json["oid"],
  3744. json["typea"],
  3745. json["typeb"],
  3746. json["typec"],
  3747. json["typed"],
  3748. json["typeE"],
  3749. json["cu"],
  3750. json["cn"],
  3751. json["classid"],
  3752. json["org"],
  3753. json["page"],
  3754. 10
  3755. );
  3756. });
  3757. //根据分类查询所有课程
  3758. router.route("/selectCourseExamine").all((req, res, next) => {
  3759. var json = queryString(req.url);
  3760. getmysql(
  3761. req,
  3762. res,
  3763. "selectCourseExamine",
  3764. json["oid"],
  3765. json["org"],
  3766. json["cn"],
  3767. json["page"],
  3768. 10
  3769. );
  3770. });
  3771. //根据分类查询所有课程
  3772. router.route("/selectTypeCourse3").all((req, res, next) => {
  3773. var json = queryString(req.url);
  3774. getmysql(
  3775. req,
  3776. res,
  3777. "selectTypeCourse3",
  3778. json["uid"],
  3779. json["oid"],
  3780. json["typea"],
  3781. json["typeb"],
  3782. json["typec"],
  3783. json["typed"],
  3784. json["typeE"],
  3785. json["cu"],
  3786. json["cn"],
  3787. json["classid"],
  3788. json["org"],
  3789. json["page"],
  3790. 10
  3791. );
  3792. });
  3793. //审核课程
  3794. router.route("/examineCourse").all((req, res, next) => {
  3795. postmysql(req, res, "examineCourse");
  3796. });
  3797. //删除1素材
  3798. router.route("/deleteM").all((req, res, next) => {
  3799. var json = queryString(req.url);
  3800. getmysql2(req, res, "deleteM", json["id"]);
  3801. });
  3802. //点击阶段时添加观看人数 修1
  3803. router.route("/updateVc").get((req, res, next) => {
  3804. var json = queryString(req.url);
  3805. getmysql2(req, res, "updateVc", json["cid"]);
  3806. });
  3807. //点击阶段时添加观看人数 修1
  3808. router.route("/updateVcTrain").get((req, res, next) => {
  3809. var json = queryString(req.url);
  3810. getmysql2(req, res, "updateVcTrain", json["cid"]);
  3811. });
  3812. //删除1课程
  3813. router.route("/deleteCourse").all((req, res, next) => {
  3814. var json = queryString(req.url);
  3815. getmysql2(req, res, "deleteCourse", json["cid"]);
  3816. });
  3817. //删除1课程
  3818. router.route("/deleteTrainCourse").all((req, res, next) => {
  3819. var json = queryString(req.url);
  3820. getmysql2(req, res, "deleteTrainCourse", json["cid"]);
  3821. });
  3822. //删除1课程
  3823. router.route("/deleteSynergyCourse").all((req, res, next) => {
  3824. var json = queryString(req.url);
  3825. getmysql2(req, res, "deleteSynergyCourse", json["cid"]);
  3826. });
  3827. //删除1课程
  3828. router.route("/deleteStudentCourse").all((req, res, next) => {
  3829. var json = queryString(req.url);
  3830. getmysql2(req, res, "deleteStudentCourse", json["cid"]);
  3831. });
  3832. //复制课程
  3833. router.route("/copyCourse").all((req, res, next) => {
  3834. postmysql(req, res, "copyCourse");
  3835. });
  3836. //复制课程
  3837. router.route("/copyCourseSz").all((req, res, next) => {
  3838. postmysql2(req, res, "copyCourse");
  3839. });
  3840. //返回复制课程
  3841. router.route("/getcopyCourseSz").all((req, res, next) => {
  3842. postmysql2(req, res, "getcopyCourseSz");
  3843. });
  3844. //返回复制课程自己的
  3845. router.route("/getcopyCourseByUseridSz").all((req, res, next) => {
  3846. postmysql2(req, res, "getcopyCourseByUseridSz");
  3847. });
  3848. //查看课程信息
  3849. router.route("/selectCourseDetailSz").all((req, res, next) => {
  3850. postmysql2(req, res, "selectCourseDetailSz");
  3851. });
  3852. //复制课程
  3853. router.route("/copyTrainCourse").all((req, res, next) => {
  3854. postmysql(req, res, "copyTrainCourse");
  3855. });
  3856. //复制课程
  3857. router.route("/copyTest").all((req, res, next) => {
  3858. postmysql(req, res, "copyTest");
  3859. });
  3860. //复制课程
  3861. router.route("/copySynergyCourse").all((req, res, next) => {
  3862. postmysql(req, res, "copySynergyCourse");
  3863. });
  3864. //复制评价体系
  3865. router.route("/copyEva").all((req, res, next) => {
  3866. postmysql(req, res, "copyEva");
  3867. });
  3868. //复制课程
  3869. router.route("/copySCourse").all((req, res, next) => {
  3870. postmysql(req, res, "copySCourse");
  3871. });
  3872. //查看课程
  3873. router.route("/select_course_detail").all((req, res, next) => {
  3874. var json = queryString(req.url);
  3875. getmysql(req, res, "select_course_detail", json["cid"]);
  3876. });
  3877. //查看课程
  3878. router.route("/select_trainCourse_detail").all((req, res, next) => {
  3879. var json = queryString(req.url);
  3880. getmysql(req, res, "select_trainCourse_detail", json["cid"]);
  3881. });
  3882. //删除评测
  3883. router.route("/deleteTestCourseWorks").all((req, res, next) => {
  3884. postmysql(req, res, "deleteTestCourseWorks");
  3885. });
  3886. //查看评测
  3887. router.route("/selectTestType").all((req, res, next) => {
  3888. var json = queryString(req.url);
  3889. getmysql(req, res, "selectTestType", json["oid"]);
  3890. });
  3891. //查看评测
  3892. router.route("/getTestCourseDetail").all((req, res, next) => {
  3893. var json = queryString(req.url);
  3894. getmysql(req, res, "getTestCourseDetail", json["cid"]);
  3895. });
  3896. //查看评测
  3897. router.route("/selectPostilByUid").all((req, res, next) => {
  3898. var json = queryString(req.url);
  3899. getmysql(req, res, "selectPostilByUid", json["uid"]);
  3900. });
  3901. //查看评测
  3902. router.route("/getTestWorkShare").all((req, res, next) => {
  3903. var json = queryString(req.url);
  3904. getmysql(req, res, "getTestWorkShare", json["id"]);
  3905. });
  3906. //查看评测
  3907. router.route("/getTestWorkShareCopy").all((req, res, next) => {
  3908. var json = queryString(req.url);
  3909. getmysql(req, res, "getTestWorkShareCopy", json["id"], json["tea"]);
  3910. });
  3911. //查看fileid
  3912. router.route("/selectFileId").all((req, res, next) => {
  3913. var json = queryString(req.url);
  3914. getmysql(req, res, "selectFileId", json["oid"]);
  3915. });
  3916. //查看fileid
  3917. router.route("/selectAiFileId").all((req, res, next) => {
  3918. var json = queryString(req.url);
  3919. getmysql(req, res, "selectAiFileId", json["oid"]);
  3920. });
  3921. //查看fileid
  3922. router.route("/selectKnowFileid").all((req, res, next) => {
  3923. var json = queryString(req.url);
  3924. getmysql(req, res, "selectKnowFileid", json["oid"], json["sta"]);
  3925. });
  3926. //查看课程
  3927. router.route("/select_synergy").all((req, res, next) => {
  3928. var json = queryString(req.url);
  3929. getmysql(req, res, "select_synergy", json["cid"]);
  3930. });
  3931. //查看课程
  3932. router.route("/select_student_course_detail").all((req, res, next) => {
  3933. //学生
  3934. var json = queryString(req.url);
  3935. getmysql(req, res, "select_student_course_detail", json["cid"]);
  3936. });
  3937. //查看课程
  3938. router.route("/select_student_course_detail2").all((req, res, next) => {
  3939. //学生
  3940. var json = queryString(req.url);
  3941. getmysql(req, res, "select_student_course_detail2", json["cid"]);
  3942. });
  3943. //查看课程
  3944. router.route("/getExportScourse").all((req, res, next) => {
  3945. //学生
  3946. var json = queryString(req.url);
  3947. getmysql(req, res, "getExportScourse", json["cid"]);
  3948. });
  3949. //模糊查找课程
  3950. // router.route('/searchCourse').all((req, res, next) => {
  3951. // var json = queryString(req.url);
  3952. // getmysql(req, res, "searchCourse", json['cu'], json['cn'], json['page'], 10);
  3953. // });
  3954. //创建调查问卷
  3955. router.route("/addAsk").all((req, res, next) => {
  3956. postmysql(req, res, "insert_ask");
  3957. });
  3958. //学生提交问卷
  3959. router.route("/addAskList").all((req, res, next) => {
  3960. postmysql(req, res, "insert_askList");
  3961. });
  3962. //根据课程id阶段id获取已提交的问卷
  3963. router.route("/getAskListByCidStage").all((req, res, next) => {
  3964. var json = queryString(req.url);
  3965. getmysql(
  3966. req,
  3967. res,
  3968. "getAskListByCidStage",
  3969. json["cid"],
  3970. json["stage"],
  3971. json["task"]
  3972. );
  3973. });
  3974. //获取调查问卷
  3975. router.route("/getAsk").all((req, res, next) => {
  3976. var json = queryString(req.url);
  3977. getmysql(req, res, "select_ask", json["uid"], json["page"], 10);
  3978. });
  3979. //删除问卷
  3980. router.route("/deleteAsk").all((req, res, next) => {
  3981. postmysql(req, res, "deleteAsk");
  3982. });
  3983. //问卷调查数据统计
  3984. router.route("/getAskListByAskid").all((req, res, next) => {
  3985. var json = queryString(req.url);
  3986. getmysql(req, res, "select_askListByAskid", json["aid"]);
  3987. });
  3988. //删除学生提交问卷
  3989. router.route("/deleteAskList").all((req, res, next) => {
  3990. postmysql(req, res, "update_askList_delete");
  3991. });
  3992. //根据id获取调查问卷
  3993. router.route("/getAskList").all((req, res, next) => {
  3994. var json = queryString(req.url);
  3995. getmysql(req, res, "select_askList", json["uid"], json["page"], 10);
  3996. });
  3997. //查看便签列表
  3998. router.route("/selectNote").all((req, res, next) => {
  3999. var json = queryString(req.url);
  4000. getmysql(req, res, "selectNote", json["uid"]);
  4001. });
  4002. //新增便签列表 修1
  4003. router.route("/insertNote").get((req, res, next) => {
  4004. var json = queryString(req.url);
  4005. getmysql2(req, res, "insertNote", json["uid"], json["c"]);
  4006. });
  4007. //根据便签id修改便签内容 修1
  4008. router.route("/updateNote").get((req, res, next) => {
  4009. var json = queryString(req.url);
  4010. getmysql2(req, res, "updateNote", json["nid"], json["c"]);
  4011. });
  4012. //删除1便签
  4013. router.route("/deleteNote").all((req, res, next) => {
  4014. var json = queryString(req.url);
  4015. getmysql2(req, res, "deleteNote", json["nid"]);
  4016. });
  4017. //查询便签
  4018. router.route("/selectNoteContent").all((req, res, next) => {
  4019. var json = queryString(req.url);
  4020. getmysql(req, res, "selectNoteContent", json["cn"]);
  4021. });
  4022. //修改用户信息
  4023. router.route("/updateUserByEdu").all((req, res, next) => {
  4024. postmysql(req, res, "updateUserByEdu");
  4025. });
  4026. //修改用户信息
  4027. router.route("/updateUserByEdu1").all((req, res, next) => {
  4028. postmysql(req, res, "updateUserByEdu1");
  4029. });
  4030. //修改用户信息
  4031. router.route("/updateUserByEduOid").all((req, res, next) => {
  4032. postmysql(req, res, "updateUserByEduOid");
  4033. });
  4034. //修改学生信息
  4035. router.route("/updateStudentInfo").all((req, res, next) => {
  4036. postmysql(req, res, "updateStudentInfo");
  4037. });
  4038. //教师端data修改pbl用户信息
  4039. router.route("/updatePblMessage").all((req, res, next) => {
  4040. postmysql2(req, res, "updatePblMessage");
  4041. });
  4042. //登录次数
  4043. router.route("/addLoginOperation").all((req, res, next) => {
  4044. postmysql2(req, res, "addLoginOperation");
  4045. });
  4046. //当日登录时间
  4047. router.route("/addOperationTime").all((req, res, next) => {
  4048. postmysql2(req, res, "addOperationTime");
  4049. });
  4050. //课程学习时间
  4051. router.route("/addOperationTime2").all((req, res, next) => {
  4052. postmysql(req, res, "addOperationTime");
  4053. });
  4054. //当日登录时间
  4055. router.route("/addOperationTimeT").all((req, res, next) => {
  4056. postmysql2(req, res, "addOperationTime2");
  4057. });
  4058. //课程学习时间
  4059. router.route("/addOperationTimeT2").all((req, res, next) => {
  4060. postmysql(req, res, "addOperationTime2");
  4061. });
  4062. //记录用户协同建构操作
  4063. router.route("/add_OperationCSCL").all((req, res, next) => {
  4064. postmysql2(req, res, "add_OperationCSCL");
  4065. });
  4066. //获取所有分组协同数据
  4067. router.route("/select_CSCLDataByID").all((req, res, next) => {
  4068. postmysql2(req, res, "select_CSCLDataByID");
  4069. });
  4070. //获取项目所有的分组所有的人操作数据的总数和时间
  4071. router.route("/select_CSCLDataCount").all((req, res, next) => {
  4072. postmysql2(req, res, "select_CSCLDataCount");
  4073. });
  4074. //获取用户在某个分组的操作日志
  4075. router.route("/select_CSCLDataByUserIdID").all((req, res, next) => {
  4076. postmysql2(req, res, "select_CSCLDataByUserIdID");
  4077. });
  4078. router.route("/updatePblMessage2").all((req, res, next) => {
  4079. postmysql(req, res, "updatePblMessage");
  4080. });
  4081. router.route("/updateUserInfoText").all((req, res, next) => {
  4082. postmysql(req, res, "updateUserInfoText");
  4083. });
  4084. //修改幼儿园评价个人信息
  4085. router.route("/updateStudentInfoText").all((req, res, next) => {
  4086. postmysql(req, res, "updateStudentInfoText");
  4087. });
  4088. router.route("/updateRaceUser").all((req, res, next) => {
  4089. postmysql(req, res, "updateRaceUser");
  4090. });
  4091. //查询用户信息
  4092. router.route("/selectUser").all((req, res, next) => {
  4093. var json = queryString(req.url);
  4094. getmysql(req, res, "selectUser", json["userid"]);
  4095. });
  4096. //查询用户信息
  4097. router.route("/selectUserSzdjg").all((req, res, next) => {
  4098. var json = queryString(req.url);
  4099. getmysql(req, res, "selectUserSzdjg", json["username"]);
  4100. });
  4101. //新增英语写作批改 修1
  4102. router.route("/addEngC").get((req, res, next) => {
  4103. var json = queryString(req.url);
  4104. getmysql2(req, res, "insertEngCorrect", json["cid"], json["s"], json["t"], json["tool"], json["wid"], json["c"], json["w"]);
  4105. });
  4106. //查询英语写作批改
  4107. router.route("/selectEngC").all((req, res, next) => {
  4108. var json = queryString(req.url);
  4109. getmysql(req, res, "selectEngCorrect", json["workid"]);
  4110. });
  4111. //查询英语写作作业
  4112. router.route("/selectEngWork").all((req, res, next) => {
  4113. var json = queryString(req.url);
  4114. getmysql(req, res, "selectEngWork", json["wid"]);
  4115. });
  4116. //新增或修改英语写作评价 修1
  4117. router.route("/addEngEva").get((req, res, next) => {
  4118. var json = queryString(req.url);
  4119. getmysql2(req, res, "addEngEva", json["id"], json["aic"], json["tc"]);
  4120. });
  4121. //查询分类及所有子分类
  4122. router.route("/selectAllType").all((req, res, next) => {
  4123. var json = queryString(req.url);
  4124. getmysql(req, res, "selectAllType", json["org"], json["oid"]);
  4125. });
  4126. //查询分类及所有子分类 stand
  4127. router.route("/selectAllTypeStand").all((req, res, next) => {
  4128. var json = queryString(req.url);
  4129. getmysql(req, res, "selectAllTypeStand", json["org"], json["oid"], json["stand"]);
  4130. });
  4131. //查询分类及所有子分类
  4132. router.route("/selectAllTrainType").all((req, res, next) => {
  4133. var json = queryString(req.url);
  4134. getmysql(req, res, "selectAllTrainType", json["org"], json["oid"]);
  4135. });
  4136. //查询分类及所有子分类
  4137. router.route("/selectAllTypeS").all((req, res, next) => {
  4138. var json = queryString(req.url);
  4139. getmysql(req, res, "selectAllTypeS", json["org"], json["oid"]);
  4140. });
  4141. //查询分类及所有子分类
  4142. router.route("/selectAllTypeT").all((req, res, next) => {
  4143. var json = queryString(req.url);
  4144. getmysql(req, res, "selectAllTypeT", json["org"], json["oid"]);
  4145. });
  4146. //查询分类及子分类
  4147. router.route("/selectType").all((req, res, next) => {
  4148. var json = queryString(req.url);
  4149. getmysql(req, res, "selectType");
  4150. });
  4151. //查询分类及子分类
  4152. router.route("/selectStudentType").all((req, res, next) => {
  4153. var json = queryString(req.url);
  4154. getmysql(req, res, "selectStudentType");
  4155. });
  4156. //查询赛事分类及子分类
  4157. router.route("/selectMatType").all((req, res, next) => {
  4158. var json = queryString(req.url);
  4159. getmysql(req, res, "selectMatType");
  4160. });
  4161. //查询赛事分类及子分类
  4162. router.route("/selectRaceNum").all((req, res, next) => {
  4163. var json = queryString(req.url);
  4164. getmysql(req, res, "selectRaceNum", json["oid"]);
  4165. });
  4166. //根据学校查询分类
  4167. router.route("/selectPtype").all((req, res, next) => {
  4168. var json = queryString(req.url);
  4169. getmysql(req, res, "selectPtype", json["page"], 10);
  4170. });
  4171. //根据学校查询学生项目分类
  4172. router.route("/selectSPtype").all((req, res, next) => {
  4173. var json = queryString(req.url);
  4174. getmysql(req, res, "selectSPtype", json["page"], 10);
  4175. });
  4176. //根据学校查询分类1
  4177. router.route("/selectPtype1").all((req, res, next) => {
  4178. var json = queryString(req.url);
  4179. getmysql(req, res, "selectPtype1", json["oid"], json["page"], 10);
  4180. });
  4181. //添加分类 修1
  4182. router.route("/addPtype").get((req, res, next) => {
  4183. var json = queryString(req.url);
  4184. getmysql2(req, res, "addPtype", json["n"], json["uid"], json["oid"]);
  4185. });
  4186. //修改分类 修1
  4187. router.route("/updatePtype").get((req, res, next) => {
  4188. var json = queryString(req.url);
  4189. getmysql2(req, res, "updatePtype", json["n"], json["tid"]);
  4190. });
  4191. //修改学生项目分类 修1
  4192. router.route("/updateSPtype").get((req, res, next) => {
  4193. var json = queryString(req.url);
  4194. getmysql2(req, res, "updateSPtype", json["n"], json["tid"]);
  4195. });
  4196. //删除1分类
  4197. router.route("/deletePtype").all((req, res, next) => {
  4198. var json = queryString(req.url);
  4199. getmysql2(req, res, "deletePtype", json["tid"]);
  4200. });
  4201. //删除1学生项目分类
  4202. router.route("/deleteSPtype").all((req, res, next) => {
  4203. var json = queryString(req.url);
  4204. getmysql2(req, res, "deleteSPtype", json["tid"]);
  4205. });
  4206. //查询子分类列表
  4207. router.route("/selectStype").all((req, res, next) => {
  4208. var json = queryString(req.url);
  4209. getmysql(req, res, "selectStype", json["pid"], json["oid"], json["page"], 10);
  4210. });
  4211. //查询学生项目子分类列表
  4212. router.route("/selectSStype").all((req, res, next) => {
  4213. var json = queryString(req.url);
  4214. getmysql(
  4215. req,
  4216. res,
  4217. "selectSStype",
  4218. json["pid"],
  4219. json["oid"],
  4220. json["page"],
  4221. 10
  4222. );
  4223. });
  4224. //添加子分类 修1
  4225. router.route("/addStype").get((req, res, next) => {
  4226. var json = queryString(req.url);
  4227. getmysql2(
  4228. req,
  4229. res,
  4230. "addStype",
  4231. json["pid"],
  4232. json["n"],
  4233. json["uid"],
  4234. json["oid"]
  4235. );
  4236. });
  4237. //添加学生项目子分类 修1
  4238. router.route("/addSStype").get((req, res, next) => {
  4239. var json = queryString(req.url);
  4240. getmysql2(
  4241. req,
  4242. res,
  4243. "addSStype",
  4244. json["pid"],
  4245. json["n"],
  4246. json["uid"],
  4247. json["oid"]
  4248. );
  4249. });
  4250. //根据学校查询工作分类
  4251. router.route("/selectStudioPtype").all((req, res, next) => {
  4252. var json = queryString(req.url);
  4253. getmysql(req, res, "selectStudioPtype", json["page"], 10);
  4254. });
  4255. //查询工作室项目子分类列表
  4256. router.route("/selectStudioStype").all((req, res, next) => {
  4257. var json = queryString(req.url);
  4258. getmysql(
  4259. req,
  4260. res,
  4261. "selectStudioStype",
  4262. json["pid"],
  4263. json["oid"],
  4264. json["page"],
  4265. 10
  4266. );
  4267. });
  4268. //添加工作室项目子分类 修1
  4269. router.route("/addStudioStype").get((req, res, next) => {
  4270. var json = queryString(req.url);
  4271. getmysql2(
  4272. req,
  4273. res,
  4274. "addStudioStype",
  4275. json["pid"],
  4276. json["n"],
  4277. json["uid"],
  4278. json["oid"]
  4279. );
  4280. });
  4281. //修改工作项目分类 修1
  4282. router.route("/updateStudioPtype").get((req, res, next) => {
  4283. var json = queryString(req.url);
  4284. getmysql2(req, res, "updateStudioPtype", json["n"], json["tid"]);
  4285. });
  4286. //删除1工作项目分类
  4287. router.route("/deleteStudioPtype").all((req, res, next) => {
  4288. var json = queryString(req.url);
  4289. getmysql2(req, res, "deleteStudioPtype", json["tid"]);
  4290. });
  4291. //查看本校所有学生(分页)
  4292. router.route("/selectAllStudent").all((req, res, next) => {
  4293. var json = queryString(req.url);
  4294. getmysql(
  4295. req,
  4296. res,
  4297. "selectAllStudent",
  4298. json["oid"],
  4299. json["cn"],
  4300. json["cid"],
  4301. json["page"],
  4302. 10
  4303. );
  4304. });
  4305. //查看本校所有学生(分页)teacher
  4306. router.route("/selectAllStudentTeacher").all((req, res, next) => {
  4307. var json = queryString(req.url);
  4308. getmysql(
  4309. req,
  4310. res,
  4311. "selectAllStudentTeacher",
  4312. json["oid"],
  4313. json["cn"],
  4314. json["cid"],
  4315. json["userid"],
  4316. json["page"],
  4317. 10
  4318. );
  4319. });
  4320. //根据学校id查询子分类
  4321. router.route("/selectTypeByOid").all((req, res, next) => {
  4322. var json = queryString(req.url);
  4323. getmysql(req, res, "selectTypeByOid", json["oid"]);
  4324. });
  4325. //根据学校id查询子分类
  4326. router.route("/selectTypeByOrg").all((req, res, next) => {
  4327. var json = queryString(req.url);
  4328. getmysql(req, res, "selectTypeByOid", json["oid"]);
  4329. });
  4330. //根据组织id查询子分类
  4331. router.route("/selectStudentTypeByOid").all((req, res, next) => {
  4332. var json = queryString(req.url);
  4333. getmysql(req, res, "selectStudentTypeByOid", json["oid"]);
  4334. });
  4335. //更加父id查询分类
  4336. router.route("/selectTypeByPid").all((req, res, next) => {
  4337. var json = queryString(req.url);
  4338. getmysql(req, res, "selectTypeByPid", json["pid"]);
  4339. });
  4340. //点击工具计数 修1
  4341. router.route("/insertToolsCount").get((req, res, next) => {
  4342. var json = queryString(req.url);
  4343. getmysql2(
  4344. req,
  4345. res,
  4346. "insertToolsCount",
  4347. json["cid"],
  4348. json["chid"],
  4349. json["uid"],
  4350. json["tid"],
  4351. json["count"]
  4352. );
  4353. });
  4354. //修改工具次数 修1
  4355. router.route("/updateToolsCount").get((req, res, next) => {
  4356. var json = queryString(req.url);
  4357. getmysql2(
  4358. req,
  4359. res,
  4360. "updateToolsCount",
  4361. json["cid"],
  4362. json["chid"],
  4363. json["uid"],
  4364. json["tid"],
  4365. json["count"]
  4366. );
  4367. });
  4368. //查询工具次数
  4369. router.route("/selectToolsCount").all((req, res, next) => {
  4370. var json = queryString(req.url);
  4371. getmysql(
  4372. req,
  4373. res,
  4374. "selectToolsCount",
  4375. json["cid"],
  4376. json["chid"],
  4377. json["uid"]
  4378. );
  4379. });
  4380. //导出学生
  4381. router.route("/selectUserBySchool").all((req, res, next) => {
  4382. var json = queryString(req.url);
  4383. getmysql(req, res, "selectUserBySchool", json["oid"]);
  4384. });
  4385. //上传学生作业 修1
  4386. router.route("/insertSWork").get((req, res, next) => {
  4387. var json = queryString(req.url);
  4388. getmysql2(
  4389. req,
  4390. res,
  4391. "insertSWork",
  4392. json["uid"],
  4393. json["cid"],
  4394. json["p"],
  4395. json["t"],
  4396. json["upload"]
  4397. );
  4398. });
  4399. //查询学生作业
  4400. router.route("/selectSWork").all((req, res, next) => {
  4401. var json = queryString(req.url);
  4402. getmysql(
  4403. req,
  4404. res,
  4405. "selectSWork",
  4406. json["uid"],
  4407. json["cid"],
  4408. json["p"],
  4409. json["type"]
  4410. );
  4411. });
  4412. //课程进展数据
  4413. router.route("/selectCase").all((req, res, next) => {
  4414. var json = queryString(req.url);
  4415. getmysql(req, res, "selectCase", json["org"]);
  4416. });
  4417. //课程进展数据
  4418. router.route("/selectCase2").all((req, res, next) => {
  4419. var json = queryString(req.url);
  4420. getmysql(req, res, "selectCase2", json["org"]);
  4421. });
  4422. //课程进展数据
  4423. router.route("/selectCase3").all((req, res, next) => {
  4424. var json = queryString(req.url);
  4425. getmysql(
  4426. req,
  4427. res,
  4428. "selectCase3",
  4429. json["org"],
  4430. json["oid"],
  4431. json["page"],
  4432. json["pageSize"]
  4433. );
  4434. });
  4435. //课程进展数据
  4436. router.route("/selectCase4").all((req, res, next) => {
  4437. var json = queryString(req.url);
  4438. getmysql(
  4439. req,
  4440. res,
  4441. "selectCase4",
  4442. json["org"],
  4443. json["oid"],
  4444. json["typeA"],
  4445. json["typeB"],
  4446. json["typeC"],
  4447. json["typeD"],
  4448. json["typeE"],
  4449. json["page"],
  4450. json["pageSize"]
  4451. );
  4452. });
  4453. //项目进展数据
  4454. router.route("/selectCaseS").all((req, res, next) => {
  4455. var json = queryString(req.url);
  4456. getmysql(req, res, "selectCaseS", json["org"], json["oid"]);
  4457. });
  4458. //项目进展数据
  4459. router.route("/selectCaseS2").all((req, res, next) => {
  4460. var json = queryString(req.url);
  4461. getmysql(
  4462. req,
  4463. res,
  4464. "selectCaseS2",
  4465. json["org"],
  4466. json["oid"],
  4467. json["type"],
  4468. json["page"],
  4469. json["pageSize"]
  4470. );
  4471. });
  4472. //查询赛事项目列表
  4473. router.route("/selectRaceList").all((req, res, next) => {
  4474. var json = queryString(req.url);
  4475. getmysql(req, res, "selectRaceList", json["uid"], json["t"]);
  4476. });
  4477. //修改赛事状态 修1
  4478. router.route("/updateRaceState").get((req, res, next) => {
  4479. var json = queryString(req.url);
  4480. getmysql2(req, res, "updateRaceState", json["id"], json["s"]);
  4481. });
  4482. //查询赛事项目详情
  4483. router.route("/selectRaceDetail").all((req, res, next) => {
  4484. var json = queryString(req.url);
  4485. getmysql(req, res, "selectRaceDetail", json["id"]);
  4486. });
  4487. //race 查询学校
  4488. router.route("/getSchool").all((req, res, next) => {
  4489. var json = queryString(req.url);
  4490. getmysql(req, res, "getSchool", json["n"]);
  4491. });
  4492. //查询我的学习报告
  4493. router.route("/selectMrEva").all((req, res, next) => {
  4494. var json = queryString(req.url);
  4495. getmysql(req, res, "selectMrEva", json["uid"], json["oid"], json["cid"]);
  4496. });
  4497. //查询行为数据库
  4498. router.route("/selectModelList").all((req, res, next) => {
  4499. var json = queryString(req.url);
  4500. getmysql(req, res, "selectModelList", json["cn"], json["oid"]);
  4501. });
  4502. //lsc
  4503. //admin 查询学校
  4504. router.route("/getSchoolAdmin").all((req, res, next) => {
  4505. var json = queryString(req.url);
  4506. getmysql(req, res, "select_school", json["page"], 10);
  4507. });
  4508. //admin 添加学校
  4509. router.route("/addSchoolAdmin").all((req, res, next) => {
  4510. postmysql(req, res, "add_school");
  4511. });
  4512. //组织添加学校
  4513. router.route("/addSchoolOrg").all((req, res, next) => {
  4514. postmysql(req, res, "addSchoolOrg");
  4515. });
  4516. //教师端组织添加学校
  4517. router.route("/insertSchoolByOrg").all((req, res, next) => {
  4518. postmysql(req, res, "insertSchoolByOrg");
  4519. });
  4520. //admin 删除学校
  4521. router.route("/deleteSchoolAdmin").all((req, res, next) => {
  4522. postmysql(req, res, "delete_school");
  4523. });
  4524. //admin 查询班级
  4525. router.route("/getClassAdmin").all((req, res, next) => {
  4526. var json = queryString(req.url);
  4527. getmysql(req, res, "select_classAdmin", json["cn"], json["page"], 10);
  4528. });
  4529. //查询ai权限
  4530. router.route("/getAIJ").all((req, res, next) => {
  4531. getmysql(req, res, "getAIJ");
  4532. });
  4533. //admin 添加班级
  4534. router.route("/addClassAdmin").all((req, res, next) => {
  4535. postmysql(req, res, "add_classAdmin");
  4536. });
  4537. //admin 查询班级是否重复
  4538. router.route("/getClassRepeat").all((req, res, next) => {
  4539. var json = queryString(req.url);
  4540. getmysql(req, res, "select_classRepeatAdmin", json["n"], json["oid"]);
  4541. });
  4542. //查询未在此班级的学生
  4543. router.route("/getClassStudent").all((req, res, next) => {
  4544. var json = queryString(req.url);
  4545. getmysql(
  4546. req,
  4547. res,
  4548. "getClassStudent",
  4549. json["cid"],
  4550. json["oid"],
  4551. json["cn"],
  4552. json["page"],
  4553. json["num"]
  4554. );
  4555. });
  4556. //查询未在此教研室的老师
  4557. router.route("/getClassTeacher").all((req, res, next) => {
  4558. var json = queryString(req.url);
  4559. getmysql(
  4560. req,
  4561. res,
  4562. "getClassTeacher",
  4563. json["cid"],
  4564. json["oid"],
  4565. json["cn"],
  4566. json["page"],
  4567. json["num"]
  4568. );
  4569. });
  4570. //查询未在此年级的班级
  4571. router.route("/getGradeClass").all((req, res, next) => {
  4572. var json = queryString(req.url);
  4573. getmysql(
  4574. req,
  4575. res,
  4576. "getGradeClass",
  4577. json["cid"],
  4578. json["oid"],
  4579. json["cn"],
  4580. json["page"],
  4581. json["num"]
  4582. );
  4583. });
  4584. //添加学生到班级
  4585. router.route("/addClassStudent").all((req, res, next) => {
  4586. let cid = req.body[0].cid;
  4587. let student = JSON.parse(decodeURIComponent(req.body[0].student));
  4588. for (let i = 0; i < student.length; i++) {
  4589. let _userdata = [student[i]];
  4590. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
  4591. mysql.usselect(_userdata, function(ret) {
  4592. let classid = ret[0][0].classid;
  4593. if (!classid || classid.indexOf(cid) == -1) {
  4594. classid = classid ? classid.split(",") : [];
  4595. classid.push(cid);
  4596. let _userdata2 = [student[i], classid.join(",")];
  4597. _userdata2.unshift(
  4598. _mysqlLabor[0],
  4599. _mysqlLabor[1],
  4600. "updateStudentClass"
  4601. );
  4602. mysql.usselect(_userdata2, function(ret) {
  4603. if (i == student.length - 1) {
  4604. res.end(JSON.stringify({ success: 1 }));
  4605. }
  4606. });
  4607. }
  4608. });
  4609. }
  4610. });
  4611. //添加老师到教研室
  4612. router.route("/addClassTeacher").all((req, res, next) => {
  4613. let cid = req.body[0].cid;
  4614. let student = JSON.parse(decodeURIComponent(req.body[0].student));
  4615. for (let i = 0; i < student.length; i++) {
  4616. let _userdata = [student[i]];
  4617. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
  4618. mysql.usselect(_userdata, function(ret) {
  4619. let classid = ret[0][0].cclassid;
  4620. if (!classid || classid.indexOf(cid) == -1) {
  4621. classid = classid ? classid.split(",") : [];
  4622. classid.push(cid);
  4623. let _userdata2 = [student[i], classid.join(",")];
  4624. _userdata2.unshift(
  4625. _mysqlLabor[0],
  4626. _mysqlLabor[1],
  4627. "updateTeacherClass"
  4628. );
  4629. mysql.usselect(_userdata2, function(ret) {
  4630. if (i == student.length - 1) {
  4631. res.end(JSON.stringify({ success: 1 }));
  4632. }
  4633. });
  4634. }
  4635. });
  4636. }
  4637. });
  4638. //添加班级到年级
  4639. router.route("/addGradeClass").all((req, res, next) => {
  4640. let cid = req.body[0].cid;
  4641. let student = JSON.parse(decodeURIComponent(req.body[0].student));
  4642. for (let i = 0; i < student.length; i++) {
  4643. let _userdata = [cid, student[i]];
  4644. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "addGradeClass");
  4645. mysql.usselect(_userdata, function(ret) {
  4646. if (i == student.length - 1) {
  4647. res.end(JSON.stringify({ success: 1 }));
  4648. }
  4649. });
  4650. }
  4651. });
  4652. //移除学生此班级
  4653. router.route("/deleteClassStudent").all((req, res, next) => {
  4654. let cid = req.body[0].cid;
  4655. let student = req.body[0].uid;
  4656. let _userdata = [student];
  4657. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
  4658. mysql.usselect(_userdata, function(ret) {
  4659. let classid = ret[0][0].classid;
  4660. if (classid.indexOf(cid) != -1) {
  4661. classid = classid.split(",");
  4662. classid.splice(classid.indexOf(cid), 1);
  4663. let _userdata2 = [student, classid.join(",")];
  4664. _userdata2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentClass");
  4665. mysql.usselect(_userdata2, function(ret) {
  4666. res.end(JSON.stringify({ success: 1 }));
  4667. });
  4668. }
  4669. });
  4670. });
  4671. //移除学生此班级
  4672. router.route("/deleteClassTeacher").all((req, res, next) => {
  4673. let cid = req.body[0].cid;
  4674. let student = req.body[0].uid;
  4675. let _userdata = [student];
  4676. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
  4677. mysql.usselect(_userdata, function(ret) {
  4678. let classid = ret[0][0].cclassid;
  4679. if (classid.indexOf(cid) != -1) {
  4680. classid = classid.split(",");
  4681. classid.splice(classid.indexOf(cid), 1);
  4682. let _userdata2 = [student, classid.join(",")];
  4683. _userdata2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTeacherClass");
  4684. mysql.usselect(_userdata2, function(ret) {
  4685. res.end(JSON.stringify({ success: 1 }));
  4686. });
  4687. }
  4688. });
  4689. });
  4690. //移除班级
  4691. router.route("/deleteGradeClass").all((req, res, next) => {
  4692. let cid = req.body[0].cid;
  4693. let student = req.body[0].uid;
  4694. let _userdata = ['', student];
  4695. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "addGradeClass");
  4696. mysql.usselect(_userdata, function(ret) {
  4697. res.end(JSON.stringify({ success: 1 }));
  4698. });
  4699. });
  4700. //admin 发布通知
  4701. router.route("/addNews").all((req, res, next) => {
  4702. postmysql(req, res, "add_news");
  4703. });
  4704. //admin 删除通知
  4705. router.route("/deleteNews").all((req, res, next) => {
  4706. postmysql(req, res, "delete_news");
  4707. });
  4708. //admin 添加banner
  4709. router.route("/addBanner").all((req, res, next) => {
  4710. postmysql(req, res, "add_banner");
  4711. });
  4712. //admin 添加banner
  4713. router.route("/deleteBanner").all((req, res, next) => {
  4714. postmysql(req, res, "delete_banner");
  4715. });
  4716. //admin 查询banner
  4717. router.route("/getBanner").all((req, res, next) => {
  4718. var json = queryString(req.url);
  4719. getmysql(req, res, "select_banner");
  4720. });
  4721. //根据学校查询banner
  4722. router.route("/selectBannerByOid").all((req, res, next) => {
  4723. var json = queryString(req.url);
  4724. getmysql(req, res, "selectBannerByOid", json["oid"]);
  4725. });
  4726. //admin 查询banner
  4727. router.route("/getBannerS").all((req, res, next) => {
  4728. var json = queryString(req.url);
  4729. getmysql(req, res, "getBannerS");
  4730. });
  4731. //根据学校查询banner
  4732. router.route("/selectBannerByOidS").all((req, res, next) => {
  4733. var json = queryString(req.url);
  4734. getmysql(req, res, "selectBannerByOidS", json["oid"]);
  4735. });
  4736. //admin 查询课程getSearchCourse
  4737. router.route("/getSearchCourse").all((req, res, next) => {
  4738. var json = queryString(req.url);
  4739. getmysql(req, res, "selectAll_courseSearch", json["t"]);
  4740. });
  4741. //根据学校查询课程
  4742. router.route("/getSearchCourseByoid").all((req, res, next) => {
  4743. var json = queryString(req.url);
  4744. getmysql(req, res, "selectAll_courseByOid", json["t"], json["oid"]);
  4745. });
  4746. //admin 查询所有课程专区
  4747. router.route("/getZone").all((req, res, next) => {
  4748. getmysql(req, res, "select_zone");
  4749. });
  4750. //admin 添加课程专区
  4751. router.route("/addZone").all((req, res, next) => {
  4752. postmysql(req, res, "insert_classZone");
  4753. });
  4754. //评审
  4755. router.route("/reviewCourse").all((req, res, next) => {
  4756. postmysql(req, res, "reviewCourse");
  4757. });
  4758. //查询评审
  4759. router.route("/getReview").all((req, res, next) => {
  4760. var json = queryString(req.url);
  4761. getmysql(req, res, "getReview", json["cid"]);
  4762. });
  4763. //查询所有课程专区下的课程
  4764. router.route("/getZoneClass").all((req, res, next) => {
  4765. var json = queryString(req.url);
  4766. getmysql(
  4767. req,
  4768. res,
  4769. "select_zoneClass",
  4770. json["bid"],
  4771. json["oid"],
  4772. json["page"],
  4773. 10
  4774. );
  4775. });
  4776. //查询所有课程专区下的课程
  4777. router.route("/getZoneClass").all((req, res, next) => {
  4778. var json = queryString(req.url);
  4779. getmysql(
  4780. req,
  4781. res,
  4782. "select_zoneClass",
  4783. json["bid"],
  4784. json["oid"],
  4785. json["page"],
  4786. 10
  4787. );
  4788. });
  4789. //查询所有课程专区下的课程
  4790. router.route("/getZoneClassStudent").all((req, res, next) => {
  4791. var json = queryString(req.url);
  4792. getmysql(
  4793. req,
  4794. res,
  4795. "select_zoneClass",
  4796. json["bid"],
  4797. json["oid"],
  4798. json["page"],
  4799. 20
  4800. );
  4801. });
  4802. //admin 后台查看专区下课程的数量
  4803. router.route("/getZoneClassNum").all((req, res, next) => {
  4804. var json = queryString(req.url);
  4805. getmysql(req, res, "select_zoneClassNum", json["bid"]);
  4806. });
  4807. //admin 后台添加课程专区时查看课程是否在此专区重复
  4808. router.route("/getZoneClassRepeat").all((req, res, next) => {
  4809. var json = queryString(req.url);
  4810. getmysql(req, res, "select_zoneClassRepeat", json["pid"], json["cid"]);
  4811. });
  4812. //把课程添加进专区
  4813. router.route("/addZoneCourse").all((req, res, next) => {
  4814. postmysql(req, res, "insert_app");
  4815. });
  4816. //admin 删除课程专区底下的课程
  4817. router.route("/deleteZoneCourse").all((req, res, next) => {
  4818. postmysql(req, res, "delete_app");
  4819. });
  4820. //admin 删除班级
  4821. router.route("/deleteZone").all((req, res, next) => {
  4822. postmysql(req, res, "delete_zone");
  4823. });
  4824. //admin 后台专区上移下移
  4825. router.route("/zoneRank").all((req, res, next) => {
  4826. postmysql(req, res, "update_classRank");
  4827. });
  4828. //admin 添加模板文档
  4829. router.route("/addTemplateAdmin").all((req, res, next) => {
  4830. postmysql(req, res, "add_template");
  4831. });
  4832. //admin 添加模板文档
  4833. router.route("/deleteTemplateAdmin").all((req, res, next) => {
  4834. postmysql(req, res, "delete_template");
  4835. });
  4836. //admin 查询模板文档
  4837. router.route("/getTemplateAdmin").all((req, res, next) => {
  4838. var json = queryString(req.url);
  4839. getmysql(req, res, "select_template", json["page"], 10);
  4840. });
  4841. //查询上传作业
  4842. router.route("/getCourseWorks").all((req, res, next) => {
  4843. var json = queryString(req.url); //cid 课程id,page 页数
  4844. getmysql(
  4845. req,
  4846. res,
  4847. "select_courseWorks",
  4848. json["cid"],
  4849. json["stage"],
  4850. json["task"],
  4851. json["page"],
  4852. 10
  4853. );
  4854. });
  4855. //查询上传作业
  4856. router.route("/getCourseWorks2").all((req, res, next) => {
  4857. var json = queryString(req.url); //cid 课程id,page 页数
  4858. getmysql(
  4859. req,
  4860. res,
  4861. "select_courseWorks2",
  4862. json["cid"],
  4863. json["uname"],
  4864. json["stage"],
  4865. json["task"],
  4866. json["page"],
  4867. 10
  4868. );
  4869. });
  4870. //查询上传作业
  4871. router.route("/getCourseWorks3").all((req, res, next) => {
  4872. var json = queryString(req.url); //cid 课程id,page 页数
  4873. getmysql(
  4874. req,
  4875. res,
  4876. "select_courseWorks3",
  4877. json["cid"],
  4878. json["uname"],
  4879. json["stage"],
  4880. json["task"],
  4881. json["page"],
  4882. 10
  4883. );
  4884. });
  4885. //查询上传作业
  4886. router.route("/getCourseWorks3Copy").all((req, res, next) => {
  4887. var json = queryString(req.url); //cid 课程id,page 页数
  4888. getmysql(
  4889. req,
  4890. res,
  4891. "getCourseWorks3Copy",
  4892. json["cid"],
  4893. json["uname"],
  4894. json["stage"],
  4895. json["task"],
  4896. json["page"],
  4897. 10
  4898. );
  4899. });
  4900. //查询上传作业y
  4901. router.route("/getCourseWorks3Copy1").all((req, res, next) => {
  4902. var json = queryString(req.url); //cid 课程id,page 页数
  4903. getmysql(
  4904. req,
  4905. res,
  4906. "getCourseWorks3Copy1",
  4907. json["cid"],
  4908. json["uCla"],
  4909. json["uname"],
  4910. json["tck"],
  4911. json["stage"],
  4912. json["task"],
  4913. json["page"],
  4914. 10
  4915. );
  4916. });
  4917. //评价管理查看报告-学生上下切换功能
  4918. router.route("/getCourseWorksList").all((req, res, next) => {
  4919. var json = queryString(req.url); //cid 课程id
  4920. getmysql(
  4921. req,
  4922. res,
  4923. "getCourseWorksList",
  4924. json["cid"]
  4925. );
  4926. });
  4927. //评价管理查看报告筛选获取班级
  4928. router.route("/getCourseReportClassList").all((req, res, next) => {
  4929. var json = queryString(req.url); //cid 课程id
  4930. getmysql(
  4931. req,
  4932. res,
  4933. "getCourseReportClassList",
  4934. json["cid"]
  4935. );
  4936. });
  4937. //查询上传作业--加上筛选班级
  4938. router.route("/getCourseWorks5").all((req, res, next) => {
  4939. var json = queryString(req.url); //cid 课程id,page 页数
  4940. getmysql(
  4941. req,
  4942. res,
  4943. "select_courseWorks5",
  4944. json["cid"],
  4945. json["uname"],
  4946. json["choseClass"],
  4947. json["stage"],
  4948. json["task"],
  4949. json["page"],
  4950. 10
  4951. );
  4952. });
  4953. //查询上传作业--加上筛选班级
  4954. router.route("/getCourseStageWorks").all((req, res, next) => {
  4955. var json = queryString(req.url); //cid 课程id,page 页数
  4956. getmysql(
  4957. req,
  4958. res,
  4959. "getCourseStageWorks",
  4960. json["cid"],
  4961. json["uname"],
  4962. json["choseClass"],
  4963. json["stage"],
  4964. json["task"],
  4965. json["page"],
  4966. 10
  4967. );
  4968. });
  4969. //查询上传作业--加上筛选班级
  4970. router.route("/getCourseStageWorks2").all((req, res, next) => {
  4971. var json = queryString(req.url); //cid 课程id,page 页数
  4972. getmysql(
  4973. req,
  4974. res,
  4975. "getCourseStageWorks2",
  4976. json["cid"],
  4977. json["uname"],
  4978. json["choseClass"],
  4979. json["stage"],
  4980. json["task"]
  4981. );
  4982. });
  4983. //查询上传作业--加上筛选班级
  4984. router.route("/getCourseTaskWorks").all((req, res, next) => {
  4985. var json = queryString(req.url); //cid 课程id,page 页数
  4986. getmysql(
  4987. req,
  4988. res,
  4989. "getCourseTaskWorks",
  4990. json["cid"],
  4991. json["uname"],
  4992. json["choseClass"],
  4993. json["stage"],
  4994. json["task"],
  4995. json["page"],
  4996. 10
  4997. );
  4998. });
  4999. //查询上传作业--加上筛选班级
  5000. router.route("/getCourseTaskWorks2").all((req, res, next) => {
  5001. var json = queryString(req.url); //cid 课程id,page 页数
  5002. getmysql(
  5003. req,
  5004. res,
  5005. "getCourseTaskWorks2",
  5006. json["cid"],
  5007. json["uname"],
  5008. json["choseClass"],
  5009. json["stage"],
  5010. json["task"]
  5011. );
  5012. });
  5013. //查询所有学生上传作业--加上筛选班级
  5014. router.route("/getCourseWorks6").all((req, res, next) => {
  5015. var json = queryString(req.url); //cid 课程id,page 页数
  5016. getmysql(
  5017. req,
  5018. res,
  5019. "select_courseWorks6",
  5020. json["cid"],
  5021. json["uname"],
  5022. json['choseClass'],
  5023. json["stage"],
  5024. json["task"]
  5025. );
  5026. });
  5027. //查询所有学生上传作业
  5028. router.route("/getCourseWorks4").all((req, res, next) => {
  5029. var json = queryString(req.url); //cid 课程id,page 页数
  5030. getmysql(
  5031. req,
  5032. res,
  5033. "select_courseWorks4",
  5034. json["cid"],
  5035. json["uname"],
  5036. json["stage"],
  5037. json["task"]
  5038. );
  5039. });
  5040. //查询学生课程作业
  5041. router.route("/selectStudentCourseWorks").all((req, res, next) => {
  5042. var json = queryString(req.url); //cid 课程id,page 页数
  5043. getmysql(
  5044. req,
  5045. res,
  5046. "selectStudentCourseWorks",
  5047. json["uid"],
  5048. json["cid"],
  5049. json["stage"],
  5050. json["task"],
  5051. json["page"],
  5052. 10
  5053. );
  5054. });
  5055. //查询学生课程作业
  5056. router.route("/selectStudentCourseWorksTwo").all((req, res, next) => {
  5057. var json = queryString(req.url); //cid 课程id,page 页数
  5058. getmysql(
  5059. req,
  5060. res,
  5061. "selectStudentCourseWorksTwo",
  5062. json["uid"],
  5063. json["cname"],
  5064. json["uClass"],
  5065. json["page"],
  5066. 10
  5067. );
  5068. });
  5069. //查询学生课程作业
  5070. router.route("/selectStudentCourseWorksTwo2").all((req, res, next) => {
  5071. var json = queryString(req.url); //cid 课程id,page 页数
  5072. getmysql(
  5073. req,
  5074. res,
  5075. "selectStudentCourseWorksTwo2",
  5076. json["uid"],
  5077. json["cname"],
  5078. json["uClass"],
  5079. json["userid"],
  5080. json["page"],
  5081. 10
  5082. );
  5083. });
  5084. //查询报告数据
  5085. router.route("/getCourseWorksReport").all((req, res, next) => {
  5086. var json = queryString(req.url); //cid 课程id,page 页数
  5087. getmysql(req, res, "getCourseWorksReport", json["cid"]);
  5088. });
  5089. //查询报告数据y
  5090. router.route("/getCourseWorksReport1").all((req, res, next) => {
  5091. var json = queryString(req.url); //cid 课程id
  5092. getmysql(req, res, "getCourseWorksReport1", json["cid"]);
  5093. });
  5094. //查询报告数据--根据班级
  5095. router.route("/getCourseWorksReport2").all((req, res, next) => {
  5096. var json = queryString(req.url); //cid 课程id,page 页数
  5097. getmysql(req, res, "getCourseWorksReport2", json["cid"],json["choseClass"]);
  5098. });
  5099. //查询dyList
  5100. router.route("/getCourseWorksDyList").all((req, res, next) => {
  5101. var json = queryString(req.url); //cid 课程id,page 页数
  5102. getmysql(req, res, "getCourseWorksDyList", json["cid"]);
  5103. });
  5104. //查询多个课程报告数据
  5105. router.route("/getCourseWorksReportMore").all((req, res, next) => {
  5106. var json = queryString(req.url); //cid 课程id,page 页数
  5107. getmysql(req, res, "getCourseWorksReportMore", json["cid"]);
  5108. });
  5109. //查询学生课程报告数据
  5110. router.route("/getStudentCourseWorksReport").all((req, res, next) => {
  5111. var json = queryString(req.url); //cid 课程id,page 页数
  5112. getmysql(req, res, "getStudentCourseWorksReport", json["uid"]);
  5113. });
  5114. //admin 添加项目模板文档
  5115. router.route("/addCourseTemplateAdmin").all((req, res, next) => {
  5116. postmysql(req, res, "add_courseTemplate");
  5117. });
  5118. //admin 添加项目模板文档
  5119. router.route("/deleteCourseTemplateAdmin").all((req, res, next) => {
  5120. postmysql(req, res, "delete_courseTemplate");
  5121. });
  5122. //admin 查询项目模板文档
  5123. router.route("/getCourseTemplateAdmin").all((req, res, next) => {
  5124. var json = queryString(req.url);
  5125. getmysql(req, res, "select_courseTemplate", json["page"], 10);
  5126. });
  5127. //teacher 查询项目模板
  5128. router.route("/getCourseTemplateT").all((req, res, next) => {
  5129. var json = queryString(req.url);
  5130. getmysql(req, res, "select_courseTemplateT");
  5131. });
  5132. //teacher 查询项目模板
  5133. router.route("/getTrainCourseTemplateT").all((req, res, next) => {
  5134. var json = queryString(req.url);
  5135. getmysql(req, res, "getTrainCourseTemplateT");
  5136. });
  5137. //teacher 查询项目模板
  5138. router.route("/getCourseTemplateTByOid").all((req, res, next) => {
  5139. var json = queryString(req.url);
  5140. getmysql(req, res, "getCourseTemplateTByOid", json["oid"]);
  5141. });
  5142. //teacher 查询项目模板
  5143. router.route("/getTrainCourseTemplateTByOid").all((req, res, next) => {
  5144. var json = queryString(req.url);
  5145. getmysql(req, res, "getTrainCourseTemplateTByOid", json["oid"]);
  5146. });
  5147. //目标管理查询目标模板
  5148. router.route("/selectEvaTemplate").all((req, res, next) => {
  5149. var json = queryString(req.url);
  5150. getmysql(req, res, "select_evaTemplate", json["oid"]);
  5151. });
  5152. //目标管理新增目标模板 修1
  5153. router.route("/addEvaTemplate").get((req, res, next) => {
  5154. var json = queryString(req.url);
  5155. getmysql2(req, res, "add_evaTemplate", json["t"], json["c"], json["uid"], json["oid"]);
  5156. });
  5157. //teacher 查询项目模板
  5158. router.route("/getCourseTemplateTs").all((req, res, next) => {
  5159. var json = queryString(req.url);
  5160. getmysql(req, res, "getCourseTemplateTs", json["oid"]);
  5161. });
  5162. //teacher 查询项目模板
  5163. router.route("/getCourseTemplateTStudio").all((req, res, next) => {
  5164. var json = queryString(req.url);
  5165. getmysql(req, res, "getCourseTemplateTStudio", json["oid"]);
  5166. });
  5167. //admin 查询课程
  5168. router.route("/getCourseAdmin").all((req, res, next) => {
  5169. var json = queryString(req.url);
  5170. getmysql(req, res, "select_courseAdmin", json["cn"], json["page"], 10);
  5171. });
  5172. //admin 查询模板文档
  5173. router.route("/deleteCourseAdmin").all((req, res, next) => {
  5174. postmysql(req, res, "delete_courseAdmin");
  5175. });
  5176. //设置分组
  5177. router.route("/setCourseGroup").all((req, res, next) => {
  5178. postmysql(req, res, "setCourseGroup");
  5179. });
  5180. //删除分组
  5181. router.route("/deleteCourseGroup").all((req, res, next) => {
  5182. postmysql(req, res, "deleteCourseGroup");
  5183. });
  5184. //获取分组
  5185. router.route("/getCourseGroup").all((req, res, next) => {
  5186. var json = queryString(req.url);
  5187. getmysql(req, res, "getCourseGroup", json["cid"], json["classid"]);
  5188. });
  5189. //获取分组
  5190. router.route("/getCourseGroup2").all((req, res, next) => {
  5191. var json = queryString(req.url);
  5192. getmysql(req, res, "getCourseGroup2", json["cid"], json["classid"]);
  5193. });
  5194. //加入分组
  5195. router.route("/joinCourseGroup").all((req, res, next) => {
  5196. postmysql(req, res, "joinCourseGroup");
  5197. });
  5198. //退出分组
  5199. router.route("/exitCourseGroup").all((req, res, next) => {
  5200. postmysql(req, res, "exitCourseGroup");
  5201. });
  5202. //加入分组
  5203. router.route("/joinGroup").all((req, res, next) => {
  5204. postmysql(req, res, "joinGroup");
  5205. });
  5206. //退出分组
  5207. router.route("/exitGroup").all((req, res, next) => {
  5208. postmysql(req, res, "exitGroup");
  5209. });
  5210. //查看分组
  5211. router.route("/selectGroup").all((req, res, next) => {
  5212. postmysql(req, res, "selectGroup");
  5213. });
  5214. //查询pblstudent 分页
  5215. router.route("/selectPblStudent").all((req, res, next) => {
  5216. var json = queryString(req.url);
  5217. getmysql(req, res, "selectPblStudent", json["uid"], json["org"], json["oid"], json["type"], json["n"], json["page"], json["int"]);
  5218. });
  5219. //删除pblstudent 传courseid
  5220. router.route("/deletePblStudent").all((req, res, next) => {
  5221. postmysql(req, res, "deletePblStudent");
  5222. });
  5223. //查询pblstudent单个项目详情
  5224. router.route("/selectPblStudentDetail").all((req, res, next) => {
  5225. var json = queryString(req.url);
  5226. getmysql(req, res, "selectPblStudentDetail", json["cid"]);
  5227. });
  5228. //添加pblstudent 传uid 用户id t 标题 n 选题
  5229. router.route("/addPblStudent").all((req, res, next) => {
  5230. postmysql(req, res, "addPblStudent");
  5231. });
  5232. //修改pblstudentjson内容 传 cid 课程id chapters内容
  5233. router.route("/updatePblStudentChapters").all((req, res, next) => {
  5234. postmysql(req, res, "updatePblStudentChapters");
  5235. });
  5236. //修改pblstudent 所属已完成位置 传 cid 课程id doi 已完成位置传数字
  5237. router.route("/updatePblStudentDoIndex").all((req, res, next) => {
  5238. postmysql(req, res, "updatePblStudentDoIndex");
  5239. });
  5240. //课堂观察 对比分析查询
  5241. router.route("/select_contrastObservation_data").all((req, res, next) => {
  5242. postmysql(req, res, "select_contrastObservation_data");
  5243. });
  5244. //课堂观察 对比分析查询
  5245. router.route("/update_contrastObservation_data").all((req, res, next) => {
  5246. postmysql(req, res, "update_contrastObservation_data");
  5247. });
  5248. //查询ppt在哪页
  5249. router.route("/selectPptPage").all((req, res, next) => {
  5250. var json = queryString(req.url);
  5251. getmysql(req, res, "selectPptPage", json["id"]);
  5252. });
  5253. //修改ppt页码
  5254. router.route("/updatePptPage").all((req, res, next) => {
  5255. postmysql(req, res, "updatePptPage");
  5256. });
  5257. //修改ppt操作
  5258. router.route("/updatePPTHandle").all((req, res, next) => {
  5259. postmysql(req, res, "updatePPTHandle");
  5260. });
  5261. //查询实时课堂
  5262. router.route("/getRealTimeClass").all((req, res, next) => {
  5263. var json = queryString(req.url);
  5264. getmysql(
  5265. req,
  5266. res,
  5267. "getRealTimeClass",
  5268. json["cn"],
  5269. json["uid"],
  5270. json["page"],
  5271. 10
  5272. );
  5273. });
  5274. //查询实时课堂学生
  5275. router.route("/getRealTimeClassStu").all((req, res, next) => {
  5276. var json = queryString(req.url);
  5277. getmysql(
  5278. req,
  5279. res,
  5280. "getRealTimeClassStu",
  5281. json["oid"],
  5282. json["cid"],
  5283. json["page"],
  5284. 10
  5285. );
  5286. });
  5287. //查询实时课堂学生
  5288. router.route("/getRealTimeClassById").all((req, res, next) => {
  5289. var json = queryString(req.url);
  5290. getmysql(req, res, "getRealTimeClassById", json["id"]);
  5291. });
  5292. //根据区级管理者查询案例
  5293. router.route("/selectAnliList").all((req, res, next) => {
  5294. var json = queryString(req.url);
  5295. getmysql(
  5296. req,
  5297. res,
  5298. "selectAnliList",
  5299. json["typea"],
  5300. json["typeb"],
  5301. json["typec"],
  5302. json["typed"],
  5303. json["typeE"],
  5304. json["cn"],
  5305. json["cid"],
  5306. json["title"],
  5307. json["page"],
  5308. 10
  5309. );
  5310. });
  5311. //根据区级管理者查询案例
  5312. router.route("/selectAnliListGM").all((req, res, next) => {
  5313. var json = queryString(req.url);
  5314. getmysql(
  5315. req,
  5316. res,
  5317. "selectAnliListGM",
  5318. json["typea"],
  5319. json["typeb"],
  5320. json["typec"],
  5321. json["typed"],
  5322. json["typeE"],
  5323. json["cn"],
  5324. json["cid"],
  5325. json["title"],
  5326. json["page"],
  5327. 10
  5328. );
  5329. });
  5330. //根据市级管理者查询案例
  5331. router.route("/selectAnliList1").all((req, res, next) => {
  5332. var json = queryString(req.url);
  5333. getmysql(
  5334. req,
  5335. res,
  5336. "selectAnliList1",
  5337. json["typea"],
  5338. json["typeb"],
  5339. json["typec"],
  5340. json["typed"],
  5341. json["typeE"],
  5342. json["cn"],
  5343. json["cid"],
  5344. json["title"],
  5345. json["page"],
  5346. 10
  5347. );
  5348. });
  5349. //根据省级级管理者查询案例
  5350. router.route("/selectAnliList2").all((req, res, next) => {
  5351. var json = queryString(req.url);
  5352. getmysql(
  5353. req,
  5354. res,
  5355. "selectAnliList2",
  5356. json["typea"],
  5357. json["typeb"],
  5358. json["typec"],
  5359. json["typed"],
  5360. json["typeE"],
  5361. json["cn"],
  5362. json["cid"],
  5363. json["title"],
  5364. json["page"],
  5365. 10
  5366. );
  5367. });
  5368. //删除1案例
  5369. router.route("/deleteAnli").all((req, res, next) => {
  5370. var json = queryString(req.url);
  5371. getmysql2(req, res, "deleteAnli", json["id"]);
  5372. });
  5373. //根据区县管理者查询评分
  5374. router.route("/selectPoint").all((req, res, next) => {
  5375. var json = queryString(req.url);
  5376. getmysql(
  5377. req,
  5378. res,
  5379. "selectPoint",
  5380. json["typea"],
  5381. json["typeb"],
  5382. json["typec"],
  5383. json["typed"],
  5384. json["typeE"],
  5385. json["cn"],
  5386. json["cid"],
  5387. json["title"],
  5388. json["page"],
  5389. 10
  5390. );
  5391. });
  5392. //根据市级管理者查询评分
  5393. router.route("/selectPoint1").all((req, res, next) => {
  5394. var json = queryString(req.url);
  5395. getmysql(
  5396. req,
  5397. res,
  5398. "selectPoint1",
  5399. json["typea"],
  5400. json["typeb"],
  5401. json["typec"],
  5402. json["typed"],
  5403. json["typeE"],
  5404. json["cn"],
  5405. json["cid"],
  5406. json["title"],
  5407. json["page"],
  5408. 10
  5409. );
  5410. });
  5411. //根据市级管理者查询全部评分
  5412. router.route("/selectPointAll").all((req, res, next) => {
  5413. var json = queryString(req.url);
  5414. getmysql(
  5415. req,
  5416. res,
  5417. "selectPointAll",
  5418. json["typea"],
  5419. json["typeb"],
  5420. json["typec"],
  5421. json["typed"],
  5422. json["typeE"],
  5423. json["cn"],
  5424. json["cid"],
  5425. json["title"]
  5426. );
  5427. });
  5428. //根据市级管理者查询全部评分
  5429. router.route("/selectPointAllGM").all((req, res, next) => {
  5430. var json = queryString(req.url);
  5431. getmysql(
  5432. req,
  5433. res,
  5434. "selectPointAllGM",
  5435. json["typea"],
  5436. json["typeb"],
  5437. json["typec"],
  5438. json["typed"],
  5439. json["typeE"],
  5440. json["cn"],
  5441. json["cid"],
  5442. json["title"]
  5443. );
  5444. });
  5445. //根据市级管理者查询全部评分
  5446. router.route("/selectPointAllGM2").all((req, res, next) => {
  5447. var json = queryString(req.url);
  5448. getmysql(
  5449. req,
  5450. res,
  5451. "selectPointAllGM2",
  5452. json["typea"],
  5453. json["typeb"],
  5454. json["typec"],
  5455. json["typed"],
  5456. json["typeE"],
  5457. json["cn"],
  5458. json["cid"],
  5459. json["title"],
  5460. json["numCheck"]
  5461. );
  5462. });
  5463. //根据市级管理者查询全部评分
  5464. router.route("/selectPointAllGM2Post").all((req, res, next) => {
  5465. postmysql(req, res, "selectPointAllGM2");
  5466. });
  5467. //查询分配案例
  5468. router.route("/selectCaseUser").all((req, res, next) => {
  5469. var json = queryString(req.url);
  5470. getmysql(req, res, "select_case", json["uid"]);
  5471. });
  5472. //根据用户id,课程id,阶段,任务,工具去查询协同
  5473. router.route("/selectWord").all((req, res, next) => {
  5474. var json = queryString(req.url);
  5475. getmysql(
  5476. req,
  5477. res,
  5478. "selectWord",
  5479. json["uid"],
  5480. json["cid"],
  5481. json["s"],
  5482. json["task"],
  5483. json["t"]
  5484. );
  5485. });
  5486. //根据用户id,课程id,阶段,任务,工具去查询协同
  5487. router.route("/selectWord2").all((req, res, next) => {
  5488. var json = queryString(req.url);
  5489. getmysql(
  5490. req,
  5491. res,
  5492. "selectWord2",
  5493. json["uid"],
  5494. json["cid"],
  5495. json["s"],
  5496. json["task"],
  5497. json["t"],
  5498. json["type"]
  5499. );
  5500. });
  5501. //根据用户id,课程id,阶段,任务,工具去查询协同
  5502. router.route("/selectWords").all((req, res, next) => {
  5503. var json = queryString(req.url);
  5504. getmysql(
  5505. req,
  5506. res,
  5507. "selectWords",
  5508. json["uid"],
  5509. json["cid"],
  5510. json["s"],
  5511. json["task"],
  5512. json["t"],
  5513. json["type"]
  5514. );
  5515. });
  5516. //根据用户id,课程id,阶段,任务,工具去查询协同
  5517. router.route("/selectWordsY").all((req, res, next) => {
  5518. var json = queryString(req.url);
  5519. getmysql(
  5520. req,
  5521. res,
  5522. "selectWordsY",
  5523. json["uid"],
  5524. json["cid"],
  5525. json["s"],
  5526. json["task"],
  5527. json["t"],
  5528. json["type"]
  5529. );
  5530. });
  5531. //新增协同内容
  5532. router.route("/insertWord2y").all((req, res, next) => {
  5533. var json = queryString(req.url);
  5534. // getmysql(req, res, "insertWord2y", json["uid"], json["cid"], json["s"], json["task"], json["t"], json["text"], json["type"]);
  5535. postmysql3(req, res, "insertWord2y");
  5536. });
  5537. //新增协同内容 修1
  5538. router.route("/insertWord").get((req, res, next) => {
  5539. var json = queryString(req.url);
  5540. getmysql2(
  5541. req,
  5542. res,
  5543. "insertWord",
  5544. json["uid"],
  5545. json["cid"],
  5546. json["s"],
  5547. json["task"],
  5548. json["t"],
  5549. json["text"]
  5550. );
  5551. });
  5552. //分配案例
  5553. router.route("/insertCase").all((req, res, next) => {
  5554. if (req.body[0]) {
  5555. p = [req.body[0].uid, req.body[0].box];
  5556. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insertCase"); //執行存儲過程
  5557. mysql.usselect(p, function(ret) {
  5558. res.end(JSON.stringify({ success: 1 }));
  5559. });
  5560. }
  5561. });
  5562. //新增评分
  5563. router.route("/addScore").all((req, res, next) => {
  5564. postmysql(req, res, "addScore");
  5565. });
  5566. //添加用户标签
  5567. router.route("/add_userlabel").all((req, res, next) => {
  5568. postmysql2(req, res, "add_userlabel");
  5569. });
  5570. //查询评分
  5571. router.route("/selectScore").all((req, res, next) => {
  5572. var json = queryString(req.url);
  5573. getmysql(req, res, "selectScore", json["rid"], json["suser"]);
  5574. });
  5575. //查询所有评分
  5576. router.route("/selectAllScore").all((req, res, next) => {
  5577. var json = queryString(req.url);
  5578. getmysql(req, res, "selectAllScore");
  5579. });
  5580. //查询所有评分
  5581. router.route("/selectAllScoreGM").all((req, res, next) => {
  5582. var json = queryString(req.url);
  5583. getmysql(req, res, "selectAllScoreGM");
  5584. });
  5585. //查询所有评分
  5586. router.route("/selectAllScoreGM2").all((req, res, next) => {
  5587. var json = queryString(req.url);
  5588. getmysql(req, res, "selectAllScoreGM2", json['numCheck']);
  5589. });
  5590. //查询所有学校以及组织
  5591. router.route("/selectAllSchool").all((req, res, next) => {
  5592. var json = queryString(req.url);
  5593. getmysql(req, res, "selectAllSchool");
  5594. });
  5595. //根据用户id查询评分
  5596. router.route("/selectScoreByUid").all((req, res, next) => {
  5597. var json = queryString(req.url);
  5598. getmysql(req, res, "selectScoreByUid", json["uid"]);
  5599. });
  5600. //查询单个案例所有评分
  5601. router.route("/selectAnliScore").all((req, res, next) => {
  5602. var json = queryString(req.url);
  5603. getmysql(req, res, "selectAnliScore", json["rid"]);
  5604. });
  5605. //赛事推荐 修1
  5606. router.route("/updateRaceRec").get((req, res, next) => {
  5607. var json = queryString(req.url);
  5608. getmysql2(req, res, "updateRaceRec", json["id"], json["rec"]);
  5609. });
  5610. //查询数据报告学生报告列表
  5611. router.route("/selectSr").all((req, res, next) => {
  5612. var json = queryString(req.url);
  5613. getmysql(
  5614. req,
  5615. res,
  5616. "selectSr",
  5617. json["cu"],
  5618. json["cn"],
  5619. json["oid"],
  5620. json["page"],
  5621. 10
  5622. );
  5623. });
  5624. //查询数据报告班级报告列表
  5625. router.route("/selectCr").all((req, res, next) => {
  5626. var json = queryString(req.url);
  5627. getmysql(
  5628. req,
  5629. res,
  5630. "selectCr",
  5631. json["cu"],
  5632. json["cn"],
  5633. json["oid"],
  5634. json["page"],
  5635. 10
  5636. );
  5637. });
  5638. //查询数据报告查看班级报告底下学生列表
  5639. router.route("/selectCStudent").all((req, res, next) => {
  5640. var json = queryString(req.url);
  5641. getmysql(req, res, "selectCStudent", json["cid"], json["courseid"]);
  5642. });
  5643. //查询数据报告课程报告列表
  5644. router.route("/selectCourseR").all((req, res, next) => {
  5645. var json = queryString(req.url);
  5646. getmysql(
  5647. req,
  5648. res,
  5649. "selectCourseR",
  5650. json["cu"],
  5651. json["cn"],
  5652. json["cl"],
  5653. json["oid"],
  5654. json["page"],
  5655. 10
  5656. );
  5657. });
  5658. //根据学校id查询学校底下有评价的课程
  5659. router.route("/selectCourseByOid").all((req, res, next) => {
  5660. var json = queryString(req.url);
  5661. getmysql(req, res, "selectCourseByOid", json["oid"]);
  5662. });
  5663. //根据目标id和班级id查询底下有作业的课程
  5664. router.route("/selectEvaCourse").all((req, res, next) => {
  5665. var json = queryString(req.url);
  5666. getmysql(req, res, "selectEvaCourse", json["eid"], json["cid"]);
  5667. });
  5668. //teacher 查询模板
  5669. router.route("/getTemplateT").all((req, res, next) => {
  5670. var json = queryString(req.url);
  5671. getmysql(req, res, "select_templateT");
  5672. });
  5673. //思维网格 创建房间
  5674. router.route("/insertRoom").all((req, res, next) => {
  5675. postmysql(req, res, "insertRoom");
  5676. });
  5677. //删除作业阶段任务工具
  5678. router.route("/deleteStudentToolSTT").all((req, res, next) => {
  5679. postmysql(req, res, "deleteStudentToolSTT");
  5680. });
  5681. //删除作业阶段任务
  5682. router.route("/deleteStudentToolST").all((req, res, next) => {
  5683. postmysql(req, res, "deleteStudentToolST");
  5684. });
  5685. //删除作业阶段
  5686. router.route("/deleteStudentToolS").all((req, res, next) => {
  5687. postmysql(req, res, "deleteStudentToolST");
  5688. });
  5689. //协同编辑 创建房间
  5690. router.route("/insertRoomByFile").all((req, res, next) => {
  5691. //var json = queryString(req.url);
  5692. postmysql2(req, res, "insertRoomByFile");
  5693. //getmysql(req, res, "insertRoomByFile", json["uid"], json["n"], json["d"]);
  5694. });
  5695. //思维网格 查询是否是重复房间号
  5696. router.route("/checkRoomNum").all((req, res, next) => {
  5697. var json = queryString(req.url);
  5698. getmysql(req, res, "checkRoomNum", json["num"]);
  5699. });
  5700. //思维网格 查询房间列表
  5701. router.route("/selectRoomList").all((req, res, next) => {
  5702. var json = queryString(req.url);
  5703. getmysql(
  5704. req,
  5705. res,
  5706. "selectRoomList",
  5707. json["uid"],
  5708. json["oid"],
  5709. json["cid"],
  5710. json["cu"],
  5711. json["cn"]
  5712. );
  5713. });
  5714. //查询pdf列表
  5715. router.route("/selectRTC").all((req, res, next) => {
  5716. var json = queryString(req.url);
  5717. getmysql(req, res, "selectRTC", json["uid"], json["cu"], json["cn"]);
  5718. });
  5719. //协同文档 查询房间列表
  5720. router.route("/selectFileList").all((req, res, next) => {
  5721. var json = queryString(req.url);
  5722. getmysql(
  5723. req,
  5724. res,
  5725. "selectFileList",
  5726. json["uid"],
  5727. json["oid"],
  5728. json["cid"],
  5729. json["cu"],
  5730. json["cn"]
  5731. );
  5732. });
  5733. //协同编辑 查询是否是重复房间号
  5734. router.route("/checkRoomNumByFile").all((req, res, next) => {
  5735. var json = queryString(req.url);
  5736. getmysql(req, res, "checkRoomNumByFile", json["num"]);
  5737. });
  5738. //思维网格 根据房间号或者用户id查询房间信息
  5739. router.route("/selectRoom").all((req, res, next) => {
  5740. var json = queryString(req.url);
  5741. getmysql(req, res, "selectRoom", json["uid"]);
  5742. });
  5743. //思维网格 根据房间号或者用户id查询房间信息
  5744. router.route("/getRoom").all((req, res, next) => {
  5745. var json = queryString(req.url);
  5746. getmysql(req, res, "select_room", json["fid"]);
  5747. });
  5748. //协同编辑 根据房间号或者用户id查询房间信息
  5749. router.route("/selectRoomByFile").all((req, res, next) => {
  5750. var json = queryString(req.url);
  5751. getmysql(req, res, "selectRoomByFile", json["uid"]);
  5752. });
  5753. //思维网格 修改房间数据
  5754. router.route("/updateRoomData").all((req, res, next) => {
  5755. postmysql(req, res, "updateRoomData");
  5756. });
  5757. // 修1
  5758. router.route("/updateFileData").get((req, res, next) => {
  5759. var json = queryString(req.url);
  5760. var json2 = json["mode"].split(",");
  5761. getmysql2(req, res, "updateFileData", json2[0], json2[1]);
  5762. });
  5763. router.route("/select_file").all((req, res, next) => {
  5764. var json = queryString(req.url);
  5765. getmysql(req, res, "select_file", json["fid"]);
  5766. });
  5767. //思维网格 解散房间
  5768. router.route("/dismiss").all((req, res, next) => {
  5769. postmysql(req, res, "update_room");
  5770. });
  5771. //提交提问
  5772. router.route("/addProblem").all((req, res, next) => {
  5773. postmysql(req, res, "add_problem");
  5774. //cid 课程id,chid 章节id,t 提问内容,uid 用户id
  5775. });
  5776. //查询提交的提问
  5777. router.route("/getProblem").all((req, res, next) => {
  5778. var json = queryString(req.url); //cid 课程id,page 页数
  5779. getmysql(req, res, "select_problem", json["cid"], json["page"], 10);
  5780. });
  5781. //获取用户基本信息
  5782. router.route("/getUserInfo").all((req, res, next) => {
  5783. var json = queryString(req.url);
  5784. getmysql(req, res, "getUserInfo", json["uid"], json["cid"]);
  5785. });
  5786. //获取用户多个课程基本信息
  5787. router.route("/getUserInfoMore").all((req, res, next) => {
  5788. var json = queryString(req.url);
  5789. getmysql(req, res, "getUserInfoMore", json["uid"], json["cid"]);
  5790. });
  5791. //获取多个用户单个课程基本信息
  5792. router.route("/getClassUserInfoMore").all((req, res, next) => {
  5793. var json = queryString(req.url);
  5794. getmysql(req, res, "getClassUserInfoMore", json["uid"], json["cid"]);
  5795. });
  5796. //获取课程下所有有作业的学生id
  5797. router.route("/selectCourseSuid").all((req, res, next) => {
  5798. var json = queryString(req.url);
  5799. getmysql(req, res, "selectCourseSuid", json["cid"], json["courseid"]);
  5800. });
  5801. //获取项目基本信息
  5802. router.route("/getCourseInfo").all((req, res, next) => {
  5803. var json = queryString(req.url);
  5804. getmysql(req, res, "getCourseInfo", json["cid"]);
  5805. });
  5806. //课程中心 总评添加和修改功能
  5807. router.route("/opCourseScore").all((req, res, next) => {
  5808. postmysql(req, res, "opCourseScore");
  5809. });
  5810. //查询已评价功能
  5811. router.route("/getCourseScoreP").all((req, res, next) => {
  5812. var json = queryString(req.url);
  5813. getmysql(req, res, "getCourseScoreP", json["cid"], json["uid"]);
  5814. });
  5815. //查询所有已评价功能
  5816. router.route("/getCourseScore").all((req, res, next) => {
  5817. var json = queryString(req.url);
  5818. getmysql(req, res, "getCourseScore", json["cid"]);
  5819. });
  5820. //查看已有作业功能
  5821. router.route("/selectWorkByCidAi").all((req, res, next) => {
  5822. var json = queryString(req.url);
  5823. getmysql(req, res, "selectWorkByCidAi", json["cid"], json["classid"]);
  5824. });
  5825. //插叙单个学生作业
  5826. router.route("/selectWorkByCidAiByUid").all((req, res, next) => {
  5827. var json = queryString(req.url);
  5828. getmysql(req, res, "selectWorkByCidAiByUid", json["cid"], json["uid"]);
  5829. });
  5830. //获取多个项目基本信息
  5831. router.route("/getCourseInfoMore").all((req, res, next) => {
  5832. var json = queryString(req.url);
  5833. getmysql(req, res, "getCourseInfoMore", json["cid"]);
  5834. });
  5835. //获取用户基本信息
  5836. router.route("/getAllUserById").all((req, res, next) => {
  5837. var json = queryString(req.url);
  5838. getmysql(req, res, "getAllUserById", json["uid"]);
  5839. });
  5840. //获取用户基本信息
  5841. router.route("/getAllUserByIdP").all((req, res, next) => {
  5842. postmysql(req, res, "getAllUserById");
  5843. });
  5844. //作业生成报告
  5845. router.route("/getWorkData").all((req, res, next) => {
  5846. var json = queryString(req.url); //cid 课程id,page 页数
  5847. getmysql(req, res, "select_work_data", json["cid"]);
  5848. });
  5849. //查询评价体系
  5850. router.route("/getEvaluation").all((req, res, next) => {
  5851. var json = queryString(req.url); //cid 课程id,page 页数
  5852. getmysql(
  5853. req,
  5854. res,
  5855. "select_evaluation",
  5856. json["oid"],
  5857. json["n"],
  5858. json["page"],
  5859. 10
  5860. );
  5861. });
  5862. //添加评价体系
  5863. router.route("/addEvaluation").all((req, res, next) => {
  5864. postmysql(req, res, "add_evaluation");
  5865. //uid 用户id t标题 c内容
  5866. });
  5867. //修改评价体系
  5868. router.route("/updateEvaluation").all((req, res, next) => {
  5869. postmysql(req, res, "update_evaluation");
  5870. //c内容 t标题 id评价id
  5871. });
  5872. //删除评价体系
  5873. router.route("/deleteEvaluation").all((req, res, next) => {
  5874. postmysql(req, res, "delete_evaluation");
  5875. // id评价id
  5876. });
  5877. //删除评价体系前查询课程是否有该评价
  5878. router.route("/selectCourseEva").all((req, res, next) => {
  5879. var json = queryString(req.url); //cid 课程id,page 页数
  5880. getmysql(
  5881. req,
  5882. res,
  5883. "select_course_eva",
  5884. json["eid"],
  5885. );
  5886. });
  5887. //批量添加学校
  5888. router.route("/batchRegistrationSchool").post(function(req, res, next) {
  5889. let users = req.body[0];
  5890. let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
  5891. for (let i = 0; i < arr.length; i++) {
  5892. let _school = encodeURIComponent(arr[i].school);
  5893. let _org = users.org;
  5894. //用戶數據
  5895. let _data = [_school, _org, "", "1", ""];
  5896. //參數拼接,註冊
  5897. _data.unshift(_mysqlLabor[0], _mysqlLabor[1], "insertSchoolByOrg");
  5898. //用戶註冊處理
  5899. mysql.usselect(_data, function(ret) {
  5900. res.end(JSON.stringify({ success: 1 }));
  5901. });
  5902. }
  5903. });
  5904. //批量添加学生
  5905. router.route("/batchRegistrationMore").post(function(req, res, next) {
  5906. let users = req.body[0];
  5907. let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
  5908. for (let i = 0; i < arr.length; i++) {
  5909. let _username = encodeURIComponent(arr[i].name);
  5910. let _mail = encodeURIComponent(arr[i].mail)
  5911. let _password = users.password || "123456";
  5912. let _alias = encodeURIComponent(arr[i].name)
  5913. let _oid = users.oid;
  5914. let _ph = encodeURIComponent(arr[i].phone ? arr[i].phone : "")
  5915. let _class = encodeURIComponent(arr[i].class)
  5916. let _sId = encodeURIComponent(arr[i].sId)
  5917. //加密密碼
  5918. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  5919. //生成激活碼
  5920. let _hashstr = new Date().getTime() + "";
  5921. let _digest = crypto
  5922. .createHash("sha256")
  5923. .update(_hashstr, "utf8")
  5924. .digest("hex");
  5925. //用戶數據
  5926. let _userdata = [
  5927. _mail,
  5928. _password,
  5929. _alias,
  5930. "",
  5931. 1, //0老师 1学生
  5932. _username,
  5933. "",
  5934. generateAPIKey(_username),
  5935. _digest,
  5936. "",
  5937. _username,
  5938. _sId,
  5939. 2, //1老师 2学生
  5940. _oid,
  5941. _ph,
  5942. _class,
  5943. "",
  5944. "0",
  5945. ];
  5946. //參數拼接,註冊
  5947. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregister");
  5948. //用戶註冊處理
  5949. mysql.usselect(_userdata, function(ret) {
  5950. // let _pbluserdata = [
  5951. // ret[1][0].uid,
  5952. // _username,
  5953. // _sId,
  5954. // 2,
  5955. // _oid,
  5956. // _ph,
  5957. // _class,
  5958. // '',
  5959. // "0",
  5960. // ];
  5961. // _pbluserdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateUserByEdu");
  5962. // mysql.usselect(_pbluserdata, function(ret) {
  5963. res.end(JSON.stringify({ success: 1 }));
  5964. // });
  5965. });
  5966. }
  5967. });
  5968. //幼儿园评价
  5969. // 获取所有年级
  5970. router.route("/select_techerAllGrade").all(function(req, res, next) {
  5971. // let users = req.query;
  5972. var json = queryString(req.url);
  5973. getmysql(req, res, "select_techerAllGrade", json['cid']);
  5974. });
  5975. // 获取所有班级
  5976. router.route("/select_techerAllClass").all(function(req, res, next) {
  5977. // let users = req.query;
  5978. var json = queryString(req.url);
  5979. getmysql(req, res, "select_techerAllClass", json['cid']);
  5980. });
  5981. // 获取所有班级
  5982. router.route("/select_techerAllClass2").all(function(req, res, next) {
  5983. // let users = req.query;
  5984. var json = queryString(req.url);
  5985. getmysql(req, res, "select_techerAllClass2", json['cid'], json['gid']);
  5986. });
  5987. // 获取所有班级学生
  5988. router.route("/selectClassStudent").all(function(req, res, next) {
  5989. var json = queryString(req.url);
  5990. getmysql(req, res, "selectClassStudent", json['cid']);
  5991. });
  5992. // 获取所有班级学生
  5993. router.route("/selectClassStudent2").all(function(req, res, next) {
  5994. var json = queryString(req.url);
  5995. getmysql(req, res, "selectClassStudent2", json['cid'], json['gid']);
  5996. });
  5997. // 获取学生详情
  5998. router.route("/selectStudentDetail").all(function(req, res, next) {
  5999. // let users = req.query;
  6000. var json = queryString(req.url);
  6001. console.log(json);
  6002. getmysql(req, res, "selectStudentDetail", json['uid']);
  6003. });
  6004. // 获取学生记录筛选框
  6005. router.route("/selectVeiDoo").all(function(req, res, next) {
  6006. // let users = req.query;
  6007. var json = queryString(req.url);
  6008. // console.log(json);
  6009. getmysql(req, res, "selectVeiDoo", json['oid']);
  6010. });
  6011. // 上传学生评价
  6012. router.route("/insertRecord").all(function(req, res, next) {
  6013. // console.log(req.query);
  6014. postmysql(req, res, "insertRecord");
  6015. });
  6016. // 获取学生记录
  6017. router.route("/selectRecord").all(function(req, res, next) {
  6018. // let users = req.query;
  6019. var json = queryString(req.url);
  6020. // console.log(json);
  6021. // let txt=
  6022. getmysql(req, res, "selectRecord", json['uid'], json['trm'], json['txt']);
  6023. });
  6024. // 获取学生记录详情
  6025. router.route("/selectRecordDetail").all(function(req, res, next) {
  6026. // let users = req.query;
  6027. var json = queryString(req.url);
  6028. // console.log(json);
  6029. getmysql(req, res, "selectRecordDetail", json['id']);
  6030. });
  6031. // 删除学生评价
  6032. router.route("/updateRecord").all(function(req, res, next) {
  6033. // console.log(req.query);
  6034. postmysql(req, res, "updateRecord");
  6035. });
  6036. // 更新学生评价
  6037. router.route("/updateRecordData").all(function(req, res, next) {
  6038. // console.log(req.query);
  6039. postmysql(req, res, "updateRecordData");
  6040. });
  6041. // 获取学生记录详情
  6042. router.route("/selectSerStudent").all(function(req, res, next) {
  6043. // let users = req.query;
  6044. var json = queryString(req.url);
  6045. // console.log(json);
  6046. getmysql(req, res, "selectSerStudent", json['id'], json['txt']);
  6047. });
  6048. // 获取学期
  6049. router.route("/selectTerm").all(function(req, res, next) {
  6050. var json = queryString(req.url);
  6051. getmysql(req, res, "selectTerm");
  6052. });
  6053. // 获取班级信息
  6054. router.route("/selectManyClassStudent").all(function(req, res, next) {
  6055. var json = queryString(req.url);
  6056. getmysql(req, res, "selectManyClassStudent", json['cid'], json['uid']);
  6057. });
  6058. //幼儿园学生评价获取学生列表
  6059. router.route("/selectStudentAndRecord").all(function(req, res, next) {
  6060. var json = queryString(req.url);
  6061. getmysql(req, res, "selectStudentAndRecord", json['cid'], json['cu'], json['cn'], json['oid'], json['org'], json['page'], 10);
  6062. });
  6063. // pbl教师端观察日记
  6064. router.route("/selectVeidooType").all(function(req, res, next) {
  6065. var json = queryString(req.url);
  6066. // console.log(json);
  6067. getmysql(req, res, "selectVeidooType", json['uid'], json['cid'], json['cu'], json['cn'], json['cm'], json['page'], 10);
  6068. });
  6069. //查询幼儿园分类
  6070. router.route("/selectSTEType").all(function(req, res, next) {
  6071. var json = queryString(req.url);
  6072. // console.log(json);
  6073. getmysql(req, res, "selectSTEType", json['org'], json['oid']);
  6074. });
  6075. //查询口语分类
  6076. router.route("/select_englishVoiceType").all(function(req, res, next) {
  6077. var json = queryString(req.url);
  6078. // console.log(json);
  6079. getmysql(req, res, "select_englishVoiceType", json['oid'], json['org']);
  6080. });
  6081. //查询我的口语分类
  6082. router.route("/selectMySubTalk").all(function(req, res, next) {
  6083. var json = queryString(req.url);
  6084. // console.log(json);
  6085. getmysql(req, res, "selectMySubTalk", json['userid']);
  6086. });
  6087. //查询学情报告雷达图数据
  6088. router.route("/selectMapStuScore").all(function(req, res, next) {
  6089. var json = queryString(req.url);
  6090. // console.log(json);
  6091. getmysql(req, res, "selectMapStuScore", json['uid'], json['year']);
  6092. });
  6093. //每个大分类下的关键证据
  6094. router.route("/selectHealthRecord").all(function(req, res, next) {
  6095. var json = queryString(req.url);
  6096. // console.log(json);
  6097. getmysql(req, res, "selectHealthRecord", json['uid'], json['year'], json['txt'], json['page'], 4);
  6098. });
  6099. //手机端 获取记录地点list
  6100. router.route("/selectSTEPlace").all(function(req, res, next) {
  6101. var json = queryString(req.url);
  6102. // console.log(json);
  6103. getmysql(req, res, "selectSTEPlace", json['org'], json['oid']);
  6104. });
  6105. //获取所有的记录进行下载
  6106. router.route("/selectClassAllRecord").all(function(req, res, next) {
  6107. var json = queryString(req.url);
  6108. // console.log(json);
  6109. getmysql(req, res, "selectClassAllRecord",json['cid'], json['id']);
  6110. });
  6111. //record页面计算班级平均分
  6112. router.route("/selectClaAverageScore").all(function(req, res, next) {
  6113. var json = queryString(req.url);
  6114. // console.log(json);
  6115. getmysql(req, res, "selectClaAverageScore", json["cu"], json["oid"], json["cn"], json["trm"], json["page"], 10);
  6116. });
  6117. //record页面下载班级分数数据
  6118. router.route("/selectAllClaAvaRescore").all(function(req, res, next) {
  6119. var json = queryString(req.url);
  6120. // console.log(json);
  6121. getmysql(req, res, "selectAllClaAvaRescore", json["cu"], json["oid"], json["cn"], json["trm"]);
  6122. });
  6123. //学情报告计算班级平均分
  6124. router.route("/selectClaAvaScore").all(function(req, res, next) {
  6125. var json = queryString(req.url);
  6126. // console.log(json);
  6127. getmysql(req, res, "selectClaAvaScore", json["cid"], json["trm"]);
  6128. });
  6129. //查询协同人员不带org的
  6130. router.route("/selectCollaborativeMembers").all(function(req, res, next) {
  6131. var json = queryString(req.url);
  6132. // console.log(json);
  6133. getmysql(req, res, "selectCollaborativeMembers", json["oid"], json["cu"], json["cn"], json["coll"]);
  6134. });
  6135. //查询协同人员带org
  6136. router.route("/selectCollaborativeMembersOrg").all(function(req, res, next) {
  6137. var json = queryString(req.url);
  6138. // console.log(json);
  6139. getmysql(req, res, "selectCollaborativeMembersOrg", json["oid"], json["cu"], json["cn"], json["coll"]);
  6140. });
  6141. // 教师发展获取数据来源表单标题
  6142. router.route("/selectExamineTestName").all(function(req, res, next) {
  6143. // var json = queryString(req.url);
  6144. // console.log(json);
  6145. postmysql(req, res, "selectExamineTestName");
  6146. // getmysql(req, res, "selectExamineTestName", json["testId"]);
  6147. });
  6148. // 教师发展 页面数据
  6149. router.route("/selectTestExamineBase").all(function(req, res, next) {
  6150. var json = queryString(req.url);
  6151. getmysql(req, res, "selectTestExamineBase", json["typ"], json["org"], json["oid"]);
  6152. });
  6153. // 教师发展 按人员页面数据
  6154. router.route("/selectTestExaminePersonData").all(function(req, res, next) {
  6155. var json = queryString(req.url);
  6156. getmysql(req, res, "selectTestExaminePersonData", json["oid"], json["org"], json["type"], json["tname"]);
  6157. });
  6158. // 教师发展 按人员页面数据
  6159. router.route("/selectTestExaminePersonData2").all(function(req, res, next) {
  6160. postmysql(req, res, "selectTestExaminePersonData2");
  6161. });
  6162. // 教师发展 管理员提交数据
  6163. router.route("/updateExamineCogData").all(function(req, res, next) {
  6164. postmysql(req, res, "updateExamineCogData");
  6165. });
  6166. // 教师发展 管理员提交数据(新版添加了修改后保存教师记录)
  6167. router.route("/updateExamineCogDataCopy").all(function(req, res, next) {
  6168. postmysql(req, res, "updateExamineCogDataCopy");
  6169. });
  6170. // 教师发展 获取修改记录
  6171. router.route("/selectExamineOperateRecord").all(function(req, res, next) {
  6172. var json = queryString(req.url);
  6173. getmysql(req, res, "selectExamineOperateRecord", json["tid"], json["type"]);
  6174. });
  6175. // 教师发展 管理员撤回提交数据
  6176. router.route("/updateExamineState").all(function(req, res, next) {
  6177. postmysql(req, res, "updateExamineState");
  6178. });
  6179. // 教师发展 获取数据汇总
  6180. router.route("/selectTestWorksAggregate").all(function(req, res, next) {
  6181. var json = queryString(req.url);
  6182. getmysql(req, res, "selectTestWorksAggregate", json["oid"], json["org"]);
  6183. });
  6184. // 教师发展 提醒
  6185. router.route("/selectExamineTeaRemind").all(function(req, res, next) {
  6186. var json = queryString(req.url);
  6187. getmysql(req, res, "selectExamineTeaRemind", json["oid"], json["org"], json["tea"], json["ptype"]);
  6188. });
  6189. // 课程管理-文档评分
  6190. router.route("/selectWorksEvaScore").all(function(req, res, next) {
  6191. var json = queryString(req.url);
  6192. getmysql(req, res, "selectWorksEvaScore", json["uid"], json["cid"]);
  6193. });
  6194. // 课程管理-文档评分
  6195. router.route("/selectWorksEvaScoreTwo").all(function(req, res, next) {
  6196. var json = queryString(req.url);
  6197. getmysql(req, res, "selectWorksEvaScoreTwo", json["uid"], json["cid"], json["s"], json["t"], json["tool"]);
  6198. });
  6199. /* 新增教研室 */
  6200. router.route("/insertTeacherOfficeCopy").all(function(req, res, next) {
  6201. postmysql(req, res, "insertTeacherOfficeCopy");
  6202. });
  6203. /* 查询教研室*/
  6204. router.route("/selectTeacherOffice2").all(function(req, res, next) {
  6205. var json = queryString(req.url);
  6206. getmysql(req, res, "selectTeacherOffice2", json["cu"], json["oid"], json["cn"], json["pid"], json["page"], 10);
  6207. });
  6208. /* 查询教研室*/
  6209. router.route("/selectPerInfoTeacherOffice").all(function(req, res, next) {
  6210. var json = queryString(req.url);
  6211. getmysql(req, res, "selectPerInfoTeacherOffice", json["cu"], json["oid"], json["cn"], 6);
  6212. });
  6213. /* 查询所有教研室分类与分类下的数据*/
  6214. router.route("/selectPerInfoAllTea").all(function(req, res, next) {
  6215. var json = queryString(req.url);
  6216. getmysql(req, res, "selectPerInfoAllTea",json["oid"]);
  6217. });
  6218. /* 查询教研室类型lim */
  6219. router.route("/selectTeacherOfficeTypeLim").all(function(req, res, next) {
  6220. var json = queryString(req.url);
  6221. getmysql(req, res, "selectTeacherOfficeTypeLim", json["cu"], json["oid"], json["cn"], json["pid"], json["page"], 10);
  6222. });
  6223. /* 查询教研室类型 */
  6224. router.route("/selectTeacherOfficeType").all(function(req, res, next) {
  6225. var json = queryString(req.url);
  6226. getmysql(req, res, "selectTeacherOfficeType", json["cu"], json["oid"], json["cn"], json["pid"]);
  6227. });
  6228. // 存储学生课程分析数据
  6229. router.route("/upDateAnalysis").all(function(req, res, next) {
  6230. postmysql(req, res, "upDateAnalysis");
  6231. });
  6232. // 存储学生课程分析数据 ym
  6233. router.route("/upDateAnalysisTwo").all(function(req, res, next) {
  6234. postmysql(req, res, "upDateAnalysisTwo");
  6235. });
  6236. // 获取教师管理table数据
  6237. router.route("/selectOrgTeachar").all((req, res, next) => {
  6238. var json = queryString(req.url);
  6239. getmysql(
  6240. req,
  6241. res,
  6242. "selectOrgTeachar",
  6243. json["org"],
  6244. json["oid"],
  6245. json["cu"],
  6246. json["cn"],
  6247. json["page"],
  6248. 10
  6249. );
  6250. });
  6251. // 更新老师信息数据
  6252. router.route("/updateYTeacherInfo").all(function(req, res, next) {
  6253. // console.log(req.query);
  6254. postmysql(req, res, "updateYTeacherInfo");
  6255. });
  6256. //教师管理新增教师
  6257. router.route("/teacherRegistration").post(function(req, res, next) {
  6258. var users = req.body[0];
  6259. //循环注册
  6260. var _username = users.alias;
  6261. var _mail = users.username;
  6262. var _password = users.password || "123456";
  6263. var _alias = users.alias;
  6264. var _org = users.org;
  6265. var _oid = users.oid;
  6266. var _ph = users.ph;
  6267. var _class = users.cid;
  6268. var _sId = users.sid;
  6269. var _typ = users.typ;
  6270. var _rol = users.rol;
  6271. //加密密碼
  6272. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6273. //生成激活碼
  6274. let _hashstr = new Date().getTime() + "";
  6275. let _digest = crypto
  6276. .createHash("sha256")
  6277. .update(_hashstr, "utf8")
  6278. .digest("hex");
  6279. //用戶數據
  6280. var _userdata = [
  6281. _mail,
  6282. _password,
  6283. _alias,
  6284. "",
  6285. 0,
  6286. _username,
  6287. "",
  6288. generateAPIKey(_username),
  6289. _digest,
  6290. "",
  6291. _username,
  6292. _sId,
  6293. _typ,
  6294. _org,
  6295. _oid,
  6296. _ph,
  6297. _class,
  6298. "",
  6299. "0",
  6300. _rol
  6301. ];
  6302. //參數拼接,註冊
  6303. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_teacherRegistration");
  6304. //用戶註冊處理
  6305. mysql.usselect(_userdata, function(ret) {
  6306. res.end(
  6307. JSON.stringify({
  6308. uid: ret[1][0].uid,
  6309. ph: _ph,
  6310. oid: _oid,
  6311. cid: _class,
  6312. success: 1,
  6313. })
  6314. );
  6315. });
  6316. });
  6317. //初始化密码
  6318. router.route("/iniPassword").post(function(req, res, next) {
  6319. let users = req.body[0];
  6320. _password = users.pa;
  6321. //加密密碼
  6322. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6323. //用戶數據
  6324. let _userList = [users.uid, _password];
  6325. _userList.unshift(_mysqlLabor[0], _mysqlLabor[1], "iniPassword");
  6326. mysql.usselect(_userList, function(ret) {
  6327. res.end(JSON.stringify({ success: 1 }));
  6328. });
  6329. });
  6330. //批量添加教师
  6331. router.route("/batchRegistrationMore1").post(function(req, res, next) {
  6332. let users = req.body[0];
  6333. let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
  6334. for (let i = 0; i < arr.length; i++) {
  6335. let _username = encodeURIComponent(arr[i].name)
  6336. let _mail = encodeURIComponent(arr[i].mail)
  6337. let _password = users.password || "123456";
  6338. let _alias = encodeURIComponent(arr[i].name)
  6339. let _org = users.org;
  6340. let _oid = encodeURIComponent(arr[i].school)
  6341. let _ph = encodeURIComponent(arr[i].phone ? arr[i].phone : "")
  6342. let _class = encodeURIComponent(arr[i].class)
  6343. let _sId = encodeURIComponent(arr[i].sId)
  6344. //加密密碼
  6345. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6346. //生成激活碼
  6347. let _hashstr = new Date().getTime() + "";
  6348. let _digest = crypto
  6349. .createHash("sha256")
  6350. .update(_hashstr, "utf8")
  6351. .digest("hex");
  6352. //用戶數據
  6353. let _userdata = [
  6354. _mail,
  6355. _password,
  6356. _alias,
  6357. "",
  6358. 0, //0老师 1学生
  6359. _username,
  6360. "",
  6361. generateAPIKey(_username),
  6362. _digest,
  6363. "",
  6364. _username,
  6365. _sId,
  6366. 1, //1老师 2学生
  6367. _org,
  6368. _oid,
  6369. "",
  6370. "",
  6371. "",
  6372. "0",
  6373. ];
  6374. //參數拼接,註冊
  6375. _userdata.unshift(
  6376. _mysqluser[0],
  6377. _mysqluser[1],
  6378. "pbl_add_batchregister_oid"
  6379. );
  6380. //用戶註冊處理
  6381. mysql.usselect(_userdata, function(ret) {
  6382. res.end(JSON.stringify({ success: 1 }));
  6383. });
  6384. }
  6385. });
  6386. //赛事批量注册老师
  6387. router.route("/pbl_add_raceuser_oid").post(function(req, res, next) {
  6388. let users = req.body[0];
  6389. let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
  6390. for (let i = 0; i < arr.length; i++) {
  6391. let _username = encodeURIComponent(arr[i].name)
  6392. let _mail = encodeURIComponent(arr[i].mail)
  6393. let _password = users.password || "123456";
  6394. let _oid = encodeURIComponent(arr[i].school)
  6395. //加密密碼
  6396. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6397. //生成激活碼
  6398. let _hashstr = new Date().getTime() + "";
  6399. let _digest = crypto
  6400. .createHash("sha256")
  6401. .update(_hashstr, "utf8")
  6402. .digest("hex");
  6403. //用戶數據
  6404. let _userdata = [
  6405. _mail,
  6406. _oid,
  6407. _password,
  6408. _username,
  6409. 1, //1普通教师 2市级 3省级 4市级子级评委 5县区评委 6县区子级
  6410. ];
  6411. //參數拼接,註冊
  6412. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "pbl_add_raceuser_oid");
  6413. //用戶註冊處理
  6414. mysql.usselect(_userdata, function(ret) {
  6415. res.end(JSON.stringify({ success: 1 }));
  6416. });
  6417. }
  6418. });
  6419. //新增学生
  6420. router.route("/batchRegistration").post(function(req, res, next) {
  6421. var users = req.body[0];
  6422. //循环注册
  6423. var _username = users.alias;
  6424. var _mail = users.username;
  6425. var _password = users.password || "123456";
  6426. var _alias = users.alias;
  6427. var _oid = users.oid;
  6428. var _ph = users.ph;
  6429. var _class = users.cid;
  6430. var _sId = users.sid;
  6431. //加密密碼
  6432. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6433. //生成激活碼
  6434. let _hashstr = new Date().getTime() + "";
  6435. let _digest = crypto
  6436. .createHash("sha256")
  6437. .update(_hashstr, "utf8")
  6438. .digest("hex");
  6439. //用戶數據
  6440. var _userdata = [
  6441. _mail,
  6442. _password,
  6443. _alias,
  6444. "",
  6445. 1,
  6446. _username,
  6447. "",
  6448. generateAPIKey(_username),
  6449. _digest,
  6450. "",
  6451. _username,
  6452. _sId,
  6453. 2,
  6454. _oid,
  6455. _ph,
  6456. _class,
  6457. "",
  6458. "0",
  6459. ];
  6460. //參數拼接,註冊
  6461. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregister");
  6462. //用戶註冊處理
  6463. mysql.usselect(_userdata, function(ret) {
  6464. res.end(
  6465. JSON.stringify({
  6466. uid: ret[1][0].uid,
  6467. ph: _ph,
  6468. oid: _oid,
  6469. cid: _class,
  6470. success: 1,
  6471. })
  6472. );
  6473. });
  6474. });
  6475. //深圳电教馆注册
  6476. router.route("/batchRegistrationSzdjg").post(function(req, res, next) {
  6477. var users = Object.values(req.body)[0].split(",");
  6478. //循环注册
  6479. var _username = users[0]; //名字
  6480. var _mail = users[1]; //用户名 账号
  6481. var _password = "123456";
  6482. var _alias = _username;
  6483. var _org = users[2];
  6484. var _oid = users[3];
  6485. var _ph = users[4];
  6486. var _class = users[5];
  6487. var _type = users[6];
  6488. var _openid = users[7];
  6489. //加密密碼
  6490. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6491. //生成激活碼
  6492. let _hashstr = new Date().getTime() + "";
  6493. let _digest = crypto
  6494. .createHash("sha256")
  6495. .update(_hashstr, "utf8")
  6496. .digest("hex");
  6497. //用戶數據
  6498. var _userdata = [
  6499. _mail,
  6500. _password,
  6501. _alias,
  6502. "",
  6503. 0,
  6504. _username,
  6505. _openid,
  6506. generateAPIKey(_username),
  6507. _digest,
  6508. "",
  6509. _username,
  6510. '',
  6511. _type,
  6512. _org,
  6513. _oid,
  6514. _ph,
  6515. _class,
  6516. "",
  6517. "0",
  6518. ];
  6519. //參數拼接,註冊
  6520. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregisterSzdjg");
  6521. //用戶註冊處理
  6522. mysql.usselect(_userdata, function(ret) {
  6523. res.end(
  6524. JSON.stringify({
  6525. uid: ret[1][0].uid,
  6526. ph: _ph,
  6527. oid: _oid,
  6528. cid: _class,
  6529. success: 1,
  6530. })
  6531. );
  6532. });
  6533. });
  6534. //深圳电教馆注册
  6535. router.route("/batchRegistrationSzdjg2").post(function(req, res, next) {
  6536. var users = Object.values(req.body)[0].split(",");
  6537. //循环注册
  6538. var _username = users[0]; //名字
  6539. var _mail = users[1]; //用户名 账号
  6540. var _password = "123456";
  6541. var _alias = _username;
  6542. var _org = users[2];
  6543. var _oid = users[3];
  6544. var _ph = users[4];
  6545. var _class = users[5];
  6546. var _type = users[6];
  6547. var _openid = users[7];
  6548. var _dest = users[8];
  6549. //加密密碼
  6550. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6551. //生成激活碼
  6552. let _hashstr = new Date().getTime() + "";
  6553. let _digest = crypto
  6554. .createHash("sha256")
  6555. .update(_hashstr, "utf8")
  6556. .digest("hex");
  6557. //用戶數據
  6558. var _userdata = [
  6559. _mail,
  6560. _password,
  6561. _alias,
  6562. "",
  6563. 0,
  6564. _username,
  6565. _openid,
  6566. generateAPIKey(_username),
  6567. _digest,
  6568. "",
  6569. _username,
  6570. '',
  6571. _type,
  6572. _org,
  6573. _oid,
  6574. _ph,
  6575. _class,
  6576. "",
  6577. "0",
  6578. _dest
  6579. ];
  6580. //參數拼接,註冊
  6581. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregisterSzdjg2");
  6582. //用戶註冊處理
  6583. mysql.usselect(_userdata, function(ret) {
  6584. res.end(
  6585. JSON.stringify({
  6586. uid: ret[1][0].uid,
  6587. ph: _ph,
  6588. oid: _oid,
  6589. cid: _class,
  6590. success: 1,
  6591. })
  6592. );
  6593. });
  6594. });
  6595. //深圳电教馆注册
  6596. router.route("/batchRegistrationSzdjg3").post(function(req, res, next) {
  6597. var users = Object.values(req.body)[0].split(",");
  6598. //循环注册
  6599. var _username = users[0]; //名字
  6600. var _mail = users[1]; //用户名 账号
  6601. var _password = "123456";
  6602. var _alias = _username;
  6603. var _org = users[2];
  6604. var _oid = users[3];
  6605. var _ph = users[4];
  6606. var _class = users[5];
  6607. var _type = users[6];
  6608. var _openid = users[7];
  6609. var _dest = users[8];
  6610. var _eduId = users[9];
  6611. //加密密碼
  6612. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6613. //生成激活碼
  6614. let _hashstr = new Date().getTime() + "";
  6615. let _digest = crypto
  6616. .createHash("sha256")
  6617. .update(_hashstr, "utf8")
  6618. .digest("hex");
  6619. //用戶數據
  6620. var _userdata = [
  6621. _mail,
  6622. _password,
  6623. _alias,
  6624. "",
  6625. 0,
  6626. _username,
  6627. _openid,
  6628. generateAPIKey(_username),
  6629. _digest,
  6630. "",
  6631. _username,
  6632. '',
  6633. _type,
  6634. _org,
  6635. _oid,
  6636. _ph,
  6637. _class,
  6638. "",
  6639. "0",
  6640. _dest,
  6641. _eduId
  6642. ];
  6643. //參數拼接,註冊
  6644. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregisterSzdjg3");
  6645. //用戶註冊處理
  6646. mysql.usselect(_userdata, function(ret) {
  6647. res.end(
  6648. JSON.stringify({
  6649. uid: ret[1][0].uid,
  6650. ph: _ph,
  6651. oid: _oid,
  6652. cid: _class,
  6653. success: 1,
  6654. })
  6655. );
  6656. });
  6657. });
  6658. //新增教师
  6659. router.route("/batchRegistration1").post(function(req, res, next) {
  6660. var users = req.body[0];
  6661. //循环注册
  6662. var _username = users.alias;
  6663. var _mail = users.username;
  6664. var _password = users.password || "123456";
  6665. var _alias = users.alias;
  6666. var _org = users.org;
  6667. var _oid = users.oid;
  6668. var _ph = users.ph;
  6669. var _class = users.cid;
  6670. var _sId = users.sid;
  6671. //加密密碼
  6672. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6673. //生成激活碼
  6674. let _hashstr = new Date().getTime() + "";
  6675. let _digest = crypto
  6676. .createHash("sha256")
  6677. .update(_hashstr, "utf8")
  6678. .digest("hex");
  6679. //用戶數據
  6680. var _userdata = [
  6681. _mail,
  6682. _password,
  6683. _alias,
  6684. "",
  6685. 0,
  6686. _username,
  6687. "",
  6688. generateAPIKey(_username),
  6689. _digest,
  6690. "",
  6691. _username,
  6692. _sId,
  6693. 1,
  6694. _org,
  6695. _oid,
  6696. _ph,
  6697. _class,
  6698. "",
  6699. "0",
  6700. ];
  6701. //參數拼接,註冊
  6702. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregister1");
  6703. //用戶註冊處理
  6704. mysql.usselect(_userdata, function(ret) {
  6705. res.end(
  6706. JSON.stringify({
  6707. uid: ret[1][0].uid,
  6708. ph: _ph,
  6709. oid: _oid,
  6710. cid: _class,
  6711. success: 1,
  6712. })
  6713. );
  6714. });
  6715. });
  6716. router.route("/batchRegistrationOrg").post(function(req, res, next) {
  6717. var users = req.body[0];
  6718. //循环注册
  6719. var _username = users.alias;
  6720. var _mail = users.username;
  6721. var _password = users.password || "123456";
  6722. var _alias = users.alias;
  6723. var _oid = users.oid;
  6724. var _ph = users.ph;
  6725. var _class = users.cid;
  6726. var _sId = users.sid;
  6727. var _org = users.org;
  6728. //加密密碼
  6729. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6730. //生成激活碼
  6731. let _hashstr = new Date().getTime() + "";
  6732. let _digest = crypto
  6733. .createHash("sha256")
  6734. .update(_hashstr, "utf8")
  6735. .digest("hex");
  6736. //用戶數據
  6737. var _userdata = [
  6738. _mail,
  6739. _password,
  6740. _alias,
  6741. "",
  6742. 1,
  6743. _username,
  6744. "",
  6745. generateAPIKey(_username),
  6746. _digest,
  6747. "",
  6748. _username,
  6749. _sId,
  6750. 2,
  6751. _oid,
  6752. _ph,
  6753. _class,
  6754. "",
  6755. "0",
  6756. _org,
  6757. ];
  6758. //參數拼接,註冊
  6759. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregister_org");
  6760. //用戶註冊處理
  6761. mysql.usselect(_userdata, function(ret) {
  6762. res.end(
  6763. JSON.stringify({
  6764. uid: ret[1][0].uid,
  6765. ph: _ph,
  6766. oid: _oid,
  6767. cid: _class,
  6768. success: 1,
  6769. })
  6770. );
  6771. });
  6772. });
  6773. router.route("/batchRegistrationMoreOrg").post(function(req, res, next) {
  6774. let users = req.body[0];
  6775. let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
  6776. for (let i = 0; i < arr.length; i++) {
  6777. let _username = encodeURIComponent(arr[i].name)
  6778. let _mail = encodeURIComponent(arr[i].mail)
  6779. let _password = users.password || "123456";
  6780. let _alias = encodeURIComponent(arr[i].name)
  6781. let _oid = users.oid;
  6782. let _ph = encodeURIComponent(arr[i].phone ? arr[i].phone : "")
  6783. let _class = encodeURIComponent(arr[i].class)
  6784. let _sId = encodeURIComponent(arr[i].sId)
  6785. let _org = users.org;
  6786. //加密密碼
  6787. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6788. //生成激活碼
  6789. let _hashstr = new Date().getTime() + "";
  6790. let _digest = crypto
  6791. .createHash("sha256")
  6792. .update(_hashstr, "utf8")
  6793. .digest("hex");
  6794. //用戶數據
  6795. let _userdata = [
  6796. _mail,
  6797. _password,
  6798. _alias,
  6799. "",
  6800. 1, //0老师 1学生
  6801. _username,
  6802. "",
  6803. generateAPIKey(_username),
  6804. _digest,
  6805. "",
  6806. _username,
  6807. _sId,
  6808. 2, //1老师 2学生
  6809. _oid,
  6810. _ph,
  6811. _class,
  6812. "",
  6813. "0",
  6814. _org,
  6815. ];
  6816. //參數拼接,註冊
  6817. _userdata.unshift(
  6818. _mysqluser[0],
  6819. _mysqluser[1],
  6820. "pbl_add_batchregister_org2"
  6821. );
  6822. //用戶註冊處理
  6823. mysql.usselect(_userdata, function(ret) {
  6824. res.end(JSON.stringify({ success: 1 }));
  6825. });
  6826. }
  6827. });
  6828. //工作室管理
  6829. router.route("/updateStudioWorkNew4").all((req, res, next) => {
  6830. //学生
  6831. if (req.body[0]) {
  6832. let p = [req.body[0].cid];
  6833. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_studio_course_detail2"); //執行存儲過程
  6834. mysql.usselect(p, function(ret) {
  6835. let _unitIndex = parseInt(req.body[0].unitIndex);
  6836. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  6837. let _unitJson = JSON.parse(ret[0][0].chapters);
  6838. if (_unitJson.length - 1 < _unitIndex) {
  6839. let _i = _unitIndex - (_unitJson.length - 1);
  6840. for (let i = 0; i < _i; i++) {
  6841. _unitJson.push({
  6842. dyName: "", //单元标题
  6843. chapterInfo: [{
  6844. isread: false,
  6845. chapterid: guid(),
  6846. title: "",
  6847. courseName: "",
  6848. taskJson: [{
  6849. task: "",
  6850. taskDetail: "",
  6851. chapterData: [],
  6852. toolText: "",
  6853. toolChoose: [{
  6854. tool: [],
  6855. toolDetail: "",
  6856. toolType: 0,
  6857. askCount: 1,
  6858. askTitle: "",
  6859. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  6860. }, ],
  6861. isShowTools: false,
  6862. askCount: 1,
  6863. isFold: 0,
  6864. askTitle: "",
  6865. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  6866. checkJson: [{ checkCount: [], checkPerent: [] }],
  6867. homeworkList: [],
  6868. }, ],
  6869. itemCount: 1,
  6870. fileList1: [],
  6871. video: [],
  6872. testData: [],
  6873. pData: [],
  6874. templateArray: [],
  6875. }, ],
  6876. });
  6877. }
  6878. _unitJson[_unitIndex] = _chapters[_unitIndex];
  6879. } else {
  6880. _unitJson[_unitIndex] = _chapters[_unitIndex];
  6881. }
  6882. // console.log(_unitJson);
  6883. let p2 = [
  6884. req.body[0].cid,
  6885. encodeURIComponent(JSON.stringify(_unitJson)),
  6886. ];
  6887. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudioWorkNew4"); //執行存儲過程
  6888. mysql.usselect(p2, function(ret) {
  6889. res.end(JSON.stringify({ success: 1 }));
  6890. });
  6891. // res.end(JSON.stringify({ success: 1 }));
  6892. });
  6893. }
  6894. });
  6895. router.route("/updateStudioWorkNew2").all((req, res, next) => {
  6896. //学生
  6897. if (req.body[0]) {
  6898. p = [
  6899. req.body[0].cid,
  6900. req.body[0].title,
  6901. req.body[0].brief,
  6902. req.body[0].cover,
  6903. req.body[0].evaId,
  6904. req.body[0].astudent,
  6905. req.body[0].see,
  6906. req.body[0].chapters,
  6907. req.body[0].template,
  6908. req.body[0].ateacher,
  6909. ];
  6910. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudioWorkNew2"); //執行存儲過程
  6911. mysql.usselect(p, function(ret) {
  6912. let course = req.body[0].courseType;
  6913. let courseId = req.body[0].cid;
  6914. let userid = req.body[0].uid;
  6915. delStudioCourseTypeS(course, courseId, userid);
  6916. res.end(JSON.stringify({ success: 1 }));
  6917. });
  6918. }
  6919. });
  6920. router.route("/addStudioCourseWorkNew2").all((req, res, next) => {
  6921. //学生
  6922. if (req.body[0]) {
  6923. p = [
  6924. req.body[0].uid,
  6925. req.body[0].title,
  6926. req.body[0].brief,
  6927. req.body[0].cover,
  6928. req.body[0].evaId,
  6929. req.body[0].astudent,
  6930. req.body[0].see,
  6931. req.body[0].chapters,
  6932. req.body[0].template,
  6933. req.body[0].ateacher,
  6934. ];
  6935. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addStudioCourseWorkNew2"); //執行存儲過程
  6936. mysql.usselect(p, function(ret) {
  6937. let course = req.body[0].courseType;
  6938. let courseId = ret[0][0].courseId;
  6939. let userid = req.body[0].uid;
  6940. delStudioCourseTypeS(course, courseId, userid);
  6941. res.end(
  6942. JSON.stringify({
  6943. ordernumber: ret[0][0].ordernumber,
  6944. courseId: ret[0][0].courseId,
  6945. success: 1,
  6946. })
  6947. );
  6948. });
  6949. }
  6950. });
  6951. //teacher 查询项目模板
  6952. router.route("/getStudioTemplateTs").all((req, res, next) => {
  6953. var json = queryString(req.url);
  6954. getmysql(req, res, "getStudioTemplateTs", json["oid"]);
  6955. });
  6956. //查看课程
  6957. router.route("/select_studio_course_detail").all((req, res, next) => {
  6958. //学生
  6959. var json = queryString(req.url);
  6960. getmysql(req, res, "select_studio_course_detail", json["cid"]);
  6961. });
  6962. //查看课程
  6963. router.route("/select_studio_course_detail2").all((req, res, next) => {
  6964. //学生
  6965. var json = queryString(req.url);
  6966. getmysql(req, res, "select_studio_course_detail2", json["cid"]);
  6967. });
  6968. //协同恢复删除的阶段
  6969. router.route("/restoreStudioWork").all((req, res, next) => {
  6970. //学生
  6971. if (req.body[0]) {
  6972. let p = [req.body[0].cid];
  6973. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_studio_course_detail2"); //執行存儲過程
  6974. mysql.usselect(p, function(ret) {
  6975. let _chapid = req.body[0].chapid;
  6976. // console.log(_chapid);
  6977. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  6978. let _unitJson = JSON.parse(ret[0][0].chapters);
  6979. let _unitJson2 = [];
  6980. let chpaindex;
  6981. for (var i = 0; i < _chapters.length; i++) {
  6982. if (_chapters[i].chapterInfo[0].chapterid == _chapid) {
  6983. chpaindex = i;
  6984. }
  6985. }
  6986. for (var i = 0; i < _unitJson.length; i++) {
  6987. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  6988. // console.log(1);
  6989. // _unitJson.splice(i, -1)
  6990. _unitJson2.push(_unitJson[i]);
  6991. // break;
  6992. }
  6993. }
  6994. _unitJson2.splice(chpaindex, 0, _chapters[chpaindex]);
  6995. // console.log(_unitJson2);
  6996. let p2 = [
  6997. req.body[0].cid,
  6998. JSON.stringify(_unitJson2).replaceAll(/%/g, "%25"),
  6999. ];
  7000. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudioWorkNew4"); //執行存儲過程
  7001. mysql.usselect(p2, function(ret) {
  7002. res.end(JSON.stringify({ success: 1 }));
  7003. });
  7004. // res.end(JSON.stringify({ success: 1 }));
  7005. });
  7006. }
  7007. });
  7008. //查询分类及所有子分类
  7009. router.route("/selectAllTypeStudio").all((req, res, next) => {
  7010. var json = queryString(req.url);
  7011. getmysql(req, res, "selectAllTypeStudio", json["org"], json["oid"]);
  7012. });
  7013. //上传文件
  7014. router.route("/addStudioCourseWorksS").all((req, res, next) => {
  7015. postmysql(req, res, "addStudioCourseWorksS");
  7016. });
  7017. //删除提交的作业
  7018. router.route("/deleteStudioCourseWorkS").all((req, res, next) => {
  7019. postmysql(req, res, "deleteStudioCourseWorkS");
  7020. });
  7021. //创建新话题
  7022. router.route("/addSubTalk").all((req, res, next) => {
  7023. postmysql(req, res, "addSubTalk");
  7024. });
  7025. //创建新子分类
  7026. router.route("/addEngVType").all((req, res, next) => {
  7027. postmysql(req, res, "addEngVType");
  7028. });
  7029. router.route("/selectStudioCourseNew222").all((req, res, next) => {
  7030. var json = queryString(req.url);
  7031. getmysql(
  7032. req,
  7033. res,
  7034. "selectStudioCourseNew222",
  7035. json["type"],
  7036. json["uid"],
  7037. json["oid"],
  7038. json["org"],
  7039. json["typea"],
  7040. json["typeb"],
  7041. json["typec"],
  7042. json["typed"],
  7043. json["typef"],
  7044. json["typeE"],
  7045. json["cu"],
  7046. json["cn"],
  7047. json["page"],
  7048. json["pageSize"]
  7049. );
  7050. });
  7051. //删除1课程
  7052. router.route("/deleteStudioCourse").all((req, res, next) => {
  7053. var json = queryString(req.url);
  7054. getmysql2(req, res, "deleteStudioCourse", json["cid"]);
  7055. });
  7056. //添加分享课程数据
  7057. router.route("/addShareCourse").post((req, res, next) => {
  7058. var json = queryString(req.url);
  7059. postmysql(req, res, "addShareCourse");
  7060. });
  7061. //获取分享课程数据
  7062. router.route("/getShareCourse").all((req, res, next) => {
  7063. var json = queryString(req.url);
  7064. getmysql(req, res, "getShareCourse", json["cid"],json["type"]);
  7065. });
  7066. router.route("/delShareCourse").all((req, res, next) => {
  7067. var json = queryString(req.url);
  7068. postmysql(req, res, "delShareCourse");
  7069. });
  7070. function delStudioCourseTypeS(course, courseId, userid) {
  7071. let _courseId = courseId;
  7072. var _userdata = [_courseId];
  7073. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_studioCourseTypeS");
  7074. mysql.usselect(_userdata, function(ret) {
  7075. // console.log(ret);
  7076. addStudioCourseTypeS(userid, course, _courseId);
  7077. });
  7078. // setTimeout(() => {
  7079. // }, 1000);
  7080. }
  7081. function addStudioCourseTypeS(userid, course, _courseId) {
  7082. var _uid = userid;
  7083. var _courses = _courseId;
  7084. var _tid = JSON.parse(decodeURIComponent(course));
  7085. for (let i = 0; i < _tid.length; i++) {
  7086. if (_tid[i] == "") {
  7087. continue;
  7088. }
  7089. var _userdata = [_courses, _tid[i], _uid];
  7090. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_studioCourseTypeS");
  7091. mysql.usselect(_userdata, function(ret) {
  7092. // console.log(ret);
  7093. });
  7094. }
  7095. }
  7096. //删除作业阶段任务工具
  7097. router.route("/deleteStudioToolSTT").all((req, res, next) => {
  7098. postmysql(req, res, "deleteStudioToolSTT");
  7099. });
  7100. //删除作业阶段任务
  7101. router.route("/deleteStudioToolST").all((req, res, next) => {
  7102. postmysql(req, res, "deleteStudioToolST");
  7103. });
  7104. //删除作业阶段
  7105. router.route("/deleteStudioToolS").all((req, res, next) => {
  7106. postmysql(req, res, "deleteStudioToolST");
  7107. });
  7108. //工作管理首页查询分类
  7109. router.route("/selectStudioCourseNew22Mode").all((req, res, next) => {
  7110. var json = queryString(req.url);
  7111. getmysql(
  7112. req,
  7113. res,
  7114. "selectStudioCourseNew22Mode",
  7115. json["type"],
  7116. json["uid"],
  7117. json["oid"],
  7118. json["org"],
  7119. json["typea"],
  7120. json["typeb"],
  7121. json["typec"],
  7122. json["typed"],
  7123. json["typef"],
  7124. json["typeE"],
  7125. json["cu"],
  7126. json["cn"]
  7127. );
  7128. });
  7129. //工作管理首页查询
  7130. router.route("/selectStudioCourseNew22").all((req, res, next) => {
  7131. var json = queryString(req.url);
  7132. getmysql(
  7133. req,
  7134. res,
  7135. "selectStudioCourseNew22",
  7136. json["type"],
  7137. json["uid"],
  7138. json["oid"],
  7139. json["org"],
  7140. json["typea"],
  7141. json["typeb"],
  7142. json["typec"],
  7143. json["typed"],
  7144. json["typef"],
  7145. json["typeE"],
  7146. json["cu"],
  7147. json["cn"],
  7148. json["page"],
  7149. json["pageSize"]
  7150. );
  7151. });
  7152. //根据学校查询banner
  7153. router.route("/selectBannerByOidStudio").all((req, res, next) => {
  7154. var json = queryString(req.url);
  7155. getmysql(req, res, "selectBannerByOidStudio", json["oid"]);
  7156. });
  7157. //admin 查询banner
  7158. router.route("/getBannerStudio").all((req, res, next) => {
  7159. var json = queryString(req.url);
  7160. getmysql(req, res, "getBannerStudio");
  7161. });
  7162. //查询工作课程详情
  7163. router.route("/selectStudioCourseDetail2").all((req, res, next) => {
  7164. //学生
  7165. var json = queryString(req.url);
  7166. getmysql(req, res, "selectStudioCourseDetail2", json["courseId"]);
  7167. });
  7168. //查询工作课程详情
  7169. router.route("/selectStudioCourseDetail3").all((req, res, next) => {
  7170. //学生
  7171. var json = queryString(req.url);
  7172. getmysql(req, res, "selectStudioCourseDetail3", json["courseId"]);
  7173. });
  7174. //上传文件
  7175. router.route("/addCourseWorks4studio").all((req, res, next) => {
  7176. postmysql3(req, res, "addCourseWorks4studio");
  7177. });
  7178. //查询教师资源分类
  7179. router.route("/selectAllSourceType").all((req, res, next) => {
  7180. //学生
  7181. var json = queryString(req.url);
  7182. getmysql(req, res, "selectAllSourceType", json["oid"], json["org"]);
  7183. });
  7184. //查询资源分类
  7185. router.route("/selectAllEvaType").all((req, res, next) => {
  7186. var json = queryString(req.url);
  7187. getmysql(req, res, "selectAllEvaType", json["oid"], json["org"]);
  7188. });
  7189. router.route("/addSource").all((req, res, next) => {
  7190. //添加资源
  7191. if (req.body[0]) {
  7192. p = [
  7193. req.body[0].name,
  7194. req.body[0].url,
  7195. req.body[0].detail,
  7196. req.body[0].label,
  7197. req.body[0].userid,
  7198. ];
  7199. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addSource");
  7200. //執行存儲過程
  7201. mysql.usselect(p, function(ret) {
  7202. let course = req.body[0].courseType;
  7203. let courseId = ret[0][0].id;
  7204. let userid = req.body[0].userid;
  7205. delSourceType(course, courseId, userid);
  7206. res.end(JSON.stringify({ id: ret[0][0].id, success: 1 }));
  7207. // res.end(JSON.stringify(ret));
  7208. });
  7209. }
  7210. });
  7211. //删除1资源模板分类
  7212. router.route("/deleteCETLabel").all((req, res, next) => {
  7213. var json = queryString(req.url);
  7214. getmysql2(req, res, "deleteCETLabel", json["cid"]);
  7215. });
  7216. //添加资源模板分类
  7217. router.route("/addCETLabel").all((req, res, next) => {
  7218. postmysql(req, res, "addCETLabel");
  7219. });
  7220. //资源模板分享
  7221. router.route("/addCETShare").all((req, res, next) => {
  7222. // if (req.body[0]) {
  7223. // p = [
  7224. // req.body[0].uid,
  7225. // req.body[0].n,
  7226. // req.body[0].json,
  7227. // req.body[0].t,
  7228. // req.body[0].oid,
  7229. // ];
  7230. // p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addCETShare");
  7231. // //執行存儲過程
  7232. // mysql.usselect(p, function(ret) {
  7233. // res.end(JSON.stringify({ id: ret[0][0].id, success: 1 }));
  7234. // // res.end(JSON.stringify(ret));
  7235. // });
  7236. // }
  7237. postmysql(req, res, "addCETShare");
  7238. });
  7239. router.route("/updateSource").all((req, res, next) => {
  7240. //修改资源
  7241. if (req.body[0]) {
  7242. p = [
  7243. req.body[0].id,
  7244. req.body[0].name,
  7245. req.body[0].url,
  7246. req.body[0].detail,
  7247. req.body[0].label,
  7248. req.body[0].userid,
  7249. ];
  7250. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateSource");
  7251. //執行存儲過程
  7252. mysql.usselect(p, function(ret) {
  7253. let course = req.body[0].courseType;
  7254. let courseId = req.body[0].id;
  7255. let userid = req.body[0].userid;
  7256. delSourceType(course, courseId, userid);
  7257. res.end(JSON.stringify({ id: req.body[0].id, success: 1 }));
  7258. // res.end(JSON.stringify(ret));
  7259. });
  7260. }
  7261. });
  7262. function delSourceType(course, courseId, userid) {
  7263. let _courseId = courseId;
  7264. var _userdata = [_courseId];
  7265. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_sourceType");
  7266. mysql.usselect(_userdata, function(ret) {
  7267. addSourceType(userid, course, _courseId);
  7268. });
  7269. }
  7270. function addSourceType(userid, course, _courseId) {
  7271. var _uid = userid;
  7272. var _courses = _courseId;
  7273. var _tid = JSON.parse(decodeURIComponent(course));
  7274. for (let i = 0; i < _tid.length; i++) {
  7275. if (_tid[i] == "") {
  7276. continue;
  7277. }
  7278. var _userdata = [_courses, _tid[i], _uid];
  7279. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_sourceType");
  7280. mysql.usselect(_userdata, function(ret) {
  7281. // console.log(ret);
  7282. });
  7283. }
  7284. }
  7285. //资源查询
  7286. router.route("/selectSource").all((req, res, next) => {
  7287. var json = queryString(req.url);
  7288. getmysql(
  7289. req,
  7290. res,
  7291. "selectSource",
  7292. json["uid"],
  7293. json["oid"],
  7294. json["org"],
  7295. json["typea"],
  7296. json["typeb"],
  7297. json["typeE"],
  7298. json["cn"],
  7299. json["page"],
  7300. json["pageSize"]
  7301. );
  7302. });
  7303. //评价资源查询
  7304. router.route("/selectCourseEvaT").all((req, res, next) => {
  7305. var json = queryString(req.url);
  7306. getmysql(
  7307. req,
  7308. res,
  7309. "selectCourseEvaT",
  7310. json["uid"],
  7311. json["oid"],
  7312. json["org"],
  7313. json["typea"],
  7314. json["typeb"],
  7315. json["typeE"],
  7316. json["cn"],
  7317. json["type"],
  7318. json["page"],
  7319. json["pageSize"]
  7320. );
  7321. });
  7322. //评价资源重命名 修1
  7323. router.route("/updateCourseET").get((req, res, next) => {
  7324. var json = queryString(req.url);
  7325. getmysql2(
  7326. req,
  7327. res,
  7328. "updateCourseET",
  7329. json["id"],
  7330. json["n"],
  7331. );
  7332. });
  7333. //删除1评价资源
  7334. router.route("/deleteCourseET").all((req, res, next) => {
  7335. var json = queryString(req.url);
  7336. getmysql2(
  7337. req,
  7338. res,
  7339. "deleteCourseET",
  7340. json["id"],
  7341. );
  7342. });
  7343. //添加评价资源分类 修1
  7344. router.route("/addCETType").get((req, res, next) => {
  7345. var json = queryString(req.url);
  7346. getmysql2(
  7347. req,
  7348. res,
  7349. "addCETType",
  7350. json["pid"],
  7351. json["ppid"],
  7352. json["n"],
  7353. json["uid"],
  7354. json["oid"],
  7355. );
  7356. });
  7357. //数据看板-综合数据
  7358. router.route("/selectDataBoardSchool").all((req, res, next) => {
  7359. postmysql(req, res, "selectDataBoardSchool");
  7360. });
  7361. //数据看板-教师数据
  7362. router.route("/selectDataBoardTeacher").all((req, res, next) => {
  7363. postmysql(req, res, "selectDataBoardTeacher");
  7364. });
  7365. //数据看板-学生数据
  7366. router.route("/selectDataBoardStudent").all((req, res, next) => {
  7367. postmysql(req, res, "selectDataBoardStudent");
  7368. });
  7369. //数据看板-课程数据
  7370. router.route("/selectDataBoardCourse").all((req, res, next) => {
  7371. postmysql(req, res, "selectDataBoardCourse");
  7372. });
  7373. //数据看板-综合数据
  7374. router.route("/selectDataBoardSchoolNew").all((req, res, next) => {
  7375. postmysql(req, res, "selectDataBoardSchoolNew");
  7376. });
  7377. //数据看板-教师数据
  7378. router.route("/selectDataBoardTeacherNew").all((req, res, next) => {
  7379. postmysql(req, res, "selectDataBoardTeacherNew");
  7380. });
  7381. //数据看板-学生数据
  7382. router.route("/selectDataBoardStudentNew").all((req, res, next) => {
  7383. postmysql(req, res, "selectDataBoardStudentNew");
  7384. });
  7385. //数据看板-课程数据
  7386. router.route("/selectDataBoardCourseNew").all((req, res, next) => {
  7387. postmysql(req, res, "selectDataBoardCourseNew");
  7388. });
  7389. //数据看板-课程数据
  7390. router.route("/selectDataBoardStudentCourseNew").all((req, res, next) => {
  7391. postmysql(req, res, "selectDataBoardStudentCourseNew");
  7392. });
  7393. //数据看板-学生排行榜
  7394. router.route("/selectDataboardStudentRank").all((req, res, next) => {
  7395. postmysql(req, res, "selectDataboardStudentRank");
  7396. });
  7397. //数据看板-教师排行榜
  7398. router.route("/selectDataboardTeacherRank").all((req, res, next) => {
  7399. postmysql(req, res, "selectDataboardTeacherRank");
  7400. });
  7401. //数据看板-评测
  7402. router.route("/selectDataBoardTest").all((req, res, next) => {
  7403. postmysql(req, res, "selectDataBoardTest");
  7404. });
  7405. //数据看板-市级数据
  7406. router.route("/selectDataBoardCitySz").all((req, res, next) => {
  7407. postmysql(req, res, "selectDataBoardCitySz");
  7408. });
  7409. //数据看板-区级数据
  7410. router.route("/selectDataBoardAreaSz").all((req, res, next) => {
  7411. postmysql(req, res, "selectDataBoardAreaSz");
  7412. });
  7413. //数据看板-综合数据
  7414. router.route("/getDataBoardSchoolNew").all((req, res, next) => {
  7415. let p = Object.values(req.body[0]);
  7416. let d = Object.values(req.body[0]);
  7417. console.log(p)
  7418. p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
  7419. mysql.usselect(p, function(ret) {
  7420. if(!ret[0].length){
  7421. let p2 = [d[0], d[1]];
  7422. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardSchoolNew');
  7423. mysql.usselect(p2, function(ret) {
  7424. res.end(JSON.stringify(ret));
  7425. let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'1'];
  7426. p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
  7427. mysql.usselect(p3, function(ret) {})
  7428. });
  7429. }else{
  7430. console.log(1);
  7431. res.end(ret[0][0].json);
  7432. }
  7433. // res.end(JSON.stringify(ret));
  7434. });
  7435. });
  7436. //数据看板-课程数据
  7437. router.route("/getDataBoardCourseNew").all((req, res, next) => {
  7438. let p = Object.values(req.body[0]);
  7439. let d = Object.values(req.body[0]);
  7440. console.log(p)
  7441. p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
  7442. mysql.usselect(p, function(ret) {
  7443. if(!ret[0].length){
  7444. let p2 = [d[0], d[1]];
  7445. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardCourseNew');
  7446. mysql.usselect(p2, function(ret) {
  7447. res.end(JSON.stringify(ret));
  7448. let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'2'];
  7449. p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
  7450. mysql.usselect(p3, function(ret) {})
  7451. });
  7452. }else{
  7453. console.log(1);
  7454. res.end(ret[0][0].json);
  7455. }
  7456. // res.end(JSON.stringify(ret));
  7457. });
  7458. });
  7459. //数据看板-项目数据
  7460. router.route("/getDataBoardStudentCourseNew").all((req, res, next) => {
  7461. let p = Object.values(req.body[0]);
  7462. let d = Object.values(req.body[0]);
  7463. console.log(p)
  7464. p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
  7465. mysql.usselect(p, function(ret) {
  7466. if(!ret[0].length){
  7467. let p2 = [d[0], d[1]];
  7468. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardStudentCourseNew');
  7469. mysql.usselect(p2, function(ret) {
  7470. res.end(JSON.stringify(ret));
  7471. let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'3'];
  7472. p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
  7473. mysql.usselect(p3, function(ret) {})
  7474. });
  7475. }else{
  7476. console.log(1);
  7477. res.end(ret[0][0].json);
  7478. }
  7479. // res.end(JSON.stringify(ret));
  7480. });
  7481. });
  7482. //数据看板-学生数据
  7483. router.route("/getDataBoardStudentNew").all((req, res, next) => {
  7484. let p = Object.values(req.body[0]);
  7485. let d = Object.values(req.body[0]);
  7486. console.log(p)
  7487. p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
  7488. mysql.usselect(p, function(ret) {
  7489. if(!ret[0].length){
  7490. let p2 = [d[0], d[1]];
  7491. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardStudentNew');
  7492. mysql.usselect(p2, function(ret) {
  7493. res.end(JSON.stringify(ret));
  7494. let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'5'];
  7495. p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
  7496. mysql.usselect(p3, function(ret) {})
  7497. });
  7498. }else{
  7499. console.log(1);
  7500. res.end(ret[0][0].json);
  7501. }
  7502. // res.end(JSON.stringify(ret));
  7503. });
  7504. });
  7505. //数据看板-教师数据
  7506. router.route("/getDataBoardTeacherNew").all((req, res, next) => {
  7507. let p = Object.values(req.body[0]);
  7508. let d = Object.values(req.body[0]);
  7509. console.log(p)
  7510. p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
  7511. mysql.usselect(p, function(ret) {
  7512. if(!ret[0].length){
  7513. let p2 = [d[0], d[1]];
  7514. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardTeacherNew');
  7515. mysql.usselect(p2, function(ret) {
  7516. res.end(JSON.stringify(ret));
  7517. let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'4'];
  7518. p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
  7519. mysql.usselect(p3, function(ret) {})
  7520. });
  7521. }else{
  7522. console.log(1);
  7523. res.end(ret[0][0].json);
  7524. }
  7525. // res.end(JSON.stringify(ret));
  7526. });
  7527. });
  7528. //数据看板-查询项目数据长度
  7529. router.route("/getCourseLength").all((req, res, next) => {
  7530. postmysql(req, res, "getCourseLength");
  7531. });
  7532. //评测中心-上传评测
  7533. router.route("/addTestWorks").all((req, res, next) => {
  7534. postmysql(req, res, "addTestWorks");
  7535. });
  7536. //评测中心-上传评测
  7537. router.route("/addTestWorks2").all((req, res, next) => {
  7538. postmysql(req, res, "addTestWorks2");
  7539. });
  7540. //评测中心-删除评测
  7541. router.route("/deleteTestCourse").all((req, res, next) => {
  7542. postmysql(req, res, "deleteTestCourse");
  7543. });
  7544. //评测中心-批改
  7545. router.route("/addTestWorksTeacher").all((req, res, next) => {
  7546. postmysql(req, res, "addTestWorksTeacher");
  7547. });
  7548. //评测中心-复制评测
  7549. router.route("/copyTestWorks").all((req, res, next) => {
  7550. postmysql(req, res, "copyTestWorks");
  7551. });
  7552. //评测中心-查询用户测评总览
  7553. router.route("/selectTestUserY").all((req, res, next) => {
  7554. var json = queryString(req.url);
  7555. getmysql(req, res, "selectTestUserY", json["uid"], json["oid"], json["org"]);
  7556. });
  7557. //查询用户学习记录总览
  7558. router.route("/selectSRecordY").all((req, res, next) => {
  7559. var json = queryString(req.url);
  7560. getmysql(req, res, "selectSRecordY", json["uid"], json["oid"], json["org"]);
  7561. });
  7562. //查询幼儿园全部及学校分类
  7563. router.route("/selectSEAllType").all((req, res, next) => {
  7564. var json = queryString(req.url);
  7565. getmysql(req, res, "selectSEAllType", json["oid"]);
  7566. });
  7567. //根据学期查询幼儿园个人评分
  7568. router.route("/selectSETable").all((req, res, next) => {
  7569. var json = queryString(req.url);
  7570. getmysql(req, res, "selectSETable", json["uid"], json["oid"], json["org"], json["cu"]);
  7571. });
  7572. //根据学期保存幼儿园个人评分 修1
  7573. router.route("/addSRScore").get((req, res, next) => {
  7574. var json = queryString(req.url);
  7575. getmysql2(req, res, "addSRScore", json["uid"], json["j"], json["t"]);
  7576. });
  7577. //评测中心-数据 修1 这个不确定所以先加上了
  7578. router.route("/testDataBoard").get((req, res, next) => {
  7579. var json = queryString(req.url);
  7580. getmysql2(req, res, "testDataBoard", json["oid"], json["org"]);
  7581. });
  7582. //评测中心-查询用户数据
  7583. router.route("/selectTestUser").all((req, res, next) => {
  7584. var json = queryString(req.url);
  7585. getmysql(req, res, "selectTestUser", json["uid"]);
  7586. });
  7587. //评测中心-获取评测提交详情
  7588. router.route("/getTestWorks").all((req, res, next) => {
  7589. var json = queryString(req.url);
  7590. getmysql(req, res, "getTestWorks", json["cid"], json["uid"]);
  7591. });
  7592. //评测中心-获取评测提交详情
  7593. router.route("/getTestWorks2").all((req, res, next) => {
  7594. var json = queryString(req.url);
  7595. getmysql(req, res, "getTestWorks2", json["cid"], json["tid"]);
  7596. });
  7597. //评测中心-获取评测提交详情
  7598. router.route("/selectTestCourseWorks").all((req, res, next) => {
  7599. var json = queryString(req.url);
  7600. getmysql(req, res, "selectTestCourseWorks", json["cid"], json["tid"]);
  7601. });
  7602. //评测中心-获取评测提交详情
  7603. router.route("/getTestWorksPage").all((req, res, next) => {
  7604. var json = queryString(req.url);
  7605. getmysql(req, res, "getTestWorksPage", json["cid"], json["page"], json["pageSize"]);
  7606. });
  7607. //评测中心-获取评测提交详情
  7608. router.route("/getTestWorksPage3").all((req, res, next) => {
  7609. var json = queryString(req.url);
  7610. getmysql(req, res, "getTestWorksPage3", json["cid"], json["cn"], json["page"], json["pageSize"]);
  7611. });
  7612. //评测中心-获取评测提交详情
  7613. router.route("/getTestWorksNoPage").all((req, res, next) => {
  7614. var json = queryString(req.url);
  7615. getmysql(req, res, "getTestWorksNoPage", json["cid"], json["cn"]);
  7616. });
  7617. //评测中心-获取评测提交详情 yym
  7618. router.route("/getTestWorksNoPageCopy").all((req, res, next) => {
  7619. var json = queryString(req.url);
  7620. getmysql(req, res, "getTestWorksNoPageCopy", json["cid"], json["cn"], json["tim"], json["tea"]);
  7621. });
  7622. //评测中心-获取评测提交详情
  7623. router.route("/getTestWorksPage2").all((req, res, next) => {
  7624. var json = queryString(req.url);
  7625. getmysql(req, res, "getTestWorksPage2", json["cid"], json["page"], json["pageSize"]);
  7626. });
  7627. //评测中心-个人中心
  7628. router.route("/getTestWorksPerson").all((req, res, next) => {
  7629. var json = queryString(req.url);
  7630. getmysql(req, res, "getTestWorksPerson", json["uid"], json["typeid"]);
  7631. });
  7632. //教师发展-考核-查询是否有提交的的数据
  7633. router.route("/getTestExamineByUserId").all((req, res, next) => {
  7634. var json = queryString(req.url);
  7635. getmysql(req, res, "getTestExamineByUserId", json["uid"], json["type"]);
  7636. });
  7637. //教师发展-考核-查询是否有提交的的数据
  7638. router.route("/addTestExamineWorks").all((req, res, next) => {
  7639. postmysql(req, res, "addTestExamineWorks");
  7640. });
  7641. //教师发展-考核-管理员页面获取所有数据,用于计算平均分等
  7642. router.route("/selectTestExamineAllData").all((req, res, next) => {
  7643. var json = queryString(req.url);
  7644. getmysql(req, res, "selectTestExamineAllData", json["oid"], json["org"], json["type"]);
  7645. // postmysql(req, res, "selectTestExamineAllData");
  7646. });
  7647. //教师发展-考核-管理员页面获取二级指标数据,用于计算平均分等
  7648. router.route("/selectTestExamineSecondData").all((req, res, next) => {
  7649. var json = queryString(req.url);
  7650. getmysql(req, res, "selectTestExamineSecondData", json["oid"], json["org"], json["type"]);
  7651. // postmysql(req, res, "selectTestExamineAllData");
  7652. });
  7653. //查询英语写作评价模板
  7654. router.route("/selectEnglishEva").all((req, res, next) => {
  7655. var json = queryString(req.url);
  7656. getmysql(req, res, "selectEnglishEva", json["oid"]);
  7657. });
  7658. //新增英语写作评价模板
  7659. router.route("/insertEnglishEva").all((req, res, next) => {
  7660. postmysql(req, res, "insertEnglishEva");
  7661. });
  7662. //获取作业数量
  7663. router.route("/getStudentCourseWorkCount").all((req, res, next) => {
  7664. postmysql(req, res, "getStudentCourseWorkCount");
  7665. });
  7666. //获取作业数量
  7667. router.route("/getCourseWorkCount").all((req, res, next) => {
  7668. postmysql(req, res, "getCourseWorkCount");
  7669. });
  7670. //根据id查询英语写作评价模板
  7671. router.route("/selectEnglishEvaById").all((req, res, next) => {
  7672. var json = queryString(req.url);
  7673. getmysql(req, res, "selectEnglishEvaById", json["id"], json["oid"]);
  7674. });
  7675. //根据id删除1英语写作评价模板
  7676. router.route("/deleteEnglishEvaById").all((req, res, next) => {
  7677. var json = queryString(req.url);
  7678. getmysql2(req, res, "deleteEnglishEvaById", json["id"]);
  7679. });
  7680. //获取评价模板
  7681. router.route("/getCourseEvaTemplate").all((req, res, next) => {
  7682. var json = queryString(req.url);
  7683. getmysql(req, res, "getCourseEvaTemplate", json["oid"], json["org"], json["n"]);
  7684. });
  7685. //案例新项目登录接口
  7686. router.route("/loginNewEvenManage").all((req, res, next) => {
  7687. postmysql(req, res, "loginNewEvenManage");
  7688. });
  7689. //案例新项目创建用户接口
  7690. router.route("/addNewRaceUser").all((req, res, next) => {
  7691. postmysql(req, res, "addNewRaceUser");
  7692. });
  7693. //查询老师的信息
  7694. router.route("/getRaceUser1").all((req, res, next) => {
  7695. var json = queryString(req.url);
  7696. getmysql(req, res, "getRaceUser1", json["uid"]);
  7697. });
  7698. //修改用户信息
  7699. router.route("/updateRaceUser1").all((req, res, next) => {
  7700. postmysql(req, res, "updateRaceUser1");
  7701. });
  7702. /* 修改评审员 修1 */
  7703. router.route("/updateReviewer").get((req, res, next) => {
  7704. var json = queryString(req.url);
  7705. getmysql2(
  7706. req,
  7707. res,
  7708. "updateReviewer",
  7709. json["n"],
  7710. json["p"],
  7711. json["t"],
  7712. json["s"],
  7713. json["uid"]
  7714. );
  7715. });
  7716. //race 查询学校
  7717. router.route("/getSchool1").all((req, res, next) => {
  7718. var json = queryString(req.url);
  7719. getmysql(req, res, "getSchool1", json["n"]);
  7720. });
  7721. //查询赛事项目列表
  7722. router.route("/selectRaceList1").all((req, res, next) => {
  7723. var json = queryString(req.url);
  7724. getmysql(req, res, "selectRaceList1", json["uid"], json["t"], json["oid"], json["org"]);
  7725. });
  7726. //修改赛事状态 修1
  7727. router.route("/updateRaceStateGM").get((req, res, next) => {
  7728. var json = queryString(req.url);
  7729. getmysql2(req, res, "updateRaceStateGM", json["id"], json["s"]);
  7730. });
  7731. //删除1案例
  7732. router.route("/deleteAnliGM").all((req, res, next) => {
  7733. var json = queryString(req.url);
  7734. getmysql2(req, res, "deleteAnliGM", json["id"]);
  7735. });
  7736. //新增赛事项目
  7737. router.route("/addRaceGM").all((req, res, next) => {
  7738. if (req.body[0]) {
  7739. p = [
  7740. req.body[0].uid,
  7741. req.body[0].info,
  7742. req.body[0].over,
  7743. req.body[0].pro,
  7744. req.body[0].act,
  7745. req.body[0].exc,
  7746. req.body[0].res,
  7747. ];
  7748. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addRaceGM"); //執行存儲過程
  7749. mysql.usselect(p, function(ret) {
  7750. let course = req.body[0].courseType;
  7751. let courseId = ret[0][0].id;
  7752. let userid = req.body[0].uid;
  7753. delCourseType1(course, courseId, userid);
  7754. res.end(JSON.stringify({ courseId: courseId, success: 1 }));
  7755. });
  7756. }
  7757. });
  7758. //修改赛事项目
  7759. router.route("/updateRaceGM").all((req, res, next) => {
  7760. if (req.body[0]) {
  7761. p = [
  7762. req.body[0].id,
  7763. req.body[0].info,
  7764. req.body[0].over,
  7765. req.body[0].pro,
  7766. req.body[0].act,
  7767. req.body[0].exc,
  7768. req.body[0].res,
  7769. ];
  7770. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateRaceGM"); //執行存儲過程
  7771. mysql.usselect(p, function(ret) {
  7772. let course = req.body[0].courseType;
  7773. let courseId = req.body[0].id;
  7774. let userid = req.body[0].uid;
  7775. delCourseType1(course, courseId, userid);
  7776. res.end(JSON.stringify({ success: 1 }));
  7777. });
  7778. }
  7779. });
  7780. //查询赛事项目详情
  7781. router.route("/selectRaceDetailGM").all((req, res, next) => {
  7782. var json = queryString(req.url);
  7783. getmysql(req, res, "selectRaceDetailGM", json["id"]);
  7784. });
  7785. //查询赛事项目详情
  7786. router.route("/selectRaceDetailGM2").all((req, res, next) => {
  7787. var json = queryString(req.url);
  7788. getmysql(req, res, "selectRaceDetailGM2", json["id"]);
  7789. });
  7790. //查询赛事分类及子分类
  7791. router.route("/selectMatTypeGM").all((req, res, next) => {
  7792. var json = queryString(req.url);
  7793. getmysql(req, res, "selectMatTypeGM");
  7794. });
  7795. //添加资源库分类
  7796. router.route("/addSourceFileType").all((req, res, next) => {
  7797. postmysql(req, res, "addSourceFileType");
  7798. });
  7799. //查询资源库分类
  7800. router.route("/getSourceFileType").all((req, res, next) => {
  7801. var json = queryString(req.url);
  7802. getmysql(req, res, "getSourceFileType", json["uid"]);
  7803. });
  7804. //删除资源库分类
  7805. router.route("/deleteSoureFileType").all((req, res, next) => {
  7806. postmysql(req, res, "deleteSoureFileType");
  7807. });
  7808. //修改资源库分类名字
  7809. router.route("/updateSourceFileName").all((req, res, next) => {
  7810. postmysql(req, res, "updateSourceFileName");
  7811. });
  7812. //修改资源库分类父级
  7813. router.route("/updateSourceFileTypePid").all((req, res, next) => {
  7814. postmysql(req, res, "updateSourceFileTypePid");
  7815. });
  7816. //添加资源库
  7817. router.route("/addSourceFile").all((req, res, next) => {
  7818. postmysql(req, res, "addSourceFile");
  7819. });
  7820. //查询资源库上传文件
  7821. router.route("/getSourceFile").all((req, res, next) => {
  7822. var json = queryString(req.url);
  7823. getmysql(req, res, "getSourceFile", json["uid"], json["pid"], json["n"]);
  7824. });
  7825. //删除资源库
  7826. router.route("/deleteSourceFile").all((req, res, next) => {
  7827. postmysql(req, res, "deleteSourceFile");
  7828. });
  7829. //移动资源库
  7830. router.route("/updateSourceFilePid").all((req, res, next) => {
  7831. postmysql(req, res, "updateSourceFilePid");
  7832. });
  7833. //查询资源库上传文件
  7834. router.route("/getCourseInfoTest").all((req, res, next) => {
  7835. var json = queryString(req.url);
  7836. getmysql(req, res, "getCourseInfoTest", json["cid"]);
  7837. });
  7838. //查看已经的作业
  7839. router.route("/selectTestWorksCid").all((req, res, next) => {
  7840. var json = queryString(req.url);
  7841. getmysql(req, res, "selectTestWorksCid", json["cid"], json["uid"]);
  7842. });
  7843. //查询资源库上传文件
  7844. router.route("/getCourseInfoTestAll").all((req, res, next) => {
  7845. var json = queryString(req.url);
  7846. getmysql(req, res, "getCourseInfoTestAll", json["cid"]);
  7847. });
  7848. //查询资源库上传文件
  7849. router.route("/getCourseInfoTestAll2").all((req, res, next) => {
  7850. postmysql(req, res, "getCourseInfoTestAll");
  7851. });
  7852. //还原课程功能
  7853. router.route("/revertCourse").all((req, res, next) => {
  7854. postmysql(req, res, "revertCourse");
  7855. });
  7856. //还原课程功能
  7857. router.route("/revertCourseSz").all((req, res, next) => {
  7858. postmysql2(req, res, "revertCourse");
  7859. });
  7860. //根据课程id查询关联的表单
  7861. router.route("/selectTestCourseByCid").all((req, res, next) => {
  7862. var json = queryString(req.url);
  7863. getmysql(req, res, "selectTestCourseByCid", json["cid"]);
  7864. });
  7865. //qgt 根据用户id和文件标题获取答案来自动填写
  7866. router.route("/selectTestCourseAutoFillType3").all((req,res,next)=>{
  7867. var json = queryString(req.url);
  7868. getmysql(req, res, "selectTestCourseAutoFillType3", json["uid"],json["tit"]);
  7869. });
  7870. //qgt 课堂观察另存为模板
  7871. router.route("/insertClassroomTemplate").all((req,res,next)=>{
  7872. postmysql(req, res, "insertClassroomTemplate");
  7873. })
  7874. //qgt 课堂观察获取模板
  7875. router.route("/selectClassroomTemplate").all((req,res,next)=>{
  7876. var json = queryString(req.url);
  7877. getmysql(req, res, "selectClassroomTemplate", json["uid"],json["txt"],json["sub"],json["type1"]);
  7878. })
  7879. //qgt 课堂观察修改收藏模板
  7880. router.route("/updateClassroomTemplateCollect").all((req,res,next)=>{
  7881. postmysql(req, res, "updateClassroomTemplateCollect");
  7882. })
  7883. //qgt 课堂观察获取模板详细
  7884. router.route("/selectClassroomTemplateDetail").all((req,res,next)=>{
  7885. var json = queryString(req.url);
  7886. getmysql(req, res, "selectClassroomTemplateDetail", json["uid"],json["cid"],json['st']);
  7887. })
  7888. //qgt 课堂观察修改模板
  7889. router.route("/updateClassroomTemplateData").all((req,res,next)=>{
  7890. postmysql(req, res, "updateClassroomTemplateData");
  7891. })
  7892. //qgt设置用户默认模板
  7893. router.route("/updateClassroomDefault").all((req,res,next)=>{
  7894. postmysql(req, res, "updateClassroomDefault");
  7895. })
  7896. //qgt 获取用户默认模板
  7897. router.route("/selectClassroomDefault").all((req,res,next)=>{
  7898. var json = queryString(req.url);
  7899. getmysql(req, res, "selectClassroomDefault", json["uid"]);
  7900. })
  7901. //qgt 保存课堂助手任务面板题目
  7902. router.route("/updateCourseWorks_classRoomHelper").all((req,res,next)=>{
  7903. postmysql(req, res, "updateCourseWorks_classRoomHelper");
  7904. })
  7905. //qgt 获取课堂助手任务面板题目
  7906. router.route("/select_courseWorks_classRoomHelper").all((req,res,next)=>{
  7907. var json = queryString(req.url);
  7908. getmysql(req, res, "select_courseWorks_classRoomHelper", json["uid"],json["cid"]);
  7909. })
  7910. //qgt 获取课堂助手中当前课程所有做了选择题的数据
  7911. router.route("/select_courseWorksAll_classRoomHelper").all((req,res,next)=>{
  7912. var json = queryString(req.url);
  7913. getmysql(req, res, "select_courseWorksAll_classRoomHelper", json["uid"],json["cid"]);
  7914. })
  7915. //qgt 课堂助手倒计时面板插入数据
  7916. router.route("/insert_systemOperation_classRoomHelper").all((req,res,next)=>{
  7917. postmysql(req, res, "insert_systemOperation_classRoomHelper");
  7918. })
  7919. //qgt 课堂助手行为备忘(添加)
  7920. router.route("/insert_systemOperation_countdownBehavior").all((req,res,next)=>{
  7921. postmysql(req,res,'insert_systemOperation_countdownBehavior')
  7922. })
  7923. //lsc 课程管理行为备忘(添加)
  7924. router.route("/addCourseBehavior").all((req,res,next)=>{
  7925. postmysql(req,res,'addCourseBehavior')
  7926. })
  7927. //qgt 课堂助手行为备忘(获取)
  7928. router.route("/select_systemOperation_countdownBehavior").all((req,res,next)=>{
  7929. var json = queryString(req.url);
  7930. getmysql(req, res, "select_systemOperation_countdownBehavior", json["uid"],json["courseId"]);
  7931. })
  7932. //qgt 课堂观察新建模板分析
  7933. router.route("/insert_smodel").all((req,res,next)=>{
  7934. postmysql(req,res,'insert_smodel')
  7935. })
  7936. //qgt 课堂观察获取用户的模板分析
  7937. router.route('/select_smodel').all((req,res,next)=>{
  7938. var json = queryString(req.url);
  7939. getmysql(req, res, "select_smodel", json["uid"]);
  7940. })
  7941. //qgt 课堂观察获取指定的分析
  7942. router.route('/select_smodelById').all((req,res,next)=>{
  7943. var json = queryString(req.url);
  7944. getmysql(req, res, "select_smodelById", json["uid"],json["mid"]);
  7945. })
  7946. //qgt 课堂观察删除指定模块
  7947. router.route("/delete_smodelById").all((req,res,next)=>{
  7948. postmysql(req,res,'delete_smodelById')
  7949. })
  7950. //qgt 课堂观察修改指定模块
  7951. router.route("/update_smodel").all((req,res,next)=>{
  7952. postmysql(req,res,'update_smodel')
  7953. })
  7954. //qgt 教师画像面板获取数据
  7955. router.route('/selectPortraitData').all((req,res,next)=>{
  7956. var json = queryString(req.url);
  7957. getmysql(req, res, "selectPortraitData", json["uid"]);
  7958. })
  7959. //qgt 修改testCourse的Cover字段
  7960. router.route('/update_testCourseCoverById').all((req,res,next)=>{
  7961. postmysql(req,res,'update_testCourseCoverById')
  7962. })
  7963. //qgt 修改课程的分屏数据
  7964. router.route('/update_courseSplitScreenData').all((req,res,next)=>{
  7965. postmysql(req,res,'update_courseSplitScreenData')
  7966. })
  7967. //qgt 获取课程的分屏数据
  7968. router.route('/select_courseSplitScreenData').all((req,res,next)=>{
  7969. var json = queryString(req.url);
  7970. getmysql(req, res, "select_courseSplitScreenData", json["cid"]);
  7971. })
  7972. //qgt 应用管理-获取类型
  7973. router.route('/select_appStoreType').all((req,res,next)=>{
  7974. var json = queryString(req.url);
  7975. getmysql(req, res, "select_appStoreType", json["suserid"],json["sorg"],json["soid"],json["sstand"]);
  7976. })
  7977. //qgt 应用管理-添加应用
  7978. router.route('/insert_appStore').all((req,res,next)=>{
  7979. postmysql(req, res, "insert_appStore");
  7980. })
  7981. //qgt 应用管理-获取应用
  7982. router.route('/select_appStore').all((req,res,next)=>{
  7983. var json = queryString(req.url);
  7984. getmysql(req, res, "select_appStore", json["uid"],json["name"],json["label"],json["type"],json["juri"],json["stand"]);
  7985. })
  7986. //qgt 应用管理-修改应用
  7987. router.route('/update_appStore').all((req,res,next)=>{
  7988. postmysql(req, res, "update_appStore");
  7989. })
  7990. //教师管理 查看填写范围的教师权限
  7991. router.route("/getTestWorkTeacherCount").all((req,res,next)=>{
  7992. postmysql(req, res, "getTestWorkTeacherCount");
  7993. })
  7994. //查询教师权限
  7995. router.route('/getTypeTeacher').all((req,res,next)=>{
  7996. var json = queryString(req.url);
  7997. getmysql(req, res, "getTypeTeacher", json["cid"], json["name"], json["userid"]);
  7998. })
  7999. //删除会话记录
  8000. router.route("/deleteChat").all((req,res,next)=>{
  8001. postmysql(req, res, "deleteChat"); // id 会话id
  8002. })
  8003. //添加会话记录
  8004. router.route("/addChat").all((req,res,next)=>{
  8005. postmysql(req, res, "addChat"); // uid 用户id n 会话名称 cid chatid
  8006. })
  8007. //修改会话记录 重命名
  8008. router.route("/updateChat").all((req,res,next)=>{
  8009. postmysql(req, res, "updateChat"); // id 会话id n 会话名称
  8010. })
  8011. //获取会话记录
  8012. router.route('/getChatHistory').all((req,res,next)=>{
  8013. var json = queryString(req.url);
  8014. getmysql(req, res, "getChatHistory", json["uid"], json["n"], json["page"], json["num"]); //用户id,会话名称,页码,页数
  8015. })
  8016. function generateAPIKey(username) {
  8017. let timeStamp = new Date().getTime();
  8018. let hashStr = timeStamp + username;
  8019. let digest = crypto
  8020. .createHash("sha256")
  8021. .update(hashStr, "utf8")
  8022. .digest("hex");
  8023. return digest;
  8024. }
  8025. queryString = function(url) {
  8026. var a = url.split("?");
  8027. var json = querystring.parse(a[1]);
  8028. return json;
  8029. };
  8030. //post存儲過程處理
  8031. postmysql = function(req, res, functionname) {
  8032. //mode的處理
  8033. if (req.body[0]) {
  8034. p = Object.values(req.body[0]);
  8035. p.unshift(_mysqlLabor[0], _mysqlLabor[1], functionname);
  8036. //執行存儲過程
  8037. mysql.usselect(p, function(ret) {
  8038. res.end(JSON.stringify(ret));
  8039. });
  8040. }
  8041. };
  8042. //post存儲過程處理
  8043. postmysql2 = function(req, res, functionname) {
  8044. //mode的處理
  8045. if (req.body) {
  8046. p = Object.values(req.body)[0].split(",");
  8047. p.unshift(_mysqlLabor[0], _mysqlLabor[1], functionname);
  8048. //執行存儲過程
  8049. mysql.usselect(p, function(ret) {
  8050. res.end(JSON.stringify(ret));
  8051. });
  8052. }
  8053. };
  8054. //post存儲過程處理
  8055. postmysql3 = function(req, res, functionname) {
  8056. //mode的處理
  8057. if (req.body) {
  8058. p = Object.values(req.body);
  8059. p.unshift(_mysqlLabor[0], _mysqlLabor[1], functionname);
  8060. //執行存儲過程
  8061. mysql.usselect(p, function(ret) {
  8062. res.end(JSON.stringify(ret));
  8063. });
  8064. }
  8065. };
  8066. //get獲取數據庫信息
  8067. getmysql = function(req, res, functionname, ...p) {
  8068. p = p || [];
  8069. p.unshift(_getmysqlLabor[0], _getmysqlLabor[1], functionname);
  8070. //執行存儲過程
  8071. mysql.usselect(p, function(ret) {
  8072. res.end(JSON.stringify(ret));
  8073. }); //
  8074. };
  8075. //get獲取數據庫信息
  8076. getmysql2 = function(req, res, functionname, ...p) {
  8077. p = p || [];
  8078. p.unshift(_mysqlLabor[0], _mysqlLabor[1], functionname);
  8079. //執行存儲過程
  8080. mysql.usselect(p, function(ret) {
  8081. res.end(JSON.stringify(ret));
  8082. }); //
  8083. };
  8084. //get獲取數據庫信息
  8085. getmysql3 = function(req, res, functionname, ...p) {
  8086. p = p || [];
  8087. p.unshift(_getmysqlLabor2[0], _getmysqlLabor2[1], functionname);
  8088. //執行存儲過程
  8089. mysql.usselect(p, function(ret) {
  8090. res.end(JSON.stringify(ret));
  8091. }); //
  8092. };
  8093. //post存储过程处理
  8094. userpostmysql = function(req, res, functionname) {
  8095. //mode的处理
  8096. if (req.body.mode) {
  8097. p = req.body.mode.split(",");
  8098. p.unshift(_mysqluser[0], _mysqluser[1], functionname);
  8099. //执行存储过程
  8100. mysql.usselect(p, function(ret) {
  8101. res.end(JSON.stringify(ret));
  8102. });
  8103. }
  8104. };
  8105. //get获取数据库信息
  8106. usergetmysql = function(req, res, functionname, ...p) {
  8107. p = p || [];
  8108. p.unshift(_mysqluser[0], _mysqluser[1], functionname);
  8109. //执行存储过程
  8110. mysql.usselect(p, function(ret) {
  8111. res.end(JSON.stringify(ret));
  8112. }); //
  8113. };
  8114. module.exports = router;