pbl.js 256 KB

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