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