pbl.js 248 KB

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