pbl.js 291 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597
  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. //=====================================
  10. // 本地
  11. // const _mysqlLabor = ["183.36.25.93", "pbl"]; //edu數據庫信息
  12. // const _mysqluser = ["183.36.25.93", "cocorobouser"]; //用户数据库信息
  13. // const _getmysqlLabor2 = ["183.36.25.93", "pbl"]; //edu數據庫信息
  14. // const _getmysqlLabor = ["183.36.25.93", "pbl"]; //edu數據庫信息
  15. //线上
  16. const _mysqlLabor = ["172.16.12.5", "pbl"]; //edu數據庫信息
  17. const _mysqluser = ["172.16.12.5", "cocorobouser"]; //edu數據庫信息
  18. const _getmysqlLabor2 = ["172.16.12.7", "pbl"]; //edu數據庫信息
  19. const _getmysqlLabor = ["172.16.12.7", "pbl"]; //edu數據庫信息
  20. //======================================
  21. // const _mysqlLabor = ["183.36.25.93", "pbl"]; //edu數據庫信息
  22. // const _mysqluser = ["183.36.25.93", "cocorobouser"]; //用户数据库信息
  23. // const _getmysqlLabor = ["123.58.32.152", "pbl"]; //edu數據庫信息
  24. // const _getmysqluser = ["123.58.32.152", "cocorobouser"]; //edu數據庫信息
  25. // const _mysqlLabor = ["172.16.12.5", "pbl"]; //edu數據庫信息
  26. // const _mysqluser = ["172.16.12.5", "cocorobouser"]; //edu數據庫信息
  27. // const _getmysqlLabor = ["172.16.12.5", "pbl"]; //edu數據庫信息
  28. // const _getmysqluser = ["172.16.12.5", "cocorobouser"]; //edu數據庫信息
  29. // const _getmysqlLabor2 = ["183.36.25.93", "pbl"]; //edu數據庫信息
  30. // const _getmysqlLabor = ["183.36.25.93", "pbl"]; //edu數據庫信息
  31. const _getmysqluser = ["172.16.12.7", "cocorobouser"]; //edu數據庫信息
  32. const _localhost = ["127.0.0.1", "pbl"]; //edu數據庫信息
  33. var crypto = require("crypto");
  34. var https = require("https");
  35. const { Pool } = require('pg');
  36. const axios = require('axios');
  37. const pool = new Pool({
  38. user: 'cocorobo',
  39. host: '34.228.204.21',
  40. database: 'cocorobo-postgres',
  41. password: 'cocorobo',
  42. port: 5433,
  43. max: 20000, // 设置最大连接数
  44. idleTimeoutMillis: 30000 // 设置空闲连接超时时间
  45. });
  46. async function calculateVectors(content) {
  47. try {
  48. const response = await axios.post('http://34.228.204.21:11434/api/embeddings', {
  49. "model": "smartcreation/bge-large-zh-v1.5",
  50. "prompt": `${content}`
  51. });
  52. const contentVector = response.data.embedding;
  53. return contentVector;
  54. } catch (error) {
  55. console.error('Error calculating vectors:', content);
  56. return null;
  57. }
  58. }
  59. async function findMatchingContents(discipline, content) {
  60. const contentVector = await calculateVectors(content);
  61. const formattedContentVector = contentVector.length > 0 ? `[` + contentVector.join(', ') + `]` : null;
  62. const client = await pool.connect();
  63. try {
  64. // 使用余弦相似度进行内容向量匹配
  65. const query = `
  66. SELECT title, id, content, file_url, file_type,
  67. 1 - (content_vector <#> $1::vector) AS contentSimilarity
  68. FROM (select file_type, 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
  69. ORDER BY contentSimilarity DESC
  70. LIMIT 5;
  71. `;
  72. const result = await client.query(query, [formattedContentVector, discipline]);
  73. /*
  74. console.log(result.rows);
  75. // 将查询结果转换为匹配对象
  76. const matches = result.rows.map(row => ({
  77. id: row.id,
  78. contentSimilarity: row.contentsimilarity
  79. }));
  80. console.log(matches);
  81. */
  82. return result.rows; // 返回匹配结果
  83. } catch (error) {
  84. console.error('Error finding matching contents:', error);
  85. return [];
  86. } finally {
  87. client.release(); // 确保释放数据库连接
  88. }
  89. }
  90. async function findMatchingContentsPage2(discipline, content, grade, page) {
  91. const contentVector = await calculateVectors(content);
  92. const formattedContentVector = contentVector.length > 0 ? `[` + contentVector.join(', ') + `]` : null;
  93. const offset = ((page || 1) - 1) * 5;
  94. const client = await pool.connect();
  95. try {
  96. // 使用余弦相似度进行内容向量匹配
  97. const query = `
  98. SELECT title, id, content, file_url, file_type,
  99. 1 - (content_vector <#> $1::vector) AS contentSimilarity
  100. FROM (select file_type, file_url, title, id, content, content_vector from knowledgefiles as a
  101. where ($2 = '' or a.parent_arr && (SELECT ARRAY_AGG(id)::text[] FROM directory_files WHERE folder_name = ANY(string_to_array($2, ','))))
  102. AND ($3 = '' or a.parent_arr && (SELECT ARRAY_AGG(id)::text[] FROM directory_files WHERE folder_name = ANY(string_to_array($3, ','))))) as a
  103. ORDER BY contentSimilarity DESC
  104. LIMIT 5 OFFSET $4;
  105. `;
  106. const result = await client.query(query, [formattedContentVector, discipline, grade, offset]);
  107. return result.rows; // 返回匹配结果
  108. } catch (error) {
  109. console.error('Error finding matching contents:', error);
  110. return [];
  111. } finally {
  112. client.release(); // 确保释放数据库连接
  113. }
  114. }
  115. async function findMatchingContentsPage3(discipline, content, grade, filetype, page) {
  116. const contentVector = await calculateVectors(content);
  117. const formattedContentVector = contentVector.length > 0 ? `[` + contentVector.join(', ') + `]` : null;
  118. const offset = ((page || 1) - 1) * 5;
  119. const client = await pool.connect();
  120. try {
  121. // 使用余弦相似度进行内容向量匹配
  122. const query = `
  123. SELECT id, content, file_type, file_url, title,
  124. 1 - (content_vector <#> $1::vector) AS contentSimilarity
  125. FROM (select file_url, title,id, content, content_vector, file_type from knowledgefiles as a
  126. where ($4 = '' or file_type = ANY(string_to_array($4, ','))) and ($2 = '' or a.parent_arr && (SELECT ARRAY_AGG(id)::text[] FROM directory_files WHERE folder_name = ANY(string_to_array($2, ','))))
  127. AND ($3 = '' or a.parent_arr && (SELECT ARRAY_AGG(id)::text[] FROM directory_files WHERE folder_name = ANY(string_to_array($3, ','))))) as a
  128. ORDER BY contentSimilarity DESC
  129. LIMIT 5 OFFSET $5;
  130. `;
  131. const result = await client.query(query, [formattedContentVector, discipline, grade, filetype, offset]);
  132. return result.rows; // 返回匹配结果
  133. } catch (error) {
  134. console.error('Error finding matching contents:', error);
  135. return [];
  136. } finally {
  137. client.release(); // 确保释放数据库连接
  138. }
  139. }
  140. async function findMatchingContentsPage(discipline, content, page) {
  141. const contentVector = await calculateVectors(content);
  142. const formattedContentVector = contentVector.length > 0 ? `[` + contentVector.join(', ') + `]` : null;
  143. const offset = ((page || 1) - 1) * 5;
  144. const client = await pool.connect();
  145. try {
  146. // 使用余弦相似度进行内容向量匹配
  147. const query = `
  148. SELECT title, id, content, file_url, file_type,
  149. 1 - (content_vector <#> $1::vector) AS contentSimilarity
  150. FROM (select file_type, file_url, title, id, content, content_vector from knowledgefiles as a where top_dir_id in
  151. (select id from directory_files where $2 = '' or folder_name = ANY(string_to_array($2, ',')))) as a
  152. ORDER BY contentSimilarity DESC
  153. LIMIT 5 OFFSET $3;
  154. `;
  155. const result = await client.query(query, [formattedContentVector, discipline, offset]);
  156. return result.rows; // 返回匹配结果
  157. } catch (error) {
  158. console.error('Error finding matching contents:', error);
  159. return [];
  160. } finally {
  161. client.release(); // 确保释放数据库连接
  162. }
  163. }
  164. /*检索文件*/
  165. router.route("/findMatchingContents").all(async (req, res, next) => {
  166. var json = queryString(req.url);
  167. console.log(json["type"], json["string"])
  168. const titleMatches = await findMatchingContents(json["type"], json["string"]);
  169. res.end(JSON.stringify(titleMatches));
  170. });
  171. /*检索文件*/
  172. router.route("/findMatchingContentsPage").all(async (req, res, next) => {
  173. var json = queryString(req.url);
  174. console.log(json["type"], json["string"])
  175. const titleMatches = await findMatchingContentsPage(json["type"], json["string"], json["page"]);
  176. res.end(JSON.stringify(titleMatches));
  177. });
  178. /*检索文件*/
  179. router.route("/findMatchingContentsPage2").all(async (req, res, next) => {
  180. var json = queryString(req.url);
  181. console.log(json["type"], json["string"])
  182. const titleMatches = await findMatchingContentsPage2(json["type"], json["string"], json["grade"], json["page"]);
  183. res.end(JSON.stringify(titleMatches));
  184. });
  185. /*检索文件*/
  186. router.route("/findMatchingContentsPage3").all(async (req, res, next) => {
  187. var json = queryString(req.url);
  188. const titleMatches = await findMatchingContentsPage3(json["type"], json["string"], json["grade"], json["filetype"], json["page"]);
  189. res.end(JSON.stringify(titleMatches));
  190. });
  191. //統壹處理區域
  192. router.use(async function(req, res, next) {
  193. await asynnext(req, res, next);
  194. //// make sure we go to the next routes and don't stop here
  195. //res.end("");
  196. });
  197. /**
  198. * @des 參數解釋同上
  199. */
  200. function asynnext(req, res, next) {
  201. //異步處理
  202. return new Promise(async(resolve, reject) => {
  203. next();
  204. //resolve(true);aa
  205. });
  206. }
  207. /*測試*/
  208. router.route("/a").all((req, res, next) => {
  209. var json = queryString(req.url);
  210. getmysql(req, res, "a", json["ph"], json["pa"]);
  211. });
  212. router.route("/b").all((req, res, next) => {
  213. var json = queryString(req.url);
  214. getmysql(req, res, "b", json["ph"], json["pa"]);
  215. });
  216. /* 注册接口 */
  217. router.route("/register").post(function(req, res, next) {
  218. //mode的处理
  219. if (req.body[0]) {
  220. // 0 用户名 1 用户密码 2用户身份 3 第三方id(可有可无)
  221. p = Object.values(req.body[0]); //获取用户密码
  222. //没有第三方id的处理
  223. // if (p.length < 4) {
  224. // p.push("")
  225. // }
  226. p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
  227. //密码加密
  228. // bcrypt.hash(p[1], 10, function (err, hash) {
  229. // if (err) {
  230. // return next(err);
  231. // }
  232. // p[1] = hash;
  233. // });
  234. //参数拼接,注册
  235. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "register");
  236. //返回注册用户数据
  237. // mysql.usselect(p, function (ret) {
  238. // res.end(ret);
  239. // });
  240. mysql.usselect(p, function(ret) {
  241. res.end(JSON.stringify(ret));
  242. });
  243. }
  244. });
  245. /*登录接口*/
  246. router.route("/login").all((req, res, next) => {
  247. //mode的处理
  248. if (req.body[0]) {
  249. // 0 用户名 1 用户密码
  250. c = Object.values(req.body[0]); //获取用户密码
  251. p = [c[0]];
  252. // p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
  253. var _password = [c[0]];
  254. _password.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectPassword");
  255. mysql.usselect(_password, function(ret) {
  256. var _ret = ret;
  257. var paJ = _ret[0][0].userpassword;
  258. bcrypt.compare(c[1], paJ, function(err, result) {
  259. // console.log(result)
  260. if (result) {
  261. //参数拼接,登录
  262. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectLogin");
  263. //执行存储过程
  264. mysql.usselect(p, function(ret) {
  265. res.end(JSON.stringify({ status: "1", ...ret }));
  266. });
  267. } else {
  268. res.end(JSON.stringify([{ status: "0" }]));
  269. }
  270. });
  271. });
  272. // console.log(isEqual)
  273. }
  274. });
  275. /*手机登录接口*/
  276. router.route("/phoneLogin").all((req, res, next) => {
  277. //mode的处理
  278. if (req.body[0]) {
  279. // 0 用户名 1 用户密码
  280. c = Object.values(req.body[0]); //获取用户密码
  281. p = [c[0]];
  282. // p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
  283. var _password = [c[0]];
  284. _password.unshift(_mysqluser[0], _mysqluser[1], "selectPassword");
  285. mysql.usselect(_password, function(ret) {
  286. if (ret[0].length) {
  287. var _ret = ret;
  288. var paJ = _ret[0][0].password;
  289. let uid = _ret[0][0].userid;
  290. let duid = [uid];
  291. bcrypt.compare(c[1], paJ, function(err, result) {
  292. // console.log(result)
  293. if (result) {
  294. //参数拼接,登录
  295. duid.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
  296. //执行存储过程
  297. mysql.usselect(duid, function(ret) {
  298. res.end(JSON.stringify({ status: "1", ...ret }));
  299. });
  300. } else {
  301. res.end(JSON.stringify([{ status: "0" }]));
  302. }
  303. });
  304. } else {
  305. res.end(JSON.stringify([{ status: "0" }]));
  306. }
  307. });
  308. // console.log(isEqual)
  309. }
  310. });
  311. // 图片转base64
  312. router.route("/imgToBase64").all((req, res, next) => {
  313. var json = queryString(req.url);
  314. //mode的处理
  315. https.get(json["img"], function(res2) {
  316. var chunks = [];
  317. var size = 0;
  318. res2.on("data", function(chunk) {
  319. chunks.push(chunk);
  320. size += chunk.length; //累加缓冲数据的长度
  321. });
  322. res2.on("end", function(err) {
  323. var data = Buffer.concat(chunks, size);
  324. var base64Img = data.toString("base64");
  325. res.end(JSON.stringify([{ img: `data:image/png;base64,${base64Img}` }]));
  326. });
  327. });
  328. });
  329. router.route("/download").all(async(req, res, next) => {
  330. var json = queryString(req.url);
  331. // 查询文件名和下载链接
  332. const fileName = json["name"];
  333. const link = json["url"];
  334. // 发送下载请求
  335. request.get(link, (err, response) => {
  336. if (err) {
  337. res.status(500).end("Internal Server Error");
  338. return;
  339. }
  340. https.get(link, function(res2) {
  341. var chunks = [];
  342. var size = 0;
  343. res2.on("data", function(chunk) {
  344. chunks.push(chunk);
  345. size += chunk.length; //累加缓冲数据的长度
  346. });
  347. res2.on("end", function(err) {
  348. var data = Buffer.concat(chunks, size);
  349. var base64Img = data.toString("base64");
  350. res.end(JSON.stringify({ response, data }));
  351. });
  352. });
  353. });
  354. });
  355. // 罗湖get
  356. router.route("/luohugetTeacherInfo").all((req, res, next) => {
  357. var json = queryString(req.url);
  358. //mode的处理
  359. https.get("https://web.luohuedu.net/tx/userinfo.aspx?code=" + json['code'], function(res2) {
  360. let data = '';
  361. res2.on("data", function(chunk) {
  362. data += chunk; // 累加获取的数据
  363. });
  364. res2.on("end", function() {
  365. res.end(data); // 将获取的值传参给前端
  366. });
  367. });
  368. });
  369. /*登录接口*/
  370. router.route("/loginRace").all((req, res, next) => {
  371. //mode的处理
  372. if (req.body[0]) {
  373. // 0 用户名 1 用户密码
  374. c = Object.values(req.body[0]); //获取用户密码
  375. p = [c[0]];
  376. // p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
  377. var _password = [c[0]];
  378. _password.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectPasswordRace");
  379. mysql.usselect(_password, function(ret) {
  380. var _ret = ret;
  381. var paJ = _ret[0][0].password;
  382. bcrypt.compare(c[1], paJ, function(err, result) {
  383. // console.log(result)
  384. if (result) {
  385. //参数拼接,登录
  386. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectLoginRace");
  387. //执行存储过程
  388. mysql.usselect(p, function(ret) {
  389. res.end(JSON.stringify({ status: "1", ...ret }));
  390. });
  391. } else {
  392. res.end(JSON.stringify([{ status: "0" }]));
  393. }
  394. });
  395. });
  396. // console.log(isEqual)
  397. }
  398. });
  399. /* 修改密码接口 */
  400. router.route("/updateAllPassword").all(function(req, res, next) {
  401. //mode的处理
  402. // let p = [];
  403. // p.unshift(_mysqlLabor[0], _mysqlLabor[1], "getAllPassword"); //執行存儲過程
  404. // mysql.usselect(p, function(ret) {
  405. // var allUser = ret[0];
  406. // var matchedUsers = allUser.filter(function(user) {
  407. // return bcrypt.compareSync('123456', user.password);
  408. // });
  409. // let a = matchedUsers.map(user => user.userid).join(",");
  410. // console.log(a);
  411. // res.end(JSON.stringify(matchedUsers));
  412. // });
  413. let allUser =  ['65a493a7-0115-11ee-91d8-005056b86db5', 'b0e41557-382b-11ee-91d8-005056b86db5', '95e46cb3-6e1c-11ee-b98c-005056b86db5', '0db98925-d093-11ee-b534-005056b86db5', 'fcd9b23e-d099-11ee-b534-005056b86db5', 'fcda0e4c-d099-11ee-b534-005056b86db5', '710746bc-f657-11ef-b508-005056924926', '1b06a4fa-03c2-11f0-b508-005056924926']
  414. console.log(allUser.length);
  415. function updatePasswordBatch(startIndex, endIndex) {
  416. if (endIndex > allUser.length) {
  417. endIndex = allUser.length;
  418. }
  419. for (let i = startIndex; i < endIndex; i++) {
  420. _password = bcrypt.hashSync("Coco1234", bcrypt.genSaltSync(10));
  421. //.userid
  422. let p2 = [allUser[i], _password];
  423. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "iniPassword"); //執行存儲過程
  424. mysql.usselect(p2, function(ret) {
  425. console.log(i);
  426. // console.log(ret);
  427. if (i === endIndex - 1) {
  428. console.log(`执行下一个100条,执行完${endIndex}`);
  429. updatePasswordBatch(endIndex, endIndex + 100);
  430. if(endIndex + 1 == allUser.length){
  431. res.end("修改完成");
  432. }
  433. }
  434. });
  435. }
  436. }
  437. updatePasswordBatch(0, 100);
  438. });
  439. /* 修改密码接口 */
  440. router.route("/updatePassword").post(function(req, res, next) {
  441. //mode的处理
  442. if (req.body[0]) {
  443. let p = [req.body[0].userid];
  444. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "getPassword"); //執行存儲過程
  445. mysql.usselect(p, function(ret) {
  446. var paJ = ret[0][0].password;
  447. var op = bcrypt.hashSync(req.body[0].opassword, bcrypt.genSaltSync(10));
  448. bcrypt.compare(req.body[0].opassword, paJ, function(err, result) {
  449. // console.log(result)
  450. if (result) {
  451. let p2 = [
  452. req.body[0].userid,
  453. bcrypt.hashSync(req.body[0].password, bcrypt.genSaltSync(10)),
  454. ];
  455. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updatePassword"); //執行存儲過程
  456. mysql.usselect(p2, function(ret) {
  457. res.end(JSON.stringify([{ success: 1 }]));
  458. });
  459. } else {
  460. res.end(JSON.stringify([{ success: 0 }]));
  461. }
  462. });
  463. });
  464. }
  465. });
  466. /* 赛事修改密码 */
  467. router.route("/updatePassword1").post(function(req, res, next) {
  468. //mode的处理
  469. if (req.body[0]) {
  470. let p = [req.body[0].userid];
  471. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "getPassword1"); //執行存儲過程
  472. mysql.usselect(p, function(ret) {
  473. var paJ = ret[0][0].password;
  474. var op = bcrypt.hashSync(req.body[0].opassword, bcrypt.genSaltSync(10));
  475. bcrypt.compare(req.body[0].opassword, paJ, function(err, result) {
  476. // console.log(result)
  477. if (result) {
  478. let p2 = [
  479. req.body[0].userid,
  480. bcrypt.hashSync(req.body[0].password, bcrypt.genSaltSync(10)),
  481. ];
  482. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updatePassword1"); //執行存儲過程
  483. mysql.usselect(p2, function(ret) {
  484. res.end(JSON.stringify([{ success: 1 }]));
  485. });
  486. } else {
  487. res.end(JSON.stringify([{ success: 0 }]));
  488. }
  489. });
  490. });
  491. }
  492. });
  493. /* 找寻重复手机号 */
  494. router.route("/findPhone").all((req, res, next) => {
  495. var json = queryString(req.url);
  496. getmysql(req, res, "findPhone", json["un"]);
  497. });
  498. /* 找寻是否有此账号 */
  499. router.route("/findUsername").all((req, res, next) => {
  500. var json = queryString(req.url);
  501. getmysql(req, res, "findUsername", json["un"]);
  502. });
  503. /* 找寻重复邮箱 */
  504. router.route("/findMail").all((req, res, next) => {
  505. var json = queryString(req.url);
  506. usergetmysql(req, res, "findMail", json["un"]);
  507. });
  508. /* 找寻重复学号 */
  509. router.route("/findSid").all((req, res, next) => {
  510. var json = queryString(req.url);
  511. getmysql(req, res, "findSid", json["un"]);
  512. });
  513. /* 新增班级 修1 */
  514. router.route("/insertClass").get((req, res, next) => {
  515. var json = queryString(req.url);
  516. getmysql2(req, res, "insertClass", json["name"], json["oid"], json["uid"]);
  517. });
  518. /* 新增教研室 修1 */
  519. router.route("/insertTeacherOffice").get((req, res, next) => {
  520. var json = queryString(req.url);
  521. getmysql2(req, res, "insertTeacherOffice", json["name"], json["oid"], json["uid"]);
  522. });
  523. /* 新增年级 修1 */
  524. router.route("/insertGrade").get((req, res, next) => {
  525. var json = queryString(req.url);
  526. getmysql2(req, res, "insertGrade", json["name"], json["oid"], json["uid"]);
  527. });
  528. /* 修改班级 修1 */
  529. router.route("/updateClass").get((req, res, next) => {
  530. var json = queryString(req.url);
  531. getmysql2(req, res, "updateClass", json["id"], json["n"], json["oid"]);
  532. });
  533. // 修改教研室 修1
  534. router.route("/updateTeacherOffice").get((req, res, next) => {
  535. var json = queryString(req.url);
  536. getmysql2(req, res, "updateTeacherOffice", json["id"], json["n"], json["oid"]);
  537. });
  538. // 修改教研室 修2
  539. router.route("/updateTeacherOffice2").get((req, res, next) => {
  540. var json = queryString(req.url);
  541. getmysql2(req, res, "updateTeacherOffice2", json["id"], json["n"], json["oid"], json["pid"]);
  542. });
  543. /* 修改年级 修1 */
  544. router.route("/updateGrade").get((req, res, next) => {
  545. var json = queryString(req.url);
  546. getmysql2(req, res, "updateGrade", json["id"], json["n"], json["oid"]);
  547. });
  548. /* 查询班级 */
  549. router.route("/selectClass").all((req, res, next) => {
  550. var json = queryString(req.url);
  551. getmysql(req, res, "selectClass", json["cu"], json["oid"], json["cn"], json["page"], 10);
  552. });
  553. // 教研室查询
  554. router.route("/selectTeacherOffice").all((req, res, next) => {
  555. var json = queryString(req.url);
  556. getmysql(req, res, "selectTeacherOffice", json["cu"], json["oid"], json["cn"], json["page"], 10);
  557. });
  558. /* 查询班级 */
  559. router.route("/selectClass2").all((req, res, next) => {
  560. var json = queryString(req.url);
  561. getmysql(req, res, "selectClass2", json["cid"], json["oid"], json["cn"], json["page"], 10);
  562. });
  563. /* 查询年级 */
  564. router.route("/selectGrade").all((req, res, next) => {
  565. var json = queryString(req.url);
  566. getmysql(req, res, "selectGrade", json["cu"], json["oid"], json["cn"], json["page"], 10);
  567. });
  568. /* 删除1班级 */
  569. router.route("/deleteClass").all((req, res, next) => {
  570. var json = queryString(req.url);
  571. getmysql2(req, res, "deleteClass", json["id"]);
  572. });
  573. /* 删除1年级 */
  574. router.route("/deleteGrade").all((req, res, next) => {
  575. var json = queryString(req.url);
  576. getmysql2(req, res, "deleteGrade", json["id"]);
  577. });
  578. /* 查询学校 */
  579. router.route("/selectOrg").all((req, res, next) => {
  580. var json = queryString(req.url);
  581. getmysql(req, res, "selectOrg");
  582. });
  583. /* 查询组织 */
  584. router.route("/selectorg2").all((req, res, next) => {
  585. var json = queryString(req.url);
  586. getmysql(req, res, "selectorg2");
  587. });
  588. /* 修改学校名称 修1 */
  589. router.route("/updateSN").get((req, res, next) => {
  590. var json = queryString(req.url);
  591. getmysql2(req, res, "updateSchoolName", json["oid"], json["n"]);
  592. });
  593. /* 教师端修改学校名称 修1 */
  594. router.route("/updateSchoolByOrg").get((req, res, next) => {
  595. var json = queryString(req.url);
  596. getmysql2(req, res, "updateSchoolByOrg", json["n"], json["d"], json["id"]);
  597. });
  598. /* 教师端查询未联结学校 */
  599. router.route("/selectNoCSchool").all((req, res, next) => {
  600. var json = queryString(req.url);
  601. getmysql(req, res, "selectNoCSchool");
  602. });
  603. /* 教师端新增或修改联结学校 修1 */
  604. router.route("/addNoSchool").get((req, res, next) => {
  605. var json = queryString(req.url);
  606. getmysql2(req, res, "addNoSchool", json["id"], json["coid"]);
  607. });
  608. /* 新增学生 修1 */
  609. router.route("/insertStudent").get((req, res, next) => {
  610. var json = queryString(req.url);
  611. json["userpassword"] = bcrypt.hashSync(
  612. json["userpassword"],
  613. bcrypt.genSaltSync(10)
  614. );
  615. getmysql2(
  616. req,
  617. res,
  618. "insertStudent",
  619. json["ph"],
  620. json["username"],
  621. json["userpassword"],
  622. json["type"],
  623. json["oid"],
  624. json["tid"],
  625. json["cid"]
  626. );
  627. });
  628. // /* 新增学生 */
  629. // router.route('/iStudent').all((req, res, next) => {
  630. // var json = queryString(req.url);
  631. // json['userpassword'] = bcrypt.hashSync(json['userpassword'], bcrypt.genSaltSync(10))
  632. // getmysql(req, res, "insertStudent", json['ph'], json['username'], json['userpassword'], json['type'], json['oid'], json['tid'], json['cid']);
  633. // });
  634. /* 查询学生 */
  635. router.route("/selectStudent").all((req, res, next) => {
  636. var json = queryString(req.url);
  637. getmysql(
  638. req,
  639. res,
  640. "selectStudent",
  641. json["oid"],
  642. json["cu"],
  643. json["cn"],
  644. json["page"],
  645. 10
  646. );
  647. });
  648. /* ppt根据学校查询学生 */
  649. router.route("/selectStudentByScoolPPt").all((req, res, next) => {
  650. var json = queryString(req.url);
  651. getmysql(req, res, "selectStudentByScoolPPt", json["oid"], json["cid"]);
  652. });
  653. /* 查询学校底下的所有学生 */
  654. router.route("/selectOrgStu").all((req, res, next) => {
  655. var json = queryString(req.url);
  656. getmysql(req, res, "selectOrgStu", json["oid"]);
  657. });
  658. /* 查询学生 */
  659. router.route("/selectStudentAdd").all((req, res, next) => {
  660. var json = queryString(req.url);
  661. getmysql(req, res, "selectStudentAdd", json["oid"], json["cu"], json["cn"]);
  662. });
  663. /* 查询老师 */
  664. router.route("/selectTeacherAdd").all((req, res, next) => {
  665. var json = queryString(req.url);
  666. getmysql(req, res, "selectTeacherAdd", json["oid"], json["cu"], json["cn"]);
  667. });
  668. /* 查询老师 */
  669. router.route("/selectTeacherAdd2").all((req, res, next) => {
  670. var json = queryString(req.url);
  671. getmysql(req, res, "selectTeacherAdd2", json["oid"], json["org"], json["cu"], json["cn"]);
  672. });
  673. /* 查询老师 */
  674. router.route("/selectTeacherAddOrg").all((req, res, next) => {
  675. var json = queryString(req.url);
  676. getmysql(
  677. req,
  678. res,
  679. "selectTeacherAddOrg",
  680. json["oid"],
  681. json["cu"],
  682. json["cn"]
  683. );
  684. });
  685. /* 查询学生 */
  686. router.route("/selectStudentAddOrg").all((req, res, next) => {
  687. var json = queryString(req.url);
  688. getmysql(
  689. req,
  690. res,
  691. "selectStudentAddOrg",
  692. json["oid"],
  693. json["cu"],
  694. json["cn"]
  695. );
  696. });
  697. /* 查询全部用户 */
  698. router.route("/selectUserAddOrg").all((req, res, next) => {
  699. var json = queryString(req.url);
  700. getmysql(req, res, "selectUserAddOrg", json["oid"], json["cu"], json["cn"]);
  701. });
  702. /* 查询全部用户 */
  703. router.route("/selectUserAdd").all((req, res, next) => {
  704. var json = queryString(req.url);
  705. getmysql(req, res, "selectUserAdd", json["oid"], json["cu"], json["cn"]);
  706. });
  707. /* 查询全部用户 */
  708. router.route("/selectUserByOidS").all((req, res, next) => {
  709. var json = queryString(req.url);
  710. getmysql(
  711. req,
  712. res,
  713. "selectUserByOidS",
  714. json["oid"],
  715. json["org"],
  716. json["cu"],
  717. json["cn"]
  718. );
  719. });
  720. /* 查询全部用户 */
  721. router.route("/selectUserByOidS2").all((req, res, next) => {
  722. var json = queryString(req.url);
  723. getmysql(
  724. req,
  725. res,
  726. "selectUserByOidS2",
  727. json["oid"],
  728. json["org"],
  729. json["cu"],
  730. json["cn"],
  731. json["page"],
  732. json["pageSize"]
  733. );
  734. });
  735. /* 查询全部用户 */
  736. router.route("/selectUserByOidS2Studio").all((req, res, next) => {
  737. var json = queryString(req.url);
  738. getmysql(
  739. req,
  740. res,
  741. "selectUserByOidS2Studio",
  742. json["oid"],
  743. json["org"],
  744. json["cu"],
  745. json["cn"],
  746. json["page"],
  747. json["pageSize"]
  748. );
  749. });
  750. /* 查询班级是否有重复 */
  751. router.route("/selectC").all((req, res, next) => {
  752. var json = queryString(req.url);
  753. getmysql(req, res, "selectC", json["className"]);
  754. });
  755. /* 查询学校是否有重复 */
  756. router.route("/selectS").all((req, res, next) => {
  757. var json = queryString(req.url);
  758. getmysql(req, res, "selectS", json["schoolName"]);
  759. });
  760. /* 修改个人信息 */
  761. router.route("/updateUser").all((req, res, next) => {
  762. postmysql(req, res, "updateUser");
  763. });
  764. //获取荔园个人信息弹框数据
  765. router.route("/selectliyuanUserInfo").all((req, res, next) => {
  766. var json = queryString(req.url);
  767. getmysql(req, res, "selectliyuanUserInfo", json["uid"]);
  768. });
  769. /* 修改荔园个人信息弹框数据 */
  770. router.route("/updateliyuanUserInfo").all((req, res, next) => {
  771. postmysql(req, res, "updateliyuanUserInfo");
  772. });
  773. router.route("/updateliyuanUser").all((req, res, next) => {
  774. postmysql(req, res, "updateliyuanUser");
  775. });
  776. //查询老师的信息
  777. router.route("/getUser").all((req, res, next) => {
  778. var json = queryString(req.url);
  779. getmysql(req, res, "selectUserDeail", json["uid"]);
  780. });
  781. //查询老师的信息
  782. router.route("/getRaceUser").all((req, res, next) => {
  783. var json = queryString(req.url);
  784. getmysql(req, res, "getRaceUser", json["uid"]);
  785. });
  786. router.route("/selectUser").all((req, res, next) => {
  787. var json = queryString(req.url);
  788. getmysql2(req, res, "selectUser", json["userid"]);
  789. });
  790. router.route("/selectUserInfo").all((req, res, next) => {
  791. var json = queryString(req.url);
  792. getmysql(req, res, "selectUserInfo", json["userid"]);
  793. });
  794. //查询教师端消息
  795. router.route("/getNewsTeacher").all((req, res, next) => {
  796. var json = queryString(req.url);
  797. getmysql(req, res, "selectNew", json["uid"], json["page"], 10);
  798. });
  799. //查询教师端消息
  800. router.route("/selectNotice").all((req, res, next) => {
  801. var json = queryString(req.url);
  802. getmysql(
  803. req,
  804. res,
  805. "selectNotice",
  806. json["uid"],
  807. json["oid"],
  808. json["org"],
  809. json["page"],
  810. 10
  811. );
  812. });
  813. //查询教师端消息
  814. router.route("/selectNotice2").all((req, res, next) => {
  815. var json = queryString(req.url);
  816. getmysql(req, res, "selectNotice2", json["uid"], json["oid"], json["org"]);
  817. });
  818. //查询教师端消息
  819. router.route("/addNotice").all((req, res, next) => {
  820. postmysql(req, res, "addNotice");
  821. });
  822. //查询教师端消息
  823. router.route("/deleteNotice").all((req, res, next) => {
  824. postmysql(req, res, "deleteNotice");
  825. });
  826. //查询通知详情
  827. router.route("/selectNewDetail").all((req, res, next) => {
  828. var json = queryString(req.url);
  829. getmysql(req, res, "selectNewDetail", json["nid"]);
  830. });
  831. //查出分组分类
  832. router.route("/getGroup").all((req, res, next) => {
  833. getmysql(req, res, "selectGroupTeacher");
  834. });
  835. //查询这个老师底下的学生提交的作业
  836. router.route("/getWorks").all((req, res, next) => {
  837. //已经不用
  838. var json = queryString(req.url);
  839. getmysql(req, res, "selectWorks", json["cn"], json["cid"], json["page"], 10);
  840. });
  841. //查询项目
  842. router.route("/getProject").all((req, res, next) => {
  843. var json = queryString(req.url);
  844. getmysql(
  845. req,
  846. res,
  847. "selectProject",
  848. json["type"],
  849. json["uid"],
  850. json["oid"],
  851. json["cn"],
  852. json["page"],
  853. 10
  854. );
  855. });
  856. //新评价查询项目
  857. router.route("/getProject1").all((req, res, next) => {
  858. //已经不用
  859. var json = queryString(req.url);
  860. getmysql(
  861. req,
  862. res,
  863. "selectProject1",
  864. json["uid"],
  865. json["cid"],
  866. json["eid"],
  867. json["cn"],
  868. json["page"],
  869. 10
  870. );
  871. });
  872. //查询项目
  873. router.route("/getMyProject").all((req, res, next) => {
  874. var json = queryString(req.url);
  875. getmysql(req, res, "selectMyProject", json["uid"], json["page"], 10);
  876. });
  877. //查询项目成员
  878. router.route("/selectProjectStudent").all((req, res, next) => {
  879. var json = queryString(req.url);
  880. getmysql(req, res, "select_student", json["cn"], json["oid"], json["uid"]);
  881. });
  882. //查询Banner列表
  883. router.route("/selectBannerList").all((req, res, next) => {
  884. var json = queryString(req.url);
  885. getmysql(req, res, "selectBannerList", json["page"], 10);
  886. });
  887. //查询Banner列表
  888. router.route("/selectAllBanner").all((req, res, next) => {
  889. var json = queryString(req.url);
  890. getmysql(req, res, "selectAllBanner", json["t"]);
  891. });
  892. //新增Banner
  893. router.route("/insertBannerList").all((req, res, next) => {
  894. postmysql(req, res, "insertBannerList");
  895. });
  896. //删除提交的作业
  897. router.route("/deleteCourseWork").all((req, res, next) => {
  898. postmysql(req, res, "deleteCourseWork");
  899. });
  900. //删除提交的作业
  901. router.route("/deleteCourseWorkTwo").all((req, res, next) => {
  902. postmysql(req, res, "deleteCourseWorkTwo");
  903. });
  904. //删除提交的作业
  905. router.route("/deleteCourseWorkTwo2").all((req, res, next) => {
  906. postmysql(req, res, "deleteCourseWorkTwo2");
  907. });
  908. //查询课程管理导出pdf的数据 ym
  909. router.route("/selectStuCourseReportPdf").all((req, res, next) => {
  910. var json = queryString(req.url);
  911. getmysql(req, res, "selectStuCourseReportPdf", json["cid"], json["uid"], json["cla"]);
  912. });
  913. router.route("/selectStuCourseReportPdfTwo").all((req, res, next) => {
  914. var json = queryString(req.url);
  915. getmysql(req, res, "selectStuCourseReportPdfTwo", json["cid"], json["uid"], json["cla"]);
  916. });
  917. //删除提交的作业
  918. router.route("/deleteCourseWorkS").all((req, res, next) => {
  919. postmysql(req, res, "deleteCourseWorkS");
  920. });
  921. //删除1Banner
  922. router.route("/deleteBannerList").all((req, res, next) => {
  923. var json = queryString(req.url);
  924. getmysql2(req, res, "deleteBannerList", json["id"]);
  925. });
  926. //查询有没有重复的模板
  927. router.route("/selectTipsTemplateBE").all((req, res, next) => {
  928. var json = queryString(req.url);
  929. getmysql(req, res, "selectTipsTemplateBE", json["userid"], json["name"]);
  930. });
  931. router.route("/addTipsTemplate2E").all((req, res, next) => {
  932. postmysql(req, res, "addTipsTemplate2E");
  933. });
  934. //删除提示词模板
  935. router.route("/deleteTipsTemplateE").all((req, res, next) => {
  936. postmysql(req, res, "deleteTipsTemplateE");
  937. });
  938. //查询模板
  939. router.route("/selectTipsTemplateE").all((req, res, next) => {
  940. var json = queryString(req.url);
  941. getmysql(req, res, "selectTipsTemplateE", json["userid"], json["oid"], json["org"], json["type"], json["name"], json["stand"]);
  942. });
  943. //查询模板
  944. router.route("/selectTipsTemplateByIdE").all((req, res, next) => {
  945. var json = queryString(req.url);
  946. getmysql(req, res, "selectTipsTemplateByIdE", json["id"], json["stand"]);
  947. });
  948. //新增提示词
  949. router.route("/addTips").all((req, res, next) => {
  950. postmysql(req, res, "addTips");
  951. });
  952. //查询有没有重复的模板
  953. router.route("/selectTipsTemplateB").all((req, res, next) => {
  954. var json = queryString(req.url);
  955. getmysql(req, res, "selectTipsTemplateB", json["userid"], json["name"]);
  956. });
  957. //保存提示词模板
  958. router.route("/addTipsTemplate").all((req, res, next) => {
  959. postmysql(req, res, "addTipsTemplate");
  960. });
  961. router.route("/addTipsTemplate2").all((req, res, next) => {
  962. postmysql(req, res, "addTipsTemplate2");
  963. });
  964. //删除提示词模板
  965. router.route("/deleteTipsTemplate").all((req, res, next) => {
  966. postmysql(req, res, "deleteTipsTemplate");
  967. });
  968. //查询模板
  969. router.route("/selectTipsTemplate").all((req, res, next) => {
  970. var json = queryString(req.url);
  971. getmysql(req, res, "selectTipsTemplate", json["userid"], json["oid"], json["org"], json["type"], json["name"]);
  972. });
  973. //查询模板
  974. router.route("/selectTipsTemplateById").all((req, res, next) => {
  975. var json = queryString(req.url);
  976. getmysql(req, res, "selectTipsTemplateById", json["id"]);
  977. });
  978. //新增提示词
  979. router.route("/addTipsHK").all((req, res, next) => {
  980. postmysql(req, res, "addTipsHK");
  981. });
  982. //保存提示词模板
  983. router.route("/addTipsTemplateHK").all((req, res, next) => {
  984. postmysql(req, res, "addTipsTemplateHK");
  985. });
  986. router.route("/addTipsTemplateHK2").all((req, res, next) => {
  987. postmysql(req, res, "addTipsTemplateHK2");
  988. });
  989. //删除提示词模板
  990. router.route("/deleteTipsTemplateHK").all((req, res, next) => {
  991. postmysql(req, res, "deleteTipsTemplateHK");
  992. });
  993. //查询模板
  994. router.route("/selectTipsTemplateHK").all((req, res, next) => {
  995. var json = queryString(req.url);
  996. getmysql(req, res, "selectTipsTemplateHK", json["userid"], json["oid"], json["org"], json["type"], json["name"]);
  997. });
  998. //查询模板
  999. router.route("/selectTipsTemplateByIdHK").all((req, res, next) => {
  1000. var json = queryString(req.url);
  1001. getmysql(req, res, "selectTipsTemplateByIdHK", json["id"]);
  1002. });
  1003. //新增课程
  1004. router.route("/addWork").all((req, res, next) => {
  1005. postmysql(req, res, "insert_teacher_work");
  1006. });
  1007. //点赞评论
  1008. router.route("/insertComment").all((req, res, next) => {
  1009. postmysql(req, res, "insertComment");
  1010. });
  1011. //点赞评论
  1012. router.route("/getComment").all((req, res, next) => {
  1013. postmysql(req, res, "getComment");
  1014. });
  1015. //取消点赞 修1
  1016. router.route("/deleteComment").get((req, res, next) => {
  1017. var json = queryString(req.url);
  1018. getmysql2(req, res, "deleteComment", json["wid"], json["lid"]);
  1019. });
  1020. //删除1评论
  1021. router.route("/deleteComment2").all((req, res, next) => {
  1022. var json = queryString(req.url);
  1023. getmysql2(req, res, "deleteComment2", json["id"]);
  1024. });
  1025. //上传批注图片
  1026. router.route("/updateCourseWorks").all((req, res, next) => {
  1027. postmysql(req, res, "updateCourseWorks");
  1028. });
  1029. //上传文件
  1030. router.route("/addCourseWorks").all((req, res, next) => {
  1031. postmysql(req, res, "addCourseWorks");
  1032. });
  1033. //上传文件
  1034. router.route("/addCourseWorksS").all((req, res, next) => {
  1035. postmysql(req, res, "addCourseWorksS");
  1036. });
  1037. //上传文件
  1038. router.route("/addCourseWorksS2").all((req, res, next) => {
  1039. postmysql(req, res, "addCourseWorksS2");
  1040. });
  1041. //修改作业名字
  1042. router.route("/updateSCourseName").all((req, res, next) => {
  1043. postmysql(req, res, "updateSCourseName");
  1044. });
  1045. //可上传多个文件
  1046. router.route("/addCourseWorksR").all((req, res, next) => {
  1047. postmysql(req, res, "addCourseWorksR");
  1048. });
  1049. //可上传多个文件y
  1050. router.route("/addCourseWorksR1").all((req, res, next) => {
  1051. postmysql(req, res, "addCourseWorksR1");
  1052. });
  1053. //上传文件
  1054. router.route("/addCourseWorksTeacher").all((req, res, next) => {
  1055. postmysql(req, res, "addCourseWorksTeacher");
  1056. });
  1057. //上传文件
  1058. router.route("/addCourseWorks2").all((req, res, next) => {
  1059. var json = queryString(req.url);
  1060. postmysql(
  1061. req,
  1062. res,
  1063. "addCourseWorks",
  1064. json["uid"],
  1065. json["cid"],
  1066. json["stage"],
  1067. json["task"],
  1068. json["tool"],
  1069. json["content"],
  1070. json["type"]
  1071. );
  1072. });
  1073. //上传文件 修1
  1074. router.route("/addCourseWorks3").get((req, res, next) => {
  1075. var json = queryString(req.url);
  1076. getmysql2(
  1077. req,
  1078. res,
  1079. "addCourseWorks2",
  1080. json["uid"],
  1081. json["cid"],
  1082. json["stage"],
  1083. json["task"],
  1084. json["tool"],
  1085. json["content"],
  1086. json["type"],
  1087. json["atool"]
  1088. );
  1089. });
  1090. //上传文件
  1091. router.route("/addCourseWorks3-2").all((req, res, next) => {
  1092. var json = queryString(req.url);
  1093. postmysql(req, res, "addCourseWorks2");
  1094. });
  1095. //上传文件
  1096. router.route("/addCourseWorks2Inter").all((req, res, next) => {
  1097. var json = queryString(req.url);
  1098. postmysql(req, res, "addCourseWorks2Inter");
  1099. });
  1100. //上传文件
  1101. router.route("/addCourseWorks4").all((req, res, next) => {
  1102. postmysql3(req, res, "addCourseWorks3");
  1103. });
  1104. //上传文件
  1105. router.route("/addCourseWorks4-u").all((req, res, next) => {
  1106. postmysql2(req, res, "addCourseWorks3");
  1107. });
  1108. //上传文件
  1109. router.route("/addCourseWorks4-u2").all((req, res, next) => {
  1110. postmysql(req, res, "addCourseWorks3");
  1111. });
  1112. //上传文件
  1113. router.route("/addCourseWorks4E").all((req, res, next) => {
  1114. postmysql3(req, res, "addCourseWorks3E");
  1115. });
  1116. //上传文件
  1117. router.route("/addCourseWorks4s").all((req, res, next) => {
  1118. postmysql3(req, res, "addCourseWorks4s");
  1119. });
  1120. //上传文件
  1121. router.route("/addCourseWorks4s2").all((req, res, next) => {
  1122. postmysql3(req, res, "addCourseWorks4s2");
  1123. });
  1124. //上传文件
  1125. router.route("/addCourseWorks5").all((req, res, next) => {
  1126. postmysql(req, res, "addCourseWorks3");
  1127. });
  1128. //上传批量文件
  1129. router.route("/addCourseWorksPl").all((req, res, next) => {
  1130. if (req.body[0]) {
  1131. var p = Object.values(req.body[0]);
  1132. let ateacher = p[0];
  1133. let cid = p[1];
  1134. let stage = p[2];
  1135. let task = p[3];
  1136. let tool = p[4];
  1137. let files = JSON.parse(decodeURIComponent(p[5]));
  1138. for (let i = 0; i < files.length; i++) {
  1139. var k = [
  1140. encodeURIComponent(files[i].username),
  1141. cid,
  1142. stage,
  1143. task,
  1144. tool,
  1145. encodeURIComponent(files[i].url),
  1146. encodeURIComponent(files[i].fileType),
  1147. ateacher,
  1148. "50",
  1149. ];
  1150. k.unshift(_mysqlLabor[0], _mysqlLabor[1], "addCourseWorksPl");
  1151. //執行存儲過程
  1152. mysql.usselect(k, function(ret) {
  1153. if (i == files.length - 1) {
  1154. res.end(JSON.stringify(ret));
  1155. }
  1156. });
  1157. }
  1158. }
  1159. });
  1160. //修改课程权限(学生是否能查看所有作业) 修1
  1161. router.route("/updateCourseSLook").get((req, res, next) => {
  1162. var json = queryString(req.url);
  1163. getmysql2(req, res, "updateCourseSLook", json["sopen"], json["cid"]);
  1164. });
  1165. //修改课程权限(学生是否能查看所有作业) 修1
  1166. router.route("/updateTrainCourseSLook").get((req, res, next) => {
  1167. var json = queryString(req.url);
  1168. getmysql2(req, res, "updateTrainCourseSLook", json["sopen"], json["cid"]);
  1169. });
  1170. //修改跟随模式阶段-任务
  1171. router.route("/updateCourseFollowC").all((req, res, next) => {
  1172. postmysql(req, res, "updateCourseFollowC");
  1173. });
  1174. //修改跟随模式阶段-任务
  1175. router.route("/updateTrainCourseFollowC").all((req, res, next) => {
  1176. postmysql(req, res, "updateTrainCourseFollowC");
  1177. });
  1178. //修改跟随模式
  1179. router.route("/updateCourseFollow").all((req, res, next) => {
  1180. postmysql(req, res, "updateCourseFollow");
  1181. });
  1182. //修改学生是否可以查看内容
  1183. router.route("/updateCourseStulook").all((req, res, next) => {
  1184. postmysql(req, res, "updateCourseStulook");
  1185. });
  1186. //修改跟随模式
  1187. router.route("/updateTrainCourseFollow").all((req, res, next) => {
  1188. postmysql(req, res, "updateTrainCourseFollow");
  1189. });
  1190. //选人回答
  1191. router.route("/updateCoursePick").all((req, res, next) => {
  1192. postmysql(req, res, "updateCoursePick");
  1193. });
  1194. //删除
  1195. router.route("/deletePick").all((req, res, next) => {
  1196. postmysql(req, res, "deletePick");
  1197. });
  1198. //修改阶段锁定状态
  1199. router.route("/updateCourseLookOpen").all((req, res, next) => {
  1200. postmysql(req, res, "updateCourseLookOpen");
  1201. });
  1202. //修改阶段锁定状态
  1203. router.route("/updateTrainCourseLookOpen").all((req, res, next) => {
  1204. postmysql(req, res, "updateTrainCourseLookOpen");
  1205. });
  1206. //查看阶段锁定的状态
  1207. router.route("/getCourseState").all((req, res, next) => {
  1208. var json = queryString(req.url);
  1209. getmysql(req, res, "getCourseState", json["cid"]);
  1210. });
  1211. //添加锁定状态
  1212. router.route("/addCourseState").all((req, res, next) => {
  1213. postmysql(req, res, "addCourseState");
  1214. });
  1215. //修改锁定状态
  1216. router.route("/updateCourseSate").all((req, res, next) => {
  1217. postmysql(req, res, "updateCourseSate");
  1218. });
  1219. //修改课程管理模式
  1220. router.route("/updateCourseMode").all((req, res, next) => {
  1221. postmysql(req, res, "updateCourseMode");
  1222. });
  1223. //修改课程管理模式
  1224. router.route("/updateTrainCourseMode").all((req, res, next) => {
  1225. postmysql(req, res, "updateTrainCourseMode");
  1226. });
  1227. //查询课程权限(学生是否能查看所有作业)
  1228. router.route("/selectCourseSLook").all((req, res, next) => {
  1229. var json = queryString(req.url);
  1230. getmysql(req, res, "selectCourseSLook", json["cid"]);
  1231. });
  1232. //查询课程权限(学生是否能查看所有作业)
  1233. router.route("/selectTrainCourseSLook").all((req, res, next) => {
  1234. var json = queryString(req.url);
  1235. getmysql(req, res, "selectTrainCourseSLook", json["cid"]);
  1236. });
  1237. //查询被挑的人
  1238. router.route("/getPick").all((req, res, next) => {
  1239. var json = queryString(req.url);
  1240. getmysql(req, res, "getPick", json["cid"]);
  1241. });
  1242. //查询作业详情
  1243. router.route("/selectWorksDetail2").all((req, res, next) => {
  1244. var json = queryString(req.url);
  1245. getmysql(
  1246. req,
  1247. res,
  1248. "selectWorksDetail2",
  1249. json["uid"],
  1250. json["cid"],
  1251. json["stage"],
  1252. json["task"]
  1253. );
  1254. });
  1255. //查询作业详情
  1256. router.route("/selectWorksDetail2u").all((req, res, next) => {
  1257. //var json = queryString(req.url);//, json['uid'], json['cid'], json['stage'], json['task'], json['tool'], json['type'], json['atool']
  1258. postmysql2(req, res, "selectWorksDetail2u");
  1259. });
  1260. //查询课程全部作业详情
  1261. router.route("/selectWorksDetail3").all((req, res, next) => {
  1262. var json = queryString(req.url);
  1263. getmysql(req, res, "selectWorksDetail3", json["uid"], json["cid"]);
  1264. });
  1265. //查询课程所有作业详情
  1266. router.route("/selectAllWorksDetail").all((req, res, next) => {
  1267. var json = queryString(req.url);
  1268. getmysql(req, res, "selectAllWorksDetail", json["uid"], json["cid"]);
  1269. });
  1270. //查询多个课程全部作业详情
  1271. router.route("/selectWorksDetailMore").all((req, res, next) => {
  1272. var json = queryString(req.url);
  1273. getmysql(req, res, "selectWorksDetailMore", json["uid"], json["cid"]);
  1274. });
  1275. //一键重置作业分数
  1276. router.route("/allWorkEmptySco").all((req, res, next) => {
  1277. postmysql(req, res, "allWorkEmptySco");
  1278. });
  1279. //一键重置作业分数
  1280. router.route("/allWorkEmptyScoTwo").all((req, res, next) => {
  1281. postmysql(req, res, "allWorkEmptyScoTwo");
  1282. });
  1283. //查询课程某个阶段某个任务下的评价 修1 这个update,但标题查询
  1284. router.route("/updateWorksEva").get((req, res, next) => {
  1285. var json = queryString(req.url);
  1286. getmysql2(
  1287. req,
  1288. res,
  1289. "updateWorksEva",
  1290. json["cid"],
  1291. json["s"],
  1292. json["t"],
  1293. json["uid"],
  1294. json["rate"]
  1295. );
  1296. });
  1297. //查询课程某个阶段某个任务下的评价 修1 这个update,但标题查询
  1298. router.route("/updateWorksEvaTwo").get((req, res, next) => {
  1299. var json = queryString(req.url);
  1300. getmysql2(
  1301. req,
  1302. res,
  1303. "updateWorksEvaTwo",
  1304. json["cid"],
  1305. json["s"],
  1306. json["t"],
  1307. json["tool"],
  1308. json["uid"],
  1309. json["rate"]
  1310. );
  1311. });
  1312. //查询课程某个阶段某个任务下的评价 修1 这个update,但标题查询
  1313. router.route("/updateWorksEvaTwo1").post((req, res, next) => {
  1314. var json = queryString(req.url);
  1315. postmysql(req,res,"updateWorksEvaTwo1");
  1316. });
  1317. //学习中心教师查询作业
  1318. router.route("/selectSWorks").all((req, res, next) => {
  1319. var json = queryString(req.url);
  1320. getmysql(req, res, "selectSWorks", json["cid"], json["s"], json["t"]);
  1321. });
  1322. //学习中心教师查询工具作业
  1323. router.route("/selectMarkDialogWorks").all((req, res, next) => {
  1324. var json = queryString(req.url);
  1325. getmysql(req, res, "selectMarkDialogWorks", json["uid"],json["cid"], json["s"], json["t"], json["g"]);
  1326. });
  1327. //学习中心教师查询工具作业
  1328. router.route("/selectMarkDialogWorksTwo").all((req, res, next) => {
  1329. var json = queryString(req.url);
  1330. getmysql(req, res, "selectMarkDialogWorksTwo", json["uid"],json["cid"], json["s"], json["t"], json["g"]);
  1331. });
  1332. //学习中心教师查询作业全部展示
  1333. router.route("/selectSWorks2").all((req, res, next) => {
  1334. var json = queryString(req.url);
  1335. getmysql(req, res, "selectSWorks2", json["cid"]);
  1336. });
  1337. //学习中心学生查询作业
  1338. router.route("/selectStudentWorks").all((req, res, next) => {
  1339. var json = queryString(req.url);
  1340. getmysql(
  1341. req,
  1342. res,
  1343. "selectStudentWorks",
  1344. json["uid"],
  1345. json["cid"],
  1346. json["s"],
  1347. json["t"]
  1348. );
  1349. });
  1350. //实时课堂作业评价
  1351. router.route("/updateStudentWork").all((req, res, next) => {
  1352. postmysql(req, res, "updateStudentWork");
  1353. });
  1354. //学习中心查询学生
  1355. router.route("/selectWorksStudent").all((req, res, next) => {
  1356. var json = queryString(req.url);
  1357. getmysql(req, res, "selectWorksStudent", json["oid"], json["cid"]);
  1358. });
  1359. //批量上传查询学生
  1360. router.route("/selectSnameByCid").all((req, res, next) => {
  1361. var json = queryString(req.url);
  1362. getmysql(req, res, "selectSnameByCid", json["cid"]);
  1363. });
  1364. //批量上传查询学生分页
  1365. router.route("/selectSnameByCidPage").all((req, res, next) => {
  1366. var json = queryString(req.url);
  1367. getmysql(
  1368. req,
  1369. res,
  1370. "selectSnameByCidPage",
  1371. json["cid"],
  1372. json["cn"],
  1373. json["page"],
  1374. json["num"]
  1375. );
  1376. });
  1377. //分组查询学生
  1378. router.route("/selectSnameByCidGroup").all((req, res, next) => {
  1379. var json = queryString(req.url);
  1380. getmysql(
  1381. req,
  1382. res,
  1383. "selectSnameByCidGroup",
  1384. json["cid"],
  1385. json["oid"],
  1386. json["cn"]
  1387. );
  1388. });
  1389. /* 查询学生 */
  1390. router.route("/selectStudent2").all((req, res, next) => {
  1391. var json = queryString(req.url);
  1392. getmysql(
  1393. req,
  1394. res,
  1395. "selectStudent2",
  1396. json["oid"],
  1397. json["cu"],
  1398. json["cn"],
  1399. json["cid"],
  1400. json["page"],
  1401. 10
  1402. );
  1403. });
  1404. /* 查询教师 */
  1405. router.route("/selectTeacher2").all((req, res, next) => {
  1406. var json = queryString(req.url);
  1407. getmysql(
  1408. req,
  1409. res,
  1410. "selectTeacher2",
  1411. json["oid"],
  1412. json["cu"],
  1413. json["cn"],
  1414. json["cid"],
  1415. json["page"],
  1416. 10
  1417. );
  1418. });
  1419. /* 查询教师 */
  1420. router.route("/selectTeacher").all((req, res, next) => {
  1421. var json = queryString(req.url);
  1422. getmysql(
  1423. req,
  1424. res,
  1425. "selectTeacher",
  1426. json["org"],
  1427. json["cu"],
  1428. json["cn"],
  1429. json["page"],
  1430. 10
  1431. );
  1432. });
  1433. /* 添加教师页面查询教师 */
  1434. router.route("/selectTcTeacher").all((req, res, next) => {
  1435. var json = queryString(req.url);
  1436. getmysql(
  1437. req,
  1438. res,
  1439. "selectTcTeacher",
  1440. json["org"],
  1441. json["oid"],
  1442. json["cu"],
  1443. json["cn"],
  1444. json["page"],
  1445. 10
  1446. );
  1447. });
  1448. /* 查询所有评价体系 */
  1449. router.route("/selectAllEvaluation").all((req, res, next) => {
  1450. var json = queryString(req.url);
  1451. getmysql(req, res, "selectAllEvaluation", json["oid"]);
  1452. });
  1453. /* 根据市级用户查询评审员 */
  1454. router.route("/selectReviewer").all((req, res, next) => {
  1455. var json = queryString(req.url);
  1456. getmysql(
  1457. req,
  1458. res,
  1459. "selectReviewer",
  1460. json["uid"],
  1461. json["cn"],
  1462. json["page"],
  1463. 10
  1464. );
  1465. });
  1466. /* 市级区县管理接口 */
  1467. router.route("/selectCReviewer").all((req, res, next) => {
  1468. var json = queryString(req.url);
  1469. getmysql(
  1470. req,
  1471. res,
  1472. "selectCReviewer",
  1473. json["uid"],
  1474. json["cn"],
  1475. json["page"],
  1476. 10
  1477. );
  1478. });
  1479. /* 修改评审员 修1 */
  1480. router.route("/updateReviewer").get((req, res, next) => {
  1481. var json = queryString(req.url);
  1482. getmysql2(
  1483. req,
  1484. res,
  1485. "updateReviewer",
  1486. json["n"],
  1487. json["p"],
  1488. json["t"],
  1489. json["s"],
  1490. json["uid"]
  1491. );
  1492. });
  1493. /* 删除1评审员 */
  1494. router.route("/deleteReviewer").all((req, res, next) => {
  1495. var json = queryString(req.url);
  1496. getmysql2(req, res, "deleteReviewer", json["uid"]);
  1497. });
  1498. /* 查询区县案例 */
  1499. router.route("/selecAnliBox").all((req, res, next) => {
  1500. var json = queryString(req.url);
  1501. getmysql(req, res, "selecAnliBox", json["title"]);
  1502. });
  1503. /* 查询市级案例 */
  1504. router.route("/selecAnliBox1").all((req, res, next) => {
  1505. var json = queryString(req.url);
  1506. getmysql(req, res, "selecAnliBox1", json["title"]);
  1507. });
  1508. /* 查询省级案例 */
  1509. router.route("/selecAnliBox2").all((req, res, next) => {
  1510. var json = queryString(req.url);
  1511. getmysql(req, res, "selecAnliBox2");
  1512. });
  1513. /* 案例征集查询通知公告 */
  1514. router.route("/selectRaceNotice").all((req, res, next) => {
  1515. var json = queryString(req.url);
  1516. getmysql(req, res, "selectRaceNotice", json["page"], 10);
  1517. });
  1518. /* 案例征集查询通知公告详情 */
  1519. router.route("/getRaceNoticeDetail").all((req, res, next) => {
  1520. var json = queryString(req.url);
  1521. getmysql(req, res, "getRaceNoticeDetail", json["nid"]);
  1522. });
  1523. /* 案例征集发送通知 修1 */
  1524. router.route("/insertRaceNote").get((req, res, next) => {
  1525. var json = queryString(req.url);
  1526. getmysql2(req, res, "insertRaceNote", json["t"], json["c"], json["uid"]);
  1527. });
  1528. /* 查看随机码是否重复 */
  1529. router.route("/selectInviteCode").all((req, res, next) => {
  1530. var json = queryString(req.url);
  1531. getmysql(req, res, "selectInviteCode", json["code"], json["oid"]);
  1532. });
  1533. /* 查看随机码是否重复 */
  1534. router.route("/selectInviteCode2").all((req, res, next) => {
  1535. var json = queryString(req.url);
  1536. getmysql(req, res, "selectInviteCode2", json["code"], json["oid"]);
  1537. });
  1538. /* 根据随机码获取学校 */
  1539. router.route("/selectCourseByIc").all((req, res, next) => {
  1540. var json = queryString(req.url);
  1541. getmysql(req, res, "selectCourseByIc", json["code"], json["oid"]);
  1542. });
  1543. /* 根据随机码获取学校 */
  1544. router.route("/selectCourseByIc2").all((req, res, next) => {
  1545. var json = queryString(req.url);
  1546. getmysql(req, res, "selectCourseByIc2", json["code"], json["oid"]);
  1547. });
  1548. /* 根据随机码获取学校 */
  1549. router.route("/selectCourseByIc2SZ").all((req, res, next) => {
  1550. var json = queryString(req.url);
  1551. getmysql(req, res, "selectCourseByIc2SZ", json["code"], json["oid"]);
  1552. });
  1553. router.route("/addWorkNew").all((req, res, next) => {
  1554. // postmysql(req, res, "insert_teacher_work_new");
  1555. if (req.body[0]) {
  1556. // p = Object.values(req.body[0]);
  1557. p = [
  1558. req.body[0].uid,
  1559. req.body[0].title,
  1560. req.body[0].brief,
  1561. req.body[0].cover,
  1562. req.body[0].astudent,
  1563. req.body[0].see,
  1564. req.body[0].chapters,
  1565. req.body[0].template,
  1566. ];
  1567. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new");
  1568. //執行存儲過程
  1569. mysql.usselect(p, function(ret) {
  1570. let course = req.body[0].courseType;
  1571. let courseId = ret[0][0].courseId;
  1572. let userid = req.body[0].uid;
  1573. delCourseType(course, courseId, userid);
  1574. res.end(
  1575. JSON.stringify({
  1576. ordernumber: ret[0][0].ordernumber,
  1577. courseId: ret[0][0].courseId,
  1578. success: 1,
  1579. })
  1580. );
  1581. // res.end(JSON.stringify(ret));
  1582. });
  1583. }
  1584. });
  1585. router.route("/addWorkNew2").all((req, res, next) => {
  1586. if (req.body[0]) {
  1587. p = [
  1588. req.body[0].uid,
  1589. req.body[0].title,
  1590. req.body[0].brief,
  1591. req.body[0].cover,
  1592. req.body[0].evaId,
  1593. req.body[0].astudent,
  1594. req.body[0].see,
  1595. req.body[0].chapters,
  1596. req.body[0].template,
  1597. req.body[0].ateacher,
  1598. ];
  1599. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2"); //執行存儲過程
  1600. mysql.usselect(p, function(ret) {
  1601. let course = req.body[0].courseType;
  1602. let courseId = ret[0][0].courseId;
  1603. let userid = req.body[0].uid;
  1604. delCourseType(course, courseId, userid);
  1605. res.end(
  1606. JSON.stringify({
  1607. ordernumber: ret[0][0].ordernumber,
  1608. courseId: ret[0][0].courseId,
  1609. success: 1,
  1610. })
  1611. );
  1612. });
  1613. }
  1614. });
  1615. router.route("/addWorkNew2AI").all((req, res, next) => {
  1616. if (req.body[0]) {
  1617. p = [
  1618. req.body[0].uid,
  1619. req.body[0].title,
  1620. req.body[0].brief,
  1621. req.body[0].cover,
  1622. req.body[0].evaId,
  1623. req.body[0].astudent,
  1624. req.body[0].see,
  1625. req.body[0].chapters,
  1626. req.body[0].template,
  1627. req.body[0].ateacher,
  1628. req.body[0].refile,
  1629. req.body[0].reBrief,
  1630. ];
  1631. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2_ai"); //執行存儲過程
  1632. mysql.usselect(p, function(ret) {
  1633. let course = req.body[0].courseType;
  1634. let courseId = ret[0][0].courseId;
  1635. let userid = req.body[0].uid;
  1636. delCourseType(course, courseId, userid);
  1637. res.end(
  1638. JSON.stringify({
  1639. ordernumber: ret[0][0].ordernumber,
  1640. courseId: ret[0][0].courseId,
  1641. success: 1,
  1642. })
  1643. );
  1644. });
  1645. }
  1646. });
  1647. router.route("/addWorkNew2AI2").all((req, res, next) => {
  1648. if (req.body[0]) {
  1649. p = [
  1650. req.body[0].uid,
  1651. req.body[0].title,
  1652. req.body[0].brief,
  1653. req.body[0].cover,
  1654. req.body[0].evaId,
  1655. req.body[0].astudent,
  1656. req.body[0].see,
  1657. req.body[0].chapters,
  1658. req.body[0].template,
  1659. req.body[0].ateacher,
  1660. req.body[0].refile,
  1661. req.body[0].reBrief,
  1662. req.body[0].cpote,
  1663. ];
  1664. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2_ai2"); //執行存儲過程
  1665. mysql.usselect(p, function(ret) {
  1666. let course = req.body[0].courseType;
  1667. let courseId = ret[0][0].courseId;
  1668. let userid = req.body[0].uid;
  1669. delCourseType(course, courseId, userid);
  1670. res.end(
  1671. JSON.stringify({
  1672. ordernumber: ret[0][0].ordernumber,
  1673. courseId: ret[0][0].courseId,
  1674. success: 1,
  1675. })
  1676. );
  1677. });
  1678. }
  1679. });
  1680. router.route("/addWorkNew2AI3").all((req, res, next) => {
  1681. if (req.body[0]) {
  1682. p = [
  1683. req.body[0].uid,
  1684. req.body[0].title,
  1685. req.body[0].brief,
  1686. req.body[0].cover,
  1687. req.body[0].evaId,
  1688. req.body[0].astudent,
  1689. req.body[0].see,
  1690. req.body[0].chapters,
  1691. req.body[0].template,
  1692. req.body[0].ateacher,
  1693. req.body[0].refile,
  1694. req.body[0].reBrief,
  1695. req.body[0].cpote,
  1696. req.body[0].setting,
  1697. req.body[0].iresearch,
  1698. ];
  1699. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2_ai3"); //執行存儲過程
  1700. mysql.usselect(p, function(ret) {
  1701. let course = req.body[0].courseType;
  1702. let courseId = ret[0][0].courseId;
  1703. let userid = req.body[0].uid;
  1704. delCourseType(course, courseId, userid);
  1705. res.end(
  1706. JSON.stringify({
  1707. ordernumber: ret[0][0].ordernumber,
  1708. courseId: ret[0][0].courseId,
  1709. success: 1,
  1710. })
  1711. );
  1712. });
  1713. }
  1714. });
  1715. router.route("/addWorkNew2New").all((req, res, next) => {
  1716. if (req.body[0]) {
  1717. p = [
  1718. req.body[0].uid,
  1719. req.body[0].title,
  1720. req.body[0].brief,
  1721. req.body[0].cover,
  1722. req.body[0].evaId,
  1723. req.body[0].astudent,
  1724. req.body[0].see,
  1725. req.body[0].chapters,
  1726. req.body[0].template,
  1727. req.body[0].ateacher,
  1728. req.body[0].highSetting,
  1729. req.body[0].courseState,
  1730. ];
  1731. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2New"); //執行存儲過程
  1732. mysql.usselect(p, function(ret) {
  1733. let course = req.body[0].courseType;
  1734. let courseId = ret[0][0].courseId;
  1735. let userid = req.body[0].uid;
  1736. delCourseType(course, courseId, userid);
  1737. res.end(
  1738. JSON.stringify({
  1739. ordernumber: ret[0][0].ordernumber,
  1740. courseId: ret[0][0].courseId,
  1741. success: 1,
  1742. })
  1743. );
  1744. });
  1745. }
  1746. });
  1747. router.route("/addTrainCourseNew2").all((req, res, next) => {
  1748. if (req.body[0]) {
  1749. p = [
  1750. req.body[0].uid,
  1751. req.body[0].title,
  1752. req.body[0].brief,
  1753. req.body[0].cover,
  1754. req.body[0].evaId,
  1755. req.body[0].astudent,
  1756. req.body[0].see,
  1757. req.body[0].chapters,
  1758. req.body[0].template,
  1759. req.body[0].ateacher,
  1760. ];
  1761. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTrainCourseNew2"); //執行存儲過程
  1762. mysql.usselect(p, function(ret) {
  1763. let course = req.body[0].courseType;
  1764. let courseId = ret[0][0].courseId;
  1765. let userid = req.body[0].uid;
  1766. delCourseType(course, courseId, userid);
  1767. res.end(
  1768. JSON.stringify({
  1769. ordernumber: ret[0][0].ordernumber,
  1770. courseId: ret[0][0].courseId,
  1771. success: 1,
  1772. })
  1773. );
  1774. });
  1775. }
  1776. });
  1777. router.route("/addTestCourse").all((req, res, next) => { //添加评测
  1778. if (req.body[0]) {
  1779. p = [
  1780. req.body[0].uid,
  1781. req.body[0].title,
  1782. req.body[0].brief,
  1783. req.body[0].cover,
  1784. req.body[0].evaId,
  1785. req.body[0].astudent,
  1786. req.body[0].see,
  1787. req.body[0].chapters,
  1788. req.body[0].template,
  1789. req.body[0].ateacher,
  1790. req.body[0].typeid,
  1791. req.body[0].overtime,
  1792. req.body[0].j2,
  1793. ];
  1794. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTestCourse"); //執行存儲過程
  1795. mysql.usselect(p, function(ret) {
  1796. let course = req.body[0].courseType;
  1797. let courseId = ret[0][0].courseId;
  1798. let userid = req.body[0].uid;
  1799. delCourseType(course, courseId, userid);
  1800. res.end(
  1801. JSON.stringify({
  1802. ordernumber: ret[0][0].ordernumber,
  1803. courseId: ret[0][0].courseId,
  1804. success: 1,
  1805. })
  1806. );
  1807. });
  1808. }
  1809. });
  1810. router.route("/addTestCourse2").all((req, res, next) => { //添加评测 类型
  1811. if (req.body[0]) {
  1812. p = [
  1813. req.body[0].uid,
  1814. req.body[0].title,
  1815. req.body[0].brief,
  1816. req.body[0].cover,
  1817. req.body[0].evaId,
  1818. req.body[0].astudent,
  1819. req.body[0].see,
  1820. req.body[0].chapters,
  1821. req.body[0].template,
  1822. req.body[0].ateacher,
  1823. req.body[0].typeid,
  1824. ];
  1825. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTestCourse2"); //執行存儲過程
  1826. mysql.usselect(p, function(ret) {
  1827. let course = req.body[0].courseType;
  1828. let courseId = ret[0][0].courseId;
  1829. let userid = req.body[0].uid;
  1830. delCourseType(course, courseId, userid);
  1831. res.end(
  1832. JSON.stringify({
  1833. ordernumber: ret[0][0].ordernumber,
  1834. courseId: ret[0][0].courseId,
  1835. success: 1,
  1836. })
  1837. );
  1838. });
  1839. }
  1840. });
  1841. router.route("/addTestCourse3").all((req, res, next) => { //添加评测
  1842. if (req.body[0]) {
  1843. p = [
  1844. req.body[0].uid,
  1845. req.body[0].title,
  1846. req.body[0].brief,
  1847. req.body[0].cover,
  1848. req.body[0].evaId,
  1849. req.body[0].astudent,
  1850. req.body[0].see,
  1851. req.body[0].chapters,
  1852. req.body[0].template,
  1853. req.body[0].ateacher,
  1854. req.body[0].typeid,
  1855. req.body[0].overtime,
  1856. req.body[0].j2,
  1857. req.body[0].j3,
  1858. ];
  1859. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTestCourse3"); //執行存儲過程
  1860. mysql.usselect(p, function(ret) {
  1861. let course = req.body[0].courseType;
  1862. let courseId = ret[0][0].courseId;
  1863. let userid = req.body[0].uid;
  1864. delCourseType(course, courseId, userid);
  1865. res.end(
  1866. JSON.stringify({
  1867. ordernumber: ret[0][0].ordernumber,
  1868. courseId: ret[0][0].courseId,
  1869. success: 1,
  1870. })
  1871. );
  1872. });
  1873. }
  1874. });
  1875. router.route("/addWorkNew2E").all((req, res, next) => {
  1876. if (req.body[0]) {
  1877. p = [
  1878. req.body[0].uid,
  1879. req.body[0].title,
  1880. req.body[0].brief,
  1881. req.body[0].cover,
  1882. req.body[0].evaId,
  1883. req.body[0].astudent,
  1884. req.body[0].see,
  1885. req.body[0].chapters,
  1886. req.body[0].template,
  1887. req.body[0].ateacher,
  1888. ];
  1889. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2E"); //執行存儲過程
  1890. mysql.usselect(p, function(ret) {
  1891. let course = req.body[0].courseType;
  1892. let courseId = ret[0][0].courseId;
  1893. let userid = req.body[0].uid;
  1894. delCourseType(course, courseId, userid);
  1895. res.end(
  1896. JSON.stringify({
  1897. ordernumber: ret[0][0].ordernumber,
  1898. courseId: ret[0][0].courseId,
  1899. success: 1,
  1900. })
  1901. );
  1902. });
  1903. }
  1904. });
  1905. router.route("/addWorkNew2T").all((req, res, next) => {
  1906. if (req.body[0]) {
  1907. p = [
  1908. req.body[0].uid,
  1909. req.body[0].title,
  1910. req.body[0].brief,
  1911. req.body[0].cover,
  1912. req.body[0].evaId,
  1913. req.body[0].astudent,
  1914. req.body[0].see,
  1915. req.body[0].chapters,
  1916. req.body[0].template,
  1917. req.body[0].ateacher,
  1918. ];
  1919. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2T"); //執行存儲過程
  1920. mysql.usselect(p, function(ret) {
  1921. let course = req.body[0].courseType;
  1922. let courseId = ret[0][0].courseId;
  1923. let userid = req.body[0].uid;
  1924. delCourseType(course, courseId, userid);
  1925. res.end(
  1926. JSON.stringify({
  1927. ordernumber: ret[0][0].ordernumber,
  1928. courseId: ret[0][0].courseId,
  1929. success: 1,
  1930. })
  1931. );
  1932. });
  1933. }
  1934. });
  1935. router.route("/addTrainCourseNew2T").all((req, res, next) => {
  1936. if (req.body[0]) {
  1937. p = [
  1938. req.body[0].uid,
  1939. req.body[0].title,
  1940. req.body[0].brief,
  1941. req.body[0].cover,
  1942. req.body[0].evaId,
  1943. req.body[0].astudent,
  1944. req.body[0].see,
  1945. req.body[0].chapters,
  1946. req.body[0].template,
  1947. req.body[0].ateacher,
  1948. ];
  1949. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTrainCourseNew2T"); //執行存儲過程
  1950. mysql.usselect(p, function(ret) {
  1951. let course = req.body[0].courseType;
  1952. let courseId = ret[0][0].courseId;
  1953. let userid = req.body[0].uid;
  1954. delCourseType(course, courseId, userid);
  1955. res.end(
  1956. JSON.stringify({
  1957. ordernumber: ret[0][0].ordernumber,
  1958. courseId: ret[0][0].courseId,
  1959. success: 1,
  1960. })
  1961. );
  1962. });
  1963. }
  1964. });
  1965. router.route("/addSynergyCourse").all((req, res, next) => {
  1966. if (req.body[0]) {
  1967. p = [
  1968. req.body[0].uid,
  1969. req.body[0].title,
  1970. req.body[0].brief,
  1971. req.body[0].cover,
  1972. req.body[0].evaId,
  1973. req.body[0].astudent,
  1974. req.body[0].see,
  1975. req.body[0].chapters,
  1976. req.body[0].template,
  1977. req.body[0].ateacher,
  1978. ];
  1979. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_synergy"); //執行存儲過程
  1980. mysql.usselect(p, function(ret) {
  1981. let course = req.body[0].courseType;
  1982. let courseId = ret[0][0].courseId;
  1983. let userid = req.body[0].uid;
  1984. delCourseType(course, courseId, userid);
  1985. res.end(
  1986. JSON.stringify({
  1987. ordernumber: ret[0][0].ordernumber,
  1988. courseId: ret[0][0].courseId,
  1989. success: 1,
  1990. })
  1991. );
  1992. });
  1993. }
  1994. });
  1995. router.route("/addSynergyCourse2").all((req, res, next) => {
  1996. if (req.body[0]) {
  1997. p = [
  1998. req.body[0].cid,
  1999. req.body[0].uid,
  2000. req.body[0].title,
  2001. req.body[0].brief,
  2002. req.body[0].cover,
  2003. req.body[0].evaId,
  2004. req.body[0].astudent,
  2005. req.body[0].see,
  2006. req.body[0].chapters,
  2007. req.body[0].template,
  2008. req.body[0].ateacher,
  2009. ];
  2010. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_synergy2"); //執行存儲過程
  2011. mysql.usselect(p, function(ret) {
  2012. let course = req.body[0].courseType;
  2013. let courseId = ret[0][0].courseId;
  2014. let userid = req.body[0].uid;
  2015. delCourseType(course, courseId, userid);
  2016. res.end(
  2017. JSON.stringify({
  2018. ordernumber: ret[0][0].ordernumber,
  2019. courseId: ret[0][0].courseId,
  2020. success: 1,
  2021. })
  2022. );
  2023. });
  2024. }
  2025. });
  2026. router.route("/addWorkNew4").all((req, res, next) => {
  2027. if (req.body[0]) {
  2028. p = [
  2029. req.body[0].uid,
  2030. req.body[0].title,
  2031. req.body[0].brief,
  2032. req.body[0].cover,
  2033. req.body[0].evaId,
  2034. req.body[0].astudent,
  2035. req.body[0].see,
  2036. req.body[0].chapters,
  2037. req.body[0].template,
  2038. req.body[0].ateacher,
  2039. req.body[0].inviteCode,
  2040. ];
  2041. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new4"); //執行存儲過程
  2042. mysql.usselect(p, function(ret) {
  2043. let course = req.body[0].courseType;
  2044. let courseId = ret[0][0].courseId;
  2045. let userid = req.body[0].uid;
  2046. delCourseType(course, courseId, userid);
  2047. res.end(
  2048. JSON.stringify({
  2049. ordernumber: ret[0][0].ordernumber,
  2050. courseId: ret[0][0].courseId,
  2051. success: 1,
  2052. })
  2053. );
  2054. });
  2055. }
  2056. });
  2057. router.route("/addCourseWorkNew2").all((req, res, next) => {
  2058. //学生
  2059. if (req.body[0]) {
  2060. p = [
  2061. req.body[0].uid,
  2062. req.body[0].title,
  2063. req.body[0].brief,
  2064. req.body[0].cover,
  2065. req.body[0].evaId,
  2066. req.body[0].astudent,
  2067. req.body[0].see,
  2068. req.body[0].chapters,
  2069. req.body[0].template,
  2070. req.body[0].ateacher,
  2071. ];
  2072. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addCourseWorkNew2"); //執行存儲過程
  2073. mysql.usselect(p, function(ret) {
  2074. let course = req.body[0].courseType;
  2075. let courseId = ret[0][0].courseId;
  2076. let userid = req.body[0].uid;
  2077. delCourseType(course, courseId, userid);
  2078. res.end(
  2079. JSON.stringify({
  2080. ordernumber: ret[0][0].ordernumber,
  2081. courseId: ret[0][0].courseId,
  2082. success: 1,
  2083. })
  2084. );
  2085. });
  2086. }
  2087. });
  2088. router.route("/addCourseWorkNew22").all((req, res, next) => {
  2089. //学生
  2090. if (req.body[0]) {
  2091. p = [
  2092. req.body[0].uid,
  2093. req.body[0].title,
  2094. req.body[0].brief,
  2095. req.body[0].cover,
  2096. req.body[0].evaId,
  2097. req.body[0].astudent,
  2098. req.body[0].see,
  2099. req.body[0].chapters,
  2100. req.body[0].template,
  2101. req.body[0].ateacher,
  2102. ];
  2103. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addCourseWorkNew2"); //執行存儲過程
  2104. mysql.usselect(p, function(ret) {
  2105. let course = req.body[0].courseType;
  2106. let courseId = ret[0][0].courseId;
  2107. let userid = req.body[0].uid;
  2108. delCourseTypeS(course, courseId, userid);
  2109. res.end(
  2110. JSON.stringify({
  2111. ordernumber: ret[0][0].ordernumber,
  2112. courseId: ret[0][0].courseId,
  2113. success: 1,
  2114. })
  2115. );
  2116. });
  2117. }
  2118. });
  2119. //新增赛事项目
  2120. router.route("/addRace").all((req, res, next) => {
  2121. if (req.body[0]) {
  2122. p = [
  2123. req.body[0].uid,
  2124. req.body[0].info,
  2125. req.body[0].over,
  2126. req.body[0].pro,
  2127. req.body[0].act,
  2128. req.body[0].exc,
  2129. req.body[0].res,
  2130. ];
  2131. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addRace"); //執行存儲過程
  2132. mysql.usselect(p, function(ret) {
  2133. let course = req.body[0].courseType;
  2134. let courseId = ret[0][0].id;
  2135. let userid = req.body[0].uid;
  2136. delCourseType1(course, courseId, userid);
  2137. res.end(JSON.stringify({ courseId: courseId, success: 1 }));
  2138. });
  2139. }
  2140. });
  2141. //新增赛事项目
  2142. router.route("/addRace2").all((req, res, next) => {
  2143. if (req.body[0]) {
  2144. p = [
  2145. req.body[0].uid,
  2146. req.body[0].info,
  2147. req.body[0].over,
  2148. req.body[0].pro,
  2149. req.body[0].act,
  2150. req.body[0].exc,
  2151. req.body[0].res,
  2152. ];
  2153. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addRace2"); //執行存儲過程
  2154. mysql.usselect(p, function(ret) {
  2155. let course = req.body[0].courseType;
  2156. let courseId = ret[0][0].id;
  2157. let userid = req.body[0].uid;
  2158. delCourseType1(course, courseId, userid);
  2159. res.end(JSON.stringify({ courseId: courseId, success: 1 }));
  2160. });
  2161. }
  2162. });
  2163. //新增赛事账号信息
  2164. router.route("/addRaceUser").all((req, res, next) => {
  2165. if (req.body[0]) {
  2166. p = [
  2167. req.body[0].reg,
  2168. req.body[0].res,
  2169. req.body[0].sch,
  2170. req.body[0].n,
  2171. req.body[0].p,
  2172. req.body[0].t,
  2173. req.body[0].parent,
  2174. ];
  2175. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addRaceUser"); //執行存儲過程
  2176. mysql.usselect(p, function(ret) {
  2177. let num = ret[0][0].num;
  2178. let userid = ret[0][0].userid;
  2179. if (num < 10) {
  2180. num = "SZ" + "00" + num + "@gdae.com";
  2181. } else if (num < 100) {
  2182. num = "SZ" + "0" + num + "@gdae.com";
  2183. } else if (num > 100) {
  2184. num = "SZ" + num + "@gdae.com";
  2185. }
  2186. y = [userid, num, bcrypt.hashSync("Coco1234", bcrypt.genSaltSync(10))];
  2187. //参数拼接,注册
  2188. y.unshift(_mysqlLabor[0], _mysqlLabor[1], "upRaceUserNamePassword");
  2189. mysql.usselect(y, function(ret) {
  2190. res.end(JSON.stringify(ret));
  2191. });
  2192. res.end(JSON.stringify({ num: num, success: 1 }));
  2193. });
  2194. }
  2195. });
  2196. //修改赛事项目
  2197. router.route("/updateRace").all((req, res, next) => {
  2198. if (req.body[0]) {
  2199. p = [
  2200. req.body[0].id,
  2201. req.body[0].info,
  2202. req.body[0].over,
  2203. req.body[0].pro,
  2204. req.body[0].act,
  2205. req.body[0].exc,
  2206. req.body[0].res,
  2207. ];
  2208. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateRace"); //執行存儲過程
  2209. mysql.usselect(p, function(ret) {
  2210. let course = req.body[0].courseType;
  2211. let courseId = req.body[0].id;
  2212. let userid = req.body[0].uid;
  2213. delCourseType1(course, courseId, userid);
  2214. res.end(JSON.stringify({ success: 1 }));
  2215. });
  2216. }
  2217. });
  2218. router.route("/addWorkNew3").all((req, res, next) => {
  2219. if (req.body[0]) {
  2220. p = [
  2221. req.body[0].uid,
  2222. req.body[0].title,
  2223. req.body[0].brief,
  2224. req.body[0].cover,
  2225. req.body[0].astudent,
  2226. req.body[0].see,
  2227. req.body[0].chapters,
  2228. req.body[0].template,
  2229. req.body[0].ateacher,
  2230. ];
  2231. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new3"); //執行存儲過程
  2232. mysql.usselect(p, function(ret) {
  2233. let course = req.body[0].courseType;
  2234. let courseId = ret[0][0].courseId;
  2235. let userid = req.body[0].uid;
  2236. delCourseType(course, courseId, userid);
  2237. res.end(
  2238. JSON.stringify({
  2239. ordernumber: ret[0][0].ordernumber,
  2240. courseId: ret[0][0].courseId,
  2241. success: 1,
  2242. })
  2243. );
  2244. });
  2245. }
  2246. });
  2247. router.route("/addInviteCode").all((req, res, next) => {
  2248. if (req.body[0]) {
  2249. addCourseInviteCode(
  2250. req.body[0].courseId,
  2251. JSON.parse(decodeURIComponent(req.body[0].inviteCode))
  2252. );
  2253. }
  2254. });
  2255. function delCourseInviteCode(courseId, inviteCode) {
  2256. let _courseId = courseId;
  2257. var _userdata = [_courseId];
  2258. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_courseInviteCode");
  2259. mysql.usselect(_userdata, function(ret) {
  2260. // console.log(ret);
  2261. addCourseInviteCode(_courseId, inviteCode);
  2262. });
  2263. }
  2264. function delCourseType(course, courseId, userid) {
  2265. let _courseId = courseId;
  2266. var _userdata = [_courseId];
  2267. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_courseType");
  2268. mysql.usselect(_userdata, function(ret) {
  2269. // console.log(ret);
  2270. addCourseType(userid, course, _courseId);
  2271. });
  2272. // setTimeout(() => {
  2273. // }, 1000);
  2274. }
  2275. function delCourseType1(course, courseId, userid) {
  2276. let _courseId = courseId;
  2277. var _userdata = [_courseId];
  2278. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_courseType1");
  2279. mysql.usselect(_userdata, function(ret) {
  2280. // console.log(ret);
  2281. });
  2282. setTimeout(() => {
  2283. addCourseType1(userid, course, _courseId);
  2284. }, 1000);
  2285. }
  2286. function delCourseTypeS(course, courseId, userid) {
  2287. let _courseId = courseId;
  2288. var _userdata = [_courseId];
  2289. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_courseTypeS");
  2290. mysql.usselect(_userdata, function(ret) {
  2291. // console.log(ret);
  2292. addCourseTypeS(userid, course, _courseId);
  2293. });
  2294. // setTimeout(() => {
  2295. // }, 1000);
  2296. }
  2297. function addCourseInviteCode(courseId, inviteCode) {
  2298. var _courses = courseId;
  2299. var _tid = inviteCode;
  2300. for (let i = 0; i < _tid.length; i++) {
  2301. let _userdata = [_courses, _tid[i].cid, _tid[i].ic];
  2302. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_courseInviteCode");
  2303. setTimeout(() => {
  2304. mysql.usselect(_userdata, function(ret) {
  2305. // console.log(ret);
  2306. });
  2307. }, i * 500);
  2308. }
  2309. }
  2310. function addCourseType(userid, course, _courseId) {
  2311. var _uid = userid;
  2312. var _courses = _courseId;
  2313. var _tid = JSON.parse(decodeURIComponent(course));
  2314. for (let i = 0; i < _tid.length; i++) {
  2315. if (_tid[i] == "") {
  2316. continue;
  2317. }
  2318. var _userdata = [_courses, _tid[i], _uid];
  2319. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_courseType");
  2320. mysql.usselect(_userdata, function(ret) {
  2321. // console.log(ret);
  2322. });
  2323. }
  2324. }
  2325. function addCourseType1(userid, course, _courseId) {
  2326. var _uid = userid;
  2327. var _courses = _courseId;
  2328. var _tid = JSON.parse(decodeURIComponent(course));
  2329. for (let i = 0; i < _tid.length; i++) {
  2330. if (_tid[i] == "") {
  2331. continue;
  2332. }
  2333. var _userdata = [_courses, _tid[i], _uid];
  2334. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_courseType1");
  2335. mysql.usselect(_userdata, function(ret) {
  2336. // console.log(ret);
  2337. });
  2338. }
  2339. }
  2340. function addCourseTypeS(userid, course, _courseId) {
  2341. var _uid = userid;
  2342. var _courses = _courseId;
  2343. var _tid = JSON.parse(decodeURIComponent(course));
  2344. for (let i = 0; i < _tid.length; i++) {
  2345. if (_tid[i] == "") {
  2346. continue;
  2347. }
  2348. var _userdata = [_courses, _tid[i], _uid];
  2349. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_courseTypeS");
  2350. mysql.usselect(_userdata, function(ret) {
  2351. // console.log(ret);
  2352. });
  2353. }
  2354. }
  2355. //修改课程
  2356. // router.route('/updateWork').all((req, res, next) => {
  2357. // postmysql(req, res, "update_teacher_work");
  2358. // });
  2359. router.route("/updateWorkNew").all((req, res, next) => {
  2360. if (req.body[0]) {
  2361. // p = Object.values(req.body[0]);
  2362. p = [
  2363. req.body[0].cid,
  2364. req.body[0].title,
  2365. req.body[0].brief,
  2366. req.body[0].cover,
  2367. req.body[0].astudent,
  2368. req.body[0].see,
  2369. req.body[0].chapters,
  2370. req.body[0].template,
  2371. ];
  2372. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new");
  2373. //執行存儲過程
  2374. mysql.usselect(p, function(ret) {
  2375. let course = req.body[0].courseType;
  2376. let courseId = req.body[0].cid;
  2377. let userid = req.body[0].uid;
  2378. delCourseType(course, courseId, userid);
  2379. res.end(JSON.stringify({ success: 1 }));
  2380. // res.end(JSON.stringify(ret));
  2381. });
  2382. }
  2383. });
  2384. //查询课程
  2385. // router.route('/selectCourse').all((req, res, next) => {
  2386. // var json = queryString(req.url);
  2387. // getmysql(req, res, "select_course", json['type'], json['uid'], json['oid'], json['page'], 10);
  2388. // });
  2389. router.route("/updateWorkNew2").all((req, res, next) => {
  2390. if (req.body[0]) {
  2391. p = [
  2392. req.body[0].cid,
  2393. req.body[0].title,
  2394. req.body[0].brief,
  2395. req.body[0].cover,
  2396. req.body[0].evaId,
  2397. req.body[0].astudent,
  2398. req.body[0].see,
  2399. req.body[0].chapters,
  2400. req.body[0].template,
  2401. req.body[0].ateacher,
  2402. ];
  2403. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new2"); //執行存儲過程
  2404. mysql.usselect(p, function(ret) {
  2405. let course = req.body[0].courseType;
  2406. let courseId = req.body[0].cid;
  2407. let userid = req.body[0].uid;
  2408. delCourseType(course, courseId, userid);
  2409. res.end(JSON.stringify({ success: 1 }));
  2410. });
  2411. }
  2412. });
  2413. router.route("/updateWorkNew2AI").all((req, res, next) => {
  2414. if (req.body[0]) {
  2415. p = [
  2416. req.body[0].cid,
  2417. req.body[0].title,
  2418. req.body[0].brief,
  2419. req.body[0].cover,
  2420. req.body[0].evaId,
  2421. req.body[0].astudent,
  2422. req.body[0].see,
  2423. req.body[0].chapters,
  2424. req.body[0].template,
  2425. req.body[0].ateacher,
  2426. req.body[0].refile,
  2427. req.body[0].reBrief,
  2428. ];
  2429. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new2_ai"); //執行存儲過程
  2430. mysql.usselect(p, function(ret) {
  2431. let course = req.body[0].courseType;
  2432. let courseId = req.body[0].cid;
  2433. let userid = req.body[0].uid;
  2434. delCourseType(course, courseId, userid);
  2435. res.end(JSON.stringify({ success: 1 }));
  2436. });
  2437. }
  2438. });
  2439. router.route("/updateWorkNew2AI2").all((req, res, next) => {
  2440. if (req.body[0]) {
  2441. p = [
  2442. req.body[0].cid,
  2443. req.body[0].title,
  2444. req.body[0].brief,
  2445. req.body[0].cover,
  2446. req.body[0].evaId,
  2447. req.body[0].astudent,
  2448. req.body[0].see,
  2449. req.body[0].chapters,
  2450. req.body[0].template,
  2451. req.body[0].ateacher,
  2452. req.body[0].refile,
  2453. req.body[0].reBrief,
  2454. req.body[0].cpote,
  2455. ];
  2456. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new2_ai2"); //執行存儲過程
  2457. mysql.usselect(p, function(ret) {
  2458. let course = req.body[0].courseType;
  2459. let courseId = req.body[0].cid;
  2460. let userid = req.body[0].uid;
  2461. delCourseType(course, courseId, userid);
  2462. res.end(JSON.stringify({ success: 1 }));
  2463. });
  2464. }
  2465. });
  2466. router.route("/updateWorkNew2AI3").all((req, res, next) => {
  2467. if (req.body[0]) {
  2468. p = [
  2469. req.body[0].cid,
  2470. req.body[0].title,
  2471. req.body[0].brief,
  2472. req.body[0].cover,
  2473. req.body[0].evaId,
  2474. req.body[0].astudent,
  2475. req.body[0].see,
  2476. req.body[0].chapters,
  2477. req.body[0].template,
  2478. req.body[0].ateacher,
  2479. req.body[0].refile,
  2480. req.body[0].reBrief,
  2481. req.body[0].cpote,
  2482. req.body[0].setting,
  2483. req.body[0].iresearch,
  2484. ];
  2485. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new2_ai3"); //執行存儲過程
  2486. mysql.usselect(p, function(ret) {
  2487. let course = req.body[0].courseType;
  2488. let courseId = req.body[0].cid;
  2489. let userid = req.body[0].uid;
  2490. delCourseType(course, courseId, userid);
  2491. res.end(JSON.stringify({ success: 1 }));
  2492. });
  2493. }
  2494. });
  2495. router.route("/updateWorkNew2New").all((req, res, next) => {
  2496. if (req.body[0]) {
  2497. p = [
  2498. req.body[0].cid,
  2499. req.body[0].title,
  2500. req.body[0].brief,
  2501. req.body[0].cover,
  2502. req.body[0].evaId,
  2503. req.body[0].astudent,
  2504. req.body[0].see,
  2505. req.body[0].chapters,
  2506. req.body[0].template,
  2507. req.body[0].ateacher,
  2508. req.body[0].highSetting
  2509. ];
  2510. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new2New"); //執行存儲過程
  2511. mysql.usselect(p, function(ret) {
  2512. let course = req.body[0].courseType;
  2513. let courseId = req.body[0].cid;
  2514. let userid = req.body[0].uid;
  2515. delCourseType(course, courseId, userid);
  2516. res.end(JSON.stringify({ success: 1 }));
  2517. });
  2518. }
  2519. });
  2520. router.route("/updateTrainCourseNew2").all((req, res, next) => {
  2521. if (req.body[0]) {
  2522. p = [
  2523. req.body[0].cid,
  2524. req.body[0].title,
  2525. req.body[0].brief,
  2526. req.body[0].cover,
  2527. req.body[0].evaId,
  2528. req.body[0].astudent,
  2529. req.body[0].see,
  2530. req.body[0].chapters,
  2531. req.body[0].template,
  2532. req.body[0].ateacher,
  2533. ];
  2534. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTrainCourseNew2"); //執行存儲過程
  2535. mysql.usselect(p, function(ret) {
  2536. let course = req.body[0].courseType;
  2537. let courseId = req.body[0].cid;
  2538. let userid = req.body[0].uid;
  2539. delCourseType(course, courseId, userid);
  2540. res.end(JSON.stringify({ success: 1 }));
  2541. });
  2542. }
  2543. });
  2544. router.route("/updateTestCourse").all((req, res, next) => { //修改评测
  2545. if (req.body[0]) {
  2546. p = [
  2547. req.body[0].cid,
  2548. req.body[0].title,
  2549. req.body[0].brief,
  2550. req.body[0].cover,
  2551. req.body[0].evaId,
  2552. req.body[0].astudent,
  2553. req.body[0].see,
  2554. req.body[0].chapters,
  2555. req.body[0].template,
  2556. req.body[0].ateacher,
  2557. req.body[0].look,
  2558. req.body[0].typeid,
  2559. req.body[0].overtime,
  2560. req.body[0].j2,
  2561. ];
  2562. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTestCourse"); //執行存儲過程
  2563. mysql.usselect(p, function(ret) {
  2564. let course = req.body[0].courseType;
  2565. let courseId = req.body[0].cid;
  2566. let userid = req.body[0].uid;
  2567. delCourseType(course, courseId, userid);
  2568. res.end(JSON.stringify({ success: 1 }));
  2569. });
  2570. }
  2571. });
  2572. router.route("/updateTestCourse2").all((req, res, next) => { //修改评测
  2573. if (req.body[0]) {
  2574. p = [
  2575. req.body[0].cid,
  2576. req.body[0].title,
  2577. req.body[0].brief,
  2578. req.body[0].cover,
  2579. req.body[0].evaId,
  2580. req.body[0].astudent,
  2581. req.body[0].see,
  2582. req.body[0].chapters,
  2583. req.body[0].template,
  2584. req.body[0].ateacher,
  2585. req.body[0].look,
  2586. req.body[0].typeid,
  2587. ];
  2588. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTestCourse2"); //執行存儲過程
  2589. mysql.usselect(p, function(ret) {
  2590. let course = req.body[0].courseType;
  2591. let courseId = req.body[0].cid;
  2592. let userid = req.body[0].uid;
  2593. delCourseType(course, courseId, userid);
  2594. res.end(JSON.stringify({ success: 1 }));
  2595. });
  2596. }
  2597. });
  2598. router.route("/updateTestCourse3").all((req, res, next) => { //修改评测
  2599. if (req.body[0]) {
  2600. p = [
  2601. req.body[0].cid,
  2602. req.body[0].title,
  2603. req.body[0].brief,
  2604. req.body[0].cover,
  2605. req.body[0].evaId,
  2606. req.body[0].astudent,
  2607. req.body[0].see,
  2608. req.body[0].chapters,
  2609. req.body[0].template,
  2610. req.body[0].ateacher,
  2611. req.body[0].look,
  2612. req.body[0].typeid,
  2613. req.body[0].overtime,
  2614. req.body[0].j2,
  2615. req.body[0].j3,
  2616. ];
  2617. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTestCourse3"); //執行存儲過程
  2618. mysql.usselect(p, function(ret) {
  2619. let course = req.body[0].courseType;
  2620. let courseId = req.body[0].cid;
  2621. let userid = req.body[0].uid;
  2622. delCourseType(course, courseId, userid);
  2623. res.end(JSON.stringify({ success: 1 }));
  2624. });
  2625. }
  2626. });
  2627. router.route("/updateSynergy").all((req, res, next) => {
  2628. if (req.body[0]) {
  2629. p = [
  2630. req.body[0].cid,
  2631. req.body[0].title,
  2632. req.body[0].brief,
  2633. req.body[0].cover,
  2634. req.body[0].evaId,
  2635. req.body[0].astudent,
  2636. req.body[0].see,
  2637. req.body[0].chapters,
  2638. req.body[0].template,
  2639. req.body[0].ateacher,
  2640. ];
  2641. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_synergy"); //執行存儲過程
  2642. mysql.usselect(p, function(ret) {
  2643. let course = req.body[0].courseType;
  2644. let courseId = req.body[0].cid;
  2645. let userid = req.body[0].uid;
  2646. delCourseType(course, courseId, userid);
  2647. res.end(JSON.stringify({ success: 1 }));
  2648. });
  2649. }
  2650. });
  2651. router.route("/updateWorkNew5").all((req, res, next) => {
  2652. if (req.body[0]) {
  2653. p = [
  2654. req.body[0].cid,
  2655. req.body[0].title,
  2656. req.body[0].brief,
  2657. req.body[0].cover,
  2658. req.body[0].evaId,
  2659. req.body[0].astudent,
  2660. req.body[0].see,
  2661. req.body[0].chapters,
  2662. req.body[0].template,
  2663. req.body[0].ateacher,
  2664. req.body[0].inviteCode,
  2665. ];
  2666. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new5"); //執行存儲過程
  2667. mysql.usselect(p, function(ret) {
  2668. let course = req.body[0].courseType;
  2669. let courseId = req.body[0].cid;
  2670. let userid = req.body[0].uid;
  2671. delCourseType(course, courseId, userid);
  2672. res.end(JSON.stringify({ success: 1 }));
  2673. });
  2674. }
  2675. });
  2676. router.route("/updateStudentWorkNew2").all((req, res, next) => {
  2677. //学生
  2678. if (req.body[0]) {
  2679. p = [
  2680. req.body[0].cid,
  2681. req.body[0].title,
  2682. req.body[0].brief,
  2683. req.body[0].cover,
  2684. req.body[0].evaId,
  2685. req.body[0].astudent,
  2686. req.body[0].see,
  2687. req.body[0].chapters,
  2688. req.body[0].template,
  2689. req.body[0].ateacher,
  2690. ];
  2691. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew2"); //執行存儲過程
  2692. mysql.usselect(p, function(ret) {
  2693. let course = req.body[0].courseType;
  2694. let courseId = req.body[0].cid;
  2695. let userid = req.body[0].uid;
  2696. delCourseType(course, courseId, userid);
  2697. res.end(JSON.stringify({ success: 1 }));
  2698. });
  2699. }
  2700. });
  2701. router.route("/updateStudentWorkNew22").all((req, res, next) => {
  2702. //学生
  2703. if (req.body[0]) {
  2704. p = [
  2705. req.body[0].cid,
  2706. req.body[0].title,
  2707. req.body[0].brief,
  2708. req.body[0].cover,
  2709. req.body[0].evaId,
  2710. req.body[0].astudent,
  2711. req.body[0].see,
  2712. req.body[0].chapters,
  2713. req.body[0].template,
  2714. req.body[0].ateacher,
  2715. ];
  2716. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew2"); //執行存儲過程
  2717. mysql.usselect(p, function(ret) {
  2718. let course = req.body[0].courseType;
  2719. let courseId = req.body[0].cid;
  2720. let userid = req.body[0].uid;
  2721. delCourseTypeS(course, courseId, userid);
  2722. res.end(JSON.stringify({ success: 1 }));
  2723. });
  2724. }
  2725. });
  2726. router.route("/updateWorkNew3").all((req, res, next) => {
  2727. if (req.body[0]) {
  2728. p = [
  2729. req.body[0].cid,
  2730. req.body[0].title,
  2731. req.body[0].brief,
  2732. req.body[0].cover,
  2733. req.body[0].astudent,
  2734. req.body[0].see,
  2735. req.body[0].chapters,
  2736. req.body[0].template,
  2737. req.body[0].ateacher,
  2738. ];
  2739. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new3"); //執行存儲過程
  2740. mysql.usselect(p, function(ret) {
  2741. let course = req.body[0].courseType;
  2742. let courseId = req.body[0].cid;
  2743. let userid = req.body[0].uid;
  2744. delCourseType(course, courseId, userid);
  2745. res.end(JSON.stringify({ success: 1 }));
  2746. });
  2747. }
  2748. });
  2749. function guid() {
  2750. var _num,
  2751. i,
  2752. _guid = "";
  2753. for (i = 0; i < 32; i++) {
  2754. _guid += Math.floor(Math.random() * 16).toString(16); //随机0 - 16 的数字 转变为16进制的字符串
  2755. _num = Math.floor((i - 7) / 4); //计算 (i-7)除4
  2756. if (_num > -1 && _num < 4 && i == 7 + 4 * _num) {
  2757. //会使guid中间加 "-" 形式为xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  2758. _guid += "-";
  2759. }
  2760. }
  2761. return _guid;
  2762. }
  2763. router.route("/updateWorkNew4").all((req, res, next) => {
  2764. if (req.body[0]) {
  2765. let p = [req.body[0].cid];
  2766. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_course_detail"); //執行存儲過程
  2767. mysql.usselect(p, function(ret) {
  2768. let _unitIndex = parseInt(req.body[0].unitIndex);
  2769. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  2770. let _unitJson = JSON.parse(ret[0][0].chapters);
  2771. if (_unitJson.length - 1 < _unitIndex) {
  2772. let _i = _unitIndex - (_unitJson.length - 1);
  2773. for (let i = 0; i < _i; i++) {
  2774. _unitJson.push({
  2775. dyName: "", //单元标题
  2776. chapterInfo: [{
  2777. isread: false,
  2778. chapterid: guid(),
  2779. title: "",
  2780. courseName: "",
  2781. taskJson: [{
  2782. task: "",
  2783. taskDetail: "",
  2784. chapterData: [],
  2785. toolText: "",
  2786. toolChoose: [{
  2787. tool: [],
  2788. toolDetail: "",
  2789. toolType: 0,
  2790. askCount: 1,
  2791. askTitle: "",
  2792. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  2793. }, ],
  2794. isShowTools: false,
  2795. askCount: 1,
  2796. isFold: 0,
  2797. askTitle: "",
  2798. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  2799. checkJson: [{ checkCount: [], checkPerent: [] }],
  2800. homeworkList: [],
  2801. }, ],
  2802. itemCount: 1,
  2803. fileList1: [],
  2804. video: [],
  2805. testData: [],
  2806. pData: [],
  2807. templateArray: [],
  2808. }, ],
  2809. });
  2810. }
  2811. _unitJson[_unitIndex] = _chapters[_unitIndex];
  2812. } else {
  2813. _unitJson[_unitIndex] = _chapters[_unitIndex];
  2814. }
  2815. // console.log(_unitJson);
  2816. let p2 = [
  2817. req.body[0].cid,
  2818. // JSON.stringify(_unitJson).replaceAll(/%/g, "%25")
  2819. encodeURIComponent(JSON.stringify(_unitJson)),
  2820. ];
  2821. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new4"); //執行存儲過程
  2822. mysql.usselect(p2, function(ret) {
  2823. res.end(JSON.stringify({ success: 1 }));
  2824. });
  2825. // res.end(JSON.stringify({ success: 1 }));
  2826. });
  2827. }
  2828. });
  2829. router.route("/updateTrainCourseNew4").all((req, res, next) => {
  2830. if (req.body[0]) {
  2831. let p = [req.body[0].cid];
  2832. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_trainCourse_detail"); //執行存儲過程
  2833. mysql.usselect(p, function(ret) {
  2834. let _unitIndex = parseInt(req.body[0].unitIndex);
  2835. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  2836. let _unitJson = JSON.parse(ret[0][0].chapters);
  2837. if (_unitJson.length - 1 < _unitIndex) {
  2838. let _i = _unitIndex - (_unitJson.length - 1);
  2839. for (let i = 0; i < _i; i++) {
  2840. _unitJson.push({
  2841. dyName: "", //单元标题
  2842. chapterInfo: [{
  2843. isread: false,
  2844. chapterid: guid(),
  2845. title: "",
  2846. courseName: "",
  2847. taskJson: [{
  2848. task: "",
  2849. taskDetail: "",
  2850. chapterData: [],
  2851. toolText: "",
  2852. toolChoose: [{
  2853. tool: [],
  2854. toolDetail: "",
  2855. toolType: 0,
  2856. askCount: 1,
  2857. askTitle: "",
  2858. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  2859. }, ],
  2860. isShowTools: false,
  2861. askCount: 1,
  2862. isFold: 0,
  2863. askTitle: "",
  2864. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  2865. checkJson: [{ checkCount: [], checkPerent: [] }],
  2866. homeworkList: [],
  2867. }, ],
  2868. itemCount: 1,
  2869. fileList1: [],
  2870. video: [],
  2871. testData: [],
  2872. pData: [],
  2873. templateArray: [],
  2874. }, ],
  2875. });
  2876. }
  2877. _unitJson[_unitIndex] = _chapters[_unitIndex];
  2878. } else {
  2879. _unitJson[_unitIndex] = _chapters[_unitIndex];
  2880. }
  2881. // console.log(_unitJson);
  2882. let p2 = [
  2883. req.body[0].cid,
  2884. encodeURIComponent(JSON.stringify(_unitJson)),
  2885. ];
  2886. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTrainCourseNew4"); //執行存儲過程
  2887. mysql.usselect(p2, function(ret) {
  2888. res.end(JSON.stringify({ success: 1 }));
  2889. });
  2890. // res.end(JSON.stringify({ success: 1 }));
  2891. });
  2892. }
  2893. });
  2894. router.route("/updateStudentWorkNew4").all((req, res, next) => {
  2895. //学生
  2896. if (req.body[0]) {
  2897. let p = [req.body[0].cid];
  2898. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_student_course_detail2"); //執行存儲過程
  2899. mysql.usselect(p, function(ret) {
  2900. let _unitIndex = parseInt(req.body[0].unitIndex);
  2901. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  2902. let _unitJson = JSON.parse(ret[0][0].chapters);
  2903. if (_unitJson.length - 1 < _unitIndex) {
  2904. let _i = _unitIndex - (_unitJson.length - 1);
  2905. for (let i = 0; i < _i; i++) {
  2906. _unitJson.push({
  2907. dyName: "", //单元标题
  2908. chapterInfo: [{
  2909. isread: false,
  2910. chapterid: guid(),
  2911. title: "",
  2912. courseName: "",
  2913. taskJson: [{
  2914. task: "",
  2915. taskDetail: "",
  2916. chapterData: [],
  2917. toolText: "",
  2918. toolChoose: [{
  2919. tool: [],
  2920. toolDetail: "",
  2921. toolType: 0,
  2922. askCount: 1,
  2923. askTitle: "",
  2924. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  2925. }, ],
  2926. isShowTools: false,
  2927. askCount: 1,
  2928. isFold: 0,
  2929. askTitle: "",
  2930. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  2931. checkJson: [{ checkCount: [], checkPerent: [] }],
  2932. homeworkList: [],
  2933. }, ],
  2934. itemCount: 1,
  2935. fileList1: [],
  2936. video: [],
  2937. testData: [],
  2938. pData: [],
  2939. templateArray: [],
  2940. }, ],
  2941. });
  2942. }
  2943. _unitJson[_unitIndex] = _chapters[_unitIndex];
  2944. } else {
  2945. _unitJson[_unitIndex] = _chapters[_unitIndex];
  2946. }
  2947. // console.log(_unitJson);
  2948. let p2 = [
  2949. req.body[0].cid,
  2950. encodeURIComponent(JSON.stringify(_unitJson)),
  2951. ];
  2952. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew4"); //執行存儲過程
  2953. mysql.usselect(p2, function(ret) {
  2954. res.end(JSON.stringify({ success: 1 }));
  2955. });
  2956. // res.end(JSON.stringify({ success: 1 }));
  2957. });
  2958. }
  2959. });
  2960. //协同删除阶段
  2961. router.route("/deleteWork").all((req, res, next) => {
  2962. if (req.body[0]) {
  2963. let p = [req.body[0].cid];
  2964. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_course_detail"); //執行存儲過程
  2965. mysql.usselect(p, function(ret) {
  2966. let _chapid = req.body[0].chapid;
  2967. // console.log(_chapid);
  2968. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  2969. let _unitJson = JSON.parse(ret[0][0].chapters);
  2970. let _unitJson2 = [];
  2971. for (var i = 0; i < _unitJson.length; i++) {
  2972. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  2973. // console.log(1);
  2974. // _unitJson.splice(i, -1)
  2975. _unitJson2.push(_unitJson[i]);
  2976. // break;
  2977. }
  2978. }
  2979. // console.log(_unitJson2);
  2980. let p2 = [
  2981. req.body[0].cid,
  2982. encodeURIComponent(JSON.stringify(_unitJson2)),
  2983. ];
  2984. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new4"); //執行存儲過程
  2985. mysql.usselect(p2, function(ret) {
  2986. res.end(JSON.stringify({ success: 1 }));
  2987. });
  2988. // res.end(JSON.stringify({ success: 1 }));
  2989. });
  2990. }
  2991. });
  2992. router.route("/deletetrainCourseWork").all((req, res, next) => {
  2993. if (req.body[0]) {
  2994. let p = [req.body[0].cid];
  2995. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_trainCourse_detail"); //執行存儲過程
  2996. mysql.usselect(p, function(ret) {
  2997. let _chapid = req.body[0].chapid;
  2998. // console.log(_chapid);
  2999. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  3000. let _unitJson = JSON.parse(ret[0][0].chapters);
  3001. let _unitJson2 = [];
  3002. for (var i = 0; i < _unitJson.length; i++) {
  3003. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  3004. // console.log(1);
  3005. // _unitJson.splice(i, -1)
  3006. _unitJson2.push(_unitJson[i]);
  3007. // break;
  3008. }
  3009. }
  3010. // console.log(_unitJson2);
  3011. let p2 = [
  3012. req.body[0].cid,
  3013. encodeURIComponent(JSON.stringify(_unitJson2)),
  3014. ];
  3015. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTrainCourseNew4"); //執行存儲過程
  3016. mysql.usselect(p2, function(ret) {
  3017. res.end(JSON.stringify({ success: 1 }));
  3018. });
  3019. // res.end(JSON.stringify({ success: 1 }));
  3020. });
  3021. }
  3022. });
  3023. //协同删除阶段
  3024. router.route("/deleteStudentWork").all((req, res, next) => {
  3025. //学生
  3026. if (req.body[0]) {
  3027. let p = [req.body[0].cid];
  3028. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_student_course_detail2"); //執行存儲過程
  3029. mysql.usselect(p, function(ret) {
  3030. let _chapid = req.body[0].chapid;
  3031. // console.log(_chapid);
  3032. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  3033. let _unitJson = JSON.parse(ret[0][0].chapters);
  3034. let _unitJson2 = [];
  3035. for (var i = 0; i < _unitJson.length; i++) {
  3036. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  3037. // console.log(1);
  3038. // _unitJson.splice(i, -1)
  3039. _unitJson2.push(_unitJson[i]);
  3040. // break;
  3041. }
  3042. }
  3043. // console.log(_unitJson2);
  3044. let p2 = [
  3045. req.body[0].cid,
  3046. encodeURIComponent(JSON.stringify(_unitJson2)),
  3047. ];
  3048. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew4"); //執行存儲過程
  3049. mysql.usselect(p2, function(ret) {
  3050. res.end(JSON.stringify({ success: 1 }));
  3051. });
  3052. // res.end(JSON.stringify({ success: 1 }));
  3053. });
  3054. }
  3055. });
  3056. //协同恢复删除的阶段
  3057. router.route("/restoreWork").all((req, res, next) => {
  3058. if (req.body[0]) {
  3059. let p = [req.body[0].cid];
  3060. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_course_detail"); //執行存儲過程
  3061. mysql.usselect(p, function(ret) {
  3062. let _chapid = req.body[0].chapid;
  3063. // console.log(_chapid);
  3064. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  3065. let _unitJson = JSON.parse(ret[0][0].chapters);
  3066. let _unitJson2 = [];
  3067. let chpaindex;
  3068. for (var i = 0; i < _chapters.length; i++) {
  3069. if (_chapters[i].chapterInfo[0].chapterid == _chapid) {
  3070. chpaindex = i;
  3071. }
  3072. }
  3073. for (var i = 0; i < _unitJson.length; i++) {
  3074. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  3075. // console.log(1);
  3076. // _unitJson.splice(i, -1)
  3077. _unitJson2.push(_unitJson[i]);
  3078. // break;
  3079. }
  3080. }
  3081. _unitJson2.splice(chpaindex, 0, _chapters[chpaindex]);
  3082. // console.log(_unitJson2);
  3083. let p2 = [
  3084. req.body[0].cid,
  3085. encodeURIComponent(JSON.stringify(_unitJson2)),
  3086. ];
  3087. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new4"); //執行存儲過程
  3088. mysql.usselect(p2, function(ret) {
  3089. res.end(JSON.stringify({ success: 1 }));
  3090. });
  3091. // res.end(JSON.stringify({ success: 1 }));
  3092. });
  3093. }
  3094. });
  3095. //协同恢复删除的阶段
  3096. router.route("/restoreTrainCourse").all((req, res, next) => {
  3097. if (req.body[0]) {
  3098. let p = [req.body[0].cid];
  3099. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_trainCourse_detail"); //執行存儲過程
  3100. mysql.usselect(p, function(ret) {
  3101. let _chapid = req.body[0].chapid;
  3102. // console.log(_chapid);
  3103. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  3104. let _unitJson = JSON.parse(ret[0][0].chapters);
  3105. let _unitJson2 = [];
  3106. let chpaindex;
  3107. for (var i = 0; i < _chapters.length; i++) {
  3108. if (_chapters[i].chapterInfo[0].chapterid == _chapid) {
  3109. chpaindex = i;
  3110. }
  3111. }
  3112. for (var i = 0; i < _unitJson.length; i++) {
  3113. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  3114. // console.log(1);
  3115. // _unitJson.splice(i, -1)
  3116. _unitJson2.push(_unitJson[i]);
  3117. // break;
  3118. }
  3119. }
  3120. _unitJson2.splice(chpaindex, 0, _chapters[chpaindex]);
  3121. // console.log(_unitJson2);
  3122. let p2 = [
  3123. req.body[0].cid,
  3124. encodeURIComponent(JSON.stringify(_unitJson2)),
  3125. ];
  3126. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTrainCourseNew4"); //執行存儲過程
  3127. mysql.usselect(p2, function(ret) {
  3128. res.end(JSON.stringify({ success: 1 }));
  3129. });
  3130. // res.end(JSON.stringify({ success: 1 }));
  3131. });
  3132. }
  3133. });
  3134. //协同恢复删除的阶段
  3135. router.route("/restoreStudentWork").all((req, res, next) => {
  3136. //学生
  3137. if (req.body[0]) {
  3138. let p = [req.body[0].cid];
  3139. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_student_course_detail2"); //執行存儲過程
  3140. mysql.usselect(p, function(ret) {
  3141. let _chapid = req.body[0].chapid;
  3142. // console.log(_chapid);
  3143. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  3144. let _unitJson = JSON.parse(ret[0][0].chapters);
  3145. let _unitJson2 = [];
  3146. let chpaindex;
  3147. for (var i = 0; i < _chapters.length; i++) {
  3148. if (_chapters[i].chapterInfo[0].chapterid == _chapid) {
  3149. chpaindex = i;
  3150. }
  3151. }
  3152. for (var i = 0; i < _unitJson.length; i++) {
  3153. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  3154. // console.log(1);
  3155. // _unitJson.splice(i, -1)
  3156. _unitJson2.push(_unitJson[i]);
  3157. // break;
  3158. }
  3159. }
  3160. _unitJson2.splice(chpaindex, 0, _chapters[chpaindex]);
  3161. // console.log(_unitJson2);
  3162. let p2 = [
  3163. req.body[0].cid,
  3164. encodeURIComponent(JSON.stringify(_unitJson2)),
  3165. ];
  3166. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew4"); //執行存儲過程
  3167. mysql.usselect(p2, function(ret) {
  3168. res.end(JSON.stringify({ success: 1 }));
  3169. });
  3170. // res.end(JSON.stringify({ success: 1 }));
  3171. });
  3172. }
  3173. });
  3174. router.route("/selectCourseNew").all((req, res, next) => {
  3175. var json = queryString(req.url);
  3176. getmysql(
  3177. req,
  3178. res,
  3179. "select_course_new",
  3180. json["type"],
  3181. json["uid"],
  3182. json["oid"],
  3183. json["typea"],
  3184. json["typeb"],
  3185. json["typec"],
  3186. json["typed"],
  3187. json["typeE"],
  3188. json["cu"],
  3189. json["cn"],
  3190. json["page"],
  3191. 10
  3192. );
  3193. });
  3194. router.route("/selectCourseNew2").all((req, res, next) => {
  3195. var json = queryString(req.url);
  3196. getmysql(
  3197. req,
  3198. res,
  3199. "select_course_new2",
  3200. json["type"],
  3201. json["uid"],
  3202. json["oid"],
  3203. json["org"],
  3204. json["typea"],
  3205. json["typeb"],
  3206. json["typec"],
  3207. json["typed"],
  3208. json["typeE"],
  3209. json["cu"],
  3210. json["cn"],
  3211. json["page"],
  3212. json["pageSize"]
  3213. );
  3214. });
  3215. router.route("/selectCourseNew2Liyuan").all((req, res, next) => {
  3216. var json = queryString(req.url);
  3217. getmysql(
  3218. req,
  3219. res,
  3220. "selectCourseNew2Liyuan",
  3221. json["type"],
  3222. json["uid"],
  3223. json["oid"],
  3224. json["org"],
  3225. json["typea"],
  3226. json["typeb"],
  3227. json["typec"],
  3228. json["typed"],
  3229. json["typeE"],
  3230. json["cu"],
  3231. json["cn"],
  3232. json["page"],
  3233. json["pageSize"]
  3234. );
  3235. });
  3236. router.route("/selectTrainCourseNew2").all((req, res, next) => {
  3237. var json = queryString(req.url);
  3238. getmysql(
  3239. req,
  3240. res,
  3241. "selectTrainCourseNew2",
  3242. json["type"],
  3243. json["uid"],
  3244. json["oid"],
  3245. json["org"],
  3246. json["typea"],
  3247. json["typeb"],
  3248. json["typec"],
  3249. json["typed"],
  3250. json["typeE"],
  3251. json["cu"],
  3252. json["cn"],
  3253. json["page"],
  3254. json["pageSize"]
  3255. );
  3256. });
  3257. router.route("/selectSynergyCourse").all((req, res, next) => {
  3258. var json = queryString(req.url);
  3259. getmysql(
  3260. req,
  3261. res,
  3262. "selectSynergyCourse",
  3263. json["type"],
  3264. json["uid"],
  3265. json["oid"],
  3266. json["org"],
  3267. json["typea"],
  3268. json["typeb"],
  3269. json["typec"],
  3270. json["typed"],
  3271. json["typeE"],
  3272. json["cu"],
  3273. json["cn"],
  3274. json["page"],
  3275. json["pageSize"]
  3276. );
  3277. });
  3278. router.route("/selectStudentCourseNew2").all((req, res, next) => {
  3279. var json = queryString(req.url);
  3280. getmysql(
  3281. req,
  3282. res,
  3283. "selectStudentCourseNew2",
  3284. json["type"],
  3285. json["uid"],
  3286. json["oid"],
  3287. json["org"],
  3288. json["typea"],
  3289. json["typeb"],
  3290. json["typec"],
  3291. json["typed"],
  3292. json["typeE"],
  3293. json["cu"],
  3294. json["cn"],
  3295. json["page"],
  3296. 10
  3297. );
  3298. });
  3299. router.route("/selectStudentCourseNew22").all((req, res, next) => {
  3300. var json = queryString(req.url);
  3301. getmysql(
  3302. req,
  3303. res,
  3304. "selectStudentCourseNew22",
  3305. json["type"],
  3306. json["uid"],
  3307. json["oid"],
  3308. json["org"],
  3309. json["typea"],
  3310. json["typeb"],
  3311. json["typec"],
  3312. json["typed"],
  3313. json["typef"],
  3314. json["typeE"],
  3315. json["cu"],
  3316. json["cn"],
  3317. json["page"],
  3318. json["pageSize"]
  3319. );
  3320. });
  3321. router.route("/selectStudentCourseNew222").all((req, res, next) => {
  3322. var json = queryString(req.url);
  3323. getmysql(
  3324. req,
  3325. res,
  3326. "selectStudentCourseNew222",
  3327. json["type"],
  3328. json["uid"],
  3329. json["oid"],
  3330. json["org"],
  3331. json["typea"],
  3332. json["typeb"],
  3333. json["typec"],
  3334. json["typed"],
  3335. json["typef"],
  3336. json["typeE"],
  3337. json["cu"],
  3338. json["cn"],
  3339. json["page"],
  3340. json["pageSize"]
  3341. );
  3342. });
  3343. //查询评测
  3344. router.route("/selectTesttCourse").all((req, res, next) => {
  3345. var json = queryString(req.url);
  3346. getmysql(
  3347. req,
  3348. res,
  3349. "selectTesttCourse",
  3350. json["type"],
  3351. json["uid"],
  3352. json["oid"],
  3353. json["org"],
  3354. json["typea"],
  3355. json["typeb"],
  3356. json["typec"],
  3357. json["typed"],
  3358. json["typef"],
  3359. json["typeE"],
  3360. json["cu"],
  3361. json["cn"],
  3362. json["page"],
  3363. json["pageSize"]
  3364. );
  3365. });
  3366. //查询评测
  3367. router.route("/selectTesttCourse3").all((req, res, next) => {
  3368. var json = queryString(req.url);
  3369. getmysql(
  3370. req,
  3371. res,
  3372. "selectTesttCourse3",
  3373. json["type"],
  3374. json["uid"],
  3375. json["oid"],
  3376. json["org"],
  3377. json["typea"],
  3378. json["typeb"],
  3379. json["typec"],
  3380. json["typed"],
  3381. json["typef"],
  3382. json["typeE"],
  3383. json["cu"],
  3384. json["cn"],
  3385. json["page"],
  3386. json["pageSize"]
  3387. );
  3388. });
  3389. //查询评测
  3390. router.route("/selectTesttCourse2").all((req, res, next) => {
  3391. var json = queryString(req.url);
  3392. getmysql(
  3393. req,
  3394. res,
  3395. "selectTesttCourse2",
  3396. json["oid"],
  3397. json["org"],
  3398. json["type"],
  3399. json["cn"],
  3400. json["page"],
  3401. json["pageSize"]
  3402. );
  3403. });
  3404. //查询评测 评测中心
  3405. router.route("/selectTesttCourseCenter").all((req, res, next) => {
  3406. var json = queryString(req.url);
  3407. getmysql(
  3408. req,
  3409. res,
  3410. "selectTesttCourseCenter",
  3411. json["type"],
  3412. json["uid"],
  3413. json["oid"],
  3414. json["org"],
  3415. json["classid"],
  3416. json["typea"],
  3417. json["typeb"],
  3418. json["typec"],
  3419. json["typed"],
  3420. json["typef"],
  3421. json["typeE"],
  3422. json["cu"],
  3423. json["cn"],
  3424. json["page"],
  3425. json["pageSize"]
  3426. );
  3427. });
  3428. //查询评测 评测中心及作业
  3429. router.route("/selectTesttCourseCenter1").all((req, res, next) => {
  3430. var json = queryString(req.url);
  3431. getmysql(
  3432. req,
  3433. res,
  3434. "selectTesttCourseCenter1",
  3435. json["type"],
  3436. json["uid"],
  3437. json["oid"],
  3438. json["org"],
  3439. json["classid"],
  3440. json["typea"],
  3441. json["typeb"],
  3442. json["typec"],
  3443. json["typed"],
  3444. json["typef"],
  3445. json["typeE"],
  3446. json["cu"],
  3447. json["cn"],
  3448. json["page"],
  3449. json["pageSize"]
  3450. );
  3451. });
  3452. router.route("/selectStudentCourseNew22Mode").all((req, res, next) => {
  3453. var json = queryString(req.url);
  3454. getmysql(
  3455. req,
  3456. res,
  3457. "selectStudentCourseNew22Mode",
  3458. json["type"],
  3459. json["uid"],
  3460. json["oid"],
  3461. json["org"],
  3462. json["typea"],
  3463. json["typeb"],
  3464. json["typec"],
  3465. json["typed"],
  3466. json["typef"],
  3467. json["typeE"],
  3468. json["cu"],
  3469. json["cn"]
  3470. );
  3471. });
  3472. //查询协同编辑课程
  3473. router.route("/selectCourseTeam").all((req, res, next) => {
  3474. var json = queryString(req.url);
  3475. getmysql(req, res, "selectCourseTeam", json["uid"], json["oid"]);
  3476. });
  3477. //查询学校
  3478. router.route("/selectSchoolName").all((req, res, next) => {
  3479. var json = queryString(req.url);
  3480. getmysql(req, res, "selectOidName", json["cu"], json["cn"], json["page"], 10);
  3481. });
  3482. //查询组织
  3483. router.route("/selectOrgName").all((req, res, next) => {
  3484. var json = queryString(req.url);
  3485. getmysql(req, res, "selectOrgName", json["page"], 10);
  3486. });
  3487. //查询学校
  3488. router.route("/selectSchoolName2").all((req, res, next) => {
  3489. var json = queryString(req.url);
  3490. getmysql(req, res, "selectOidName2", json["oid"]);
  3491. });
  3492. //查询学校
  3493. router.route("/selectSchoolNameOrg").all((req, res, next) => {
  3494. var json = queryString(req.url);
  3495. getmysql(req, res, "selectSchoolNameOrg", json["org"], json["page"], 10);
  3496. });
  3497. //查询协同学校和被协同学校
  3498. router.route("/selectOrgType").all((req, res, next) => {
  3499. var json = queryString(req.url);
  3500. getmysql(req, res, "selectOrgType", json["t"], json["org"], json["page"], 10);
  3501. });
  3502. //新增批注
  3503. router.route("/addPz").all((req, res, next) => {
  3504. postmysql(req, res, "addPz");
  3505. });
  3506. //新增批注
  3507. router.route("/addPz2").all((req, res, next) => {
  3508. postmysql(req, res, "addPz2");
  3509. });
  3510. //新增回复
  3511. router.route("/addHf").all((req, res, next) => {
  3512. postmysql(req, res, "addHf");
  3513. });
  3514. //删除批注
  3515. router.route("/deletePz").all((req, res, next) => {
  3516. postmysql(req, res, "deletePz");
  3517. });
  3518. //删除回复
  3519. router.route("/deleteReply").all((req, res, next) => {
  3520. postmysql(req, res, "deleteReply");
  3521. });
  3522. //查询批注列表
  3523. router.route("/selectPzList").all((req, res, next) => {
  3524. var json = queryString(req.url);
  3525. getmysql(req, res, "selectPzList", json["cid"], json["s"], json["t"]);
  3526. });
  3527. //查询批注列表
  3528. router.route("/selectPzListType").all((req, res, next) => {
  3529. var json = queryString(req.url);
  3530. getmysql(req, res, "selectPzListType", json["cid"], json["s"], json["t"], json["type"], json["uid"]);
  3531. });
  3532. //评分
  3533. router.route("/scoreWork").all((req, res, next) => {
  3534. postmysql(req, res, "scoreWork");
  3535. });
  3536. //删除学生
  3537. router.route("/deleteStudent").all((req, res, next) => {
  3538. postmysql(req, res, "delete_student");
  3539. });
  3540. //查询学校底下的班级
  3541. router.route("/selectClassBySchool").all((req, res, next) => {
  3542. var json = queryString(req.url);
  3543. getmysql(req, res, "selectClassBySchool", json["oid"]);
  3544. });
  3545. //查询学校底下的教研室
  3546. router.route("/selectTeacherOfficeBySchool").all((req, res, next) => {
  3547. var json = queryString(req.url);
  3548. getmysql(req, res, "selectTeacherOfficeBySchool", json["oid"]);
  3549. });
  3550. //查询学校底下的年级
  3551. router.route("/selectGrageBySchool").all((req, res, next) => {
  3552. var json = queryString(req.url);
  3553. getmysql(req, res, "selectGrageBySchool", json["oid"]);
  3554. });
  3555. //查询学校底下的班级
  3556. router.route("/selectClassBySchoolSearch").all((req, res, next) => {
  3557. var json = queryString(req.url);
  3558. getmysql(req, res, "selectClassBySchoolSearch", json["oid"], json["cn"]);
  3559. });
  3560. //查询学校底下的班级
  3561. router.route("/selectClassBySchoolSearch2").all((req, res, next) => {
  3562. var json = queryString(req.url);
  3563. getmysql(req, res, "selectClassBySchoolSearch2", json["oid"], json["gid"], json["cn"]);
  3564. });
  3565. //查询组织底下的学校
  3566. router.route("/selectSchoolByOrg").all((req, res, next) => {
  3567. var json = queryString(req.url);
  3568. getmysql(req, res, "selectSchoolByOrg", json["org"]);
  3569. });
  3570. //学生注册接口
  3571. router.route("/register_student").post(function(req, res, next) {
  3572. //mode的处理
  3573. if (req.body[0]) {
  3574. // 0 用户名 1 用户密码 2用户身份 3 第三方id(可有可无)
  3575. p = Object.values(req.body[0]); //获取用户密码
  3576. //没有第三方id的处理
  3577. // if (p.length < 4) {
  3578. // p.push("")
  3579. // }
  3580. p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
  3581. //密码加密
  3582. // bcrypt.hash(p[1], 10, function (err, hash) {
  3583. // if (err) {
  3584. // return next(err);
  3585. // }
  3586. // p[1] = hash;
  3587. // });
  3588. //参数拼接,注册
  3589. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "register_student");
  3590. //返回注册用户数据
  3591. // mysql.usselect(p, function (ret) {
  3592. // res.end(ret);
  3593. // });
  3594. mysql.usselect(p, function(ret) {
  3595. res.end(JSON.stringify(ret));
  3596. });
  3597. }
  3598. });
  3599. //查询课程详情
  3600. router.route("/selectCourseDetail").all((req, res, next) => {
  3601. var json = queryString(req.url);
  3602. getmysql(req, res, "selectCourseDetail", json["courseId"]);
  3603. });
  3604. //查询课程详情
  3605. router.route("/selectTrainCourseDetail").all((req, res, next) => {
  3606. var json = queryString(req.url);
  3607. getmysql(req, res, "selectTrainCourseDetail", json["courseId"]);
  3608. });
  3609. //查询课程详情
  3610. router.route("/selectCourseDetail2").all((req, res, next) => {
  3611. var json = queryString(req.url);
  3612. getmysql(req, res, "selectCourseDetail2", json["courseId"]);
  3613. });
  3614. //查询课程详情
  3615. router.route("/selectTrainCourseDetail2").all((req, res, next) => {
  3616. var json = queryString(req.url);
  3617. getmysql(req, res, "selectTrainCourseDetail2", json["courseId"]);
  3618. });
  3619. //查询课程详情
  3620. router.route("/selectCourseDetail3").all((req, res, next) => {
  3621. var json = queryString(req.url);
  3622. getmysql(req, res, "selectCourseDetail3", json["courseId"]);
  3623. });
  3624. //查询课程详情
  3625. router.route("/selectTrainCourseDetail3").all((req, res, next) => {
  3626. var json = queryString(req.url);
  3627. getmysql(req, res, "selectTrainCourseDetail3", json["courseId"]);
  3628. });
  3629. //查询学校底下的所有赛事
  3630. router.route("/selectRaceByOid").all((req, res, next) => {
  3631. var json = queryString(req.url);
  3632. getmysql(req, res, "selectRaceByOid", json["sid"]);
  3633. });
  3634. //修改作业学生名称 修1
  3635. router.route("/updateCourseWorksName").get((req, res, next) => {
  3636. var json = queryString(req.url);
  3637. getmysql2(req, res, "updateCourseWorksName", json["n"], json["cid"]);
  3638. });
  3639. //查询课程详情
  3640. router.route("/selectStudentCourseDetail").all((req, res, next) => {
  3641. //学生
  3642. var json = queryString(req.url);
  3643. getmysql(req, res, "selectStudentCourseDetail", json["courseId"]);
  3644. });
  3645. //查询课程详情
  3646. router.route("/selectStudentCourseDetail3").all((req, res, next) => {
  3647. //学生
  3648. var json = queryString(req.url);
  3649. getmysql(req, res, "selectStudentCourseDetail3", json["courseId"]);
  3650. });
  3651. //查询课程详情
  3652. router.route("/selectStudentCourseDetail2").all((req, res, next) => {
  3653. //学生
  3654. var json = queryString(req.url);
  3655. getmysql(req, res, "selectStudentCourseDetail2", json["courseId"]);
  3656. });
  3657. //跳转阶段时,如果有课程就查询1返回,如果没有就插入 修1
  3658. router.route("/addUserR").get((req, res, next) => {
  3659. var json = queryString(req.url);
  3660. getmysql2(req, res, "insertUserR", json["uid"], json["cid"]);
  3661. });
  3662. //新增学生端作业
  3663. router.route("/addWorks").all((req, res, next) => {
  3664. postmysql(req, res, "add_works");
  3665. });
  3666. //查询已提交作业
  3667. router.route("/selectWork").all((req, res, next) => {
  3668. var json = queryString(req.url);
  3669. getmysql(
  3670. req,
  3671. res,
  3672. "selectWork",
  3673. json["cid"],
  3674. json["stage"],
  3675. json["task"],
  3676. json["uid"]
  3677. );
  3678. });
  3679. //查询作业详情
  3680. router.route("/selectWorksDetail").all((req, res, next) => {
  3681. var json = queryString(req.url);
  3682. getmysql(req, res, "selectWorksDetail", json["uid"], json["cid"]);
  3683. });
  3684. //新增作业评分 修1
  3685. router.route("/updateWorks").get((req, res, next) => {
  3686. var json = queryString(req.url);
  3687. getmysql2(req, res, "updateWorks", json["rate"], json["tuid"], json["id"]);
  3688. });
  3689. //新增素材信息 修1
  3690. router.route("/addMtl").get((req, res, next) => {
  3691. var json = queryString(req.url);
  3692. getmysql2(req, res, "add_mtl", json["cInfo"], json["t"], json["cBy"]);
  3693. });
  3694. //根据类型查询素材信息
  3695. router.route("/selectMtl").all((req, res, next) => {
  3696. var json = queryString(req.url);
  3697. getmysql(req, res, "selectMtl", json["t"], json["page"], 10);
  3698. });
  3699. //根据类型查询素材信息
  3700. router.route("/selectMtl2").all((req, res, next) => {
  3701. var json = queryString(req.url);
  3702. getmysql(req, res, "selectMtl2", json["t"], json["uid"], json["page"], 10);
  3703. });
  3704. //学习中心
  3705. //新增学习资源信息 修1
  3706. router.route("/addStuMtl").get((req, res, next) => {
  3707. var json = queryString(req.url);
  3708. getmysql2(req, res, "addStuMtl", json["cInfo"], json["t"], json["cBy"]);
  3709. });
  3710. //根据类型查询学习资料信息
  3711. router.route("/selectStuMtl").all((req, res, next) => {
  3712. var json = queryString(req.url);
  3713. getmysql(req, res, "selectStuMtl", json["t"], json["page"], 10);
  3714. });
  3715. //删除1素材
  3716. router.route("/deleteStuM").all((req, res, next) => {
  3717. var json = queryString(req.url);
  3718. getmysql2(req, res, "deleteStuM", json["id"]);
  3719. });
  3720. //查询学生信息
  3721. router.route("/selectSDetail").all((req, res, next) => {
  3722. var json = queryString(req.url);
  3723. getmysql(req, res, "selectStudentDetail", json["uid"]);
  3724. });
  3725. //查询个人课程
  3726. router.route("/selectMyCourse").all((req, res, next) => {
  3727. var json = queryString(req.url);
  3728. getmysql(req, res, "selectMyCourse", json["uid"]);
  3729. });
  3730. //查询个人课程groupby课程id
  3731. router.route("/selectMyCourseBycid").all((req, res, next) => {
  3732. var json = queryString(req.url);
  3733. getmysql(req, res, "selectMyCourseBycid", json["uid"]);
  3734. });
  3735. //查询所有课程
  3736. router.route("/selectAllCourse").all((req, res, next) => {
  3737. var json = queryString(req.url);
  3738. getmysql(req, res, "selectAllCourse", json["oid"], json["page"], 10);
  3739. });
  3740. //根据班级查询所有课程
  3741. router.route("/selectAllCourseByCid").all((req, res, next) => {
  3742. var json = queryString(req.url);
  3743. getmysql(
  3744. req,
  3745. res,
  3746. "selectAllCourseByCid",
  3747. json["oid"],
  3748. json["cid"],
  3749. json["page"],
  3750. 10
  3751. );
  3752. });
  3753. //根据分类查询所有课程
  3754. router.route("/selectTypeCourse").all((req, res, next) => {
  3755. var json = queryString(req.url);
  3756. getmysql(
  3757. req,
  3758. res,
  3759. "selectTypeCourse",
  3760. json["uid"],
  3761. json["oid"],
  3762. json["typea"],
  3763. json["typeb"],
  3764. json["typec"],
  3765. json["typed"],
  3766. json["typeE"],
  3767. json["cu"],
  3768. json["cn"],
  3769. json["classid"],
  3770. json["page"],
  3771. 10
  3772. );
  3773. });
  3774. //根据分类查询所有课程
  3775. router.route("/selectTypeCourse2").all((req, res, next) => {
  3776. var json = queryString(req.url);
  3777. getmysql(
  3778. req,
  3779. res,
  3780. "selectTypeCourse2",
  3781. json["uid"],
  3782. json["oid"],
  3783. json["typea"],
  3784. json["typeb"],
  3785. json["typec"],
  3786. json["typed"],
  3787. json["typeE"],
  3788. json["cu"],
  3789. json["cn"],
  3790. json["classid"],
  3791. json["org"],
  3792. json["page"],
  3793. json["pageSize"]
  3794. );
  3795. });
  3796. //根据分类查询所有课程
  3797. router.route("/selectTypeCourse22").all((req, res, next) => {
  3798. var json = queryString(req.url);
  3799. getmysql(
  3800. req,
  3801. res,
  3802. "selectTypeCourse22",
  3803. json["uid"],
  3804. json["oid"],
  3805. json["typea"],
  3806. json["typeb"],
  3807. json["typec"],
  3808. json["typed"],
  3809. json["typeE"],
  3810. json["cu"],
  3811. json["cn"],
  3812. json["classid"],
  3813. json["org"],
  3814. json["page"],
  3815. json["pageSize"],
  3816. json["orderBy"]
  3817. );
  3818. });
  3819. //根据分类查询所有课程
  3820. router.route("/selectTypeTrainCourse2").all((req, res, next) => {
  3821. var json = queryString(req.url);
  3822. getmysql(
  3823. req,
  3824. res,
  3825. "selectTypeTrainCourse2",
  3826. json["uid"],
  3827. json["oid"],
  3828. json["typea"],
  3829. json["typeb"],
  3830. json["typec"],
  3831. json["typed"],
  3832. json["typeE"],
  3833. json["cu"],
  3834. json["cn"],
  3835. json["classid"],
  3836. json["org"],
  3837. json["page"],
  3838. json["pageSize"]
  3839. );
  3840. });
  3841. //根据分类查询所有课程
  3842. router.route("/selectTypeCourse2Mode").all((req, res, next) => {
  3843. var json = queryString(req.url);
  3844. getmysql(
  3845. req,
  3846. res,
  3847. "selectTypeCourse2Mode",
  3848. json["uid"],
  3849. json["oid"],
  3850. json["typea"],
  3851. json["typeb"],
  3852. json["typec"],
  3853. json["typed"],
  3854. json["typeE"],
  3855. json["cu"],
  3856. json["cn"],
  3857. json["classid"],
  3858. json["org"]
  3859. );
  3860. });
  3861. //根据分类查询所有课程
  3862. router.route("/selectTypeCourse2Mode2").all((req, res, next) => {
  3863. var json = queryString(req.url);
  3864. getmysql(
  3865. req,
  3866. res,
  3867. "selectTypeCourse2Mode2",
  3868. json["uid"],
  3869. json["oid"],
  3870. json["typea"],
  3871. json["typeb"],
  3872. json["typec"],
  3873. json["typed"],
  3874. json["typeE"],
  3875. json["cu"],
  3876. json["cn"],
  3877. json["classid"],
  3878. json["org"],
  3879. json["orderBy"]
  3880. );
  3881. });
  3882. //根据分类查询所有课程
  3883. router.route("/selectTypeTrainCourse2Mode").all((req, res, next) => {
  3884. var json = queryString(req.url);
  3885. getmysql(
  3886. req,
  3887. res,
  3888. "selectTypeTrainCourse2Mode",
  3889. json["uid"],
  3890. json["oid"],
  3891. json["typea"],
  3892. json["typeb"],
  3893. json["typec"],
  3894. json["typed"],
  3895. json["typeE"],
  3896. json["cu"],
  3897. json["cn"],
  3898. json["classid"],
  3899. json["org"]
  3900. );
  3901. });
  3902. //根据分类查询所有课程
  3903. router.route("/selectTypeCourse2GM").all((req, res, next) => {
  3904. var json = queryString(req.url);
  3905. getmysql(
  3906. req,
  3907. res,
  3908. "selectTypeCourse2GM",
  3909. json["uid"],
  3910. json["oid"],
  3911. json["typea"],
  3912. json["typeb"],
  3913. json["typec"],
  3914. json["typed"],
  3915. json["typeE"],
  3916. json["cu"],
  3917. json["cn"],
  3918. json["classid"],
  3919. json["org"],
  3920. json["page"],
  3921. 10
  3922. );
  3923. });
  3924. //根据分类查询所有课程
  3925. router.route("/selectCourseExamine").all((req, res, next) => {
  3926. var json = queryString(req.url);
  3927. getmysql(
  3928. req,
  3929. res,
  3930. "selectCourseExamine",
  3931. json["oid"],
  3932. json["org"],
  3933. json["cn"],
  3934. json["page"],
  3935. 10
  3936. );
  3937. });
  3938. //根据分类查询所有课程
  3939. router.route("/selectTypeCourse3").all((req, res, next) => {
  3940. var json = queryString(req.url);
  3941. getmysql(
  3942. req,
  3943. res,
  3944. "selectTypeCourse3",
  3945. json["uid"],
  3946. json["oid"],
  3947. json["typea"],
  3948. json["typeb"],
  3949. json["typec"],
  3950. json["typed"],
  3951. json["typeE"],
  3952. json["cu"],
  3953. json["cn"],
  3954. json["classid"],
  3955. json["org"],
  3956. json["page"],
  3957. 10
  3958. );
  3959. });
  3960. //审核课程
  3961. router.route("/examineCourse").all((req, res, next) => {
  3962. postmysql(req, res, "examineCourse");
  3963. });
  3964. //删除1素材
  3965. router.route("/deleteM").all((req, res, next) => {
  3966. var json = queryString(req.url);
  3967. getmysql2(req, res, "deleteM", json["id"]);
  3968. });
  3969. //点击阶段时添加观看人数 修1
  3970. router.route("/updateVc").get((req, res, next) => {
  3971. var json = queryString(req.url);
  3972. getmysql2(req, res, "updateVc", json["cid"]);
  3973. });
  3974. //点击阶段时添加观看人数 修1
  3975. router.route("/updateVcTrain").get((req, res, next) => {
  3976. var json = queryString(req.url);
  3977. getmysql2(req, res, "updateVcTrain", json["cid"]);
  3978. });
  3979. //删除1课程
  3980. router.route("/deleteCourse").all((req, res, next) => {
  3981. var json = queryString(req.url);
  3982. getmysql2(req, res, "deleteCourse", json["cid"]);
  3983. });
  3984. //删除1课程
  3985. router.route("/deleteTrainCourse").all((req, res, next) => {
  3986. var json = queryString(req.url);
  3987. getmysql2(req, res, "deleteTrainCourse", json["cid"]);
  3988. });
  3989. //删除1课程
  3990. router.route("/deleteSynergyCourse").all((req, res, next) => {
  3991. var json = queryString(req.url);
  3992. getmysql2(req, res, "deleteSynergyCourse", json["cid"]);
  3993. });
  3994. //删除1课程
  3995. router.route("/deleteStudentCourse").all((req, res, next) => {
  3996. var json = queryString(req.url);
  3997. getmysql2(req, res, "deleteStudentCourse", json["cid"]);
  3998. });
  3999. //复制课程
  4000. router.route("/copyCourse").all((req, res, next) => {
  4001. postmysql(req, res, "copyCourse");
  4002. });
  4003. //复制课程
  4004. router.route("/copyCourse2").all((req, res, next) => {
  4005. postmysql(req, res, "copyCourse2");
  4006. });
  4007. //复制课程
  4008. router.route("/copyCourseSz").all((req, res, next) => {
  4009. postmysql2(req, res, "copyCourse");
  4010. });
  4011. //返回复制课程
  4012. router.route("/getcopyCourseSz").all((req, res, next) => {
  4013. postmysql2(req, res, "getcopyCourseSz");
  4014. });
  4015. //返回复制课程自己的
  4016. router.route("/getcopyCourseByUseridSz").all((req, res, next) => {
  4017. postmysql2(req, res, "getcopyCourseByUseridSz");
  4018. });
  4019. //查看课程信息
  4020. router.route("/selectCourseDetailSz").all((req, res, next) => {
  4021. postmysql2(req, res, "selectCourseDetailSz");
  4022. });
  4023. //复制课程
  4024. router.route("/copyTrainCourse").all((req, res, next) => {
  4025. postmysql(req, res, "copyTrainCourse");
  4026. });
  4027. //复制课程
  4028. router.route("/copyTest").all((req, res, next) => {
  4029. postmysql(req, res, "copyTest");
  4030. });
  4031. //复制课程
  4032. router.route("/copySynergyCourse").all((req, res, next) => {
  4033. postmysql(req, res, "copySynergyCourse");
  4034. });
  4035. //复制评价体系
  4036. router.route("/copyEva").all((req, res, next) => {
  4037. postmysql(req, res, "copyEva");
  4038. });
  4039. //复制课程
  4040. router.route("/copySCourse").all((req, res, next) => {
  4041. postmysql(req, res, "copySCourse");
  4042. });
  4043. //查看课程
  4044. router.route("/select_course_detail").all((req, res, next) => {
  4045. var json = queryString(req.url);
  4046. getmysql(req, res, "select_course_detail", json["cid"]);
  4047. });
  4048. //查看课程
  4049. router.route("/select_trainCourse_detail").all((req, res, next) => {
  4050. var json = queryString(req.url);
  4051. getmysql(req, res, "select_trainCourse_detail", json["cid"]);
  4052. });
  4053. //删除评测
  4054. router.route("/deleteTestCourseWorks").all((req, res, next) => {
  4055. postmysql(req, res, "deleteTestCourseWorks");
  4056. });
  4057. //查看评测
  4058. router.route("/selectTestType").all((req, res, next) => {
  4059. var json = queryString(req.url);
  4060. getmysql(req, res, "selectTestType", json["oid"]);
  4061. });
  4062. //查看评测
  4063. router.route("/getTestCourseDetail").all((req, res, next) => {
  4064. var json = queryString(req.url);
  4065. getmysql(req, res, "getTestCourseDetail", json["cid"]);
  4066. });
  4067. //查看评测
  4068. router.route("/selectPostilByUid").all((req, res, next) => {
  4069. var json = queryString(req.url);
  4070. getmysql(req, res, "selectPostilByUid", json["uid"]);
  4071. });
  4072. //查看评测
  4073. router.route("/getTestWorkShare").all((req, res, next) => {
  4074. var json = queryString(req.url);
  4075. getmysql(req, res, "getTestWorkShare", json["id"]);
  4076. });
  4077. //查看评测
  4078. router.route("/getTestWorkShareCopy").all((req, res, next) => {
  4079. var json = queryString(req.url);
  4080. getmysql(req, res, "getTestWorkShareCopy", json["id"], json["tea"]);
  4081. });
  4082. //查看fileid
  4083. router.route("/selectFileId").all((req, res, next) => {
  4084. var json = queryString(req.url);
  4085. getmysql(req, res, "selectFileId", json["oid"]);
  4086. });
  4087. //查看fileid
  4088. router.route("/selectAiFileId").all((req, res, next) => {
  4089. var json = queryString(req.url);
  4090. getmysql(req, res, "selectAiFileId", json["oid"]);
  4091. });
  4092. //查看fileid
  4093. router.route("/selectKnowFileid").all((req, res, next) => {
  4094. var json = queryString(req.url);
  4095. getmysql(req, res, "selectKnowFileid", json["oid"], json["sta"]);
  4096. });
  4097. //查看课程
  4098. router.route("/select_synergy").all((req, res, next) => {
  4099. var json = queryString(req.url);
  4100. getmysql(req, res, "select_synergy", json["cid"]);
  4101. });
  4102. //查看课程
  4103. router.route("/select_student_course_detail").all((req, res, next) => {
  4104. //学生
  4105. var json = queryString(req.url);
  4106. getmysql(req, res, "select_student_course_detail", json["cid"]);
  4107. });
  4108. //查看课程
  4109. router.route("/select_student_course_detail2").all((req, res, next) => {
  4110. //学生
  4111. var json = queryString(req.url);
  4112. getmysql(req, res, "select_student_course_detail2", json["cid"]);
  4113. });
  4114. //查看课程
  4115. router.route("/getExportScourse").all((req, res, next) => {
  4116. //学生
  4117. var json = queryString(req.url);
  4118. getmysql(req, res, "getExportScourse", json["cid"]);
  4119. });
  4120. //模糊查找课程
  4121. // router.route('/searchCourse').all((req, res, next) => {
  4122. // var json = queryString(req.url);
  4123. // getmysql(req, res, "searchCourse", json['cu'], json['cn'], json['page'], 10);
  4124. // });
  4125. //创建调查问卷
  4126. router.route("/addAsk").all((req, res, next) => {
  4127. postmysql(req, res, "insert_ask");
  4128. });
  4129. //学生提交问卷
  4130. router.route("/addAskList").all((req, res, next) => {
  4131. postmysql(req, res, "insert_askList");
  4132. });
  4133. //根据课程id阶段id获取已提交的问卷
  4134. router.route("/getAskListByCidStage").all((req, res, next) => {
  4135. var json = queryString(req.url);
  4136. getmysql(
  4137. req,
  4138. res,
  4139. "getAskListByCidStage",
  4140. json["cid"],
  4141. json["stage"],
  4142. json["task"]
  4143. );
  4144. });
  4145. //获取调查问卷
  4146. router.route("/getAsk").all((req, res, next) => {
  4147. var json = queryString(req.url);
  4148. getmysql(req, res, "select_ask", json["uid"], json["page"], 10);
  4149. });
  4150. //删除问卷
  4151. router.route("/deleteAsk").all((req, res, next) => {
  4152. postmysql(req, res, "deleteAsk");
  4153. });
  4154. //问卷调查数据统计
  4155. router.route("/getAskListByAskid").all((req, res, next) => {
  4156. var json = queryString(req.url);
  4157. getmysql(req, res, "select_askListByAskid", json["aid"]);
  4158. });
  4159. //删除学生提交问卷
  4160. router.route("/deleteAskList").all((req, res, next) => {
  4161. postmysql(req, res, "update_askList_delete");
  4162. });
  4163. //根据id获取调查问卷
  4164. router.route("/getAskList").all((req, res, next) => {
  4165. var json = queryString(req.url);
  4166. getmysql(req, res, "select_askList", json["uid"], json["page"], 10);
  4167. });
  4168. //查看便签列表
  4169. router.route("/selectNote").all((req, res, next) => {
  4170. var json = queryString(req.url);
  4171. getmysql(req, res, "selectNote", json["uid"]);
  4172. });
  4173. //新增便签列表 修1
  4174. router.route("/insertNote").get((req, res, next) => {
  4175. var json = queryString(req.url);
  4176. getmysql2(req, res, "insertNote", json["uid"], json["c"]);
  4177. });
  4178. //根据便签id修改便签内容 修1
  4179. router.route("/updateNote").get((req, res, next) => {
  4180. var json = queryString(req.url);
  4181. getmysql2(req, res, "updateNote", json["nid"], json["c"]);
  4182. });
  4183. //删除1便签
  4184. router.route("/deleteNote").all((req, res, next) => {
  4185. var json = queryString(req.url);
  4186. getmysql2(req, res, "deleteNote", json["nid"]);
  4187. });
  4188. //查询便签
  4189. router.route("/selectNoteContent").all((req, res, next) => {
  4190. var json = queryString(req.url);
  4191. getmysql(req, res, "selectNoteContent", json["cn"]);
  4192. });
  4193. //修改用户信息
  4194. router.route("/updateUserByEdu").all((req, res, next) => {
  4195. postmysql(req, res, "updateUserByEdu");
  4196. });
  4197. //修改用户信息
  4198. router.route("/updateUserByEdu1").all((req, res, next) => {
  4199. postmysql(req, res, "updateUserByEdu1");
  4200. });
  4201. //修改用户信息
  4202. router.route("/updateUserByEduOid").all((req, res, next) => {
  4203. postmysql(req, res, "updateUserByEduOid");
  4204. });
  4205. //修改学生信息
  4206. router.route("/updateStudentInfo").all((req, res, next) => {
  4207. postmysql(req, res, "updateStudentInfo");
  4208. });
  4209. //教师端data修改pbl用户信息
  4210. router.route("/updatePblMessage").all((req, res, next) => {
  4211. postmysql2(req, res, "updatePblMessage");
  4212. });
  4213. //登录次数
  4214. router.route("/addLoginOperation").all((req, res, next) => {
  4215. postmysql2(req, res, "addLoginOperation");
  4216. });
  4217. //当日登录时间
  4218. router.route("/addOperationTime").all((req, res, next) => {
  4219. postmysql2(req, res, "addOperationTime");
  4220. });
  4221. //课程学习时间
  4222. router.route("/addOperationTime2").all((req, res, next) => {
  4223. postmysql(req, res, "addOperationTime");
  4224. });
  4225. //当日登录时间
  4226. router.route("/addOperationTimeT").all((req, res, next) => {
  4227. postmysql2(req, res, "addOperationTime2");
  4228. });
  4229. //课程学习时间
  4230. router.route("/addOperationTimeT2").all((req, res, next) => {
  4231. postmysql(req, res, "addOperationTime2");
  4232. });
  4233. //记录用户协同建构操作
  4234. router.route("/add_OperationCSCL").all((req, res, next) => {
  4235. postmysql2(req, res, "add_OperationCSCL");
  4236. });
  4237. //获取所有分组协同数据
  4238. router.route("/select_CSCLDataByID").all((req, res, next) => {
  4239. postmysql2(req, res, "select_CSCLDataByID");
  4240. });
  4241. //获取项目所有的分组所有的人操作数据的总数和时间
  4242. router.route("/select_CSCLDataCount").all((req, res, next) => {
  4243. postmysql2(req, res, "select_CSCLDataCount");
  4244. });
  4245. //获取用户在某个分组的操作日志
  4246. router.route("/select_CSCLDataByUserIdID").all((req, res, next) => {
  4247. postmysql2(req, res, "select_CSCLDataByUserIdID");
  4248. });
  4249. router.route("/updatePblMessage2").all((req, res, next) => {
  4250. postmysql(req, res, "updatePblMessage");
  4251. });
  4252. router.route("/updateUserInfoText").all((req, res, next) => {
  4253. postmysql(req, res, "updateUserInfoText");
  4254. });
  4255. //修改幼儿园评价个人信息
  4256. router.route("/updateStudentInfoText").all((req, res, next) => {
  4257. postmysql(req, res, "updateStudentInfoText");
  4258. });
  4259. router.route("/updateRaceUser").all((req, res, next) => {
  4260. postmysql(req, res, "updateRaceUser");
  4261. });
  4262. //查询用户信息
  4263. router.route("/selectUser").all((req, res, next) => {
  4264. var json = queryString(req.url);
  4265. getmysql(req, res, "selectUser", json["userid"]);
  4266. });
  4267. //查询用户信息
  4268. router.route("/selectUserSzdjg").all((req, res, next) => {
  4269. var json = queryString(req.url);
  4270. getmysql(req, res, "selectUserSzdjg", json["username"]);
  4271. });
  4272. //新增英语写作批改 修1
  4273. router.route("/addEngC").get((req, res, next) => {
  4274. var json = queryString(req.url);
  4275. getmysql2(req, res, "insertEngCorrect", json["cid"], json["s"], json["t"], json["tool"], json["wid"], json["c"], json["w"]);
  4276. });
  4277. //查询英语写作批改
  4278. router.route("/selectEngC").all((req, res, next) => {
  4279. var json = queryString(req.url);
  4280. getmysql(req, res, "selectEngCorrect", json["workid"]);
  4281. });
  4282. //查询英语写作作业
  4283. router.route("/selectEngWork").all((req, res, next) => {
  4284. var json = queryString(req.url);
  4285. getmysql(req, res, "selectEngWork", json["wid"]);
  4286. });
  4287. //新增或修改英语写作评价 修1
  4288. router.route("/addEngEva").get((req, res, next) => {
  4289. var json = queryString(req.url);
  4290. getmysql2(req, res, "addEngEva", json["id"], json["aic"], json["tc"]);
  4291. });
  4292. //查询分类及所有子分类
  4293. router.route("/selectAllType").all((req, res, next) => {
  4294. var json = queryString(req.url);
  4295. getmysql(req, res, "selectAllType", json["org"], json["oid"]);
  4296. });
  4297. //查询分类及所有子分类 stand
  4298. router.route("/selectAllTypeStand").all((req, res, next) => {
  4299. var json = queryString(req.url);
  4300. getmysql(req, res, "selectAllTypeStand", json["org"], json["oid"], json["stand"]);
  4301. });
  4302. //查询分类及所有子分类
  4303. router.route("/selectAllTrainType").all((req, res, next) => {
  4304. var json = queryString(req.url);
  4305. getmysql(req, res, "selectAllTrainType", json["org"], json["oid"]);
  4306. });
  4307. //查询分类及所有子分类
  4308. router.route("/selectAllTypeS").all((req, res, next) => {
  4309. var json = queryString(req.url);
  4310. getmysql(req, res, "selectAllTypeS", json["org"], json["oid"]);
  4311. });
  4312. //查询分类及所有子分类
  4313. router.route("/selectAllTypeT").all((req, res, next) => {
  4314. var json = queryString(req.url);
  4315. getmysql(req, res, "selectAllTypeT", json["org"], json["oid"]);
  4316. });
  4317. //查询分类及子分类
  4318. router.route("/selectType").all((req, res, next) => {
  4319. var json = queryString(req.url);
  4320. getmysql(req, res, "selectType");
  4321. });
  4322. //查询分类及子分类
  4323. router.route("/selectStudentType").all((req, res, next) => {
  4324. var json = queryString(req.url);
  4325. getmysql(req, res, "selectStudentType");
  4326. });
  4327. //查询赛事分类及子分类
  4328. router.route("/selectMatType").all((req, res, next) => {
  4329. var json = queryString(req.url);
  4330. getmysql(req, res, "selectMatType");
  4331. });
  4332. //查询赛事分类及子分类
  4333. router.route("/selectRaceNum").all((req, res, next) => {
  4334. var json = queryString(req.url);
  4335. getmysql(req, res, "selectRaceNum", json["oid"]);
  4336. });
  4337. //根据学校查询分类
  4338. router.route("/selectPtype").all((req, res, next) => {
  4339. var json = queryString(req.url);
  4340. getmysql(req, res, "selectPtype", json["page"], 10);
  4341. });
  4342. //根据学校查询学生项目分类
  4343. router.route("/selectSPtype").all((req, res, next) => {
  4344. var json = queryString(req.url);
  4345. getmysql(req, res, "selectSPtype", json["page"], 10);
  4346. });
  4347. //根据学校查询分类1
  4348. router.route("/selectPtype1").all((req, res, next) => {
  4349. var json = queryString(req.url);
  4350. getmysql(req, res, "selectPtype1", json["oid"], json["page"], 10);
  4351. });
  4352. //添加分类 修1
  4353. router.route("/addPtype").get((req, res, next) => {
  4354. var json = queryString(req.url);
  4355. getmysql2(req, res, "addPtype", json["n"], json["uid"], json["oid"]);
  4356. });
  4357. //修改分类 修1
  4358. router.route("/updatePtype").get((req, res, next) => {
  4359. var json = queryString(req.url);
  4360. getmysql2(req, res, "updatePtype", json["n"], json["tid"]);
  4361. });
  4362. //修改学生项目分类 修1
  4363. router.route("/updateSPtype").get((req, res, next) => {
  4364. var json = queryString(req.url);
  4365. getmysql2(req, res, "updateSPtype", json["n"], json["tid"]);
  4366. });
  4367. //删除1分类
  4368. router.route("/deletePtype").all((req, res, next) => {
  4369. var json = queryString(req.url);
  4370. getmysql2(req, res, "deletePtype", json["tid"]);
  4371. });
  4372. //删除1学生项目分类
  4373. router.route("/deleteSPtype").all((req, res, next) => {
  4374. var json = queryString(req.url);
  4375. getmysql2(req, res, "deleteSPtype", json["tid"]);
  4376. });
  4377. //查询子分类列表
  4378. router.route("/selectStype").all((req, res, next) => {
  4379. var json = queryString(req.url);
  4380. getmysql(req, res, "selectStype", json["pid"], json["oid"], json["page"], 10);
  4381. });
  4382. //查询学生项目子分类列表
  4383. router.route("/selectSStype").all((req, res, next) => {
  4384. var json = queryString(req.url);
  4385. getmysql(
  4386. req,
  4387. res,
  4388. "selectSStype",
  4389. json["pid"],
  4390. json["oid"],
  4391. json["page"],
  4392. 10
  4393. );
  4394. });
  4395. //添加子分类 修1
  4396. router.route("/addStype").get((req, res, next) => {
  4397. var json = queryString(req.url);
  4398. getmysql2(
  4399. req,
  4400. res,
  4401. "addStype",
  4402. json["pid"],
  4403. json["n"],
  4404. json["uid"],
  4405. json["oid"]
  4406. );
  4407. });
  4408. //添加学生项目子分类 修1
  4409. router.route("/addSStype").get((req, res, next) => {
  4410. var json = queryString(req.url);
  4411. getmysql2(
  4412. req,
  4413. res,
  4414. "addSStype",
  4415. json["pid"],
  4416. json["n"],
  4417. json["uid"],
  4418. json["oid"]
  4419. );
  4420. });
  4421. //根据学校查询工作分类
  4422. router.route("/selectStudioPtype").all((req, res, next) => {
  4423. var json = queryString(req.url);
  4424. getmysql(req, res, "selectStudioPtype", json["page"], 10);
  4425. });
  4426. //查询工作室项目子分类列表
  4427. router.route("/selectStudioStype").all((req, res, next) => {
  4428. var json = queryString(req.url);
  4429. getmysql(
  4430. req,
  4431. res,
  4432. "selectStudioStype",
  4433. json["pid"],
  4434. json["oid"],
  4435. json["page"],
  4436. 10
  4437. );
  4438. });
  4439. //添加工作室项目子分类 修1
  4440. router.route("/addStudioStype").get((req, res, next) => {
  4441. var json = queryString(req.url);
  4442. getmysql2(
  4443. req,
  4444. res,
  4445. "addStudioStype",
  4446. json["pid"],
  4447. json["n"],
  4448. json["uid"],
  4449. json["oid"]
  4450. );
  4451. });
  4452. //修改工作项目分类 修1
  4453. router.route("/updateStudioPtype").get((req, res, next) => {
  4454. var json = queryString(req.url);
  4455. getmysql2(req, res, "updateStudioPtype", json["n"], json["tid"]);
  4456. });
  4457. //删除1工作项目分类
  4458. router.route("/deleteStudioPtype").all((req, res, next) => {
  4459. var json = queryString(req.url);
  4460. getmysql2(req, res, "deleteStudioPtype", json["tid"]);
  4461. });
  4462. //查看本校所有学生(分页)
  4463. router.route("/selectAllStudent").all((req, res, next) => {
  4464. var json = queryString(req.url);
  4465. getmysql(
  4466. req,
  4467. res,
  4468. "selectAllStudent",
  4469. json["oid"],
  4470. json["cn"],
  4471. json["cid"],
  4472. json["page"],
  4473. 10
  4474. );
  4475. });
  4476. //查看本校所有学生(分页)teacher
  4477. router.route("/selectAllStudentTeacher").all((req, res, next) => {
  4478. var json = queryString(req.url);
  4479. getmysql(
  4480. req,
  4481. res,
  4482. "selectAllStudentTeacher",
  4483. json["oid"],
  4484. json["cn"],
  4485. json["cid"],
  4486. json["userid"],
  4487. json["page"],
  4488. 10
  4489. );
  4490. });
  4491. //根据学校id查询子分类
  4492. router.route("/selectTypeByOid").all((req, res, next) => {
  4493. var json = queryString(req.url);
  4494. getmysql(req, res, "selectTypeByOid", json["oid"]);
  4495. });
  4496. //根据学校id查询子分类
  4497. router.route("/selectTypeByOrg").all((req, res, next) => {
  4498. var json = queryString(req.url);
  4499. getmysql(req, res, "selectTypeByOid", json["oid"]);
  4500. });
  4501. //根据组织id查询子分类
  4502. router.route("/selectStudentTypeByOid").all((req, res, next) => {
  4503. var json = queryString(req.url);
  4504. getmysql(req, res, "selectStudentTypeByOid", json["oid"]);
  4505. });
  4506. //更加父id查询分类
  4507. router.route("/selectTypeByPid").all((req, res, next) => {
  4508. var json = queryString(req.url);
  4509. getmysql(req, res, "selectTypeByPid", json["pid"]);
  4510. });
  4511. //点击工具计数 修1
  4512. router.route("/insertToolsCount").get((req, res, next) => {
  4513. var json = queryString(req.url);
  4514. getmysql2(
  4515. req,
  4516. res,
  4517. "insertToolsCount",
  4518. json["cid"],
  4519. json["chid"],
  4520. json["uid"],
  4521. json["tid"],
  4522. json["count"]
  4523. );
  4524. });
  4525. //修改工具次数 修1
  4526. router.route("/updateToolsCount").get((req, res, next) => {
  4527. var json = queryString(req.url);
  4528. getmysql2(
  4529. req,
  4530. res,
  4531. "updateToolsCount",
  4532. json["cid"],
  4533. json["chid"],
  4534. json["uid"],
  4535. json["tid"],
  4536. json["count"]
  4537. );
  4538. });
  4539. //查询工具次数
  4540. router.route("/selectToolsCount").all((req, res, next) => {
  4541. var json = queryString(req.url);
  4542. getmysql(
  4543. req,
  4544. res,
  4545. "selectToolsCount",
  4546. json["cid"],
  4547. json["chid"],
  4548. json["uid"]
  4549. );
  4550. });
  4551. //导出学生
  4552. router.route("/selectUserBySchool").all((req, res, next) => {
  4553. var json = queryString(req.url);
  4554. getmysql(req, res, "selectUserBySchool", json["oid"]);
  4555. });
  4556. //上传学生作业 修1
  4557. router.route("/insertSWork").get((req, res, next) => {
  4558. var json = queryString(req.url);
  4559. getmysql2(
  4560. req,
  4561. res,
  4562. "insertSWork",
  4563. json["uid"],
  4564. json["cid"],
  4565. json["p"],
  4566. json["t"],
  4567. json["upload"]
  4568. );
  4569. });
  4570. //查询学生作业
  4571. router.route("/selectSWork").all((req, res, next) => {
  4572. var json = queryString(req.url);
  4573. getmysql(
  4574. req,
  4575. res,
  4576. "selectSWork",
  4577. json["uid"],
  4578. json["cid"],
  4579. json["p"],
  4580. json["type"]
  4581. );
  4582. });
  4583. //课程进展数据
  4584. router.route("/selectCase").all((req, res, next) => {
  4585. var json = queryString(req.url);
  4586. getmysql(req, res, "selectCase", json["org"]);
  4587. });
  4588. //课程进展数据
  4589. router.route("/selectCase2").all((req, res, next) => {
  4590. var json = queryString(req.url);
  4591. getmysql(req, res, "selectCase2", json["org"]);
  4592. });
  4593. //课程进展数据
  4594. router.route("/selectCase3").all((req, res, next) => {
  4595. var json = queryString(req.url);
  4596. getmysql(
  4597. req,
  4598. res,
  4599. "selectCase3",
  4600. json["org"],
  4601. json["oid"],
  4602. json["page"],
  4603. json["pageSize"]
  4604. );
  4605. });
  4606. //课程进展数据
  4607. router.route("/selectCase4").all((req, res, next) => {
  4608. var json = queryString(req.url);
  4609. getmysql(
  4610. req,
  4611. res,
  4612. "selectCase4",
  4613. json["org"],
  4614. json["oid"],
  4615. json["typeA"],
  4616. json["typeB"],
  4617. json["typeC"],
  4618. json["typeD"],
  4619. json["typeE"],
  4620. json["page"],
  4621. json["pageSize"]
  4622. );
  4623. });
  4624. //项目进展数据
  4625. router.route("/selectCaseS").all((req, res, next) => {
  4626. var json = queryString(req.url);
  4627. getmysql(req, res, "selectCaseS", json["org"], json["oid"]);
  4628. });
  4629. //项目进展数据
  4630. router.route("/selectCaseS2").all((req, res, next) => {
  4631. var json = queryString(req.url);
  4632. getmysql(
  4633. req,
  4634. res,
  4635. "selectCaseS2",
  4636. json["org"],
  4637. json["oid"],
  4638. json["type"],
  4639. json["page"],
  4640. json["pageSize"]
  4641. );
  4642. });
  4643. //查询赛事项目列表
  4644. router.route("/selectRaceList").all((req, res, next) => {
  4645. var json = queryString(req.url);
  4646. getmysql(req, res, "selectRaceList", json["uid"], json["t"]);
  4647. });
  4648. //修改赛事状态 修1
  4649. router.route("/updateRaceState").get((req, res, next) => {
  4650. var json = queryString(req.url);
  4651. getmysql2(req, res, "updateRaceState", json["id"], json["s"]);
  4652. });
  4653. //查询赛事项目详情
  4654. router.route("/selectRaceDetail").all((req, res, next) => {
  4655. var json = queryString(req.url);
  4656. getmysql(req, res, "selectRaceDetail", json["id"]);
  4657. });
  4658. //race 查询学校
  4659. router.route("/getSchool").all((req, res, next) => {
  4660. var json = queryString(req.url);
  4661. getmysql(req, res, "getSchool", json["n"]);
  4662. });
  4663. //查询我的学习报告
  4664. router.route("/selectMrEva").all((req, res, next) => {
  4665. var json = queryString(req.url);
  4666. getmysql(req, res, "selectMrEva", json["uid"], json["oid"], json["cid"]);
  4667. });
  4668. //查询行为数据库
  4669. router.route("/selectModelList").all((req, res, next) => {
  4670. var json = queryString(req.url);
  4671. getmysql(req, res, "selectModelList", json["cn"], json["oid"]);
  4672. });
  4673. //lsc
  4674. //admin 查询学校
  4675. router.route("/getSchoolAdmin").all((req, res, next) => {
  4676. var json = queryString(req.url);
  4677. getmysql(req, res, "select_school", json["page"], 10);
  4678. });
  4679. //admin 添加学校
  4680. router.route("/addSchoolAdmin").all((req, res, next) => {
  4681. postmysql(req, res, "add_school");
  4682. });
  4683. //组织添加学校
  4684. router.route("/addSchoolOrg").all((req, res, next) => {
  4685. postmysql(req, res, "addSchoolOrg");
  4686. });
  4687. //教师端组织添加学校
  4688. router.route("/insertSchoolByOrg").all((req, res, next) => {
  4689. postmysql(req, res, "insertSchoolByOrg");
  4690. });
  4691. //admin 删除学校
  4692. router.route("/deleteSchoolAdmin").all((req, res, next) => {
  4693. postmysql(req, res, "delete_school");
  4694. });
  4695. //admin 查询班级
  4696. router.route("/getClassAdmin").all((req, res, next) => {
  4697. var json = queryString(req.url);
  4698. getmysql(req, res, "select_classAdmin", json["cn"], json["page"], 10);
  4699. });
  4700. //查询ai权限
  4701. router.route("/getAIJ").all((req, res, next) => {
  4702. getmysql(req, res, "getAIJ");
  4703. });
  4704. //admin 添加班级
  4705. router.route("/addClassAdmin").all((req, res, next) => {
  4706. postmysql(req, res, "add_classAdmin");
  4707. });
  4708. //admin 查询班级是否重复
  4709. router.route("/getClassRepeat").all((req, res, next) => {
  4710. var json = queryString(req.url);
  4711. getmysql(req, res, "select_classRepeatAdmin", json["n"], json["oid"]);
  4712. });
  4713. //查询未在此班级的学生
  4714. router.route("/getClassStudent").all((req, res, next) => {
  4715. var json = queryString(req.url);
  4716. getmysql(
  4717. req,
  4718. res,
  4719. "getClassStudent",
  4720. json["cid"],
  4721. json["oid"],
  4722. json["cn"],
  4723. json["page"],
  4724. json["num"]
  4725. );
  4726. });
  4727. //查询未在此教研室的老师
  4728. router.route("/getClassTeacher").all((req, res, next) => {
  4729. var json = queryString(req.url);
  4730. getmysql(
  4731. req,
  4732. res,
  4733. "getClassTeacher",
  4734. json["cid"],
  4735. json["oid"],
  4736. json["cn"],
  4737. json["page"],
  4738. json["num"]
  4739. );
  4740. });
  4741. //查询未在此年级的班级
  4742. router.route("/getGradeClass").all((req, res, next) => {
  4743. var json = queryString(req.url);
  4744. getmysql(
  4745. req,
  4746. res,
  4747. "getGradeClass",
  4748. json["cid"],
  4749. json["oid"],
  4750. json["cn"],
  4751. json["page"],
  4752. json["num"]
  4753. );
  4754. });
  4755. //添加学生到班级
  4756. router.route("/addClassStudent").all((req, res, next) => {
  4757. let cid = req.body[0].cid;
  4758. let student = JSON.parse(decodeURIComponent(req.body[0].student));
  4759. for (let i = 0; i < student.length; i++) {
  4760. let _userdata = [student[i]];
  4761. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
  4762. mysql.usselect(_userdata, function(ret) {
  4763. let classid = ret[0][0].classid;
  4764. if (!classid || classid.indexOf(cid) == -1) {
  4765. classid = classid ? classid.split(",") : [];
  4766. classid.push(cid);
  4767. let _userdata2 = [student[i], classid.join(",")];
  4768. _userdata2.unshift(
  4769. _mysqlLabor[0],
  4770. _mysqlLabor[1],
  4771. "updateStudentClass"
  4772. );
  4773. mysql.usselect(_userdata2, function(ret) {
  4774. if (i == student.length - 1) {
  4775. res.end(JSON.stringify({ success: 1 }));
  4776. }
  4777. });
  4778. }
  4779. });
  4780. }
  4781. });
  4782. //添加老师到教研室
  4783. router.route("/addClassTeacher").all((req, res, next) => {
  4784. let cid = req.body[0].cid;
  4785. let student = JSON.parse(decodeURIComponent(req.body[0].student));
  4786. for (let i = 0; i < student.length; i++) {
  4787. let _userdata = [student[i]];
  4788. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
  4789. mysql.usselect(_userdata, function(ret) {
  4790. let classid = ret[0][0].cclassid;
  4791. if (!classid || classid.indexOf(cid) == -1) {
  4792. classid = classid ? classid.split(",") : [];
  4793. classid.push(cid);
  4794. let _userdata2 = [student[i], classid.join(",")];
  4795. _userdata2.unshift(
  4796. _mysqlLabor[0],
  4797. _mysqlLabor[1],
  4798. "updateTeacherClass"
  4799. );
  4800. mysql.usselect(_userdata2, function(ret) {
  4801. if (i == student.length - 1) {
  4802. res.end(JSON.stringify({ success: 1 }));
  4803. }
  4804. });
  4805. }
  4806. });
  4807. }
  4808. });
  4809. //添加班级到年级
  4810. router.route("/addGradeClass").all((req, res, next) => {
  4811. let cid = req.body[0].cid;
  4812. let student = JSON.parse(decodeURIComponent(req.body[0].student));
  4813. for (let i = 0; i < student.length; i++) {
  4814. let _userdata = [cid, student[i]];
  4815. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "addGradeClass");
  4816. mysql.usselect(_userdata, function(ret) {
  4817. if (i == student.length - 1) {
  4818. res.end(JSON.stringify({ success: 1 }));
  4819. }
  4820. });
  4821. }
  4822. });
  4823. //移除学生此班级
  4824. router.route("/deleteClassStudent").all((req, res, next) => {
  4825. let cid = req.body[0].cid;
  4826. let student = req.body[0].uid;
  4827. let _userdata = [student];
  4828. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
  4829. mysql.usselect(_userdata, function(ret) {
  4830. let classid = ret[0][0].classid;
  4831. if (classid.indexOf(cid) != -1) {
  4832. classid = classid.split(",");
  4833. classid.splice(classid.indexOf(cid), 1);
  4834. let _userdata2 = [student, classid.join(",")];
  4835. _userdata2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentClass");
  4836. mysql.usselect(_userdata2, function(ret) {
  4837. res.end(JSON.stringify({ success: 1 }));
  4838. });
  4839. }
  4840. });
  4841. });
  4842. //移除学生此班级
  4843. router.route("/deleteClassTeacher").all((req, res, next) => {
  4844. let cid = req.body[0].cid;
  4845. let student = req.body[0].uid;
  4846. let _userdata = [student];
  4847. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
  4848. mysql.usselect(_userdata, function(ret) {
  4849. let classid = ret[0][0].cclassid;
  4850. if (classid.indexOf(cid) != -1) {
  4851. classid = classid.split(",");
  4852. classid.splice(classid.indexOf(cid), 1);
  4853. let _userdata2 = [student, classid.join(",")];
  4854. _userdata2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTeacherClass");
  4855. mysql.usselect(_userdata2, function(ret) {
  4856. res.end(JSON.stringify({ success: 1 }));
  4857. });
  4858. }
  4859. });
  4860. });
  4861. //移除班级
  4862. router.route("/deleteGradeClass").all((req, res, next) => {
  4863. let cid = req.body[0].cid;
  4864. let student = req.body[0].uid;
  4865. let _userdata = ['', student];
  4866. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "addGradeClass");
  4867. mysql.usselect(_userdata, function(ret) {
  4868. res.end(JSON.stringify({ success: 1 }));
  4869. });
  4870. });
  4871. //admin 发布通知
  4872. router.route("/addNews").all((req, res, next) => {
  4873. postmysql(req, res, "add_news");
  4874. });
  4875. //admin 删除通知
  4876. router.route("/deleteNews").all((req, res, next) => {
  4877. postmysql(req, res, "delete_news");
  4878. });
  4879. //admin 添加banner
  4880. router.route("/addBanner").all((req, res, next) => {
  4881. postmysql(req, res, "add_banner");
  4882. });
  4883. //admin 添加banner
  4884. router.route("/deleteBanner").all((req, res, next) => {
  4885. postmysql(req, res, "delete_banner");
  4886. });
  4887. //admin 查询banner
  4888. router.route("/getBanner").all((req, res, next) => {
  4889. var json = queryString(req.url);
  4890. getmysql(req, res, "select_banner");
  4891. });
  4892. //根据学校查询banner
  4893. router.route("/selectBannerByOid").all((req, res, next) => {
  4894. var json = queryString(req.url);
  4895. getmysql(req, res, "selectBannerByOid", json["oid"]);
  4896. });
  4897. //admin 查询banner
  4898. router.route("/getBannerS").all((req, res, next) => {
  4899. var json = queryString(req.url);
  4900. getmysql(req, res, "getBannerS");
  4901. });
  4902. //根据学校查询banner
  4903. router.route("/selectBannerByOidS").all((req, res, next) => {
  4904. var json = queryString(req.url);
  4905. getmysql(req, res, "selectBannerByOidS", json["oid"]);
  4906. });
  4907. //admin 查询课程getSearchCourse
  4908. router.route("/getSearchCourse").all((req, res, next) => {
  4909. var json = queryString(req.url);
  4910. getmysql(req, res, "selectAll_courseSearch", json["t"]);
  4911. });
  4912. //根据学校查询课程
  4913. router.route("/getSearchCourseByoid").all((req, res, next) => {
  4914. var json = queryString(req.url);
  4915. getmysql(req, res, "selectAll_courseByOid", json["t"], json["oid"]);
  4916. });
  4917. //admin 查询所有课程专区
  4918. router.route("/getZone").all((req, res, next) => {
  4919. getmysql(req, res, "select_zone");
  4920. });
  4921. //admin 添加课程专区
  4922. router.route("/addZone").all((req, res, next) => {
  4923. postmysql(req, res, "insert_classZone");
  4924. });
  4925. //评审
  4926. router.route("/reviewCourse").all((req, res, next) => {
  4927. postmysql(req, res, "reviewCourse");
  4928. });
  4929. //查询评审
  4930. router.route("/getReview").all((req, res, next) => {
  4931. var json = queryString(req.url);
  4932. getmysql(req, res, "getReview", json["cid"]);
  4933. });
  4934. //查询所有课程专区下的课程
  4935. router.route("/getZoneClass").all((req, res, next) => {
  4936. var json = queryString(req.url);
  4937. getmysql(
  4938. req,
  4939. res,
  4940. "select_zoneClass",
  4941. json["bid"],
  4942. json["oid"],
  4943. json["page"],
  4944. 10
  4945. );
  4946. });
  4947. //查询所有课程专区下的课程
  4948. router.route("/getZoneClass").all((req, res, next) => {
  4949. var json = queryString(req.url);
  4950. getmysql(
  4951. req,
  4952. res,
  4953. "select_zoneClass",
  4954. json["bid"],
  4955. json["oid"],
  4956. json["page"],
  4957. 10
  4958. );
  4959. });
  4960. //查询所有课程专区下的课程
  4961. router.route("/getZoneClassStudent").all((req, res, next) => {
  4962. var json = queryString(req.url);
  4963. getmysql(
  4964. req,
  4965. res,
  4966. "select_zoneClass",
  4967. json["bid"],
  4968. json["oid"],
  4969. json["page"],
  4970. 20
  4971. );
  4972. });
  4973. //admin 后台查看专区下课程的数量
  4974. router.route("/getZoneClassNum").all((req, res, next) => {
  4975. var json = queryString(req.url);
  4976. getmysql(req, res, "select_zoneClassNum", json["bid"]);
  4977. });
  4978. //admin 后台添加课程专区时查看课程是否在此专区重复
  4979. router.route("/getZoneClassRepeat").all((req, res, next) => {
  4980. var json = queryString(req.url);
  4981. getmysql(req, res, "select_zoneClassRepeat", json["pid"], json["cid"]);
  4982. });
  4983. //把课程添加进专区
  4984. router.route("/addZoneCourse").all((req, res, next) => {
  4985. postmysql(req, res, "insert_app");
  4986. });
  4987. //admin 删除课程专区底下的课程
  4988. router.route("/deleteZoneCourse").all((req, res, next) => {
  4989. postmysql(req, res, "delete_app");
  4990. });
  4991. //admin 删除班级
  4992. router.route("/deleteZone").all((req, res, next) => {
  4993. postmysql(req, res, "delete_zone");
  4994. });
  4995. //admin 后台专区上移下移
  4996. router.route("/zoneRank").all((req, res, next) => {
  4997. postmysql(req, res, "update_classRank");
  4998. });
  4999. //admin 添加模板文档
  5000. router.route("/addTemplateAdmin").all((req, res, next) => {
  5001. postmysql(req, res, "add_template");
  5002. });
  5003. //admin 添加模板文档
  5004. router.route("/deleteTemplateAdmin").all((req, res, next) => {
  5005. postmysql(req, res, "delete_template");
  5006. });
  5007. //admin 查询模板文档
  5008. router.route("/getTemplateAdmin").all((req, res, next) => {
  5009. var json = queryString(req.url);
  5010. getmysql(req, res, "select_template", json["page"], 10);
  5011. });
  5012. //查询上传作业
  5013. router.route("/getCourseWorks").all((req, res, next) => {
  5014. var json = queryString(req.url); //cid 课程id,page 页数
  5015. getmysql(
  5016. req,
  5017. res,
  5018. "select_courseWorks",
  5019. json["cid"],
  5020. json["stage"],
  5021. json["task"],
  5022. json["page"],
  5023. 10
  5024. );
  5025. });
  5026. //查询上传作业
  5027. router.route("/getCourseWorks2").all((req, res, next) => {
  5028. var json = queryString(req.url); //cid 课程id,page 页数
  5029. getmysql(
  5030. req,
  5031. res,
  5032. "select_courseWorks2",
  5033. json["cid"],
  5034. json["uname"],
  5035. json["stage"],
  5036. json["task"],
  5037. json["page"],
  5038. 10
  5039. );
  5040. });
  5041. //查询上传作业
  5042. router.route("/getCourseWorks3").all((req, res, next) => {
  5043. var json = queryString(req.url); //cid 课程id,page 页数
  5044. getmysql(
  5045. req,
  5046. res,
  5047. "select_courseWorks3",
  5048. json["cid"],
  5049. json["uname"],
  5050. json["stage"],
  5051. json["task"],
  5052. json["page"],
  5053. 10
  5054. );
  5055. });
  5056. //查询上传作业
  5057. router.route("/getCourseWorks3Copy").all((req, res, next) => {
  5058. var json = queryString(req.url); //cid 课程id,page 页数
  5059. getmysql(
  5060. req,
  5061. res,
  5062. "getCourseWorks3Copy",
  5063. json["cid"],
  5064. json["uname"],
  5065. json["stage"],
  5066. json["task"],
  5067. json["page"],
  5068. 10
  5069. );
  5070. });
  5071. //查询上传作业y
  5072. router.route("/getCourseWorks3Copy1").all((req, res, next) => {
  5073. var json = queryString(req.url); //cid 课程id,page 页数
  5074. getmysql(
  5075. req,
  5076. res,
  5077. "getCourseWorks3Copy1",
  5078. json["cid"],
  5079. json["uCla"],
  5080. json["uname"],
  5081. json["tck"],
  5082. json["stage"],
  5083. json["task"],
  5084. json["page"],
  5085. 10
  5086. );
  5087. });
  5088. //评价管理查看报告-学生上下切换功能
  5089. router.route("/getCourseWorksList").all((req, res, next) => {
  5090. var json = queryString(req.url); //cid 课程id
  5091. getmysql(
  5092. req,
  5093. res,
  5094. "getCourseWorksList",
  5095. json["cid"]
  5096. );
  5097. });
  5098. //评价管理查看报告筛选获取班级
  5099. router.route("/getCourseReportClassList").all((req, res, next) => {
  5100. var json = queryString(req.url); //cid 课程id
  5101. getmysql(
  5102. req,
  5103. res,
  5104. "getCourseReportClassList",
  5105. json["cid"]
  5106. );
  5107. });
  5108. //查询上传作业--加上筛选班级
  5109. router.route("/getCourseWorks5").all((req, res, next) => {
  5110. var json = queryString(req.url); //cid 课程id,page 页数
  5111. getmysql(
  5112. req,
  5113. res,
  5114. "select_courseWorks5",
  5115. json["cid"],
  5116. json["uname"],
  5117. json["choseClass"],
  5118. json["stage"],
  5119. json["task"],
  5120. json["page"],
  5121. 10
  5122. );
  5123. });
  5124. //查询上传作业--加上筛选班级
  5125. router.route("/getCourseStageWorks").all((req, res, next) => {
  5126. var json = queryString(req.url); //cid 课程id,page 页数
  5127. getmysql(
  5128. req,
  5129. res,
  5130. "getCourseStageWorks",
  5131. json["cid"],
  5132. json["uname"],
  5133. json["choseClass"],
  5134. json["stage"],
  5135. json["task"],
  5136. json["page"],
  5137. 10
  5138. );
  5139. });
  5140. //查询上传作业--加上筛选班级
  5141. router.route("/getCourseStageWorks2").all((req, res, next) => {
  5142. var json = queryString(req.url); //cid 课程id,page 页数
  5143. getmysql(
  5144. req,
  5145. res,
  5146. "getCourseStageWorks2",
  5147. json["cid"],
  5148. json["uname"],
  5149. json["choseClass"],
  5150. json["stage"],
  5151. json["task"]
  5152. );
  5153. });
  5154. //查询上传作业--加上筛选班级
  5155. router.route("/getCourseTaskWorks").all((req, res, next) => {
  5156. var json = queryString(req.url); //cid 课程id,page 页数
  5157. getmysql(
  5158. req,
  5159. res,
  5160. "getCourseTaskWorks",
  5161. json["cid"],
  5162. json["uname"],
  5163. json["choseClass"],
  5164. json["stage"],
  5165. json["task"],
  5166. json["page"],
  5167. 10
  5168. );
  5169. });
  5170. //查询上传作业--加上筛选班级
  5171. router.route("/getCourseTaskWorks2").all((req, res, next) => {
  5172. var json = queryString(req.url); //cid 课程id,page 页数
  5173. getmysql(
  5174. req,
  5175. res,
  5176. "getCourseTaskWorks2",
  5177. json["cid"],
  5178. json["uname"],
  5179. json["choseClass"],
  5180. json["stage"],
  5181. json["task"]
  5182. );
  5183. });
  5184. //查询所有学生上传作业--加上筛选班级
  5185. router.route("/getCourseWorks6").all((req, res, next) => {
  5186. var json = queryString(req.url); //cid 课程id,page 页数
  5187. getmysql(
  5188. req,
  5189. res,
  5190. "select_courseWorks6",
  5191. json["cid"],
  5192. json["uname"],
  5193. json['choseClass'],
  5194. json["stage"],
  5195. json["task"]
  5196. );
  5197. });
  5198. //查询所有学生上传作业
  5199. router.route("/getCourseWorks4").all((req, res, next) => {
  5200. var json = queryString(req.url); //cid 课程id,page 页数
  5201. getmysql(
  5202. req,
  5203. res,
  5204. "select_courseWorks4",
  5205. json["cid"],
  5206. json["uname"],
  5207. json["stage"],
  5208. json["task"]
  5209. );
  5210. });
  5211. //查询学生课程作业
  5212. router.route("/selectStudentCourseWorks").all((req, res, next) => {
  5213. var json = queryString(req.url); //cid 课程id,page 页数
  5214. getmysql(
  5215. req,
  5216. res,
  5217. "selectStudentCourseWorks",
  5218. json["uid"],
  5219. json["cid"],
  5220. json["stage"],
  5221. json["task"],
  5222. json["page"],
  5223. 10
  5224. );
  5225. });
  5226. //查询学生课程作业
  5227. router.route("/selectStudentCourseWorksTwo").all((req, res, next) => {
  5228. var json = queryString(req.url); //cid 课程id,page 页数
  5229. getmysql(
  5230. req,
  5231. res,
  5232. "selectStudentCourseWorksTwo",
  5233. json["uid"],
  5234. json["cname"],
  5235. json["uClass"],
  5236. json["page"],
  5237. 10
  5238. );
  5239. });
  5240. //查询学生课程作业
  5241. router.route("/selectStudentCourseWorksTwo2").all((req, res, next) => {
  5242. var json = queryString(req.url); //cid 课程id,page 页数
  5243. getmysql(
  5244. req,
  5245. res,
  5246. "selectStudentCourseWorksTwo2",
  5247. json["uid"],
  5248. json["cname"],
  5249. json["uClass"],
  5250. json["userid"],
  5251. json["page"],
  5252. 10
  5253. );
  5254. });
  5255. //查询报告数据
  5256. router.route("/getCourseWorksReport").all((req, res, next) => {
  5257. var json = queryString(req.url); //cid 课程id,page 页数
  5258. getmysql(req, res, "getCourseWorksReport", json["cid"]);
  5259. });
  5260. //查询报告数据y
  5261. router.route("/getCourseWorksReport1").all((req, res, next) => {
  5262. var json = queryString(req.url); //cid 课程id
  5263. getmysql(req, res, "getCourseWorksReport1", json["cid"]);
  5264. });
  5265. //查询报告数据--根据班级
  5266. router.route("/getCourseWorksReport2").all((req, res, next) => {
  5267. var json = queryString(req.url); //cid 课程id,page 页数
  5268. getmysql(req, res, "getCourseWorksReport2", json["cid"],json["choseClass"]);
  5269. });
  5270. //查询dyList
  5271. router.route("/getCourseWorksDyList").all((req, res, next) => {
  5272. var json = queryString(req.url); //cid 课程id,page 页数
  5273. getmysql(req, res, "getCourseWorksDyList", json["cid"]);
  5274. });
  5275. //查询多个课程报告数据
  5276. router.route("/getCourseWorksReportMore").all((req, res, next) => {
  5277. var json = queryString(req.url); //cid 课程id,page 页数
  5278. getmysql(req, res, "getCourseWorksReportMore", json["cid"]);
  5279. });
  5280. //查询学生课程报告数据
  5281. router.route("/getStudentCourseWorksReport").all((req, res, next) => {
  5282. var json = queryString(req.url); //cid 课程id,page 页数
  5283. getmysql(req, res, "getStudentCourseWorksReport", json["uid"]);
  5284. });
  5285. //admin 添加项目模板文档
  5286. router.route("/addCourseTemplateAdmin").all((req, res, next) => {
  5287. postmysql(req, res, "add_courseTemplate");
  5288. });
  5289. //admin 添加项目模板文档
  5290. router.route("/deleteCourseTemplateAdmin").all((req, res, next) => {
  5291. postmysql(req, res, "delete_courseTemplate");
  5292. });
  5293. //admin 查询项目模板文档
  5294. router.route("/getCourseTemplateAdmin").all((req, res, next) => {
  5295. var json = queryString(req.url);
  5296. getmysql(req, res, "select_courseTemplate", json["page"], 10);
  5297. });
  5298. //teacher 查询项目模板
  5299. router.route("/getCourseTemplateT").all((req, res, next) => {
  5300. var json = queryString(req.url);
  5301. getmysql(req, res, "select_courseTemplateT");
  5302. });
  5303. //teacher 查询项目模板
  5304. router.route("/getTrainCourseTemplateT").all((req, res, next) => {
  5305. var json = queryString(req.url);
  5306. getmysql(req, res, "getTrainCourseTemplateT");
  5307. });
  5308. //teacher 查询项目模板
  5309. router.route("/getCourseTemplateTByOid").all((req, res, next) => {
  5310. var json = queryString(req.url);
  5311. getmysql(req, res, "getCourseTemplateTByOid", json["oid"]);
  5312. });
  5313. //teacher 查询项目模板
  5314. router.route("/getTrainCourseTemplateTByOid").all((req, res, next) => {
  5315. var json = queryString(req.url);
  5316. getmysql(req, res, "getTrainCourseTemplateTByOid", json["oid"]);
  5317. });
  5318. //目标管理查询目标模板
  5319. router.route("/selectEvaTemplate").all((req, res, next) => {
  5320. var json = queryString(req.url);
  5321. getmysql(req, res, "select_evaTemplate", json["oid"]);
  5322. });
  5323. //目标管理新增目标模板 修1
  5324. router.route("/addEvaTemplate").get((req, res, next) => {
  5325. var json = queryString(req.url);
  5326. getmysql2(req, res, "add_evaTemplate", json["t"], json["c"], json["uid"], json["oid"]);
  5327. });
  5328. //teacher 查询项目模板
  5329. router.route("/getCourseTemplateTs").all((req, res, next) => {
  5330. var json = queryString(req.url);
  5331. getmysql(req, res, "getCourseTemplateTs", json["oid"]);
  5332. });
  5333. //teacher 查询项目模板
  5334. router.route("/getCourseTemplateTStudio").all((req, res, next) => {
  5335. var json = queryString(req.url);
  5336. getmysql(req, res, "getCourseTemplateTStudio", json["oid"]);
  5337. });
  5338. //admin 查询课程
  5339. router.route("/getCourseAdmin").all((req, res, next) => {
  5340. var json = queryString(req.url);
  5341. getmysql(req, res, "select_courseAdmin", json["cn"], json["page"], 10);
  5342. });
  5343. //admin 查询模板文档
  5344. router.route("/deleteCourseAdmin").all((req, res, next) => {
  5345. postmysql(req, res, "delete_courseAdmin");
  5346. });
  5347. //设置分组
  5348. router.route("/setCourseGroup").all((req, res, next) => {
  5349. postmysql(req, res, "setCourseGroup");
  5350. });
  5351. //删除分组
  5352. router.route("/deleteCourseGroup").all((req, res, next) => {
  5353. postmysql(req, res, "deleteCourseGroup");
  5354. });
  5355. //获取分组
  5356. router.route("/getCourseGroup").all((req, res, next) => {
  5357. var json = queryString(req.url);
  5358. getmysql(req, res, "getCourseGroup", json["cid"], json["classid"]);
  5359. });
  5360. //获取分组
  5361. router.route("/getCourseGroup2").all((req, res, next) => {
  5362. var json = queryString(req.url);
  5363. getmysql(req, res, "getCourseGroup2", json["cid"], json["classid"]);
  5364. });
  5365. //加入分组
  5366. router.route("/joinCourseGroup").all((req, res, next) => {
  5367. postmysql(req, res, "joinCourseGroup");
  5368. });
  5369. //退出分组
  5370. router.route("/exitCourseGroup").all((req, res, next) => {
  5371. postmysql(req, res, "exitCourseGroup");
  5372. });
  5373. //加入分组
  5374. router.route("/joinGroup").all((req, res, next) => {
  5375. postmysql(req, res, "joinGroup");
  5376. });
  5377. //退出分组
  5378. router.route("/exitGroup").all((req, res, next) => {
  5379. postmysql(req, res, "exitGroup");
  5380. });
  5381. //查看分组
  5382. router.route("/selectGroup").all((req, res, next) => {
  5383. postmysql(req, res, "selectGroup");
  5384. });
  5385. //查询pblstudent 分页
  5386. router.route("/selectPblStudent").all((req, res, next) => {
  5387. var json = queryString(req.url);
  5388. getmysql(req, res, "selectPblStudent", json["uid"], json["org"], json["oid"], json["type"], json["n"], json["page"], json["int"]);
  5389. });
  5390. //删除pblstudent 传courseid
  5391. router.route("/deletePblStudent").all((req, res, next) => {
  5392. postmysql(req, res, "deletePblStudent");
  5393. });
  5394. //查询pblstudent单个项目详情
  5395. router.route("/selectPblStudentDetail").all((req, res, next) => {
  5396. var json = queryString(req.url);
  5397. getmysql(req, res, "selectPblStudentDetail", json["cid"]);
  5398. });
  5399. //添加pblstudent 传uid 用户id t 标题 n 选题
  5400. router.route("/addPblStudent").all((req, res, next) => {
  5401. postmysql(req, res, "addPblStudent");
  5402. });
  5403. //修改pblstudentjson内容 传 cid 课程id chapters内容
  5404. router.route("/updatePblStudentChapters").all((req, res, next) => {
  5405. postmysql(req, res, "updatePblStudentChapters");
  5406. });
  5407. //修改pblstudent 所属已完成位置 传 cid 课程id doi 已完成位置传数字
  5408. router.route("/updatePblStudentDoIndex").all((req, res, next) => {
  5409. postmysql(req, res, "updatePblStudentDoIndex");
  5410. });
  5411. //课堂观察 对比分析查询
  5412. router.route("/select_contrastObservation_data").all((req, res, next) => {
  5413. postmysql(req, res, "select_contrastObservation_data");
  5414. });
  5415. //课堂观察 对比分析查询
  5416. router.route("/update_contrastObservation_data").all((req, res, next) => {
  5417. postmysql(req, res, "update_contrastObservation_data");
  5418. });
  5419. //查询ppt在哪页
  5420. router.route("/selectPptPage").all((req, res, next) => {
  5421. var json = queryString(req.url);
  5422. getmysql(req, res, "selectPptPage", json["id"]);
  5423. });
  5424. //修改ppt页码
  5425. router.route("/updatePptPage").all((req, res, next) => {
  5426. postmysql(req, res, "updatePptPage");
  5427. });
  5428. //修改ppt操作
  5429. router.route("/updatePPTHandle").all((req, res, next) => {
  5430. postmysql(req, res, "updatePPTHandle");
  5431. });
  5432. //查询实时课堂
  5433. router.route("/getRealTimeClass").all((req, res, next) => {
  5434. var json = queryString(req.url);
  5435. getmysql(
  5436. req,
  5437. res,
  5438. "getRealTimeClass",
  5439. json["cn"],
  5440. json["uid"],
  5441. json["page"],
  5442. 10
  5443. );
  5444. });
  5445. //查询实时课堂学生
  5446. router.route("/getRealTimeClassStu").all((req, res, next) => {
  5447. var json = queryString(req.url);
  5448. getmysql(
  5449. req,
  5450. res,
  5451. "getRealTimeClassStu",
  5452. json["oid"],
  5453. json["cid"],
  5454. json["page"],
  5455. 10
  5456. );
  5457. });
  5458. //查询实时课堂学生
  5459. router.route("/getRealTimeClassById").all((req, res, next) => {
  5460. var json = queryString(req.url);
  5461. getmysql(req, res, "getRealTimeClassById", json["id"]);
  5462. });
  5463. //根据区级管理者查询案例
  5464. router.route("/selectAnliList").all((req, res, next) => {
  5465. var json = queryString(req.url);
  5466. getmysql(
  5467. req,
  5468. res,
  5469. "selectAnliList",
  5470. json["typea"],
  5471. json["typeb"],
  5472. json["typec"],
  5473. json["typed"],
  5474. json["typeE"],
  5475. json["cn"],
  5476. json["cid"],
  5477. json["title"],
  5478. json["page"],
  5479. 10
  5480. );
  5481. });
  5482. //根据区级管理者查询案例
  5483. router.route("/selectAnliListGM").all((req, res, next) => {
  5484. var json = queryString(req.url);
  5485. getmysql(
  5486. req,
  5487. res,
  5488. "selectAnliListGM",
  5489. json["typea"],
  5490. json["typeb"],
  5491. json["typec"],
  5492. json["typed"],
  5493. json["typeE"],
  5494. json["cn"],
  5495. json["cid"],
  5496. json["title"],
  5497. json["page"],
  5498. 10
  5499. );
  5500. });
  5501. //根据市级管理者查询案例
  5502. router.route("/selectAnliList1").all((req, res, next) => {
  5503. var json = queryString(req.url);
  5504. getmysql(
  5505. req,
  5506. res,
  5507. "selectAnliList1",
  5508. json["typea"],
  5509. json["typeb"],
  5510. json["typec"],
  5511. json["typed"],
  5512. json["typeE"],
  5513. json["cn"],
  5514. json["cid"],
  5515. json["title"],
  5516. json["page"],
  5517. 10
  5518. );
  5519. });
  5520. //根据省级级管理者查询案例
  5521. router.route("/selectAnliList2").all((req, res, next) => {
  5522. var json = queryString(req.url);
  5523. getmysql(
  5524. req,
  5525. res,
  5526. "selectAnliList2",
  5527. json["typea"],
  5528. json["typeb"],
  5529. json["typec"],
  5530. json["typed"],
  5531. json["typeE"],
  5532. json["cn"],
  5533. json["cid"],
  5534. json["title"],
  5535. json["page"],
  5536. 10
  5537. );
  5538. });
  5539. //删除1案例
  5540. router.route("/deleteAnli").all((req, res, next) => {
  5541. var json = queryString(req.url);
  5542. getmysql2(req, res, "deleteAnli", json["id"]);
  5543. });
  5544. //根据区县管理者查询评分
  5545. router.route("/selectPoint").all((req, res, next) => {
  5546. var json = queryString(req.url);
  5547. getmysql(
  5548. req,
  5549. res,
  5550. "selectPoint",
  5551. json["typea"],
  5552. json["typeb"],
  5553. json["typec"],
  5554. json["typed"],
  5555. json["typeE"],
  5556. json["cn"],
  5557. json["cid"],
  5558. json["title"],
  5559. json["page"],
  5560. 10
  5561. );
  5562. });
  5563. //根据市级管理者查询评分
  5564. router.route("/selectPoint1").all((req, res, next) => {
  5565. var json = queryString(req.url);
  5566. getmysql(
  5567. req,
  5568. res,
  5569. "selectPoint1",
  5570. json["typea"],
  5571. json["typeb"],
  5572. json["typec"],
  5573. json["typed"],
  5574. json["typeE"],
  5575. json["cn"],
  5576. json["cid"],
  5577. json["title"],
  5578. json["page"],
  5579. 10
  5580. );
  5581. });
  5582. //根据市级管理者查询全部评分
  5583. router.route("/selectPointAll").all((req, res, next) => {
  5584. var json = queryString(req.url);
  5585. getmysql(
  5586. req,
  5587. res,
  5588. "selectPointAll",
  5589. json["typea"],
  5590. json["typeb"],
  5591. json["typec"],
  5592. json["typed"],
  5593. json["typeE"],
  5594. json["cn"],
  5595. json["cid"],
  5596. json["title"]
  5597. );
  5598. });
  5599. //根据市级管理者查询全部评分
  5600. router.route("/selectPointAllGM").all((req, res, next) => {
  5601. var json = queryString(req.url);
  5602. getmysql(
  5603. req,
  5604. res,
  5605. "selectPointAllGM",
  5606. json["typea"],
  5607. json["typeb"],
  5608. json["typec"],
  5609. json["typed"],
  5610. json["typeE"],
  5611. json["cn"],
  5612. json["cid"],
  5613. json["title"]
  5614. );
  5615. });
  5616. //根据市级管理者查询全部评分
  5617. router.route("/selectPointAllGM2").all((req, res, next) => {
  5618. var json = queryString(req.url);
  5619. getmysql(
  5620. req,
  5621. res,
  5622. "selectPointAllGM2",
  5623. json["typea"],
  5624. json["typeb"],
  5625. json["typec"],
  5626. json["typed"],
  5627. json["typeE"],
  5628. json["cn"],
  5629. json["cid"],
  5630. json["title"],
  5631. json["numCheck"]
  5632. );
  5633. });
  5634. //根据市级管理者查询全部评分
  5635. router.route("/selectPointAllGM2Post").all((req, res, next) => {
  5636. postmysql(req, res, "selectPointAllGM2");
  5637. });
  5638. //查询分配案例
  5639. router.route("/selectCaseUser").all((req, res, next) => {
  5640. var json = queryString(req.url);
  5641. getmysql(req, res, "select_case", json["uid"]);
  5642. });
  5643. //根据用户id,课程id,阶段,任务,工具去查询协同
  5644. router.route("/selectWord").all((req, res, next) => {
  5645. var json = queryString(req.url);
  5646. getmysql(
  5647. req,
  5648. res,
  5649. "selectWord",
  5650. json["uid"],
  5651. json["cid"],
  5652. json["s"],
  5653. json["task"],
  5654. json["t"]
  5655. );
  5656. });
  5657. //根据用户id,课程id,阶段,任务,工具去查询协同
  5658. router.route("/selectWord2").all((req, res, next) => {
  5659. var json = queryString(req.url);
  5660. getmysql(
  5661. req,
  5662. res,
  5663. "selectWord2",
  5664. json["uid"],
  5665. json["cid"],
  5666. json["s"],
  5667. json["task"],
  5668. json["t"],
  5669. json["type"]
  5670. );
  5671. });
  5672. //根据用户id,课程id,阶段,任务,工具去查询协同
  5673. router.route("/selectWords").all((req, res, next) => {
  5674. var json = queryString(req.url);
  5675. getmysql(
  5676. req,
  5677. res,
  5678. "selectWords",
  5679. json["uid"],
  5680. json["cid"],
  5681. json["s"],
  5682. json["task"],
  5683. json["t"],
  5684. json["type"]
  5685. );
  5686. });
  5687. //根据用户id,课程id,阶段,任务,工具去查询协同
  5688. router.route("/selectWordsY").all((req, res, next) => {
  5689. var json = queryString(req.url);
  5690. getmysql(
  5691. req,
  5692. res,
  5693. "selectWordsY",
  5694. json["uid"],
  5695. json["cid"],
  5696. json["s"],
  5697. json["task"],
  5698. json["t"],
  5699. json["type"]
  5700. );
  5701. });
  5702. //新增协同内容
  5703. router.route("/insertWord2y").all((req, res, next) => {
  5704. var json = queryString(req.url);
  5705. // getmysql(req, res, "insertWord2y", json["uid"], json["cid"], json["s"], json["task"], json["t"], json["text"], json["type"]);
  5706. postmysql3(req, res, "insertWord2y");
  5707. });
  5708. //新增协同内容 修1
  5709. router.route("/insertWord").get((req, res, next) => {
  5710. var json = queryString(req.url);
  5711. getmysql2(
  5712. req,
  5713. res,
  5714. "insertWord",
  5715. json["uid"],
  5716. json["cid"],
  5717. json["s"],
  5718. json["task"],
  5719. json["t"],
  5720. json["text"]
  5721. );
  5722. });
  5723. //分配案例
  5724. router.route("/insertCase").all((req, res, next) => {
  5725. if (req.body[0]) {
  5726. p = [req.body[0].uid, req.body[0].box];
  5727. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insertCase"); //執行存儲過程
  5728. mysql.usselect(p, function(ret) {
  5729. res.end(JSON.stringify({ success: 1 }));
  5730. });
  5731. }
  5732. });
  5733. //新增评分
  5734. router.route("/addScore").all((req, res, next) => {
  5735. postmysql(req, res, "addScore");
  5736. });
  5737. //添加用户标签
  5738. router.route("/add_userlabel").all((req, res, next) => {
  5739. postmysql2(req, res, "add_userlabel");
  5740. });
  5741. //查询评分
  5742. router.route("/selectScore").all((req, res, next) => {
  5743. var json = queryString(req.url);
  5744. getmysql(req, res, "selectScore", json["rid"], json["suser"]);
  5745. });
  5746. //查询所有评分
  5747. router.route("/selectAllScore").all((req, res, next) => {
  5748. var json = queryString(req.url);
  5749. getmysql(req, res, "selectAllScore");
  5750. });
  5751. //查询所有评分
  5752. router.route("/selectAllScoreGM").all((req, res, next) => {
  5753. var json = queryString(req.url);
  5754. getmysql(req, res, "selectAllScoreGM");
  5755. });
  5756. //查询所有评分
  5757. router.route("/selectAllScoreGM2").all((req, res, next) => {
  5758. var json = queryString(req.url);
  5759. getmysql(req, res, "selectAllScoreGM2", json['numCheck']);
  5760. });
  5761. //查询所有学校以及组织
  5762. router.route("/selectAllSchool").all((req, res, next) => {
  5763. var json = queryString(req.url);
  5764. getmysql(req, res, "selectAllSchool");
  5765. });
  5766. //查询所有学校以及组织
  5767. router.route("/selectAllSchoolByOid").all((req, res, next) => {
  5768. var json = queryString(req.url);
  5769. getmysql(req, res, "selectAllSchoolByOid", json['oid']);
  5770. });
  5771. //根据用户id查询评分
  5772. router.route("/selectScoreByUid").all((req, res, next) => {
  5773. var json = queryString(req.url);
  5774. getmysql(req, res, "selectScoreByUid", json["uid"]);
  5775. });
  5776. //查询单个案例所有评分
  5777. router.route("/selectAnliScore").all((req, res, next) => {
  5778. var json = queryString(req.url);
  5779. getmysql(req, res, "selectAnliScore", json["rid"]);
  5780. });
  5781. //赛事推荐 修1
  5782. router.route("/updateRaceRec").get((req, res, next) => {
  5783. var json = queryString(req.url);
  5784. getmysql2(req, res, "updateRaceRec", json["id"], json["rec"]);
  5785. });
  5786. //查询数据报告学生报告列表
  5787. router.route("/selectSr").all((req, res, next) => {
  5788. var json = queryString(req.url);
  5789. getmysql(
  5790. req,
  5791. res,
  5792. "selectSr",
  5793. json["cu"],
  5794. json["cn"],
  5795. json["oid"],
  5796. json["page"],
  5797. 10
  5798. );
  5799. });
  5800. //查询数据报告班级报告列表
  5801. router.route("/selectCr").all((req, res, next) => {
  5802. var json = queryString(req.url);
  5803. getmysql(
  5804. req,
  5805. res,
  5806. "selectCr",
  5807. json["cu"],
  5808. json["cn"],
  5809. json["oid"],
  5810. json["page"],
  5811. 10
  5812. );
  5813. });
  5814. //查询数据报告查看班级报告底下学生列表
  5815. router.route("/selectCStudent").all((req, res, next) => {
  5816. var json = queryString(req.url);
  5817. getmysql(req, res, "selectCStudent", json["cid"], json["courseid"]);
  5818. });
  5819. //查询数据报告课程报告列表
  5820. router.route("/selectCourseR").all((req, res, next) => {
  5821. var json = queryString(req.url);
  5822. getmysql(
  5823. req,
  5824. res,
  5825. "selectCourseR",
  5826. json["cu"],
  5827. json["cn"],
  5828. json["cl"],
  5829. json["oid"],
  5830. json["page"],
  5831. 10
  5832. );
  5833. });
  5834. //根据学校id查询学校底下有评价的课程
  5835. router.route("/selectCourseByOid").all((req, res, next) => {
  5836. var json = queryString(req.url);
  5837. getmysql(req, res, "selectCourseByOid", json["oid"]);
  5838. });
  5839. //根据目标id和班级id查询底下有作业的课程
  5840. router.route("/selectEvaCourse").all((req, res, next) => {
  5841. var json = queryString(req.url);
  5842. getmysql(req, res, "selectEvaCourse", json["eid"], json["cid"]);
  5843. });
  5844. //teacher 查询模板
  5845. router.route("/getTemplateT").all((req, res, next) => {
  5846. var json = queryString(req.url);
  5847. getmysql(req, res, "select_templateT");
  5848. });
  5849. //思维网格 创建房间
  5850. router.route("/insertRoom").all((req, res, next) => {
  5851. postmysql(req, res, "insertRoom");
  5852. });
  5853. //删除作业阶段任务工具
  5854. router.route("/deleteStudentToolSTT").all((req, res, next) => {
  5855. postmysql(req, res, "deleteStudentToolSTT");
  5856. });
  5857. //删除作业阶段任务
  5858. router.route("/deleteStudentToolST").all((req, res, next) => {
  5859. postmysql(req, res, "deleteStudentToolST");
  5860. });
  5861. //删除作业阶段
  5862. router.route("/deleteStudentToolS").all((req, res, next) => {
  5863. postmysql(req, res, "deleteStudentToolST");
  5864. });
  5865. //协同编辑 创建房间
  5866. router.route("/insertRoomByFile").all((req, res, next) => {
  5867. //var json = queryString(req.url);
  5868. postmysql2(req, res, "insertRoomByFile");
  5869. //getmysql(req, res, "insertRoomByFile", json["uid"], json["n"], json["d"]);
  5870. });
  5871. //思维网格 查询是否是重复房间号
  5872. router.route("/checkRoomNum").all((req, res, next) => {
  5873. var json = queryString(req.url);
  5874. getmysql(req, res, "checkRoomNum", json["num"]);
  5875. });
  5876. //思维网格 查询房间列表
  5877. router.route("/selectRoomList").all((req, res, next) => {
  5878. var json = queryString(req.url);
  5879. getmysql(
  5880. req,
  5881. res,
  5882. "selectRoomList",
  5883. json["uid"],
  5884. json["oid"],
  5885. json["cid"],
  5886. json["cu"],
  5887. json["cn"]
  5888. );
  5889. });
  5890. //查询pdf列表
  5891. router.route("/selectRTC").all((req, res, next) => {
  5892. var json = queryString(req.url);
  5893. getmysql(req, res, "selectRTC", json["uid"], json["cu"], json["cn"]);
  5894. });
  5895. //协同文档 查询房间列表
  5896. router.route("/selectFileList").all((req, res, next) => {
  5897. var json = queryString(req.url);
  5898. getmysql(
  5899. req,
  5900. res,
  5901. "selectFileList",
  5902. json["uid"],
  5903. json["oid"],
  5904. json["cid"],
  5905. json["cu"],
  5906. json["cn"]
  5907. );
  5908. });
  5909. //协同编辑 查询是否是重复房间号
  5910. router.route("/checkRoomNumByFile").all((req, res, next) => {
  5911. var json = queryString(req.url);
  5912. getmysql(req, res, "checkRoomNumByFile", json["num"]);
  5913. });
  5914. //思维网格 根据房间号或者用户id查询房间信息
  5915. router.route("/selectRoom").all((req, res, next) => {
  5916. var json = queryString(req.url);
  5917. getmysql(req, res, "selectRoom", json["uid"]);
  5918. });
  5919. //思维网格 根据房间号或者用户id查询房间信息
  5920. router.route("/getRoom").all((req, res, next) => {
  5921. var json = queryString(req.url);
  5922. getmysql(req, res, "select_room", json["fid"]);
  5923. });
  5924. //协同编辑 根据房间号或者用户id查询房间信息
  5925. router.route("/selectRoomByFile").all((req, res, next) => {
  5926. var json = queryString(req.url);
  5927. getmysql(req, res, "selectRoomByFile", json["uid"]);
  5928. });
  5929. //思维网格 修改房间数据
  5930. router.route("/updateRoomData").all((req, res, next) => {
  5931. postmysql(req, res, "updateRoomData");
  5932. });
  5933. // 修1
  5934. router.route("/updateFileData").get((req, res, next) => {
  5935. var json = queryString(req.url);
  5936. var json2 = json["mode"].split(",");
  5937. getmysql2(req, res, "updateFileData", json2[0], json2[1]);
  5938. });
  5939. router.route("/select_file").all((req, res, next) => {
  5940. var json = queryString(req.url);
  5941. getmysql(req, res, "select_file", json["fid"]);
  5942. });
  5943. //思维网格 解散房间
  5944. router.route("/dismiss").all((req, res, next) => {
  5945. postmysql(req, res, "update_room");
  5946. });
  5947. //提交提问
  5948. router.route("/addProblem").all((req, res, next) => {
  5949. postmysql(req, res, "add_problem");
  5950. //cid 课程id,chid 章节id,t 提问内容,uid 用户id
  5951. });
  5952. //查询提交的提问
  5953. router.route("/getProblem").all((req, res, next) => {
  5954. var json = queryString(req.url); //cid 课程id,page 页数
  5955. getmysql(req, res, "select_problem", json["cid"], json["page"], 10);
  5956. });
  5957. //获取用户基本信息
  5958. router.route("/getUserInfo").all((req, res, next) => {
  5959. var json = queryString(req.url);
  5960. getmysql(req, res, "getUserInfo", json["uid"], json["cid"]);
  5961. });
  5962. //获取用户多个课程基本信息
  5963. router.route("/getUserInfoMore").all((req, res, next) => {
  5964. var json = queryString(req.url);
  5965. getmysql(req, res, "getUserInfoMore", json["uid"], json["cid"]);
  5966. });
  5967. //获取多个用户单个课程基本信息
  5968. router.route("/getClassUserInfoMore").all((req, res, next) => {
  5969. var json = queryString(req.url);
  5970. getmysql(req, res, "getClassUserInfoMore", json["uid"], json["cid"]);
  5971. });
  5972. //获取课程下所有有作业的学生id
  5973. router.route("/selectCourseSuid").all((req, res, next) => {
  5974. var json = queryString(req.url);
  5975. getmysql(req, res, "selectCourseSuid", json["cid"], json["courseid"]);
  5976. });
  5977. //获取项目基本信息
  5978. router.route("/getCourseInfo").all((req, res, next) => {
  5979. var json = queryString(req.url);
  5980. getmysql(req, res, "getCourseInfo", json["cid"]);
  5981. });
  5982. //课程中心 总评添加和修改功能
  5983. router.route("/opCourseScore").all((req, res, next) => {
  5984. postmysql(req, res, "opCourseScore");
  5985. });
  5986. //查询已评价功能
  5987. router.route("/getCourseScoreP").all((req, res, next) => {
  5988. var json = queryString(req.url);
  5989. getmysql(req, res, "getCourseScoreP", json["cid"], json["uid"]);
  5990. });
  5991. //查询所有已评价功能
  5992. router.route("/getCourseScore").all((req, res, next) => {
  5993. var json = queryString(req.url);
  5994. getmysql(req, res, "getCourseScore", json["cid"]);
  5995. });
  5996. //查看已有作业功能
  5997. router.route("/selectWorkByCidAi").all((req, res, next) => {
  5998. var json = queryString(req.url);
  5999. getmysql(req, res, "selectWorkByCidAi", json["cid"], json["classid"]);
  6000. });
  6001. //插叙单个学生作业
  6002. router.route("/selectWorkByCidAiByUid").all((req, res, next) => {
  6003. var json = queryString(req.url);
  6004. getmysql(req, res, "selectWorkByCidAiByUid", json["cid"], json["uid"]);
  6005. });
  6006. //获取多个项目基本信息
  6007. router.route("/getCourseInfoMore").all((req, res, next) => {
  6008. var json = queryString(req.url);
  6009. getmysql(req, res, "getCourseInfoMore", json["cid"]);
  6010. });
  6011. //获取用户基本信息
  6012. router.route("/getAllUserById").all((req, res, next) => {
  6013. var json = queryString(req.url);
  6014. getmysql(req, res, "getAllUserById", json["uid"]);
  6015. });
  6016. //获取用户基本信息
  6017. router.route("/getAllUserByIdP").all((req, res, next) => {
  6018. postmysql(req, res, "getAllUserById");
  6019. });
  6020. //作业生成报告
  6021. router.route("/getWorkData").all((req, res, next) => {
  6022. var json = queryString(req.url); //cid 课程id,page 页数
  6023. getmysql(req, res, "select_work_data", json["cid"]);
  6024. });
  6025. //查询评价体系
  6026. router.route("/getEvaluation").all((req, res, next) => {
  6027. var json = queryString(req.url); //cid 课程id,page 页数
  6028. getmysql(
  6029. req,
  6030. res,
  6031. "select_evaluation",
  6032. json["oid"],
  6033. json["n"],
  6034. json["page"],
  6035. 10
  6036. );
  6037. });
  6038. //添加评价体系
  6039. router.route("/addEvaluation").all((req, res, next) => {
  6040. postmysql(req, res, "add_evaluation");
  6041. //uid 用户id t标题 c内容
  6042. });
  6043. //修改评价体系
  6044. router.route("/updateEvaluation").all((req, res, next) => {
  6045. postmysql(req, res, "update_evaluation");
  6046. //c内容 t标题 id评价id
  6047. });
  6048. //删除评价体系
  6049. router.route("/deleteEvaluation").all((req, res, next) => {
  6050. postmysql(req, res, "delete_evaluation");
  6051. // id评价id
  6052. });
  6053. //删除评价体系前查询课程是否有该评价
  6054. router.route("/selectCourseEva").all((req, res, next) => {
  6055. var json = queryString(req.url); //cid 课程id,page 页数
  6056. getmysql(
  6057. req,
  6058. res,
  6059. "select_course_eva",
  6060. json["eid"],
  6061. );
  6062. });
  6063. //批量添加学校
  6064. router.route("/batchRegistrationSchool").post(function(req, res, next) {
  6065. let users = req.body[0];
  6066. let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
  6067. for (let i = 0; i < arr.length; i++) {
  6068. let _school = encodeURIComponent(arr[i].school);
  6069. let _org = users.org;
  6070. //用戶數據
  6071. let _data = [_school, _org, "", "1", ""];
  6072. //參數拼接,註冊
  6073. _data.unshift(_mysqlLabor[0], _mysqlLabor[1], "insertSchoolByOrg");
  6074. //用戶註冊處理
  6075. mysql.usselect(_data, function(ret) {
  6076. res.end(JSON.stringify({ success: 1 }));
  6077. });
  6078. }
  6079. });
  6080. //批量添加学生
  6081. router.route("/batchRegistrationMore").post(function(req, res, next) {
  6082. let users = req.body[0];
  6083. let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
  6084. for (let i = 0; i < arr.length; i++) {
  6085. let _username = encodeURIComponent(arr[i].name);
  6086. let _mail = encodeURIComponent(arr[i].mail)
  6087. let _password = users.password || "Coco1234";
  6088. let _alias = encodeURIComponent(arr[i].name)
  6089. let _oid = users.oid;
  6090. let _ph = encodeURIComponent(arr[i].phone ? arr[i].phone : "")
  6091. let _class = encodeURIComponent(arr[i].class)
  6092. let _sId = encodeURIComponent(arr[i].sId)
  6093. //加密密碼
  6094. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6095. //生成激活碼
  6096. let _hashstr = new Date().getTime() + "";
  6097. let _digest = crypto
  6098. .createHash("sha256")
  6099. .update(_hashstr, "utf8")
  6100. .digest("hex");
  6101. //用戶數據
  6102. let _userdata = [
  6103. _mail,
  6104. _password,
  6105. _alias,
  6106. "",
  6107. 1, //0老师 1学生
  6108. _username,
  6109. "",
  6110. generateAPIKey(_username),
  6111. _digest,
  6112. "",
  6113. _username,
  6114. _sId,
  6115. 2, //1老师 2学生
  6116. _oid,
  6117. _ph,
  6118. _class,
  6119. "",
  6120. "0",
  6121. ];
  6122. //參數拼接,註冊
  6123. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregister");
  6124. //用戶註冊處理
  6125. mysql.usselect(_userdata, function(ret) {
  6126. // let _pbluserdata = [
  6127. // ret[1][0].uid,
  6128. // _username,
  6129. // _sId,
  6130. // 2,
  6131. // _oid,
  6132. // _ph,
  6133. // _class,
  6134. // '',
  6135. // "0",
  6136. // ];
  6137. // _pbluserdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateUserByEdu");
  6138. // mysql.usselect(_pbluserdata, function(ret) {
  6139. res.end(JSON.stringify({ success: 1 }));
  6140. // });
  6141. });
  6142. }
  6143. });
  6144. //幼儿园评价
  6145. // 获取所有年级
  6146. router.route("/select_techerAllGrade").all(function(req, res, next) {
  6147. // let users = req.query;
  6148. var json = queryString(req.url);
  6149. getmysql(req, res, "select_techerAllGrade", json['cid']);
  6150. });
  6151. // 获取所有班级
  6152. router.route("/select_techerAllClass").all(function(req, res, next) {
  6153. // let users = req.query;
  6154. var json = queryString(req.url);
  6155. getmysql(req, res, "select_techerAllClass", json['cid']);
  6156. });
  6157. // 获取所有班级
  6158. router.route("/select_techerAllClass2").all(function(req, res, next) {
  6159. // let users = req.query;
  6160. var json = queryString(req.url);
  6161. getmysql(req, res, "select_techerAllClass2", json['cid'], json['gid']);
  6162. });
  6163. // 获取所有班级学生
  6164. router.route("/selectClassStudent").all(function(req, res, next) {
  6165. var json = queryString(req.url);
  6166. getmysql(req, res, "selectClassStudent", json['cid']);
  6167. });
  6168. // 获取所有班级学生
  6169. router.route("/selectClassStudent2").all(function(req, res, next) {
  6170. var json = queryString(req.url);
  6171. getmysql(req, res, "selectClassStudent2", json['cid'], json['gid']);
  6172. });
  6173. // 获取学生详情
  6174. router.route("/selectStudentDetail").all(function(req, res, next) {
  6175. // let users = req.query;
  6176. var json = queryString(req.url);
  6177. console.log(json);
  6178. getmysql(req, res, "selectStudentDetail", json['uid']);
  6179. });
  6180. // 获取学生记录筛选框
  6181. router.route("/selectVeiDoo").all(function(req, res, next) {
  6182. // let users = req.query;
  6183. var json = queryString(req.url);
  6184. // console.log(json);
  6185. getmysql(req, res, "selectVeiDoo", json['oid']);
  6186. });
  6187. // 上传学生评价
  6188. router.route("/insertRecord").all(function(req, res, next) {
  6189. // console.log(req.query);
  6190. postmysql(req, res, "insertRecord");
  6191. });
  6192. //修改openid
  6193. router.route('/UpdateOpenId').all((req, res, next) => {
  6194. postmysql(req, res, "UpdateOpenId");
  6195. });
  6196. //查询是否有openid
  6197. router.route('/checkOpenId').all((req, res, next) => {
  6198. postmysql(req, res, "checkOpenId");
  6199. });
  6200. // 获取学生记录
  6201. router.route("/selectRecord").all(function(req, res, next) {
  6202. // let users = req.query;
  6203. var json = queryString(req.url);
  6204. // console.log(json);
  6205. // let txt=
  6206. getmysql(req, res, "selectRecord", json['uid'], json['trm'], json['txt']);
  6207. });
  6208. // 获取学生记录详情
  6209. router.route("/selectRecordDetail").all(function(req, res, next) {
  6210. // let users = req.query;
  6211. var json = queryString(req.url);
  6212. // console.log(json);
  6213. getmysql(req, res, "selectRecordDetail", json['id']);
  6214. });
  6215. // 删除学生评价
  6216. router.route("/updateRecord").all(function(req, res, next) {
  6217. // console.log(req.query);
  6218. postmysql(req, res, "updateRecord");
  6219. });
  6220. // 更新学生评价
  6221. router.route("/updateRecordData").all(function(req, res, next) {
  6222. // console.log(req.query);
  6223. postmysql(req, res, "updateRecordData");
  6224. });
  6225. // 获取学生记录详情
  6226. router.route("/selectSerStudent").all(function(req, res, next) {
  6227. // let users = req.query;
  6228. var json = queryString(req.url);
  6229. // console.log(json);
  6230. getmysql(req, res, "selectSerStudent", json['id'], json['txt']);
  6231. });
  6232. // 获取学期
  6233. router.route("/selectTerm").all(function(req, res, next) {
  6234. var json = queryString(req.url);
  6235. getmysql(req, res, "selectTerm");
  6236. });
  6237. // 获取班级信息
  6238. router.route("/selectManyClassStudent").all(function(req, res, next) {
  6239. var json = queryString(req.url);
  6240. getmysql(req, res, "selectManyClassStudent", json['cid'], json['uid']);
  6241. });
  6242. //幼儿园学生评价获取学生列表
  6243. router.route("/selectStudentAndRecord").all(function(req, res, next) {
  6244. var json = queryString(req.url);
  6245. getmysql(req, res, "selectStudentAndRecord", json['cid'], json['cu'], json['cn'], json['oid'], json['org'], json['page'], 10);
  6246. });
  6247. // pbl教师端观察日记
  6248. router.route("/selectVeidooType").all(function(req, res, next) {
  6249. var json = queryString(req.url);
  6250. // console.log(json);
  6251. getmysql(req, res, "selectVeidooType", json['uid'], json['cid'], json['cu'], json['cn'], json['cm'], json['page'], 10);
  6252. });
  6253. //查询幼儿园分类
  6254. router.route("/selectSTEType").all(function(req, res, next) {
  6255. var json = queryString(req.url);
  6256. // console.log(json);
  6257. getmysql(req, res, "selectSTEType", json['org'], json['oid']);
  6258. });
  6259. //查询口语分类
  6260. router.route("/select_englishVoiceType").all(function(req, res, next) {
  6261. var json = queryString(req.url);
  6262. // console.log(json);
  6263. getmysql(req, res, "select_englishVoiceType", json['oid'], json['org']);
  6264. });
  6265. //查询我的口语分类
  6266. router.route("/selectMySubTalk").all(function(req, res, next) {
  6267. var json = queryString(req.url);
  6268. // console.log(json);
  6269. getmysql(req, res, "selectMySubTalk", json['userid']);
  6270. });
  6271. //查询学情报告雷达图数据
  6272. router.route("/selectMapStuScore").all(function(req, res, next) {
  6273. var json = queryString(req.url);
  6274. // console.log(json);
  6275. getmysql(req, res, "selectMapStuScore", json['uid'], json['year']);
  6276. });
  6277. //每个大分类下的关键证据
  6278. router.route("/selectHealthRecord").all(function(req, res, next) {
  6279. var json = queryString(req.url);
  6280. // console.log(json);
  6281. getmysql(req, res, "selectHealthRecord", json['uid'], json['year'], json['txt'], json['page'], 4);
  6282. });
  6283. //手机端 获取记录地点list
  6284. router.route("/selectSTEPlace").all(function(req, res, next) {
  6285. var json = queryString(req.url);
  6286. // console.log(json);
  6287. getmysql(req, res, "selectSTEPlace", json['org'], json['oid']);
  6288. });
  6289. //获取所有的记录进行下载
  6290. router.route("/selectClassAllRecord").all(function(req, res, next) {
  6291. var json = queryString(req.url);
  6292. // console.log(json);
  6293. getmysql(req, res, "selectClassAllRecord",json['cid'], json['id']);
  6294. });
  6295. //record页面计算班级平均分
  6296. router.route("/selectClaAverageScore").all(function(req, res, next) {
  6297. var json = queryString(req.url);
  6298. // console.log(json);
  6299. getmysql(req, res, "selectClaAverageScore", json["cu"], json["oid"], json["cn"], json["trm"], json["page"], 10);
  6300. });
  6301. //record页面下载班级分数数据
  6302. router.route("/selectAllClaAvaRescore").all(function(req, res, next) {
  6303. var json = queryString(req.url);
  6304. // console.log(json);
  6305. getmysql(req, res, "selectAllClaAvaRescore", json["cu"], json["oid"], json["cn"], json["trm"]);
  6306. });
  6307. //学情报告计算班级平均分
  6308. router.route("/selectClaAvaScore").all(function(req, res, next) {
  6309. var json = queryString(req.url);
  6310. // console.log(json);
  6311. getmysql(req, res, "selectClaAvaScore", json["cid"], json["trm"]);
  6312. });
  6313. //查询协同人员不带org的
  6314. router.route("/selectCollaborativeMembers").all(function(req, res, next) {
  6315. var json = queryString(req.url);
  6316. // console.log(json);
  6317. getmysql(req, res, "selectCollaborativeMembers", json["oid"], json["cu"], json["cn"], json["coll"]);
  6318. });
  6319. //查询协同人员带org
  6320. router.route("/selectCollaborativeMembersOrg").all(function(req, res, next) {
  6321. var json = queryString(req.url);
  6322. // console.log(json);
  6323. getmysql(req, res, "selectCollaborativeMembersOrg", json["oid"], json["cu"], json["cn"], json["coll"]);
  6324. });
  6325. // 教师发展获取数据来源表单标题
  6326. router.route("/selectExamineTestName").all(function(req, res, next) {
  6327. // var json = queryString(req.url);
  6328. // console.log(json);
  6329. postmysql(req, res, "selectExamineTestName");
  6330. // getmysql(req, res, "selectExamineTestName", json["testId"]);
  6331. });
  6332. // 教师发展 页面数据
  6333. router.route("/selectTestExamineBase").all(function(req, res, next) {
  6334. var json = queryString(req.url);
  6335. getmysql(req, res, "selectTestExamineBase", json["typ"], json["org"], json["oid"]);
  6336. });
  6337. // 教师发展 页面数据 添加时间获取
  6338. router.route("/selectTestExamineBase2").all(function(req, res, next) {
  6339. var json = queryString(req.url);
  6340. getmysql(req, res, "selectTestExamineBase2", json["typ"], json["org"], json["oid"],json['time']);
  6341. });
  6342. // 教师发展 按人员页面数据
  6343. router.route("/selectTestExaminePersonData").all(function(req, res, next) {
  6344. var json = queryString(req.url);
  6345. getmysql(req, res, "selectTestExaminePersonData", json["oid"], json["org"], json["type"], json["tname"]);
  6346. });
  6347. // 教师发展 按人员页面数据
  6348. router.route("/selectTestExaminePersonData2").all(function(req, res, next) {
  6349. postmysql(req, res, "selectTestExaminePersonData2");
  6350. });
  6351. // 教师发展 管理员提交数据
  6352. router.route("/updateExamineCogData").all(function(req, res, next) {
  6353. postmysql(req, res, "updateExamineCogData");
  6354. });
  6355. // 教师发展 管理员提交数据(新版添加了修改后保存教师记录)
  6356. router.route("/updateExamineCogDataCopy").all(function(req, res, next) {
  6357. postmysql(req, res, "updateExamineCogDataCopy");
  6358. });
  6359. // 教师发展 获取修改记录
  6360. router.route("/selectExamineOperateRecord").all(function(req, res, next) {
  6361. var json = queryString(req.url);
  6362. getmysql(req, res, "selectExamineOperateRecord", json["tid"], json["type"]);
  6363. });
  6364. // 教师发展 管理员撤回提交数据
  6365. router.route("/updateExamineState").all(function(req, res, next) {
  6366. postmysql(req, res, "updateExamineState");
  6367. });
  6368. // 教师发展 获取数据汇总
  6369. router.route("/selectTestWorksAggregate").all(function(req, res, next) {
  6370. var json = queryString(req.url);
  6371. getmysql(req, res, "selectTestWorksAggregate", json["oid"], json["org"]);
  6372. });
  6373. // 教师发展 提醒
  6374. router.route("/selectExamineTeaRemind").all(function(req, res, next) {
  6375. var json = queryString(req.url);
  6376. getmysql(req, res, "selectExamineTeaRemind", json["oid"], json["org"], json["tea"], json["ptype"]);
  6377. });
  6378. // 课程管理-文档评分
  6379. router.route("/selectWorksEvaScore").all(function(req, res, next) {
  6380. var json = queryString(req.url);
  6381. getmysql(req, res, "selectWorksEvaScore", json["uid"], json["cid"]);
  6382. });
  6383. // 课程管理-文档评分
  6384. router.route("/selectWorksEvaScoreTwo").all(function(req, res, next) {
  6385. var json = queryString(req.url);
  6386. getmysql(req, res, "selectWorksEvaScoreTwo", json["uid"], json["cid"], json["s"], json["t"], json["tool"]);
  6387. });
  6388. // 课程管理-文档评分一次性获取全部
  6389. router.route("/selectWorksEvaScoreNew").all(function(req, res, next) {
  6390. var json = queryString(req.url);
  6391. getmysql(req, res, "selectWorksEvaScoreNew", json["cid"], json["s"], json["t"]);
  6392. });
  6393. /* 新增教研室 */
  6394. router.route("/insertTeacherOfficeCopy").all(function(req, res, next) {
  6395. postmysql(req, res, "insertTeacherOfficeCopy");
  6396. });
  6397. /* 查询教研室*/
  6398. router.route("/selectTeacherOffice2").all(function(req, res, next) {
  6399. var json = queryString(req.url);
  6400. getmysql(req, res, "selectTeacherOffice2", json["cu"], json["oid"], json["cn"], json["pid"], json["page"], 10);
  6401. });
  6402. /* 查询教研室*/
  6403. router.route("/selectPerInfoTeacherOffice").all(function(req, res, next) {
  6404. var json = queryString(req.url);
  6405. getmysql(req, res, "selectPerInfoTeacherOffice", json["cu"], json["oid"], json["cn"], 6);
  6406. });
  6407. /* 查询所有教研室分类与分类下的数据*/
  6408. router.route("/selectPerInfoAllTea").all(function(req, res, next) {
  6409. var json = queryString(req.url);
  6410. getmysql(req, res, "selectPerInfoAllTea",json["oid"]);
  6411. });
  6412. /* 查询教研室类型lim */
  6413. router.route("/selectTeacherOfficeTypeLim").all(function(req, res, next) {
  6414. var json = queryString(req.url);
  6415. getmysql(req, res, "selectTeacherOfficeTypeLim", json["cu"], json["oid"], json["cn"], json["pid"], json["page"], 10);
  6416. });
  6417. /* 查询教研室类型 */
  6418. router.route("/selectTeacherOfficeType").all(function(req, res, next) {
  6419. var json = queryString(req.url);
  6420. getmysql(req, res, "selectTeacherOfficeType", json["cu"], json["oid"], json["cn"], json["pid"]);
  6421. });
  6422. // 存储学生课程分析数据
  6423. router.route("/upDateAnalysis").all(function(req, res, next) {
  6424. postmysql(req, res, "upDateAnalysis");
  6425. });
  6426. // 存储学生课程分析数据 ym
  6427. router.route("/upDateAnalysisTwo").all(function(req, res, next) {
  6428. postmysql(req, res, "upDateAnalysisTwo");
  6429. });
  6430. // 教师手动修改存储学生课程分析数据 ym
  6431. router.route("/upDateAnalysisTeacher").all(function(req, res, next) {
  6432. postmysql(req, res, "upDateAnalysisTeacher");
  6433. });
  6434. // 获取教师管理table数据
  6435. router.route("/selectOrgTeachar").all((req, res, next) => {
  6436. var json = queryString(req.url);
  6437. getmysql(
  6438. req,
  6439. res,
  6440. "selectOrgTeachar",
  6441. json["org"],
  6442. json["oid"],
  6443. json["cu"],
  6444. json["cn"],
  6445. json["page"],
  6446. 10
  6447. );
  6448. });
  6449. // 更新老师信息数据
  6450. router.route("/updateYTeacherInfo").all(function(req, res, next) {
  6451. // console.log(req.query);
  6452. postmysql(req, res, "updateYTeacherInfo");
  6453. });
  6454. //教师管理新增教师
  6455. router.route("/teacherRegistration").post(function(req, res, next) {
  6456. var users = req.body[0];
  6457. //循环注册
  6458. var _username = users.alias;
  6459. var _mail = users.username;
  6460. var _password = users.password || "Coco1234";
  6461. var _alias = users.alias;
  6462. var _org = users.org;
  6463. var _oid = users.oid;
  6464. var _ph = users.ph;
  6465. var _class = users.cid;
  6466. var _sId = users.sid;
  6467. var _typ = users.typ;
  6468. var _rol = users.rol;
  6469. //加密密碼
  6470. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6471. //生成激活碼
  6472. let _hashstr = new Date().getTime() + "";
  6473. let _digest = crypto
  6474. .createHash("sha256")
  6475. .update(_hashstr, "utf8")
  6476. .digest("hex");
  6477. //用戶數據
  6478. var _userdata = [
  6479. _mail,
  6480. _password,
  6481. _alias,
  6482. "",
  6483. 0,
  6484. _username,
  6485. "",
  6486. generateAPIKey(_username),
  6487. _digest,
  6488. "",
  6489. _username,
  6490. _sId,
  6491. _typ,
  6492. _org,
  6493. _oid,
  6494. _ph,
  6495. _class,
  6496. "",
  6497. "0",
  6498. _rol
  6499. ];
  6500. //參數拼接,註冊
  6501. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_teacherRegistration");
  6502. //用戶註冊處理
  6503. mysql.usselect(_userdata, function(ret) {
  6504. res.end(
  6505. JSON.stringify({
  6506. uid: ret[1][0].uid,
  6507. ph: _ph,
  6508. oid: _oid,
  6509. cid: _class,
  6510. success: 1,
  6511. })
  6512. );
  6513. });
  6514. });
  6515. //初始化密码
  6516. router.route("/iniPassword").post(function(req, res, next) {
  6517. let users = req.body[0];
  6518. _password = users.pa;
  6519. //加密密碼
  6520. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6521. //用戶數據
  6522. let _userList = [users.uid, _password];
  6523. _userList.unshift(_mysqlLabor[0], _mysqlLabor[1], "iniPassword");
  6524. mysql.usselect(_userList, function(ret) {
  6525. res.end(JSON.stringify({ success: 1 }));
  6526. });
  6527. });
  6528. //批量添加教师
  6529. router.route("/batchRegistrationMore1").post(function(req, res, next) {
  6530. let users = req.body[0];
  6531. let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
  6532. for (let i = 0; i < arr.length; i++) {
  6533. let _username = encodeURIComponent(arr[i].name)
  6534. let _mail = encodeURIComponent(arr[i].mail)
  6535. let _password = users.password || "Coco1234";
  6536. let _alias = encodeURIComponent(arr[i].name)
  6537. let _org = users.org;
  6538. let _oid = encodeURIComponent(arr[i].school)
  6539. let _ph = encodeURIComponent(arr[i].phone ? arr[i].phone : "")
  6540. let _class = encodeURIComponent(arr[i].class)
  6541. let _sId = encodeURIComponent(arr[i].sId)
  6542. //加密密碼
  6543. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6544. //生成激活碼
  6545. let _hashstr = new Date().getTime() + "";
  6546. let _digest = crypto
  6547. .createHash("sha256")
  6548. .update(_hashstr, "utf8")
  6549. .digest("hex");
  6550. //用戶數據
  6551. let _userdata = [
  6552. _mail,
  6553. _password,
  6554. _alias,
  6555. "",
  6556. 0, //0老师 1学生
  6557. _username,
  6558. "",
  6559. generateAPIKey(_username),
  6560. _digest,
  6561. "",
  6562. _username,
  6563. _sId,
  6564. 1, //1老师 2学生
  6565. _org,
  6566. _oid,
  6567. "",
  6568. "",
  6569. "",
  6570. "0",
  6571. ];
  6572. //參數拼接,註冊
  6573. _userdata.unshift(
  6574. _mysqluser[0],
  6575. _mysqluser[1],
  6576. "pbl_add_batchregister_oid"
  6577. );
  6578. //用戶註冊處理
  6579. mysql.usselect(_userdata, function(ret) {
  6580. res.end(JSON.stringify({ success: 1 }));
  6581. });
  6582. }
  6583. });
  6584. //赛事批量注册老师
  6585. router.route("/pbl_add_raceuser_oid").post(function(req, res, next) {
  6586. let users = req.body[0];
  6587. let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
  6588. for (let i = 0; i < arr.length; i++) {
  6589. let _username = encodeURIComponent(arr[i].name)
  6590. let _mail = encodeURIComponent(arr[i].mail)
  6591. let _password = users.password || "Coco1234";
  6592. let _oid = encodeURIComponent(arr[i].school)
  6593. //加密密碼
  6594. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6595. //生成激活碼
  6596. let _hashstr = new Date().getTime() + "";
  6597. let _digest = crypto
  6598. .createHash("sha256")
  6599. .update(_hashstr, "utf8")
  6600. .digest("hex");
  6601. //用戶數據
  6602. let _userdata = [
  6603. _mail,
  6604. _oid,
  6605. _password,
  6606. _username,
  6607. 1, //1普通教师 2市级 3省级 4市级子级评委 5县区评委 6县区子级
  6608. ];
  6609. //參數拼接,註冊
  6610. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "pbl_add_raceuser_oid");
  6611. //用戶註冊處理
  6612. mysql.usselect(_userdata, function(ret) {
  6613. res.end(JSON.stringify({ success: 1 }));
  6614. });
  6615. }
  6616. });
  6617. //新增学生
  6618. router.route("/batchRegistration").post(function(req, res, next) {
  6619. var users = req.body[0];
  6620. //循环注册
  6621. var _username = users.alias;
  6622. var _mail = users.username;
  6623. var _password = users.password || "Coco1234";
  6624. var _alias = users.alias;
  6625. var _oid = users.oid;
  6626. var _ph = users.ph;
  6627. var _class = users.cid;
  6628. var _sId = users.sid;
  6629. //加密密碼
  6630. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6631. //生成激活碼
  6632. let _hashstr = new Date().getTime() + "";
  6633. let _digest = crypto
  6634. .createHash("sha256")
  6635. .update(_hashstr, "utf8")
  6636. .digest("hex");
  6637. //用戶數據
  6638. var _userdata = [
  6639. _mail,
  6640. _password,
  6641. _alias,
  6642. "",
  6643. 1,
  6644. _username,
  6645. "",
  6646. generateAPIKey(_username),
  6647. _digest,
  6648. "",
  6649. _username,
  6650. _sId,
  6651. 2,
  6652. _oid,
  6653. _ph,
  6654. _class,
  6655. "",
  6656. "0",
  6657. ];
  6658. //參數拼接,註冊
  6659. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregister");
  6660. //用戶註冊處理
  6661. mysql.usselect(_userdata, function(ret) {
  6662. res.end(
  6663. JSON.stringify({
  6664. uid: ret[1][0].uid,
  6665. ph: _ph,
  6666. oid: _oid,
  6667. cid: _class,
  6668. success: 1,
  6669. })
  6670. );
  6671. });
  6672. });
  6673. //深圳电教馆注册
  6674. router.route("/batchRegistrationSzdjg").post(function(req, res, next) {
  6675. var users = Object.values(req.body)[0].split(",");
  6676. //循环注册
  6677. var _username = users[0]; //名字
  6678. var _mail = users[1]; //用户名 账号
  6679. var _password = "Coco1234";
  6680. var _alias = _username;
  6681. var _org = users[2];
  6682. var _oid = users[3];
  6683. var _ph = users[4];
  6684. var _class = users[5];
  6685. var _type = users[6];
  6686. var _openid = users[7];
  6687. //加密密碼
  6688. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6689. //生成激活碼
  6690. let _hashstr = new Date().getTime() + "";
  6691. let _digest = crypto
  6692. .createHash("sha256")
  6693. .update(_hashstr, "utf8")
  6694. .digest("hex");
  6695. //用戶數據
  6696. var _userdata = [
  6697. _mail,
  6698. _password,
  6699. _alias,
  6700. "",
  6701. 0,
  6702. _username,
  6703. _openid,
  6704. generateAPIKey(_username),
  6705. _digest,
  6706. "",
  6707. _username,
  6708. '',
  6709. _type,
  6710. _org,
  6711. _oid,
  6712. _ph,
  6713. _class,
  6714. "",
  6715. "0",
  6716. ];
  6717. //參數拼接,註冊
  6718. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregisterSzdjg");
  6719. //用戶註冊處理
  6720. mysql.usselect(_userdata, function(ret) {
  6721. res.end(
  6722. JSON.stringify({
  6723. uid: ret[1][0].uid,
  6724. ph: _ph,
  6725. oid: _oid,
  6726. cid: _class,
  6727. success: 1,
  6728. })
  6729. );
  6730. });
  6731. });
  6732. //深圳电教馆注册
  6733. router.route("/batchRegistrationSzdjg2").post(function(req, res, next) {
  6734. var users = Object.values(req.body)[0].split(",");
  6735. //循环注册
  6736. var _username = users[0]; //名字
  6737. var _mail = users[1]; //用户名 账号
  6738. var _password = "Coco1234";
  6739. var _alias = _username;
  6740. var _org = users[2];
  6741. var _oid = users[3];
  6742. var _ph = users[4];
  6743. var _class = users[5];
  6744. var _type = users[6];
  6745. var _openid = users[7];
  6746. var _dest = users[8];
  6747. //加密密碼
  6748. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6749. //生成激活碼
  6750. let _hashstr = new Date().getTime() + "";
  6751. let _digest = crypto
  6752. .createHash("sha256")
  6753. .update(_hashstr, "utf8")
  6754. .digest("hex");
  6755. //用戶數據
  6756. var _userdata = [
  6757. _mail,
  6758. _password,
  6759. _alias,
  6760. "",
  6761. 0,
  6762. _username,
  6763. _openid,
  6764. generateAPIKey(_username),
  6765. _digest,
  6766. "",
  6767. _username,
  6768. '',
  6769. _type,
  6770. _org,
  6771. _oid,
  6772. _ph,
  6773. _class,
  6774. "",
  6775. "0",
  6776. _dest
  6777. ];
  6778. //參數拼接,註冊
  6779. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregisterSzdjg2");
  6780. //用戶註冊處理
  6781. mysql.usselect(_userdata, function(ret) {
  6782. res.end(
  6783. JSON.stringify({
  6784. uid: ret[1][0].uid,
  6785. ph: _ph,
  6786. oid: _oid,
  6787. cid: _class,
  6788. success: 1,
  6789. })
  6790. );
  6791. });
  6792. });
  6793. //深圳电教馆注册
  6794. router.route("/batchRegistrationSzdjg3").post(function(req, res, next) {
  6795. var users = Object.values(req.body)[0].split(",");
  6796. //循环注册
  6797. var _username = users[0]; //名字
  6798. var _mail = users[1]; //用户名 账号
  6799. var _password = "Coco1234";
  6800. var _alias = _username;
  6801. var _org = users[2];
  6802. var _oid = users[3];
  6803. var _ph = users[4];
  6804. var _class = users[5];
  6805. var _type = users[6];
  6806. var _openid = users[7];
  6807. var _dest = users[8];
  6808. var _eduId = users[9];
  6809. //加密密碼
  6810. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6811. //生成激活碼
  6812. let _hashstr = new Date().getTime() + "";
  6813. let _digest = crypto
  6814. .createHash("sha256")
  6815. .update(_hashstr, "utf8")
  6816. .digest("hex");
  6817. //用戶數據
  6818. var _userdata = [
  6819. _mail,
  6820. _password,
  6821. _alias,
  6822. "",
  6823. 0,
  6824. _username,
  6825. _openid,
  6826. generateAPIKey(_username),
  6827. _digest,
  6828. "",
  6829. _username,
  6830. '',
  6831. _type,
  6832. _org,
  6833. _oid,
  6834. _ph,
  6835. _class,
  6836. "",
  6837. "0",
  6838. _dest,
  6839. _eduId
  6840. ];
  6841. //參數拼接,註冊
  6842. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregisterSzdjg3");
  6843. //用戶註冊處理
  6844. mysql.usselect(_userdata, function(ret) {
  6845. res.end(
  6846. JSON.stringify({
  6847. uid: ret[1][0].uid,
  6848. ph: _ph,
  6849. oid: _oid,
  6850. cid: _class,
  6851. success: 1,
  6852. })
  6853. );
  6854. });
  6855. });
  6856. //新增用户接口
  6857. router.route("/batchRegistrationUser").post(function(req, res, next) {
  6858. var users = req.body[0];
  6859. //循环注册
  6860. var _username = users.alias; //名字
  6861. var _mail = users.username; //用户名 账号
  6862. var _password = "Coco1234";
  6863. var _alias = _username;
  6864. var _org = users.org;
  6865. var _oid = users.oid;
  6866. var _ph = users.ph;
  6867. var _class = users.cid;
  6868. var _type = users.type;
  6869. var _openid = users.opid;
  6870. var _dest = users.dest;
  6871. var _eduId = users.eduid;
  6872. //加密密碼
  6873. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6874. //生成激活碼
  6875. let _hashstr = new Date().getTime() + "";
  6876. let _digest = crypto
  6877. .createHash("sha256")
  6878. .update(_hashstr, "utf8")
  6879. .digest("hex");
  6880. //用戶數據
  6881. var _userdata = [
  6882. _mail,
  6883. _password,
  6884. _alias,
  6885. "",
  6886. 0,
  6887. _username,
  6888. _openid,
  6889. generateAPIKey(_username),
  6890. _digest,
  6891. "",
  6892. _username,
  6893. '',
  6894. _type,
  6895. _org,
  6896. _oid,
  6897. _ph,
  6898. _class,
  6899. "",
  6900. "0",
  6901. _dest,
  6902. _eduId
  6903. ];
  6904. //參數拼接,註冊
  6905. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregisterSzdjg3");
  6906. //用戶註冊處理
  6907. mysql.usselect(_userdata, function(ret) {
  6908. res.end(
  6909. JSON.stringify({
  6910. uid: ret[1][0].uid,
  6911. ph: _ph,
  6912. oid: _oid,
  6913. cid: _class,
  6914. success: 1,
  6915. })
  6916. );
  6917. });
  6918. });
  6919. //新增教师
  6920. router.route("/batchRegistration1").post(function(req, res, next) {
  6921. var users = req.body[0];
  6922. //循环注册
  6923. var _username = users.alias;
  6924. var _mail = users.username;
  6925. var _password = users.password || "Coco1234";
  6926. var _alias = users.alias;
  6927. var _org = users.org;
  6928. var _oid = users.oid;
  6929. var _ph = users.ph;
  6930. var _class = users.cid;
  6931. var _sId = users.sid;
  6932. //加密密碼
  6933. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6934. //生成激活碼
  6935. let _hashstr = new Date().getTime() + "";
  6936. let _digest = crypto
  6937. .createHash("sha256")
  6938. .update(_hashstr, "utf8")
  6939. .digest("hex");
  6940. //用戶數據
  6941. var _userdata = [
  6942. _mail,
  6943. _password,
  6944. _alias,
  6945. "",
  6946. 0,
  6947. _username,
  6948. "",
  6949. generateAPIKey(_username),
  6950. _digest,
  6951. "",
  6952. _username,
  6953. _sId,
  6954. 1,
  6955. _org,
  6956. _oid,
  6957. _ph,
  6958. _class,
  6959. "",
  6960. "0",
  6961. ];
  6962. //參數拼接,註冊
  6963. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregister1");
  6964. //用戶註冊處理
  6965. mysql.usselect(_userdata, function(ret) {
  6966. res.end(
  6967. JSON.stringify({
  6968. uid: ret[1][0].uid,
  6969. ph: _ph,
  6970. oid: _oid,
  6971. cid: _class,
  6972. success: 1,
  6973. })
  6974. );
  6975. });
  6976. });
  6977. router.route("/batchRegistrationOrg").post(function(req, res, next) {
  6978. var users = req.body[0];
  6979. //循环注册
  6980. var _username = users.alias;
  6981. var _mail = users.username;
  6982. var _password = users.password || "Coco1234";
  6983. var _alias = users.alias;
  6984. var _oid = users.oid;
  6985. var _ph = users.ph;
  6986. var _class = users.cid;
  6987. var _sId = users.sid;
  6988. var _org = users.org;
  6989. //加密密碼
  6990. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6991. //生成激活碼
  6992. let _hashstr = new Date().getTime() + "";
  6993. let _digest = crypto
  6994. .createHash("sha256")
  6995. .update(_hashstr, "utf8")
  6996. .digest("hex");
  6997. //用戶數據
  6998. var _userdata = [
  6999. _mail,
  7000. _password,
  7001. _alias,
  7002. "",
  7003. 1,
  7004. _username,
  7005. "",
  7006. generateAPIKey(_username),
  7007. _digest,
  7008. "",
  7009. _username,
  7010. _sId,
  7011. 2,
  7012. _oid,
  7013. _ph,
  7014. _class,
  7015. "",
  7016. "0",
  7017. _org,
  7018. ];
  7019. //參數拼接,註冊
  7020. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregister_org");
  7021. //用戶註冊處理
  7022. mysql.usselect(_userdata, function(ret) {
  7023. res.end(
  7024. JSON.stringify({
  7025. uid: ret[1][0].uid,
  7026. ph: _ph,
  7027. oid: _oid,
  7028. cid: _class,
  7029. success: 1,
  7030. })
  7031. );
  7032. });
  7033. });
  7034. router.route("/batchRegistrationMoreOrg").post(function(req, res, next) {
  7035. let users = req.body[0];
  7036. let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
  7037. for (let i = 0; i < arr.length; i++) {
  7038. let _username = encodeURIComponent(arr[i].name)
  7039. let _mail = encodeURIComponent(arr[i].mail)
  7040. let _password = users.password || "Coco1234";
  7041. let _alias = encodeURIComponent(arr[i].name)
  7042. let _oid = users.oid;
  7043. let _ph = encodeURIComponent(arr[i].phone ? arr[i].phone : "")
  7044. let _class = encodeURIComponent(arr[i].class)
  7045. let _sId = encodeURIComponent(arr[i].sId)
  7046. let _org = users.org;
  7047. //加密密碼
  7048. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  7049. //生成激活碼
  7050. let _hashstr = new Date().getTime() + "";
  7051. let _digest = crypto
  7052. .createHash("sha256")
  7053. .update(_hashstr, "utf8")
  7054. .digest("hex");
  7055. //用戶數據
  7056. let _userdata = [
  7057. _mail,
  7058. _password,
  7059. _alias,
  7060. "",
  7061. 1, //0老师 1学生
  7062. _username,
  7063. "",
  7064. generateAPIKey(_username),
  7065. _digest,
  7066. "",
  7067. _username,
  7068. _sId,
  7069. 2, //1老师 2学生
  7070. _oid,
  7071. _ph,
  7072. _class,
  7073. "",
  7074. "0",
  7075. _org,
  7076. ];
  7077. //參數拼接,註冊
  7078. _userdata.unshift(
  7079. _mysqluser[0],
  7080. _mysqluser[1],
  7081. "pbl_add_batchregister_org2"
  7082. );
  7083. //用戶註冊處理
  7084. mysql.usselect(_userdata, function(ret) {
  7085. res.end(JSON.stringify({ success: 1 }));
  7086. });
  7087. }
  7088. });
  7089. //工作室管理
  7090. router.route("/updateStudioWorkNew4").all((req, res, next) => {
  7091. //学生
  7092. if (req.body[0]) {
  7093. let p = [req.body[0].cid];
  7094. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_studio_course_detail2"); //執行存儲過程
  7095. mysql.usselect(p, function(ret) {
  7096. let _unitIndex = parseInt(req.body[0].unitIndex);
  7097. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  7098. let _unitJson = JSON.parse(ret[0][0].chapters);
  7099. if (_unitJson.length - 1 < _unitIndex) {
  7100. let _i = _unitIndex - (_unitJson.length - 1);
  7101. for (let i = 0; i < _i; i++) {
  7102. _unitJson.push({
  7103. dyName: "", //单元标题
  7104. chapterInfo: [{
  7105. isread: false,
  7106. chapterid: guid(),
  7107. title: "",
  7108. courseName: "",
  7109. taskJson: [{
  7110. task: "",
  7111. taskDetail: "",
  7112. chapterData: [],
  7113. toolText: "",
  7114. toolChoose: [{
  7115. tool: [],
  7116. toolDetail: "",
  7117. toolType: 0,
  7118. askCount: 1,
  7119. askTitle: "",
  7120. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  7121. }, ],
  7122. isShowTools: false,
  7123. askCount: 1,
  7124. isFold: 0,
  7125. askTitle: "",
  7126. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  7127. checkJson: [{ checkCount: [], checkPerent: [] }],
  7128. homeworkList: [],
  7129. }, ],
  7130. itemCount: 1,
  7131. fileList1: [],
  7132. video: [],
  7133. testData: [],
  7134. pData: [],
  7135. templateArray: [],
  7136. }, ],
  7137. });
  7138. }
  7139. _unitJson[_unitIndex] = _chapters[_unitIndex];
  7140. } else {
  7141. _unitJson[_unitIndex] = _chapters[_unitIndex];
  7142. }
  7143. // console.log(_unitJson);
  7144. let p2 = [
  7145. req.body[0].cid,
  7146. encodeURIComponent(JSON.stringify(_unitJson)),
  7147. ];
  7148. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudioWorkNew4"); //執行存儲過程
  7149. mysql.usselect(p2, function(ret) {
  7150. res.end(JSON.stringify({ success: 1 }));
  7151. });
  7152. // res.end(JSON.stringify({ success: 1 }));
  7153. });
  7154. }
  7155. });
  7156. router.route("/updateStudioWorkNew2").all((req, res, next) => {
  7157. //学生
  7158. if (req.body[0]) {
  7159. p = [
  7160. req.body[0].cid,
  7161. req.body[0].title,
  7162. req.body[0].brief,
  7163. req.body[0].cover,
  7164. req.body[0].evaId,
  7165. req.body[0].astudent,
  7166. req.body[0].see,
  7167. req.body[0].chapters,
  7168. req.body[0].template,
  7169. req.body[0].ateacher,
  7170. ];
  7171. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudioWorkNew2"); //執行存儲過程
  7172. mysql.usselect(p, function(ret) {
  7173. let course = req.body[0].courseType;
  7174. let courseId = req.body[0].cid;
  7175. let userid = req.body[0].uid;
  7176. delStudioCourseTypeS(course, courseId, userid);
  7177. res.end(JSON.stringify({ success: 1 }));
  7178. });
  7179. }
  7180. });
  7181. router.route("/addStudioCourseWorkNew2").all((req, res, next) => {
  7182. //学生
  7183. if (req.body[0]) {
  7184. p = [
  7185. req.body[0].uid,
  7186. req.body[0].title,
  7187. req.body[0].brief,
  7188. req.body[0].cover,
  7189. req.body[0].evaId,
  7190. req.body[0].astudent,
  7191. req.body[0].see,
  7192. req.body[0].chapters,
  7193. req.body[0].template,
  7194. req.body[0].ateacher,
  7195. ];
  7196. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addStudioCourseWorkNew2"); //執行存儲過程
  7197. mysql.usselect(p, function(ret) {
  7198. let course = req.body[0].courseType;
  7199. let courseId = ret[0][0].courseId;
  7200. let userid = req.body[0].uid;
  7201. delStudioCourseTypeS(course, courseId, userid);
  7202. res.end(
  7203. JSON.stringify({
  7204. ordernumber: ret[0][0].ordernumber,
  7205. courseId: ret[0][0].courseId,
  7206. success: 1,
  7207. })
  7208. );
  7209. });
  7210. }
  7211. });
  7212. //teacher 查询项目模板
  7213. router.route("/getStudioTemplateTs").all((req, res, next) => {
  7214. var json = queryString(req.url);
  7215. getmysql(req, res, "getStudioTemplateTs", json["oid"]);
  7216. });
  7217. //查看课程
  7218. router.route("/select_studio_course_detail").all((req, res, next) => {
  7219. //学生
  7220. var json = queryString(req.url);
  7221. getmysql(req, res, "select_studio_course_detail", json["cid"]);
  7222. });
  7223. //查看课程
  7224. router.route("/select_studio_course_detail2").all((req, res, next) => {
  7225. //学生
  7226. var json = queryString(req.url);
  7227. getmysql(req, res, "select_studio_course_detail2", json["cid"]);
  7228. });
  7229. //协同恢复删除的阶段
  7230. router.route("/restoreStudioWork").all((req, res, next) => {
  7231. //学生
  7232. if (req.body[0]) {
  7233. let p = [req.body[0].cid];
  7234. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_studio_course_detail2"); //執行存儲過程
  7235. mysql.usselect(p, function(ret) {
  7236. let _chapid = req.body[0].chapid;
  7237. // console.log(_chapid);
  7238. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  7239. let _unitJson = JSON.parse(ret[0][0].chapters);
  7240. let _unitJson2 = [];
  7241. let chpaindex;
  7242. for (var i = 0; i < _chapters.length; i++) {
  7243. if (_chapters[i].chapterInfo[0].chapterid == _chapid) {
  7244. chpaindex = i;
  7245. }
  7246. }
  7247. for (var i = 0; i < _unitJson.length; i++) {
  7248. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  7249. // console.log(1);
  7250. // _unitJson.splice(i, -1)
  7251. _unitJson2.push(_unitJson[i]);
  7252. // break;
  7253. }
  7254. }
  7255. _unitJson2.splice(chpaindex, 0, _chapters[chpaindex]);
  7256. // console.log(_unitJson2);
  7257. let p2 = [
  7258. req.body[0].cid,
  7259. JSON.stringify(_unitJson2).replaceAll(/%/g, "%25"),
  7260. ];
  7261. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudioWorkNew4"); //執行存儲過程
  7262. mysql.usselect(p2, function(ret) {
  7263. res.end(JSON.stringify({ success: 1 }));
  7264. });
  7265. // res.end(JSON.stringify({ success: 1 }));
  7266. });
  7267. }
  7268. });
  7269. //查询分类及所有子分类
  7270. router.route("/selectAllTypeStudio").all((req, res, next) => {
  7271. var json = queryString(req.url);
  7272. getmysql(req, res, "selectAllTypeStudio", json["org"], json["oid"]);
  7273. });
  7274. //上传文件
  7275. router.route("/addStudioCourseWorksS").all((req, res, next) => {
  7276. postmysql(req, res, "addStudioCourseWorksS");
  7277. });
  7278. //删除提交的作业
  7279. router.route("/deleteStudioCourseWorkS").all((req, res, next) => {
  7280. postmysql(req, res, "deleteStudioCourseWorkS");
  7281. });
  7282. //创建新话题
  7283. router.route("/addSubTalk").all((req, res, next) => {
  7284. postmysql(req, res, "addSubTalk");
  7285. });
  7286. //创建新子分类
  7287. router.route("/addEngVType").all((req, res, next) => {
  7288. postmysql(req, res, "addEngVType");
  7289. });
  7290. router.route("/selectStudioCourseNew222").all((req, res, next) => {
  7291. var json = queryString(req.url);
  7292. getmysql(
  7293. req,
  7294. res,
  7295. "selectStudioCourseNew222",
  7296. json["type"],
  7297. json["uid"],
  7298. json["oid"],
  7299. json["org"],
  7300. json["typea"],
  7301. json["typeb"],
  7302. json["typec"],
  7303. json["typed"],
  7304. json["typef"],
  7305. json["typeE"],
  7306. json["cu"],
  7307. json["cn"],
  7308. json["page"],
  7309. json["pageSize"]
  7310. );
  7311. });
  7312. //删除1课程
  7313. router.route("/deleteStudioCourse").all((req, res, next) => {
  7314. var json = queryString(req.url);
  7315. getmysql2(req, res, "deleteStudioCourse", json["cid"]);
  7316. });
  7317. //添加分享课程数据
  7318. router.route("/addShareCourse").post((req, res, next) => {
  7319. var json = queryString(req.url);
  7320. postmysql(req, res, "addShareCourse");
  7321. });
  7322. //获取分享课程数据
  7323. router.route("/getShareCourse").all((req, res, next) => {
  7324. var json = queryString(req.url);
  7325. getmysql(req, res, "getShareCourse", json["cid"],json["type"]);
  7326. });
  7327. router.route("/delShareCourse").all((req, res, next) => {
  7328. var json = queryString(req.url);
  7329. postmysql(req, res, "delShareCourse");
  7330. });
  7331. function delStudioCourseTypeS(course, courseId, userid) {
  7332. let _courseId = courseId;
  7333. var _userdata = [_courseId];
  7334. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_studioCourseTypeS");
  7335. mysql.usselect(_userdata, function(ret) {
  7336. // console.log(ret);
  7337. addStudioCourseTypeS(userid, course, _courseId);
  7338. });
  7339. // setTimeout(() => {
  7340. // }, 1000);
  7341. }
  7342. function addStudioCourseTypeS(userid, course, _courseId) {
  7343. var _uid = userid;
  7344. var _courses = _courseId;
  7345. var _tid = JSON.parse(decodeURIComponent(course));
  7346. for (let i = 0; i < _tid.length; i++) {
  7347. if (_tid[i] == "") {
  7348. continue;
  7349. }
  7350. var _userdata = [_courses, _tid[i], _uid];
  7351. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_studioCourseTypeS");
  7352. mysql.usselect(_userdata, function(ret) {
  7353. // console.log(ret);
  7354. });
  7355. }
  7356. }
  7357. //删除作业阶段任务工具
  7358. router.route("/deleteStudioToolSTT").all((req, res, next) => {
  7359. postmysql(req, res, "deleteStudioToolSTT");
  7360. });
  7361. //删除作业阶段任务
  7362. router.route("/deleteStudioToolST").all((req, res, next) => {
  7363. postmysql(req, res, "deleteStudioToolST");
  7364. });
  7365. //删除作业阶段
  7366. router.route("/deleteStudioToolS").all((req, res, next) => {
  7367. postmysql(req, res, "deleteStudioToolST");
  7368. });
  7369. //工作管理首页查询分类
  7370. router.route("/selectStudioCourseNew22Mode").all((req, res, next) => {
  7371. var json = queryString(req.url);
  7372. getmysql(
  7373. req,
  7374. res,
  7375. "selectStudioCourseNew22Mode",
  7376. json["type"],
  7377. json["uid"],
  7378. json["oid"],
  7379. json["org"],
  7380. json["typea"],
  7381. json["typeb"],
  7382. json["typec"],
  7383. json["typed"],
  7384. json["typef"],
  7385. json["typeE"],
  7386. json["cu"],
  7387. json["cn"]
  7388. );
  7389. });
  7390. //工作管理首页查询
  7391. router.route("/selectStudioCourseNew22").all((req, res, next) => {
  7392. var json = queryString(req.url);
  7393. getmysql(
  7394. req,
  7395. res,
  7396. "selectStudioCourseNew22",
  7397. json["type"],
  7398. json["uid"],
  7399. json["oid"],
  7400. json["org"],
  7401. json["typea"],
  7402. json["typeb"],
  7403. json["typec"],
  7404. json["typed"],
  7405. json["typef"],
  7406. json["typeE"],
  7407. json["cu"],
  7408. json["cn"],
  7409. json["page"],
  7410. json["pageSize"]
  7411. );
  7412. });
  7413. //根据学校查询banner
  7414. router.route("/selectBannerByOidStudio").all((req, res, next) => {
  7415. var json = queryString(req.url);
  7416. getmysql(req, res, "selectBannerByOidStudio", json["oid"]);
  7417. });
  7418. //admin 查询banner
  7419. router.route("/getBannerStudio").all((req, res, next) => {
  7420. var json = queryString(req.url);
  7421. getmysql(req, res, "getBannerStudio");
  7422. });
  7423. //查询工作课程详情
  7424. router.route("/selectStudioCourseDetail2").all((req, res, next) => {
  7425. //学生
  7426. var json = queryString(req.url);
  7427. getmysql(req, res, "selectStudioCourseDetail2", json["courseId"]);
  7428. });
  7429. //查询工作课程详情
  7430. router.route("/selectStudioCourseDetail3").all((req, res, next) => {
  7431. //学生
  7432. var json = queryString(req.url);
  7433. getmysql(req, res, "selectStudioCourseDetail3", json["courseId"]);
  7434. });
  7435. //上传文件
  7436. router.route("/addCourseWorks4studio").all((req, res, next) => {
  7437. postmysql3(req, res, "addCourseWorks4studio");
  7438. });
  7439. //查询教师资源分类
  7440. router.route("/selectAllSourceType").all((req, res, next) => {
  7441. //学生
  7442. var json = queryString(req.url);
  7443. getmysql(req, res, "selectAllSourceType", json["oid"], json["org"]);
  7444. });
  7445. //查询资源分类
  7446. router.route("/selectAllEvaType").all((req, res, next) => {
  7447. var json = queryString(req.url);
  7448. getmysql(req, res, "selectAllEvaType", json["oid"], json["org"]);
  7449. });
  7450. router.route("/addSource").all((req, res, next) => {
  7451. //添加资源
  7452. if (req.body[0]) {
  7453. p = [
  7454. req.body[0].name,
  7455. req.body[0].url,
  7456. req.body[0].detail,
  7457. req.body[0].label,
  7458. req.body[0].userid,
  7459. ];
  7460. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addSource");
  7461. //執行存儲過程
  7462. mysql.usselect(p, function(ret) {
  7463. let course = req.body[0].courseType;
  7464. let courseId = ret[0][0].id;
  7465. let userid = req.body[0].userid;
  7466. delSourceType(course, courseId, userid);
  7467. res.end(JSON.stringify({ id: ret[0][0].id, success: 1 }));
  7468. // res.end(JSON.stringify(ret));
  7469. });
  7470. }
  7471. });
  7472. //删除1资源模板分类
  7473. router.route("/deleteCETLabel").all((req, res, next) => {
  7474. var json = queryString(req.url);
  7475. getmysql2(req, res, "deleteCETLabel", json["cid"]);
  7476. });
  7477. //添加资源模板分类
  7478. router.route("/addCETLabel").all((req, res, next) => {
  7479. postmysql(req, res, "addCETLabel");
  7480. });
  7481. //资源模板分享
  7482. router.route("/addCETShare").all((req, res, next) => {
  7483. // if (req.body[0]) {
  7484. // p = [
  7485. // req.body[0].uid,
  7486. // req.body[0].n,
  7487. // req.body[0].json,
  7488. // req.body[0].t,
  7489. // req.body[0].oid,
  7490. // ];
  7491. // p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addCETShare");
  7492. // //執行存儲過程
  7493. // mysql.usselect(p, function(ret) {
  7494. // res.end(JSON.stringify({ id: ret[0][0].id, success: 1 }));
  7495. // // res.end(JSON.stringify(ret));
  7496. // });
  7497. // }
  7498. postmysql(req, res, "addCETShare");
  7499. });
  7500. router.route("/updateSource").all((req, res, next) => {
  7501. //修改资源
  7502. if (req.body[0]) {
  7503. p = [
  7504. req.body[0].id,
  7505. req.body[0].name,
  7506. req.body[0].url,
  7507. req.body[0].detail,
  7508. req.body[0].label,
  7509. req.body[0].userid,
  7510. ];
  7511. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateSource");
  7512. //執行存儲過程
  7513. mysql.usselect(p, function(ret) {
  7514. let course = req.body[0].courseType;
  7515. let courseId = req.body[0].id;
  7516. let userid = req.body[0].userid;
  7517. delSourceType(course, courseId, userid);
  7518. res.end(JSON.stringify({ id: req.body[0].id, success: 1 }));
  7519. // res.end(JSON.stringify(ret));
  7520. });
  7521. }
  7522. });
  7523. function delSourceType(course, courseId, userid) {
  7524. let _courseId = courseId;
  7525. var _userdata = [_courseId];
  7526. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_sourceType");
  7527. mysql.usselect(_userdata, function(ret) {
  7528. addSourceType(userid, course, _courseId);
  7529. });
  7530. }
  7531. function addSourceType(userid, course, _courseId) {
  7532. var _uid = userid;
  7533. var _courses = _courseId;
  7534. var _tid = JSON.parse(decodeURIComponent(course));
  7535. for (let i = 0; i < _tid.length; i++) {
  7536. if (_tid[i] == "") {
  7537. continue;
  7538. }
  7539. var _userdata = [_courses, _tid[i], _uid];
  7540. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_sourceType");
  7541. mysql.usselect(_userdata, function(ret) {
  7542. // console.log(ret);
  7543. });
  7544. }
  7545. }
  7546. //资源查询
  7547. router.route("/selectSource").all((req, res, next) => {
  7548. var json = queryString(req.url);
  7549. getmysql(
  7550. req,
  7551. res,
  7552. "selectSource",
  7553. json["uid"],
  7554. json["oid"],
  7555. json["org"],
  7556. json["typea"],
  7557. json["typeb"],
  7558. json["typeE"],
  7559. json["cn"],
  7560. json["page"],
  7561. json["pageSize"]
  7562. );
  7563. });
  7564. //评价资源查询
  7565. router.route("/selectCourseEvaT").all((req, res, next) => {
  7566. var json = queryString(req.url);
  7567. getmysql(
  7568. req,
  7569. res,
  7570. "selectCourseEvaT",
  7571. json["uid"],
  7572. json["oid"],
  7573. json["org"],
  7574. json["typea"],
  7575. json["typeb"],
  7576. json["typeE"],
  7577. json["cn"],
  7578. json["type"],
  7579. json["page"],
  7580. json["pageSize"]
  7581. );
  7582. });
  7583. //评价资源重命名 修1
  7584. router.route("/updateCourseET").get((req, res, next) => {
  7585. var json = queryString(req.url);
  7586. getmysql2(
  7587. req,
  7588. res,
  7589. "updateCourseET",
  7590. json["id"],
  7591. json["n"],
  7592. );
  7593. });
  7594. //删除1评价资源
  7595. router.route("/deleteCourseET").all((req, res, next) => {
  7596. var json = queryString(req.url);
  7597. getmysql2(
  7598. req,
  7599. res,
  7600. "deleteCourseET",
  7601. json["id"],
  7602. );
  7603. });
  7604. //添加评价资源分类 修1
  7605. router.route("/addCETType").get((req, res, next) => {
  7606. var json = queryString(req.url);
  7607. getmysql2(
  7608. req,
  7609. res,
  7610. "addCETType",
  7611. json["pid"],
  7612. json["ppid"],
  7613. json["n"],
  7614. json["uid"],
  7615. json["oid"],
  7616. );
  7617. });
  7618. //课程打开次数
  7619. router.route("/addOpenCoursenum").all((req, res, next) => {
  7620. postmysql(req, res, "addOpenCoursenum");
  7621. });
  7622. // 数据看板ai应用
  7623. router.route("/getKanbanBasedata").all((req, res, next) => {
  7624. postmysql(req, res, "getKanbanBasedata");
  7625. });
  7626. // 数据看板ai应用
  7627. router.route("/getKanbanAIdata").all((req, res, next) => {
  7628. postmysql(req, res, "getKanbanAIdata");
  7629. });
  7630. // 数据看板常规教学
  7631. router.route("/getKanbanTeadata").all((req, res, next) => {
  7632. postmysql(req, res, "getKanbanTeadata");
  7633. });
  7634. // 数据看板常规教学
  7635. router.route("/getKanbanTeaManagedata").all((req, res, next) => {
  7636. postmysql(req, res, "getKanbanTeaManagedata");
  7637. });
  7638. //数据看板-综合数据
  7639. router.route("/selectDataBoardSchool").all((req, res, next) => {
  7640. postmysql(req, res, "selectDataBoardSchool");
  7641. });
  7642. //数据看板-教师数据
  7643. router.route("/selectDataBoardTeacher").all((req, res, next) => {
  7644. postmysql(req, res, "selectDataBoardTeacher");
  7645. });
  7646. //数据看板-学生数据
  7647. router.route("/selectDataBoardStudent").all((req, res, next) => {
  7648. postmysql(req, res, "selectDataBoardStudent");
  7649. });
  7650. //数据看板-课程数据
  7651. router.route("/selectDataBoardCourse").all((req, res, next) => {
  7652. postmysql(req, res, "selectDataBoardCourse");
  7653. });
  7654. //数据看板-综合数据
  7655. router.route("/selectDataBoardSchoolNew").all((req, res, next) => {
  7656. postmysql(req, res, "selectDataBoardSchoolNew");
  7657. });
  7658. //数据看板-教师数据
  7659. router.route("/selectDataBoardTeacherNew").all((req, res, next) => {
  7660. postmysql(req, res, "selectDataBoardTeacherNew");
  7661. });
  7662. //数据看板-学生数据
  7663. router.route("/selectDataBoardStudentNew").all((req, res, next) => {
  7664. postmysql(req, res, "selectDataBoardStudentNew");
  7665. });
  7666. //数据看板-课程数据
  7667. router.route("/selectDataBoardCourseNew").all((req, res, next) => {
  7668. postmysql(req, res, "selectDataBoardCourseNew");
  7669. });
  7670. //数据看板-课程数据
  7671. router.route("/selectDataBoardStudentCourseNew").all((req, res, next) => {
  7672. postmysql(req, res, "selectDataBoardStudentCourseNew");
  7673. });
  7674. //数据看板-学生排行榜
  7675. router.route("/selectDataboardStudentRank").all((req, res, next) => {
  7676. postmysql(req, res, "selectDataboardStudentRank");
  7677. });
  7678. //数据看板-教师排行榜
  7679. router.route("/selectDataboardTeacherRank").all((req, res, next) => {
  7680. postmysql(req, res, "selectDataboardTeacherRank");
  7681. });
  7682. //数据看板-评测
  7683. router.route("/selectDataBoardTest").all((req, res, next) => {
  7684. postmysql(req, res, "selectDataBoardTest");
  7685. });
  7686. //数据看板-市级数据
  7687. router.route("/selectDataBoardCitySz").all((req, res, next) => {
  7688. postmysql(req, res, "selectDataBoardCitySz");
  7689. });
  7690. //数据看板-区级数据
  7691. router.route("/selectDataBoardAreaSz").all((req, res, next) => {
  7692. postmysql(req, res, "selectDataBoardAreaSz");
  7693. });
  7694. //数据看板-综合数据
  7695. router.route("/getDataBoardSchoolNew").all((req, res, next) => {
  7696. let p = Object.values(req.body[0]);
  7697. let d = Object.values(req.body[0]);
  7698. console.log(p)
  7699. p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
  7700. mysql.usselect(p, function(ret) {
  7701. if(!ret[0].length){
  7702. let p2 = [d[0], d[1]];
  7703. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardSchoolNew');
  7704. mysql.usselect(p2, function(ret) {
  7705. res.end(JSON.stringify(ret));
  7706. let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'1'];
  7707. p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
  7708. mysql.usselect(p3, function(ret) {})
  7709. });
  7710. }else{
  7711. console.log(1);
  7712. res.end(ret[0][0].json);
  7713. }
  7714. // res.end(JSON.stringify(ret));
  7715. });
  7716. });
  7717. //数据看板-课程数据
  7718. router.route("/getDataBoardCourseNew").all((req, res, next) => {
  7719. let p = Object.values(req.body[0]);
  7720. let d = Object.values(req.body[0]);
  7721. console.log(p)
  7722. p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
  7723. mysql.usselect(p, function(ret) {
  7724. if(!ret[0].length){
  7725. let p2 = [d[0], d[1]];
  7726. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardCourseNew');
  7727. mysql.usselect(p2, function(ret) {
  7728. res.end(JSON.stringify(ret));
  7729. let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'2'];
  7730. p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
  7731. mysql.usselect(p3, function(ret) {})
  7732. });
  7733. }else{
  7734. console.log(1);
  7735. res.end(ret[0][0].json);
  7736. }
  7737. // res.end(JSON.stringify(ret));
  7738. });
  7739. });
  7740. //数据看板-项目数据
  7741. router.route("/getDataBoardStudentCourseNew").all((req, res, next) => {
  7742. let p = Object.values(req.body[0]);
  7743. let d = Object.values(req.body[0]);
  7744. console.log(p)
  7745. p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
  7746. mysql.usselect(p, function(ret) {
  7747. if(!ret[0].length){
  7748. let p2 = [d[0], d[1]];
  7749. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardStudentCourseNew');
  7750. mysql.usselect(p2, function(ret) {
  7751. res.end(JSON.stringify(ret));
  7752. let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'3'];
  7753. p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
  7754. mysql.usselect(p3, function(ret) {})
  7755. });
  7756. }else{
  7757. console.log(1);
  7758. res.end(ret[0][0].json);
  7759. }
  7760. // res.end(JSON.stringify(ret));
  7761. });
  7762. });
  7763. //数据看板-学生数据
  7764. router.route("/getDataBoardStudentNew").all((req, res, next) => {
  7765. let p = Object.values(req.body[0]);
  7766. let d = Object.values(req.body[0]);
  7767. console.log(p)
  7768. p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
  7769. mysql.usselect(p, function(ret) {
  7770. if(!ret[0].length){
  7771. let p2 = [d[0], d[1]];
  7772. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardStudentNew');
  7773. mysql.usselect(p2, function(ret) {
  7774. res.end(JSON.stringify(ret));
  7775. let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'5'];
  7776. p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
  7777. mysql.usselect(p3, function(ret) {})
  7778. });
  7779. }else{
  7780. console.log(1);
  7781. res.end(ret[0][0].json);
  7782. }
  7783. // res.end(JSON.stringify(ret));
  7784. });
  7785. });
  7786. //数据看板-教师数据
  7787. router.route("/getDataBoardTeacherNew").all((req, res, next) => {
  7788. let p = Object.values(req.body[0]);
  7789. let d = Object.values(req.body[0]);
  7790. console.log(p)
  7791. p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
  7792. mysql.usselect(p, function(ret) {
  7793. if(!ret[0].length){
  7794. let p2 = [d[0], d[1]];
  7795. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardTeacherNew');
  7796. mysql.usselect(p2, function(ret) {
  7797. res.end(JSON.stringify(ret));
  7798. let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'4'];
  7799. p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
  7800. mysql.usselect(p3, function(ret) {})
  7801. });
  7802. }else{
  7803. console.log(1);
  7804. res.end(ret[0][0].json);
  7805. }
  7806. // res.end(JSON.stringify(ret));
  7807. });
  7808. });
  7809. //数据看板-查询项目数据长度
  7810. router.route("/getCourseLength").all((req, res, next) => {
  7811. postmysql(req, res, "getCourseLength");
  7812. });
  7813. //评测中心-上传评测
  7814. router.route("/addTestWorks").all((req, res, next) => {
  7815. postmysql(req, res, "addTestWorks");
  7816. });
  7817. //评测中心-上传评测
  7818. router.route("/addTestWorks2").all((req, res, next) => {
  7819. postmysql(req, res, "addTestWorks2");
  7820. });
  7821. //评测中心-删除评测
  7822. router.route("/deleteTestCourse").all((req, res, next) => {
  7823. postmysql(req, res, "deleteTestCourse");
  7824. });
  7825. //评测中心-批改
  7826. router.route("/addTestWorksTeacher").all((req, res, next) => {
  7827. postmysql(req, res, "addTestWorksTeacher");
  7828. });
  7829. //评测中心-复制评测
  7830. router.route("/copyTestWorks").all((req, res, next) => {
  7831. postmysql(req, res, "copyTestWorks");
  7832. });
  7833. //评测中心-查询用户测评总览
  7834. router.route("/selectTestUserY").all((req, res, next) => {
  7835. var json = queryString(req.url);
  7836. getmysql(req, res, "selectTestUserY", json["uid"], json["oid"], json["org"]);
  7837. });
  7838. //查询用户学习记录总览
  7839. router.route("/selectSRecordY").all((req, res, next) => {
  7840. var json = queryString(req.url);
  7841. getmysql(req, res, "selectSRecordY", json["uid"], json["oid"], json["org"]);
  7842. });
  7843. //查询幼儿园全部及学校分类
  7844. router.route("/selectSEAllType").all((req, res, next) => {
  7845. var json = queryString(req.url);
  7846. getmysql(req, res, "selectSEAllType", json["oid"]);
  7847. });
  7848. //根据学期查询幼儿园个人评分
  7849. router.route("/selectSETable").all((req, res, next) => {
  7850. var json = queryString(req.url);
  7851. getmysql(req, res, "selectSETable", json["uid"], json["oid"], json["org"], json["cu"]);
  7852. });
  7853. //根据学期保存幼儿园个人评分 修1
  7854. router.route("/addSRScore").get((req, res, next) => {
  7855. var json = queryString(req.url);
  7856. getmysql2(req, res, "addSRScore", json["uid"], json["j"], json["t"]);
  7857. });
  7858. //评测中心-数据 修1 这个不确定所以先加上了
  7859. router.route("/testDataBoard").get((req, res, next) => {
  7860. var json = queryString(req.url);
  7861. getmysql2(req, res, "testDataBoard", json["oid"], json["org"]);
  7862. });
  7863. //评测中心-查询用户数据
  7864. router.route("/selectTestUser").all((req, res, next) => {
  7865. var json = queryString(req.url);
  7866. getmysql(req, res, "selectTestUser", json["uid"]);
  7867. });
  7868. //评测中心-获取评测提交详情
  7869. router.route("/getTestWorks").all((req, res, next) => {
  7870. var json = queryString(req.url);
  7871. getmysql(req, res, "getTestWorks", json["cid"], json["uid"]);
  7872. });
  7873. //评测中心-获取评测提交详情
  7874. router.route("/getTestWorks2").all((req, res, next) => {
  7875. var json = queryString(req.url);
  7876. getmysql(req, res, "getTestWorks2", json["cid"], json["tid"]);
  7877. });
  7878. //评测中心-获取评测提交详情
  7879. router.route("/selectTestCourseWorks").all((req, res, next) => {
  7880. var json = queryString(req.url);
  7881. getmysql(req, res, "selectTestCourseWorks", json["cid"], json["tid"]);
  7882. });
  7883. //评测中心-获取评测提交详情
  7884. router.route("/getTestWorksPage").all((req, res, next) => {
  7885. var json = queryString(req.url);
  7886. getmysql(req, res, "getTestWorksPage", json["cid"], json["page"], json["pageSize"]);
  7887. });
  7888. //评测中心-获取评测提交详情
  7889. router.route("/getTestWorksPage3").all((req, res, next) => {
  7890. var json = queryString(req.url);
  7891. getmysql(req, res, "getTestWorksPage3", json["cid"], json["cn"], json["page"], json["pageSize"]);
  7892. });
  7893. //评测中心-获取评测提交详情
  7894. router.route("/getTestWorksNoPage").all((req, res, next) => {
  7895. var json = queryString(req.url);
  7896. getmysql(req, res, "getTestWorksNoPage", json["cid"], json["cn"]);
  7897. });
  7898. //评测中心-获取评测提交详情 yym
  7899. router.route("/getTestWorksNoPageCopy").all((req, res, next) => {
  7900. var json = queryString(req.url);
  7901. getmysql(req, res, "getTestWorksNoPageCopy", json["cid"], json["cn"], json["tim"], json["tea"]);
  7902. });
  7903. //评测中心-获取评测提交详情 yym
  7904. router.route("/getTestWorksNoPageCopy2").all((req, res, next) => {
  7905. postmysql(req, res, "getTestWorksNoPageCopy2");
  7906. });
  7907. //评测中心-智能表单ai评分
  7908. router.route("/addtestAiSco").all((req, res, next) => {
  7909. postmysql(req, res, "addtestAiSco");
  7910. });
  7911. //评测中心-智能表单ai评分
  7912. router.route("/deltestAisco").all((req, res, next) => {
  7913. postmysql(req, res, "deltestAisco");
  7914. });
  7915. //评测中心-获取智能表单ai评分
  7916. router.route("/getTestAiSco").all((req, res, next) => {
  7917. var json = queryString(req.url);
  7918. getmysql(req, res, "getTestAiSco", json["tid"]);
  7919. });
  7920. //评测中心-获取评测提交详情
  7921. router.route("/getTestWorksPage2").all((req, res, next) => {
  7922. var json = queryString(req.url);
  7923. getmysql(req, res, "getTestWorksPage2", json["cid"], json["page"], json["pageSize"]);
  7924. });
  7925. //评测中心-个人中心
  7926. router.route("/getTestWorksPerson").all((req, res, next) => {
  7927. var json = queryString(req.url);
  7928. getmysql(req, res, "getTestWorksPerson", json["uid"], json["typeid"]);
  7929. });
  7930. //教师发展-考核-查询是否有提交的的数据
  7931. router.route("/getTestExamineByUserId").all((req, res, next) => {
  7932. var json = queryString(req.url);
  7933. getmysql(req, res, "getTestExamineByUserId", json["uid"], json["type"]);
  7934. });
  7935. //教师发展-考核-查询是否有提交的的数据 加上tid查询
  7936. router.route("/getTestExamineByUserId2").all((req, res, next) => {
  7937. var json = queryString(req.url);
  7938. getmysql(req, res, "getTestExamineByUserId2", json["uid"], json["type"],json["tid"]);
  7939. });
  7940. //教师发展-考核-查询是否有提交的的数据
  7941. router.route("/addTestExamineWorks").all((req, res, next) => {
  7942. postmysql(req, res, "addTestExamineWorks");
  7943. });
  7944. //教师发展-考核-查询是否有提交的的数据 加上tid
  7945. router.route("/addTestExamineWorks2").all((req, res, next) => {
  7946. postmysql(req, res, "addTestExamineWorks2");
  7947. });
  7948. //教师发展-考核-管理员页面获取所有数据,用于计算平均分等
  7949. router.route("/selectTestExamineAllData").all((req, res, next) => {
  7950. var json = queryString(req.url);
  7951. getmysql(req, res, "selectTestExamineAllData", json["oid"], json["org"], json["type"]);
  7952. // postmysql(req, res, "selectTestExamineAllData");
  7953. });
  7954. //教师发展-考核-管理员页面获取所有数据,用于计算平均分等 ,加上对应的tid
  7955. router.route("/selectTestExamineAllData2").all((req, res, next) => {
  7956. var json = queryString(req.url);
  7957. getmysql(req, res, "selectTestExamineAllData2", json["oid"], json["org"], json["type"],json['tid']);
  7958. // postmysql(req, res, "selectTestExamineAllData");
  7959. });
  7960. //教师发展-考核-管理员页面获取二级指标数据,用于计算平均分等
  7961. router.route("/selectTestExamineSecondData").all((req, res, next) => {
  7962. var json = queryString(req.url);
  7963. getmysql(req, res, "selectTestExamineSecondData", json["oid"], json["org"], json["type"]);
  7964. // postmysql(req, res, "selectTestExamineAllData");
  7965. });
  7966. //教师发展-考核-管理员页面获取二级指标数据,用于计算平均分等 加上tid
  7967. router.route("/selectTestExamineSecondData2").all((req, res, next) => {
  7968. var json = queryString(req.url);
  7969. getmysql(req, res, "selectTestExamineSecondData2", json["oid"], json["org"], json["type"],json['tid']);
  7970. // postmysql(req, res, "selectTestExamineAllData");
  7971. });
  7972. //查询英语写作评价模板
  7973. router.route("/selectEnglishEva").all((req, res, next) => {
  7974. var json = queryString(req.url);
  7975. getmysql(req, res, "selectEnglishEva", json["oid"]);
  7976. });
  7977. //新增英语写作评价模板
  7978. router.route("/insertEnglishEva").all((req, res, next) => {
  7979. postmysql(req, res, "insertEnglishEva");
  7980. });
  7981. //获取作业数量
  7982. router.route("/getStudentCourseWorkCount").all((req, res, next) => {
  7983. postmysql(req, res, "getStudentCourseWorkCount");
  7984. });
  7985. //获取作业数量
  7986. router.route("/getCourseWorkCount").all((req, res, next) => {
  7987. postmysql(req, res, "getCourseWorkCount");
  7988. });
  7989. //根据id查询英语写作评价模板
  7990. router.route("/selectEnglishEvaById").all((req, res, next) => {
  7991. var json = queryString(req.url);
  7992. getmysql(req, res, "selectEnglishEvaById", json["id"], json["oid"]);
  7993. });
  7994. //根据id删除1英语写作评价模板
  7995. router.route("/deleteEnglishEvaById").all((req, res, next) => {
  7996. var json = queryString(req.url);
  7997. getmysql2(req, res, "deleteEnglishEvaById", json["id"]);
  7998. });
  7999. //获取评价模板
  8000. router.route("/getCourseEvaTemplate").all((req, res, next) => {
  8001. var json = queryString(req.url);
  8002. getmysql(req, res, "getCourseEvaTemplate", json["oid"], json["org"], json["n"]);
  8003. });
  8004. //案例新项目登录接口
  8005. router.route("/loginNewEvenManage").all((req, res, next) => {
  8006. postmysql(req, res, "loginNewEvenManage");
  8007. });
  8008. //案例新项目创建用户接口
  8009. router.route("/addNewRaceUser").all((req, res, next) => {
  8010. postmysql(req, res, "addNewRaceUser");
  8011. });
  8012. //查询老师的信息
  8013. router.route("/getRaceUser1").all((req, res, next) => {
  8014. var json = queryString(req.url);
  8015. getmysql(req, res, "getRaceUser1", json["uid"]);
  8016. });
  8017. //修改用户信息
  8018. router.route("/updateRaceUser1").all((req, res, next) => {
  8019. postmysql(req, res, "updateRaceUser1");
  8020. });
  8021. /* 修改评审员 修1 */
  8022. router.route("/updateReviewer").get((req, res, next) => {
  8023. var json = queryString(req.url);
  8024. getmysql2(
  8025. req,
  8026. res,
  8027. "updateReviewer",
  8028. json["n"],
  8029. json["p"],
  8030. json["t"],
  8031. json["s"],
  8032. json["uid"]
  8033. );
  8034. });
  8035. //race 查询学校
  8036. router.route("/getSchool1").all((req, res, next) => {
  8037. var json = queryString(req.url);
  8038. getmysql(req, res, "getSchool1", json["n"]);
  8039. });
  8040. //查询赛事项目列表
  8041. router.route("/selectRaceList1").all((req, res, next) => {
  8042. var json = queryString(req.url);
  8043. getmysql(req, res, "selectRaceList1", json["uid"], json["t"], json["oid"], json["org"]);
  8044. });
  8045. //修改赛事状态 修1
  8046. router.route("/updateRaceStateGM").get((req, res, next) => {
  8047. var json = queryString(req.url);
  8048. getmysql2(req, res, "updateRaceStateGM", json["id"], json["s"]);
  8049. });
  8050. //删除1案例
  8051. router.route("/deleteAnliGM").all((req, res, next) => {
  8052. var json = queryString(req.url);
  8053. getmysql2(req, res, "deleteAnliGM", json["id"]);
  8054. });
  8055. //新增赛事项目
  8056. router.route("/addRaceGM").all((req, res, next) => {
  8057. if (req.body[0]) {
  8058. p = [
  8059. req.body[0].uid,
  8060. req.body[0].info,
  8061. req.body[0].over,
  8062. req.body[0].pro,
  8063. req.body[0].act,
  8064. req.body[0].exc,
  8065. req.body[0].res,
  8066. ];
  8067. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addRaceGM"); //執行存儲過程
  8068. mysql.usselect(p, function(ret) {
  8069. let course = req.body[0].courseType;
  8070. let courseId = ret[0][0].id;
  8071. let userid = req.body[0].uid;
  8072. delCourseType1(course, courseId, userid);
  8073. res.end(JSON.stringify({ courseId: courseId, success: 1 }));
  8074. });
  8075. }
  8076. });
  8077. //修改赛事项目
  8078. router.route("/updateRaceGM").all((req, res, next) => {
  8079. if (req.body[0]) {
  8080. p = [
  8081. req.body[0].id,
  8082. req.body[0].info,
  8083. req.body[0].over,
  8084. req.body[0].pro,
  8085. req.body[0].act,
  8086. req.body[0].exc,
  8087. req.body[0].res,
  8088. ];
  8089. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateRaceGM"); //執行存儲過程
  8090. mysql.usselect(p, function(ret) {
  8091. let course = req.body[0].courseType;
  8092. let courseId = req.body[0].id;
  8093. let userid = req.body[0].uid;
  8094. delCourseType1(course, courseId, userid);
  8095. res.end(JSON.stringify({ success: 1 }));
  8096. });
  8097. }
  8098. });
  8099. //查询赛事项目详情
  8100. router.route("/selectRaceDetailGM").all((req, res, next) => {
  8101. var json = queryString(req.url);
  8102. getmysql(req, res, "selectRaceDetailGM", json["id"]);
  8103. });
  8104. //查询赛事项目详情
  8105. router.route("/selectRaceDetailGM2").all((req, res, next) => {
  8106. var json = queryString(req.url);
  8107. getmysql(req, res, "selectRaceDetailGM2", json["id"]);
  8108. });
  8109. //查询赛事分类及子分类
  8110. router.route("/selectMatTypeGM").all((req, res, next) => {
  8111. var json = queryString(req.url);
  8112. getmysql(req, res, "selectMatTypeGM");
  8113. });
  8114. //添加资源库分类
  8115. router.route("/addSourceFileType").all((req, res, next) => {
  8116. postmysql(req, res, "addSourceFileType");
  8117. });
  8118. //查询资源库分类
  8119. router.route("/getSourceFileType").all((req, res, next) => {
  8120. var json = queryString(req.url);
  8121. getmysql(req, res, "getSourceFileType", json["uid"]);
  8122. });
  8123. //删除资源库分类
  8124. router.route("/deleteSoureFileType").all((req, res, next) => {
  8125. postmysql(req, res, "deleteSoureFileType");
  8126. });
  8127. //修改资源库分类名字
  8128. router.route("/updateSourceFileName").all((req, res, next) => {
  8129. postmysql(req, res, "updateSourceFileName");
  8130. });
  8131. //修改资源库分类父级
  8132. router.route("/updateSourceFileTypePid").all((req, res, next) => {
  8133. postmysql(req, res, "updateSourceFileTypePid");
  8134. });
  8135. //添加资源库
  8136. router.route("/addSourceFile").all((req, res, next) => {
  8137. postmysql(req, res, "addSourceFile");
  8138. });
  8139. //查询资源库上传文件
  8140. router.route("/getSourceFile").all((req, res, next) => {
  8141. var json = queryString(req.url);
  8142. getmysql(req, res, "getSourceFile", json["uid"], json["pid"], json["n"]);
  8143. });
  8144. //删除资源库
  8145. router.route("/deleteSourceFile").all((req, res, next) => {
  8146. postmysql(req, res, "deleteSourceFile");
  8147. });
  8148. //移动资源库
  8149. router.route("/updateSourceFilePid").all((req, res, next) => {
  8150. postmysql(req, res, "updateSourceFilePid");
  8151. });
  8152. //查询资源库上传文件
  8153. router.route("/getCourseInfoTest").all((req, res, next) => {
  8154. var json = queryString(req.url);
  8155. getmysql(req, res, "getCourseInfoTest", json["cid"]);
  8156. });
  8157. //查看已经的作业
  8158. router.route("/selectTestWorksCid").all((req, res, next) => {
  8159. var json = queryString(req.url);
  8160. getmysql(req, res, "selectTestWorksCid", json["cid"], json["uid"]);
  8161. });
  8162. //查询资源库上传文件
  8163. router.route("/getCourseInfoTestAll").all((req, res, next) => {
  8164. var json = queryString(req.url);
  8165. getmysql(req, res, "getCourseInfoTestAll", json["cid"]);
  8166. });
  8167. //查询资源库上传文件
  8168. router.route("/getCourseInfoTestAll2").all((req, res, next) => {
  8169. postmysql(req, res, "getCourseInfoTestAll");
  8170. });
  8171. //还原课程功能
  8172. router.route("/revertCourse").all((req, res, next) => {
  8173. postmysql(req, res, "revertCourse");
  8174. });
  8175. //还原课程功能
  8176. router.route("/revertCourseSz").all((req, res, next) => {
  8177. postmysql2(req, res, "revertCourse");
  8178. });
  8179. //根据课程id查询关联的表单
  8180. router.route("/selectTestCourseByCid").all((req, res, next) => {
  8181. var json = queryString(req.url);
  8182. getmysql(req, res, "selectTestCourseByCid", json["cid"]);
  8183. });
  8184. //qgt 根据用户id和文件标题获取答案来自动填写
  8185. router.route("/selectTestCourseAutoFillType3").all((req,res,next)=>{
  8186. var json = queryString(req.url);
  8187. getmysql(req, res, "selectTestCourseAutoFillType3", json["uid"],json["tit"]);
  8188. });
  8189. //qgt 课堂观察另存为模板
  8190. router.route("/insertClassroomTemplate").all((req,res,next)=>{
  8191. postmysql(req, res, "insertClassroomTemplate");
  8192. })
  8193. //qgt 课堂观察获取模板
  8194. router.route("/selectClassroomTemplate").all((req,res,next)=>{
  8195. var json = queryString(req.url);
  8196. getmysql(req, res, "selectClassroomTemplate", json["uid"],json["txt"],json["sub"],json["type1"]);
  8197. })
  8198. //qgt 课堂观察修改收藏模板
  8199. router.route("/updateClassroomTemplateCollect").all((req,res,next)=>{
  8200. postmysql(req, res, "updateClassroomTemplateCollect");
  8201. })
  8202. //qgt 课堂观察获取模板详细
  8203. router.route("/selectClassroomTemplateDetail").all((req,res,next)=>{
  8204. var json = queryString(req.url);
  8205. getmysql(req, res, "selectClassroomTemplateDetail", json["uid"],json["cid"],json['st']);
  8206. })
  8207. //qgt 课堂观察修改模板
  8208. router.route("/updateClassroomTemplateData").all((req,res,next)=>{
  8209. postmysql(req, res, "updateClassroomTemplateData");
  8210. })
  8211. //qgt设置用户默认模板
  8212. router.route("/updateClassroomDefault").all((req,res,next)=>{
  8213. postmysql(req, res, "updateClassroomDefault");
  8214. })
  8215. //qgt 获取用户默认模板
  8216. router.route("/selectClassroomDefault").all((req,res,next)=>{
  8217. var json = queryString(req.url);
  8218. getmysql(req, res, "selectClassroomDefault", json["uid"]);
  8219. })
  8220. //qgt 保存课堂助手任务面板题目
  8221. router.route("/updateCourseWorks_classRoomHelper").all((req,res,next)=>{
  8222. postmysql(req, res, "updateCourseWorks_classRoomHelper");
  8223. })
  8224. //qgt 获取课堂助手任务面板题目
  8225. router.route("/select_courseWorks_classRoomHelper").all((req,res,next)=>{
  8226. var json = queryString(req.url);
  8227. getmysql(req, res, "select_courseWorks_classRoomHelper", json["uid"],json["cid"]);
  8228. })
  8229. //qgt 获取课堂助手中当前课程所有做了选择题的数据
  8230. router.route("/select_courseWorksAll_classRoomHelper").all((req,res,next)=>{
  8231. var json = queryString(req.url);
  8232. getmysql(req, res, "select_courseWorksAll_classRoomHelper", json["uid"],json["cid"]);
  8233. })
  8234. //qgt 课堂助手倒计时面板插入数据
  8235. router.route("/insert_systemOperation_classRoomHelper").all((req,res,next)=>{
  8236. postmysql(req, res, "insert_systemOperation_classRoomHelper");
  8237. })
  8238. //qgt 课堂助手行为备忘(添加)
  8239. router.route("/insert_systemOperation_countdownBehavior").all((req,res,next)=>{
  8240. postmysql(req,res,'insert_systemOperation_countdownBehavior')
  8241. })
  8242. //lsc 课程管理行为备忘(添加)
  8243. router.route("/addCourseBehavior").all((req,res,next)=>{
  8244. console.log(req.body[0].content)
  8245. postmysql(req,res,'addCourseBehavior')
  8246. })
  8247. //qgt 课堂助手行为备忘(获取)
  8248. router.route("/select_systemOperation_countdownBehavior").all((req,res,next)=>{
  8249. var json = queryString(req.url);
  8250. getmysql(req, res, "select_systemOperation_countdownBehavior", json["uid"],json["courseId"]);
  8251. })
  8252. //qgt 课堂观察新建模板分析
  8253. router.route("/insert_smodel").all((req,res,next)=>{
  8254. postmysql(req,res,'insert_smodel')
  8255. })
  8256. //qgt 课堂观察获取用户的模板分析
  8257. router.route('/select_smodel').all((req,res,next)=>{
  8258. var json = queryString(req.url);
  8259. getmysql(req, res, "select_smodel", json["uid"]);
  8260. })
  8261. //qgt 课堂观察获取指定的分析
  8262. router.route('/select_smodelById').all((req,res,next)=>{
  8263. var json = queryString(req.url);
  8264. getmysql(req, res, "select_smodelById", json["uid"],json["mid"]);
  8265. })
  8266. //qgt 课堂观察删除指定模块
  8267. router.route("/delete_smodelById").all((req,res,next)=>{
  8268. postmysql(req,res,'delete_smodelById')
  8269. })
  8270. //qgt 课堂观察修改指定模块
  8271. router.route("/update_smodel").all((req,res,next)=>{
  8272. postmysql(req,res,'update_smodel')
  8273. })
  8274. //qgt 教师画像面板获取数据
  8275. router.route('/selectPortraitData').all((req,res,next)=>{
  8276. var json = queryString(req.url);
  8277. getmysql(req, res, "selectPortraitData", json["uid"]);
  8278. })
  8279. //qgt 修改testCourse的Cover字段
  8280. router.route('/update_testCourseCoverById').all((req,res,next)=>{
  8281. postmysql(req,res,'update_testCourseCoverById')
  8282. })
  8283. //qgt 修改课程的分屏数据
  8284. router.route('/update_courseSplitScreenData').all((req,res,next)=>{
  8285. postmysql(req,res,'update_courseSplitScreenData')
  8286. })
  8287. //qgt 获取课程的分屏数据
  8288. router.route('/select_courseSplitScreenData').all((req,res,next)=>{
  8289. var json = queryString(req.url);
  8290. getmysql(req, res, "select_courseSplitScreenData", json["cid"]);
  8291. })
  8292. //qgt 应用管理-添加类型
  8293. router.route('/insert_appStoreType').all((req,res,next)=>{
  8294. postmysql(req,res,'insert_appStoreType')
  8295. })
  8296. //qgt 应用管理-获取类型
  8297. router.route('/select_appStoreType').all((req,res,next)=>{
  8298. var json = queryString(req.url);
  8299. getmysql(req, res, "select_appStoreType", json["suserid"],json["sorg"],json["soid"],json["sstand"]);
  8300. })
  8301. //qgt 应用管理-获取类型-不获取某些类型
  8302. router.route('/select_appStoreType_exceptType').all((req,res,next)=>{
  8303. var json = queryString(req.url);
  8304. getmysql(req, res, "select_appStoreType_exceptType", json["suserid"],json["sorg"],json["soid"],json["sstand"],json["exportType"]);
  8305. })
  8306. //qgt 应用管理-添加应用
  8307. router.route('/insert_appStore').all((req,res,next)=>{
  8308. postmysql(req, res, "insert_appStore");
  8309. })
  8310. //qgt 应用管理-添加应用
  8311. router.route('/insert_appStoreJson').all((req,res,next)=>{
  8312. postmysql3(req, res, "insert_appStore");
  8313. })
  8314. //qgt 应用管理-获取应用
  8315. router.route('/select_appStore').all((req,res,next)=>{
  8316. var json = queryString(req.url);
  8317. getmysql(req, res, "select_appStore", json["uid"],json["name"],json["label"],json["type"],json["juri"],json["stand"],json['status']);
  8318. })
  8319. router.route('/select_appStore_exportType').all((req,res,next)=>{
  8320. var json = queryString(req.url);
  8321. getmysql(req, res, "select_appStore_exportType", json["uid"],json["name"],json["label"],json["type"],json["juri"],json["stand"],json['status'],json["exportType"]);
  8322. })
  8323. router.route('/select_appStore_exportType2').all((req,res,next)=>{
  8324. var json = queryString(req.url);
  8325. getmysql(req, res, "select_appStore_exportType2", json["uid"],json["name"],json["label"],json["type"],json["juri"],json["stand"],json['status'],json['model'],json["exportType"]);
  8326. })
  8327. //qgt 应用管理-修改应用
  8328. router.route('/update_appStore').all((req,res,next)=>{
  8329. postmysql(req, res, "update_appStore");
  8330. })
  8331. //qgt 应用管理-修改应用
  8332. router.route('/update_appStoreJson').all((req,res,next)=>{
  8333. postmysql3(req, res, "update_appStore");
  8334. })
  8335. //qgt 应用管理-添加收藏或者最近使用
  8336. router.route('/insert_appStoreSave').all((req,res,next)=>{
  8337. postmysql(req, res, "insert_appStoreSave");
  8338. })
  8339. //qgt 应用管理-获取收藏或者最近使用
  8340. router.route('/select_appStoreSave').all((req,res,next)=>{
  8341. var json = queryString(req.url);
  8342. getmysql(req, res, "select_appStoreSave", json["uid"],json["type"],json["limit"]);
  8343. })
  8344. //qgt 应用管理-取消收藏
  8345. router.route('/delete_appStoreSave').all((req,res,next)=>{
  8346. postmysql(req, res, "delete_appStoreSave");
  8347. })
  8348. //qgt 应用管理-删除应用
  8349. router.route('/delete_appStore').all((req,res,next)=>{
  8350. postmysql(req,res,"delete_appStore")
  8351. })
  8352. //qgt 应用管理-删除应用
  8353. router.route('/delete_appStoreJson').all((req,res,next)=>{
  8354. postmysql3(req,res,"delete_appStore")
  8355. })
  8356. //qgt banner获取
  8357. router.route('/select_bannerByoidORorg').all((req,res,next)=>{
  8358. var json = queryString(req.url);
  8359. getmysql(req, res, "select_bannerByoidORorg", json["uid"],json["oid"],json["org"],json["type"]);
  8360. })
  8361. //qgt 获取单个应用
  8362. router.route("/select_appStoreById").all((req,res,next)=>{
  8363. var json = queryString(req.url);
  8364. getmysql(req, res, "select_appStoreById", json["uid"],json["aid"]);
  8365. })
  8366. //qgt 获取应用中心得控制json
  8367. router.route("/select_appStore_controls").all((req,res,next)=>{
  8368. var json = queryString(req.url);
  8369. getmysql(req, res, "select_appStore_controls", json["uid"],json["org"],json["oid"]);
  8370. })
  8371. //qgt 教师中心-获取表单数据
  8372. router.route("/getTestWorksPerson_2type").all((req,res,next)=>{
  8373. var json = queryString(req.url);
  8374. getmysql(req, res, "getTestWorksPerson_2type", json["uid"], json["typeid"]);
  8375. })
  8376. //qgt sass管理平台-按表单查看
  8377. router.route("/selectTesttCourse_sass").all((req,res,next)=>{
  8378. var json = queryString(req.url);
  8379. getmysql(req, res, "selectTesttCourse_sass", json["uid"], json["type"],json["oid"],json["org"],json["typeId"],json["textValue"]);
  8380. })
  8381. //qgt sass管理平台-按人员查看
  8382. router.route("/selectTesttCourse2_sass").all((req,res,next)=>{
  8383. var json = queryString(req.url);
  8384. getmysql(req, res, "selectTesttCourse2_sass",json["oid"],json["org"],json["typeId"],json["textValue"]);
  8385. })
  8386. //qgt 根据oid获取是那个地区的
  8387. router.route("/select_oidArea").all((req,res,next)=>{
  8388. var json = queryString(req.url);
  8389. getmysql(req, res, "select_oidArea", json["oid"]);
  8390. })
  8391. //qgt 应用中心获取AppStoreJuri
  8392. router.route("/select_appStorJuri").all((req,res,next)=>{
  8393. var json = queryString(req.url);
  8394. getmysql(req, res, "select_appStorJuri");
  8395. })
  8396. //qgt 应用中心获取AppStoreJuri
  8397. router.route("/select_userIsAdmin").all((req,res,next)=>{
  8398. var json = queryString(req.url);
  8399. getmysql(req, res, "select_userIsAdmin", json["userId"]);
  8400. })
  8401. //qgt 课堂观察-添加任务
  8402. router.route('/insert_classroomTask').all((req,res,next)=>{
  8403. postmysql(req, res, "insert_classroomTask");
  8404. })
  8405. //qgt 课堂观察-删除任务
  8406. router.route('/delete_classroomTask').all((req,res,next)=>{
  8407. postmysql(req, res, "delete_classroomTask");
  8408. })
  8409. //qgt 课堂观察-修改任务
  8410. router.route('/update_classroomTask').all((req,res,next)=>{
  8411. postmysql(req, res, "update_classroomTask");
  8412. })
  8413. //qgt 课堂观察-查询任务
  8414. router.route('/select_classroomTask').all((req,res,next)=>{
  8415. var json = queryString(req.url);
  8416. getmysql(req, res, "select_classroomTask", json["userId"]);
  8417. })
  8418. //qgt 教学模式-添加应用
  8419. router.route("/insert_teachingMode").all((req,res,next)=>{
  8420. postmysql(req, res, "insert_teachingMode");
  8421. })
  8422. //qgt 教学模式-获取应用
  8423. router.route("/select_teachingMode").all((req,res,next)=>{
  8424. var json = queryString(req.url);
  8425. getmysql(req, res, "select_teachingMode", json["uid"],json["jur"],json["type"],json["model"],json["status"],json["search"]);
  8426. })
  8427. //qgt 教学模式-修改应用
  8428. router.route("/update_teachingMode").all((req,res,next)=>{
  8429. postmysql(req, res, "update_teachingMode");
  8430. })
  8431. //qgt 教学模式-获取单个应用详细数据
  8432. router.route("/select_teachingModeById").all((req,res,next)=>{
  8433. var json = queryString(req.url);
  8434. getmysql(req, res, "select_teachingModeById", json["uid"],json["tid"]);
  8435. })
  8436. //qgt 通过idList获取班级数据
  8437. router.route("/select_ClassByidList").all((req,res,next)=>{
  8438. var json = queryString(req.url);
  8439. getmysql(req, res, "select_ClassByidList", json["idList"]);
  8440. })
  8441. //qgt 教学空间-获取学生列表 也可以获取单个学生的数据
  8442. router.route("/select_teachingModeWorks").all((req,res,next)=>{
  8443. var json = queryString(req.url);
  8444. getmysql(req, res, "select_teachingModeWorks", json["uid"],json["tid"],json["sid"]);
  8445. })
  8446. //qgt 教学空间-插入学生数据
  8447. router.route("/insert_teachingModeWorks").all((req,res,next)=>{
  8448. postmysql(req, res, "insert_teachingModeWorks");
  8449. })
  8450. //qgt 教学空间-修改学生状态
  8451. router.route("/update_teachingModeWorks_statusAndOperatingById").all((req,res,next)=>{
  8452. postmysql(req, res, "update_teachingModeWorks_statusAndOperatingById");
  8453. })
  8454. //qgt 教学空间-通过app的id获取教学的数据
  8455. router.route("/select_teachingModeByAppUrlAndClassId").all((req,res,next)=>{
  8456. var json = queryString(req.url);
  8457. getmysql(req, res, "select_teachingModeByAppUrlAndClassId", json["uid"],json["appUrl"]);
  8458. })
  8459. //qgt 教学空间-修改学生对话数据
  8460. router.route("/update_teachingModeWorks_nodeDataAndStageAndLastChatById").all((req,res,next)=>{
  8461. postmysql(req, res, "update_teachingModeWorks_nodeDataAndStageAndLastChatById");
  8462. })
  8463. //qgt 个人空间-资料提交-修改提交的表单名称
  8464. router.route("/update_testCourseWorksNameById").all((req,res,next)=>{
  8465. postmysql(req, res, "update_testCourseWorksNameById");
  8466. })
  8467. //qgt 教学空间-删除数据
  8468. router.route("/clear_teachingMode").all((req,res,next)=>{
  8469. postmysql(req, res, "clear_teachingMode");
  8470. })
  8471. //qgt 教学空间-删除应用
  8472. router.route("/update_teachingModeIsDelete").all((req,res,next)=>{
  8473. postmysql(req, res, "update_teachingModeIsDelete");
  8474. })
  8475. //qgt 教学空间-删除学生
  8476. router.route("/delete_teachingModeWorksById").all((req,res,next)=>{
  8477. postmysql(req, res, "delete_teachingModeWorksById");
  8478. })
  8479. //qgt 教学空间-aiChat-修改学生总结
  8480. router.route("/update_teachingModeWorks_summaryById").all((req,res,next)=>{
  8481. postmysql(req, res, "update_teachingModeWorks_summaryById");
  8482. })
  8483. //qgt 课程管理-ppt模式添加课程
  8484. router.route("/insert_teacher_work_pptCourse").all((req, res, next) => {
  8485. if (req.body[0]) {
  8486. p = [
  8487. req.body[0].uid,
  8488. req.body[0].title,
  8489. req.body[0].brief,
  8490. req.body[0].cover,
  8491. req.body[0].evaId,
  8492. req.body[0].astudent,
  8493. req.body[0].see,
  8494. req.body[0].chapters,
  8495. req.body[0].template,
  8496. req.body[0].ateacher,
  8497. ];
  8498. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_pptCourse"); //執行存儲過程
  8499. mysql.usselect(p, function(ret) {
  8500. let course = req.body[0].courseType;
  8501. let courseId = ret[0][0].courseId;
  8502. let userid = req.body[0].uid;
  8503. delCourseType(course, courseId, userid);
  8504. res.end(
  8505. JSON.stringify({
  8506. ordernumber: ret[0][0].ordernumber,
  8507. courseId: ret[0][0].courseId,
  8508. success: 1,
  8509. })
  8510. );
  8511. });
  8512. }
  8513. });
  8514. //qgt 课程管理-单独修改课程的chapters
  8515. router.route("/update_course_chapters").all((req,res,next)=>{
  8516. postmysql(req, res, "update_teacher_work_new4");
  8517. })
  8518. //qgt 课程管理-添加workPage数据
  8519. router.route("/insert_workPage").all((req,res,next)=>{
  8520. postmysql(req, res, "insert_workPage");
  8521. })
  8522. //qgt workPage查询作业
  8523. router.route("/select_workPageById").all((req,res,next)=>{
  8524. var json = queryString(req.url);
  8525. getmysql(req, res, "select_workPageById", json["id"]);
  8526. })
  8527. //qgt workPage上传作业
  8528. router.route("/addCourseWorks_workPage").all((req,res,next)=>{
  8529. postmysql(req, res, "addCourseWorks_workPage");
  8530. })
  8531. //qgt workPage获取作业
  8532. router.route("/select_courseWorks_workPageData").all((req,res,next)=>{
  8533. var json = queryString(req.url);
  8534. getmysql(req, res, "select_courseWorks_workPageData", json["uid"],json["cid"], json["stage"],json["task"], json["tool"]);
  8535. })
  8536. //qgt Class根据parentid获取数据
  8537. router.route("/select_ClassByParentid").all((req,res,next)=>{
  8538. var json = queryString(req.url);
  8539. getmysql(req, res, "select_ClassByParentid", json["pid"]);
  8540. })
  8541. //qgt 年度考核-教师发展获取数据来源表单标题-筛选时间
  8542. router.route("/selectExamineTestNameFilterTime").all(function(req, res, next) {
  8543. // var json = queryString(req.url);
  8544. // console.log(json);
  8545. postmysql(req, res, "selectExamineTestNameFilterTime");
  8546. // getmysql(req, res, "selectExamineTestName", json["testId"]);
  8547. });
  8548. //教师管理 查看填写范围的教师权限
  8549. router.route("/getTestWorkTeacherCount").all((req,res,next)=>{
  8550. postmysql(req, res, "getTestWorkTeacherCount");
  8551. })
  8552. //查询教师权限
  8553. router.route('/getTypeTeacher').all((req,res,next)=>{
  8554. var json = queryString(req.url);
  8555. getmysql(req, res, "getTypeTeacher", json["cid"], json["name"], json["userid"]);
  8556. })
  8557. //删除会话记录
  8558. router.route("/deleteChat").all((req,res,next)=>{
  8559. postmysql(req, res, "deleteChat"); // id 会话id
  8560. })
  8561. //添加会话记录
  8562. router.route("/addChat").all((req,res,next)=>{
  8563. postmysql(req, res, "addChat"); // uid 用户id n 会话名称 cid chatid
  8564. })
  8565. //修改会话记录 重命名
  8566. router.route("/updateChat").all((req,res,next)=>{
  8567. postmysql(req, res, "updateChat"); // id 会话id n 会话名称
  8568. })
  8569. //获取会话记录
  8570. router.route('/getChatHistory').all((req,res,next)=>{
  8571. var json = queryString(req.url);
  8572. getmysql(req, res, "getChatHistory", json["uid"], json["n"], json["page"], json["num"]); //用户id,会话名称,页码,页数
  8573. })
  8574. //本地调用
  8575. router.route("/localPost").all((req,res,next)=>{
  8576. postmysqlLocal(req, res);
  8577. })
  8578. //本地调用
  8579. router.route("/onlinePost").all((req,res,next)=>{
  8580. postmysqlOnline(req, res);
  8581. })
  8582. //修改课程设置
  8583. router.route("/updateWorksSetting").all((req,res,next)=>{
  8584. postmysql(req, res, "updateWorksSetting");
  8585. })
  8586. //新建文件夹
  8587. router.route("/addFolder").all((req,res,next)=>{
  8588. postmysql(req, res, "addFolder");
  8589. })
  8590. ///获取新建的文件夹
  8591. router.route("/getFolder").all((req,res,next)=>{
  8592. postmysql(req, res, "getFolder");
  8593. })
  8594. //获取新建的文件夹带分页
  8595. router.route("/getFolderPage").all((req,res,next)=>{
  8596. postmysql(req, res, "getFolderPage");
  8597. })
  8598. //删除文件夹
  8599. router.route("/deleteFolder").all((req,res,next)=>{
  8600. postmysql(req, res, "deleteFolder");
  8601. })
  8602. //查询tag
  8603. router.route("/getKnowledgeTag").all((req,res,next)=>{
  8604. postmysql(req, res, "getKnowledgeTag");
  8605. })
  8606. // 上传智能体模板
  8607. router.route("/insertAppTem").all((req,res,next)=>{
  8608. postmysql(req, res, "insertAppTem");
  8609. })
  8610. // 上传智能体模板
  8611. router.route("/insertAppTem2").all((req,res,next)=>{
  8612. postmysql(req, res, "insertAppTem2");
  8613. })
  8614. // 删除智能体模板
  8615. router.route("/deleteAppTem").all((req,res,next)=>{
  8616. postmysql(req, res, "deleteAppTem");
  8617. })
  8618. // 获取智能体模板
  8619. router.route("/selectAppTem").get((req, res, next) => {
  8620. var json = queryString(req.url);
  8621. getmysql2(req, res, "selectAppTem", json["oid"], json["type"]);
  8622. });
  8623. // 获取智能体模板
  8624. router.route("/selectAppTem2").get((req, res, next) => {
  8625. var json = queryString(req.url);
  8626. getmysql2(req, res, "selectAppTem2", json["oid"], json["type"], json["subject"]);
  8627. });
  8628. // 获取智能体模板
  8629. router.route("/selectAppTem3").get((req, res, next) => {
  8630. var json = queryString(req.url);
  8631. getmysql2(req, res, "selectAppTem3", json["oid"], json["type"], json["subject"], json["area"]);
  8632. });
  8633. // 获取智能体模板
  8634. router.route("/selectAppTemById").get((req, res, next) => {
  8635. var json = queryString(req.url);
  8636. getmysql2(req, res, "selectAppTemById", json["id"]);
  8637. });
  8638. //查询文件夹详情
  8639. router.route("/getKnowledgeDetail").all((req,res,next)=>{
  8640. postmysql(req, res, "getKnowledgeDetail");
  8641. })
  8642. //修改文件夹
  8643. router.route("/updateFolder").all((req,res,next)=>{
  8644. postmysql(req, res, "updateFolder");
  8645. })
  8646. //添加标签
  8647. router.route("/addTag").all((req,res,next)=>{
  8648. postmysql(req, res, "addTag");
  8649. })
  8650. //删除标签
  8651. router.route("/deleteTag").all((req,res,next)=>{
  8652. postmysql(req, res, "deleteTag");
  8653. })
  8654. //添加上传好的知识库文件
  8655. router.route("/addFile").all((req,res,next)=>{
  8656. postmysql(req, res, "add_file");
  8657. })
  8658. //notebookllm
  8659. router.route("/add_llm").all((req,res,next)=>{
  8660. postmysql(req, res, "add_llm");
  8661. })
  8662. router.route("/upload_llm_file").all((req,res,next)=>{
  8663. postmysql(req, res, "upload_llm_file");
  8664. })
  8665. router.route("/update_llm_title").all((req,res,next)=>{
  8666. postmysql(req, res, "update_llm_title");
  8667. })
  8668. router.route("/delete_llm").all((req,res,next)=>{
  8669. postmysql(req, res, "delete_llm");
  8670. })
  8671. router.route("/get_all_llm").all((req,res,next)=>{
  8672. var json = queryString(req.url);
  8673. getmysql2(req, res, "get_all_llm", json["uid"]);
  8674. })
  8675. router.route("/get_llm").all((req,res,next)=>{
  8676. var json = queryString(req.url);
  8677. getmysql2(req, res, "get_llm", json["id"]);
  8678. })
  8679. router.route("/get_llm_chat").all((req,res,next)=>{
  8680. var json = queryString(req.url);
  8681. getmysql2(req, res, "get_llm_chat", json["id"]);
  8682. })
  8683. router.route("/add_llm_chat").all((req,res,next)=>{
  8684. postmysql(req, res, "add_llm_chat");
  8685. })
  8686. router.route("/delete_llm_chat").all((req,res,next)=>{
  8687. postmysql(req, res, "delete_llm_chat");
  8688. })
  8689. router.route("/add_llm_note").all((req,res,next)=>{
  8690. postmysql(req, res, "add_llm_note");
  8691. })
  8692. router.route("/update_llm_note_title").all((req,res,next)=>{
  8693. postmysql(req, res, "update_llm_note_title");
  8694. })
  8695. router.route("/update_llm_note_detail").all((req,res,next)=>{
  8696. postmysql(req, res, "update_llm_note_detail");
  8697. })
  8698. router.route("/delete_llm_note").all((req,res,next)=>{
  8699. postmysql(req, res, "delete_llm_note");
  8700. })
  8701. router.route("/get_all_llm_note").all((req,res,next)=>{
  8702. var json = queryString(req.url);
  8703. getmysql2(req, res, "get_all_llm_note", json["id"]);
  8704. })
  8705. router.route("/get_llm_note").all((req,res,next)=>{
  8706. var json = queryString(req.url);
  8707. getmysql2(req, res, "get_llm_note", json["id"]);
  8708. })
  8709. router.route("/get_llm_chat_id").all((req,res,next)=>{
  8710. var json = queryString(req.url);
  8711. getmysql2(req, res, "get_llm_chat_id", json["id"]);
  8712. })
  8713. router.route("/update_llm_chat_detail").all((req,res,next)=>{
  8714. postmysql(req, res, "update_llm_chat_detail");
  8715. })
  8716. router.route("/update_llm_chat_title").all((req,res,next)=>{
  8717. postmysql(req, res, "update_llm_chat_title");
  8718. })
  8719. router.route("/update_llm_role").all((req,res,next)=>{
  8720. postmysql(req, res, "update_llm_role");
  8721. })
  8722. router.route("/update_llm_sound").all((req,res,next)=>{
  8723. postmysql(req, res, "update_llm_sound");
  8724. })
  8725. router.route("/update_knowledgefile_detail").all((req,res,next)=>{
  8726. postmysql(req, res, "update_knowledgefile_detail");
  8727. })
  8728. //notebookllm
  8729. //获取智能体
  8730. router.route('/selectCoder').all((req,res,next)=>{
  8731. var json = queryString(req.url);
  8732. getmysql(req, res, "selectCoder", json["oid"],json["org"]);
  8733. })
  8734. function generateAPIKey(username) {
  8735. let timeStamp = new Date().getTime();
  8736. let hashStr = timeStamp + username;
  8737. let digest = crypto
  8738. .createHash("sha256")
  8739. .update(hashStr, "utf8")
  8740. .digest("hex");
  8741. return digest;
  8742. }
  8743. queryString = function(url) {
  8744. var a = url.split("?");
  8745. var json = querystring.parse(a[1]);
  8746. return json;
  8747. };
  8748. //post存儲過程處理
  8749. postmysql = function(req, res, functionname) {
  8750. //mode的處理
  8751. if (req.body[0]) {
  8752. p = Object.values(req.body[0]);
  8753. p.unshift(_mysqlLabor[0], _mysqlLabor[1], functionname);
  8754. //執行存儲過程
  8755. mysql.usselect(p, function(ret) {
  8756. res.end(JSON.stringify(ret));
  8757. });
  8758. }
  8759. };
  8760. //post存儲過程處理
  8761. postmysql2 = function(req, res, functionname) {
  8762. //mode的處理
  8763. if (req.body) {
  8764. p = Object.values(req.body)[0].split(",");
  8765. p.unshift(_mysqlLabor[0], _mysqlLabor[1], functionname);
  8766. //執行存儲過程
  8767. mysql.usselect(p, function(ret) {
  8768. res.end(JSON.stringify(ret));
  8769. });
  8770. }
  8771. };
  8772. //post存儲過程處理
  8773. postmysql3 = function(req, res, functionname) {
  8774. //mode的處理
  8775. if (req.body) {
  8776. p = Object.values(req.body);
  8777. p.unshift(_mysqlLabor[0], _mysqlLabor[1], functionname);
  8778. //執行存儲過程
  8779. mysql.usselect(p, function(ret) {
  8780. res.end(JSON.stringify(ret));
  8781. });
  8782. }
  8783. };
  8784. //get獲取數據庫信息
  8785. getmysql = function(req, res, functionname, ...p) {
  8786. p = p || [];
  8787. p.unshift(_getmysqlLabor[0], _getmysqlLabor[1], functionname);
  8788. //執行存儲過程
  8789. mysql.usselect(p, function(ret) {
  8790. res.end(JSON.stringify(ret));
  8791. }); //
  8792. };
  8793. //get獲取數據庫信息
  8794. getmysql2 = function(req, res, functionname, ...p) {
  8795. p = p || [];
  8796. p.unshift(_mysqlLabor[0], _mysqlLabor[1], functionname);
  8797. //執行存儲過程
  8798. mysql.usselect(p, function(ret) {
  8799. res.end(JSON.stringify(ret));
  8800. }); //
  8801. };
  8802. //get獲取數據庫信息
  8803. getmysql3 = function(req, res, functionname, ...p) {
  8804. p = p || [];
  8805. p.unshift(_getmysqlLabor2[0], _getmysqlLabor2[1], functionname);
  8806. //執行存儲過程
  8807. mysql.usselect(p, function(ret) {
  8808. res.end(JSON.stringify(ret));
  8809. }); //
  8810. };
  8811. //post存储过程处理
  8812. userpostmysql = function(req, res, functionname) {
  8813. //mode的处理
  8814. if (req.body.mode) {
  8815. p = req.body.mode.split(",");
  8816. p.unshift(_mysqluser[0], _mysqluser[1], functionname);
  8817. //执行存储过程
  8818. mysql.usselect(p, function(ret) {
  8819. res.end(JSON.stringify(ret));
  8820. });
  8821. }
  8822. };
  8823. //get获取数据库信息
  8824. usergetmysql = function(req, res, functionname, ...p) {
  8825. p = p || [];
  8826. p.unshift(_mysqluser[0], _mysqluser[1], functionname);
  8827. //执行存储过程
  8828. mysql.usselect(p, function(ret) {
  8829. res.end(JSON.stringify(ret));
  8830. }); //
  8831. };
  8832. //post存儲過程處理
  8833. postmysqlLocal = function(req, res) {
  8834. //mode的處理
  8835. if (req.body[0]) {
  8836. p = Object.values(req.body[0]);
  8837. p.unshift(_localhost[0], _localhost[1]);
  8838. //執行存儲過程
  8839. mysql.usselect(p, function(ret) {
  8840. res.end(JSON.stringify(ret));
  8841. });
  8842. }
  8843. };
  8844. postmysqlOnline = function(req, res) {
  8845. //mode的處理
  8846. if (req.body[0]) {
  8847. p = Object.values(req.body[0]);
  8848. p.unshift(_mysqlLabor[0], _mysqlLabor[1]);
  8849. //執行存儲過程
  8850. mysql.usselect(p, function(ret) {
  8851. res.end(JSON.stringify(ret));
  8852. });
  8853. }
  8854. };
  8855. module.exports = router;