123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233 |
- // ROUTES FOR OUR APIselectClassStudent
- // =============================================================================
- var express = require("express");
- var request = require("request");
- var bcrypt = require("bcryptjs");
- var router = express.Router(); // get an instance of the express Router
- const querystring = require("querystring");
- var mysql = require("./mysql");
- // const _mysqlLabor = ["123.58.32.151", "pbl"]; //edu數據庫信息
- // const _mysqluser = ["123.58.32.151", "cocorobouser"]; //用户数据库信息
- // const _getmysqlLabor = ["123.58.32.152", "pbl"]; //edu數據庫信息
- // const _getmysqluser = ["123.58.32.152", "cocorobouser"]; //edu數據庫信息
- const _mysqlLabor = ["172.16.12.5", "pbl"]; //edu數據庫信息
- const _mysqluser = ["172.16.12.5", "cocorobouser"]; //edu數據庫信息
- const _getmysqlLabor = ["172.16.12.5", "pbl"]; //edu數據庫信息
- const _getmysqluser = ["172.16.12.5", "cocorobouser"]; //edu數據庫信息
- // const _getmysqlLabor = ["172.16.12.7", "pbl"]; //edu數據庫信息
- // const _getmysqluser = ["172.16.12.7", "cocorobouser"]; //edu數據庫信息
- var crypto = require("crypto");
- var https = require("https");
- //統壹處理區域
- router.use(async function(req, res, next) {
- await asynnext(req, res, next);
- //// make sure we go to the next routes and don't stop here
- //res.end("");
- });
- /**
- * @des 參數解釋同上
- */
- function asynnext(req, res, next) {
- //異步處理
- return new Promise(async(resolve, reject) => {
- next();
- //resolve(true);aa
- });
- }
- /*測試*/
- router.route("/a").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "a", json["ph"], json["pa"]);
- });
- router.route("/b").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "b", json["ph"], json["pa"]);
- });
- /* 注册接口 */
- router.route("/register").post(function(req, res, next) {
- //mode的处理
- if (req.body[0]) {
- // 0 用户名 1 用户密码 2用户身份 3 第三方id(可有可无)
- p = Object.values(req.body[0]); //获取用户密码
- //没有第三方id的处理
- // if (p.length < 4) {
- // p.push("")
- // }
- p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
- //密码加密
- // bcrypt.hash(p[1], 10, function (err, hash) {
- // if (err) {
- // return next(err);
- // }
- // p[1] = hash;
- // });
- //参数拼接,注册
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "register");
- //返回注册用户数据
- // mysql.usselect(p, function (ret) {
- // res.end(ret);
- // });
- mysql.usselect(p, function(ret) {
- res.end(JSON.stringify(ret));
- });
- }
- });
- /*登录接口*/
- router.route("/login").all((req, res, next) => {
- //mode的处理
- if (req.body[0]) {
- // 0 用户名 1 用户密码
- c = Object.values(req.body[0]); //获取用户密码
- p = [c[0]];
- // p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
- var _password = [c[0]];
- _password.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectPassword");
- mysql.usselect(_password, function(ret) {
- var _ret = ret;
- var paJ = _ret[0][0].userpassword;
- bcrypt.compare(c[1], paJ, function(err, result) {
- // console.log(result)
- if (result) {
- //参数拼接,登录
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectLogin");
- //执行存储过程
- mysql.usselect(p, function(ret) {
- res.end(JSON.stringify({ status: "1", ...ret }));
- });
- } else {
- res.end(JSON.stringify([{ status: "0" }]));
- }
- });
- });
- // console.log(isEqual)
- }
- });
- /*手机登录接口*/
- router.route("/phoneLogin").all((req, res, next) => {
- //mode的处理
- if (req.body[0]) {
- // 0 用户名 1 用户密码
- c = Object.values(req.body[0]); //获取用户密码
- p = [c[0]];
- // p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
- var _password = [c[0]];
- _password.unshift(_mysqluser[0], _mysqluser[1], "selectPassword");
- mysql.usselect(_password, function(ret) {
- if (ret[0].length) {
- var _ret = ret;
- var paJ = _ret[0][0].password;
- let uid = _ret[0][0].userid;
- let duid = [uid];
- bcrypt.compare(c[1], paJ, function(err, result) {
- // console.log(result)
- if (result) {
- //参数拼接,登录
- duid.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
- //执行存储过程
- mysql.usselect(duid, function(ret) {
- res.end(JSON.stringify({ status: "1", ...ret }));
- });
- } else {
- res.end(JSON.stringify([{ status: "0" }]));
- }
- });
- } else {
- res.end(JSON.stringify([{ status: "0" }]));
- }
- });
- // console.log(isEqual)
- }
- });
- // 图片转base64
- router.route("/imgToBase64").all((req, res, next) => {
- var json = queryString(req.url);
- //mode的处理
- https.get(json["img"], function(res2) {
- var chunks = [];
- var size = 0;
- res2.on("data", function(chunk) {
- chunks.push(chunk);
- size += chunk.length; //累加缓冲数据的长度
- });
- res2.on("end", function(err) {
- var data = Buffer.concat(chunks, size);
- var base64Img = data.toString("base64");
- res.end(JSON.stringify([{ img: `data:image/png;base64,${base64Img}` }]));
- });
- });
- });
- router.route("/download").all(async(req, res, next) => {
- var json = queryString(req.url);
- // 查询文件名和下载链接
- const fileName = json["name"];
- const link = json["url"];
- // 发送下载请求
- request.get(link, (err, response) => {
- if (err) {
- res.status(500).end("Internal Server Error");
- return;
- }
- https.get(link, function(res2) {
- var chunks = [];
- var size = 0;
- res2.on("data", function(chunk) {
- chunks.push(chunk);
- size += chunk.length; //累加缓冲数据的长度
- });
- res2.on("end", function(err) {
- var data = Buffer.concat(chunks, size);
- var base64Img = data.toString("base64");
- res.end(JSON.stringify({ response, data }));
- });
- });
- });
- });
- /*登录接口*/
- router.route("/loginRace").all((req, res, next) => {
- //mode的处理
- if (req.body[0]) {
- // 0 用户名 1 用户密码
- c = Object.values(req.body[0]); //获取用户密码
- p = [c[0]];
- // p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
- var _password = [c[0]];
- _password.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectPasswordRace");
- mysql.usselect(_password, function(ret) {
- var _ret = ret;
- var paJ = _ret[0][0].password;
- bcrypt.compare(c[1], paJ, function(err, result) {
- // console.log(result)
- if (result) {
- //参数拼接,登录
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectLoginRace");
- //执行存储过程
- mysql.usselect(p, function(ret) {
- res.end(JSON.stringify({ status: "1", ...ret }));
- });
- } else {
- res.end(JSON.stringify([{ status: "0" }]));
- }
- });
- });
- // console.log(isEqual)
- }
- });
- /* 修改密码接口 */
- router.route("/updatePassword").post(function(req, res, next) {
- //mode的处理
- if (req.body[0]) {
- let p = [req.body[0].userid];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "getPassword"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- var paJ = ret[0][0].password;
- var op = bcrypt.hashSync(req.body[0].opassword, bcrypt.genSaltSync(10));
- bcrypt.compare(req.body[0].opassword, paJ, function(err, result) {
- // console.log(result)
- if (result) {
- let p2 = [
- req.body[0].userid,
- bcrypt.hashSync(req.body[0].password, bcrypt.genSaltSync(10)),
- ];
- p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updatePassword"); //執行存儲過程
- mysql.usselect(p2, function(ret) {
- res.end(JSON.stringify([{ success: 1 }]));
- });
- } else {
- res.end(JSON.stringify([{ success: 0 }]));
- }
- });
- });
- }
- });
- /* 赛事修改密码 */
- router.route("/updatePassword1").post(function(req, res, next) {
- //mode的处理
- if (req.body[0]) {
- let p = [req.body[0].userid];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "getPassword1"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- var paJ = ret[0][0].password;
- var op = bcrypt.hashSync(req.body[0].opassword, bcrypt.genSaltSync(10));
- bcrypt.compare(req.body[0].opassword, paJ, function(err, result) {
- // console.log(result)
- if (result) {
- let p2 = [
- req.body[0].userid,
- bcrypt.hashSync(req.body[0].password, bcrypt.genSaltSync(10)),
- ];
- p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updatePassword1"); //執行存儲過程
- mysql.usselect(p2, function(ret) {
- res.end(JSON.stringify([{ success: 1 }]));
- });
- } else {
- res.end(JSON.stringify([{ success: 0 }]));
- }
- });
- });
- }
- });
- /* 找寻重复手机号 */
- router.route("/findPhone").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "findPhone", json["un"]);
- });
- /* 找寻是否有此账号 */
- router.route("/findUsername").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "findUsername", json["un"]);
- });
- /* 找寻重复邮箱 */
- router.route("/findMail").all((req, res, next) => {
- var json = queryString(req.url);
- usergetmysql(req, res, "findMail", json["un"]);
- });
- /* 找寻重复学号 */
- router.route("/findSid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "findSid", json["un"]);
- });
- /* 新增班级 修1 */
- router.route("/insertClass").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "insertClass", json["name"], json["oid"], json["uid"]);
- });
- /* 新增教研室 修1 */
- router.route("/insertTeacherOffice").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "insertTeacherOffice", json["name"], json["oid"], json["uid"]);
- });
- /* 新增年级 修1 */
- router.route("/insertGrade").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "insertGrade", json["name"], json["oid"], json["uid"]);
- });
- /* 修改班级 修1 */
- router.route("/updateClass").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "updateClass", json["id"], json["n"], json["oid"]);
- });
- // 修改教研室 修1
- router.route("/updateTeacherOffice").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "updateTeacherOffice", json["id"], json["n"], json["oid"]);
- });
- /* 修改年级 修1 */
- router.route("/updateGrade").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "updateGrade", json["id"], json["n"], json["oid"]);
- });
- /* 查询班级 */
- router.route("/selectClass").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectClass", json["cu"], json["oid"], json["cn"], json["page"], 10);
- });
- // 教研室查询
- router.route("/selectTeacherOffice").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectTeacherOffice", json["cu"], json["oid"], json["cn"], json["page"], 10);
- });
- /* 查询班级 */
- router.route("/selectClass2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectClass2", json["cid"], json["oid"], json["cn"], json["page"], 10);
- });
- /* 查询年级 */
- router.route("/selectGrade").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectGrade", json["cu"], json["oid"], json["cn"], json["page"], 10);
- });
- /* 删除1班级 */
- router.route("/deleteClass").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteClass", json["id"]);
- });
- /* 删除1年级 */
- router.route("/deleteGrade").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteGrade", json["id"]);
- });
- /* 查询学校 */
- router.route("/selectOrg").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectOrg");
- });
- /* 查询组织 */
- router.route("/selectorg2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectorg2");
- });
- /* 修改学校名称 修1 */
- router.route("/updateSN").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "updateSchoolName", json["oid"], json["n"]);
- });
- /* 教师端修改学校名称 修1 */
- router.route("/updateSchoolByOrg").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "updateSchoolByOrg", json["n"], json["d"], json["id"]);
- });
- /* 教师端查询未联结学校 */
- router.route("/selectNoCSchool").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectNoCSchool");
- });
- /* 教师端新增或修改联结学校 修1 */
- router.route("/addNoSchool").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "addNoSchool", json["id"], json["coid"]);
- });
- /* 新增学生 修1 */
- router.route("/insertStudent").all((req, res, next) => {
- var json = queryString(req.url);
- json["userpassword"] = bcrypt.hashSync(
- json["userpassword"],
- bcrypt.genSaltSync(10)
- );
- getmysql(
- req,
- res,
- "insertStudent",
- json["ph"],
- json["username"],
- json["userpassword"],
- json["type"],
- json["oid"],
- json["tid"],
- json["cid"]
- );
- });
- // /* 新增学生 */
- // router.route('/iStudent').all((req, res, next) => {
- // var json = queryString(req.url);
- // json['userpassword'] = bcrypt.hashSync(json['userpassword'], bcrypt.genSaltSync(10))
- // getmysql(req, res, "insertStudent", json['ph'], json['username'], json['userpassword'], json['type'], json['oid'], json['tid'], json['cid']);
- // });
- /* 查询学生 */
- router.route("/selectStudent").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectStudent",
- json["oid"],
- json["cu"],
- json["cn"],
- json["page"],
- 10
- );
- });
- /* ppt根据学校查询学生 */
- router.route("/selectStudentByScoolPPt").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectStudentByScoolPPt", json["oid"], json["cid"]);
- });
- /* 查询学校底下的所有学生 */
- router.route("/selectOrgStu").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectOrgStu", json["oid"]);
- });
- /* 查询学生 */
- router.route("/selectStudentAdd").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectStudentAdd", json["oid"], json["cu"], json["cn"]);
- });
- /* 查询老师 */
- router.route("/selectTeacherAdd").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectTeacherAdd", json["oid"], json["cu"], json["cn"]);
- });
- /* 查询老师 */
- router.route("/selectTeacherAddOrg").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectTeacherAddOrg",
- json["oid"],
- json["cu"],
- json["cn"]
- );
- });
- /* 查询学生 */
- router.route("/selectStudentAddOrg").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectStudentAddOrg",
- json["oid"],
- json["cu"],
- json["cn"]
- );
- });
- /* 查询全部用户 */
- router.route("/selectUserAddOrg").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectUserAddOrg", json["oid"], json["cu"], json["cn"]);
- });
- /* 查询全部用户 */
- router.route("/selectUserAdd").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectUserAdd", json["oid"], json["cu"], json["cn"]);
- });
- /* 查询全部用户 */
- router.route("/selectUserByOidS").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectUserByOidS",
- json["oid"],
- json["org"],
- json["cu"],
- json["cn"]
- );
- });
- /* 查询全部用户 */
- router.route("/selectUserByOidS2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectUserByOidS2",
- json["oid"],
- json["org"],
- json["cu"],
- json["cn"],
- json["page"],
- json["pageSize"]
- );
- });
- /* 查询全部用户 */
- router.route("/selectUserByOidS2Studio").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectUserByOidS2Studio",
- json["oid"],
- json["org"],
- json["cu"],
- json["cn"],
- json["page"],
- json["pageSize"]
- );
- });
- /* 查询班级是否有重复 */
- router.route("/selectC").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectC", json["className"]);
- });
- /* 查询学校是否有重复 */
- router.route("/selectS").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectS", json["schoolName"]);
- });
- /* 修改个人信息 */
- router.route("/updateUser").all((req, res, next) => {
- postmysql(req, res, "updateUser");
- });
- //查询老师的信息
- router.route("/getUser").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectUserDeail", json["uid"]);
- });
- //查询老师的信息
- router.route("/getRaceUser").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getRaceUser", json["uid"]);
- });
- router.route("/selectUser").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectUser", json["userid"]);
- });
- //查询教师端消息
- router.route("/getNewsTeacher").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectNew", json["uid"], json["page"], 10);
- });
- //查询教师端消息
- router.route("/selectNotice").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectNotice",
- json["uid"],
- json["oid"],
- json["org"],
- json["page"],
- 10
- );
- });
- //查询教师端消息
- router.route("/selectNotice2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectNotice2", json["uid"], json["oid"], json["org"]);
- });
- //查询教师端消息
- router.route("/addNotice").all((req, res, next) => {
- postmysql(req, res, "addNotice");
- });
- //查询教师端消息
- router.route("/deleteNotice").all((req, res, next) => {
- postmysql(req, res, "deleteNotice");
- });
- //查询通知详情
- router.route("/selectNewDetail").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectNewDetail", json["nid"]);
- });
- //查出分组分类
- router.route("/getGroup").all((req, res, next) => {
- getmysql(req, res, "selectGroupTeacher");
- });
- //查询这个老师底下的学生提交的作业
- router.route("/getWorks").all((req, res, next) => {
- //已经不用
- var json = queryString(req.url);
- getmysql(req, res, "selectWorks", json["cn"], json["cid"], json["page"], 10);
- });
- //查询项目
- router.route("/getProject").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectProject",
- json["type"],
- json["uid"],
- json["oid"],
- json["cn"],
- json["page"],
- 10
- );
- });
- //新评价查询项目
- router.route("/getProject1").all((req, res, next) => {
- //已经不用
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectProject1",
- json["uid"],
- json["cid"],
- json["eid"],
- json["cn"],
- json["page"],
- 10
- );
- });
- //查询项目
- router.route("/getMyProject").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectMyProject", json["uid"], json["page"], 10);
- });
- //查询项目成员
- router.route("/selectProjectStudent").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_student", json["cn"], json["oid"], json["uid"]);
- });
- //查询Banner列表
- router.route("/selectBannerList").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectBannerList", json["page"], 10);
- });
- //查询Banner列表
- router.route("/selectAllBanner").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectAllBanner", json["t"]);
- });
- //新增Banner
- router.route("/insertBannerList").all((req, res, next) => {
- postmysql(req, res, "insertBannerList");
- });
- //删除提交的作业
- router.route("/deleteCourseWork").all((req, res, next) => {
- postmysql(req, res, "deleteCourseWork");
- });
- //删除提交的作业
- router.route("/deleteCourseWorkS").all((req, res, next) => {
- postmysql(req, res, "deleteCourseWorkS");
- });
- //删除1Banner
- router.route("/deleteBannerList").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteBannerList", json["id"]);
- });
- //新增课程
- router.route("/addWork").all((req, res, next) => {
- postmysql(req, res, "insert_teacher_work");
- });
- //点赞评论
- router.route("/insertComment").all((req, res, next) => {
- postmysql(req, res, "insertComment");
- });
- //点赞评论
- router.route("/getComment").all((req, res, next) => {
- postmysql(req, res, "getComment");
- });
- //取消点赞
- router.route("/deleteComment").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "deleteComment", json["wid"], json["lid"]);
- });
- //删除1评论
- router.route("/deleteComment2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteComment2", json["id"]);
- });
- //上传批注图片
- router.route("/updateCourseWorks").all((req, res, next) => {
- postmysql(req, res, "updateCourseWorks");
- });
- //上传文件
- router.route("/addCourseWorks").all((req, res, next) => {
- postmysql(req, res, "addCourseWorks");
- });
- //上传文件
- router.route("/addCourseWorksS").all((req, res, next) => {
- postmysql(req, res, "addCourseWorksS");
- });
- //上传文件
- router.route("/addCourseWorksS2").all((req, res, next) => {
- postmysql(req, res, "addCourseWorksS2");
- });
- //修改作业名字
- router.route("/updateSCourseName").all((req, res, next) => {
- postmysql(req, res, "updateSCourseName");
- });
- //可上传多个文件
- router.route("/addCourseWorksR").all((req, res, next) => {
- postmysql(req, res, "addCourseWorksR");
- });
- //上传文件
- router.route("/addCourseWorksTeacher").all((req, res, next) => {
- postmysql(req, res, "addCourseWorksTeacher");
- });
- //上传文件
- router.route("/addCourseWorks2").all((req, res, next) => {
- var json = queryString(req.url);
- postmysql(
- req,
- res,
- "addCourseWorks",
- json["uid"],
- json["cid"],
- json["stage"],
- json["task"],
- json["tool"],
- json["content"],
- json["type"]
- );
- });
- //上传文件 修1
- router.route("/addCourseWorks3").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "addCourseWorks2",
- json["uid"],
- json["cid"],
- json["stage"],
- json["task"],
- json["tool"],
- json["content"],
- json["type"],
- json["atool"]
- );
- });
- //上传文件
- router.route("/addCourseWorks3-2").all((req, res, next) => {
- var json = queryString(req.url);
- postmysql(req, res, "addCourseWorks2");
- });
- //上传文件
- router.route("/addCourseWorks2Inter").all((req, res, next) => {
- var json = queryString(req.url);
- postmysql(req, res, "addCourseWorks2Inter");
- });
- //上传文件
- router.route("/addCourseWorks4").all((req, res, next) => {
- postmysql3(req, res, "addCourseWorks3");
- });
- //上传文件
- router.route("/addCourseWorks4-u").all((req, res, next) => {
- postmysql2(req, res, "addCourseWorks3");
- });
- //上传文件
- router.route("/addCourseWorks4E").all((req, res, next) => {
- postmysql3(req, res, "addCourseWorks3E");
- });
- //上传文件
- router.route("/addCourseWorks4s").all((req, res, next) => {
- postmysql3(req, res, "addCourseWorks4s");
- });
- //上传文件
- router.route("/addCourseWorks4s2").all((req, res, next) => {
- postmysql3(req, res, "addCourseWorks4s2");
- });
- //上传文件
- router.route("/addCourseWorks5").all((req, res, next) => {
- postmysql(req, res, "addCourseWorks3");
- });
- //上传批量文件
- router.route("/addCourseWorksPl").all((req, res, next) => {
- if (req.body[0]) {
- var p = Object.values(req.body[0]);
- let ateacher = p[0];
- let cid = p[1];
- let stage = p[2];
- let task = p[3];
- let tool = p[4];
- let files = JSON.parse(decodeURIComponent(p[5]));
- for (let i = 0; i < files.length; i++) {
- var k = [
- encodeURIComponent(files[i].username),
- cid,
- stage,
- task,
- tool,
- encodeURIComponent(files[i].url),
- encodeURIComponent(files[i].fileType),
- ateacher,
- "50",
- ];
- k.unshift(_mysqlLabor[0], _mysqlLabor[1], "addCourseWorksPl");
- //執行存儲過程
- mysql.usselect(k, function(ret) {
- if (i == files.length - 1) {
- res.end(JSON.stringify(ret));
- }
- });
- }
- }
- });
- //修改课程权限(学生是否能查看所有作业) 修1
- router.route("/updateCourseSLook").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "updateCourseSLook", json["sopen"], json["cid"]);
- });
- //修改课程权限(学生是否能查看所有作业) 修1
- router.route("/updateTrainCourseSLook").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "updateTrainCourseSLook", json["sopen"], json["cid"]);
- });
- //修改跟随模式阶段-任务
- router.route("/updateCourseFollowC").all((req, res, next) => {
- postmysql(req, res, "updateCourseFollowC");
- });
- //修改跟随模式阶段-任务
- router.route("/updateTrainCourseFollowC").all((req, res, next) => {
- postmysql(req, res, "updateTrainCourseFollowC");
- });
- //修改跟随模式
- router.route("/updateCourseFollow").all((req, res, next) => {
- postmysql(req, res, "updateCourseFollow");
- });
- //修改跟随模式
- router.route("/updateTrainCourseFollow").all((req, res, next) => {
- postmysql(req, res, "updateTrainCourseFollow");
- });
- //选人回答
- router.route("/updateCoursePick").all((req, res, next) => {
- postmysql(req, res, "updateCoursePick");
- });
- //删除
- router.route("/deletePick").all((req, res, next) => {
- postmysql(req, res, "deletePick");
- });
- //修改阶段锁定状态
- router.route("/updateCourseLookOpen").all((req, res, next) => {
- postmysql(req, res, "updateCourseLookOpen");
- });
- //修改阶段锁定状态
- router.route("/updateTrainCourseLookOpen").all((req, res, next) => {
- postmysql(req, res, "updateTrainCourseLookOpen");
- });
- //查看阶段锁定的状态
- router.route("/getCourseState").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getCourseState", json["cid"]);
- });
- //添加锁定状态
- router.route("/addCourseState").all((req, res, next) => {
- postmysql(req, res, "addCourseState");
- });
- //修改锁定状态
- router.route("/updateCourseSate").all((req, res, next) => {
- postmysql(req, res, "updateCourseSate");
- });
- //修改课程管理模式
- router.route("/updateCourseMode").all((req, res, next) => {
- postmysql(req, res, "updateCourseMode");
- });
- //修改课程管理模式
- router.route("/updateTrainCourseMode").all((req, res, next) => {
- postmysql(req, res, "updateTrainCourseMode");
- });
- //查询课程权限(学生是否能查看所有作业)
- router.route("/selectCourseSLook").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectCourseSLook", json["cid"]);
- });
- //查询课程权限(学生是否能查看所有作业)
- router.route("/selectTrainCourseSLook").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectTrainCourseSLook", json["cid"]);
- });
- //查询被挑的人
- router.route("/getPick").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getPick", json["cid"]);
- });
- //查询作业详情
- router.route("/selectWorksDetail2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectWorksDetail2",
- json["uid"],
- json["cid"],
- json["stage"],
- json["task"]
- );
- });
- //查询作业详情
- router.route("/selectWorksDetail2u").all((req, res, next) => {
- //var json = queryString(req.url);//, json['uid'], json['cid'], json['stage'], json['task'], json['tool'], json['type'], json['atool']
- postmysql2(req, res, "selectWorksDetail2u");
- });
- //查询课程全部作业详情
- router.route("/selectWorksDetail3").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectWorksDetail3", json["uid"], json["cid"]);
- });
- //查询课程所有作业详情
- router.route("/selectAllWorksDetail").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectAllWorksDetail", json["uid"], json["cid"]);
- });
- //查询多个课程全部作业详情
- router.route("/selectWorksDetailMore").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectWorksDetailMore", json["uid"], json["cid"]);
- });
- //查询课程某个阶段某个任务下的评价
- router.route("/updateWorksEva").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "updateWorksEva",
- json["cid"],
- json["s"],
- json["t"],
- json["uid"],
- json["rate"]
- );
- });
- //学习中心教师查询作业
- router.route("/selectSWorks").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectSWorks", json["cid"], json["s"], json["t"]);
- });
- //学习中心教师查询作业全部展示
- router.route("/selectSWorks2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectSWorks2", json["cid"]);
- });
- //学习中心学生查询作业
- router.route("/selectStudentWorks").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectStudentWorks",
- json["uid"],
- json["cid"],
- json["s"],
- json["t"]
- );
- });
- //实时课堂作业评价
- router.route("/updateStudentWork").all((req, res, next) => {
- postmysql(req, res, "updateStudentWork");
- });
- //学习中心查询学生
- router.route("/selectWorksStudent").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectWorksStudent", json["oid"], json["cid"]);
- });
- //批量上传查询学生
- router.route("/selectSnameByCid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectSnameByCid", json["cid"]);
- });
- //批量上传查询学生分页
- router.route("/selectSnameByCidPage").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectSnameByCidPage",
- json["cid"],
- json["cn"],
- json["page"],
- json["num"]
- );
- });
- //分组查询学生
- router.route("/selectSnameByCidGroup").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectSnameByCidGroup",
- json["cid"],
- json["oid"],
- json["cn"]
- );
- });
- /* 查询学生 */
- router.route("/selectStudent2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectStudent2",
- json["oid"],
- json["cu"],
- json["cn"],
- json["cid"],
- json["page"],
- 10
- );
- });
- /* 查询教师 */
- router.route("/selectTeacher2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectTeacher2",
- json["oid"],
- json["cu"],
- json["cn"],
- json["cid"],
- json["page"],
- 10
- );
- });
- /* 查询教师 */
- router.route("/selectTeacher").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectTeacher",
- json["org"],
- json["cu"],
- json["cn"],
- json["page"],
- 10
- );
- });
- /* 添加教师页面查询教师 */
- router.route("/selectTcTeacher").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectTcTeacher",
- json["org"],
- json["oid"],
- json["cu"],
- json["cn"],
- json["page"],
- 10
- );
- });
- /* 查询所有评价体系 */
- router.route("/selectAllEvaluation").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectAllEvaluation", json["oid"]);
- });
- /* 根据市级用户查询评审员 */
- router.route("/selectReviewer").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectReviewer",
- json["uid"],
- json["cn"],
- json["page"],
- 10
- );
- });
- /* 市级区县管理接口 */
- router.route("/selectCReviewer").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectCReviewer",
- json["uid"],
- json["cn"],
- json["page"],
- 10
- );
- });
- /* 修改评审员 修1 */
- router.route("/updateReviewer").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "updateReviewer",
- json["n"],
- json["p"],
- json["t"],
- json["s"],
- json["uid"]
- );
- });
- /* 删除1评审员 */
- router.route("/deleteReviewer").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteReviewer", json["uid"]);
- });
- /* 查询区县案例 */
- router.route("/selecAnliBox").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selecAnliBox", json["title"]);
- });
- /* 查询市级案例 */
- router.route("/selecAnliBox1").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selecAnliBox1", json["title"]);
- });
- /* 查询省级案例 */
- router.route("/selecAnliBox2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selecAnliBox2");
- });
- /* 案例征集查询通知公告 */
- router.route("/selectRaceNotice").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectRaceNotice", json["page"], 10);
- });
- /* 案例征集查询通知公告详情 */
- router.route("/getRaceNoticeDetail").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getRaceNoticeDetail", json["nid"]);
- });
- /* 案例征集发送通知 修1 */
- router.route("/insertRaceNote").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "insertRaceNote", json["t"], json["c"], json["uid"]);
- });
- /* 查看随机码是否重复 */
- router.route("/selectInviteCode").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectInviteCode", json["code"], json["oid"]);
- });
- /* 查看随机码是否重复 */
- router.route("/selectInviteCode2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectInviteCode2", json["code"], json["oid"]);
- });
- /* 根据随机码获取学校 */
- router.route("/selectCourseByIc").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectCourseByIc", json["code"], json["oid"]);
- });
- /* 根据随机码获取学校 */
- router.route("/selectCourseByIc2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectCourseByIc2", json["code"], json["oid"]);
- });
- /* 根据随机码获取学校 */
- router.route("/selectCourseByIc2SZ").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectCourseByIc2SZ", json["code"], json["oid"]);
- });
- router.route("/addWorkNew").all((req, res, next) => {
- // postmysql(req, res, "insert_teacher_work_new");
- if (req.body[0]) {
- // p = Object.values(req.body[0]);
- p = [
- req.body[0].uid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new");
- //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].courseId;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(
- JSON.stringify({
- ordernumber: ret[0][0].ordernumber,
- courseId: ret[0][0].courseId,
- success: 1,
- })
- );
- // res.end(JSON.stringify(ret));
- });
- }
- });
- router.route("/addWorkNew2").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].uid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].courseId;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(
- JSON.stringify({
- ordernumber: ret[0][0].ordernumber,
- courseId: ret[0][0].courseId,
- success: 1,
- })
- );
- });
- }
- });
- router.route("/addWorkNew2AI").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].uid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- req.body[0].refile,
- req.body[0].reBrief,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2_ai"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].courseId;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(
- JSON.stringify({
- ordernumber: ret[0][0].ordernumber,
- courseId: ret[0][0].courseId,
- success: 1,
- })
- );
- });
- }
- });
- router.route("/addWorkNew2New").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].uid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- req.body[0].highSetting,
- req.body[0].courseState,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2New"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].courseId;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(
- JSON.stringify({
- ordernumber: ret[0][0].ordernumber,
- courseId: ret[0][0].courseId,
- success: 1,
- })
- );
- });
- }
- });
- router.route("/addTrainCourseNew2").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].uid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTrainCourseNew2"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].courseId;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(
- JSON.stringify({
- ordernumber: ret[0][0].ordernumber,
- courseId: ret[0][0].courseId,
- success: 1,
- })
- );
- });
- }
- });
- router.route("/addTestCourse").all((req, res, next) => { //添加评测
- if (req.body[0]) {
- p = [
- req.body[0].uid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- req.body[0].typeid,
- req.body[0].overtime,
- req.body[0].j2,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTestCourse"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].courseId;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(
- JSON.stringify({
- ordernumber: ret[0][0].ordernumber,
- courseId: ret[0][0].courseId,
- success: 1,
- })
- );
- });
- }
- });
- router.route("/addTestCourse2").all((req, res, next) => { //添加评测 类型
- if (req.body[0]) {
- p = [
- req.body[0].uid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- req.body[0].typeid,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTestCourse2"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].courseId;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(
- JSON.stringify({
- ordernumber: ret[0][0].ordernumber,
- courseId: ret[0][0].courseId,
- success: 1,
- })
- );
- });
- }
- });
- router.route("/addWorkNew2E").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].uid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2E"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].courseId;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(
- JSON.stringify({
- ordernumber: ret[0][0].ordernumber,
- courseId: ret[0][0].courseId,
- success: 1,
- })
- );
- });
- }
- });
- router.route("/addWorkNew2T").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].uid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2T"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].courseId;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(
- JSON.stringify({
- ordernumber: ret[0][0].ordernumber,
- courseId: ret[0][0].courseId,
- success: 1,
- })
- );
- });
- }
- });
- router.route("/addTrainCourseNew2T").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].uid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTrainCourseNew2T"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].courseId;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(
- JSON.stringify({
- ordernumber: ret[0][0].ordernumber,
- courseId: ret[0][0].courseId,
- success: 1,
- })
- );
- });
- }
- });
- router.route("/addSynergyCourse").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].uid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_synergy"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].courseId;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(
- JSON.stringify({
- ordernumber: ret[0][0].ordernumber,
- courseId: ret[0][0].courseId,
- success: 1,
- })
- );
- });
- }
- });
- router.route("/addSynergyCourse2").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].cid,
- req.body[0].uid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_synergy2"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].courseId;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(
- JSON.stringify({
- ordernumber: ret[0][0].ordernumber,
- courseId: ret[0][0].courseId,
- success: 1,
- })
- );
- });
- }
- });
- router.route("/addWorkNew4").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].uid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- req.body[0].inviteCode,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new4"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].courseId;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(
- JSON.stringify({
- ordernumber: ret[0][0].ordernumber,
- courseId: ret[0][0].courseId,
- success: 1,
- })
- );
- });
- }
- });
- router.route("/addCourseWorkNew2").all((req, res, next) => {
- //学生
- if (req.body[0]) {
- p = [
- req.body[0].uid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addCourseWorkNew2"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].courseId;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(
- JSON.stringify({
- ordernumber: ret[0][0].ordernumber,
- courseId: ret[0][0].courseId,
- success: 1,
- })
- );
- });
- }
- });
- router.route("/addCourseWorkNew22").all((req, res, next) => {
- //学生
- if (req.body[0]) {
- p = [
- req.body[0].uid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addCourseWorkNew2"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].courseId;
- let userid = req.body[0].uid;
- delCourseTypeS(course, courseId, userid);
- res.end(
- JSON.stringify({
- ordernumber: ret[0][0].ordernumber,
- courseId: ret[0][0].courseId,
- success: 1,
- })
- );
- });
- }
- });
- //新增赛事项目
- router.route("/addRace").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].uid,
- req.body[0].info,
- req.body[0].over,
- req.body[0].pro,
- req.body[0].act,
- req.body[0].exc,
- req.body[0].res,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addRace"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].id;
- let userid = req.body[0].uid;
- delCourseType1(course, courseId, userid);
- res.end(JSON.stringify({ courseId: courseId, success: 1 }));
- });
- }
- });
- //新增赛事账号信息
- router.route("/addRaceUser").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].reg,
- req.body[0].res,
- req.body[0].sch,
- req.body[0].n,
- req.body[0].p,
- req.body[0].t,
- req.body[0].parent,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addRaceUser"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let num = ret[0][0].num;
- let userid = ret[0][0].userid;
- if (num < 10) {
- num = "SZ" + "00" + num + "@gdae.com";
- } else if (num < 100) {
- num = "SZ" + "0" + num + "@gdae.com";
- } else if (num > 100) {
- num = "SZ" + num + "@gdae.com";
- }
- y = [userid, num, bcrypt.hashSync("123456", bcrypt.genSaltSync(10))];
- //参数拼接,注册
- y.unshift(_mysqlLabor[0], _mysqlLabor[1], "upRaceUserNamePassword");
- mysql.usselect(y, function(ret) {
- res.end(JSON.stringify(ret));
- });
- res.end(JSON.stringify({ num: num, success: 1 }));
- });
- }
- });
- //修改赛事项目
- router.route("/updateRace").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].id,
- req.body[0].info,
- req.body[0].over,
- req.body[0].pro,
- req.body[0].act,
- req.body[0].exc,
- req.body[0].res,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateRace"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = req.body[0].id;
- let userid = req.body[0].uid;
- delCourseType1(course, courseId, userid);
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- router.route("/addWorkNew3").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].uid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new3"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].courseId;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(
- JSON.stringify({
- ordernumber: ret[0][0].ordernumber,
- courseId: ret[0][0].courseId,
- success: 1,
- })
- );
- });
- }
- });
- router.route("/addInviteCode").all((req, res, next) => {
- if (req.body[0]) {
- addCourseInviteCode(
- req.body[0].courseId,
- JSON.parse(decodeURIComponent(req.body[0].inviteCode))
- );
- }
- });
- function delCourseInviteCode(courseId, inviteCode) {
- let _courseId = courseId;
- var _userdata = [_courseId];
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_courseInviteCode");
- mysql.usselect(_userdata, function(ret) {
- // console.log(ret);
- addCourseInviteCode(_courseId, inviteCode);
- });
- }
- function delCourseType(course, courseId, userid) {
- let _courseId = courseId;
- var _userdata = [_courseId];
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_courseType");
- mysql.usselect(_userdata, function(ret) {
- // console.log(ret);
- addCourseType(userid, course, _courseId);
- });
- // setTimeout(() => {
- // }, 1000);
- }
- function delCourseType1(course, courseId, userid) {
- let _courseId = courseId;
- var _userdata = [_courseId];
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_courseType1");
- mysql.usselect(_userdata, function(ret) {
- // console.log(ret);
- });
- setTimeout(() => {
- addCourseType1(userid, course, _courseId);
- }, 1000);
- }
- function delCourseTypeS(course, courseId, userid) {
- let _courseId = courseId;
- var _userdata = [_courseId];
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_courseTypeS");
- mysql.usselect(_userdata, function(ret) {
- // console.log(ret);
- addCourseTypeS(userid, course, _courseId);
- });
- // setTimeout(() => {
- // }, 1000);
- }
- function addCourseInviteCode(courseId, inviteCode) {
- var _courses = courseId;
- var _tid = inviteCode;
- for (let i = 0; i < _tid.length; i++) {
- let _userdata = [_courses, _tid[i].cid, _tid[i].ic];
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_courseInviteCode");
- setTimeout(() => {
- mysql.usselect(_userdata, function(ret) {
- // console.log(ret);
- });
- }, i * 500);
- }
- }
- function addCourseType(userid, course, _courseId) {
- var _uid = userid;
- var _courses = _courseId;
- var _tid = JSON.parse(decodeURIComponent(course));
- for (let i = 0; i < _tid.length; i++) {
- if (_tid[i] == "") {
- continue;
- }
- var _userdata = [_courses, _tid[i], _uid];
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_courseType");
- mysql.usselect(_userdata, function(ret) {
- // console.log(ret);
- });
- }
- }
- function addCourseType1(userid, course, _courseId) {
- var _uid = userid;
- var _courses = _courseId;
- var _tid = JSON.parse(decodeURIComponent(course));
- for (let i = 0; i < _tid.length; i++) {
- if (_tid[i] == "") {
- continue;
- }
- var _userdata = [_courses, _tid[i], _uid];
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_courseType1");
- mysql.usselect(_userdata, function(ret) {
- // console.log(ret);
- });
- }
- }
- function addCourseTypeS(userid, course, _courseId) {
- var _uid = userid;
- var _courses = _courseId;
- var _tid = JSON.parse(decodeURIComponent(course));
- for (let i = 0; i < _tid.length; i++) {
- if (_tid[i] == "") {
- continue;
- }
- var _userdata = [_courses, _tid[i], _uid];
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_courseTypeS");
- mysql.usselect(_userdata, function(ret) {
- // console.log(ret);
- });
- }
- }
- //修改课程
- // router.route('/updateWork').all((req, res, next) => {
- // postmysql(req, res, "update_teacher_work");
- // });
- router.route("/updateWorkNew").all((req, res, next) => {
- if (req.body[0]) {
- // p = Object.values(req.body[0]);
- p = [
- req.body[0].cid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new");
- //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = req.body[0].cid;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(JSON.stringify({ success: 1 }));
- // res.end(JSON.stringify(ret));
- });
- }
- });
- //查询课程
- // router.route('/selectCourse').all((req, res, next) => {
- // var json = queryString(req.url);
- // getmysql(req, res, "select_course", json['type'], json['uid'], json['oid'], json['page'], 10);
- // });
- router.route("/updateWorkNew2").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].cid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new2"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = req.body[0].cid;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- router.route("/updateWorkNew2AI").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].cid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- req.body[0].refile,
- req.body[0].reBrief,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new2_ai"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = req.body[0].cid;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- router.route("/updateWorkNew2New").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].cid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- req.body[0].highSetting
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new2New"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = req.body[0].cid;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- router.route("/updateTrainCourseNew2").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].cid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTrainCourseNew2"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = req.body[0].cid;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- router.route("/updateTestCourse").all((req, res, next) => { //修改评测
- if (req.body[0]) {
- p = [
- req.body[0].cid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- req.body[0].look,
- req.body[0].typeid,
- req.body[0].overtime,
- req.body[0].j2,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTestCourse"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = req.body[0].cid;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- router.route("/updateTestCourse2").all((req, res, next) => { //修改评测
- if (req.body[0]) {
- p = [
- req.body[0].cid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- req.body[0].look,
- req.body[0].typeid,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTestCourse2"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = req.body[0].cid;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- router.route("/updateSynergy").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].cid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_synergy"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = req.body[0].cid;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- router.route("/updateWorkNew5").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].cid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- req.body[0].inviteCode,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new5"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = req.body[0].cid;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- router.route("/updateStudentWorkNew2").all((req, res, next) => {
- //学生
- if (req.body[0]) {
- p = [
- req.body[0].cid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew2"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = req.body[0].cid;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- router.route("/updateStudentWorkNew22").all((req, res, next) => {
- //学生
- if (req.body[0]) {
- p = [
- req.body[0].cid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew2"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = req.body[0].cid;
- let userid = req.body[0].uid;
- delCourseTypeS(course, courseId, userid);
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- router.route("/updateWorkNew3").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].cid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new3"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = req.body[0].cid;
- let userid = req.body[0].uid;
- delCourseType(course, courseId, userid);
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- function guid() {
- var _num,
- i,
- _guid = "";
- for (i = 0; i < 32; i++) {
- _guid += Math.floor(Math.random() * 16).toString(16); //随机0 - 16 的数字 转变为16进制的字符串
- _num = Math.floor((i - 7) / 4); //计算 (i-7)除4
- if (_num > -1 && _num < 4 && i == 7 + 4 * _num) {
- //会使guid中间加 "-" 形式为xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- _guid += "-";
- }
- }
- return _guid;
- }
- router.route("/updateWorkNew4").all((req, res, next) => {
- if (req.body[0]) {
- let p = [req.body[0].cid];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_course_detail"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let _unitIndex = parseInt(req.body[0].unitIndex);
- let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
- let _unitJson = JSON.parse(ret[0][0].chapters);
- if (_unitJson.length - 1 < _unitIndex) {
- let _i = _unitIndex - (_unitJson.length - 1);
- for (let i = 0; i < _i; i++) {
- _unitJson.push({
- dyName: "", //单元标题
- chapterInfo: [{
- isread: false,
- chapterid: guid(),
- title: "",
- courseName: "",
- taskJson: [{
- task: "",
- taskDetail: "",
- chapterData: [],
- toolText: "",
- toolChoose: [{
- tool: [],
- toolDetail: "",
- toolType: 0,
- askCount: 1,
- askTitle: "",
- askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
- }, ],
- isShowTools: false,
- askCount: 1,
- isFold: 0,
- askTitle: "",
- askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
- checkJson: [{ checkCount: [], checkPerent: [] }],
- homeworkList: [],
- }, ],
- itemCount: 1,
- fileList1: [],
- video: [],
- testData: [],
- pData: [],
- templateArray: [],
- }, ],
- });
- }
- _unitJson[_unitIndex] = _chapters[_unitIndex];
- } else {
- _unitJson[_unitIndex] = _chapters[_unitIndex];
- }
- // console.log(_unitJson);
- let p2 = [
- req.body[0].cid,
- // JSON.stringify(_unitJson).replaceAll(/%/g, "%25")
- encodeURIComponent(JSON.stringify(_unitJson)),
- ];
- p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new4"); //執行存儲過程
- mysql.usselect(p2, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- // res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- router.route("/updateTrainCourseNew4").all((req, res, next) => {
- if (req.body[0]) {
- let p = [req.body[0].cid];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_trainCourse_detail"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let _unitIndex = parseInt(req.body[0].unitIndex);
- let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
- let _unitJson = JSON.parse(ret[0][0].chapters);
- if (_unitJson.length - 1 < _unitIndex) {
- let _i = _unitIndex - (_unitJson.length - 1);
- for (let i = 0; i < _i; i++) {
- _unitJson.push({
- dyName: "", //单元标题
- chapterInfo: [{
- isread: false,
- chapterid: guid(),
- title: "",
- courseName: "",
- taskJson: [{
- task: "",
- taskDetail: "",
- chapterData: [],
- toolText: "",
- toolChoose: [{
- tool: [],
- toolDetail: "",
- toolType: 0,
- askCount: 1,
- askTitle: "",
- askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
- }, ],
- isShowTools: false,
- askCount: 1,
- isFold: 0,
- askTitle: "",
- askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
- checkJson: [{ checkCount: [], checkPerent: [] }],
- homeworkList: [],
- }, ],
- itemCount: 1,
- fileList1: [],
- video: [],
- testData: [],
- pData: [],
- templateArray: [],
- }, ],
- });
- }
- _unitJson[_unitIndex] = _chapters[_unitIndex];
- } else {
- _unitJson[_unitIndex] = _chapters[_unitIndex];
- }
- // console.log(_unitJson);
- let p2 = [
- req.body[0].cid,
- encodeURIComponent(JSON.stringify(_unitJson)),
- ];
- p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTrainCourseNew4"); //執行存儲過程
- mysql.usselect(p2, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- // res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- router.route("/updateStudentWorkNew4").all((req, res, next) => {
- //学生
- if (req.body[0]) {
- let p = [req.body[0].cid];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_student_course_detail2"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let _unitIndex = parseInt(req.body[0].unitIndex);
- let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
- let _unitJson = JSON.parse(ret[0][0].chapters);
- if (_unitJson.length - 1 < _unitIndex) {
- let _i = _unitIndex - (_unitJson.length - 1);
- for (let i = 0; i < _i; i++) {
- _unitJson.push({
- dyName: "", //单元标题
- chapterInfo: [{
- isread: false,
- chapterid: guid(),
- title: "",
- courseName: "",
- taskJson: [{
- task: "",
- taskDetail: "",
- chapterData: [],
- toolText: "",
- toolChoose: [{
- tool: [],
- toolDetail: "",
- toolType: 0,
- askCount: 1,
- askTitle: "",
- askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
- }, ],
- isShowTools: false,
- askCount: 1,
- isFold: 0,
- askTitle: "",
- askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
- checkJson: [{ checkCount: [], checkPerent: [] }],
- homeworkList: [],
- }, ],
- itemCount: 1,
- fileList1: [],
- video: [],
- testData: [],
- pData: [],
- templateArray: [],
- }, ],
- });
- }
- _unitJson[_unitIndex] = _chapters[_unitIndex];
- } else {
- _unitJson[_unitIndex] = _chapters[_unitIndex];
- }
- // console.log(_unitJson);
- let p2 = [
- req.body[0].cid,
- encodeURIComponent(JSON.stringify(_unitJson)),
- ];
- p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew4"); //執行存儲過程
- mysql.usselect(p2, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- // res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- //协同删除阶段
- router.route("/deleteWork").all((req, res, next) => {
- if (req.body[0]) {
- let p = [req.body[0].cid];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_course_detail"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let _chapid = req.body[0].chapid;
- // console.log(_chapid);
- let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
- let _unitJson = JSON.parse(ret[0][0].chapters);
- let _unitJson2 = [];
- for (var i = 0; i < _unitJson.length; i++) {
- if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
- // console.log(1);
- // _unitJson.splice(i, -1)
- _unitJson2.push(_unitJson[i]);
- // break;
- }
- }
- // console.log(_unitJson2);
- let p2 = [
- req.body[0].cid,
- encodeURIComponent(JSON.stringify(_unitJson2)),
- ];
- p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new4"); //執行存儲過程
- mysql.usselect(p2, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- // res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- router.route("/deletetrainCourseWork").all((req, res, next) => {
- if (req.body[0]) {
- let p = [req.body[0].cid];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_trainCourse_detail"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let _chapid = req.body[0].chapid;
- // console.log(_chapid);
- let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
- let _unitJson = JSON.parse(ret[0][0].chapters);
- let _unitJson2 = [];
- for (var i = 0; i < _unitJson.length; i++) {
- if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
- // console.log(1);
- // _unitJson.splice(i, -1)
- _unitJson2.push(_unitJson[i]);
- // break;
- }
- }
- // console.log(_unitJson2);
- let p2 = [
- req.body[0].cid,
- encodeURIComponent(JSON.stringify(_unitJson2)),
- ];
- p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTrainCourseNew4"); //執行存儲過程
- mysql.usselect(p2, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- // res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- //协同删除阶段
- router.route("/deleteStudentWork").all((req, res, next) => {
- //学生
- if (req.body[0]) {
- let p = [req.body[0].cid];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_student_course_detail2"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let _chapid = req.body[0].chapid;
- // console.log(_chapid);
- let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
- let _unitJson = JSON.parse(ret[0][0].chapters);
- let _unitJson2 = [];
- for (var i = 0; i < _unitJson.length; i++) {
- if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
- // console.log(1);
- // _unitJson.splice(i, -1)
- _unitJson2.push(_unitJson[i]);
- // break;
- }
- }
- // console.log(_unitJson2);
- let p2 = [
- req.body[0].cid,
- encodeURIComponent(JSON.stringify(_unitJson2)),
- ];
- p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew4"); //執行存儲過程
- mysql.usselect(p2, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- // res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- //协同恢复删除的阶段
- router.route("/restoreWork").all((req, res, next) => {
- if (req.body[0]) {
- let p = [req.body[0].cid];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_course_detail"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let _chapid = req.body[0].chapid;
- // console.log(_chapid);
- let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
- let _unitJson = JSON.parse(ret[0][0].chapters);
- let _unitJson2 = [];
- let chpaindex;
- for (var i = 0; i < _chapters.length; i++) {
- if (_chapters[i].chapterInfo[0].chapterid == _chapid) {
- chpaindex = i;
- }
- }
- for (var i = 0; i < _unitJson.length; i++) {
- if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
- // console.log(1);
- // _unitJson.splice(i, -1)
- _unitJson2.push(_unitJson[i]);
- // break;
- }
- }
- _unitJson2.splice(chpaindex, 0, _chapters[chpaindex]);
- // console.log(_unitJson2);
- let p2 = [
- req.body[0].cid,
- encodeURIComponent(JSON.stringify(_unitJson2)),
- ];
- p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new4"); //執行存儲過程
- mysql.usselect(p2, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- // res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- //协同恢复删除的阶段
- router.route("/restoreTrainCourse").all((req, res, next) => {
- if (req.body[0]) {
- let p = [req.body[0].cid];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_trainCourse_detail"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let _chapid = req.body[0].chapid;
- // console.log(_chapid);
- let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
- let _unitJson = JSON.parse(ret[0][0].chapters);
- let _unitJson2 = [];
- let chpaindex;
- for (var i = 0; i < _chapters.length; i++) {
- if (_chapters[i].chapterInfo[0].chapterid == _chapid) {
- chpaindex = i;
- }
- }
- for (var i = 0; i < _unitJson.length; i++) {
- if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
- // console.log(1);
- // _unitJson.splice(i, -1)
- _unitJson2.push(_unitJson[i]);
- // break;
- }
- }
- _unitJson2.splice(chpaindex, 0, _chapters[chpaindex]);
- // console.log(_unitJson2);
- let p2 = [
- req.body[0].cid,
- encodeURIComponent(JSON.stringify(_unitJson2)),
- ];
- p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTrainCourseNew4"); //執行存儲過程
- mysql.usselect(p2, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- // res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- //协同恢复删除的阶段
- router.route("/restoreStudentWork").all((req, res, next) => {
- //学生
- if (req.body[0]) {
- let p = [req.body[0].cid];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_student_course_detail2"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let _chapid = req.body[0].chapid;
- // console.log(_chapid);
- let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
- let _unitJson = JSON.parse(ret[0][0].chapters);
- let _unitJson2 = [];
- let chpaindex;
- for (var i = 0; i < _chapters.length; i++) {
- if (_chapters[i].chapterInfo[0].chapterid == _chapid) {
- chpaindex = i;
- }
- }
- for (var i = 0; i < _unitJson.length; i++) {
- if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
- // console.log(1);
- // _unitJson.splice(i, -1)
- _unitJson2.push(_unitJson[i]);
- // break;
- }
- }
- _unitJson2.splice(chpaindex, 0, _chapters[chpaindex]);
- // console.log(_unitJson2);
- let p2 = [
- req.body[0].cid,
- encodeURIComponent(JSON.stringify(_unitJson2)),
- ];
- p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew4"); //執行存儲過程
- mysql.usselect(p2, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- // res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- router.route("/selectCourseNew").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "select_course_new",
- json["type"],
- json["uid"],
- json["oid"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["page"],
- 10
- );
- });
- router.route("/selectCourseNew2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "select_course_new2",
- json["type"],
- json["uid"],
- json["oid"],
- json["org"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["page"],
- json["pageSize"]
- );
- });
- router.route("/selectTrainCourseNew2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectTrainCourseNew2",
- json["type"],
- json["uid"],
- json["oid"],
- json["org"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["page"],
- json["pageSize"]
- );
- });
- router.route("/selectSynergyCourse").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectSynergyCourse",
- json["type"],
- json["uid"],
- json["oid"],
- json["org"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["page"],
- json["pageSize"]
- );
- });
- router.route("/selectStudentCourseNew2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectStudentCourseNew2",
- json["type"],
- json["uid"],
- json["oid"],
- json["org"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["page"],
- 10
- );
- });
- router.route("/selectStudentCourseNew22").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectStudentCourseNew22",
- json["type"],
- json["uid"],
- json["oid"],
- json["org"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typef"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["page"],
- json["pageSize"]
- );
- });
- router.route("/selectStudentCourseNew222").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectStudentCourseNew222",
- json["type"],
- json["uid"],
- json["oid"],
- json["org"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typef"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["page"],
- json["pageSize"]
- );
- });
- //查询评测
- router.route("/selectTesttCourse").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectTesttCourse",
- json["type"],
- json["uid"],
- json["oid"],
- json["org"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typef"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["page"],
- json["pageSize"]
- );
- });
- //查询评测
- router.route("/selectTesttCourse2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectTesttCourse2",
- json["oid"],
- json["org"],
- json["type"],
- json["cn"],
- json["page"],
- json["pageSize"]
- );
- });
- //查询评测 评测中心
- router.route("/selectTesttCourseCenter").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectTesttCourseCenter",
- json["type"],
- json["uid"],
- json["oid"],
- json["org"],
- json["classid"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typef"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["page"],
- json["pageSize"]
- );
- });
- //查询评测 评测中心及作业
- router.route("/selectTesttCourseCenter1").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectTesttCourseCenter1",
- json["type"],
- json["uid"],
- json["oid"],
- json["org"],
- json["classid"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typef"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["page"],
- json["pageSize"]
- );
- });
- router.route("/selectStudentCourseNew22Mode").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectStudentCourseNew22Mode",
- json["type"],
- json["uid"],
- json["oid"],
- json["org"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typef"],
- json["typeE"],
- json["cu"],
- json["cn"]
- );
- });
- //查询协同编辑课程
- router.route("/selectCourseTeam").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectCourseTeam", json["uid"], json["oid"]);
- });
- //查询学校
- router.route("/selectSchoolName").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectOidName", json["cu"], json["cn"], json["page"], 10);
- });
- //查询组织
- router.route("/selectOrgName").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectOrgName", json["page"], 10);
- });
- //查询学校
- router.route("/selectSchoolName2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectOidName2", json["oid"]);
- });
- //查询学校
- router.route("/selectSchoolNameOrg").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectSchoolNameOrg", json["org"], json["page"], 10);
- });
- //查询协同学校和被协同学校
- router.route("/selectOrgType").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectOrgType", json["t"], json["org"], json["page"], 10);
- });
- //新增批注
- router.route("/addPz").all((req, res, next) => {
- postmysql(req, res, "addPz");
- });
- //新增批注
- router.route("/addPz2").all((req, res, next) => {
- postmysql(req, res, "addPz2");
- });
- //新增回复
- router.route("/addHf").all((req, res, next) => {
- postmysql(req, res, "addHf");
- });
- //删除批注
- router.route("/deletePz").all((req, res, next) => {
- postmysql(req, res, "deletePz");
- });
- //删除回复
- router.route("/deleteReply").all((req, res, next) => {
- postmysql(req, res, "deleteReply");
- });
- //查询批注列表
- router.route("/selectPzList").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectPzList", json["cid"], json["s"], json["t"]);
- });
- //查询批注列表
- router.route("/selectPzListType").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectPzListType", json["cid"], json["s"], json["t"], json["type"], json["uid"]);
- });
- //评分
- router.route("/scoreWork").all((req, res, next) => {
- postmysql(req, res, "scoreWork");
- });
- //删除学生
- router.route("/deleteStudent").all((req, res, next) => {
- postmysql(req, res, "delete_student");
- });
- //查询学校底下的班级
- router.route("/selectClassBySchool").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectClassBySchool", json["oid"]);
- });
- //查询学校底下的教研室
- router.route("/selectTeacherOfficeBySchool").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectTeacherOfficeBySchool", json["oid"]);
- });
- //查询学校底下的年级
- router.route("/selectGrageBySchool").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectGrageBySchool", json["oid"]);
- });
- //查询学校底下的班级
- router.route("/selectClassBySchoolSearch").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectClassBySchoolSearch", json["oid"], json["cn"]);
- });
- //查询学校底下的班级
- router.route("/selectClassBySchoolSearch2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectClassBySchoolSearch2", json["oid"], json["gid"], json["cn"]);
- });
- //查询组织底下的学校
- router.route("/selectSchoolByOrg").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectSchoolByOrg", json["org"]);
- });
- //学生注册接口
- router.route("/register_student").post(function(req, res, next) {
- //mode的处理
- if (req.body[0]) {
- // 0 用户名 1 用户密码 2用户身份 3 第三方id(可有可无)
- p = Object.values(req.body[0]); //获取用户密码
- //没有第三方id的处理
- // if (p.length < 4) {
- // p.push("")
- // }
- p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
- //密码加密
- // bcrypt.hash(p[1], 10, function (err, hash) {
- // if (err) {
- // return next(err);
- // }
- // p[1] = hash;
- // });
- //参数拼接,注册
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "register_student");
- //返回注册用户数据
- // mysql.usselect(p, function (ret) {
- // res.end(ret);
- // });
- mysql.usselect(p, function(ret) {
- res.end(JSON.stringify(ret));
- });
- }
- });
- //查询课程详情
- router.route("/selectCourseDetail").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectCourseDetail", json["courseId"]);
- });
- //查询课程详情
- router.route("/selectTrainCourseDetail").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectTrainCourseDetail", json["courseId"]);
- });
- //查询课程详情
- router.route("/selectCourseDetail2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectCourseDetail2", json["courseId"]);
- });
- //查询课程详情
- router.route("/selectTrainCourseDetail2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectTrainCourseDetail2", json["courseId"]);
- });
- //查询课程详情
- router.route("/selectCourseDetail3").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectCourseDetail3", json["courseId"]);
- });
- //查询课程详情
- router.route("/selectTrainCourseDetail3").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectTrainCourseDetail3", json["courseId"]);
- });
- //查询学校底下的所有赛事
- router.route("/selectRaceByOid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectRaceByOid", json["sid"]);
- });
- //修改作业学生名称 修1
- router.route("/updateCourseWorksName").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "updateCourseWorksName", json["n"], json["cid"]);
- });
- //查询课程详情
- router.route("/selectStudentCourseDetail").all((req, res, next) => {
- //学生
- var json = queryString(req.url);
- getmysql(req, res, "selectStudentCourseDetail", json["courseId"]);
- });
- //查询课程详情
- router.route("/selectStudentCourseDetail3").all((req, res, next) => {
- //学生
- var json = queryString(req.url);
- getmysql(req, res, "selectStudentCourseDetail3", json["courseId"]);
- });
- //查询课程详情
- router.route("/selectStudentCourseDetail2").all((req, res, next) => {
- //学生
- var json = queryString(req.url);
- getmysql(req, res, "selectStudentCourseDetail2", json["courseId"]);
- });
- //跳转阶段时,如果有课程就查询1返回,如果没有就插入 修1
- router.route("/addUserR").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "insertUserR", json["uid"], json["cid"]);
- });
- //新增学生端作业
- router.route("/addWorks").all((req, res, next) => {
- postmysql(req, res, "add_works");
- });
- //查询已提交作业
- router.route("/selectWork").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectWork",
- json["cid"],
- json["stage"],
- json["task"],
- json["uid"]
- );
- });
- //查询作业详情
- router.route("/selectWorksDetail").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectWorksDetail", json["uid"], json["cid"]);
- });
- //新增作业评分 修1
- router.route("/updateWorks").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "updateWorks", json["rate"], json["tuid"], json["id"]);
- });
- //新增素材信息 修1
- router.route("/addMtl").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "add_mtl", json["cInfo"], json["t"], json["cBy"]);
- });
- //根据类型查询素材信息
- router.route("/selectMtl").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectMtl", json["t"], json["page"], 10);
- });
- //根据类型查询素材信息
- router.route("/selectMtl2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectMtl2", json["t"], json["uid"], json["page"], 10);
- });
- //学习中心
- //新增学习资源信息
- router.route("/addStuMtl").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "addStuMtl", json["cInfo"], json["t"], json["cBy"]);
- });
- //根据类型查询学习资料信息
- router.route("/selectStuMtl").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectStuMtl", json["t"], json["page"], 10);
- });
- //删除1素材
- router.route("/deleteStuM").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteStuM", json["id"]);
- });
- //查询学生信息
- router.route("/selectSDetail").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectStudentDetail", json["uid"]);
- });
- //查询个人课程
- router.route("/selectMyCourse").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectMyCourse", json["uid"]);
- });
- //查询个人课程groupby课程id
- router.route("/selectMyCourseBycid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectMyCourseBycid", json["uid"]);
- });
- //查询所有课程
- router.route("/selectAllCourse").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectAllCourse", json["oid"], json["page"], 10);
- });
- //根据班级查询所有课程
- router.route("/selectAllCourseByCid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectAllCourseByCid",
- json["oid"],
- json["cid"],
- json["page"],
- 10
- );
- });
- //根据分类查询所有课程
- router.route("/selectTypeCourse").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectTypeCourse",
- json["uid"],
- json["oid"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["classid"],
- json["page"],
- 10
- );
- });
- //根据分类查询所有课程
- router.route("/selectTypeCourse2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectTypeCourse2",
- json["uid"],
- json["oid"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["classid"],
- json["org"],
- json["page"],
- json["pageSize"]
- );
- });
- //根据分类查询所有课程
- router.route("/selectTypeTrainCourse2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectTypeTrainCourse2",
- json["uid"],
- json["oid"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["classid"],
- json["org"],
- json["page"],
- json["pageSize"]
- );
- });
- //根据分类查询所有课程
- router.route("/selectTypeCourse2Mode").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectTypeCourse2Mode",
- json["uid"],
- json["oid"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["classid"],
- json["org"]
- );
- });
- //根据分类查询所有课程
- router.route("/selectTypeTrainCourse2Mode").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectTypeTrainCourse2Mode",
- json["uid"],
- json["oid"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["classid"],
- json["org"]
- );
- });
- //根据分类查询所有课程
- router.route("/selectTypeCourse2GM").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectTypeCourse2GM",
- json["uid"],
- json["oid"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["classid"],
- json["org"],
- json["page"],
- 10
- );
- });
- //根据分类查询所有课程
- router.route("/selectCourseExamine").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectCourseExamine",
- json["oid"],
- json["org"],
- json["cn"],
- json["page"],
- 10
- );
- });
- //根据分类查询所有课程
- router.route("/selectTypeCourse3").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectTypeCourse3",
- json["uid"],
- json["oid"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["classid"],
- json["org"],
- json["page"],
- 10
- );
- });
- //审核课程
- router.route("/examineCourse").all((req, res, next) => {
- postmysql(req, res, "examineCourse");
- });
- //删除1素材
- router.route("/deleteM").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteM", json["id"]);
- });
- //点击阶段时添加观看人数 修1
- router.route("/updateVc").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "updateVc", json["cid"]);
- });
- //点击阶段时添加观看人数
- router.route("/updateVcTrain").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "updateVcTrain", json["cid"]);
- });
- //删除1课程
- router.route("/deleteCourse").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteCourse", json["cid"]);
- });
- //删除1课程
- router.route("/deleteTrainCourse").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteTrainCourse", json["cid"]);
- });
- //删除1课程
- router.route("/deleteSynergyCourse").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteSynergyCourse", json["cid"]);
- });
- //删除1课程
- router.route("/deleteStudentCourse").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteStudentCourse", json["cid"]);
- });
- //复制课程
- router.route("/copyCourse").all((req, res, next) => {
- postmysql(req, res, "copyCourse");
- });
- //复制课程
- router.route("/copyCourseSz").all((req, res, next) => {
- postmysql2(req, res, "copyCourse");
- });
- //返回复制课程
- router.route("/getcopyCourseSz").all((req, res, next) => {
- postmysql2(req, res, "getcopyCourseSz");
- });
- //查看课程信息
- router.route("/selectCourseDetailSz").all((req, res, next) => {
- postmysql2(req, res, "selectCourseDetailSz");
- });
- //复制课程
- router.route("/copyTrainCourse").all((req, res, next) => {
- postmysql(req, res, "copyTrainCourse");
- });
- //复制课程
- router.route("/copyTest").all((req, res, next) => {
- postmysql(req, res, "copyTest");
- });
- //复制课程
- router.route("/copySynergyCourse").all((req, res, next) => {
- postmysql(req, res, "copySynergyCourse");
- });
- //复制评价体系
- router.route("/copyEva").all((req, res, next) => {
- postmysql(req, res, "copyEva");
- });
- //复制课程
- router.route("/copySCourse").all((req, res, next) => {
- postmysql(req, res, "copySCourse");
- });
- //查看课程
- router.route("/select_course_detail").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_course_detail", json["cid"]);
- });
- //查看课程
- router.route("/select_trainCourse_detail").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_trainCourse_detail", json["cid"]);
- });
- //删除评测
- router.route("/deleteTestCourseWorks").all((req, res, next) => {
- postmysql(req, res, "deleteTestCourseWorks");
- });
- //查看评测
- router.route("/selectTestType").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectTestType", json["oid"]);
- });
- //查看评测
- router.route("/getTestCourseDetail").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getTestCourseDetail", json["cid"]);
- });
- //查看评测
- router.route("/selectPostilByUid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectPostilByUid", json["uid"]);
- });
- //查看评测
- router.route("/getTestWorkShare").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getTestWorkShare", json["id"]);
- });
- //查看课程
- router.route("/select_synergy").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_synergy", json["cid"]);
- });
- //查看课程
- router.route("/select_student_course_detail").all((req, res, next) => {
- //学生
- var json = queryString(req.url);
- getmysql(req, res, "select_student_course_detail", json["cid"]);
- });
- //查看课程
- router.route("/select_student_course_detail2").all((req, res, next) => {
- //学生
- var json = queryString(req.url);
- getmysql(req, res, "select_student_course_detail2", json["cid"]);
- });
- //查看课程
- router.route("/getExportScourse").all((req, res, next) => {
- //学生
- var json = queryString(req.url);
- getmysql(req, res, "getExportScourse", json["cid"]);
- });
- //模糊查找课程
- // router.route('/searchCourse').all((req, res, next) => {
- // var json = queryString(req.url);
- // getmysql(req, res, "searchCourse", json['cu'], json['cn'], json['page'], 10);
- // });
- //创建调查问卷
- router.route("/addAsk").all((req, res, next) => {
- postmysql(req, res, "insert_ask");
- });
- //学生提交问卷
- router.route("/addAskList").all((req, res, next) => {
- postmysql(req, res, "insert_askList");
- });
- //根据课程id阶段id获取已提交的问卷
- router.route("/getAskListByCidStage").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "getAskListByCidStage",
- json["cid"],
- json["stage"],
- json["task"]
- );
- });
- //获取调查问卷
- router.route("/getAsk").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_ask", json["uid"], json["page"], 10);
- });
- //删除问卷
- router.route("/deleteAsk").all((req, res, next) => {
- postmysql(req, res, "deleteAsk");
- });
- //问卷调查数据统计
- router.route("/getAskListByAskid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_askListByAskid", json["aid"]);
- });
- //删除学生提交问卷
- router.route("/deleteAskList").all((req, res, next) => {
- postmysql(req, res, "update_askList_delete");
- });
- //根据id获取调查问卷
- router.route("/getAskList").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_askList", json["uid"], json["page"], 10);
- });
- //查看便签列表
- router.route("/selectNote").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectNote", json["uid"]);
- });
- //新增便签列表
- router.route("/insertNote").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "insertNote", json["uid"], json["c"]);
- });
- //根据便签id修改便签内容
- router.route("/updateNote").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "updateNote", json["nid"], json["c"]);
- });
- //删除1便签
- router.route("/deleteNote").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteNote", json["nid"]);
- });
- //查询便签
- router.route("/selectNoteContent").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectNoteContent", json["cn"]);
- });
- //修改用户信息
- router.route("/updateUserByEdu").all((req, res, next) => {
- postmysql(req, res, "updateUserByEdu");
- });
- //修改用户信息
- router.route("/updateUserByEdu1").all((req, res, next) => {
- postmysql(req, res, "updateUserByEdu1");
- });
- //修改用户信息
- router.route("/updateUserByEduOid").all((req, res, next) => {
- postmysql(req, res, "updateUserByEduOid");
- });
- //修改学生信息
- router.route("/updateStudentInfo").all((req, res, next) => {
- postmysql(req, res, "updateStudentInfo");
- });
- //教师端data修改pbl用户信息
- router.route("/updatePblMessage").all((req, res, next) => {
- postmysql2(req, res, "updatePblMessage");
- });
- //登录次数
- router.route("/addLoginOperation").all((req, res, next) => {
- postmysql2(req, res, "addLoginOperation");
- });
- //当日登录时间
- router.route("/addOperationTime").all((req, res, next) => {
- postmysql2(req, res, "addOperationTime");
- });
- //课程学习时间
- router.route("/addOperationTime2").all((req, res, next) => {
- postmysql(req, res, "addOperationTime");
- });
- //当日登录时间
- router.route("/addOperationTimeT").all((req, res, next) => {
- postmysql2(req, res, "addOperationTime2");
- });
- //课程学习时间
- router.route("/addOperationTimeT2").all((req, res, next) => {
- postmysql(req, res, "addOperationTime2");
- });
- //记录用户协同建构操作
- router.route("/add_OperationCSCL").all((req, res, next) => {
- postmysql2(req, res, "add_OperationCSCL");
- });
- //获取所有分组协同数据
- router.route("/select_CSCLDataByID").all((req, res, next) => {
- postmysql2(req, res, "select_CSCLDataByID");
- });
- //获取项目所有的分组所有的人操作数据的总数和时间
- router.route("/select_CSCLDataCount").all((req, res, next) => {
- postmysql2(req, res, "select_CSCLDataCount");
- });
- //获取用户在某个分组的操作日志
- router.route("/select_CSCLDataByUserIdID").all((req, res, next) => {
- postmysql2(req, res, "select_CSCLDataByUserIdID");
- });
- router.route("/updatePblMessage2").all((req, res, next) => {
- postmysql(req, res, "updatePblMessage");
- });
- router.route("/updateUserInfoText").all((req, res, next) => {
- postmysql(req, res, "updateUserInfoText");
- });
- //修改幼儿园评价个人信息
- router.route("/updateStudentInfoText").all((req, res, next) => {
- postmysql(req, res, "updateStudentInfoText");
- });
- router.route("/updateRaceUser").all((req, res, next) => {
- postmysql(req, res, "updateRaceUser");
- });
- //查询用户信息
- router.route("/selectUser").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectUser", json["userid"]);
- });
- //查询用户信息
- router.route("/selectUserSzdjg").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectUserSzdjg", json["username"]);
- });
- //新增英语写作批改
- router.route("/addEngC").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "insertEngCorrect", json["cid"], json["s"], json["t"], json["tool"], json["wid"], json["c"], json["w"]);
- });
- //查询英语写作批改
- router.route("/selectEngC").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectEngCorrect", json["workid"]);
- });
- //查询英语写作作业
- router.route("/selectEngWork").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectEngWork", json["wid"]);
- });
- //新增或修改英语写作评价
- router.route("/addEngEva").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "addEngEva", json["id"], json["aic"], json["tc"]);
- });
- //查询分类及所有子分类
- router.route("/selectAllType").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectAllType", json["org"], json["oid"]);
- });
- //查询分类及所有子分类
- router.route("/selectAllTrainType").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectAllTrainType", json["org"], json["oid"]);
- });
- //查询分类及所有子分类
- router.route("/selectAllTypeS").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectAllTypeS", json["org"], json["oid"]);
- });
- //查询分类及所有子分类
- router.route("/selectAllTypeT").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectAllTypeT", json["org"], json["oid"]);
- });
- //查询分类及子分类
- router.route("/selectType").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectType");
- });
- //查询分类及子分类
- router.route("/selectStudentType").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectStudentType");
- });
- //查询赛事分类及子分类
- router.route("/selectMatType").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectMatType");
- });
- //根据学校查询分类
- router.route("/selectPtype").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectPtype", json["page"], 10);
- });
- //根据学校查询学生项目分类
- router.route("/selectSPtype").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectSPtype", json["page"], 10);
- });
- //根据学校查询分类1
- router.route("/selectPtype1").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectPtype1", json["oid"], json["page"], 10);
- });
- //添加分类
- router.route("/addPtype").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "addPtype", json["n"], json["uid"], json["oid"]);
- });
- //修改分类
- router.route("/updatePtype").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "updatePtype", json["n"], json["tid"]);
- });
- //修改学生项目分类
- router.route("/updateSPtype").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "updateSPtype", json["n"], json["tid"]);
- });
- //删除1分类
- router.route("/deletePtype").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deletePtype", json["tid"]);
- });
- //删除1学生项目分类
- router.route("/deleteSPtype").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteSPtype", json["tid"]);
- });
- //查询子分类列表
- router.route("/selectStype").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectStype", json["pid"], json["oid"], json["page"], 10);
- });
- //查询学生项目子分类列表
- router.route("/selectSStype").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectSStype",
- json["pid"],
- json["oid"],
- json["page"],
- 10
- );
- });
- //添加子分类
- router.route("/addStype").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "addStype",
- json["pid"],
- json["n"],
- json["uid"],
- json["oid"]
- );
- });
- //添加学生项目子分类
- router.route("/addSStype").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "addSStype",
- json["pid"],
- json["n"],
- json["uid"],
- json["oid"]
- );
- });
- //根据学校查询工作分类
- router.route("/selectStudioPtype").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectStudioPtype", json["page"], 10);
- });
- //查询工作室项目子分类列表
- router.route("/selectStudioStype").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectStudioStype",
- json["pid"],
- json["oid"],
- json["page"],
- 10
- );
- });
- //添加工作室项目子分类
- router.route("/addStudioStype").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "addStudioStype",
- json["pid"],
- json["n"],
- json["uid"],
- json["oid"]
- );
- });
- //修改工作项目分类
- router.route("/updateStudioPtype").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "updateStudioPtype", json["n"], json["tid"]);
- });
- //删除1工作项目分类
- router.route("/deleteStudioPtype").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteStudioPtype", json["tid"]);
- });
- //查看本校所有学生(分页)
- router.route("/selectAllStudent").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectAllStudent",
- json["oid"],
- json["cn"],
- json["cid"],
- json["page"],
- 10
- );
- });
- //根据学校id查询子分类
- router.route("/selectTypeByOid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectTypeByOid", json["oid"]);
- });
- //根据学校id查询子分类
- router.route("/selectTypeByOrg").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectTypeByOid", json["oid"]);
- });
- //根据组织id查询子分类
- router.route("/selectStudentTypeByOid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectStudentTypeByOid", json["oid"]);
- });
- //更加父id查询分类
- router.route("/selectTypeByPid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectTypeByPid", json["pid"]);
- });
- //点击工具计数
- router.route("/insertToolsCount").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "insertToolsCount",
- json["cid"],
- json["chid"],
- json["uid"],
- json["tid"],
- json["count"]
- );
- });
- //修改工具次数
- router.route("/updateToolsCount").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "updateToolsCount",
- json["cid"],
- json["chid"],
- json["uid"],
- json["tid"],
- json["count"]
- );
- });
- //查询工具次数
- router.route("/selectToolsCount").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectToolsCount",
- json["cid"],
- json["chid"],
- json["uid"]
- );
- });
- //导出学生
- router.route("/selectUserBySchool").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectUserBySchool", json["oid"]);
- });
- //上传学生作业
- router.route("/insertSWork").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "insertSWork",
- json["uid"],
- json["cid"],
- json["p"],
- json["t"],
- json["upload"]
- );
- });
- //查询学生作业
- router.route("/selectSWork").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectSWork",
- json["uid"],
- json["cid"],
- json["p"],
- json["type"]
- );
- });
- //课程进展数据
- router.route("/selectCase").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectCase", json["org"]);
- });
- //课程进展数据
- router.route("/selectCase2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectCase2", json["org"]);
- });
- //课程进展数据
- router.route("/selectCase3").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectCase3",
- json["org"],
- json["oid"],
- json["page"],
- json["pageSize"]
- );
- });
- //项目进展数据
- router.route("/selectCaseS").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectCaseS", json["org"], json["oid"]);
- });
- //项目进展数据
- router.route("/selectCaseS2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectCaseS2",
- json["org"],
- json["oid"],
- json["type"],
- json["page"],
- json["pageSize"]
- );
- });
- //查询赛事项目列表
- router.route("/selectRaceList").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectRaceList", json["uid"], json["t"]);
- });
- //修改赛事状态
- router.route("/updateRaceState").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "updateRaceState", json["id"], json["s"]);
- });
- //查询赛事项目详情
- router.route("/selectRaceDetail").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectRaceDetail", json["id"]);
- });
- //race 查询学校
- router.route("/getSchool").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getSchool", json["n"]);
- });
- //查询我的学习报告
- router.route("/selectMrEva").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectMrEva", json["uid"], json["oid"], json["cid"]);
- });
- //查询行为数据库
- router.route("/selectModelList").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectModelList", json["cn"], json["oid"]);
- });
- //lsc
- //admin 查询学校
- router.route("/getSchoolAdmin").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_school", json["page"], 10);
- });
- //admin 添加学校
- router.route("/addSchoolAdmin").all((req, res, next) => {
- postmysql(req, res, "add_school");
- });
- //组织添加学校
- router.route("/addSchoolOrg").all((req, res, next) => {
- postmysql(req, res, "addSchoolOrg");
- });
- //教师端组织添加学校
- router.route("/insertSchoolByOrg").all((req, res, next) => {
- postmysql(req, res, "insertSchoolByOrg");
- });
- //admin 删除学校
- router.route("/deleteSchoolAdmin").all((req, res, next) => {
- postmysql(req, res, "delete_school");
- });
- //admin 查询班级
- router.route("/getClassAdmin").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_classAdmin", json["cn"], json["page"], 10);
- });
- //admin 添加班级
- router.route("/addClassAdmin").all((req, res, next) => {
- postmysql(req, res, "add_classAdmin");
- });
- //admin 查询班级是否重复
- router.route("/getClassRepeat").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_classRepeatAdmin", json["n"], json["oid"]);
- });
- //查询未在此班级的学生
- router.route("/getClassStudent").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "getClassStudent",
- json["cid"],
- json["oid"],
- json["cn"],
- json["page"],
- json["num"]
- );
- });
- //查询未在此教研室的老师
- router.route("/getClassTeacher").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "getClassTeacher",
- json["cid"],
- json["oid"],
- json["cn"],
- json["page"],
- json["num"]
- );
- });
- //查询未在此年级的班级
- router.route("/getGradeClass").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "getGradeClass",
- json["cid"],
- json["oid"],
- json["cn"],
- json["page"],
- json["num"]
- );
- });
- //添加学生到班级
- router.route("/addClassStudent").all((req, res, next) => {
- let cid = req.body[0].cid;
- let student = JSON.parse(decodeURIComponent(req.body[0].student));
- for (let i = 0; i < student.length; i++) {
- let _userdata = [student[i]];
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
- mysql.usselect(_userdata, function(ret) {
- let classid = ret[0][0].classid;
- if (!classid || classid.indexOf(cid) == -1) {
- classid = classid ? classid.split(",") : [];
- classid.push(cid);
- let _userdata2 = [student[i], classid.join(",")];
- _userdata2.unshift(
- _mysqlLabor[0],
- _mysqlLabor[1],
- "updateStudentClass"
- );
- mysql.usselect(_userdata2, function(ret) {
- if (i == student.length - 1) {
- res.end(JSON.stringify({ success: 1 }));
- }
- });
- }
- });
- }
- });
- //添加老师到教研室
- router.route("/addClassTeacher").all((req, res, next) => {
- let cid = req.body[0].cid;
- let student = JSON.parse(decodeURIComponent(req.body[0].student));
- for (let i = 0; i < student.length; i++) {
- let _userdata = [student[i]];
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
- mysql.usselect(_userdata, function(ret) {
- let classid = ret[0][0].cclassid;
- if (!classid || classid.indexOf(cid) == -1) {
- classid = classid ? classid.split(",") : [];
- classid.push(cid);
- let _userdata2 = [student[i], classid.join(",")];
- _userdata2.unshift(
- _mysqlLabor[0],
- _mysqlLabor[1],
- "updateTeacherClass"
- );
- mysql.usselect(_userdata2, function(ret) {
- if (i == student.length - 1) {
- res.end(JSON.stringify({ success: 1 }));
- }
- });
- }
- });
- }
- });
- //添加班级到年级
- router.route("/addGradeClass").all((req, res, next) => {
- let cid = req.body[0].cid;
- let student = JSON.parse(decodeURIComponent(req.body[0].student));
- for (let i = 0; i < student.length; i++) {
- let _userdata = [cid, student[i]];
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "addGradeClass");
- mysql.usselect(_userdata, function(ret) {
- if (i == student.length - 1) {
- res.end(JSON.stringify({ success: 1 }));
- }
- });
- }
- });
- //移除学生此班级
- router.route("/deleteClassStudent").all((req, res, next) => {
- let cid = req.body[0].cid;
- let student = req.body[0].uid;
- let _userdata = [student];
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
- mysql.usselect(_userdata, function(ret) {
- let classid = ret[0][0].classid;
- if (classid.indexOf(cid) != -1) {
- classid = classid.split(",");
- classid.splice(classid.indexOf(cid), 1);
- let _userdata2 = [student, classid.join(",")];
- _userdata2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentClass");
- mysql.usselect(_userdata2, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- });
- //移除学生此班级
- router.route("/deleteClassTeacher").all((req, res, next) => {
- let cid = req.body[0].cid;
- let student = req.body[0].uid;
- let _userdata = [student];
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
- mysql.usselect(_userdata, function(ret) {
- let classid = ret[0][0].cclassid;
- if (classid.indexOf(cid) != -1) {
- classid = classid.split(",");
- classid.splice(classid.indexOf(cid), 1);
- let _userdata2 = [student, classid.join(",")];
- _userdata2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTeacherClass");
- mysql.usselect(_userdata2, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- });
- //移除班级
- router.route("/deleteGradeClass").all((req, res, next) => {
- let cid = req.body[0].cid;
- let student = req.body[0].uid;
- let _userdata = ['', student];
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "addGradeClass");
- mysql.usselect(_userdata, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- });
- //admin 发布通知
- router.route("/addNews").all((req, res, next) => {
- postmysql(req, res, "add_news");
- });
- //admin 删除通知
- router.route("/deleteNews").all((req, res, next) => {
- postmysql(req, res, "delete_news");
- });
- //admin 添加banner
- router.route("/addBanner").all((req, res, next) => {
- postmysql(req, res, "add_banner");
- });
- //admin 添加banner
- router.route("/deleteBanner").all((req, res, next) => {
- postmysql(req, res, "delete_banner");
- });
- //admin 查询banner
- router.route("/getBanner").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_banner");
- });
- //根据学校查询banner
- router.route("/selectBannerByOid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectBannerByOid", json["oid"]);
- });
- //admin 查询banner
- router.route("/getBannerS").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getBannerS");
- });
- //根据学校查询banner
- router.route("/selectBannerByOidS").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectBannerByOidS", json["oid"]);
- });
- //admin 查询课程getSearchCourse
- router.route("/getSearchCourse").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectAll_courseSearch", json["t"]);
- });
- //根据学校查询课程
- router.route("/getSearchCourseByoid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectAll_courseByOid", json["t"], json["oid"]);
- });
- //admin 查询所有课程专区
- router.route("/getZone").all((req, res, next) => {
- getmysql(req, res, "select_zone");
- });
- //admin 添加课程专区
- router.route("/addZone").all((req, res, next) => {
- postmysql(req, res, "insert_classZone");
- });
- //评审
- router.route("/reviewCourse").all((req, res, next) => {
- postmysql(req, res, "reviewCourse");
- });
- //查询评审
- router.route("/getReview").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getReview", json["cid"]);
- });
- //查询所有课程专区下的课程
- router.route("/getZoneClass").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "select_zoneClass",
- json["bid"],
- json["oid"],
- json["page"],
- 10
- );
- });
- //查询所有课程专区下的课程
- router.route("/getZoneClass").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "select_zoneClass",
- json["bid"],
- json["oid"],
- json["page"],
- 10
- );
- });
- //查询所有课程专区下的课程
- router.route("/getZoneClassStudent").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "select_zoneClass",
- json["bid"],
- json["oid"],
- json["page"],
- 20
- );
- });
- //admin 后台查看专区下课程的数量
- router.route("/getZoneClassNum").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_zoneClassNum", json["bid"]);
- });
- //admin 后台添加课程专区时查看课程是否在此专区重复
- router.route("/getZoneClassRepeat").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_zoneClassRepeat", json["pid"], json["cid"]);
- });
- //把课程添加进专区
- router.route("/addZoneCourse").all((req, res, next) => {
- postmysql(req, res, "insert_app");
- });
- //admin 删除课程专区底下的课程
- router.route("/deleteZoneCourse").all((req, res, next) => {
- postmysql(req, res, "delete_app");
- });
- //admin 删除班级
- router.route("/deleteZone").all((req, res, next) => {
- postmysql(req, res, "delete_zone");
- });
- //admin 后台专区上移下移
- router.route("/zoneRank").all((req, res, next) => {
- postmysql(req, res, "update_classRank");
- });
- //admin 添加模板文档
- router.route("/addTemplateAdmin").all((req, res, next) => {
- postmysql(req, res, "add_template");
- });
- //admin 添加模板文档
- router.route("/deleteTemplateAdmin").all((req, res, next) => {
- postmysql(req, res, "delete_template");
- });
- //admin 查询模板文档
- router.route("/getTemplateAdmin").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_template", json["page"], 10);
- });
- //查询上传作业
- router.route("/getCourseWorks").all((req, res, next) => {
- var json = queryString(req.url); //cid 课程id,page 页数
- getmysql(
- req,
- res,
- "select_courseWorks",
- json["cid"],
- json["stage"],
- json["task"],
- json["page"],
- 10
- );
- });
- //查询上传作业
- router.route("/getCourseWorks2").all((req, res, next) => {
- var json = queryString(req.url); //cid 课程id,page 页数
- getmysql(
- req,
- res,
- "select_courseWorks2",
- json["cid"],
- json["uname"],
- json["stage"],
- json["task"],
- json["page"],
- 10
- );
- });
- //查询上传作业
- router.route("/getCourseWorks3").all((req, res, next) => {
- var json = queryString(req.url); //cid 课程id,page 页数
- getmysql(
- req,
- res,
- "select_courseWorks3",
- json["cid"],
- json["uname"],
- json["stage"],
- json["task"],
- json["page"],
- 10
- );
- });
- //查询上传作业--加上筛选班级
- router.route("/getCourseWorks5").all((req, res, next) => {
- var json = queryString(req.url); //cid 课程id,page 页数
- getmysql(
- req,
- res,
- "select_courseWorks5",
- json["cid"],
- json["uname"],
- json["choseClass"],
- json["stage"],
- json["task"],
- json["page"],
- 10
- );
- });
- //查询所有学生上传作业--加上筛选班级
- router.route("/getCourseWorks6").all((req, res, next) => {
- var json = queryString(req.url); //cid 课程id,page 页数
- getmysql(
- req,
- res,
- "select_courseWorks6",
- json["cid"],
- json["uname"],
- json['choseClass'],
- json["stage"],
- json["task"]
- );
- });
- //查询所有学生上传作业
- router.route("/getCourseWorks4").all((req, res, next) => {
- var json = queryString(req.url); //cid 课程id,page 页数
- getmysql(
- req,
- res,
- "select_courseWorks4",
- json["cid"],
- json["uname"],
- json["stage"],
- json["task"]
- );
- });
- //查询学生课程作业
- router.route("/selectStudentCourseWorks").all((req, res, next) => {
- var json = queryString(req.url); //cid 课程id,page 页数
- getmysql(
- req,
- res,
- "selectStudentCourseWorks",
- json["uid"],
- json["cid"],
- json["stage"],
- json["task"],
- json["page"],
- 10
- );
- });
- //查询报告数据
- router.route("/getCourseWorksReport").all((req, res, next) => {
- var json = queryString(req.url); //cid 课程id,page 页数
- getmysql(req, res, "getCourseWorksReport", json["cid"]);
- });
- //查询报告数据--根据班级
- router.route("/getCourseWorksReport2").all((req, res, next) => {
- var json = queryString(req.url); //cid 课程id,page 页数
- getmysql(req, res, "getCourseWorksReport2", json["cid"],json["choseClass"]);
- });
- //查询多个课程报告数据
- router.route("/getCourseWorksReportMore").all((req, res, next) => {
- var json = queryString(req.url); //cid 课程id,page 页数
- getmysql(req, res, "getCourseWorksReportMore", json["cid"]);
- });
- //查询学生课程报告数据
- router.route("/getStudentCourseWorksReport").all((req, res, next) => {
- var json = queryString(req.url); //cid 课程id,page 页数
- getmysql(req, res, "getStudentCourseWorksReport", json["uid"]);
- });
- //admin 添加项目模板文档
- router.route("/addCourseTemplateAdmin").all((req, res, next) => {
- postmysql(req, res, "add_courseTemplate");
- });
- //admin 添加项目模板文档
- router.route("/deleteCourseTemplateAdmin").all((req, res, next) => {
- postmysql(req, res, "delete_courseTemplate");
- });
- //admin 查询项目模板文档
- router.route("/getCourseTemplateAdmin").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_courseTemplate", json["page"], 10);
- });
- //teacher 查询项目模板
- router.route("/getCourseTemplateT").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_courseTemplateT");
- });
- //teacher 查询项目模板
- router.route("/getTrainCourseTemplateT").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getTrainCourseTemplateT");
- });
- //teacher 查询项目模板
- router.route("/getCourseTemplateTByOid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getCourseTemplateTByOid", json["oid"]);
- });
- //teacher 查询项目模板
- router.route("/getTrainCourseTemplateTByOid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getTrainCourseTemplateTByOid", json["oid"]);
- });
- //目标管理查询目标模板
- router.route("/selectEvaTemplate").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_evaTemplate", json["oid"]);
- });
- //目标管理新增目标模板
- router.route("/addEvaTemplate").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "add_evaTemplate", json["t"], json["c"], json["uid"], json["oid"]);
- });
- //teacher 查询项目模板
- router.route("/getCourseTemplateTs").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getCourseTemplateTs", json["oid"]);
- });
- //teacher 查询项目模板
- router.route("/getCourseTemplateTStudio").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getCourseTemplateTStudio", json["oid"]);
- });
- //admin 查询课程
- router.route("/getCourseAdmin").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_courseAdmin", json["cn"], json["page"], 10);
- });
- //admin 查询模板文档
- router.route("/deleteCourseAdmin").all((req, res, next) => {
- postmysql(req, res, "delete_courseAdmin");
- });
- //设置分组
- router.route("/setCourseGroup").all((req, res, next) => {
- postmysql(req, res, "setCourseGroup");
- });
- //删除分组
- router.route("/deleteCourseGroup").all((req, res, next) => {
- postmysql(req, res, "deleteCourseGroup");
- });
- //获取分组
- router.route("/getCourseGroup").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getCourseGroup", json["cid"], json["classid"]);
- });
- //获取分组
- router.route("/getCourseGroup2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getCourseGroup2", json["cid"], json["classid"]);
- });
- //加入分组
- router.route("/joinCourseGroup").all((req, res, next) => {
- postmysql(req, res, "joinCourseGroup");
- });
- //退出分组
- router.route("/exitCourseGroup").all((req, res, next) => {
- postmysql(req, res, "exitCourseGroup");
- });
- //加入分组
- router.route("/joinGroup").all((req, res, next) => {
- postmysql(req, res, "joinGroup");
- });
- //退出分组
- router.route("/exitGroup").all((req, res, next) => {
- postmysql(req, res, "exitGroup");
- });
- //查看分组
- router.route("/selectGroup").all((req, res, next) => {
- postmysql(req, res, "selectGroup");
- });
- //查询ppt在哪页
- router.route("/selectPptPage").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectPptPage", json["id"]);
- });
- //修改ppt页码
- router.route("/updatePptPage").all((req, res, next) => {
- postmysql(req, res, "updatePptPage");
- });
- //修改ppt操作
- router.route("/updatePPTHandle").all((req, res, next) => {
- postmysql(req, res, "updatePPTHandle");
- });
- //查询实时课堂
- router.route("/getRealTimeClass").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "getRealTimeClass",
- json["cn"],
- json["uid"],
- json["page"],
- 10
- );
- });
- //查询实时课堂学生
- router.route("/getRealTimeClassStu").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "getRealTimeClassStu",
- json["oid"],
- json["cid"],
- json["page"],
- 10
- );
- });
- //查询实时课堂学生
- router.route("/getRealTimeClassById").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getRealTimeClassById", json["id"]);
- });
- //根据区级管理者查询案例
- router.route("/selectAnliList").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectAnliList",
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typeE"],
- json["cn"],
- json["cid"],
- json["title"],
- json["page"],
- 10
- );
- });
- //根据市级管理者查询案例
- router.route("/selectAnliList1").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectAnliList1",
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typeE"],
- json["cn"],
- json["cid"],
- json["title"],
- json["page"],
- 10
- );
- });
- //根据省级级管理者查询案例
- router.route("/selectAnliList2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectAnliList2",
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typeE"],
- json["cn"],
- json["cid"],
- json["title"],
- json["page"],
- 10
- );
- });
- //删除1案例
- router.route("/deleteAnli").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteAnli", json["id"]);
- });
- //根据区县管理者查询评分
- router.route("/selectPoint").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectPoint",
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typeE"],
- json["cn"],
- json["cid"],
- json["title"],
- json["page"],
- 10
- );
- });
- //根据市级管理者查询评分
- router.route("/selectPoint1").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectPoint1",
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typeE"],
- json["cn"],
- json["cid"],
- json["title"],
- json["page"],
- 10
- );
- });
- //根据市级管理者查询全部评分
- router.route("/selectPointAll").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectPointAll",
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typeE"],
- json["cn"],
- json["cid"],
- json["title"]
- );
- });
- //查询分配案例
- router.route("/selectCaseUser").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_case", json["uid"]);
- });
- //根据用户id,课程id,阶段,任务,工具去查询协同
- router.route("/selectWord").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectWord",
- json["uid"],
- json["cid"],
- json["s"],
- json["task"],
- json["t"]
- );
- });
- //根据用户id,课程id,阶段,任务,工具去查询协同
- router.route("/selectWord2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectWord2",
- json["uid"],
- json["cid"],
- json["s"],
- json["task"],
- json["t"],
- json["type"]
- );
- });
- //根据用户id,课程id,阶段,任务,工具去查询协同
- router.route("/selectWords").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectWords",
- json["uid"],
- json["cid"],
- json["s"],
- json["task"],
- json["t"],
- json["type"]
- );
- });
- //根据用户id,课程id,阶段,任务,工具去查询协同
- router.route("/selectWordsY").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectWordsY",
- json["uid"],
- json["cid"],
- json["s"],
- json["task"],
- json["t"],
- json["type"]
- );
- });
- //新增协同内容
- router.route("/insertWord2y").all((req, res, next) => {
- var json = queryString(req.url);
- // getmysql(req, res, "insertWord2y", json["uid"], json["cid"], json["s"], json["task"], json["t"], json["text"], json["type"]);
- postmysql3(req, res, "insertWord2y");
- });
- //新增协同内容
- router.route("/insertWord").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "insertWord",
- json["uid"],
- json["cid"],
- json["s"],
- json["task"],
- json["t"],
- json["text"]
- );
- });
- //分配案例
- router.route("/insertCase").all((req, res, next) => {
- if (req.body[0]) {
- p = [req.body[0].uid, req.body[0].box];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insertCase"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- //新增评分
- router.route("/addScore").all((req, res, next) => {
- postmysql(req, res, "addScore");
- });
- //添加用户标签
- router.route("/add_userlabel").all((req, res, next) => {
- postmysql2(req, res, "add_userlabel");
- });
- //查询评分
- router.route("/selectScore").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectScore", json["rid"], json["suser"]);
- });
- //查询所有评分
- router.route("/selectAllScore").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectAllScore");
- });
- //查询所有学校以及组织
- router.route("/selectAllSchool").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectAllSchool");
- });
- //根据用户id查询评分
- router.route("/selectScoreByUid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectScoreByUid", json["uid"]);
- });
- //查询单个案例所有评分
- router.route("/selectAnliScore").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectAnliScore", json["rid"]);
- });
- //赛事推荐
- router.route("/updateRaceRec").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "updateRaceRec", json["id"], json["rec"]);
- });
- //查询数据报告学生报告列表
- router.route("/selectSr").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectSr",
- json["cu"],
- json["cn"],
- json["oid"],
- json["page"],
- 10
- );
- });
- //查询数据报告班级报告列表
- router.route("/selectCr").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectCr",
- json["cu"],
- json["cn"],
- json["oid"],
- json["page"],
- 10
- );
- });
- //查询数据报告查看班级报告底下学生列表
- router.route("/selectCStudent").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectCStudent", json["cid"], json["courseid"]);
- });
- //查询数据报告课程报告列表
- router.route("/selectCourseR").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectCourseR",
- json["cu"],
- json["cn"],
- json["cl"],
- json["oid"],
- json["page"],
- 10
- );
- });
- //根据学校id查询学校底下有评价的课程
- router.route("/selectCourseByOid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectCourseByOid", json["oid"]);
- });
- //根据目标id和班级id查询底下有作业的课程
- router.route("/selectEvaCourse").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectEvaCourse", json["eid"], json["cid"]);
- });
- //teacher 查询模板
- router.route("/getTemplateT").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_templateT");
- });
- //思维网格 创建房间
- router.route("/insertRoom").all((req, res, next) => {
- postmysql(req, res, "insertRoom");
- });
- //删除作业阶段任务工具
- router.route("/deleteStudentToolSTT").all((req, res, next) => {
- postmysql(req, res, "deleteStudentToolSTT");
- });
- //删除作业阶段任务
- router.route("/deleteStudentToolST").all((req, res, next) => {
- postmysql(req, res, "deleteStudentToolST");
- });
- //删除作业阶段
- router.route("/deleteStudentToolS").all((req, res, next) => {
- postmysql(req, res, "deleteStudentToolST");
- });
- //协同编辑 创建房间
- router.route("/insertRoomByFile").all((req, res, next) => {
- //var json = queryString(req.url);
- postmysql2(req, res, "insertRoomByFile");
- //getmysql(req, res, "insertRoomByFile", json["uid"], json["n"], json["d"]);
- });
- //思维网格 查询是否是重复房间号
- router.route("/checkRoomNum").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "checkRoomNum", json["num"]);
- });
- //思维网格 查询房间列表
- router.route("/selectRoomList").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectRoomList",
- json["uid"],
- json["oid"],
- json["cid"],
- json["cu"],
- json["cn"]
- );
- });
- //查询pdf列表
- router.route("/selectRTC").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectRTC", json["uid"], json["cu"], json["cn"]);
- });
- //协同文档 查询房间列表
- router.route("/selectFileList").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectFileList",
- json["uid"],
- json["oid"],
- json["cid"],
- json["cu"],
- json["cn"]
- );
- });
- //协同编辑 查询是否是重复房间号
- router.route("/checkRoomNumByFile").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "checkRoomNumByFile", json["num"]);
- });
- //思维网格 根据房间号或者用户id查询房间信息
- router.route("/selectRoom").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectRoom", json["uid"]);
- });
- //思维网格 根据房间号或者用户id查询房间信息
- router.route("/getRoom").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_room", json["fid"]);
- });
- //协同编辑 根据房间号或者用户id查询房间信息
- router.route("/selectRoomByFile").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectRoomByFile", json["uid"]);
- });
- //思维网格 修改房间数据
- router.route("/updateRoomData").all((req, res, next) => {
- postmysql(req, res, "updateRoomData");
- });
- router.route("/updateFileData").all((req, res, next) => {
- var json = queryString(req.url);
- var json2 = json["mode"].split(",");
- getmysql(req, res, "updateFileData", json2[0], json2[1]);
- });
- router.route("/select_file").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "select_file", json["fid"]);
- });
- //思维网格 解散房间
- router.route("/dismiss").all((req, res, next) => {
- postmysql(req, res, "update_room");
- });
- //提交提问
- router.route("/addProblem").all((req, res, next) => {
- postmysql(req, res, "add_problem");
- //cid 课程id,chid 章节id,t 提问内容,uid 用户id
- });
- //查询提交的提问
- router.route("/getProblem").all((req, res, next) => {
- var json = queryString(req.url); //cid 课程id,page 页数
- getmysql(req, res, "select_problem", json["cid"], json["page"], 10);
- });
- //获取用户基本信息
- router.route("/getUserInfo").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getUserInfo", json["uid"], json["cid"]);
- });
- //获取用户多个课程基本信息
- router.route("/getUserInfoMore").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getUserInfoMore", json["uid"], json["cid"]);
- });
- //获取多个用户单个课程基本信息
- router.route("/getClassUserInfoMore").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getClassUserInfoMore", json["uid"], json["cid"]);
- });
- //获取课程下所有有作业的学生id
- router.route("/selectCourseSuid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectCourseSuid", json["cid"], json["courseid"]);
- });
- //获取项目基本信息
- router.route("/getCourseInfo").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getCourseInfo", json["cid"]);
- });
- //课程中心 总评添加和修改功能
- router.route("/opCourseScore").all((req, res, next) => {
- postmysql(req, res, "opCourseScore");
- });
- //查询已评价功能
- router.route("/getCourseScoreP").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getCourseScoreP", json["cid"], json["uid"]);
- });
- //查询所有已评价功能
- router.route("/getCourseScore").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getCourseScore", json["cid"]);
- });
- //获取多个项目基本信息
- router.route("/getCourseInfoMore").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getCourseInfoMore", json["cid"]);
- });
- //获取用户基本信息
- router.route("/getAllUserById").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getAllUserById", json["uid"]);
- });
- //作业生成报告
- router.route("/getWorkData").all((req, res, next) => {
- var json = queryString(req.url); //cid 课程id,page 页数
- getmysql(req, res, "select_work_data", json["cid"]);
- });
- //查询评价体系
- router.route("/getEvaluation").all((req, res, next) => {
- var json = queryString(req.url); //cid 课程id,page 页数
- getmysql(
- req,
- res,
- "select_evaluation",
- json["oid"],
- json["n"],
- json["page"],
- 10
- );
- });
- //添加评价体系
- router.route("/addEvaluation").all((req, res, next) => {
- postmysql(req, res, "add_evaluation");
- //uid 用户id t标题 c内容
- });
- //修改评价体系
- router.route("/updateEvaluation").all((req, res, next) => {
- postmysql(req, res, "update_evaluation");
- //c内容 t标题 id评价id
- });
- //删除评价体系
- router.route("/deleteEvaluation").all((req, res, next) => {
- postmysql(req, res, "delete_evaluation");
- // id评价id
- });
- //删除评价体系前查询课程是否有该评价
- router.route("/selectCourseEva").all((req, res, next) => {
- var json = queryString(req.url); //cid 课程id,page 页数
- getmysql(
- req,
- res,
- "select_course_eva",
- json["eid"],
- );
- });
- //批量添加学校
- router.route("/batchRegistrationSchool").post(function(req, res, next) {
- let users = req.body[0];
- let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
- for (let i = 0; i < arr.length; i++) {
- let _school = encodeURIComponent(arr[i].school);
- let _org = users.org;
- //用戶數據
- let _data = [_school, _org, "", "1", ""];
- //參數拼接,註冊
- _data.unshift(_mysqlLabor[0], _mysqlLabor[1], "insertSchoolByOrg");
- //用戶註冊處理
- mysql.usselect(_data, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- //批量添加学生
- router.route("/batchRegistrationMore").post(function(req, res, next) {
- let users = req.body[0];
- let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
- for (let i = 0; i < arr.length; i++) {
- let _username = encodeURIComponent(arr[i].name);
- let _mail = encodeURIComponent(arr[i].mail)
- let _password = users.password || "123456";
- let _alias = encodeURIComponent(arr[i].name)
- let _oid = users.oid;
- let _ph = encodeURIComponent(arr[i].phone ? arr[i].phone : "")
- let _class = encodeURIComponent(arr[i].class)
- let _sId = encodeURIComponent(arr[i].sId)
- //加密密碼
- _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
- //生成激活碼
- let _hashstr = new Date().getTime() + "";
- let _digest = crypto
- .createHash("sha256")
- .update(_hashstr, "utf8")
- .digest("hex");
- //用戶數據
- let _userdata = [
- _mail,
- _password,
- _alias,
- "",
- 1, //0老师 1学生
- _username,
- "",
- generateAPIKey(_username),
- _digest,
- "",
- _username,
- _sId,
- 2, //1老师 2学生
- _oid,
- _ph,
- _class,
- "",
- "0",
- ];
- //參數拼接,註冊
- _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregister");
- //用戶註冊處理
- mysql.usselect(_userdata, function(ret) {
- // let _pbluserdata = [
- // ret[1][0].uid,
- // _username,
- // _sId,
- // 2,
- // _oid,
- // _ph,
- // _class,
- // '',
- // "0",
- // ];
- // _pbluserdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateUserByEdu");
- // mysql.usselect(_pbluserdata, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- // });
- });
- }
- });
- //幼儿园评价
- // 获取所有班级
- router.route("/select_techerAllClass").all(function(req, res, next) {
- // let users = req.query;
- var json = queryString(req.url);
- console.log(json);
- getmysql(req, res, "select_techerAllClass", json['cid']);
- });
- // 获取所有班级学生
- router.route("/selectClassStudent").all(function(req, res, next) {
- var json = queryString(req.url);
- getmysql(req, res, "selectClassStudent", json['cid']);
- });
- // 获取学生详情
- router.route("/selectStudentDetail").all(function(req, res, next) {
- // let users = req.query;
- var json = queryString(req.url);
- console.log(json);
- getmysql(req, res, "selectStudentDetail", json['uid']);
- });
- // 获取学生记录筛选框
- router.route("/selectVeiDoo").all(function(req, res, next) {
- // let users = req.query;
- var json = queryString(req.url);
- // console.log(json);
- getmysql(req, res, "selectVeiDoo", json['oid']);
- });
- // 上传学生评价
- router.route("/insertRecord").all(function(req, res, next) {
- // console.log(req.query);
- postmysql(req, res, "insertRecord");
- });
- // 获取学生记录
- router.route("/selectRecord").all(function(req, res, next) {
- // let users = req.query;
- var json = queryString(req.url);
- // console.log(json);
- // let txt=
- getmysql(req, res, "selectRecord", json['uid'], json['trm'], json['txt']);
- });
- // 获取学生记录详情
- router.route("/selectRecordDetail").all(function(req, res, next) {
- // let users = req.query;
- var json = queryString(req.url);
- // console.log(json);
- getmysql(req, res, "selectRecordDetail", json['id']);
- });
- // 删除学生评价
- router.route("/updateRecord").all(function(req, res, next) {
- // console.log(req.query);
- postmysql(req, res, "updateRecord");
- });
- // 更新学生评价
- router.route("/updateRecordData").all(function(req, res, next) {
- // console.log(req.query);
- postmysql(req, res, "updateRecordData");
- });
- // 获取学生记录详情
- router.route("/selectSerStudent").all(function(req, res, next) {
- // let users = req.query;
- var json = queryString(req.url);
- // console.log(json);
- getmysql(req, res, "selectSerStudent", json['id'], json['txt']);
- });
- // 获取学期
- router.route("/selectTerm").all(function(req, res, next) {
- var json = queryString(req.url);
- getmysql(req, res, "selectTerm");
- });
- // 获取班级信息
- router.route("/selectManyClassStudent").all(function(req, res, next) {
- var json = queryString(req.url);
- getmysql(req, res, "selectManyClassStudent", json['cid'], json['uid']);
- });
- //幼儿园学生评价获取学生列表
- router.route("/selectStudentAndRecord").all(function(req, res, next) {
- var json = queryString(req.url);
- getmysql(req, res, "selectStudentAndRecord", json['cid'], json['cu'], json['cn'], json['oid'], json['org'], json['page'], 10);
- });
- // pbl教师端观察日记
- router.route("/selectVeidooType").all(function(req, res, next) {
- var json = queryString(req.url);
- // console.log(json);
- getmysql(req, res, "selectVeidooType", json['uid'], json['cid'], json['cu'], json['cn'], json['cm'], json['page'], 10);
- });
- //查询幼儿园分类
- router.route("/selectSTEType").all(function(req, res, next) {
- var json = queryString(req.url);
- // console.log(json);
- getmysql(req, res, "selectSTEType", json['org'], json['oid']);
- });
- //查询口语分类
- router.route("/select_englishVoiceType").all(function(req, res, next) {
- var json = queryString(req.url);
- // console.log(json);
- getmysql(req, res, "select_englishVoiceType", json['oid'], json['org']);
- });
- //查询我的口语分类
- router.route("/selectMySubTalk").all(function(req, res, next) {
- var json = queryString(req.url);
- // console.log(json);
- getmysql(req, res, "selectMySubTalk", json['userid']);
- });
- //查询学情报告雷达图数据
- router.route("/selectMapStuScore").all(function(req, res, next) {
- var json = queryString(req.url);
- // console.log(json);
- getmysql(req, res, "selectMapStuScore", json['uid'], json['year']);
- });
- //每个大分类下的关键证据
- router.route("/selectHealthRecord").all(function(req, res, next) {
- var json = queryString(req.url);
- // console.log(json);
- getmysql(req, res, "selectHealthRecord", json['uid'], json['year'], json['txt'], json['page'], 4);
- });
- //手机端 获取记录地点list
- router.route("/selectSTEPlace").all(function(req, res, next) {
- var json = queryString(req.url);
- // console.log(json);
- getmysql(req, res, "selectSTEPlace", json['org'], json['oid']);
- });
- //获取所有的记录进行下载
- router.route("/selectClassAllRecord").all(function(req, res, next) {
- var json = queryString(req.url);
- // console.log(json);
- getmysql(req, res, "selectClassAllRecord",json['cid'], json['id']);
- });
- //record页面计算班级平均分
- router.route("/selectClaAverageScore").all(function(req, res, next) {
- var json = queryString(req.url);
- // console.log(json);
- getmysql(req, res, "selectClaAverageScore", json["cu"], json["oid"], json["cn"], json["trm"], json["page"], 10);
- });
- //record页面下载班级分数数据
- router.route("/selectAllClaAvaRescore").all(function(req, res, next) {
- var json = queryString(req.url);
- // console.log(json);
- getmysql(req, res, "selectAllClaAvaRescore", json["cu"], json["oid"], json["cn"], json["trm"]);
- });
- //学情报告计算班级平均分
- router.route("/selectClaAvaScore").all(function(req, res, next) {
- var json = queryString(req.url);
- // console.log(json);
- getmysql(req, res, "selectClaAvaScore", json["cid"], json["trm"]);
- });
- // 获取教师管理table数据
- router.route("/selectOrgTeachar").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectOrgTeachar",
- json["org"],
- json["oid"],
- json["cu"],
- json["cn"],
- json["page"],
- 10
- );
- });
- // 更新老师信息数据
- router.route("/updateYTeacherInfo").all(function(req, res, next) {
- // console.log(req.query);
- postmysql(req, res, "updateYTeacherInfo");
- });
- //教师管理新增教师
- router.route("/teacherRegistration").post(function(req, res, next) {
- var users = req.body[0];
- //循环注册
- var _username = users.alias;
- var _mail = users.username;
- var _password = users.password || "123456";
- var _alias = users.alias;
- var _org = users.org;
- var _oid = users.oid;
- var _ph = users.ph;
- var _class = users.cid;
- var _sId = users.sid;
- var _typ = users.typ;
- var _rol = users.rol;
- //加密密碼
- _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
- //生成激活碼
- let _hashstr = new Date().getTime() + "";
- let _digest = crypto
- .createHash("sha256")
- .update(_hashstr, "utf8")
- .digest("hex");
- //用戶數據
- var _userdata = [
- _mail,
- _password,
- _alias,
- "",
- 0,
- _username,
- "",
- generateAPIKey(_username),
- _digest,
- "",
- _username,
- _sId,
- _typ,
- _org,
- _oid,
- _ph,
- _class,
- "",
- "0",
- _rol
- ];
- //參數拼接,註冊
- _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_teacherRegistration");
- //用戶註冊處理
- mysql.usselect(_userdata, function(ret) {
- res.end(
- JSON.stringify({
- uid: ret[1][0].uid,
- ph: _ph,
- oid: _oid,
- cid: _class,
- success: 1,
- })
- );
- });
- });
- //初始化密码
- router.route("/iniPassword").post(function(req, res, next) {
- let users = req.body[0];
- _password = users.pa;
- //加密密碼
- _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
- //用戶數據
- let _userList = [users.uid, _password];
- _userList.unshift(_mysqlLabor[0], _mysqlLabor[1], "iniPassword");
- mysql.usselect(_userList, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- });
- //批量添加教师
- router.route("/batchRegistrationMore1").post(function(req, res, next) {
- let users = req.body[0];
- let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
- for (let i = 0; i < arr.length; i++) {
- let _username = encodeURIComponent(arr[i].name)
- let _mail = encodeURIComponent(arr[i].mail)
- let _password = users.password || "123456";
- let _alias = encodeURIComponent(arr[i].name)
- let _org = users.org;
- let _oid = encodeURIComponent(arr[i].school)
- let _ph = encodeURIComponent(arr[i].phone ? arr[i].phone : "")
- let _class = encodeURIComponent(arr[i].class)
- let _sId = encodeURIComponent(arr[i].sId)
- //加密密碼
- _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
- //生成激活碼
- let _hashstr = new Date().getTime() + "";
- let _digest = crypto
- .createHash("sha256")
- .update(_hashstr, "utf8")
- .digest("hex");
- //用戶數據
- let _userdata = [
- _mail,
- _password,
- _alias,
- "",
- 0, //0老师 1学生
- _username,
- "",
- generateAPIKey(_username),
- _digest,
- "",
- _username,
- _sId,
- 1, //1老师 2学生
- _org,
- _oid,
- "",
- "",
- "",
- "0",
- ];
- //參數拼接,註冊
- _userdata.unshift(
- _mysqluser[0],
- _mysqluser[1],
- "pbl_add_batchregister_oid"
- );
- //用戶註冊處理
- mysql.usselect(_userdata, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- //赛事批量注册老师
- router.route("/pbl_add_raceuser_oid").post(function(req, res, next) {
- let users = req.body[0];
- let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
- for (let i = 0; i < arr.length; i++) {
- let _username = encodeURIComponent(arr[i].name)
- let _mail = encodeURIComponent(arr[i].mail)
- let _password = users.password || "123456";
- let _oid = encodeURIComponent(arr[i].school)
- //加密密碼
- _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
- //生成激活碼
- let _hashstr = new Date().getTime() + "";
- let _digest = crypto
- .createHash("sha256")
- .update(_hashstr, "utf8")
- .digest("hex");
- //用戶數據
- let _userdata = [
- _mail,
- _oid,
- _password,
- _username,
- 1, //1普通教师 2市级 3省级 4市级子级评委 5县区评委 6县区子级
- ];
- //參數拼接,註冊
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "pbl_add_raceuser_oid");
- //用戶註冊處理
- mysql.usselect(_userdata, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- //新增学生
- router.route("/batchRegistration").post(function(req, res, next) {
- var users = req.body[0];
- //循环注册
- var _username = users.alias;
- var _mail = users.username;
- var _password = users.password || "123456";
- var _alias = users.alias;
- var _oid = users.oid;
- var _ph = users.ph;
- var _class = users.cid;
- var _sId = users.sid;
- //加密密碼
- _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
- //生成激活碼
- let _hashstr = new Date().getTime() + "";
- let _digest = crypto
- .createHash("sha256")
- .update(_hashstr, "utf8")
- .digest("hex");
- //用戶數據
- var _userdata = [
- _mail,
- _password,
- _alias,
- "",
- 1,
- _username,
- "",
- generateAPIKey(_username),
- _digest,
- "",
- _username,
- _sId,
- 2,
- _oid,
- _ph,
- _class,
- "",
- "0",
- ];
- //參數拼接,註冊
- _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregister");
- //用戶註冊處理
- mysql.usselect(_userdata, function(ret) {
- res.end(
- JSON.stringify({
- uid: ret[1][0].uid,
- ph: _ph,
- oid: _oid,
- cid: _class,
- success: 1,
- })
- );
- });
- });
- //深圳电教馆注册
- router.route("/batchRegistrationSzdjg").post(function(req, res, next) {
- var users = Object.values(req.body)[0].split(",");
- //循环注册
- var _username = users[0]; //名字
- var _mail = users[1]; //用户名 账号
- var _password = "123456";
- var _alias = _username;
- var _org = users[2];
- var _oid = users[3];
- var _ph = users[4];
- var _class = users[5];
- var _type = users[6];
- var _openid = users[7];
- //加密密碼
- _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
- //生成激活碼
- let _hashstr = new Date().getTime() + "";
- let _digest = crypto
- .createHash("sha256")
- .update(_hashstr, "utf8")
- .digest("hex");
- //用戶數據
- var _userdata = [
- _mail,
- _password,
- _alias,
- "",
- 0,
- _username,
- _openid,
- generateAPIKey(_username),
- _digest,
- "",
- _username,
- '',
- _type,
- _org,
- _oid,
- _ph,
- _class,
- "",
- "0",
- ];
- //參數拼接,註冊
- _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregisterSzdjg");
- //用戶註冊處理
- mysql.usselect(_userdata, function(ret) {
- res.end(
- JSON.stringify({
- uid: ret[1][0].uid,
- ph: _ph,
- oid: _oid,
- cid: _class,
- success: 1,
- })
- );
- });
- });
- //新增教师
- router.route("/batchRegistration1").post(function(req, res, next) {
- var users = req.body[0];
- //循环注册
- var _username = users.alias;
- var _mail = users.username;
- var _password = users.password || "123456";
- var _alias = users.alias;
- var _org = users.org;
- var _oid = users.oid;
- var _ph = users.ph;
- var _class = users.cid;
- var _sId = users.sid;
- //加密密碼
- _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
- //生成激活碼
- let _hashstr = new Date().getTime() + "";
- let _digest = crypto
- .createHash("sha256")
- .update(_hashstr, "utf8")
- .digest("hex");
- //用戶數據
- var _userdata = [
- _mail,
- _password,
- _alias,
- "",
- 0,
- _username,
- "",
- generateAPIKey(_username),
- _digest,
- "",
- _username,
- _sId,
- 1,
- _org,
- _oid,
- _ph,
- _class,
- "",
- "0",
- ];
- //參數拼接,註冊
- _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregister1");
- //用戶註冊處理
- mysql.usselect(_userdata, function(ret) {
- res.end(
- JSON.stringify({
- uid: ret[1][0].uid,
- ph: _ph,
- oid: _oid,
- cid: _class,
- success: 1,
- })
- );
- });
- });
- router.route("/batchRegistrationOrg").post(function(req, res, next) {
- var users = req.body[0];
- //循环注册
- var _username = users.alias;
- var _mail = users.username;
- var _password = users.password || "123456";
- var _alias = users.alias;
- var _oid = users.oid;
- var _ph = users.ph;
- var _class = users.cid;
- var _sId = users.sid;
- var _org = users.org;
- //加密密碼
- _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
- //生成激活碼
- let _hashstr = new Date().getTime() + "";
- let _digest = crypto
- .createHash("sha256")
- .update(_hashstr, "utf8")
- .digest("hex");
- //用戶數據
- var _userdata = [
- _mail,
- _password,
- _alias,
- "",
- 1,
- _username,
- "",
- generateAPIKey(_username),
- _digest,
- "",
- _username,
- _sId,
- 2,
- _oid,
- _ph,
- _class,
- "",
- "0",
- _org,
- ];
- //參數拼接,註冊
- _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregister_org");
- //用戶註冊處理
- mysql.usselect(_userdata, function(ret) {
- res.end(
- JSON.stringify({
- uid: ret[1][0].uid,
- ph: _ph,
- oid: _oid,
- cid: _class,
- success: 1,
- })
- );
- });
- });
- router.route("/batchRegistrationMoreOrg").post(function(req, res, next) {
- let users = req.body[0];
- let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
- for (let i = 0; i < arr.length; i++) {
- let _username = encodeURIComponent(arr[i].name)
- let _mail = encodeURIComponent(arr[i].mail)
- let _password = users.password || "123456";
- let _alias = encodeURIComponent(arr[i].name)
- let _oid = users.oid;
- let _ph = encodeURIComponent(arr[i].phone ? arr[i].phone : "")
- let _class = encodeURIComponent(arr[i].class)
- let _sId = encodeURIComponent(arr[i].sId)
- let _org = users.org;
- //加密密碼
- _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
- //生成激活碼
- let _hashstr = new Date().getTime() + "";
- let _digest = crypto
- .createHash("sha256")
- .update(_hashstr, "utf8")
- .digest("hex");
- //用戶數據
- let _userdata = [
- _mail,
- _password,
- _alias,
- "",
- 1, //0老师 1学生
- _username,
- "",
- generateAPIKey(_username),
- _digest,
- "",
- _username,
- _sId,
- 2, //1老师 2学生
- _oid,
- _ph,
- _class,
- "",
- "0",
- _org,
- ];
- //參數拼接,註冊
- _userdata.unshift(
- _mysqluser[0],
- _mysqluser[1],
- "pbl_add_batchregister_org2"
- );
- //用戶註冊處理
- mysql.usselect(_userdata, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- //工作室管理
- router.route("/updateStudioWorkNew4").all((req, res, next) => {
- //学生
- if (req.body[0]) {
- let p = [req.body[0].cid];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_studio_course_detail2"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let _unitIndex = parseInt(req.body[0].unitIndex);
- let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
- let _unitJson = JSON.parse(ret[0][0].chapters);
- if (_unitJson.length - 1 < _unitIndex) {
- let _i = _unitIndex - (_unitJson.length - 1);
- for (let i = 0; i < _i; i++) {
- _unitJson.push({
- dyName: "", //单元标题
- chapterInfo: [{
- isread: false,
- chapterid: guid(),
- title: "",
- courseName: "",
- taskJson: [{
- task: "",
- taskDetail: "",
- chapterData: [],
- toolText: "",
- toolChoose: [{
- tool: [],
- toolDetail: "",
- toolType: 0,
- askCount: 1,
- askTitle: "",
- askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
- }, ],
- isShowTools: false,
- askCount: 1,
- isFold: 0,
- askTitle: "",
- askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
- checkJson: [{ checkCount: [], checkPerent: [] }],
- homeworkList: [],
- }, ],
- itemCount: 1,
- fileList1: [],
- video: [],
- testData: [],
- pData: [],
- templateArray: [],
- }, ],
- });
- }
- _unitJson[_unitIndex] = _chapters[_unitIndex];
- } else {
- _unitJson[_unitIndex] = _chapters[_unitIndex];
- }
- // console.log(_unitJson);
- let p2 = [
- req.body[0].cid,
- encodeURIComponent(JSON.stringify(_unitJson)),
- ];
- p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudioWorkNew4"); //執行存儲過程
- mysql.usselect(p2, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- // res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- router.route("/updateStudioWorkNew2").all((req, res, next) => {
- //学生
- if (req.body[0]) {
- p = [
- req.body[0].cid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudioWorkNew2"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = req.body[0].cid;
- let userid = req.body[0].uid;
- delStudioCourseTypeS(course, courseId, userid);
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- router.route("/addStudioCourseWorkNew2").all((req, res, next) => {
- //学生
- if (req.body[0]) {
- p = [
- req.body[0].uid,
- req.body[0].title,
- req.body[0].brief,
- req.body[0].cover,
- req.body[0].evaId,
- req.body[0].astudent,
- req.body[0].see,
- req.body[0].chapters,
- req.body[0].template,
- req.body[0].ateacher,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addStudioCourseWorkNew2"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].courseId;
- let userid = req.body[0].uid;
- delStudioCourseTypeS(course, courseId, userid);
- res.end(
- JSON.stringify({
- ordernumber: ret[0][0].ordernumber,
- courseId: ret[0][0].courseId,
- success: 1,
- })
- );
- });
- }
- });
- //teacher 查询项目模板
- router.route("/getStudioTemplateTs").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getStudioTemplateTs", json["oid"]);
- });
- //查看课程
- router.route("/select_studio_course_detail").all((req, res, next) => {
- //学生
- var json = queryString(req.url);
- getmysql(req, res, "select_studio_course_detail", json["cid"]);
- });
- //查看课程
- router.route("/select_studio_course_detail2").all((req, res, next) => {
- //学生
- var json = queryString(req.url);
- getmysql(req, res, "select_studio_course_detail2", json["cid"]);
- });
- //协同恢复删除的阶段
- router.route("/restoreStudioWork").all((req, res, next) => {
- //学生
- if (req.body[0]) {
- let p = [req.body[0].cid];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_studio_course_detail2"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let _chapid = req.body[0].chapid;
- // console.log(_chapid);
- let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
- let _unitJson = JSON.parse(ret[0][0].chapters);
- let _unitJson2 = [];
- let chpaindex;
- for (var i = 0; i < _chapters.length; i++) {
- if (_chapters[i].chapterInfo[0].chapterid == _chapid) {
- chpaindex = i;
- }
- }
- for (var i = 0; i < _unitJson.length; i++) {
- if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
- // console.log(1);
- // _unitJson.splice(i, -1)
- _unitJson2.push(_unitJson[i]);
- // break;
- }
- }
- _unitJson2.splice(chpaindex, 0, _chapters[chpaindex]);
- // console.log(_unitJson2);
- let p2 = [
- req.body[0].cid,
- JSON.stringify(_unitJson2).replaceAll(/%/g, "%25"),
- ];
- p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudioWorkNew4"); //執行存儲過程
- mysql.usselect(p2, function(ret) {
- res.end(JSON.stringify({ success: 1 }));
- });
- // res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- //查询分类及所有子分类
- router.route("/selectAllTypeStudio").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectAllTypeStudio", json["org"], json["oid"]);
- });
- //上传文件
- router.route("/addStudioCourseWorksS").all((req, res, next) => {
- postmysql(req, res, "addStudioCourseWorksS");
- });
- //删除提交的作业
- router.route("/deleteStudioCourseWorkS").all((req, res, next) => {
- postmysql(req, res, "deleteStudioCourseWorkS");
- });
- //创建新话题
- router.route("/addSubTalk").all((req, res, next) => {
- postmysql(req, res, "addSubTalk");
- });
- //创建新子分类
- router.route("/addEngVType").all((req, res, next) => {
- postmysql(req, res, "addEngVType");
- });
- router.route("/selectStudioCourseNew222").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectStudioCourseNew222",
- json["type"],
- json["uid"],
- json["oid"],
- json["org"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typef"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["page"],
- json["pageSize"]
- );
- });
- //删除1课程
- router.route("/deleteStudioCourse").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteStudioCourse", json["cid"]);
- });
- //添加分享课程数据
- router.route("/addShareCourse").post((req, res, next) => {
- var json = queryString(req.url);
- postmysql(req, res, "addShareCourse");
- });
- //获取分享课程数据
- router.route("/getShareCourse").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getShareCourse", json["cid"],json["type"]);
- });
- router.route("/delShareCourse").all((req, res, next) => {
- var json = queryString(req.url);
- postmysql(req, res, "delShareCourse");
- });
- function delStudioCourseTypeS(course, courseId, userid) {
- let _courseId = courseId;
- var _userdata = [_courseId];
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_studioCourseTypeS");
- mysql.usselect(_userdata, function(ret) {
- // console.log(ret);
- addStudioCourseTypeS(userid, course, _courseId);
- });
- // setTimeout(() => {
- // }, 1000);
- }
- function addStudioCourseTypeS(userid, course, _courseId) {
- var _uid = userid;
- var _courses = _courseId;
- var _tid = JSON.parse(decodeURIComponent(course));
- for (let i = 0; i < _tid.length; i++) {
- if (_tid[i] == "") {
- continue;
- }
- var _userdata = [_courses, _tid[i], _uid];
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_studioCourseTypeS");
- mysql.usselect(_userdata, function(ret) {
- // console.log(ret);
- });
- }
- }
- //删除作业阶段任务工具
- router.route("/deleteStudioToolSTT").all((req, res, next) => {
- postmysql(req, res, "deleteStudioToolSTT");
- });
- //删除作业阶段任务
- router.route("/deleteStudioToolST").all((req, res, next) => {
- postmysql(req, res, "deleteStudioToolST");
- });
- //删除作业阶段
- router.route("/deleteStudioToolS").all((req, res, next) => {
- postmysql(req, res, "deleteStudioToolST");
- });
- //工作管理首页查询分类
- router.route("/selectStudioCourseNew22Mode").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectStudioCourseNew22Mode",
- json["type"],
- json["uid"],
- json["oid"],
- json["org"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typef"],
- json["typeE"],
- json["cu"],
- json["cn"]
- );
- });
- //工作管理首页查询
- router.route("/selectStudioCourseNew22").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectStudioCourseNew22",
- json["type"],
- json["uid"],
- json["oid"],
- json["org"],
- json["typea"],
- json["typeb"],
- json["typec"],
- json["typed"],
- json["typef"],
- json["typeE"],
- json["cu"],
- json["cn"],
- json["page"],
- json["pageSize"]
- );
- });
- //根据学校查询banner
- router.route("/selectBannerByOidStudio").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectBannerByOidStudio", json["oid"]);
- });
- //admin 查询banner
- router.route("/getBannerStudio").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getBannerStudio");
- });
- //查询工作课程详情
- router.route("/selectStudioCourseDetail2").all((req, res, next) => {
- //学生
- var json = queryString(req.url);
- getmysql(req, res, "selectStudioCourseDetail2", json["courseId"]);
- });
- //查询工作课程详情
- router.route("/selectStudioCourseDetail3").all((req, res, next) => {
- //学生
- var json = queryString(req.url);
- getmysql(req, res, "selectStudioCourseDetail3", json["courseId"]);
- });
- //上传文件
- router.route("/addCourseWorks4studio").all((req, res, next) => {
- postmysql3(req, res, "addCourseWorks4studio");
- });
- //查询教师资源分类
- router.route("/selectAllSourceType").all((req, res, next) => {
- //学生
- var json = queryString(req.url);
- getmysql(req, res, "selectAllSourceType", json["oid"], json["org"]);
- });
- //查询资源分类
- router.route("/selectAllEvaType").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectAllEvaType", json["oid"], json["org"]);
- });
- router.route("/addSource").all((req, res, next) => {
- //添加资源
- if (req.body[0]) {
- p = [
- req.body[0].name,
- req.body[0].url,
- req.body[0].detail,
- req.body[0].label,
- req.body[0].userid,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addSource");
- //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].id;
- let userid = req.body[0].userid;
- delSourceType(course, courseId, userid);
- res.end(JSON.stringify({ id: ret[0][0].id, success: 1 }));
- // res.end(JSON.stringify(ret));
- });
- }
- });
- //删除1资源模板分类
- router.route("/deleteCETLabel").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteCETLabel", json["cid"]);
- });
- //添加资源模板分类
- router.route("/addCETLabel").all((req, res, next) => {
- postmysql(req, res, "addCETLabel");
- });
- //资源模板分享
- router.route("/addCETShare").all((req, res, next) => {
- // if (req.body[0]) {
- // p = [
- // req.body[0].uid,
- // req.body[0].n,
- // req.body[0].json,
- // req.body[0].t,
- // req.body[0].oid,
- // ];
- // p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addCETShare");
- // //執行存儲過程
- // mysql.usselect(p, function(ret) {
- // res.end(JSON.stringify({ id: ret[0][0].id, success: 1 }));
- // // res.end(JSON.stringify(ret));
- // });
- // }
- postmysql(req, res, "addCETShare");
- });
- router.route("/updateSource").all((req, res, next) => {
- //修改资源
- if (req.body[0]) {
- p = [
- req.body[0].id,
- req.body[0].name,
- req.body[0].url,
- req.body[0].detail,
- req.body[0].label,
- req.body[0].userid,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateSource");
- //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = req.body[0].id;
- let userid = req.body[0].userid;
- delSourceType(course, courseId, userid);
- res.end(JSON.stringify({ id: req.body[0].id, success: 1 }));
- // res.end(JSON.stringify(ret));
- });
- }
- });
- function delSourceType(course, courseId, userid) {
- let _courseId = courseId;
- var _userdata = [_courseId];
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_sourceType");
- mysql.usselect(_userdata, function(ret) {
- addSourceType(userid, course, _courseId);
- });
- }
- function addSourceType(userid, course, _courseId) {
- var _uid = userid;
- var _courses = _courseId;
- var _tid = JSON.parse(decodeURIComponent(course));
- for (let i = 0; i < _tid.length; i++) {
- if (_tid[i] == "") {
- continue;
- }
- var _userdata = [_courses, _tid[i], _uid];
- _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_sourceType");
- mysql.usselect(_userdata, function(ret) {
- // console.log(ret);
- });
- }
- }
- //资源查询
- router.route("/selectSource").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectSource",
- json["uid"],
- json["oid"],
- json["org"],
- json["typea"],
- json["typeb"],
- json["typeE"],
- json["cn"],
- json["page"],
- json["pageSize"]
- );
- });
- //评价资源查询
- router.route("/selectCourseEvaT").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "selectCourseEvaT",
- json["uid"],
- json["oid"],
- json["org"],
- json["typea"],
- json["typeb"],
- json["typeE"],
- json["cn"],
- json["type"],
- json["page"],
- json["pageSize"]
- );
- });
- //评价资源重命名
- router.route("/updateCourseET").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "updateCourseET",
- json["id"],
- json["n"],
- );
- });
- //删除1评价资源
- router.route("/deleteCourseET").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(
- req,
- res,
- "deleteCourseET",
- json["id"],
- );
- });
- //添加评价资源分类
- router.route("/addCETType").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "addCETType",
- json["pid"],
- json["ppid"],
- json["n"],
- json["uid"],
- json["oid"],
- );
- });
- //数据看板-综合数据
- router.route("/selectDataBoardSchool").all((req, res, next) => {
- postmysql(req, res, "selectDataBoardSchool");
- });
- //数据看板-教师数据
- router.route("/selectDataBoardTeacher").all((req, res, next) => {
- postmysql(req, res, "selectDataBoardTeacher");
- });
- //数据看板-学生数据
- router.route("/selectDataBoardStudent").all((req, res, next) => {
- postmysql(req, res, "selectDataBoardStudent");
- });
- //数据看板-课程数据
- router.route("/selectDataBoardCourse").all((req, res, next) => {
- postmysql(req, res, "selectDataBoardCourse");
- });
- //数据看板-综合数据
- router.route("/selectDataBoardSchoolNew").all((req, res, next) => {
- postmysql(req, res, "selectDataBoardSchoolNew");
- });
- //数据看板-教师数据
- router.route("/selectDataBoardTeacherNew").all((req, res, next) => {
- postmysql(req, res, "selectDataBoardTeacherNew");
- });
- //数据看板-学生数据
- router.route("/selectDataBoardStudentNew").all((req, res, next) => {
- postmysql(req, res, "selectDataBoardStudentNew");
- });
- //数据看板-课程数据
- router.route("/selectDataBoardCourseNew").all((req, res, next) => {
- postmysql(req, res, "selectDataBoardCourseNew");
- });
- //数据看板-课程数据
- router.route("/selectDataBoardStudentCourseNew").all((req, res, next) => {
- postmysql(req, res, "selectDataBoardStudentCourseNew");
- });
- //数据看板-学生排行榜
- router.route("/selectDataboardStudentRank").all((req, res, next) => {
- postmysql(req, res, "selectDataboardStudentRank");
- });
- //数据看板-教师排行榜
- router.route("/selectDataboardTeacherRank").all((req, res, next) => {
- postmysql(req, res, "selectDataboardTeacherRank");
- });
- //数据看板-评测
- router.route("/selectDataBoardTest").all((req, res, next) => {
- postmysql(req, res, "selectDataBoardTest");
- });
- //数据看板-市级数据
- router.route("/selectDataBoardCitySz").all((req, res, next) => {
- postmysql(req, res, "selectDataBoardCitySz");
- });
- //数据看板-区级数据
- router.route("/selectDataBoardAreaSz").all((req, res, next) => {
- postmysql(req, res, "selectDataBoardAreaSz");
- });
- //数据看板-综合数据
- router.route("/getDataBoardSchoolNew").all((req, res, next) => {
- let p = Object.values(req.body[0]);
- let d = Object.values(req.body[0]);
- console.log(p)
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
- mysql.usselect(p, function(ret) {
- if(!ret[0].length){
- let p2 = [d[0], d[1]];
- p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardSchoolNew');
- mysql.usselect(p2, function(ret) {
- res.end(JSON.stringify(ret));
- let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'1'];
- p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
- mysql.usselect(p3, function(ret) {})
- });
- }else{
- console.log(1);
- res.end(ret[0][0].json);
- }
- // res.end(JSON.stringify(ret));
- });
- });
- //数据看板-课程数据
- router.route("/getDataBoardCourseNew").all((req, res, next) => {
- let p = Object.values(req.body[0]);
- let d = Object.values(req.body[0]);
- console.log(p)
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
- mysql.usselect(p, function(ret) {
- if(!ret[0].length){
- let p2 = [d[0], d[1]];
- p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardCourseNew');
- mysql.usselect(p2, function(ret) {
- res.end(JSON.stringify(ret));
- let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'2'];
- p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
- mysql.usselect(p3, function(ret) {})
- });
- }else{
- console.log(1);
- res.end(ret[0][0].json);
- }
- // res.end(JSON.stringify(ret));
- });
- });
- //数据看板-项目数据
- router.route("/getDataBoardStudentCourseNew").all((req, res, next) => {
- let p = Object.values(req.body[0]);
- let d = Object.values(req.body[0]);
- console.log(p)
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
- mysql.usselect(p, function(ret) {
- if(!ret[0].length){
- let p2 = [d[0], d[1]];
- p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardStudentCourseNew');
- mysql.usselect(p2, function(ret) {
- res.end(JSON.stringify(ret));
- let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'3'];
- p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
- mysql.usselect(p3, function(ret) {})
- });
- }else{
- console.log(1);
- res.end(ret[0][0].json);
- }
- // res.end(JSON.stringify(ret));
- });
- });
- //数据看板-学生数据
- router.route("/getDataBoardStudentNew").all((req, res, next) => {
- let p = Object.values(req.body[0]);
- let d = Object.values(req.body[0]);
- console.log(p)
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
- mysql.usselect(p, function(ret) {
- if(!ret[0].length){
- let p2 = [d[0], d[1]];
- p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardStudentNew');
- mysql.usselect(p2, function(ret) {
- res.end(JSON.stringify(ret));
- let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'5'];
- p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
- mysql.usselect(p3, function(ret) {})
- });
- }else{
- console.log(1);
- res.end(ret[0][0].json);
- }
- // res.end(JSON.stringify(ret));
- });
- });
- //数据看板-教师数据
- router.route("/getDataBoardTeacherNew").all((req, res, next) => {
- let p = Object.values(req.body[0]);
- let d = Object.values(req.body[0]);
- console.log(p)
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
- mysql.usselect(p, function(ret) {
- if(!ret[0].length){
- let p2 = [d[0], d[1]];
- p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardTeacherNew');
- mysql.usselect(p2, function(ret) {
- res.end(JSON.stringify(ret));
- let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'4'];
- p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
- mysql.usselect(p3, function(ret) {})
- });
- }else{
- console.log(1);
- res.end(ret[0][0].json);
- }
- // res.end(JSON.stringify(ret));
- });
- });
- //数据看板-查询项目数据长度
- router.route("/getCourseLength").all((req, res, next) => {
- postmysql(req, res, "getCourseLength");
- });
- //评测中心-上传评测
- router.route("/addTestWorks").all((req, res, next) => {
- postmysql(req, res, "addTestWorks");
- });
- //评测中心-上传评测
- router.route("/addTestWorks2").all((req, res, next) => {
- postmysql(req, res, "addTestWorks2");
- });
- //评测中心-删除评测
- router.route("/deleteTestCourse").all((req, res, next) => {
- postmysql(req, res, "deleteTestCourse");
- });
- //评测中心-批改
- router.route("/addTestWorksTeacher").all((req, res, next) => {
- postmysql(req, res, "addTestWorksTeacher");
- });
- //评测中心-复制评测
- router.route("/copyTestWorks").all((req, res, next) => {
- postmysql(req, res, "copyTestWorks");
- });
- //评测中心-查询用户测评总览
- router.route("/selectTestUserY").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectTestUserY", json["uid"], json["oid"], json["org"]);
- });
- //查询用户学习记录总览
- router.route("/selectSRecordY").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectSRecordY", json["uid"], json["oid"], json["org"]);
- });
- //查询幼儿园全部及学校分类
- router.route("/selectSEAllType").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectSEAllType", json["oid"]);
- });
- //根据学期查询幼儿园个人评分
- router.route("/selectSETable").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectSETable", json["uid"], json["oid"], json["org"], json["cu"]);
- });
- //根据学期保存幼儿园个人评分
- router.route("/addSRScore").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "addSRScore", json["uid"], json["j"], json["t"]);
- });
- //评测中心-数据
- router.route("/testDataBoard").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "testDataBoard", json["oid"], json["org"]);
- });
- //评测中心-查询用户数据
- router.route("/selectTestUser").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectTestUser", json["uid"]);
- });
- //评测中心-获取评测提交详情
- router.route("/getTestWorks").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getTestWorks", json["cid"], json["uid"]);
- });
- //评测中心-获取评测提交详情
- router.route("/getTestWorks2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getTestWorks2", json["cid"], json["tid"]);
- });
- //评测中心-获取评测提交详情
- router.route("/selectTestCourseWorks").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectTestCourseWorks", json["cid"], json["tid"]);
- });
- //评测中心-获取评测提交详情
- router.route("/getTestWorksPage").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getTestWorksPage", json["cid"], json["page"], json["pageSize"]);
- });
- //评测中心-获取评测提交详情
- router.route("/getTestWorksPage3").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getTestWorksPage3", json["cid"], json["cn"], json["page"], json["pageSize"]);
- });
- //评测中心-获取评测提交详情
- router.route("/getTestWorksNoPage").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getTestWorksNoPage", json["cid"], json["cn"]);
- });
- //评测中心-获取评测提交详情
- router.route("/getTestWorksPage2").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getTestWorksPage2", json["cid"], json["page"], json["pageSize"]);
- });
- //评测中心-个人中心
- router.route("/getTestWorksPerson").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getTestWorksPerson", json["uid"], json["typeid"]);
- });
- //查询英语写作评价模板
- router.route("/selectEnglishEva").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectEnglishEva", json["oid"]);
- });
- //新增英语写作评价模板
- router.route("/insertEnglishEva").all((req, res, next) => {
- postmysql(req, res, "insertEnglishEva");
- });
- //获取作业数量
- router.route("/getStudentCourseWorkCount").all((req, res, next) => {
- postmysql(req, res, "getStudentCourseWorkCount");
- });
- //获取作业数量
- router.route("/getCourseWorkCount").all((req, res, next) => {
- postmysql(req, res, "getCourseWorkCount");
- });
- //根据id查询英语写作评价模板
- router.route("/selectEnglishEvaById").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectEnglishEvaById", json["id"], json["oid"]);
- });
- //根据id删除1英语写作评价模板
- router.route("/deleteEnglishEvaById").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteEnglishEvaById", json["id"]);
- });
- //获取评价模板
- router.route("/getCourseEvaTemplate").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getCourseEvaTemplate", json["oid"], json["org"], json["n"]);
- });
- //案例新项目登录接口
- router.route("/loginNewEvenManage").all((req, res, next) => {
- postmysql(req, res, "loginNewEvenManage");
- });
- //案例新项目创建用户接口
- router.route("/addNewRaceUser").all((req, res, next) => {
- postmysql(req, res, "addNewRaceUser");
- });
- //查询老师的信息
- router.route("/getRaceUser1").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getRaceUser1", json["uid"]);
- });
- //修改用户信息
- router.route("/updateRaceUser1").all((req, res, next) => {
- postmysql(req, res, "updateRaceUser1");
- });
- /* 修改评审员 */
- router.route("/updateReviewer").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(
- req,
- res,
- "updateReviewer",
- json["n"],
- json["p"],
- json["t"],
- json["s"],
- json["uid"]
- );
- });
- //race 查询学校
- router.route("/getSchool1").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getSchool1", json["n"]);
- });
- //查询赛事项目列表
- router.route("/selectRaceList1").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectRaceList1", json["uid"], json["t"], json["oid"], json["org"]);
- });
- //修改赛事状态
- router.route("/updateRaceStateGM").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "updateRaceStateGM", json["id"], json["s"]);
- });
- //删除1案例
- router.route("/deleteAnliGM").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql2(req, res, "deleteAnliGM", json["id"]);
- });
- //新增赛事项目
- router.route("/addRaceGM").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].uid,
- req.body[0].info,
- req.body[0].over,
- req.body[0].pro,
- req.body[0].act,
- req.body[0].exc,
- req.body[0].res,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addRaceGM"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = ret[0][0].id;
- let userid = req.body[0].uid;
- delCourseType1(course, courseId, userid);
- res.end(JSON.stringify({ courseId: courseId, success: 1 }));
- });
- }
- });
- //修改赛事项目
- router.route("/updateRaceGM").all((req, res, next) => {
- if (req.body[0]) {
- p = [
- req.body[0].id,
- req.body[0].info,
- req.body[0].over,
- req.body[0].pro,
- req.body[0].act,
- req.body[0].exc,
- req.body[0].res,
- ];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateRaceGM"); //執行存儲過程
- mysql.usselect(p, function(ret) {
- let course = req.body[0].courseType;
- let courseId = req.body[0].id;
- let userid = req.body[0].uid;
- delCourseType1(course, courseId, userid);
- res.end(JSON.stringify({ success: 1 }));
- });
- }
- });
- //查询赛事项目详情
- router.route("/selectRaceDetailGM").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectRaceDetailGM", json["id"]);
- });
- //查询赛事分类及子分类
- router.route("/selectMatTypeGM").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectMatTypeGM");
- });
- //添加资源库分类
- router.route("/addSourceFileType").all((req, res, next) => {
- postmysql(req, res, "addSourceFileType");
- });
- //查询资源库分类
- router.route("/getSourceFileType").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getSourceFileType", json["uid"]);
- });
- //删除资源库分类
- router.route("/deleteSoureFileType").all((req, res, next) => {
- postmysql(req, res, "deleteSoureFileType");
- });
- //修改资源库分类名字
- router.route("/updateSourceFileName").all((req, res, next) => {
- postmysql(req, res, "updateSourceFileName");
- });
- //修改资源库分类父级
- router.route("/updateSourceFileTypePid").all((req, res, next) => {
- postmysql(req, res, "updateSourceFileTypePid");
- });
- //添加资源库
- router.route("/addSourceFile").all((req, res, next) => {
- postmysql(req, res, "addSourceFile");
- });
- //查询资源库上传文件
- router.route("/getSourceFile").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getSourceFile", json["uid"], json["pid"], json["n"]);
- });
- //删除资源库
- router.route("/deleteSourceFile").all((req, res, next) => {
- postmysql(req, res, "deleteSourceFile");
- });
- //移动资源库
- router.route("/updateSourceFilePid").all((req, res, next) => {
- postmysql(req, res, "updateSourceFilePid");
- });
- //查询资源库上传文件
- router.route("/getCourseInfoTest").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getCourseInfoTest", json["cid"]);
- });
- //查看已经的作业
- router.route("/selectTestWorksCid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectTestWorksCid", json["cid"], json["uid"]);
- });
- //查询资源库上传文件
- router.route("/getCourseInfoTestAll").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "getCourseInfoTestAll", json["cid"]);
- });
- //还原课程功能
- router.route("/revertCourse").all((req, res, next) => {
- postmysql(req, res, "revertCourse");
- });
- //还原课程功能
- router.route("/revertCourseSz").all((req, res, next) => {
- postmysql2(req, res, "revertCourse");
- });
- //根据课程id查询关联的表单
- router.route("/selectTestCourseByCid").all((req, res, next) => {
- var json = queryString(req.url);
- getmysql(req, res, "selectTestCourseByCid", json["cid"]);
- });
- //qgt 根据用户id和文件标题获取答案来自动填写
- router.route("/selectTestCourseAutoFillType3").all((req,res,next)=>{
- var json = queryString(req.url);
- getmysql(req, res, "selectTestCourseAutoFillType3", json["uid"],json["tit"]);
- });
- function generateAPIKey(username) {
- let timeStamp = new Date().getTime();
- let hashStr = timeStamp + username;
- let digest = crypto
- .createHash("sha256")
- .update(hashStr, "utf8")
- .digest("hex");
- return digest;
- }
- queryString = function(url) {
- var a = url.split("?");
- var json = querystring.parse(a[1]);
- return json;
- };
- //post存儲過程處理
- postmysql = function(req, res, functionname) {
- //mode的處理
- if (req.body[0]) {
- p = Object.values(req.body[0]);
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], functionname);
- //執行存儲過程
- mysql.usselect(p, function(ret) {
- res.end(JSON.stringify(ret));
- });
- }
- };
- //post存儲過程處理
- postmysql2 = function(req, res, functionname) {
- //mode的處理
- if (req.body) {
- p = Object.values(req.body)[0].split(",");
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], functionname);
- //執行存儲過程
- mysql.usselect(p, function(ret) {
- res.end(JSON.stringify(ret));
- });
- }
- };
- //post存儲過程處理
- postmysql3 = function(req, res, functionname) {
- //mode的處理
- if (req.body) {
- p = Object.values(req.body);
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], functionname);
- //執行存儲過程
- mysql.usselect(p, function(ret) {
- res.end(JSON.stringify(ret));
- });
- }
- };
- //get獲取數據庫信息
- getmysql = function(req, res, functionname, ...p) {
- p = p || [];
- p.unshift(_getmysqlLabor[0], _getmysqlLabor[1], functionname);
- //執行存儲過程
- mysql.usselect(p, function(ret) {
- res.end(JSON.stringify(ret));
- }); //
- };
- //get獲取數據庫信息
- getmysql2 = function(req, res, functionname, ...p) {
- p = p || [];
- p.unshift(_mysqlLabor[0], _mysqlLabor[1], functionname);
- //執行存儲過程
- mysql.usselect(p, function(ret) {
- res.end(JSON.stringify(ret));
- }); //
- };
- //post存储过程处理
- userpostmysql = function(req, res, functionname) {
- //mode的处理
- if (req.body.mode) {
- p = req.body.mode.split(",");
- p.unshift(_mysqluser[0], _mysqluser[1], functionname);
- //执行存储过程
- mysql.usselect(p, function(ret) {
- res.end(JSON.stringify(ret));
- });
- }
- };
- //get获取数据库信息
- usergetmysql = function(req, res, functionname, ...p) {
- p = p || [];
- p.unshift(_getmysqluser[0], _getmysqluser[1], functionname);
-
- //执行存储过程
- mysql.usselect(p, function(ret) {
- res.end(JSON.stringify(ret));
- }); //
- };
- module.exports = router;
|