pbl.js 290 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578
  1. // ROUTES FOR OUR APIselectClassStudent
  2. // =============================================================================
  3. var express = require("express");
  4. var request = require("request");
  5. var bcrypt = require("bcryptjs");
  6. var router = express.Router(); // get an instance of the express Router
  7. const querystring = require("querystring");
  8. var mysql = require("./mysql");
  9. //=====================================
  10. // 本地
  11. // const _mysqlLabor = ["183.36.25.93", "pbl"]; //edu數據庫信息
  12. // const _mysqluser = ["183.36.25.93", "cocorobouser"]; //用户数据库信息
  13. // const _getmysqlLabor2 = ["183.36.25.93", "pbl"]; //edu數據庫信息
  14. // const _getmysqlLabor = ["183.36.25.93", "pbl"]; //edu數據庫信息
  15. //线上
  16. const _mysqlLabor = ["172.16.12.5", "pbl"]; //edu數據庫信息
  17. const _mysqluser = ["172.16.12.5", "cocorobouser"]; //edu數據庫信息
  18. const _getmysqlLabor2 = ["172.16.12.7", "pbl"]; //edu數據庫信息
  19. const _getmysqlLabor = ["172.16.12.7", "pbl"]; //edu數據庫信息
  20. //======================================
  21. // const _mysqlLabor = ["183.36.25.93", "pbl"]; //edu數據庫信息
  22. // const _mysqluser = ["183.36.25.93", "cocorobouser"]; //用户数据库信息
  23. // const _getmysqlLabor = ["123.58.32.152", "pbl"]; //edu數據庫信息
  24. // const _getmysqluser = ["123.58.32.152", "cocorobouser"]; //edu數據庫信息
  25. // const _mysqlLabor = ["172.16.12.5", "pbl"]; //edu數據庫信息
  26. // const _mysqluser = ["172.16.12.5", "cocorobouser"]; //edu數據庫信息
  27. // const _getmysqlLabor = ["172.16.12.5", "pbl"]; //edu數據庫信息
  28. // const _getmysqluser = ["172.16.12.5", "cocorobouser"]; //edu數據庫信息
  29. // const _getmysqlLabor2 = ["183.36.25.93", "pbl"]; //edu數據庫信息
  30. // const _getmysqlLabor = ["183.36.25.93", "pbl"]; //edu數據庫信息
  31. const _getmysqluser = ["172.16.12.7", "cocorobouser"]; //edu數據庫信息
  32. const _localhost = ["127.0.0.1", "pbl"]; //edu數據庫信息
  33. var crypto = require("crypto");
  34. var https = require("https");
  35. const { Pool } = require('pg');
  36. const axios = require('axios');
  37. const pool = new Pool({
  38. user: 'cocorobo',
  39. host: '34.228.204.21',
  40. database: 'cocorobo-postgres',
  41. password: 'cocorobo',
  42. port: 5433,
  43. max: 20000, // 设置最大连接数
  44. idleTimeoutMillis: 30000 // 设置空闲连接超时时间
  45. });
  46. async function calculateVectors(content) {
  47. try {
  48. const response = await axios.post('http://34.228.204.21:11434/api/embeddings', {
  49. "model": "smartcreation/bge-large-zh-v1.5",
  50. "prompt": `${content}`
  51. });
  52. const contentVector = response.data.embedding;
  53. return contentVector;
  54. } catch (error) {
  55. console.error('Error calculating vectors:', content);
  56. return null;
  57. }
  58. }
  59. async function findMatchingContents(discipline, content) {
  60. const contentVector = await calculateVectors(content);
  61. const formattedContentVector = contentVector.length > 0 ? `[` + contentVector.join(', ') + `]` : null;
  62. const client = await pool.connect();
  63. try {
  64. // 使用余弦相似度进行内容向量匹配
  65. const query = `
  66. SELECT title, id, content, file_url, file_type,
  67. 1 - (content_vector <#> $1::vector) AS contentSimilarity
  68. FROM (select file_type, file_url, title, id, content, content_vector from knowledgefiles as a where top_dir_id in (select id from directory_files where $2 = '' or folder_name = ANY(string_to_array($2, ',')))) as a
  69. ORDER BY contentSimilarity DESC
  70. LIMIT 5;
  71. `;
  72. const result = await client.query(query, [formattedContentVector, discipline]);
  73. /*
  74. console.log(result.rows);
  75. // 将查询结果转换为匹配对象
  76. const matches = result.rows.map(row => ({
  77. id: row.id,
  78. contentSimilarity: row.contentsimilarity
  79. }));
  80. console.log(matches);
  81. */
  82. return result.rows; // 返回匹配结果
  83. } catch (error) {
  84. console.error('Error finding matching contents:', error);
  85. return [];
  86. } finally {
  87. client.release(); // 确保释放数据库连接
  88. }
  89. }
  90. async function findMatchingContentsPage2(discipline, content, grade, page) {
  91. const contentVector = await calculateVectors(content);
  92. const formattedContentVector = contentVector.length > 0 ? `[` + contentVector.join(', ') + `]` : null;
  93. const offset = ((page || 1) - 1) * 5;
  94. const client = await pool.connect();
  95. try {
  96. // 使用余弦相似度进行内容向量匹配
  97. const query = `
  98. SELECT title, id, content, file_url, file_type,
  99. 1 - (content_vector <#> $1::vector) AS contentSimilarity
  100. FROM (select file_type, file_url, title, id, content, content_vector from knowledgefiles as a
  101. where ($2 = '' or a.parent_arr && (SELECT ARRAY_AGG(id)::text[] FROM directory_files WHERE folder_name = ANY(string_to_array($2, ','))))
  102. AND ($3 = '' or a.parent_arr && (SELECT ARRAY_AGG(id)::text[] FROM directory_files WHERE folder_name = ANY(string_to_array($3, ','))))) as a
  103. ORDER BY contentSimilarity DESC
  104. LIMIT 5 OFFSET $4;
  105. `;
  106. const result = await client.query(query, [formattedContentVector, discipline, grade, offset]);
  107. return result.rows; // 返回匹配结果
  108. } catch (error) {
  109. console.error('Error finding matching contents:', error);
  110. return [];
  111. } finally {
  112. client.release(); // 确保释放数据库连接
  113. }
  114. }
  115. async function findMatchingContentsPage3(discipline, content, grade, filetype, page) {
  116. const contentVector = await calculateVectors(content);
  117. const formattedContentVector = contentVector.length > 0 ? `[` + contentVector.join(', ') + `]` : null;
  118. const offset = ((page || 1) - 1) * 5;
  119. const client = await pool.connect();
  120. try {
  121. // 使用余弦相似度进行内容向量匹配
  122. const query = `
  123. SELECT id, content, file_type, file_url, title,
  124. 1 - (content_vector <#> $1::vector) AS contentSimilarity
  125. FROM (select file_url, title,id, content, content_vector, file_type from knowledgefiles as a
  126. where ($4 = '' or file_type = ANY(string_to_array($4, ','))) and ($2 = '' or a.parent_arr && (SELECT ARRAY_AGG(id)::text[] FROM directory_files WHERE folder_name = ANY(string_to_array($2, ','))))
  127. AND ($3 = '' or a.parent_arr && (SELECT ARRAY_AGG(id)::text[] FROM directory_files WHERE folder_name = ANY(string_to_array($3, ','))))) as a
  128. ORDER BY contentSimilarity DESC
  129. LIMIT 5 OFFSET $5;
  130. `;
  131. const result = await client.query(query, [formattedContentVector, discipline, grade, filetype, offset]);
  132. return result.rows; // 返回匹配结果
  133. } catch (error) {
  134. console.error('Error finding matching contents:', error);
  135. return [];
  136. } finally {
  137. client.release(); // 确保释放数据库连接
  138. }
  139. }
  140. async function findMatchingContentsPage(discipline, content, page) {
  141. const contentVector = await calculateVectors(content);
  142. const formattedContentVector = contentVector.length > 0 ? `[` + contentVector.join(', ') + `]` : null;
  143. const offset = ((page || 1) - 1) * 5;
  144. const client = await pool.connect();
  145. try {
  146. // 使用余弦相似度进行内容向量匹配
  147. const query = `
  148. SELECT title, id, content, file_url, file_type,
  149. 1 - (content_vector <#> $1::vector) AS contentSimilarity
  150. FROM (select file_type, file_url, title, id, content, content_vector from knowledgefiles as a where top_dir_id in
  151. (select id from directory_files where $2 = '' or folder_name = ANY(string_to_array($2, ',')))) as a
  152. ORDER BY contentSimilarity DESC
  153. LIMIT 5 OFFSET $3;
  154. `;
  155. const result = await client.query(query, [formattedContentVector, discipline, offset]);
  156. return result.rows; // 返回匹配结果
  157. } catch (error) {
  158. console.error('Error finding matching contents:', error);
  159. return [];
  160. } finally {
  161. client.release(); // 确保释放数据库连接
  162. }
  163. }
  164. /*检索文件*/
  165. router.route("/findMatchingContents").all(async (req, res, next) => {
  166. var json = queryString(req.url);
  167. console.log(json["type"], json["string"])
  168. const titleMatches = await findMatchingContents(json["type"], json["string"]);
  169. res.end(JSON.stringify(titleMatches));
  170. });
  171. /*检索文件*/
  172. router.route("/findMatchingContentsPage").all(async (req, res, next) => {
  173. var json = queryString(req.url);
  174. console.log(json["type"], json["string"])
  175. const titleMatches = await findMatchingContentsPage(json["type"], json["string"], json["page"]);
  176. res.end(JSON.stringify(titleMatches));
  177. });
  178. /*检索文件*/
  179. router.route("/findMatchingContentsPage2").all(async (req, res, next) => {
  180. var json = queryString(req.url);
  181. console.log(json["type"], json["string"])
  182. const titleMatches = await findMatchingContentsPage2(json["type"], json["string"], json["grade"], json["page"]);
  183. res.end(JSON.stringify(titleMatches));
  184. });
  185. /*检索文件*/
  186. router.route("/findMatchingContentsPage3").all(async (req, res, next) => {
  187. var json = queryString(req.url);
  188. const titleMatches = await findMatchingContentsPage3(json["type"], json["string"], json["grade"], json["filetype"], json["page"]);
  189. res.end(JSON.stringify(titleMatches));
  190. });
  191. //統壹處理區域
  192. router.use(async function(req, res, next) {
  193. await asynnext(req, res, next);
  194. //// make sure we go to the next routes and don't stop here
  195. //res.end("");
  196. });
  197. /**
  198. * @des 參數解釋同上
  199. */
  200. function asynnext(req, res, next) {
  201. //異步處理
  202. return new Promise(async(resolve, reject) => {
  203. next();
  204. //resolve(true);aa
  205. });
  206. }
  207. /*測試*/
  208. router.route("/a").all((req, res, next) => {
  209. var json = queryString(req.url);
  210. getmysql(req, res, "a", json["ph"], json["pa"]);
  211. });
  212. router.route("/b").all((req, res, next) => {
  213. var json = queryString(req.url);
  214. getmysql(req, res, "b", json["ph"], json["pa"]);
  215. });
  216. /* 注册接口 */
  217. router.route("/register").post(function(req, res, next) {
  218. //mode的处理
  219. if (req.body[0]) {
  220. // 0 用户名 1 用户密码 2用户身份 3 第三方id(可有可无)
  221. p = Object.values(req.body[0]); //获取用户密码
  222. //没有第三方id的处理
  223. // if (p.length < 4) {
  224. // p.push("")
  225. // }
  226. p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
  227. //密码加密
  228. // bcrypt.hash(p[1], 10, function (err, hash) {
  229. // if (err) {
  230. // return next(err);
  231. // }
  232. // p[1] = hash;
  233. // });
  234. //参数拼接,注册
  235. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "register");
  236. //返回注册用户数据
  237. // mysql.usselect(p, function (ret) {
  238. // res.end(ret);
  239. // });
  240. mysql.usselect(p, function(ret) {
  241. res.end(JSON.stringify(ret));
  242. });
  243. }
  244. });
  245. /*登录接口*/
  246. router.route("/login").all((req, res, next) => {
  247. //mode的处理
  248. if (req.body[0]) {
  249. // 0 用户名 1 用户密码
  250. c = Object.values(req.body[0]); //获取用户密码
  251. p = [c[0]];
  252. // p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
  253. var _password = [c[0]];
  254. _password.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectPassword");
  255. mysql.usselect(_password, function(ret) {
  256. var _ret = ret;
  257. var paJ = _ret[0][0].userpassword;
  258. bcrypt.compare(c[1], paJ, function(err, result) {
  259. // console.log(result)
  260. if (result) {
  261. //参数拼接,登录
  262. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectLogin");
  263. //执行存储过程
  264. mysql.usselect(p, function(ret) {
  265. res.end(JSON.stringify({ status: "1", ...ret }));
  266. });
  267. } else {
  268. res.end(JSON.stringify([{ status: "0" }]));
  269. }
  270. });
  271. });
  272. // console.log(isEqual)
  273. }
  274. });
  275. /*手机登录接口*/
  276. router.route("/phoneLogin").all((req, res, next) => {
  277. //mode的处理
  278. if (req.body[0]) {
  279. // 0 用户名 1 用户密码
  280. c = Object.values(req.body[0]); //获取用户密码
  281. p = [c[0]];
  282. // p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
  283. var _password = [c[0]];
  284. _password.unshift(_mysqluser[0], _mysqluser[1], "selectPassword");
  285. mysql.usselect(_password, function(ret) {
  286. if (ret[0].length) {
  287. var _ret = ret;
  288. var paJ = _ret[0][0].password;
  289. let uid = _ret[0][0].userid;
  290. let duid = [uid];
  291. bcrypt.compare(c[1], paJ, function(err, result) {
  292. // console.log(result)
  293. if (result) {
  294. //参数拼接,登录
  295. duid.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
  296. //执行存储过程
  297. mysql.usselect(duid, function(ret) {
  298. res.end(JSON.stringify({ status: "1", ...ret }));
  299. });
  300. } else {
  301. res.end(JSON.stringify([{ status: "0" }]));
  302. }
  303. });
  304. } else {
  305. res.end(JSON.stringify([{ status: "0" }]));
  306. }
  307. });
  308. // console.log(isEqual)
  309. }
  310. });
  311. // 图片转base64
  312. router.route("/imgToBase64").all((req, res, next) => {
  313. var json = queryString(req.url);
  314. //mode的处理
  315. https.get(json["img"], function(res2) {
  316. var chunks = [];
  317. var size = 0;
  318. res2.on("data", function(chunk) {
  319. chunks.push(chunk);
  320. size += chunk.length; //累加缓冲数据的长度
  321. });
  322. res2.on("end", function(err) {
  323. var data = Buffer.concat(chunks, size);
  324. var base64Img = data.toString("base64");
  325. res.end(JSON.stringify([{ img: `data:image/png;base64,${base64Img}` }]));
  326. });
  327. });
  328. });
  329. router.route("/download").all(async(req, res, next) => {
  330. var json = queryString(req.url);
  331. // 查询文件名和下载链接
  332. const fileName = json["name"];
  333. const link = json["url"];
  334. // 发送下载请求
  335. request.get(link, (err, response) => {
  336. if (err) {
  337. res.status(500).end("Internal Server Error");
  338. return;
  339. }
  340. https.get(link, function(res2) {
  341. var chunks = [];
  342. var size = 0;
  343. res2.on("data", function(chunk) {
  344. chunks.push(chunk);
  345. size += chunk.length; //累加缓冲数据的长度
  346. });
  347. res2.on("end", function(err) {
  348. var data = Buffer.concat(chunks, size);
  349. var base64Img = data.toString("base64");
  350. res.end(JSON.stringify({ response, data }));
  351. });
  352. });
  353. });
  354. });
  355. // 罗湖get
  356. router.route("/luohugetTeacherInfo").all((req, res, next) => {
  357. var json = queryString(req.url);
  358. //mode的处理
  359. https.get("https://web.luohuedu.net/tx/userinfo.aspx?code=" + json['code'], function(res2) {
  360. let data = '';
  361. res2.on("data", function(chunk) {
  362. data += chunk; // 累加获取的数据
  363. });
  364. res2.on("end", function() {
  365. res.end(data); // 将获取的值传参给前端
  366. });
  367. });
  368. });
  369. /*登录接口*/
  370. router.route("/loginRace").all((req, res, next) => {
  371. //mode的处理
  372. if (req.body[0]) {
  373. // 0 用户名 1 用户密码
  374. c = Object.values(req.body[0]); //获取用户密码
  375. p = [c[0]];
  376. // p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
  377. var _password = [c[0]];
  378. _password.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectPasswordRace");
  379. mysql.usselect(_password, function(ret) {
  380. var _ret = ret;
  381. var paJ = _ret[0][0].password;
  382. bcrypt.compare(c[1], paJ, function(err, result) {
  383. // console.log(result)
  384. if (result) {
  385. //参数拼接,登录
  386. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectLoginRace");
  387. //执行存储过程
  388. mysql.usselect(p, function(ret) {
  389. res.end(JSON.stringify({ status: "1", ...ret }));
  390. });
  391. } else {
  392. res.end(JSON.stringify([{ status: "0" }]));
  393. }
  394. });
  395. });
  396. // console.log(isEqual)
  397. }
  398. });
  399. /* 修改密码接口 */
  400. router.route("/updateAllPassword").all(function(req, res, next) {
  401. //mode的处理
  402. // let p = [];
  403. // p.unshift(_mysqlLabor[0], _mysqlLabor[1], "getAllPassword"); //執行存儲過程
  404. // mysql.usselect(p, function(ret) {
  405. // var allUser = ret[0];
  406. // var matchedUsers = allUser.filter(function(user) {
  407. // return bcrypt.compareSync('123456', user.password);
  408. // });
  409. // let a = matchedUsers.map(user => user.userid).join(",");
  410. // console.log(a);
  411. // res.end(JSON.stringify(matchedUsers));
  412. // });
  413. let allUser =  ['65a493a7-0115-11ee-91d8-005056b86db5', 'b0e41557-382b-11ee-91d8-005056b86db5', '95e46cb3-6e1c-11ee-b98c-005056b86db5', '0db98925-d093-11ee-b534-005056b86db5', 'fcd9b23e-d099-11ee-b534-005056b86db5', 'fcda0e4c-d099-11ee-b534-005056b86db5', '710746bc-f657-11ef-b508-005056924926', '1b06a4fa-03c2-11f0-b508-005056924926']
  414. console.log(allUser.length);
  415. function updatePasswordBatch(startIndex, endIndex) {
  416. if (endIndex > allUser.length) {
  417. endIndex = allUser.length;
  418. }
  419. for (let i = startIndex; i < endIndex; i++) {
  420. _password = bcrypt.hashSync("Coco1234", bcrypt.genSaltSync(10));
  421. //.userid
  422. let p2 = [allUser[i], _password];
  423. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "iniPassword"); //執行存儲過程
  424. mysql.usselect(p2, function(ret) {
  425. console.log(i);
  426. // console.log(ret);
  427. if (i === endIndex - 1) {
  428. console.log(`执行下一个100条,执行完${endIndex}`);
  429. updatePasswordBatch(endIndex, endIndex + 100);
  430. if(endIndex + 1 == allUser.length){
  431. res.end("修改完成");
  432. }
  433. }
  434. });
  435. }
  436. }
  437. updatePasswordBatch(0, 100);
  438. });
  439. /* 修改密码接口 */
  440. router.route("/updatePassword").post(function(req, res, next) {
  441. //mode的处理
  442. if (req.body[0]) {
  443. let p = [req.body[0].userid];
  444. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "getPassword"); //執行存儲過程
  445. mysql.usselect(p, function(ret) {
  446. var paJ = ret[0][0].password;
  447. var op = bcrypt.hashSync(req.body[0].opassword, bcrypt.genSaltSync(10));
  448. bcrypt.compare(req.body[0].opassword, paJ, function(err, result) {
  449. // console.log(result)
  450. if (result) {
  451. let p2 = [
  452. req.body[0].userid,
  453. bcrypt.hashSync(req.body[0].password, bcrypt.genSaltSync(10)),
  454. ];
  455. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updatePassword"); //執行存儲過程
  456. mysql.usselect(p2, function(ret) {
  457. res.end(JSON.stringify([{ success: 1 }]));
  458. });
  459. } else {
  460. res.end(JSON.stringify([{ success: 0 }]));
  461. }
  462. });
  463. });
  464. }
  465. });
  466. /* 赛事修改密码 */
  467. router.route("/updatePassword1").post(function(req, res, next) {
  468. //mode的处理
  469. if (req.body[0]) {
  470. let p = [req.body[0].userid];
  471. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "getPassword1"); //執行存儲過程
  472. mysql.usselect(p, function(ret) {
  473. var paJ = ret[0][0].password;
  474. var op = bcrypt.hashSync(req.body[0].opassword, bcrypt.genSaltSync(10));
  475. bcrypt.compare(req.body[0].opassword, paJ, function(err, result) {
  476. // console.log(result)
  477. if (result) {
  478. let p2 = [
  479. req.body[0].userid,
  480. bcrypt.hashSync(req.body[0].password, bcrypt.genSaltSync(10)),
  481. ];
  482. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updatePassword1"); //執行存儲過程
  483. mysql.usselect(p2, function(ret) {
  484. res.end(JSON.stringify([{ success: 1 }]));
  485. });
  486. } else {
  487. res.end(JSON.stringify([{ success: 0 }]));
  488. }
  489. });
  490. });
  491. }
  492. });
  493. /* 找寻重复手机号 */
  494. router.route("/findPhone").all((req, res, next) => {
  495. var json = queryString(req.url);
  496. getmysql(req, res, "findPhone", json["un"]);
  497. });
  498. /* 找寻是否有此账号 */
  499. router.route("/findUsername").all((req, res, next) => {
  500. var json = queryString(req.url);
  501. getmysql(req, res, "findUsername", json["un"]);
  502. });
  503. /* 找寻重复邮箱 */
  504. router.route("/findMail").all((req, res, next) => {
  505. var json = queryString(req.url);
  506. usergetmysql(req, res, "findMail", json["un"]);
  507. });
  508. /* 找寻重复学号 */
  509. router.route("/findSid").all((req, res, next) => {
  510. var json = queryString(req.url);
  511. getmysql(req, res, "findSid", json["un"]);
  512. });
  513. /* 新增班级 修1 */
  514. router.route("/insertClass").get((req, res, next) => {
  515. var json = queryString(req.url);
  516. getmysql2(req, res, "insertClass", json["name"], json["oid"], json["uid"]);
  517. });
  518. /* 新增教研室 修1 */
  519. router.route("/insertTeacherOffice").get((req, res, next) => {
  520. var json = queryString(req.url);
  521. getmysql2(req, res, "insertTeacherOffice", json["name"], json["oid"], json["uid"]);
  522. });
  523. /* 新增年级 修1 */
  524. router.route("/insertGrade").get((req, res, next) => {
  525. var json = queryString(req.url);
  526. getmysql2(req, res, "insertGrade", json["name"], json["oid"], json["uid"]);
  527. });
  528. /* 修改班级 修1 */
  529. router.route("/updateClass").get((req, res, next) => {
  530. var json = queryString(req.url);
  531. getmysql2(req, res, "updateClass", json["id"], json["n"], json["oid"]);
  532. });
  533. // 修改教研室 修1
  534. router.route("/updateTeacherOffice").get((req, res, next) => {
  535. var json = queryString(req.url);
  536. getmysql2(req, res, "updateTeacherOffice", json["id"], json["n"], json["oid"]);
  537. });
  538. // 修改教研室 修2
  539. router.route("/updateTeacherOffice2").get((req, res, next) => {
  540. var json = queryString(req.url);
  541. getmysql2(req, res, "updateTeacherOffice2", json["id"], json["n"], json["oid"], json["pid"]);
  542. });
  543. /* 修改年级 修1 */
  544. router.route("/updateGrade").get((req, res, next) => {
  545. var json = queryString(req.url);
  546. getmysql2(req, res, "updateGrade", json["id"], json["n"], json["oid"]);
  547. });
  548. /* 查询班级 */
  549. router.route("/selectClass").all((req, res, next) => {
  550. var json = queryString(req.url);
  551. getmysql(req, res, "selectClass", json["cu"], json["oid"], json["cn"], json["page"], 10);
  552. });
  553. // 教研室查询
  554. router.route("/selectTeacherOffice").all((req, res, next) => {
  555. var json = queryString(req.url);
  556. getmysql(req, res, "selectTeacherOffice", json["cu"], json["oid"], json["cn"], json["page"], 10);
  557. });
  558. /* 查询班级 */
  559. router.route("/selectClass2").all((req, res, next) => {
  560. var json = queryString(req.url);
  561. getmysql(req, res, "selectClass2", json["cid"], json["oid"], json["cn"], json["page"], 10);
  562. });
  563. /* 查询年级 */
  564. router.route("/selectGrade").all((req, res, next) => {
  565. var json = queryString(req.url);
  566. getmysql(req, res, "selectGrade", json["cu"], json["oid"], json["cn"], json["page"], 10);
  567. });
  568. /* 删除1班级 */
  569. router.route("/deleteClass").all((req, res, next) => {
  570. var json = queryString(req.url);
  571. getmysql2(req, res, "deleteClass", json["id"]);
  572. });
  573. /* 删除1年级 */
  574. router.route("/deleteGrade").all((req, res, next) => {
  575. var json = queryString(req.url);
  576. getmysql2(req, res, "deleteGrade", json["id"]);
  577. });
  578. /* 查询学校 */
  579. router.route("/selectOrg").all((req, res, next) => {
  580. var json = queryString(req.url);
  581. getmysql(req, res, "selectOrg");
  582. });
  583. /* 查询组织 */
  584. router.route("/selectorg2").all((req, res, next) => {
  585. var json = queryString(req.url);
  586. getmysql(req, res, "selectorg2");
  587. });
  588. /* 修改学校名称 修1 */
  589. router.route("/updateSN").get((req, res, next) => {
  590. var json = queryString(req.url);
  591. getmysql2(req, res, "updateSchoolName", json["oid"], json["n"]);
  592. });
  593. /* 教师端修改学校名称 修1 */
  594. router.route("/updateSchoolByOrg").get((req, res, next) => {
  595. var json = queryString(req.url);
  596. getmysql2(req, res, "updateSchoolByOrg", json["n"], json["d"], json["id"]);
  597. });
  598. /* 教师端查询未联结学校 */
  599. router.route("/selectNoCSchool").all((req, res, next) => {
  600. var json = queryString(req.url);
  601. getmysql(req, res, "selectNoCSchool");
  602. });
  603. /* 教师端新增或修改联结学校 修1 */
  604. router.route("/addNoSchool").get((req, res, next) => {
  605. var json = queryString(req.url);
  606. getmysql2(req, res, "addNoSchool", json["id"], json["coid"]);
  607. });
  608. /* 新增学生 修1 */
  609. router.route("/insertStudent").get((req, res, next) => {
  610. var json = queryString(req.url);
  611. json["userpassword"] = bcrypt.hashSync(
  612. json["userpassword"],
  613. bcrypt.genSaltSync(10)
  614. );
  615. getmysql2(
  616. req,
  617. res,
  618. "insertStudent",
  619. json["ph"],
  620. json["username"],
  621. json["userpassword"],
  622. json["type"],
  623. json["oid"],
  624. json["tid"],
  625. json["cid"]
  626. );
  627. });
  628. // /* 新增学生 */
  629. // router.route('/iStudent').all((req, res, next) => {
  630. // var json = queryString(req.url);
  631. // json['userpassword'] = bcrypt.hashSync(json['userpassword'], bcrypt.genSaltSync(10))
  632. // getmysql(req, res, "insertStudent", json['ph'], json['username'], json['userpassword'], json['type'], json['oid'], json['tid'], json['cid']);
  633. // });
  634. /* 查询学生 */
  635. router.route("/selectStudent").all((req, res, next) => {
  636. var json = queryString(req.url);
  637. getmysql(
  638. req,
  639. res,
  640. "selectStudent",
  641. json["oid"],
  642. json["cu"],
  643. json["cn"],
  644. json["page"],
  645. 10
  646. );
  647. });
  648. /* ppt根据学校查询学生 */
  649. router.route("/selectStudentByScoolPPt").all((req, res, next) => {
  650. var json = queryString(req.url);
  651. getmysql(req, res, "selectStudentByScoolPPt", json["oid"], json["cid"]);
  652. });
  653. /* 查询学校底下的所有学生 */
  654. router.route("/selectOrgStu").all((req, res, next) => {
  655. var json = queryString(req.url);
  656. getmysql(req, res, "selectOrgStu", json["oid"]);
  657. });
  658. /* 查询学生 */
  659. router.route("/selectStudentAdd").all((req, res, next) => {
  660. var json = queryString(req.url);
  661. getmysql(req, res, "selectStudentAdd", json["oid"], json["cu"], json["cn"]);
  662. });
  663. /* 查询老师 */
  664. router.route("/selectTeacherAdd").all((req, res, next) => {
  665. var json = queryString(req.url);
  666. getmysql(req, res, "selectTeacherAdd", json["oid"], json["cu"], json["cn"]);
  667. });
  668. /* 查询老师 */
  669. router.route("/selectTeacherAdd2").all((req, res, next) => {
  670. var json = queryString(req.url);
  671. getmysql(req, res, "selectTeacherAdd2", json["oid"], json["org"], json["cu"], json["cn"]);
  672. });
  673. /* 查询老师 */
  674. router.route("/selectTeacherAddOrg").all((req, res, next) => {
  675. var json = queryString(req.url);
  676. getmysql(
  677. req,
  678. res,
  679. "selectTeacherAddOrg",
  680. json["oid"],
  681. json["cu"],
  682. json["cn"]
  683. );
  684. });
  685. /* 查询学生 */
  686. router.route("/selectStudentAddOrg").all((req, res, next) => {
  687. var json = queryString(req.url);
  688. getmysql(
  689. req,
  690. res,
  691. "selectStudentAddOrg",
  692. json["oid"],
  693. json["cu"],
  694. json["cn"]
  695. );
  696. });
  697. /* 查询全部用户 */
  698. router.route("/selectUserAddOrg").all((req, res, next) => {
  699. var json = queryString(req.url);
  700. getmysql(req, res, "selectUserAddOrg", json["oid"], json["cu"], json["cn"]);
  701. });
  702. /* 查询全部用户 */
  703. router.route("/selectUserAdd").all((req, res, next) => {
  704. var json = queryString(req.url);
  705. getmysql(req, res, "selectUserAdd", json["oid"], json["cu"], json["cn"]);
  706. });
  707. /* 查询全部用户 */
  708. router.route("/selectUserByOidS").all((req, res, next) => {
  709. var json = queryString(req.url);
  710. getmysql(
  711. req,
  712. res,
  713. "selectUserByOidS",
  714. json["oid"],
  715. json["org"],
  716. json["cu"],
  717. json["cn"]
  718. );
  719. });
  720. /* 查询全部用户 */
  721. router.route("/selectUserByOidS2").all((req, res, next) => {
  722. var json = queryString(req.url);
  723. getmysql(
  724. req,
  725. res,
  726. "selectUserByOidS2",
  727. json["oid"],
  728. json["org"],
  729. json["cu"],
  730. json["cn"],
  731. json["page"],
  732. json["pageSize"]
  733. );
  734. });
  735. /* 查询全部用户 */
  736. router.route("/selectUserByOidS2Studio").all((req, res, next) => {
  737. var json = queryString(req.url);
  738. getmysql(
  739. req,
  740. res,
  741. "selectUserByOidS2Studio",
  742. json["oid"],
  743. json["org"],
  744. json["cu"],
  745. json["cn"],
  746. json["page"],
  747. json["pageSize"]
  748. );
  749. });
  750. /* 查询班级是否有重复 */
  751. router.route("/selectC").all((req, res, next) => {
  752. var json = queryString(req.url);
  753. getmysql(req, res, "selectC", json["className"]);
  754. });
  755. /* 查询学校是否有重复 */
  756. router.route("/selectS").all((req, res, next) => {
  757. var json = queryString(req.url);
  758. getmysql(req, res, "selectS", json["schoolName"]);
  759. });
  760. /* 修改个人信息 */
  761. router.route("/updateUser").all((req, res, next) => {
  762. postmysql(req, res, "updateUser");
  763. });
  764. router.route("/updateliyuanUser").all((req, res, next) => {
  765. postmysql(req, res, "updateliyuanUser");
  766. });
  767. //查询老师的信息
  768. router.route("/getUser").all((req, res, next) => {
  769. var json = queryString(req.url);
  770. getmysql(req, res, "selectUserDeail", json["uid"]);
  771. });
  772. //查询老师的信息
  773. router.route("/getRaceUser").all((req, res, next) => {
  774. var json = queryString(req.url);
  775. getmysql(req, res, "getRaceUser", json["uid"]);
  776. });
  777. router.route("/selectUser").all((req, res, next) => {
  778. var json = queryString(req.url);
  779. getmysql2(req, res, "selectUser", json["userid"]);
  780. });
  781. router.route("/selectUserInfo").all((req, res, next) => {
  782. var json = queryString(req.url);
  783. getmysql(req, res, "selectUserInfo", json["userid"]);
  784. });
  785. //查询教师端消息
  786. router.route("/getNewsTeacher").all((req, res, next) => {
  787. var json = queryString(req.url);
  788. getmysql(req, res, "selectNew", json["uid"], json["page"], 10);
  789. });
  790. //查询教师端消息
  791. router.route("/selectNotice").all((req, res, next) => {
  792. var json = queryString(req.url);
  793. getmysql(
  794. req,
  795. res,
  796. "selectNotice",
  797. json["uid"],
  798. json["oid"],
  799. json["org"],
  800. json["page"],
  801. 10
  802. );
  803. });
  804. //查询教师端消息
  805. router.route("/selectNotice2").all((req, res, next) => {
  806. var json = queryString(req.url);
  807. getmysql(req, res, "selectNotice2", json["uid"], json["oid"], json["org"]);
  808. });
  809. //查询教师端消息
  810. router.route("/addNotice").all((req, res, next) => {
  811. postmysql(req, res, "addNotice");
  812. });
  813. //查询教师端消息
  814. router.route("/deleteNotice").all((req, res, next) => {
  815. postmysql(req, res, "deleteNotice");
  816. });
  817. //查询通知详情
  818. router.route("/selectNewDetail").all((req, res, next) => {
  819. var json = queryString(req.url);
  820. getmysql(req, res, "selectNewDetail", json["nid"]);
  821. });
  822. //查出分组分类
  823. router.route("/getGroup").all((req, res, next) => {
  824. getmysql(req, res, "selectGroupTeacher");
  825. });
  826. //查询这个老师底下的学生提交的作业
  827. router.route("/getWorks").all((req, res, next) => {
  828. //已经不用
  829. var json = queryString(req.url);
  830. getmysql(req, res, "selectWorks", json["cn"], json["cid"], json["page"], 10);
  831. });
  832. //查询项目
  833. router.route("/getProject").all((req, res, next) => {
  834. var json = queryString(req.url);
  835. getmysql(
  836. req,
  837. res,
  838. "selectProject",
  839. json["type"],
  840. json["uid"],
  841. json["oid"],
  842. json["cn"],
  843. json["page"],
  844. 10
  845. );
  846. });
  847. //新评价查询项目
  848. router.route("/getProject1").all((req, res, next) => {
  849. //已经不用
  850. var json = queryString(req.url);
  851. getmysql(
  852. req,
  853. res,
  854. "selectProject1",
  855. json["uid"],
  856. json["cid"],
  857. json["eid"],
  858. json["cn"],
  859. json["page"],
  860. 10
  861. );
  862. });
  863. //查询项目
  864. router.route("/getMyProject").all((req, res, next) => {
  865. var json = queryString(req.url);
  866. getmysql(req, res, "selectMyProject", json["uid"], json["page"], 10);
  867. });
  868. //查询项目成员
  869. router.route("/selectProjectStudent").all((req, res, next) => {
  870. var json = queryString(req.url);
  871. getmysql(req, res, "select_student", json["cn"], json["oid"], json["uid"]);
  872. });
  873. //查询Banner列表
  874. router.route("/selectBannerList").all((req, res, next) => {
  875. var json = queryString(req.url);
  876. getmysql(req, res, "selectBannerList", json["page"], 10);
  877. });
  878. //查询Banner列表
  879. router.route("/selectAllBanner").all((req, res, next) => {
  880. var json = queryString(req.url);
  881. getmysql(req, res, "selectAllBanner", json["t"]);
  882. });
  883. //新增Banner
  884. router.route("/insertBannerList").all((req, res, next) => {
  885. postmysql(req, res, "insertBannerList");
  886. });
  887. //删除提交的作业
  888. router.route("/deleteCourseWork").all((req, res, next) => {
  889. postmysql(req, res, "deleteCourseWork");
  890. });
  891. //删除提交的作业
  892. router.route("/deleteCourseWorkTwo").all((req, res, next) => {
  893. postmysql(req, res, "deleteCourseWorkTwo");
  894. });
  895. //删除提交的作业
  896. router.route("/deleteCourseWorkTwo2").all((req, res, next) => {
  897. postmysql(req, res, "deleteCourseWorkTwo2");
  898. });
  899. //查询课程管理导出pdf的数据 ym
  900. router.route("/selectStuCourseReportPdf").all((req, res, next) => {
  901. var json = queryString(req.url);
  902. getmysql(req, res, "selectStuCourseReportPdf", json["cid"], json["uid"], json["cla"]);
  903. });
  904. router.route("/selectStuCourseReportPdfTwo").all((req, res, next) => {
  905. var json = queryString(req.url);
  906. getmysql(req, res, "selectStuCourseReportPdfTwo", json["cid"], json["uid"], json["cla"]);
  907. });
  908. //删除提交的作业
  909. router.route("/deleteCourseWorkS").all((req, res, next) => {
  910. postmysql(req, res, "deleteCourseWorkS");
  911. });
  912. //删除1Banner
  913. router.route("/deleteBannerList").all((req, res, next) => {
  914. var json = queryString(req.url);
  915. getmysql2(req, res, "deleteBannerList", json["id"]);
  916. });
  917. //查询有没有重复的模板
  918. router.route("/selectTipsTemplateBE").all((req, res, next) => {
  919. var json = queryString(req.url);
  920. getmysql(req, res, "selectTipsTemplateBE", json["userid"], json["name"]);
  921. });
  922. router.route("/addTipsTemplate2E").all((req, res, next) => {
  923. postmysql(req, res, "addTipsTemplate2E");
  924. });
  925. //删除提示词模板
  926. router.route("/deleteTipsTemplateE").all((req, res, next) => {
  927. postmysql(req, res, "deleteTipsTemplateE");
  928. });
  929. //查询模板
  930. router.route("/selectTipsTemplateE").all((req, res, next) => {
  931. var json = queryString(req.url);
  932. getmysql(req, res, "selectTipsTemplateE", json["userid"], json["oid"], json["org"], json["type"], json["name"], json["stand"]);
  933. });
  934. //查询模板
  935. router.route("/selectTipsTemplateByIdE").all((req, res, next) => {
  936. var json = queryString(req.url);
  937. getmysql(req, res, "selectTipsTemplateByIdE", json["id"], json["stand"]);
  938. });
  939. //新增提示词
  940. router.route("/addTips").all((req, res, next) => {
  941. postmysql(req, res, "addTips");
  942. });
  943. //查询有没有重复的模板
  944. router.route("/selectTipsTemplateB").all((req, res, next) => {
  945. var json = queryString(req.url);
  946. getmysql(req, res, "selectTipsTemplateB", json["userid"], json["name"]);
  947. });
  948. //保存提示词模板
  949. router.route("/addTipsTemplate").all((req, res, next) => {
  950. postmysql(req, res, "addTipsTemplate");
  951. });
  952. router.route("/addTipsTemplate2").all((req, res, next) => {
  953. postmysql(req, res, "addTipsTemplate2");
  954. });
  955. //删除提示词模板
  956. router.route("/deleteTipsTemplate").all((req, res, next) => {
  957. postmysql(req, res, "deleteTipsTemplate");
  958. });
  959. //查询模板
  960. router.route("/selectTipsTemplate").all((req, res, next) => {
  961. var json = queryString(req.url);
  962. getmysql(req, res, "selectTipsTemplate", json["userid"], json["oid"], json["org"], json["type"], json["name"]);
  963. });
  964. //查询模板
  965. router.route("/selectTipsTemplateById").all((req, res, next) => {
  966. var json = queryString(req.url);
  967. getmysql(req, res, "selectTipsTemplateById", json["id"]);
  968. });
  969. //新增提示词
  970. router.route("/addTipsHK").all((req, res, next) => {
  971. postmysql(req, res, "addTipsHK");
  972. });
  973. //保存提示词模板
  974. router.route("/addTipsTemplateHK").all((req, res, next) => {
  975. postmysql(req, res, "addTipsTemplateHK");
  976. });
  977. router.route("/addTipsTemplateHK2").all((req, res, next) => {
  978. postmysql(req, res, "addTipsTemplateHK2");
  979. });
  980. //删除提示词模板
  981. router.route("/deleteTipsTemplateHK").all((req, res, next) => {
  982. postmysql(req, res, "deleteTipsTemplateHK");
  983. });
  984. //查询模板
  985. router.route("/selectTipsTemplateHK").all((req, res, next) => {
  986. var json = queryString(req.url);
  987. getmysql(req, res, "selectTipsTemplateHK", json["userid"], json["oid"], json["org"], json["type"], json["name"]);
  988. });
  989. //查询模板
  990. router.route("/selectTipsTemplateByIdHK").all((req, res, next) => {
  991. var json = queryString(req.url);
  992. getmysql(req, res, "selectTipsTemplateByIdHK", json["id"]);
  993. });
  994. //新增课程
  995. router.route("/addWork").all((req, res, next) => {
  996. postmysql(req, res, "insert_teacher_work");
  997. });
  998. //点赞评论
  999. router.route("/insertComment").all((req, res, next) => {
  1000. postmysql(req, res, "insertComment");
  1001. });
  1002. //点赞评论
  1003. router.route("/getComment").all((req, res, next) => {
  1004. postmysql(req, res, "getComment");
  1005. });
  1006. //取消点赞 修1
  1007. router.route("/deleteComment").get((req, res, next) => {
  1008. var json = queryString(req.url);
  1009. getmysql2(req, res, "deleteComment", json["wid"], json["lid"]);
  1010. });
  1011. //删除1评论
  1012. router.route("/deleteComment2").all((req, res, next) => {
  1013. var json = queryString(req.url);
  1014. getmysql2(req, res, "deleteComment2", json["id"]);
  1015. });
  1016. //上传批注图片
  1017. router.route("/updateCourseWorks").all((req, res, next) => {
  1018. postmysql(req, res, "updateCourseWorks");
  1019. });
  1020. //上传文件
  1021. router.route("/addCourseWorks").all((req, res, next) => {
  1022. postmysql(req, res, "addCourseWorks");
  1023. });
  1024. //上传文件
  1025. router.route("/addCourseWorksS").all((req, res, next) => {
  1026. postmysql(req, res, "addCourseWorksS");
  1027. });
  1028. //上传文件
  1029. router.route("/addCourseWorksS2").all((req, res, next) => {
  1030. postmysql(req, res, "addCourseWorksS2");
  1031. });
  1032. //修改作业名字
  1033. router.route("/updateSCourseName").all((req, res, next) => {
  1034. postmysql(req, res, "updateSCourseName");
  1035. });
  1036. //可上传多个文件
  1037. router.route("/addCourseWorksR").all((req, res, next) => {
  1038. postmysql(req, res, "addCourseWorksR");
  1039. });
  1040. //可上传多个文件y
  1041. router.route("/addCourseWorksR1").all((req, res, next) => {
  1042. postmysql(req, res, "addCourseWorksR1");
  1043. });
  1044. //上传文件
  1045. router.route("/addCourseWorksTeacher").all((req, res, next) => {
  1046. postmysql(req, res, "addCourseWorksTeacher");
  1047. });
  1048. //上传文件
  1049. router.route("/addCourseWorks2").all((req, res, next) => {
  1050. var json = queryString(req.url);
  1051. postmysql(
  1052. req,
  1053. res,
  1054. "addCourseWorks",
  1055. json["uid"],
  1056. json["cid"],
  1057. json["stage"],
  1058. json["task"],
  1059. json["tool"],
  1060. json["content"],
  1061. json["type"]
  1062. );
  1063. });
  1064. //上传文件 修1
  1065. router.route("/addCourseWorks3").get((req, res, next) => {
  1066. var json = queryString(req.url);
  1067. getmysql2(
  1068. req,
  1069. res,
  1070. "addCourseWorks2",
  1071. json["uid"],
  1072. json["cid"],
  1073. json["stage"],
  1074. json["task"],
  1075. json["tool"],
  1076. json["content"],
  1077. json["type"],
  1078. json["atool"]
  1079. );
  1080. });
  1081. //上传文件
  1082. router.route("/addCourseWorks3-2").all((req, res, next) => {
  1083. var json = queryString(req.url);
  1084. postmysql(req, res, "addCourseWorks2");
  1085. });
  1086. //上传文件
  1087. router.route("/addCourseWorks2Inter").all((req, res, next) => {
  1088. var json = queryString(req.url);
  1089. postmysql(req, res, "addCourseWorks2Inter");
  1090. });
  1091. //上传文件
  1092. router.route("/addCourseWorks4").all((req, res, next) => {
  1093. postmysql3(req, res, "addCourseWorks3");
  1094. });
  1095. //上传文件
  1096. router.route("/addCourseWorks4-u").all((req, res, next) => {
  1097. postmysql2(req, res, "addCourseWorks3");
  1098. });
  1099. //上传文件
  1100. router.route("/addCourseWorks4-u2").all((req, res, next) => {
  1101. postmysql(req, res, "addCourseWorks3");
  1102. });
  1103. //上传文件
  1104. router.route("/addCourseWorks4E").all((req, res, next) => {
  1105. postmysql3(req, res, "addCourseWorks3E");
  1106. });
  1107. //上传文件
  1108. router.route("/addCourseWorks4s").all((req, res, next) => {
  1109. postmysql3(req, res, "addCourseWorks4s");
  1110. });
  1111. //上传文件
  1112. router.route("/addCourseWorks4s2").all((req, res, next) => {
  1113. postmysql3(req, res, "addCourseWorks4s2");
  1114. });
  1115. //上传文件
  1116. router.route("/addCourseWorks5").all((req, res, next) => {
  1117. postmysql(req, res, "addCourseWorks3");
  1118. });
  1119. //上传批量文件
  1120. router.route("/addCourseWorksPl").all((req, res, next) => {
  1121. if (req.body[0]) {
  1122. var p = Object.values(req.body[0]);
  1123. let ateacher = p[0];
  1124. let cid = p[1];
  1125. let stage = p[2];
  1126. let task = p[3];
  1127. let tool = p[4];
  1128. let files = JSON.parse(decodeURIComponent(p[5]));
  1129. for (let i = 0; i < files.length; i++) {
  1130. var k = [
  1131. encodeURIComponent(files[i].username),
  1132. cid,
  1133. stage,
  1134. task,
  1135. tool,
  1136. encodeURIComponent(files[i].url),
  1137. encodeURIComponent(files[i].fileType),
  1138. ateacher,
  1139. "50",
  1140. ];
  1141. k.unshift(_mysqlLabor[0], _mysqlLabor[1], "addCourseWorksPl");
  1142. //執行存儲過程
  1143. mysql.usselect(k, function(ret) {
  1144. if (i == files.length - 1) {
  1145. res.end(JSON.stringify(ret));
  1146. }
  1147. });
  1148. }
  1149. }
  1150. });
  1151. //修改课程权限(学生是否能查看所有作业) 修1
  1152. router.route("/updateCourseSLook").get((req, res, next) => {
  1153. var json = queryString(req.url);
  1154. getmysql2(req, res, "updateCourseSLook", json["sopen"], json["cid"]);
  1155. });
  1156. //修改课程权限(学生是否能查看所有作业) 修1
  1157. router.route("/updateTrainCourseSLook").get((req, res, next) => {
  1158. var json = queryString(req.url);
  1159. getmysql2(req, res, "updateTrainCourseSLook", json["sopen"], json["cid"]);
  1160. });
  1161. //修改跟随模式阶段-任务
  1162. router.route("/updateCourseFollowC").all((req, res, next) => {
  1163. postmysql(req, res, "updateCourseFollowC");
  1164. });
  1165. //修改跟随模式阶段-任务
  1166. router.route("/updateTrainCourseFollowC").all((req, res, next) => {
  1167. postmysql(req, res, "updateTrainCourseFollowC");
  1168. });
  1169. //修改跟随模式
  1170. router.route("/updateCourseFollow").all((req, res, next) => {
  1171. postmysql(req, res, "updateCourseFollow");
  1172. });
  1173. //修改学生是否可以查看内容
  1174. router.route("/updateCourseStulook").all((req, res, next) => {
  1175. postmysql(req, res, "updateCourseStulook");
  1176. });
  1177. //修改跟随模式
  1178. router.route("/updateTrainCourseFollow").all((req, res, next) => {
  1179. postmysql(req, res, "updateTrainCourseFollow");
  1180. });
  1181. //选人回答
  1182. router.route("/updateCoursePick").all((req, res, next) => {
  1183. postmysql(req, res, "updateCoursePick");
  1184. });
  1185. //删除
  1186. router.route("/deletePick").all((req, res, next) => {
  1187. postmysql(req, res, "deletePick");
  1188. });
  1189. //修改阶段锁定状态
  1190. router.route("/updateCourseLookOpen").all((req, res, next) => {
  1191. postmysql(req, res, "updateCourseLookOpen");
  1192. });
  1193. //修改阶段锁定状态
  1194. router.route("/updateTrainCourseLookOpen").all((req, res, next) => {
  1195. postmysql(req, res, "updateTrainCourseLookOpen");
  1196. });
  1197. //查看阶段锁定的状态
  1198. router.route("/getCourseState").all((req, res, next) => {
  1199. var json = queryString(req.url);
  1200. getmysql(req, res, "getCourseState", json["cid"]);
  1201. });
  1202. //添加锁定状态
  1203. router.route("/addCourseState").all((req, res, next) => {
  1204. postmysql(req, res, "addCourseState");
  1205. });
  1206. //修改锁定状态
  1207. router.route("/updateCourseSate").all((req, res, next) => {
  1208. postmysql(req, res, "updateCourseSate");
  1209. });
  1210. //修改课程管理模式
  1211. router.route("/updateCourseMode").all((req, res, next) => {
  1212. postmysql(req, res, "updateCourseMode");
  1213. });
  1214. //修改课程管理模式
  1215. router.route("/updateTrainCourseMode").all((req, res, next) => {
  1216. postmysql(req, res, "updateTrainCourseMode");
  1217. });
  1218. //查询课程权限(学生是否能查看所有作业)
  1219. router.route("/selectCourseSLook").all((req, res, next) => {
  1220. var json = queryString(req.url);
  1221. getmysql(req, res, "selectCourseSLook", json["cid"]);
  1222. });
  1223. //查询课程权限(学生是否能查看所有作业)
  1224. router.route("/selectTrainCourseSLook").all((req, res, next) => {
  1225. var json = queryString(req.url);
  1226. getmysql(req, res, "selectTrainCourseSLook", json["cid"]);
  1227. });
  1228. //查询被挑的人
  1229. router.route("/getPick").all((req, res, next) => {
  1230. var json = queryString(req.url);
  1231. getmysql(req, res, "getPick", json["cid"]);
  1232. });
  1233. //查询作业详情
  1234. router.route("/selectWorksDetail2").all((req, res, next) => {
  1235. var json = queryString(req.url);
  1236. getmysql(
  1237. req,
  1238. res,
  1239. "selectWorksDetail2",
  1240. json["uid"],
  1241. json["cid"],
  1242. json["stage"],
  1243. json["task"]
  1244. );
  1245. });
  1246. //查询作业详情
  1247. router.route("/selectWorksDetail2u").all((req, res, next) => {
  1248. //var json = queryString(req.url);//, json['uid'], json['cid'], json['stage'], json['task'], json['tool'], json['type'], json['atool']
  1249. postmysql2(req, res, "selectWorksDetail2u");
  1250. });
  1251. //查询课程全部作业详情
  1252. router.route("/selectWorksDetail3").all((req, res, next) => {
  1253. var json = queryString(req.url);
  1254. getmysql(req, res, "selectWorksDetail3", json["uid"], json["cid"]);
  1255. });
  1256. //查询课程所有作业详情
  1257. router.route("/selectAllWorksDetail").all((req, res, next) => {
  1258. var json = queryString(req.url);
  1259. getmysql(req, res, "selectAllWorksDetail", json["uid"], json["cid"]);
  1260. });
  1261. //查询多个课程全部作业详情
  1262. router.route("/selectWorksDetailMore").all((req, res, next) => {
  1263. var json = queryString(req.url);
  1264. getmysql(req, res, "selectWorksDetailMore", json["uid"], json["cid"]);
  1265. });
  1266. //一键重置作业分数
  1267. router.route("/allWorkEmptySco").all((req, res, next) => {
  1268. postmysql(req, res, "allWorkEmptySco");
  1269. });
  1270. //一键重置作业分数
  1271. router.route("/allWorkEmptyScoTwo").all((req, res, next) => {
  1272. postmysql(req, res, "allWorkEmptyScoTwo");
  1273. });
  1274. //查询课程某个阶段某个任务下的评价 修1 这个update,但标题查询
  1275. router.route("/updateWorksEva").get((req, res, next) => {
  1276. var json = queryString(req.url);
  1277. getmysql2(
  1278. req,
  1279. res,
  1280. "updateWorksEva",
  1281. json["cid"],
  1282. json["s"],
  1283. json["t"],
  1284. json["uid"],
  1285. json["rate"]
  1286. );
  1287. });
  1288. //查询课程某个阶段某个任务下的评价 修1 这个update,但标题查询
  1289. router.route("/updateWorksEvaTwo").get((req, res, next) => {
  1290. var json = queryString(req.url);
  1291. getmysql2(
  1292. req,
  1293. res,
  1294. "updateWorksEvaTwo",
  1295. json["cid"],
  1296. json["s"],
  1297. json["t"],
  1298. json["tool"],
  1299. json["uid"],
  1300. json["rate"]
  1301. );
  1302. });
  1303. //查询课程某个阶段某个任务下的评价 修1 这个update,但标题查询
  1304. router.route("/updateWorksEvaTwo1").post((req, res, next) => {
  1305. var json = queryString(req.url);
  1306. postmysql(req,res,"updateWorksEvaTwo1");
  1307. });
  1308. //学习中心教师查询作业
  1309. router.route("/selectSWorks").all((req, res, next) => {
  1310. var json = queryString(req.url);
  1311. getmysql(req, res, "selectSWorks", json["cid"], json["s"], json["t"]);
  1312. });
  1313. //学习中心教师查询工具作业
  1314. router.route("/selectMarkDialogWorks").all((req, res, next) => {
  1315. var json = queryString(req.url);
  1316. getmysql(req, res, "selectMarkDialogWorks", json["uid"],json["cid"], json["s"], json["t"], json["g"]);
  1317. });
  1318. //学习中心教师查询工具作业
  1319. router.route("/selectMarkDialogWorksTwo").all((req, res, next) => {
  1320. var json = queryString(req.url);
  1321. getmysql(req, res, "selectMarkDialogWorksTwo", json["uid"],json["cid"], json["s"], json["t"], json["g"]);
  1322. });
  1323. //学习中心教师查询作业全部展示
  1324. router.route("/selectSWorks2").all((req, res, next) => {
  1325. var json = queryString(req.url);
  1326. getmysql(req, res, "selectSWorks2", json["cid"]);
  1327. });
  1328. //学习中心学生查询作业
  1329. router.route("/selectStudentWorks").all((req, res, next) => {
  1330. var json = queryString(req.url);
  1331. getmysql(
  1332. req,
  1333. res,
  1334. "selectStudentWorks",
  1335. json["uid"],
  1336. json["cid"],
  1337. json["s"],
  1338. json["t"]
  1339. );
  1340. });
  1341. //实时课堂作业评价
  1342. router.route("/updateStudentWork").all((req, res, next) => {
  1343. postmysql(req, res, "updateStudentWork");
  1344. });
  1345. //学习中心查询学生
  1346. router.route("/selectWorksStudent").all((req, res, next) => {
  1347. var json = queryString(req.url);
  1348. getmysql(req, res, "selectWorksStudent", json["oid"], json["cid"]);
  1349. });
  1350. //批量上传查询学生
  1351. router.route("/selectSnameByCid").all((req, res, next) => {
  1352. var json = queryString(req.url);
  1353. getmysql(req, res, "selectSnameByCid", json["cid"]);
  1354. });
  1355. //批量上传查询学生分页
  1356. router.route("/selectSnameByCidPage").all((req, res, next) => {
  1357. var json = queryString(req.url);
  1358. getmysql(
  1359. req,
  1360. res,
  1361. "selectSnameByCidPage",
  1362. json["cid"],
  1363. json["cn"],
  1364. json["page"],
  1365. json["num"]
  1366. );
  1367. });
  1368. //分组查询学生
  1369. router.route("/selectSnameByCidGroup").all((req, res, next) => {
  1370. var json = queryString(req.url);
  1371. getmysql(
  1372. req,
  1373. res,
  1374. "selectSnameByCidGroup",
  1375. json["cid"],
  1376. json["oid"],
  1377. json["cn"]
  1378. );
  1379. });
  1380. /* 查询学生 */
  1381. router.route("/selectStudent2").all((req, res, next) => {
  1382. var json = queryString(req.url);
  1383. getmysql(
  1384. req,
  1385. res,
  1386. "selectStudent2",
  1387. json["oid"],
  1388. json["cu"],
  1389. json["cn"],
  1390. json["cid"],
  1391. json["page"],
  1392. 10
  1393. );
  1394. });
  1395. /* 查询教师 */
  1396. router.route("/selectTeacher2").all((req, res, next) => {
  1397. var json = queryString(req.url);
  1398. getmysql(
  1399. req,
  1400. res,
  1401. "selectTeacher2",
  1402. json["oid"],
  1403. json["cu"],
  1404. json["cn"],
  1405. json["cid"],
  1406. json["page"],
  1407. 10
  1408. );
  1409. });
  1410. /* 查询教师 */
  1411. router.route("/selectTeacher").all((req, res, next) => {
  1412. var json = queryString(req.url);
  1413. getmysql(
  1414. req,
  1415. res,
  1416. "selectTeacher",
  1417. json["org"],
  1418. json["cu"],
  1419. json["cn"],
  1420. json["page"],
  1421. 10
  1422. );
  1423. });
  1424. /* 添加教师页面查询教师 */
  1425. router.route("/selectTcTeacher").all((req, res, next) => {
  1426. var json = queryString(req.url);
  1427. getmysql(
  1428. req,
  1429. res,
  1430. "selectTcTeacher",
  1431. json["org"],
  1432. json["oid"],
  1433. json["cu"],
  1434. json["cn"],
  1435. json["page"],
  1436. 10
  1437. );
  1438. });
  1439. /* 查询所有评价体系 */
  1440. router.route("/selectAllEvaluation").all((req, res, next) => {
  1441. var json = queryString(req.url);
  1442. getmysql(req, res, "selectAllEvaluation", json["oid"]);
  1443. });
  1444. /* 根据市级用户查询评审员 */
  1445. router.route("/selectReviewer").all((req, res, next) => {
  1446. var json = queryString(req.url);
  1447. getmysql(
  1448. req,
  1449. res,
  1450. "selectReviewer",
  1451. json["uid"],
  1452. json["cn"],
  1453. json["page"],
  1454. 10
  1455. );
  1456. });
  1457. /* 市级区县管理接口 */
  1458. router.route("/selectCReviewer").all((req, res, next) => {
  1459. var json = queryString(req.url);
  1460. getmysql(
  1461. req,
  1462. res,
  1463. "selectCReviewer",
  1464. json["uid"],
  1465. json["cn"],
  1466. json["page"],
  1467. 10
  1468. );
  1469. });
  1470. /* 修改评审员 修1 */
  1471. router.route("/updateReviewer").get((req, res, next) => {
  1472. var json = queryString(req.url);
  1473. getmysql2(
  1474. req,
  1475. res,
  1476. "updateReviewer",
  1477. json["n"],
  1478. json["p"],
  1479. json["t"],
  1480. json["s"],
  1481. json["uid"]
  1482. );
  1483. });
  1484. /* 删除1评审员 */
  1485. router.route("/deleteReviewer").all((req, res, next) => {
  1486. var json = queryString(req.url);
  1487. getmysql2(req, res, "deleteReviewer", json["uid"]);
  1488. });
  1489. /* 查询区县案例 */
  1490. router.route("/selecAnliBox").all((req, res, next) => {
  1491. var json = queryString(req.url);
  1492. getmysql(req, res, "selecAnliBox", json["title"]);
  1493. });
  1494. /* 查询市级案例 */
  1495. router.route("/selecAnliBox1").all((req, res, next) => {
  1496. var json = queryString(req.url);
  1497. getmysql(req, res, "selecAnliBox1", json["title"]);
  1498. });
  1499. /* 查询省级案例 */
  1500. router.route("/selecAnliBox2").all((req, res, next) => {
  1501. var json = queryString(req.url);
  1502. getmysql(req, res, "selecAnliBox2");
  1503. });
  1504. /* 案例征集查询通知公告 */
  1505. router.route("/selectRaceNotice").all((req, res, next) => {
  1506. var json = queryString(req.url);
  1507. getmysql(req, res, "selectRaceNotice", json["page"], 10);
  1508. });
  1509. /* 案例征集查询通知公告详情 */
  1510. router.route("/getRaceNoticeDetail").all((req, res, next) => {
  1511. var json = queryString(req.url);
  1512. getmysql(req, res, "getRaceNoticeDetail", json["nid"]);
  1513. });
  1514. /* 案例征集发送通知 修1 */
  1515. router.route("/insertRaceNote").get((req, res, next) => {
  1516. var json = queryString(req.url);
  1517. getmysql2(req, res, "insertRaceNote", json["t"], json["c"], json["uid"]);
  1518. });
  1519. /* 查看随机码是否重复 */
  1520. router.route("/selectInviteCode").all((req, res, next) => {
  1521. var json = queryString(req.url);
  1522. getmysql(req, res, "selectInviteCode", json["code"], json["oid"]);
  1523. });
  1524. /* 查看随机码是否重复 */
  1525. router.route("/selectInviteCode2").all((req, res, next) => {
  1526. var json = queryString(req.url);
  1527. getmysql(req, res, "selectInviteCode2", json["code"], json["oid"]);
  1528. });
  1529. /* 根据随机码获取学校 */
  1530. router.route("/selectCourseByIc").all((req, res, next) => {
  1531. var json = queryString(req.url);
  1532. getmysql(req, res, "selectCourseByIc", json["code"], json["oid"]);
  1533. });
  1534. /* 根据随机码获取学校 */
  1535. router.route("/selectCourseByIc2").all((req, res, next) => {
  1536. var json = queryString(req.url);
  1537. getmysql(req, res, "selectCourseByIc2", json["code"], json["oid"]);
  1538. });
  1539. /* 根据随机码获取学校 */
  1540. router.route("/selectCourseByIc2SZ").all((req, res, next) => {
  1541. var json = queryString(req.url);
  1542. getmysql(req, res, "selectCourseByIc2SZ", json["code"], json["oid"]);
  1543. });
  1544. router.route("/addWorkNew").all((req, res, next) => {
  1545. // postmysql(req, res, "insert_teacher_work_new");
  1546. if (req.body[0]) {
  1547. // p = Object.values(req.body[0]);
  1548. p = [
  1549. req.body[0].uid,
  1550. req.body[0].title,
  1551. req.body[0].brief,
  1552. req.body[0].cover,
  1553. req.body[0].astudent,
  1554. req.body[0].see,
  1555. req.body[0].chapters,
  1556. req.body[0].template,
  1557. ];
  1558. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new");
  1559. //執行存儲過程
  1560. mysql.usselect(p, function(ret) {
  1561. let course = req.body[0].courseType;
  1562. let courseId = ret[0][0].courseId;
  1563. let userid = req.body[0].uid;
  1564. delCourseType(course, courseId, userid);
  1565. res.end(
  1566. JSON.stringify({
  1567. ordernumber: ret[0][0].ordernumber,
  1568. courseId: ret[0][0].courseId,
  1569. success: 1,
  1570. })
  1571. );
  1572. // res.end(JSON.stringify(ret));
  1573. });
  1574. }
  1575. });
  1576. router.route("/addWorkNew2").all((req, res, next) => {
  1577. if (req.body[0]) {
  1578. p = [
  1579. req.body[0].uid,
  1580. req.body[0].title,
  1581. req.body[0].brief,
  1582. req.body[0].cover,
  1583. req.body[0].evaId,
  1584. req.body[0].astudent,
  1585. req.body[0].see,
  1586. req.body[0].chapters,
  1587. req.body[0].template,
  1588. req.body[0].ateacher,
  1589. ];
  1590. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2"); //執行存儲過程
  1591. mysql.usselect(p, function(ret) {
  1592. let course = req.body[0].courseType;
  1593. let courseId = ret[0][0].courseId;
  1594. let userid = req.body[0].uid;
  1595. delCourseType(course, courseId, userid);
  1596. res.end(
  1597. JSON.stringify({
  1598. ordernumber: ret[0][0].ordernumber,
  1599. courseId: ret[0][0].courseId,
  1600. success: 1,
  1601. })
  1602. );
  1603. });
  1604. }
  1605. });
  1606. router.route("/addWorkNew2AI").all((req, res, next) => {
  1607. if (req.body[0]) {
  1608. p = [
  1609. req.body[0].uid,
  1610. req.body[0].title,
  1611. req.body[0].brief,
  1612. req.body[0].cover,
  1613. req.body[0].evaId,
  1614. req.body[0].astudent,
  1615. req.body[0].see,
  1616. req.body[0].chapters,
  1617. req.body[0].template,
  1618. req.body[0].ateacher,
  1619. req.body[0].refile,
  1620. req.body[0].reBrief,
  1621. ];
  1622. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2_ai"); //執行存儲過程
  1623. mysql.usselect(p, function(ret) {
  1624. let course = req.body[0].courseType;
  1625. let courseId = ret[0][0].courseId;
  1626. let userid = req.body[0].uid;
  1627. delCourseType(course, courseId, userid);
  1628. res.end(
  1629. JSON.stringify({
  1630. ordernumber: ret[0][0].ordernumber,
  1631. courseId: ret[0][0].courseId,
  1632. success: 1,
  1633. })
  1634. );
  1635. });
  1636. }
  1637. });
  1638. router.route("/addWorkNew2AI2").all((req, res, next) => {
  1639. if (req.body[0]) {
  1640. p = [
  1641. req.body[0].uid,
  1642. req.body[0].title,
  1643. req.body[0].brief,
  1644. req.body[0].cover,
  1645. req.body[0].evaId,
  1646. req.body[0].astudent,
  1647. req.body[0].see,
  1648. req.body[0].chapters,
  1649. req.body[0].template,
  1650. req.body[0].ateacher,
  1651. req.body[0].refile,
  1652. req.body[0].reBrief,
  1653. req.body[0].cpote,
  1654. ];
  1655. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2_ai2"); //執行存儲過程
  1656. mysql.usselect(p, function(ret) {
  1657. let course = req.body[0].courseType;
  1658. let courseId = ret[0][0].courseId;
  1659. let userid = req.body[0].uid;
  1660. delCourseType(course, courseId, userid);
  1661. res.end(
  1662. JSON.stringify({
  1663. ordernumber: ret[0][0].ordernumber,
  1664. courseId: ret[0][0].courseId,
  1665. success: 1,
  1666. })
  1667. );
  1668. });
  1669. }
  1670. });
  1671. router.route("/addWorkNew2AI3").all((req, res, next) => {
  1672. if (req.body[0]) {
  1673. p = [
  1674. req.body[0].uid,
  1675. req.body[0].title,
  1676. req.body[0].brief,
  1677. req.body[0].cover,
  1678. req.body[0].evaId,
  1679. req.body[0].astudent,
  1680. req.body[0].see,
  1681. req.body[0].chapters,
  1682. req.body[0].template,
  1683. req.body[0].ateacher,
  1684. req.body[0].refile,
  1685. req.body[0].reBrief,
  1686. req.body[0].cpote,
  1687. req.body[0].setting,
  1688. req.body[0].iresearch,
  1689. ];
  1690. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2_ai3"); //執行存儲過程
  1691. mysql.usselect(p, function(ret) {
  1692. let course = req.body[0].courseType;
  1693. let courseId = ret[0][0].courseId;
  1694. let userid = req.body[0].uid;
  1695. delCourseType(course, courseId, userid);
  1696. res.end(
  1697. JSON.stringify({
  1698. ordernumber: ret[0][0].ordernumber,
  1699. courseId: ret[0][0].courseId,
  1700. success: 1,
  1701. })
  1702. );
  1703. });
  1704. }
  1705. });
  1706. router.route("/addWorkNew2New").all((req, res, next) => {
  1707. if (req.body[0]) {
  1708. p = [
  1709. req.body[0].uid,
  1710. req.body[0].title,
  1711. req.body[0].brief,
  1712. req.body[0].cover,
  1713. req.body[0].evaId,
  1714. req.body[0].astudent,
  1715. req.body[0].see,
  1716. req.body[0].chapters,
  1717. req.body[0].template,
  1718. req.body[0].ateacher,
  1719. req.body[0].highSetting,
  1720. req.body[0].courseState,
  1721. ];
  1722. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2New"); //執行存儲過程
  1723. mysql.usselect(p, function(ret) {
  1724. let course = req.body[0].courseType;
  1725. let courseId = ret[0][0].courseId;
  1726. let userid = req.body[0].uid;
  1727. delCourseType(course, courseId, userid);
  1728. res.end(
  1729. JSON.stringify({
  1730. ordernumber: ret[0][0].ordernumber,
  1731. courseId: ret[0][0].courseId,
  1732. success: 1,
  1733. })
  1734. );
  1735. });
  1736. }
  1737. });
  1738. router.route("/addTrainCourseNew2").all((req, res, next) => {
  1739. if (req.body[0]) {
  1740. p = [
  1741. req.body[0].uid,
  1742. req.body[0].title,
  1743. req.body[0].brief,
  1744. req.body[0].cover,
  1745. req.body[0].evaId,
  1746. req.body[0].astudent,
  1747. req.body[0].see,
  1748. req.body[0].chapters,
  1749. req.body[0].template,
  1750. req.body[0].ateacher,
  1751. ];
  1752. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTrainCourseNew2"); //執行存儲過程
  1753. mysql.usselect(p, function(ret) {
  1754. let course = req.body[0].courseType;
  1755. let courseId = ret[0][0].courseId;
  1756. let userid = req.body[0].uid;
  1757. delCourseType(course, courseId, userid);
  1758. res.end(
  1759. JSON.stringify({
  1760. ordernumber: ret[0][0].ordernumber,
  1761. courseId: ret[0][0].courseId,
  1762. success: 1,
  1763. })
  1764. );
  1765. });
  1766. }
  1767. });
  1768. router.route("/addTestCourse").all((req, res, next) => { //添加评测
  1769. if (req.body[0]) {
  1770. p = [
  1771. req.body[0].uid,
  1772. req.body[0].title,
  1773. req.body[0].brief,
  1774. req.body[0].cover,
  1775. req.body[0].evaId,
  1776. req.body[0].astudent,
  1777. req.body[0].see,
  1778. req.body[0].chapters,
  1779. req.body[0].template,
  1780. req.body[0].ateacher,
  1781. req.body[0].typeid,
  1782. req.body[0].overtime,
  1783. req.body[0].j2,
  1784. ];
  1785. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTestCourse"); //執行存儲過程
  1786. mysql.usselect(p, function(ret) {
  1787. let course = req.body[0].courseType;
  1788. let courseId = ret[0][0].courseId;
  1789. let userid = req.body[0].uid;
  1790. delCourseType(course, courseId, userid);
  1791. res.end(
  1792. JSON.stringify({
  1793. ordernumber: ret[0][0].ordernumber,
  1794. courseId: ret[0][0].courseId,
  1795. success: 1,
  1796. })
  1797. );
  1798. });
  1799. }
  1800. });
  1801. router.route("/addTestCourse2").all((req, res, next) => { //添加评测 类型
  1802. if (req.body[0]) {
  1803. p = [
  1804. req.body[0].uid,
  1805. req.body[0].title,
  1806. req.body[0].brief,
  1807. req.body[0].cover,
  1808. req.body[0].evaId,
  1809. req.body[0].astudent,
  1810. req.body[0].see,
  1811. req.body[0].chapters,
  1812. req.body[0].template,
  1813. req.body[0].ateacher,
  1814. req.body[0].typeid,
  1815. ];
  1816. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTestCourse2"); //執行存儲過程
  1817. mysql.usselect(p, function(ret) {
  1818. let course = req.body[0].courseType;
  1819. let courseId = ret[0][0].courseId;
  1820. let userid = req.body[0].uid;
  1821. delCourseType(course, courseId, userid);
  1822. res.end(
  1823. JSON.stringify({
  1824. ordernumber: ret[0][0].ordernumber,
  1825. courseId: ret[0][0].courseId,
  1826. success: 1,
  1827. })
  1828. );
  1829. });
  1830. }
  1831. });
  1832. router.route("/addTestCourse3").all((req, res, next) => { //添加评测
  1833. if (req.body[0]) {
  1834. p = [
  1835. req.body[0].uid,
  1836. req.body[0].title,
  1837. req.body[0].brief,
  1838. req.body[0].cover,
  1839. req.body[0].evaId,
  1840. req.body[0].astudent,
  1841. req.body[0].see,
  1842. req.body[0].chapters,
  1843. req.body[0].template,
  1844. req.body[0].ateacher,
  1845. req.body[0].typeid,
  1846. req.body[0].overtime,
  1847. req.body[0].j2,
  1848. req.body[0].j3,
  1849. ];
  1850. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTestCourse3"); //執行存儲過程
  1851. mysql.usselect(p, function(ret) {
  1852. let course = req.body[0].courseType;
  1853. let courseId = ret[0][0].courseId;
  1854. let userid = req.body[0].uid;
  1855. delCourseType(course, courseId, userid);
  1856. res.end(
  1857. JSON.stringify({
  1858. ordernumber: ret[0][0].ordernumber,
  1859. courseId: ret[0][0].courseId,
  1860. success: 1,
  1861. })
  1862. );
  1863. });
  1864. }
  1865. });
  1866. router.route("/addWorkNew2E").all((req, res, next) => {
  1867. if (req.body[0]) {
  1868. p = [
  1869. req.body[0].uid,
  1870. req.body[0].title,
  1871. req.body[0].brief,
  1872. req.body[0].cover,
  1873. req.body[0].evaId,
  1874. req.body[0].astudent,
  1875. req.body[0].see,
  1876. req.body[0].chapters,
  1877. req.body[0].template,
  1878. req.body[0].ateacher,
  1879. ];
  1880. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2E"); //執行存儲過程
  1881. mysql.usselect(p, function(ret) {
  1882. let course = req.body[0].courseType;
  1883. let courseId = ret[0][0].courseId;
  1884. let userid = req.body[0].uid;
  1885. delCourseType(course, courseId, userid);
  1886. res.end(
  1887. JSON.stringify({
  1888. ordernumber: ret[0][0].ordernumber,
  1889. courseId: ret[0][0].courseId,
  1890. success: 1,
  1891. })
  1892. );
  1893. });
  1894. }
  1895. });
  1896. router.route("/addWorkNew2T").all((req, res, next) => {
  1897. if (req.body[0]) {
  1898. p = [
  1899. req.body[0].uid,
  1900. req.body[0].title,
  1901. req.body[0].brief,
  1902. req.body[0].cover,
  1903. req.body[0].evaId,
  1904. req.body[0].astudent,
  1905. req.body[0].see,
  1906. req.body[0].chapters,
  1907. req.body[0].template,
  1908. req.body[0].ateacher,
  1909. ];
  1910. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new2T"); //執行存儲過程
  1911. mysql.usselect(p, function(ret) {
  1912. let course = req.body[0].courseType;
  1913. let courseId = ret[0][0].courseId;
  1914. let userid = req.body[0].uid;
  1915. delCourseType(course, courseId, userid);
  1916. res.end(
  1917. JSON.stringify({
  1918. ordernumber: ret[0][0].ordernumber,
  1919. courseId: ret[0][0].courseId,
  1920. success: 1,
  1921. })
  1922. );
  1923. });
  1924. }
  1925. });
  1926. router.route("/addTrainCourseNew2T").all((req, res, next) => {
  1927. if (req.body[0]) {
  1928. p = [
  1929. req.body[0].uid,
  1930. req.body[0].title,
  1931. req.body[0].brief,
  1932. req.body[0].cover,
  1933. req.body[0].evaId,
  1934. req.body[0].astudent,
  1935. req.body[0].see,
  1936. req.body[0].chapters,
  1937. req.body[0].template,
  1938. req.body[0].ateacher,
  1939. ];
  1940. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addTrainCourseNew2T"); //執行存儲過程
  1941. mysql.usselect(p, function(ret) {
  1942. let course = req.body[0].courseType;
  1943. let courseId = ret[0][0].courseId;
  1944. let userid = req.body[0].uid;
  1945. delCourseType(course, courseId, userid);
  1946. res.end(
  1947. JSON.stringify({
  1948. ordernumber: ret[0][0].ordernumber,
  1949. courseId: ret[0][0].courseId,
  1950. success: 1,
  1951. })
  1952. );
  1953. });
  1954. }
  1955. });
  1956. router.route("/addSynergyCourse").all((req, res, next) => {
  1957. if (req.body[0]) {
  1958. p = [
  1959. req.body[0].uid,
  1960. req.body[0].title,
  1961. req.body[0].brief,
  1962. req.body[0].cover,
  1963. req.body[0].evaId,
  1964. req.body[0].astudent,
  1965. req.body[0].see,
  1966. req.body[0].chapters,
  1967. req.body[0].template,
  1968. req.body[0].ateacher,
  1969. ];
  1970. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_synergy"); //執行存儲過程
  1971. mysql.usselect(p, function(ret) {
  1972. let course = req.body[0].courseType;
  1973. let courseId = ret[0][0].courseId;
  1974. let userid = req.body[0].uid;
  1975. delCourseType(course, courseId, userid);
  1976. res.end(
  1977. JSON.stringify({
  1978. ordernumber: ret[0][0].ordernumber,
  1979. courseId: ret[0][0].courseId,
  1980. success: 1,
  1981. })
  1982. );
  1983. });
  1984. }
  1985. });
  1986. router.route("/addSynergyCourse2").all((req, res, next) => {
  1987. if (req.body[0]) {
  1988. p = [
  1989. req.body[0].cid,
  1990. req.body[0].uid,
  1991. req.body[0].title,
  1992. req.body[0].brief,
  1993. req.body[0].cover,
  1994. req.body[0].evaId,
  1995. req.body[0].astudent,
  1996. req.body[0].see,
  1997. req.body[0].chapters,
  1998. req.body[0].template,
  1999. req.body[0].ateacher,
  2000. ];
  2001. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_synergy2"); //執行存儲過程
  2002. mysql.usselect(p, function(ret) {
  2003. let course = req.body[0].courseType;
  2004. let courseId = ret[0][0].courseId;
  2005. let userid = req.body[0].uid;
  2006. delCourseType(course, courseId, userid);
  2007. res.end(
  2008. JSON.stringify({
  2009. ordernumber: ret[0][0].ordernumber,
  2010. courseId: ret[0][0].courseId,
  2011. success: 1,
  2012. })
  2013. );
  2014. });
  2015. }
  2016. });
  2017. router.route("/addWorkNew4").all((req, res, next) => {
  2018. if (req.body[0]) {
  2019. p = [
  2020. req.body[0].uid,
  2021. req.body[0].title,
  2022. req.body[0].brief,
  2023. req.body[0].cover,
  2024. req.body[0].evaId,
  2025. req.body[0].astudent,
  2026. req.body[0].see,
  2027. req.body[0].chapters,
  2028. req.body[0].template,
  2029. req.body[0].ateacher,
  2030. req.body[0].inviteCode,
  2031. ];
  2032. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new4"); //執行存儲過程
  2033. mysql.usselect(p, function(ret) {
  2034. let course = req.body[0].courseType;
  2035. let courseId = ret[0][0].courseId;
  2036. let userid = req.body[0].uid;
  2037. delCourseType(course, courseId, userid);
  2038. res.end(
  2039. JSON.stringify({
  2040. ordernumber: ret[0][0].ordernumber,
  2041. courseId: ret[0][0].courseId,
  2042. success: 1,
  2043. })
  2044. );
  2045. });
  2046. }
  2047. });
  2048. router.route("/addCourseWorkNew2").all((req, res, next) => {
  2049. //学生
  2050. if (req.body[0]) {
  2051. p = [
  2052. req.body[0].uid,
  2053. req.body[0].title,
  2054. req.body[0].brief,
  2055. req.body[0].cover,
  2056. req.body[0].evaId,
  2057. req.body[0].astudent,
  2058. req.body[0].see,
  2059. req.body[0].chapters,
  2060. req.body[0].template,
  2061. req.body[0].ateacher,
  2062. ];
  2063. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addCourseWorkNew2"); //執行存儲過程
  2064. mysql.usselect(p, function(ret) {
  2065. let course = req.body[0].courseType;
  2066. let courseId = ret[0][0].courseId;
  2067. let userid = req.body[0].uid;
  2068. delCourseType(course, courseId, userid);
  2069. res.end(
  2070. JSON.stringify({
  2071. ordernumber: ret[0][0].ordernumber,
  2072. courseId: ret[0][0].courseId,
  2073. success: 1,
  2074. })
  2075. );
  2076. });
  2077. }
  2078. });
  2079. router.route("/addCourseWorkNew22").all((req, res, next) => {
  2080. //学生
  2081. if (req.body[0]) {
  2082. p = [
  2083. req.body[0].uid,
  2084. req.body[0].title,
  2085. req.body[0].brief,
  2086. req.body[0].cover,
  2087. req.body[0].evaId,
  2088. req.body[0].astudent,
  2089. req.body[0].see,
  2090. req.body[0].chapters,
  2091. req.body[0].template,
  2092. req.body[0].ateacher,
  2093. ];
  2094. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addCourseWorkNew2"); //執行存儲過程
  2095. mysql.usselect(p, function(ret) {
  2096. let course = req.body[0].courseType;
  2097. let courseId = ret[0][0].courseId;
  2098. let userid = req.body[0].uid;
  2099. delCourseTypeS(course, courseId, userid);
  2100. res.end(
  2101. JSON.stringify({
  2102. ordernumber: ret[0][0].ordernumber,
  2103. courseId: ret[0][0].courseId,
  2104. success: 1,
  2105. })
  2106. );
  2107. });
  2108. }
  2109. });
  2110. //新增赛事项目
  2111. router.route("/addRace").all((req, res, next) => {
  2112. if (req.body[0]) {
  2113. p = [
  2114. req.body[0].uid,
  2115. req.body[0].info,
  2116. req.body[0].over,
  2117. req.body[0].pro,
  2118. req.body[0].act,
  2119. req.body[0].exc,
  2120. req.body[0].res,
  2121. ];
  2122. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addRace"); //執行存儲過程
  2123. mysql.usselect(p, function(ret) {
  2124. let course = req.body[0].courseType;
  2125. let courseId = ret[0][0].id;
  2126. let userid = req.body[0].uid;
  2127. delCourseType1(course, courseId, userid);
  2128. res.end(JSON.stringify({ courseId: courseId, success: 1 }));
  2129. });
  2130. }
  2131. });
  2132. //新增赛事项目
  2133. router.route("/addRace2").all((req, res, next) => {
  2134. if (req.body[0]) {
  2135. p = [
  2136. req.body[0].uid,
  2137. req.body[0].info,
  2138. req.body[0].over,
  2139. req.body[0].pro,
  2140. req.body[0].act,
  2141. req.body[0].exc,
  2142. req.body[0].res,
  2143. ];
  2144. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addRace2"); //執行存儲過程
  2145. mysql.usselect(p, function(ret) {
  2146. let course = req.body[0].courseType;
  2147. let courseId = ret[0][0].id;
  2148. let userid = req.body[0].uid;
  2149. delCourseType1(course, courseId, userid);
  2150. res.end(JSON.stringify({ courseId: courseId, success: 1 }));
  2151. });
  2152. }
  2153. });
  2154. //新增赛事账号信息
  2155. router.route("/addRaceUser").all((req, res, next) => {
  2156. if (req.body[0]) {
  2157. p = [
  2158. req.body[0].reg,
  2159. req.body[0].res,
  2160. req.body[0].sch,
  2161. req.body[0].n,
  2162. req.body[0].p,
  2163. req.body[0].t,
  2164. req.body[0].parent,
  2165. ];
  2166. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addRaceUser"); //執行存儲過程
  2167. mysql.usselect(p, function(ret) {
  2168. let num = ret[0][0].num;
  2169. let userid = ret[0][0].userid;
  2170. if (num < 10) {
  2171. num = "SZ" + "00" + num + "@gdae.com";
  2172. } else if (num < 100) {
  2173. num = "SZ" + "0" + num + "@gdae.com";
  2174. } else if (num > 100) {
  2175. num = "SZ" + num + "@gdae.com";
  2176. }
  2177. y = [userid, num, bcrypt.hashSync("Coco1234", bcrypt.genSaltSync(10))];
  2178. //参数拼接,注册
  2179. y.unshift(_mysqlLabor[0], _mysqlLabor[1], "upRaceUserNamePassword");
  2180. mysql.usselect(y, function(ret) {
  2181. res.end(JSON.stringify(ret));
  2182. });
  2183. res.end(JSON.stringify({ num: num, success: 1 }));
  2184. });
  2185. }
  2186. });
  2187. //修改赛事项目
  2188. router.route("/updateRace").all((req, res, next) => {
  2189. if (req.body[0]) {
  2190. p = [
  2191. req.body[0].id,
  2192. req.body[0].info,
  2193. req.body[0].over,
  2194. req.body[0].pro,
  2195. req.body[0].act,
  2196. req.body[0].exc,
  2197. req.body[0].res,
  2198. ];
  2199. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateRace"); //執行存儲過程
  2200. mysql.usselect(p, function(ret) {
  2201. let course = req.body[0].courseType;
  2202. let courseId = req.body[0].id;
  2203. let userid = req.body[0].uid;
  2204. delCourseType1(course, courseId, userid);
  2205. res.end(JSON.stringify({ success: 1 }));
  2206. });
  2207. }
  2208. });
  2209. router.route("/addWorkNew3").all((req, res, next) => {
  2210. if (req.body[0]) {
  2211. p = [
  2212. req.body[0].uid,
  2213. req.body[0].title,
  2214. req.body[0].brief,
  2215. req.body[0].cover,
  2216. req.body[0].astudent,
  2217. req.body[0].see,
  2218. req.body[0].chapters,
  2219. req.body[0].template,
  2220. req.body[0].ateacher,
  2221. ];
  2222. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_new3"); //執行存儲過程
  2223. mysql.usselect(p, function(ret) {
  2224. let course = req.body[0].courseType;
  2225. let courseId = ret[0][0].courseId;
  2226. let userid = req.body[0].uid;
  2227. delCourseType(course, courseId, userid);
  2228. res.end(
  2229. JSON.stringify({
  2230. ordernumber: ret[0][0].ordernumber,
  2231. courseId: ret[0][0].courseId,
  2232. success: 1,
  2233. })
  2234. );
  2235. });
  2236. }
  2237. });
  2238. router.route("/addInviteCode").all((req, res, next) => {
  2239. if (req.body[0]) {
  2240. addCourseInviteCode(
  2241. req.body[0].courseId,
  2242. JSON.parse(decodeURIComponent(req.body[0].inviteCode))
  2243. );
  2244. }
  2245. });
  2246. function delCourseInviteCode(courseId, inviteCode) {
  2247. let _courseId = courseId;
  2248. var _userdata = [_courseId];
  2249. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_courseInviteCode");
  2250. mysql.usselect(_userdata, function(ret) {
  2251. // console.log(ret);
  2252. addCourseInviteCode(_courseId, inviteCode);
  2253. });
  2254. }
  2255. function delCourseType(course, courseId, userid) {
  2256. let _courseId = courseId;
  2257. var _userdata = [_courseId];
  2258. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_courseType");
  2259. mysql.usselect(_userdata, function(ret) {
  2260. // console.log(ret);
  2261. addCourseType(userid, course, _courseId);
  2262. });
  2263. // setTimeout(() => {
  2264. // }, 1000);
  2265. }
  2266. function delCourseType1(course, courseId, userid) {
  2267. let _courseId = courseId;
  2268. var _userdata = [_courseId];
  2269. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_courseType1");
  2270. mysql.usselect(_userdata, function(ret) {
  2271. // console.log(ret);
  2272. });
  2273. setTimeout(() => {
  2274. addCourseType1(userid, course, _courseId);
  2275. }, 1000);
  2276. }
  2277. function delCourseTypeS(course, courseId, userid) {
  2278. let _courseId = courseId;
  2279. var _userdata = [_courseId];
  2280. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_courseTypeS");
  2281. mysql.usselect(_userdata, function(ret) {
  2282. // console.log(ret);
  2283. addCourseTypeS(userid, course, _courseId);
  2284. });
  2285. // setTimeout(() => {
  2286. // }, 1000);
  2287. }
  2288. function addCourseInviteCode(courseId, inviteCode) {
  2289. var _courses = courseId;
  2290. var _tid = inviteCode;
  2291. for (let i = 0; i < _tid.length; i++) {
  2292. let _userdata = [_courses, _tid[i].cid, _tid[i].ic];
  2293. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_courseInviteCode");
  2294. setTimeout(() => {
  2295. mysql.usselect(_userdata, function(ret) {
  2296. // console.log(ret);
  2297. });
  2298. }, i * 500);
  2299. }
  2300. }
  2301. function addCourseType(userid, course, _courseId) {
  2302. var _uid = userid;
  2303. var _courses = _courseId;
  2304. var _tid = JSON.parse(decodeURIComponent(course));
  2305. for (let i = 0; i < _tid.length; i++) {
  2306. if (_tid[i] == "") {
  2307. continue;
  2308. }
  2309. var _userdata = [_courses, _tid[i], _uid];
  2310. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_courseType");
  2311. mysql.usselect(_userdata, function(ret) {
  2312. // console.log(ret);
  2313. });
  2314. }
  2315. }
  2316. function addCourseType1(userid, course, _courseId) {
  2317. var _uid = userid;
  2318. var _courses = _courseId;
  2319. var _tid = JSON.parse(decodeURIComponent(course));
  2320. for (let i = 0; i < _tid.length; i++) {
  2321. if (_tid[i] == "") {
  2322. continue;
  2323. }
  2324. var _userdata = [_courses, _tid[i], _uid];
  2325. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_courseType1");
  2326. mysql.usselect(_userdata, function(ret) {
  2327. // console.log(ret);
  2328. });
  2329. }
  2330. }
  2331. function addCourseTypeS(userid, course, _courseId) {
  2332. var _uid = userid;
  2333. var _courses = _courseId;
  2334. var _tid = JSON.parse(decodeURIComponent(course));
  2335. for (let i = 0; i < _tid.length; i++) {
  2336. if (_tid[i] == "") {
  2337. continue;
  2338. }
  2339. var _userdata = [_courses, _tid[i], _uid];
  2340. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_courseTypeS");
  2341. mysql.usselect(_userdata, function(ret) {
  2342. // console.log(ret);
  2343. });
  2344. }
  2345. }
  2346. //修改课程
  2347. // router.route('/updateWork').all((req, res, next) => {
  2348. // postmysql(req, res, "update_teacher_work");
  2349. // });
  2350. router.route("/updateWorkNew").all((req, res, next) => {
  2351. if (req.body[0]) {
  2352. // p = Object.values(req.body[0]);
  2353. p = [
  2354. req.body[0].cid,
  2355. req.body[0].title,
  2356. req.body[0].brief,
  2357. req.body[0].cover,
  2358. req.body[0].astudent,
  2359. req.body[0].see,
  2360. req.body[0].chapters,
  2361. req.body[0].template,
  2362. ];
  2363. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new");
  2364. //執行存儲過程
  2365. mysql.usselect(p, function(ret) {
  2366. let course = req.body[0].courseType;
  2367. let courseId = req.body[0].cid;
  2368. let userid = req.body[0].uid;
  2369. delCourseType(course, courseId, userid);
  2370. res.end(JSON.stringify({ success: 1 }));
  2371. // res.end(JSON.stringify(ret));
  2372. });
  2373. }
  2374. });
  2375. //查询课程
  2376. // router.route('/selectCourse').all((req, res, next) => {
  2377. // var json = queryString(req.url);
  2378. // getmysql(req, res, "select_course", json['type'], json['uid'], json['oid'], json['page'], 10);
  2379. // });
  2380. router.route("/updateWorkNew2").all((req, res, next) => {
  2381. if (req.body[0]) {
  2382. p = [
  2383. req.body[0].cid,
  2384. req.body[0].title,
  2385. req.body[0].brief,
  2386. req.body[0].cover,
  2387. req.body[0].evaId,
  2388. req.body[0].astudent,
  2389. req.body[0].see,
  2390. req.body[0].chapters,
  2391. req.body[0].template,
  2392. req.body[0].ateacher,
  2393. ];
  2394. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new2"); //執行存儲過程
  2395. mysql.usselect(p, function(ret) {
  2396. let course = req.body[0].courseType;
  2397. let courseId = req.body[0].cid;
  2398. let userid = req.body[0].uid;
  2399. delCourseType(course, courseId, userid);
  2400. res.end(JSON.stringify({ success: 1 }));
  2401. });
  2402. }
  2403. });
  2404. router.route("/updateWorkNew2AI").all((req, res, next) => {
  2405. if (req.body[0]) {
  2406. p = [
  2407. req.body[0].cid,
  2408. req.body[0].title,
  2409. req.body[0].brief,
  2410. req.body[0].cover,
  2411. req.body[0].evaId,
  2412. req.body[0].astudent,
  2413. req.body[0].see,
  2414. req.body[0].chapters,
  2415. req.body[0].template,
  2416. req.body[0].ateacher,
  2417. req.body[0].refile,
  2418. req.body[0].reBrief,
  2419. ];
  2420. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new2_ai"); //執行存儲過程
  2421. mysql.usselect(p, function(ret) {
  2422. let course = req.body[0].courseType;
  2423. let courseId = req.body[0].cid;
  2424. let userid = req.body[0].uid;
  2425. delCourseType(course, courseId, userid);
  2426. res.end(JSON.stringify({ success: 1 }));
  2427. });
  2428. }
  2429. });
  2430. router.route("/updateWorkNew2AI2").all((req, res, next) => {
  2431. if (req.body[0]) {
  2432. p = [
  2433. req.body[0].cid,
  2434. req.body[0].title,
  2435. req.body[0].brief,
  2436. req.body[0].cover,
  2437. req.body[0].evaId,
  2438. req.body[0].astudent,
  2439. req.body[0].see,
  2440. req.body[0].chapters,
  2441. req.body[0].template,
  2442. req.body[0].ateacher,
  2443. req.body[0].refile,
  2444. req.body[0].reBrief,
  2445. req.body[0].cpote,
  2446. ];
  2447. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new2_ai2"); //執行存儲過程
  2448. mysql.usselect(p, function(ret) {
  2449. let course = req.body[0].courseType;
  2450. let courseId = req.body[0].cid;
  2451. let userid = req.body[0].uid;
  2452. delCourseType(course, courseId, userid);
  2453. res.end(JSON.stringify({ success: 1 }));
  2454. });
  2455. }
  2456. });
  2457. router.route("/updateWorkNew2AI3").all((req, res, next) => {
  2458. if (req.body[0]) {
  2459. p = [
  2460. req.body[0].cid,
  2461. req.body[0].title,
  2462. req.body[0].brief,
  2463. req.body[0].cover,
  2464. req.body[0].evaId,
  2465. req.body[0].astudent,
  2466. req.body[0].see,
  2467. req.body[0].chapters,
  2468. req.body[0].template,
  2469. req.body[0].ateacher,
  2470. req.body[0].refile,
  2471. req.body[0].reBrief,
  2472. req.body[0].cpote,
  2473. req.body[0].setting,
  2474. req.body[0].iresearch,
  2475. ];
  2476. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new2_ai3"); //執行存儲過程
  2477. mysql.usselect(p, function(ret) {
  2478. let course = req.body[0].courseType;
  2479. let courseId = req.body[0].cid;
  2480. let userid = req.body[0].uid;
  2481. delCourseType(course, courseId, userid);
  2482. res.end(JSON.stringify({ success: 1 }));
  2483. });
  2484. }
  2485. });
  2486. router.route("/updateWorkNew2New").all((req, res, next) => {
  2487. if (req.body[0]) {
  2488. p = [
  2489. req.body[0].cid,
  2490. req.body[0].title,
  2491. req.body[0].brief,
  2492. req.body[0].cover,
  2493. req.body[0].evaId,
  2494. req.body[0].astudent,
  2495. req.body[0].see,
  2496. req.body[0].chapters,
  2497. req.body[0].template,
  2498. req.body[0].ateacher,
  2499. req.body[0].highSetting
  2500. ];
  2501. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new2New"); //執行存儲過程
  2502. mysql.usselect(p, function(ret) {
  2503. let course = req.body[0].courseType;
  2504. let courseId = req.body[0].cid;
  2505. let userid = req.body[0].uid;
  2506. delCourseType(course, courseId, userid);
  2507. res.end(JSON.stringify({ success: 1 }));
  2508. });
  2509. }
  2510. });
  2511. router.route("/updateTrainCourseNew2").all((req, res, next) => {
  2512. if (req.body[0]) {
  2513. p = [
  2514. req.body[0].cid,
  2515. req.body[0].title,
  2516. req.body[0].brief,
  2517. req.body[0].cover,
  2518. req.body[0].evaId,
  2519. req.body[0].astudent,
  2520. req.body[0].see,
  2521. req.body[0].chapters,
  2522. req.body[0].template,
  2523. req.body[0].ateacher,
  2524. ];
  2525. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTrainCourseNew2"); //執行存儲過程
  2526. mysql.usselect(p, function(ret) {
  2527. let course = req.body[0].courseType;
  2528. let courseId = req.body[0].cid;
  2529. let userid = req.body[0].uid;
  2530. delCourseType(course, courseId, userid);
  2531. res.end(JSON.stringify({ success: 1 }));
  2532. });
  2533. }
  2534. });
  2535. router.route("/updateTestCourse").all((req, res, next) => { //修改评测
  2536. if (req.body[0]) {
  2537. p = [
  2538. req.body[0].cid,
  2539. req.body[0].title,
  2540. req.body[0].brief,
  2541. req.body[0].cover,
  2542. req.body[0].evaId,
  2543. req.body[0].astudent,
  2544. req.body[0].see,
  2545. req.body[0].chapters,
  2546. req.body[0].template,
  2547. req.body[0].ateacher,
  2548. req.body[0].look,
  2549. req.body[0].typeid,
  2550. req.body[0].overtime,
  2551. req.body[0].j2,
  2552. ];
  2553. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTestCourse"); //執行存儲過程
  2554. mysql.usselect(p, function(ret) {
  2555. let course = req.body[0].courseType;
  2556. let courseId = req.body[0].cid;
  2557. let userid = req.body[0].uid;
  2558. delCourseType(course, courseId, userid);
  2559. res.end(JSON.stringify({ success: 1 }));
  2560. });
  2561. }
  2562. });
  2563. router.route("/updateTestCourse2").all((req, res, next) => { //修改评测
  2564. if (req.body[0]) {
  2565. p = [
  2566. req.body[0].cid,
  2567. req.body[0].title,
  2568. req.body[0].brief,
  2569. req.body[0].cover,
  2570. req.body[0].evaId,
  2571. req.body[0].astudent,
  2572. req.body[0].see,
  2573. req.body[0].chapters,
  2574. req.body[0].template,
  2575. req.body[0].ateacher,
  2576. req.body[0].look,
  2577. req.body[0].typeid,
  2578. ];
  2579. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTestCourse2"); //執行存儲過程
  2580. mysql.usselect(p, function(ret) {
  2581. let course = req.body[0].courseType;
  2582. let courseId = req.body[0].cid;
  2583. let userid = req.body[0].uid;
  2584. delCourseType(course, courseId, userid);
  2585. res.end(JSON.stringify({ success: 1 }));
  2586. });
  2587. }
  2588. });
  2589. router.route("/updateTestCourse3").all((req, res, next) => { //修改评测
  2590. if (req.body[0]) {
  2591. p = [
  2592. req.body[0].cid,
  2593. req.body[0].title,
  2594. req.body[0].brief,
  2595. req.body[0].cover,
  2596. req.body[0].evaId,
  2597. req.body[0].astudent,
  2598. req.body[0].see,
  2599. req.body[0].chapters,
  2600. req.body[0].template,
  2601. req.body[0].ateacher,
  2602. req.body[0].look,
  2603. req.body[0].typeid,
  2604. req.body[0].overtime,
  2605. req.body[0].j2,
  2606. req.body[0].j3,
  2607. ];
  2608. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTestCourse3"); //執行存儲過程
  2609. mysql.usselect(p, function(ret) {
  2610. let course = req.body[0].courseType;
  2611. let courseId = req.body[0].cid;
  2612. let userid = req.body[0].uid;
  2613. delCourseType(course, courseId, userid);
  2614. res.end(JSON.stringify({ success: 1 }));
  2615. });
  2616. }
  2617. });
  2618. router.route("/updateSynergy").all((req, res, next) => {
  2619. if (req.body[0]) {
  2620. p = [
  2621. req.body[0].cid,
  2622. req.body[0].title,
  2623. req.body[0].brief,
  2624. req.body[0].cover,
  2625. req.body[0].evaId,
  2626. req.body[0].astudent,
  2627. req.body[0].see,
  2628. req.body[0].chapters,
  2629. req.body[0].template,
  2630. req.body[0].ateacher,
  2631. ];
  2632. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_synergy"); //執行存儲過程
  2633. mysql.usselect(p, function(ret) {
  2634. let course = req.body[0].courseType;
  2635. let courseId = req.body[0].cid;
  2636. let userid = req.body[0].uid;
  2637. delCourseType(course, courseId, userid);
  2638. res.end(JSON.stringify({ success: 1 }));
  2639. });
  2640. }
  2641. });
  2642. router.route("/updateWorkNew5").all((req, res, next) => {
  2643. if (req.body[0]) {
  2644. p = [
  2645. req.body[0].cid,
  2646. req.body[0].title,
  2647. req.body[0].brief,
  2648. req.body[0].cover,
  2649. req.body[0].evaId,
  2650. req.body[0].astudent,
  2651. req.body[0].see,
  2652. req.body[0].chapters,
  2653. req.body[0].template,
  2654. req.body[0].ateacher,
  2655. req.body[0].inviteCode,
  2656. ];
  2657. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new5"); //執行存儲過程
  2658. mysql.usselect(p, function(ret) {
  2659. let course = req.body[0].courseType;
  2660. let courseId = req.body[0].cid;
  2661. let userid = req.body[0].uid;
  2662. delCourseType(course, courseId, userid);
  2663. res.end(JSON.stringify({ success: 1 }));
  2664. });
  2665. }
  2666. });
  2667. router.route("/updateStudentWorkNew2").all((req, res, next) => {
  2668. //学生
  2669. if (req.body[0]) {
  2670. p = [
  2671. req.body[0].cid,
  2672. req.body[0].title,
  2673. req.body[0].brief,
  2674. req.body[0].cover,
  2675. req.body[0].evaId,
  2676. req.body[0].astudent,
  2677. req.body[0].see,
  2678. req.body[0].chapters,
  2679. req.body[0].template,
  2680. req.body[0].ateacher,
  2681. ];
  2682. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew2"); //執行存儲過程
  2683. mysql.usselect(p, function(ret) {
  2684. let course = req.body[0].courseType;
  2685. let courseId = req.body[0].cid;
  2686. let userid = req.body[0].uid;
  2687. delCourseType(course, courseId, userid);
  2688. res.end(JSON.stringify({ success: 1 }));
  2689. });
  2690. }
  2691. });
  2692. router.route("/updateStudentWorkNew22").all((req, res, next) => {
  2693. //学生
  2694. if (req.body[0]) {
  2695. p = [
  2696. req.body[0].cid,
  2697. req.body[0].title,
  2698. req.body[0].brief,
  2699. req.body[0].cover,
  2700. req.body[0].evaId,
  2701. req.body[0].astudent,
  2702. req.body[0].see,
  2703. req.body[0].chapters,
  2704. req.body[0].template,
  2705. req.body[0].ateacher,
  2706. ];
  2707. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew2"); //執行存儲過程
  2708. mysql.usselect(p, function(ret) {
  2709. let course = req.body[0].courseType;
  2710. let courseId = req.body[0].cid;
  2711. let userid = req.body[0].uid;
  2712. delCourseTypeS(course, courseId, userid);
  2713. res.end(JSON.stringify({ success: 1 }));
  2714. });
  2715. }
  2716. });
  2717. router.route("/updateWorkNew3").all((req, res, next) => {
  2718. if (req.body[0]) {
  2719. p = [
  2720. req.body[0].cid,
  2721. req.body[0].title,
  2722. req.body[0].brief,
  2723. req.body[0].cover,
  2724. req.body[0].astudent,
  2725. req.body[0].see,
  2726. req.body[0].chapters,
  2727. req.body[0].template,
  2728. req.body[0].ateacher,
  2729. ];
  2730. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new3"); //執行存儲過程
  2731. mysql.usselect(p, function(ret) {
  2732. let course = req.body[0].courseType;
  2733. let courseId = req.body[0].cid;
  2734. let userid = req.body[0].uid;
  2735. delCourseType(course, courseId, userid);
  2736. res.end(JSON.stringify({ success: 1 }));
  2737. });
  2738. }
  2739. });
  2740. function guid() {
  2741. var _num,
  2742. i,
  2743. _guid = "";
  2744. for (i = 0; i < 32; i++) {
  2745. _guid += Math.floor(Math.random() * 16).toString(16); //随机0 - 16 的数字 转变为16进制的字符串
  2746. _num = Math.floor((i - 7) / 4); //计算 (i-7)除4
  2747. if (_num > -1 && _num < 4 && i == 7 + 4 * _num) {
  2748. //会使guid中间加 "-" 形式为xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  2749. _guid += "-";
  2750. }
  2751. }
  2752. return _guid;
  2753. }
  2754. router.route("/updateWorkNew4").all((req, res, next) => {
  2755. if (req.body[0]) {
  2756. let p = [req.body[0].cid];
  2757. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_course_detail"); //執行存儲過程
  2758. mysql.usselect(p, function(ret) {
  2759. let _unitIndex = parseInt(req.body[0].unitIndex);
  2760. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  2761. let _unitJson = JSON.parse(ret[0][0].chapters);
  2762. if (_unitJson.length - 1 < _unitIndex) {
  2763. let _i = _unitIndex - (_unitJson.length - 1);
  2764. for (let i = 0; i < _i; i++) {
  2765. _unitJson.push({
  2766. dyName: "", //单元标题
  2767. chapterInfo: [{
  2768. isread: false,
  2769. chapterid: guid(),
  2770. title: "",
  2771. courseName: "",
  2772. taskJson: [{
  2773. task: "",
  2774. taskDetail: "",
  2775. chapterData: [],
  2776. toolText: "",
  2777. toolChoose: [{
  2778. tool: [],
  2779. toolDetail: "",
  2780. toolType: 0,
  2781. askCount: 1,
  2782. askTitle: "",
  2783. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  2784. }, ],
  2785. isShowTools: false,
  2786. askCount: 1,
  2787. isFold: 0,
  2788. askTitle: "",
  2789. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  2790. checkJson: [{ checkCount: [], checkPerent: [] }],
  2791. homeworkList: [],
  2792. }, ],
  2793. itemCount: 1,
  2794. fileList1: [],
  2795. video: [],
  2796. testData: [],
  2797. pData: [],
  2798. templateArray: [],
  2799. }, ],
  2800. });
  2801. }
  2802. _unitJson[_unitIndex] = _chapters[_unitIndex];
  2803. } else {
  2804. _unitJson[_unitIndex] = _chapters[_unitIndex];
  2805. }
  2806. // console.log(_unitJson);
  2807. let p2 = [
  2808. req.body[0].cid,
  2809. // JSON.stringify(_unitJson).replaceAll(/%/g, "%25")
  2810. encodeURIComponent(JSON.stringify(_unitJson)),
  2811. ];
  2812. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new4"); //執行存儲過程
  2813. mysql.usselect(p2, function(ret) {
  2814. res.end(JSON.stringify({ success: 1 }));
  2815. });
  2816. // res.end(JSON.stringify({ success: 1 }));
  2817. });
  2818. }
  2819. });
  2820. router.route("/updateTrainCourseNew4").all((req, res, next) => {
  2821. if (req.body[0]) {
  2822. let p = [req.body[0].cid];
  2823. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_trainCourse_detail"); //執行存儲過程
  2824. mysql.usselect(p, function(ret) {
  2825. let _unitIndex = parseInt(req.body[0].unitIndex);
  2826. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  2827. let _unitJson = JSON.parse(ret[0][0].chapters);
  2828. if (_unitJson.length - 1 < _unitIndex) {
  2829. let _i = _unitIndex - (_unitJson.length - 1);
  2830. for (let i = 0; i < _i; i++) {
  2831. _unitJson.push({
  2832. dyName: "", //单元标题
  2833. chapterInfo: [{
  2834. isread: false,
  2835. chapterid: guid(),
  2836. title: "",
  2837. courseName: "",
  2838. taskJson: [{
  2839. task: "",
  2840. taskDetail: "",
  2841. chapterData: [],
  2842. toolText: "",
  2843. toolChoose: [{
  2844. tool: [],
  2845. toolDetail: "",
  2846. toolType: 0,
  2847. askCount: 1,
  2848. askTitle: "",
  2849. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  2850. }, ],
  2851. isShowTools: false,
  2852. askCount: 1,
  2853. isFold: 0,
  2854. askTitle: "",
  2855. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  2856. checkJson: [{ checkCount: [], checkPerent: [] }],
  2857. homeworkList: [],
  2858. }, ],
  2859. itemCount: 1,
  2860. fileList1: [],
  2861. video: [],
  2862. testData: [],
  2863. pData: [],
  2864. templateArray: [],
  2865. }, ],
  2866. });
  2867. }
  2868. _unitJson[_unitIndex] = _chapters[_unitIndex];
  2869. } else {
  2870. _unitJson[_unitIndex] = _chapters[_unitIndex];
  2871. }
  2872. // console.log(_unitJson);
  2873. let p2 = [
  2874. req.body[0].cid,
  2875. encodeURIComponent(JSON.stringify(_unitJson)),
  2876. ];
  2877. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTrainCourseNew4"); //執行存儲過程
  2878. mysql.usselect(p2, function(ret) {
  2879. res.end(JSON.stringify({ success: 1 }));
  2880. });
  2881. // res.end(JSON.stringify({ success: 1 }));
  2882. });
  2883. }
  2884. });
  2885. router.route("/updateStudentWorkNew4").all((req, res, next) => {
  2886. //学生
  2887. if (req.body[0]) {
  2888. let p = [req.body[0].cid];
  2889. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_student_course_detail2"); //執行存儲過程
  2890. mysql.usselect(p, function(ret) {
  2891. let _unitIndex = parseInt(req.body[0].unitIndex);
  2892. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  2893. let _unitJson = JSON.parse(ret[0][0].chapters);
  2894. if (_unitJson.length - 1 < _unitIndex) {
  2895. let _i = _unitIndex - (_unitJson.length - 1);
  2896. for (let i = 0; i < _i; i++) {
  2897. _unitJson.push({
  2898. dyName: "", //单元标题
  2899. chapterInfo: [{
  2900. isread: false,
  2901. chapterid: guid(),
  2902. title: "",
  2903. courseName: "",
  2904. taskJson: [{
  2905. task: "",
  2906. taskDetail: "",
  2907. chapterData: [],
  2908. toolText: "",
  2909. toolChoose: [{
  2910. tool: [],
  2911. toolDetail: "",
  2912. toolType: 0,
  2913. askCount: 1,
  2914. askTitle: "",
  2915. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  2916. }, ],
  2917. isShowTools: false,
  2918. askCount: 1,
  2919. isFold: 0,
  2920. askTitle: "",
  2921. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  2922. checkJson: [{ checkCount: [], checkPerent: [] }],
  2923. homeworkList: [],
  2924. }, ],
  2925. itemCount: 1,
  2926. fileList1: [],
  2927. video: [],
  2928. testData: [],
  2929. pData: [],
  2930. templateArray: [],
  2931. }, ],
  2932. });
  2933. }
  2934. _unitJson[_unitIndex] = _chapters[_unitIndex];
  2935. } else {
  2936. _unitJson[_unitIndex] = _chapters[_unitIndex];
  2937. }
  2938. // console.log(_unitJson);
  2939. let p2 = [
  2940. req.body[0].cid,
  2941. encodeURIComponent(JSON.stringify(_unitJson)),
  2942. ];
  2943. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew4"); //執行存儲過程
  2944. mysql.usselect(p2, function(ret) {
  2945. res.end(JSON.stringify({ success: 1 }));
  2946. });
  2947. // res.end(JSON.stringify({ success: 1 }));
  2948. });
  2949. }
  2950. });
  2951. //协同删除阶段
  2952. router.route("/deleteWork").all((req, res, next) => {
  2953. if (req.body[0]) {
  2954. let p = [req.body[0].cid];
  2955. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_course_detail"); //執行存儲過程
  2956. mysql.usselect(p, function(ret) {
  2957. let _chapid = req.body[0].chapid;
  2958. // console.log(_chapid);
  2959. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  2960. let _unitJson = JSON.parse(ret[0][0].chapters);
  2961. let _unitJson2 = [];
  2962. for (var i = 0; i < _unitJson.length; i++) {
  2963. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  2964. // console.log(1);
  2965. // _unitJson.splice(i, -1)
  2966. _unitJson2.push(_unitJson[i]);
  2967. // break;
  2968. }
  2969. }
  2970. // console.log(_unitJson2);
  2971. let p2 = [
  2972. req.body[0].cid,
  2973. encodeURIComponent(JSON.stringify(_unitJson2)),
  2974. ];
  2975. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new4"); //執行存儲過程
  2976. mysql.usselect(p2, function(ret) {
  2977. res.end(JSON.stringify({ success: 1 }));
  2978. });
  2979. // res.end(JSON.stringify({ success: 1 }));
  2980. });
  2981. }
  2982. });
  2983. router.route("/deletetrainCourseWork").all((req, res, next) => {
  2984. if (req.body[0]) {
  2985. let p = [req.body[0].cid];
  2986. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_trainCourse_detail"); //執行存儲過程
  2987. mysql.usselect(p, function(ret) {
  2988. let _chapid = req.body[0].chapid;
  2989. // console.log(_chapid);
  2990. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  2991. let _unitJson = JSON.parse(ret[0][0].chapters);
  2992. let _unitJson2 = [];
  2993. for (var i = 0; i < _unitJson.length; i++) {
  2994. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  2995. // console.log(1);
  2996. // _unitJson.splice(i, -1)
  2997. _unitJson2.push(_unitJson[i]);
  2998. // break;
  2999. }
  3000. }
  3001. // console.log(_unitJson2);
  3002. let p2 = [
  3003. req.body[0].cid,
  3004. encodeURIComponent(JSON.stringify(_unitJson2)),
  3005. ];
  3006. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTrainCourseNew4"); //執行存儲過程
  3007. mysql.usselect(p2, function(ret) {
  3008. res.end(JSON.stringify({ success: 1 }));
  3009. });
  3010. // res.end(JSON.stringify({ success: 1 }));
  3011. });
  3012. }
  3013. });
  3014. //协同删除阶段
  3015. router.route("/deleteStudentWork").all((req, res, next) => {
  3016. //学生
  3017. if (req.body[0]) {
  3018. let p = [req.body[0].cid];
  3019. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_student_course_detail2"); //執行存儲過程
  3020. mysql.usselect(p, function(ret) {
  3021. let _chapid = req.body[0].chapid;
  3022. // console.log(_chapid);
  3023. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  3024. let _unitJson = JSON.parse(ret[0][0].chapters);
  3025. let _unitJson2 = [];
  3026. for (var i = 0; i < _unitJson.length; i++) {
  3027. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  3028. // console.log(1);
  3029. // _unitJson.splice(i, -1)
  3030. _unitJson2.push(_unitJson[i]);
  3031. // break;
  3032. }
  3033. }
  3034. // console.log(_unitJson2);
  3035. let p2 = [
  3036. req.body[0].cid,
  3037. encodeURIComponent(JSON.stringify(_unitJson2)),
  3038. ];
  3039. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew4"); //執行存儲過程
  3040. mysql.usselect(p2, function(ret) {
  3041. res.end(JSON.stringify({ success: 1 }));
  3042. });
  3043. // res.end(JSON.stringify({ success: 1 }));
  3044. });
  3045. }
  3046. });
  3047. //协同恢复删除的阶段
  3048. router.route("/restoreWork").all((req, res, next) => {
  3049. if (req.body[0]) {
  3050. let p = [req.body[0].cid];
  3051. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_course_detail"); //執行存儲過程
  3052. mysql.usselect(p, function(ret) {
  3053. let _chapid = req.body[0].chapid;
  3054. // console.log(_chapid);
  3055. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  3056. let _unitJson = JSON.parse(ret[0][0].chapters);
  3057. let _unitJson2 = [];
  3058. let chpaindex;
  3059. for (var i = 0; i < _chapters.length; i++) {
  3060. if (_chapters[i].chapterInfo[0].chapterid == _chapid) {
  3061. chpaindex = i;
  3062. }
  3063. }
  3064. for (var i = 0; i < _unitJson.length; i++) {
  3065. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  3066. // console.log(1);
  3067. // _unitJson.splice(i, -1)
  3068. _unitJson2.push(_unitJson[i]);
  3069. // break;
  3070. }
  3071. }
  3072. _unitJson2.splice(chpaindex, 0, _chapters[chpaindex]);
  3073. // console.log(_unitJson2);
  3074. let p2 = [
  3075. req.body[0].cid,
  3076. encodeURIComponent(JSON.stringify(_unitJson2)),
  3077. ];
  3078. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "update_teacher_work_new4"); //執行存儲過程
  3079. mysql.usselect(p2, function(ret) {
  3080. res.end(JSON.stringify({ success: 1 }));
  3081. });
  3082. // res.end(JSON.stringify({ success: 1 }));
  3083. });
  3084. }
  3085. });
  3086. //协同恢复删除的阶段
  3087. router.route("/restoreTrainCourse").all((req, res, next) => {
  3088. if (req.body[0]) {
  3089. let p = [req.body[0].cid];
  3090. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_trainCourse_detail"); //執行存儲過程
  3091. mysql.usselect(p, function(ret) {
  3092. let _chapid = req.body[0].chapid;
  3093. // console.log(_chapid);
  3094. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  3095. let _unitJson = JSON.parse(ret[0][0].chapters);
  3096. let _unitJson2 = [];
  3097. let chpaindex;
  3098. for (var i = 0; i < _chapters.length; i++) {
  3099. if (_chapters[i].chapterInfo[0].chapterid == _chapid) {
  3100. chpaindex = i;
  3101. }
  3102. }
  3103. for (var i = 0; i < _unitJson.length; i++) {
  3104. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  3105. // console.log(1);
  3106. // _unitJson.splice(i, -1)
  3107. _unitJson2.push(_unitJson[i]);
  3108. // break;
  3109. }
  3110. }
  3111. _unitJson2.splice(chpaindex, 0, _chapters[chpaindex]);
  3112. // console.log(_unitJson2);
  3113. let p2 = [
  3114. req.body[0].cid,
  3115. encodeURIComponent(JSON.stringify(_unitJson2)),
  3116. ];
  3117. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTrainCourseNew4"); //執行存儲過程
  3118. mysql.usselect(p2, function(ret) {
  3119. res.end(JSON.stringify({ success: 1 }));
  3120. });
  3121. // res.end(JSON.stringify({ success: 1 }));
  3122. });
  3123. }
  3124. });
  3125. //协同恢复删除的阶段
  3126. router.route("/restoreStudentWork").all((req, res, next) => {
  3127. //学生
  3128. if (req.body[0]) {
  3129. let p = [req.body[0].cid];
  3130. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_student_course_detail2"); //執行存儲過程
  3131. mysql.usselect(p, function(ret) {
  3132. let _chapid = req.body[0].chapid;
  3133. // console.log(_chapid);
  3134. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  3135. let _unitJson = JSON.parse(ret[0][0].chapters);
  3136. let _unitJson2 = [];
  3137. let chpaindex;
  3138. for (var i = 0; i < _chapters.length; i++) {
  3139. if (_chapters[i].chapterInfo[0].chapterid == _chapid) {
  3140. chpaindex = i;
  3141. }
  3142. }
  3143. for (var i = 0; i < _unitJson.length; i++) {
  3144. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  3145. // console.log(1);
  3146. // _unitJson.splice(i, -1)
  3147. _unitJson2.push(_unitJson[i]);
  3148. // break;
  3149. }
  3150. }
  3151. _unitJson2.splice(chpaindex, 0, _chapters[chpaindex]);
  3152. // console.log(_unitJson2);
  3153. let p2 = [
  3154. req.body[0].cid,
  3155. encodeURIComponent(JSON.stringify(_unitJson2)),
  3156. ];
  3157. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentWorkNew4"); //執行存儲過程
  3158. mysql.usselect(p2, function(ret) {
  3159. res.end(JSON.stringify({ success: 1 }));
  3160. });
  3161. // res.end(JSON.stringify({ success: 1 }));
  3162. });
  3163. }
  3164. });
  3165. router.route("/selectCourseNew").all((req, res, next) => {
  3166. var json = queryString(req.url);
  3167. getmysql(
  3168. req,
  3169. res,
  3170. "select_course_new",
  3171. json["type"],
  3172. json["uid"],
  3173. json["oid"],
  3174. json["typea"],
  3175. json["typeb"],
  3176. json["typec"],
  3177. json["typed"],
  3178. json["typeE"],
  3179. json["cu"],
  3180. json["cn"],
  3181. json["page"],
  3182. 10
  3183. );
  3184. });
  3185. router.route("/selectCourseNew2").all((req, res, next) => {
  3186. var json = queryString(req.url);
  3187. getmysql(
  3188. req,
  3189. res,
  3190. "select_course_new2",
  3191. json["type"],
  3192. json["uid"],
  3193. json["oid"],
  3194. json["org"],
  3195. json["typea"],
  3196. json["typeb"],
  3197. json["typec"],
  3198. json["typed"],
  3199. json["typeE"],
  3200. json["cu"],
  3201. json["cn"],
  3202. json["page"],
  3203. json["pageSize"]
  3204. );
  3205. });
  3206. router.route("/selectCourseNew2Liyuan").all((req, res, next) => {
  3207. var json = queryString(req.url);
  3208. getmysql(
  3209. req,
  3210. res,
  3211. "selectCourseNew2Liyuan",
  3212. json["type"],
  3213. json["uid"],
  3214. json["oid"],
  3215. json["org"],
  3216. json["typea"],
  3217. json["typeb"],
  3218. json["typec"],
  3219. json["typed"],
  3220. json["typeE"],
  3221. json["cu"],
  3222. json["cn"],
  3223. json["page"],
  3224. json["pageSize"]
  3225. );
  3226. });
  3227. router.route("/selectTrainCourseNew2").all((req, res, next) => {
  3228. var json = queryString(req.url);
  3229. getmysql(
  3230. req,
  3231. res,
  3232. "selectTrainCourseNew2",
  3233. json["type"],
  3234. json["uid"],
  3235. json["oid"],
  3236. json["org"],
  3237. json["typea"],
  3238. json["typeb"],
  3239. json["typec"],
  3240. json["typed"],
  3241. json["typeE"],
  3242. json["cu"],
  3243. json["cn"],
  3244. json["page"],
  3245. json["pageSize"]
  3246. );
  3247. });
  3248. router.route("/selectSynergyCourse").all((req, res, next) => {
  3249. var json = queryString(req.url);
  3250. getmysql(
  3251. req,
  3252. res,
  3253. "selectSynergyCourse",
  3254. json["type"],
  3255. json["uid"],
  3256. json["oid"],
  3257. json["org"],
  3258. json["typea"],
  3259. json["typeb"],
  3260. json["typec"],
  3261. json["typed"],
  3262. json["typeE"],
  3263. json["cu"],
  3264. json["cn"],
  3265. json["page"],
  3266. json["pageSize"]
  3267. );
  3268. });
  3269. router.route("/selectStudentCourseNew2").all((req, res, next) => {
  3270. var json = queryString(req.url);
  3271. getmysql(
  3272. req,
  3273. res,
  3274. "selectStudentCourseNew2",
  3275. json["type"],
  3276. json["uid"],
  3277. json["oid"],
  3278. json["org"],
  3279. json["typea"],
  3280. json["typeb"],
  3281. json["typec"],
  3282. json["typed"],
  3283. json["typeE"],
  3284. json["cu"],
  3285. json["cn"],
  3286. json["page"],
  3287. 10
  3288. );
  3289. });
  3290. router.route("/selectStudentCourseNew22").all((req, res, next) => {
  3291. var json = queryString(req.url);
  3292. getmysql(
  3293. req,
  3294. res,
  3295. "selectStudentCourseNew22",
  3296. json["type"],
  3297. json["uid"],
  3298. json["oid"],
  3299. json["org"],
  3300. json["typea"],
  3301. json["typeb"],
  3302. json["typec"],
  3303. json["typed"],
  3304. json["typef"],
  3305. json["typeE"],
  3306. json["cu"],
  3307. json["cn"],
  3308. json["page"],
  3309. json["pageSize"]
  3310. );
  3311. });
  3312. router.route("/selectStudentCourseNew222").all((req, res, next) => {
  3313. var json = queryString(req.url);
  3314. getmysql(
  3315. req,
  3316. res,
  3317. "selectStudentCourseNew222",
  3318. json["type"],
  3319. json["uid"],
  3320. json["oid"],
  3321. json["org"],
  3322. json["typea"],
  3323. json["typeb"],
  3324. json["typec"],
  3325. json["typed"],
  3326. json["typef"],
  3327. json["typeE"],
  3328. json["cu"],
  3329. json["cn"],
  3330. json["page"],
  3331. json["pageSize"]
  3332. );
  3333. });
  3334. //查询评测
  3335. router.route("/selectTesttCourse").all((req, res, next) => {
  3336. var json = queryString(req.url);
  3337. getmysql(
  3338. req,
  3339. res,
  3340. "selectTesttCourse",
  3341. json["type"],
  3342. json["uid"],
  3343. json["oid"],
  3344. json["org"],
  3345. json["typea"],
  3346. json["typeb"],
  3347. json["typec"],
  3348. json["typed"],
  3349. json["typef"],
  3350. json["typeE"],
  3351. json["cu"],
  3352. json["cn"],
  3353. json["page"],
  3354. json["pageSize"]
  3355. );
  3356. });
  3357. //查询评测
  3358. router.route("/selectTesttCourse3").all((req, res, next) => {
  3359. var json = queryString(req.url);
  3360. getmysql(
  3361. req,
  3362. res,
  3363. "selectTesttCourse3",
  3364. json["type"],
  3365. json["uid"],
  3366. json["oid"],
  3367. json["org"],
  3368. json["typea"],
  3369. json["typeb"],
  3370. json["typec"],
  3371. json["typed"],
  3372. json["typef"],
  3373. json["typeE"],
  3374. json["cu"],
  3375. json["cn"],
  3376. json["page"],
  3377. json["pageSize"]
  3378. );
  3379. });
  3380. //查询评测
  3381. router.route("/selectTesttCourse2").all((req, res, next) => {
  3382. var json = queryString(req.url);
  3383. getmysql(
  3384. req,
  3385. res,
  3386. "selectTesttCourse2",
  3387. json["oid"],
  3388. json["org"],
  3389. json["type"],
  3390. json["cn"],
  3391. json["page"],
  3392. json["pageSize"]
  3393. );
  3394. });
  3395. //查询评测 评测中心
  3396. router.route("/selectTesttCourseCenter").all((req, res, next) => {
  3397. var json = queryString(req.url);
  3398. getmysql(
  3399. req,
  3400. res,
  3401. "selectTesttCourseCenter",
  3402. json["type"],
  3403. json["uid"],
  3404. json["oid"],
  3405. json["org"],
  3406. json["classid"],
  3407. json["typea"],
  3408. json["typeb"],
  3409. json["typec"],
  3410. json["typed"],
  3411. json["typef"],
  3412. json["typeE"],
  3413. json["cu"],
  3414. json["cn"],
  3415. json["page"],
  3416. json["pageSize"]
  3417. );
  3418. });
  3419. //查询评测 评测中心及作业
  3420. router.route("/selectTesttCourseCenter1").all((req, res, next) => {
  3421. var json = queryString(req.url);
  3422. getmysql(
  3423. req,
  3424. res,
  3425. "selectTesttCourseCenter1",
  3426. json["type"],
  3427. json["uid"],
  3428. json["oid"],
  3429. json["org"],
  3430. json["classid"],
  3431. json["typea"],
  3432. json["typeb"],
  3433. json["typec"],
  3434. json["typed"],
  3435. json["typef"],
  3436. json["typeE"],
  3437. json["cu"],
  3438. json["cn"],
  3439. json["page"],
  3440. json["pageSize"]
  3441. );
  3442. });
  3443. router.route("/selectStudentCourseNew22Mode").all((req, res, next) => {
  3444. var json = queryString(req.url);
  3445. getmysql(
  3446. req,
  3447. res,
  3448. "selectStudentCourseNew22Mode",
  3449. json["type"],
  3450. json["uid"],
  3451. json["oid"],
  3452. json["org"],
  3453. json["typea"],
  3454. json["typeb"],
  3455. json["typec"],
  3456. json["typed"],
  3457. json["typef"],
  3458. json["typeE"],
  3459. json["cu"],
  3460. json["cn"]
  3461. );
  3462. });
  3463. //查询协同编辑课程
  3464. router.route("/selectCourseTeam").all((req, res, next) => {
  3465. var json = queryString(req.url);
  3466. getmysql(req, res, "selectCourseTeam", json["uid"], json["oid"]);
  3467. });
  3468. //查询学校
  3469. router.route("/selectSchoolName").all((req, res, next) => {
  3470. var json = queryString(req.url);
  3471. getmysql(req, res, "selectOidName", json["cu"], json["cn"], json["page"], 10);
  3472. });
  3473. //查询组织
  3474. router.route("/selectOrgName").all((req, res, next) => {
  3475. var json = queryString(req.url);
  3476. getmysql(req, res, "selectOrgName", json["page"], 10);
  3477. });
  3478. //查询学校
  3479. router.route("/selectSchoolName2").all((req, res, next) => {
  3480. var json = queryString(req.url);
  3481. getmysql(req, res, "selectOidName2", json["oid"]);
  3482. });
  3483. //查询学校
  3484. router.route("/selectSchoolNameOrg").all((req, res, next) => {
  3485. var json = queryString(req.url);
  3486. getmysql(req, res, "selectSchoolNameOrg", json["org"], json["page"], 10);
  3487. });
  3488. //查询协同学校和被协同学校
  3489. router.route("/selectOrgType").all((req, res, next) => {
  3490. var json = queryString(req.url);
  3491. getmysql(req, res, "selectOrgType", json["t"], json["org"], json["page"], 10);
  3492. });
  3493. //新增批注
  3494. router.route("/addPz").all((req, res, next) => {
  3495. postmysql(req, res, "addPz");
  3496. });
  3497. //新增批注
  3498. router.route("/addPz2").all((req, res, next) => {
  3499. postmysql(req, res, "addPz2");
  3500. });
  3501. //新增回复
  3502. router.route("/addHf").all((req, res, next) => {
  3503. postmysql(req, res, "addHf");
  3504. });
  3505. //删除批注
  3506. router.route("/deletePz").all((req, res, next) => {
  3507. postmysql(req, res, "deletePz");
  3508. });
  3509. //删除回复
  3510. router.route("/deleteReply").all((req, res, next) => {
  3511. postmysql(req, res, "deleteReply");
  3512. });
  3513. //查询批注列表
  3514. router.route("/selectPzList").all((req, res, next) => {
  3515. var json = queryString(req.url);
  3516. getmysql(req, res, "selectPzList", json["cid"], json["s"], json["t"]);
  3517. });
  3518. //查询批注列表
  3519. router.route("/selectPzListType").all((req, res, next) => {
  3520. var json = queryString(req.url);
  3521. getmysql(req, res, "selectPzListType", json["cid"], json["s"], json["t"], json["type"], json["uid"]);
  3522. });
  3523. //评分
  3524. router.route("/scoreWork").all((req, res, next) => {
  3525. postmysql(req, res, "scoreWork");
  3526. });
  3527. //删除学生
  3528. router.route("/deleteStudent").all((req, res, next) => {
  3529. postmysql(req, res, "delete_student");
  3530. });
  3531. //查询学校底下的班级
  3532. router.route("/selectClassBySchool").all((req, res, next) => {
  3533. var json = queryString(req.url);
  3534. getmysql(req, res, "selectClassBySchool", json["oid"]);
  3535. });
  3536. //查询学校底下的教研室
  3537. router.route("/selectTeacherOfficeBySchool").all((req, res, next) => {
  3538. var json = queryString(req.url);
  3539. getmysql(req, res, "selectTeacherOfficeBySchool", json["oid"]);
  3540. });
  3541. //查询学校底下的年级
  3542. router.route("/selectGrageBySchool").all((req, res, next) => {
  3543. var json = queryString(req.url);
  3544. getmysql(req, res, "selectGrageBySchool", json["oid"]);
  3545. });
  3546. //查询学校底下的班级
  3547. router.route("/selectClassBySchoolSearch").all((req, res, next) => {
  3548. var json = queryString(req.url);
  3549. getmysql(req, res, "selectClassBySchoolSearch", json["oid"], json["cn"]);
  3550. });
  3551. //查询学校底下的班级
  3552. router.route("/selectClassBySchoolSearch2").all((req, res, next) => {
  3553. var json = queryString(req.url);
  3554. getmysql(req, res, "selectClassBySchoolSearch2", json["oid"], json["gid"], json["cn"]);
  3555. });
  3556. //查询组织底下的学校
  3557. router.route("/selectSchoolByOrg").all((req, res, next) => {
  3558. var json = queryString(req.url);
  3559. getmysql(req, res, "selectSchoolByOrg", json["org"]);
  3560. });
  3561. //学生注册接口
  3562. router.route("/register_student").post(function(req, res, next) {
  3563. //mode的处理
  3564. if (req.body[0]) {
  3565. // 0 用户名 1 用户密码 2用户身份 3 第三方id(可有可无)
  3566. p = Object.values(req.body[0]); //获取用户密码
  3567. //没有第三方id的处理
  3568. // if (p.length < 4) {
  3569. // p.push("")
  3570. // }
  3571. p[1] = bcrypt.hashSync(p[1], bcrypt.genSaltSync(10));
  3572. //密码加密
  3573. // bcrypt.hash(p[1], 10, function (err, hash) {
  3574. // if (err) {
  3575. // return next(err);
  3576. // }
  3577. // p[1] = hash;
  3578. // });
  3579. //参数拼接,注册
  3580. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "register_student");
  3581. //返回注册用户数据
  3582. // mysql.usselect(p, function (ret) {
  3583. // res.end(ret);
  3584. // });
  3585. mysql.usselect(p, function(ret) {
  3586. res.end(JSON.stringify(ret));
  3587. });
  3588. }
  3589. });
  3590. //查询课程详情
  3591. router.route("/selectCourseDetail").all((req, res, next) => {
  3592. var json = queryString(req.url);
  3593. getmysql(req, res, "selectCourseDetail", json["courseId"]);
  3594. });
  3595. //查询课程详情
  3596. router.route("/selectTrainCourseDetail").all((req, res, next) => {
  3597. var json = queryString(req.url);
  3598. getmysql(req, res, "selectTrainCourseDetail", json["courseId"]);
  3599. });
  3600. //查询课程详情
  3601. router.route("/selectCourseDetail2").all((req, res, next) => {
  3602. var json = queryString(req.url);
  3603. getmysql(req, res, "selectCourseDetail2", json["courseId"]);
  3604. });
  3605. //查询课程详情
  3606. router.route("/selectTrainCourseDetail2").all((req, res, next) => {
  3607. var json = queryString(req.url);
  3608. getmysql(req, res, "selectTrainCourseDetail2", json["courseId"]);
  3609. });
  3610. //查询课程详情
  3611. router.route("/selectCourseDetail3").all((req, res, next) => {
  3612. var json = queryString(req.url);
  3613. getmysql(req, res, "selectCourseDetail3", json["courseId"]);
  3614. });
  3615. //查询课程详情
  3616. router.route("/selectTrainCourseDetail3").all((req, res, next) => {
  3617. var json = queryString(req.url);
  3618. getmysql(req, res, "selectTrainCourseDetail3", json["courseId"]);
  3619. });
  3620. //查询学校底下的所有赛事
  3621. router.route("/selectRaceByOid").all((req, res, next) => {
  3622. var json = queryString(req.url);
  3623. getmysql(req, res, "selectRaceByOid", json["sid"]);
  3624. });
  3625. //修改作业学生名称 修1
  3626. router.route("/updateCourseWorksName").get((req, res, next) => {
  3627. var json = queryString(req.url);
  3628. getmysql2(req, res, "updateCourseWorksName", json["n"], json["cid"]);
  3629. });
  3630. //查询课程详情
  3631. router.route("/selectStudentCourseDetail").all((req, res, next) => {
  3632. //学生
  3633. var json = queryString(req.url);
  3634. getmysql(req, res, "selectStudentCourseDetail", json["courseId"]);
  3635. });
  3636. //查询课程详情
  3637. router.route("/selectStudentCourseDetail3").all((req, res, next) => {
  3638. //学生
  3639. var json = queryString(req.url);
  3640. getmysql(req, res, "selectStudentCourseDetail3", json["courseId"]);
  3641. });
  3642. //查询课程详情
  3643. router.route("/selectStudentCourseDetail2").all((req, res, next) => {
  3644. //学生
  3645. var json = queryString(req.url);
  3646. getmysql(req, res, "selectStudentCourseDetail2", json["courseId"]);
  3647. });
  3648. //跳转阶段时,如果有课程就查询1返回,如果没有就插入 修1
  3649. router.route("/addUserR").get((req, res, next) => {
  3650. var json = queryString(req.url);
  3651. getmysql2(req, res, "insertUserR", json["uid"], json["cid"]);
  3652. });
  3653. //新增学生端作业
  3654. router.route("/addWorks").all((req, res, next) => {
  3655. postmysql(req, res, "add_works");
  3656. });
  3657. //查询已提交作业
  3658. router.route("/selectWork").all((req, res, next) => {
  3659. var json = queryString(req.url);
  3660. getmysql(
  3661. req,
  3662. res,
  3663. "selectWork",
  3664. json["cid"],
  3665. json["stage"],
  3666. json["task"],
  3667. json["uid"]
  3668. );
  3669. });
  3670. //查询作业详情
  3671. router.route("/selectWorksDetail").all((req, res, next) => {
  3672. var json = queryString(req.url);
  3673. getmysql(req, res, "selectWorksDetail", json["uid"], json["cid"]);
  3674. });
  3675. //新增作业评分 修1
  3676. router.route("/updateWorks").get((req, res, next) => {
  3677. var json = queryString(req.url);
  3678. getmysql2(req, res, "updateWorks", json["rate"], json["tuid"], json["id"]);
  3679. });
  3680. //新增素材信息 修1
  3681. router.route("/addMtl").get((req, res, next) => {
  3682. var json = queryString(req.url);
  3683. getmysql2(req, res, "add_mtl", json["cInfo"], json["t"], json["cBy"]);
  3684. });
  3685. //根据类型查询素材信息
  3686. router.route("/selectMtl").all((req, res, next) => {
  3687. var json = queryString(req.url);
  3688. getmysql(req, res, "selectMtl", json["t"], json["page"], 10);
  3689. });
  3690. //根据类型查询素材信息
  3691. router.route("/selectMtl2").all((req, res, next) => {
  3692. var json = queryString(req.url);
  3693. getmysql(req, res, "selectMtl2", json["t"], json["uid"], json["page"], 10);
  3694. });
  3695. //学习中心
  3696. //新增学习资源信息 修1
  3697. router.route("/addStuMtl").get((req, res, next) => {
  3698. var json = queryString(req.url);
  3699. getmysql2(req, res, "addStuMtl", json["cInfo"], json["t"], json["cBy"]);
  3700. });
  3701. //根据类型查询学习资料信息
  3702. router.route("/selectStuMtl").all((req, res, next) => {
  3703. var json = queryString(req.url);
  3704. getmysql(req, res, "selectStuMtl", json["t"], json["page"], 10);
  3705. });
  3706. //删除1素材
  3707. router.route("/deleteStuM").all((req, res, next) => {
  3708. var json = queryString(req.url);
  3709. getmysql2(req, res, "deleteStuM", json["id"]);
  3710. });
  3711. //查询学生信息
  3712. router.route("/selectSDetail").all((req, res, next) => {
  3713. var json = queryString(req.url);
  3714. getmysql(req, res, "selectStudentDetail", json["uid"]);
  3715. });
  3716. //查询个人课程
  3717. router.route("/selectMyCourse").all((req, res, next) => {
  3718. var json = queryString(req.url);
  3719. getmysql(req, res, "selectMyCourse", json["uid"]);
  3720. });
  3721. //查询个人课程groupby课程id
  3722. router.route("/selectMyCourseBycid").all((req, res, next) => {
  3723. var json = queryString(req.url);
  3724. getmysql(req, res, "selectMyCourseBycid", json["uid"]);
  3725. });
  3726. //查询所有课程
  3727. router.route("/selectAllCourse").all((req, res, next) => {
  3728. var json = queryString(req.url);
  3729. getmysql(req, res, "selectAllCourse", json["oid"], json["page"], 10);
  3730. });
  3731. //根据班级查询所有课程
  3732. router.route("/selectAllCourseByCid").all((req, res, next) => {
  3733. var json = queryString(req.url);
  3734. getmysql(
  3735. req,
  3736. res,
  3737. "selectAllCourseByCid",
  3738. json["oid"],
  3739. json["cid"],
  3740. json["page"],
  3741. 10
  3742. );
  3743. });
  3744. //根据分类查询所有课程
  3745. router.route("/selectTypeCourse").all((req, res, next) => {
  3746. var json = queryString(req.url);
  3747. getmysql(
  3748. req,
  3749. res,
  3750. "selectTypeCourse",
  3751. json["uid"],
  3752. json["oid"],
  3753. json["typea"],
  3754. json["typeb"],
  3755. json["typec"],
  3756. json["typed"],
  3757. json["typeE"],
  3758. json["cu"],
  3759. json["cn"],
  3760. json["classid"],
  3761. json["page"],
  3762. 10
  3763. );
  3764. });
  3765. //根据分类查询所有课程
  3766. router.route("/selectTypeCourse2").all((req, res, next) => {
  3767. var json = queryString(req.url);
  3768. getmysql(
  3769. req,
  3770. res,
  3771. "selectTypeCourse2",
  3772. json["uid"],
  3773. json["oid"],
  3774. json["typea"],
  3775. json["typeb"],
  3776. json["typec"],
  3777. json["typed"],
  3778. json["typeE"],
  3779. json["cu"],
  3780. json["cn"],
  3781. json["classid"],
  3782. json["org"],
  3783. json["page"],
  3784. json["pageSize"]
  3785. );
  3786. });
  3787. //根据分类查询所有课程
  3788. router.route("/selectTypeCourse22").all((req, res, next) => {
  3789. var json = queryString(req.url);
  3790. getmysql(
  3791. req,
  3792. res,
  3793. "selectTypeCourse22",
  3794. json["uid"],
  3795. json["oid"],
  3796. json["typea"],
  3797. json["typeb"],
  3798. json["typec"],
  3799. json["typed"],
  3800. json["typeE"],
  3801. json["cu"],
  3802. json["cn"],
  3803. json["classid"],
  3804. json["org"],
  3805. json["page"],
  3806. json["pageSize"],
  3807. json["orderBy"]
  3808. );
  3809. });
  3810. //根据分类查询所有课程
  3811. router.route("/selectTypeTrainCourse2").all((req, res, next) => {
  3812. var json = queryString(req.url);
  3813. getmysql(
  3814. req,
  3815. res,
  3816. "selectTypeTrainCourse2",
  3817. json["uid"],
  3818. json["oid"],
  3819. json["typea"],
  3820. json["typeb"],
  3821. json["typec"],
  3822. json["typed"],
  3823. json["typeE"],
  3824. json["cu"],
  3825. json["cn"],
  3826. json["classid"],
  3827. json["org"],
  3828. json["page"],
  3829. json["pageSize"]
  3830. );
  3831. });
  3832. //根据分类查询所有课程
  3833. router.route("/selectTypeCourse2Mode").all((req, res, next) => {
  3834. var json = queryString(req.url);
  3835. getmysql(
  3836. req,
  3837. res,
  3838. "selectTypeCourse2Mode",
  3839. json["uid"],
  3840. json["oid"],
  3841. json["typea"],
  3842. json["typeb"],
  3843. json["typec"],
  3844. json["typed"],
  3845. json["typeE"],
  3846. json["cu"],
  3847. json["cn"],
  3848. json["classid"],
  3849. json["org"]
  3850. );
  3851. });
  3852. //根据分类查询所有课程
  3853. router.route("/selectTypeCourse2Mode2").all((req, res, next) => {
  3854. var json = queryString(req.url);
  3855. getmysql(
  3856. req,
  3857. res,
  3858. "selectTypeCourse2Mode2",
  3859. json["uid"],
  3860. json["oid"],
  3861. json["typea"],
  3862. json["typeb"],
  3863. json["typec"],
  3864. json["typed"],
  3865. json["typeE"],
  3866. json["cu"],
  3867. json["cn"],
  3868. json["classid"],
  3869. json["org"],
  3870. json["orderBy"]
  3871. );
  3872. });
  3873. //根据分类查询所有课程
  3874. router.route("/selectTypeTrainCourse2Mode").all((req, res, next) => {
  3875. var json = queryString(req.url);
  3876. getmysql(
  3877. req,
  3878. res,
  3879. "selectTypeTrainCourse2Mode",
  3880. json["uid"],
  3881. json["oid"],
  3882. json["typea"],
  3883. json["typeb"],
  3884. json["typec"],
  3885. json["typed"],
  3886. json["typeE"],
  3887. json["cu"],
  3888. json["cn"],
  3889. json["classid"],
  3890. json["org"]
  3891. );
  3892. });
  3893. //根据分类查询所有课程
  3894. router.route("/selectTypeCourse2GM").all((req, res, next) => {
  3895. var json = queryString(req.url);
  3896. getmysql(
  3897. req,
  3898. res,
  3899. "selectTypeCourse2GM",
  3900. json["uid"],
  3901. json["oid"],
  3902. json["typea"],
  3903. json["typeb"],
  3904. json["typec"],
  3905. json["typed"],
  3906. json["typeE"],
  3907. json["cu"],
  3908. json["cn"],
  3909. json["classid"],
  3910. json["org"],
  3911. json["page"],
  3912. 10
  3913. );
  3914. });
  3915. //根据分类查询所有课程
  3916. router.route("/selectCourseExamine").all((req, res, next) => {
  3917. var json = queryString(req.url);
  3918. getmysql(
  3919. req,
  3920. res,
  3921. "selectCourseExamine",
  3922. json["oid"],
  3923. json["org"],
  3924. json["cn"],
  3925. json["page"],
  3926. 10
  3927. );
  3928. });
  3929. //根据分类查询所有课程
  3930. router.route("/selectTypeCourse3").all((req, res, next) => {
  3931. var json = queryString(req.url);
  3932. getmysql(
  3933. req,
  3934. res,
  3935. "selectTypeCourse3",
  3936. json["uid"],
  3937. json["oid"],
  3938. json["typea"],
  3939. json["typeb"],
  3940. json["typec"],
  3941. json["typed"],
  3942. json["typeE"],
  3943. json["cu"],
  3944. json["cn"],
  3945. json["classid"],
  3946. json["org"],
  3947. json["page"],
  3948. 10
  3949. );
  3950. });
  3951. //审核课程
  3952. router.route("/examineCourse").all((req, res, next) => {
  3953. postmysql(req, res, "examineCourse");
  3954. });
  3955. //删除1素材
  3956. router.route("/deleteM").all((req, res, next) => {
  3957. var json = queryString(req.url);
  3958. getmysql2(req, res, "deleteM", json["id"]);
  3959. });
  3960. //点击阶段时添加观看人数 修1
  3961. router.route("/updateVc").get((req, res, next) => {
  3962. var json = queryString(req.url);
  3963. getmysql2(req, res, "updateVc", json["cid"]);
  3964. });
  3965. //点击阶段时添加观看人数 修1
  3966. router.route("/updateVcTrain").get((req, res, next) => {
  3967. var json = queryString(req.url);
  3968. getmysql2(req, res, "updateVcTrain", json["cid"]);
  3969. });
  3970. //删除1课程
  3971. router.route("/deleteCourse").all((req, res, next) => {
  3972. var json = queryString(req.url);
  3973. getmysql2(req, res, "deleteCourse", json["cid"]);
  3974. });
  3975. //删除1课程
  3976. router.route("/deleteTrainCourse").all((req, res, next) => {
  3977. var json = queryString(req.url);
  3978. getmysql2(req, res, "deleteTrainCourse", json["cid"]);
  3979. });
  3980. //删除1课程
  3981. router.route("/deleteSynergyCourse").all((req, res, next) => {
  3982. var json = queryString(req.url);
  3983. getmysql2(req, res, "deleteSynergyCourse", json["cid"]);
  3984. });
  3985. //删除1课程
  3986. router.route("/deleteStudentCourse").all((req, res, next) => {
  3987. var json = queryString(req.url);
  3988. getmysql2(req, res, "deleteStudentCourse", json["cid"]);
  3989. });
  3990. //复制课程
  3991. router.route("/copyCourse").all((req, res, next) => {
  3992. postmysql(req, res, "copyCourse");
  3993. });
  3994. //复制课程
  3995. router.route("/copyCourse2").all((req, res, next) => {
  3996. postmysql(req, res, "copyCourse2");
  3997. });
  3998. //复制课程
  3999. router.route("/copyCourseSz").all((req, res, next) => {
  4000. postmysql2(req, res, "copyCourse");
  4001. });
  4002. //返回复制课程
  4003. router.route("/getcopyCourseSz").all((req, res, next) => {
  4004. postmysql2(req, res, "getcopyCourseSz");
  4005. });
  4006. //返回复制课程自己的
  4007. router.route("/getcopyCourseByUseridSz").all((req, res, next) => {
  4008. postmysql2(req, res, "getcopyCourseByUseridSz");
  4009. });
  4010. //查看课程信息
  4011. router.route("/selectCourseDetailSz").all((req, res, next) => {
  4012. postmysql2(req, res, "selectCourseDetailSz");
  4013. });
  4014. //复制课程
  4015. router.route("/copyTrainCourse").all((req, res, next) => {
  4016. postmysql(req, res, "copyTrainCourse");
  4017. });
  4018. //复制课程
  4019. router.route("/copyTest").all((req, res, next) => {
  4020. postmysql(req, res, "copyTest");
  4021. });
  4022. //复制课程
  4023. router.route("/copySynergyCourse").all((req, res, next) => {
  4024. postmysql(req, res, "copySynergyCourse");
  4025. });
  4026. //复制评价体系
  4027. router.route("/copyEva").all((req, res, next) => {
  4028. postmysql(req, res, "copyEva");
  4029. });
  4030. //复制课程
  4031. router.route("/copySCourse").all((req, res, next) => {
  4032. postmysql(req, res, "copySCourse");
  4033. });
  4034. //查看课程
  4035. router.route("/select_course_detail").all((req, res, next) => {
  4036. var json = queryString(req.url);
  4037. getmysql(req, res, "select_course_detail", json["cid"]);
  4038. });
  4039. //查看课程
  4040. router.route("/select_trainCourse_detail").all((req, res, next) => {
  4041. var json = queryString(req.url);
  4042. getmysql(req, res, "select_trainCourse_detail", json["cid"]);
  4043. });
  4044. //删除评测
  4045. router.route("/deleteTestCourseWorks").all((req, res, next) => {
  4046. postmysql(req, res, "deleteTestCourseWorks");
  4047. });
  4048. //查看评测
  4049. router.route("/selectTestType").all((req, res, next) => {
  4050. var json = queryString(req.url);
  4051. getmysql(req, res, "selectTestType", json["oid"]);
  4052. });
  4053. //查看评测
  4054. router.route("/getTestCourseDetail").all((req, res, next) => {
  4055. var json = queryString(req.url);
  4056. getmysql(req, res, "getTestCourseDetail", json["cid"]);
  4057. });
  4058. //查看评测
  4059. router.route("/selectPostilByUid").all((req, res, next) => {
  4060. var json = queryString(req.url);
  4061. getmysql(req, res, "selectPostilByUid", json["uid"]);
  4062. });
  4063. //查看评测
  4064. router.route("/getTestWorkShare").all((req, res, next) => {
  4065. var json = queryString(req.url);
  4066. getmysql(req, res, "getTestWorkShare", json["id"]);
  4067. });
  4068. //查看评测
  4069. router.route("/getTestWorkShareCopy").all((req, res, next) => {
  4070. var json = queryString(req.url);
  4071. getmysql(req, res, "getTestWorkShareCopy", json["id"], json["tea"]);
  4072. });
  4073. //查看fileid
  4074. router.route("/selectFileId").all((req, res, next) => {
  4075. var json = queryString(req.url);
  4076. getmysql(req, res, "selectFileId", json["oid"]);
  4077. });
  4078. //查看fileid
  4079. router.route("/selectAiFileId").all((req, res, next) => {
  4080. var json = queryString(req.url);
  4081. getmysql(req, res, "selectAiFileId", json["oid"]);
  4082. });
  4083. //查看fileid
  4084. router.route("/selectKnowFileid").all((req, res, next) => {
  4085. var json = queryString(req.url);
  4086. getmysql(req, res, "selectKnowFileid", json["oid"], json["sta"]);
  4087. });
  4088. //查看课程
  4089. router.route("/select_synergy").all((req, res, next) => {
  4090. var json = queryString(req.url);
  4091. getmysql(req, res, "select_synergy", json["cid"]);
  4092. });
  4093. //查看课程
  4094. router.route("/select_student_course_detail").all((req, res, next) => {
  4095. //学生
  4096. var json = queryString(req.url);
  4097. getmysql(req, res, "select_student_course_detail", json["cid"]);
  4098. });
  4099. //查看课程
  4100. router.route("/select_student_course_detail2").all((req, res, next) => {
  4101. //学生
  4102. var json = queryString(req.url);
  4103. getmysql(req, res, "select_student_course_detail2", json["cid"]);
  4104. });
  4105. //查看课程
  4106. router.route("/getExportScourse").all((req, res, next) => {
  4107. //学生
  4108. var json = queryString(req.url);
  4109. getmysql(req, res, "getExportScourse", json["cid"]);
  4110. });
  4111. //模糊查找课程
  4112. // router.route('/searchCourse').all((req, res, next) => {
  4113. // var json = queryString(req.url);
  4114. // getmysql(req, res, "searchCourse", json['cu'], json['cn'], json['page'], 10);
  4115. // });
  4116. //创建调查问卷
  4117. router.route("/addAsk").all((req, res, next) => {
  4118. postmysql(req, res, "insert_ask");
  4119. });
  4120. //学生提交问卷
  4121. router.route("/addAskList").all((req, res, next) => {
  4122. postmysql(req, res, "insert_askList");
  4123. });
  4124. //根据课程id阶段id获取已提交的问卷
  4125. router.route("/getAskListByCidStage").all((req, res, next) => {
  4126. var json = queryString(req.url);
  4127. getmysql(
  4128. req,
  4129. res,
  4130. "getAskListByCidStage",
  4131. json["cid"],
  4132. json["stage"],
  4133. json["task"]
  4134. );
  4135. });
  4136. //获取调查问卷
  4137. router.route("/getAsk").all((req, res, next) => {
  4138. var json = queryString(req.url);
  4139. getmysql(req, res, "select_ask", json["uid"], json["page"], 10);
  4140. });
  4141. //删除问卷
  4142. router.route("/deleteAsk").all((req, res, next) => {
  4143. postmysql(req, res, "deleteAsk");
  4144. });
  4145. //问卷调查数据统计
  4146. router.route("/getAskListByAskid").all((req, res, next) => {
  4147. var json = queryString(req.url);
  4148. getmysql(req, res, "select_askListByAskid", json["aid"]);
  4149. });
  4150. //删除学生提交问卷
  4151. router.route("/deleteAskList").all((req, res, next) => {
  4152. postmysql(req, res, "update_askList_delete");
  4153. });
  4154. //根据id获取调查问卷
  4155. router.route("/getAskList").all((req, res, next) => {
  4156. var json = queryString(req.url);
  4157. getmysql(req, res, "select_askList", json["uid"], json["page"], 10);
  4158. });
  4159. //查看便签列表
  4160. router.route("/selectNote").all((req, res, next) => {
  4161. var json = queryString(req.url);
  4162. getmysql(req, res, "selectNote", json["uid"]);
  4163. });
  4164. //新增便签列表 修1
  4165. router.route("/insertNote").get((req, res, next) => {
  4166. var json = queryString(req.url);
  4167. getmysql2(req, res, "insertNote", json["uid"], json["c"]);
  4168. });
  4169. //根据便签id修改便签内容 修1
  4170. router.route("/updateNote").get((req, res, next) => {
  4171. var json = queryString(req.url);
  4172. getmysql2(req, res, "updateNote", json["nid"], json["c"]);
  4173. });
  4174. //删除1便签
  4175. router.route("/deleteNote").all((req, res, next) => {
  4176. var json = queryString(req.url);
  4177. getmysql2(req, res, "deleteNote", json["nid"]);
  4178. });
  4179. //查询便签
  4180. router.route("/selectNoteContent").all((req, res, next) => {
  4181. var json = queryString(req.url);
  4182. getmysql(req, res, "selectNoteContent", json["cn"]);
  4183. });
  4184. //修改用户信息
  4185. router.route("/updateUserByEdu").all((req, res, next) => {
  4186. postmysql(req, res, "updateUserByEdu");
  4187. });
  4188. //修改用户信息
  4189. router.route("/updateUserByEdu1").all((req, res, next) => {
  4190. postmysql(req, res, "updateUserByEdu1");
  4191. });
  4192. //修改用户信息
  4193. router.route("/updateUserByEduOid").all((req, res, next) => {
  4194. postmysql(req, res, "updateUserByEduOid");
  4195. });
  4196. //修改学生信息
  4197. router.route("/updateStudentInfo").all((req, res, next) => {
  4198. postmysql(req, res, "updateStudentInfo");
  4199. });
  4200. //教师端data修改pbl用户信息
  4201. router.route("/updatePblMessage").all((req, res, next) => {
  4202. postmysql2(req, res, "updatePblMessage");
  4203. });
  4204. //登录次数
  4205. router.route("/addLoginOperation").all((req, res, next) => {
  4206. postmysql2(req, res, "addLoginOperation");
  4207. });
  4208. //当日登录时间
  4209. router.route("/addOperationTime").all((req, res, next) => {
  4210. postmysql2(req, res, "addOperationTime");
  4211. });
  4212. //课程学习时间
  4213. router.route("/addOperationTime2").all((req, res, next) => {
  4214. postmysql(req, res, "addOperationTime");
  4215. });
  4216. //当日登录时间
  4217. router.route("/addOperationTimeT").all((req, res, next) => {
  4218. postmysql2(req, res, "addOperationTime2");
  4219. });
  4220. //课程学习时间
  4221. router.route("/addOperationTimeT2").all((req, res, next) => {
  4222. postmysql(req, res, "addOperationTime2");
  4223. });
  4224. //记录用户协同建构操作
  4225. router.route("/add_OperationCSCL").all((req, res, next) => {
  4226. postmysql2(req, res, "add_OperationCSCL");
  4227. });
  4228. //获取所有分组协同数据
  4229. router.route("/select_CSCLDataByID").all((req, res, next) => {
  4230. postmysql2(req, res, "select_CSCLDataByID");
  4231. });
  4232. //获取项目所有的分组所有的人操作数据的总数和时间
  4233. router.route("/select_CSCLDataCount").all((req, res, next) => {
  4234. postmysql2(req, res, "select_CSCLDataCount");
  4235. });
  4236. //获取用户在某个分组的操作日志
  4237. router.route("/select_CSCLDataByUserIdID").all((req, res, next) => {
  4238. postmysql2(req, res, "select_CSCLDataByUserIdID");
  4239. });
  4240. router.route("/updatePblMessage2").all((req, res, next) => {
  4241. postmysql(req, res, "updatePblMessage");
  4242. });
  4243. router.route("/updateUserInfoText").all((req, res, next) => {
  4244. postmysql(req, res, "updateUserInfoText");
  4245. });
  4246. //修改幼儿园评价个人信息
  4247. router.route("/updateStudentInfoText").all((req, res, next) => {
  4248. postmysql(req, res, "updateStudentInfoText");
  4249. });
  4250. router.route("/updateRaceUser").all((req, res, next) => {
  4251. postmysql(req, res, "updateRaceUser");
  4252. });
  4253. //查询用户信息
  4254. router.route("/selectUser").all((req, res, next) => {
  4255. var json = queryString(req.url);
  4256. getmysql(req, res, "selectUser", json["userid"]);
  4257. });
  4258. //查询用户信息
  4259. router.route("/selectUserSzdjg").all((req, res, next) => {
  4260. var json = queryString(req.url);
  4261. getmysql(req, res, "selectUserSzdjg", json["username"]);
  4262. });
  4263. //新增英语写作批改 修1
  4264. router.route("/addEngC").get((req, res, next) => {
  4265. var json = queryString(req.url);
  4266. getmysql2(req, res, "insertEngCorrect", json["cid"], json["s"], json["t"], json["tool"], json["wid"], json["c"], json["w"]);
  4267. });
  4268. //查询英语写作批改
  4269. router.route("/selectEngC").all((req, res, next) => {
  4270. var json = queryString(req.url);
  4271. getmysql(req, res, "selectEngCorrect", json["workid"]);
  4272. });
  4273. //查询英语写作作业
  4274. router.route("/selectEngWork").all((req, res, next) => {
  4275. var json = queryString(req.url);
  4276. getmysql(req, res, "selectEngWork", json["wid"]);
  4277. });
  4278. //新增或修改英语写作评价 修1
  4279. router.route("/addEngEva").get((req, res, next) => {
  4280. var json = queryString(req.url);
  4281. getmysql2(req, res, "addEngEva", json["id"], json["aic"], json["tc"]);
  4282. });
  4283. //查询分类及所有子分类
  4284. router.route("/selectAllType").all((req, res, next) => {
  4285. var json = queryString(req.url);
  4286. getmysql(req, res, "selectAllType", json["org"], json["oid"]);
  4287. });
  4288. //查询分类及所有子分类 stand
  4289. router.route("/selectAllTypeStand").all((req, res, next) => {
  4290. var json = queryString(req.url);
  4291. getmysql(req, res, "selectAllTypeStand", json["org"], json["oid"], json["stand"]);
  4292. });
  4293. //查询分类及所有子分类
  4294. router.route("/selectAllTrainType").all((req, res, next) => {
  4295. var json = queryString(req.url);
  4296. getmysql(req, res, "selectAllTrainType", json["org"], json["oid"]);
  4297. });
  4298. //查询分类及所有子分类
  4299. router.route("/selectAllTypeS").all((req, res, next) => {
  4300. var json = queryString(req.url);
  4301. getmysql(req, res, "selectAllTypeS", json["org"], json["oid"]);
  4302. });
  4303. //查询分类及所有子分类
  4304. router.route("/selectAllTypeT").all((req, res, next) => {
  4305. var json = queryString(req.url);
  4306. getmysql(req, res, "selectAllTypeT", json["org"], json["oid"]);
  4307. });
  4308. //查询分类及子分类
  4309. router.route("/selectType").all((req, res, next) => {
  4310. var json = queryString(req.url);
  4311. getmysql(req, res, "selectType");
  4312. });
  4313. //查询分类及子分类
  4314. router.route("/selectStudentType").all((req, res, next) => {
  4315. var json = queryString(req.url);
  4316. getmysql(req, res, "selectStudentType");
  4317. });
  4318. //查询赛事分类及子分类
  4319. router.route("/selectMatType").all((req, res, next) => {
  4320. var json = queryString(req.url);
  4321. getmysql(req, res, "selectMatType");
  4322. });
  4323. //查询赛事分类及子分类
  4324. router.route("/selectRaceNum").all((req, res, next) => {
  4325. var json = queryString(req.url);
  4326. getmysql(req, res, "selectRaceNum", json["oid"]);
  4327. });
  4328. //根据学校查询分类
  4329. router.route("/selectPtype").all((req, res, next) => {
  4330. var json = queryString(req.url);
  4331. getmysql(req, res, "selectPtype", json["page"], 10);
  4332. });
  4333. //根据学校查询学生项目分类
  4334. router.route("/selectSPtype").all((req, res, next) => {
  4335. var json = queryString(req.url);
  4336. getmysql(req, res, "selectSPtype", json["page"], 10);
  4337. });
  4338. //根据学校查询分类1
  4339. router.route("/selectPtype1").all((req, res, next) => {
  4340. var json = queryString(req.url);
  4341. getmysql(req, res, "selectPtype1", json["oid"], json["page"], 10);
  4342. });
  4343. //添加分类 修1
  4344. router.route("/addPtype").get((req, res, next) => {
  4345. var json = queryString(req.url);
  4346. getmysql2(req, res, "addPtype", json["n"], json["uid"], json["oid"]);
  4347. });
  4348. //修改分类 修1
  4349. router.route("/updatePtype").get((req, res, next) => {
  4350. var json = queryString(req.url);
  4351. getmysql2(req, res, "updatePtype", json["n"], json["tid"]);
  4352. });
  4353. //修改学生项目分类 修1
  4354. router.route("/updateSPtype").get((req, res, next) => {
  4355. var json = queryString(req.url);
  4356. getmysql2(req, res, "updateSPtype", json["n"], json["tid"]);
  4357. });
  4358. //删除1分类
  4359. router.route("/deletePtype").all((req, res, next) => {
  4360. var json = queryString(req.url);
  4361. getmysql2(req, res, "deletePtype", json["tid"]);
  4362. });
  4363. //删除1学生项目分类
  4364. router.route("/deleteSPtype").all((req, res, next) => {
  4365. var json = queryString(req.url);
  4366. getmysql2(req, res, "deleteSPtype", json["tid"]);
  4367. });
  4368. //查询子分类列表
  4369. router.route("/selectStype").all((req, res, next) => {
  4370. var json = queryString(req.url);
  4371. getmysql(req, res, "selectStype", json["pid"], json["oid"], json["page"], 10);
  4372. });
  4373. //查询学生项目子分类列表
  4374. router.route("/selectSStype").all((req, res, next) => {
  4375. var json = queryString(req.url);
  4376. getmysql(
  4377. req,
  4378. res,
  4379. "selectSStype",
  4380. json["pid"],
  4381. json["oid"],
  4382. json["page"],
  4383. 10
  4384. );
  4385. });
  4386. //添加子分类 修1
  4387. router.route("/addStype").get((req, res, next) => {
  4388. var json = queryString(req.url);
  4389. getmysql2(
  4390. req,
  4391. res,
  4392. "addStype",
  4393. json["pid"],
  4394. json["n"],
  4395. json["uid"],
  4396. json["oid"]
  4397. );
  4398. });
  4399. //添加学生项目子分类 修1
  4400. router.route("/addSStype").get((req, res, next) => {
  4401. var json = queryString(req.url);
  4402. getmysql2(
  4403. req,
  4404. res,
  4405. "addSStype",
  4406. json["pid"],
  4407. json["n"],
  4408. json["uid"],
  4409. json["oid"]
  4410. );
  4411. });
  4412. //根据学校查询工作分类
  4413. router.route("/selectStudioPtype").all((req, res, next) => {
  4414. var json = queryString(req.url);
  4415. getmysql(req, res, "selectStudioPtype", json["page"], 10);
  4416. });
  4417. //查询工作室项目子分类列表
  4418. router.route("/selectStudioStype").all((req, res, next) => {
  4419. var json = queryString(req.url);
  4420. getmysql(
  4421. req,
  4422. res,
  4423. "selectStudioStype",
  4424. json["pid"],
  4425. json["oid"],
  4426. json["page"],
  4427. 10
  4428. );
  4429. });
  4430. //添加工作室项目子分类 修1
  4431. router.route("/addStudioStype").get((req, res, next) => {
  4432. var json = queryString(req.url);
  4433. getmysql2(
  4434. req,
  4435. res,
  4436. "addStudioStype",
  4437. json["pid"],
  4438. json["n"],
  4439. json["uid"],
  4440. json["oid"]
  4441. );
  4442. });
  4443. //修改工作项目分类 修1
  4444. router.route("/updateStudioPtype").get((req, res, next) => {
  4445. var json = queryString(req.url);
  4446. getmysql2(req, res, "updateStudioPtype", json["n"], json["tid"]);
  4447. });
  4448. //删除1工作项目分类
  4449. router.route("/deleteStudioPtype").all((req, res, next) => {
  4450. var json = queryString(req.url);
  4451. getmysql2(req, res, "deleteStudioPtype", json["tid"]);
  4452. });
  4453. //查看本校所有学生(分页)
  4454. router.route("/selectAllStudent").all((req, res, next) => {
  4455. var json = queryString(req.url);
  4456. getmysql(
  4457. req,
  4458. res,
  4459. "selectAllStudent",
  4460. json["oid"],
  4461. json["cn"],
  4462. json["cid"],
  4463. json["page"],
  4464. 10
  4465. );
  4466. });
  4467. //查看本校所有学生(分页)teacher
  4468. router.route("/selectAllStudentTeacher").all((req, res, next) => {
  4469. var json = queryString(req.url);
  4470. getmysql(
  4471. req,
  4472. res,
  4473. "selectAllStudentTeacher",
  4474. json["oid"],
  4475. json["cn"],
  4476. json["cid"],
  4477. json["userid"],
  4478. json["page"],
  4479. 10
  4480. );
  4481. });
  4482. //根据学校id查询子分类
  4483. router.route("/selectTypeByOid").all((req, res, next) => {
  4484. var json = queryString(req.url);
  4485. getmysql(req, res, "selectTypeByOid", json["oid"]);
  4486. });
  4487. //根据学校id查询子分类
  4488. router.route("/selectTypeByOrg").all((req, res, next) => {
  4489. var json = queryString(req.url);
  4490. getmysql(req, res, "selectTypeByOid", json["oid"]);
  4491. });
  4492. //根据组织id查询子分类
  4493. router.route("/selectStudentTypeByOid").all((req, res, next) => {
  4494. var json = queryString(req.url);
  4495. getmysql(req, res, "selectStudentTypeByOid", json["oid"]);
  4496. });
  4497. //更加父id查询分类
  4498. router.route("/selectTypeByPid").all((req, res, next) => {
  4499. var json = queryString(req.url);
  4500. getmysql(req, res, "selectTypeByPid", json["pid"]);
  4501. });
  4502. //点击工具计数 修1
  4503. router.route("/insertToolsCount").get((req, res, next) => {
  4504. var json = queryString(req.url);
  4505. getmysql2(
  4506. req,
  4507. res,
  4508. "insertToolsCount",
  4509. json["cid"],
  4510. json["chid"],
  4511. json["uid"],
  4512. json["tid"],
  4513. json["count"]
  4514. );
  4515. });
  4516. //修改工具次数 修1
  4517. router.route("/updateToolsCount").get((req, res, next) => {
  4518. var json = queryString(req.url);
  4519. getmysql2(
  4520. req,
  4521. res,
  4522. "updateToolsCount",
  4523. json["cid"],
  4524. json["chid"],
  4525. json["uid"],
  4526. json["tid"],
  4527. json["count"]
  4528. );
  4529. });
  4530. //查询工具次数
  4531. router.route("/selectToolsCount").all((req, res, next) => {
  4532. var json = queryString(req.url);
  4533. getmysql(
  4534. req,
  4535. res,
  4536. "selectToolsCount",
  4537. json["cid"],
  4538. json["chid"],
  4539. json["uid"]
  4540. );
  4541. });
  4542. //导出学生
  4543. router.route("/selectUserBySchool").all((req, res, next) => {
  4544. var json = queryString(req.url);
  4545. getmysql(req, res, "selectUserBySchool", json["oid"]);
  4546. });
  4547. //上传学生作业 修1
  4548. router.route("/insertSWork").get((req, res, next) => {
  4549. var json = queryString(req.url);
  4550. getmysql2(
  4551. req,
  4552. res,
  4553. "insertSWork",
  4554. json["uid"],
  4555. json["cid"],
  4556. json["p"],
  4557. json["t"],
  4558. json["upload"]
  4559. );
  4560. });
  4561. //查询学生作业
  4562. router.route("/selectSWork").all((req, res, next) => {
  4563. var json = queryString(req.url);
  4564. getmysql(
  4565. req,
  4566. res,
  4567. "selectSWork",
  4568. json["uid"],
  4569. json["cid"],
  4570. json["p"],
  4571. json["type"]
  4572. );
  4573. });
  4574. //课程进展数据
  4575. router.route("/selectCase").all((req, res, next) => {
  4576. var json = queryString(req.url);
  4577. getmysql(req, res, "selectCase", json["org"]);
  4578. });
  4579. //课程进展数据
  4580. router.route("/selectCase2").all((req, res, next) => {
  4581. var json = queryString(req.url);
  4582. getmysql(req, res, "selectCase2", json["org"]);
  4583. });
  4584. //课程进展数据
  4585. router.route("/selectCase3").all((req, res, next) => {
  4586. var json = queryString(req.url);
  4587. getmysql(
  4588. req,
  4589. res,
  4590. "selectCase3",
  4591. json["org"],
  4592. json["oid"],
  4593. json["page"],
  4594. json["pageSize"]
  4595. );
  4596. });
  4597. //课程进展数据
  4598. router.route("/selectCase4").all((req, res, next) => {
  4599. var json = queryString(req.url);
  4600. getmysql(
  4601. req,
  4602. res,
  4603. "selectCase4",
  4604. json["org"],
  4605. json["oid"],
  4606. json["typeA"],
  4607. json["typeB"],
  4608. json["typeC"],
  4609. json["typeD"],
  4610. json["typeE"],
  4611. json["page"],
  4612. json["pageSize"]
  4613. );
  4614. });
  4615. //项目进展数据
  4616. router.route("/selectCaseS").all((req, res, next) => {
  4617. var json = queryString(req.url);
  4618. getmysql(req, res, "selectCaseS", json["org"], json["oid"]);
  4619. });
  4620. //项目进展数据
  4621. router.route("/selectCaseS2").all((req, res, next) => {
  4622. var json = queryString(req.url);
  4623. getmysql(
  4624. req,
  4625. res,
  4626. "selectCaseS2",
  4627. json["org"],
  4628. json["oid"],
  4629. json["type"],
  4630. json["page"],
  4631. json["pageSize"]
  4632. );
  4633. });
  4634. //查询赛事项目列表
  4635. router.route("/selectRaceList").all((req, res, next) => {
  4636. var json = queryString(req.url);
  4637. getmysql(req, res, "selectRaceList", json["uid"], json["t"]);
  4638. });
  4639. //修改赛事状态 修1
  4640. router.route("/updateRaceState").get((req, res, next) => {
  4641. var json = queryString(req.url);
  4642. getmysql2(req, res, "updateRaceState", json["id"], json["s"]);
  4643. });
  4644. //查询赛事项目详情
  4645. router.route("/selectRaceDetail").all((req, res, next) => {
  4646. var json = queryString(req.url);
  4647. getmysql(req, res, "selectRaceDetail", json["id"]);
  4648. });
  4649. //race 查询学校
  4650. router.route("/getSchool").all((req, res, next) => {
  4651. var json = queryString(req.url);
  4652. getmysql(req, res, "getSchool", json["n"]);
  4653. });
  4654. //查询我的学习报告
  4655. router.route("/selectMrEva").all((req, res, next) => {
  4656. var json = queryString(req.url);
  4657. getmysql(req, res, "selectMrEva", json["uid"], json["oid"], json["cid"]);
  4658. });
  4659. //查询行为数据库
  4660. router.route("/selectModelList").all((req, res, next) => {
  4661. var json = queryString(req.url);
  4662. getmysql(req, res, "selectModelList", json["cn"], json["oid"]);
  4663. });
  4664. //lsc
  4665. //admin 查询学校
  4666. router.route("/getSchoolAdmin").all((req, res, next) => {
  4667. var json = queryString(req.url);
  4668. getmysql(req, res, "select_school", json["page"], 10);
  4669. });
  4670. //admin 添加学校
  4671. router.route("/addSchoolAdmin").all((req, res, next) => {
  4672. postmysql(req, res, "add_school");
  4673. });
  4674. //组织添加学校
  4675. router.route("/addSchoolOrg").all((req, res, next) => {
  4676. postmysql(req, res, "addSchoolOrg");
  4677. });
  4678. //教师端组织添加学校
  4679. router.route("/insertSchoolByOrg").all((req, res, next) => {
  4680. postmysql(req, res, "insertSchoolByOrg");
  4681. });
  4682. //admin 删除学校
  4683. router.route("/deleteSchoolAdmin").all((req, res, next) => {
  4684. postmysql(req, res, "delete_school");
  4685. });
  4686. //admin 查询班级
  4687. router.route("/getClassAdmin").all((req, res, next) => {
  4688. var json = queryString(req.url);
  4689. getmysql(req, res, "select_classAdmin", json["cn"], json["page"], 10);
  4690. });
  4691. //查询ai权限
  4692. router.route("/getAIJ").all((req, res, next) => {
  4693. getmysql(req, res, "getAIJ");
  4694. });
  4695. //admin 添加班级
  4696. router.route("/addClassAdmin").all((req, res, next) => {
  4697. postmysql(req, res, "add_classAdmin");
  4698. });
  4699. //admin 查询班级是否重复
  4700. router.route("/getClassRepeat").all((req, res, next) => {
  4701. var json = queryString(req.url);
  4702. getmysql(req, res, "select_classRepeatAdmin", json["n"], json["oid"]);
  4703. });
  4704. //查询未在此班级的学生
  4705. router.route("/getClassStudent").all((req, res, next) => {
  4706. var json = queryString(req.url);
  4707. getmysql(
  4708. req,
  4709. res,
  4710. "getClassStudent",
  4711. json["cid"],
  4712. json["oid"],
  4713. json["cn"],
  4714. json["page"],
  4715. json["num"]
  4716. );
  4717. });
  4718. //查询未在此教研室的老师
  4719. router.route("/getClassTeacher").all((req, res, next) => {
  4720. var json = queryString(req.url);
  4721. getmysql(
  4722. req,
  4723. res,
  4724. "getClassTeacher",
  4725. json["cid"],
  4726. json["oid"],
  4727. json["cn"],
  4728. json["page"],
  4729. json["num"]
  4730. );
  4731. });
  4732. //查询未在此年级的班级
  4733. router.route("/getGradeClass").all((req, res, next) => {
  4734. var json = queryString(req.url);
  4735. getmysql(
  4736. req,
  4737. res,
  4738. "getGradeClass",
  4739. json["cid"],
  4740. json["oid"],
  4741. json["cn"],
  4742. json["page"],
  4743. json["num"]
  4744. );
  4745. });
  4746. //添加学生到班级
  4747. router.route("/addClassStudent").all((req, res, next) => {
  4748. let cid = req.body[0].cid;
  4749. let student = JSON.parse(decodeURIComponent(req.body[0].student));
  4750. for (let i = 0; i < student.length; i++) {
  4751. let _userdata = [student[i]];
  4752. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
  4753. mysql.usselect(_userdata, function(ret) {
  4754. let classid = ret[0][0].classid;
  4755. if (!classid || classid.indexOf(cid) == -1) {
  4756. classid = classid ? classid.split(",") : [];
  4757. classid.push(cid);
  4758. let _userdata2 = [student[i], classid.join(",")];
  4759. _userdata2.unshift(
  4760. _mysqlLabor[0],
  4761. _mysqlLabor[1],
  4762. "updateStudentClass"
  4763. );
  4764. mysql.usselect(_userdata2, function(ret) {
  4765. if (i == student.length - 1) {
  4766. res.end(JSON.stringify({ success: 1 }));
  4767. }
  4768. });
  4769. }
  4770. });
  4771. }
  4772. });
  4773. //添加老师到教研室
  4774. router.route("/addClassTeacher").all((req, res, next) => {
  4775. let cid = req.body[0].cid;
  4776. let student = JSON.parse(decodeURIComponent(req.body[0].student));
  4777. for (let i = 0; i < student.length; i++) {
  4778. let _userdata = [student[i]];
  4779. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
  4780. mysql.usselect(_userdata, function(ret) {
  4781. let classid = ret[0][0].cclassid;
  4782. if (!classid || classid.indexOf(cid) == -1) {
  4783. classid = classid ? classid.split(",") : [];
  4784. classid.push(cid);
  4785. let _userdata2 = [student[i], classid.join(",")];
  4786. _userdata2.unshift(
  4787. _mysqlLabor[0],
  4788. _mysqlLabor[1],
  4789. "updateTeacherClass"
  4790. );
  4791. mysql.usselect(_userdata2, function(ret) {
  4792. if (i == student.length - 1) {
  4793. res.end(JSON.stringify({ success: 1 }));
  4794. }
  4795. });
  4796. }
  4797. });
  4798. }
  4799. });
  4800. //添加班级到年级
  4801. router.route("/addGradeClass").all((req, res, next) => {
  4802. let cid = req.body[0].cid;
  4803. let student = JSON.parse(decodeURIComponent(req.body[0].student));
  4804. for (let i = 0; i < student.length; i++) {
  4805. let _userdata = [cid, student[i]];
  4806. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "addGradeClass");
  4807. mysql.usselect(_userdata, function(ret) {
  4808. if (i == student.length - 1) {
  4809. res.end(JSON.stringify({ success: 1 }));
  4810. }
  4811. });
  4812. }
  4813. });
  4814. //移除学生此班级
  4815. router.route("/deleteClassStudent").all((req, res, next) => {
  4816. let cid = req.body[0].cid;
  4817. let student = req.body[0].uid;
  4818. let _userdata = [student];
  4819. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
  4820. mysql.usselect(_userdata, function(ret) {
  4821. let classid = ret[0][0].classid;
  4822. if (classid.indexOf(cid) != -1) {
  4823. classid = classid.split(",");
  4824. classid.splice(classid.indexOf(cid), 1);
  4825. let _userdata2 = [student, classid.join(",")];
  4826. _userdata2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudentClass");
  4827. mysql.usselect(_userdata2, function(ret) {
  4828. res.end(JSON.stringify({ success: 1 }));
  4829. });
  4830. }
  4831. });
  4832. });
  4833. //移除学生此班级
  4834. router.route("/deleteClassTeacher").all((req, res, next) => {
  4835. let cid = req.body[0].cid;
  4836. let student = req.body[0].uid;
  4837. let _userdata = [student];
  4838. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "selectUser");
  4839. mysql.usselect(_userdata, function(ret) {
  4840. let classid = ret[0][0].cclassid;
  4841. if (classid.indexOf(cid) != -1) {
  4842. classid = classid.split(",");
  4843. classid.splice(classid.indexOf(cid), 1);
  4844. let _userdata2 = [student, classid.join(",")];
  4845. _userdata2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateTeacherClass");
  4846. mysql.usselect(_userdata2, function(ret) {
  4847. res.end(JSON.stringify({ success: 1 }));
  4848. });
  4849. }
  4850. });
  4851. });
  4852. //移除班级
  4853. router.route("/deleteGradeClass").all((req, res, next) => {
  4854. let cid = req.body[0].cid;
  4855. let student = req.body[0].uid;
  4856. let _userdata = ['', student];
  4857. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "addGradeClass");
  4858. mysql.usselect(_userdata, function(ret) {
  4859. res.end(JSON.stringify({ success: 1 }));
  4860. });
  4861. });
  4862. //admin 发布通知
  4863. router.route("/addNews").all((req, res, next) => {
  4864. postmysql(req, res, "add_news");
  4865. });
  4866. //admin 删除通知
  4867. router.route("/deleteNews").all((req, res, next) => {
  4868. postmysql(req, res, "delete_news");
  4869. });
  4870. //admin 添加banner
  4871. router.route("/addBanner").all((req, res, next) => {
  4872. postmysql(req, res, "add_banner");
  4873. });
  4874. //admin 添加banner
  4875. router.route("/deleteBanner").all((req, res, next) => {
  4876. postmysql(req, res, "delete_banner");
  4877. });
  4878. //admin 查询banner
  4879. router.route("/getBanner").all((req, res, next) => {
  4880. var json = queryString(req.url);
  4881. getmysql(req, res, "select_banner");
  4882. });
  4883. //根据学校查询banner
  4884. router.route("/selectBannerByOid").all((req, res, next) => {
  4885. var json = queryString(req.url);
  4886. getmysql(req, res, "selectBannerByOid", json["oid"]);
  4887. });
  4888. //admin 查询banner
  4889. router.route("/getBannerS").all((req, res, next) => {
  4890. var json = queryString(req.url);
  4891. getmysql(req, res, "getBannerS");
  4892. });
  4893. //根据学校查询banner
  4894. router.route("/selectBannerByOidS").all((req, res, next) => {
  4895. var json = queryString(req.url);
  4896. getmysql(req, res, "selectBannerByOidS", json["oid"]);
  4897. });
  4898. //admin 查询课程getSearchCourse
  4899. router.route("/getSearchCourse").all((req, res, next) => {
  4900. var json = queryString(req.url);
  4901. getmysql(req, res, "selectAll_courseSearch", json["t"]);
  4902. });
  4903. //根据学校查询课程
  4904. router.route("/getSearchCourseByoid").all((req, res, next) => {
  4905. var json = queryString(req.url);
  4906. getmysql(req, res, "selectAll_courseByOid", json["t"], json["oid"]);
  4907. });
  4908. //admin 查询所有课程专区
  4909. router.route("/getZone").all((req, res, next) => {
  4910. getmysql(req, res, "select_zone");
  4911. });
  4912. //admin 添加课程专区
  4913. router.route("/addZone").all((req, res, next) => {
  4914. postmysql(req, res, "insert_classZone");
  4915. });
  4916. //评审
  4917. router.route("/reviewCourse").all((req, res, next) => {
  4918. postmysql(req, res, "reviewCourse");
  4919. });
  4920. //查询评审
  4921. router.route("/getReview").all((req, res, next) => {
  4922. var json = queryString(req.url);
  4923. getmysql(req, res, "getReview", json["cid"]);
  4924. });
  4925. //查询所有课程专区下的课程
  4926. router.route("/getZoneClass").all((req, res, next) => {
  4927. var json = queryString(req.url);
  4928. getmysql(
  4929. req,
  4930. res,
  4931. "select_zoneClass",
  4932. json["bid"],
  4933. json["oid"],
  4934. json["page"],
  4935. 10
  4936. );
  4937. });
  4938. //查询所有课程专区下的课程
  4939. router.route("/getZoneClass").all((req, res, next) => {
  4940. var json = queryString(req.url);
  4941. getmysql(
  4942. req,
  4943. res,
  4944. "select_zoneClass",
  4945. json["bid"],
  4946. json["oid"],
  4947. json["page"],
  4948. 10
  4949. );
  4950. });
  4951. //查询所有课程专区下的课程
  4952. router.route("/getZoneClassStudent").all((req, res, next) => {
  4953. var json = queryString(req.url);
  4954. getmysql(
  4955. req,
  4956. res,
  4957. "select_zoneClass",
  4958. json["bid"],
  4959. json["oid"],
  4960. json["page"],
  4961. 20
  4962. );
  4963. });
  4964. //admin 后台查看专区下课程的数量
  4965. router.route("/getZoneClassNum").all((req, res, next) => {
  4966. var json = queryString(req.url);
  4967. getmysql(req, res, "select_zoneClassNum", json["bid"]);
  4968. });
  4969. //admin 后台添加课程专区时查看课程是否在此专区重复
  4970. router.route("/getZoneClassRepeat").all((req, res, next) => {
  4971. var json = queryString(req.url);
  4972. getmysql(req, res, "select_zoneClassRepeat", json["pid"], json["cid"]);
  4973. });
  4974. //把课程添加进专区
  4975. router.route("/addZoneCourse").all((req, res, next) => {
  4976. postmysql(req, res, "insert_app");
  4977. });
  4978. //admin 删除课程专区底下的课程
  4979. router.route("/deleteZoneCourse").all((req, res, next) => {
  4980. postmysql(req, res, "delete_app");
  4981. });
  4982. //admin 删除班级
  4983. router.route("/deleteZone").all((req, res, next) => {
  4984. postmysql(req, res, "delete_zone");
  4985. });
  4986. //admin 后台专区上移下移
  4987. router.route("/zoneRank").all((req, res, next) => {
  4988. postmysql(req, res, "update_classRank");
  4989. });
  4990. //admin 添加模板文档
  4991. router.route("/addTemplateAdmin").all((req, res, next) => {
  4992. postmysql(req, res, "add_template");
  4993. });
  4994. //admin 添加模板文档
  4995. router.route("/deleteTemplateAdmin").all((req, res, next) => {
  4996. postmysql(req, res, "delete_template");
  4997. });
  4998. //admin 查询模板文档
  4999. router.route("/getTemplateAdmin").all((req, res, next) => {
  5000. var json = queryString(req.url);
  5001. getmysql(req, res, "select_template", json["page"], 10);
  5002. });
  5003. //查询上传作业
  5004. router.route("/getCourseWorks").all((req, res, next) => {
  5005. var json = queryString(req.url); //cid 课程id,page 页数
  5006. getmysql(
  5007. req,
  5008. res,
  5009. "select_courseWorks",
  5010. json["cid"],
  5011. json["stage"],
  5012. json["task"],
  5013. json["page"],
  5014. 10
  5015. );
  5016. });
  5017. //查询上传作业
  5018. router.route("/getCourseWorks2").all((req, res, next) => {
  5019. var json = queryString(req.url); //cid 课程id,page 页数
  5020. getmysql(
  5021. req,
  5022. res,
  5023. "select_courseWorks2",
  5024. json["cid"],
  5025. json["uname"],
  5026. json["stage"],
  5027. json["task"],
  5028. json["page"],
  5029. 10
  5030. );
  5031. });
  5032. //查询上传作业
  5033. router.route("/getCourseWorks3").all((req, res, next) => {
  5034. var json = queryString(req.url); //cid 课程id,page 页数
  5035. getmysql(
  5036. req,
  5037. res,
  5038. "select_courseWorks3",
  5039. json["cid"],
  5040. json["uname"],
  5041. json["stage"],
  5042. json["task"],
  5043. json["page"],
  5044. 10
  5045. );
  5046. });
  5047. //查询上传作业
  5048. router.route("/getCourseWorks3Copy").all((req, res, next) => {
  5049. var json = queryString(req.url); //cid 课程id,page 页数
  5050. getmysql(
  5051. req,
  5052. res,
  5053. "getCourseWorks3Copy",
  5054. json["cid"],
  5055. json["uname"],
  5056. json["stage"],
  5057. json["task"],
  5058. json["page"],
  5059. 10
  5060. );
  5061. });
  5062. //查询上传作业y
  5063. router.route("/getCourseWorks3Copy1").all((req, res, next) => {
  5064. var json = queryString(req.url); //cid 课程id,page 页数
  5065. getmysql(
  5066. req,
  5067. res,
  5068. "getCourseWorks3Copy1",
  5069. json["cid"],
  5070. json["uCla"],
  5071. json["uname"],
  5072. json["tck"],
  5073. json["stage"],
  5074. json["task"],
  5075. json["page"],
  5076. 10
  5077. );
  5078. });
  5079. //评价管理查看报告-学生上下切换功能
  5080. router.route("/getCourseWorksList").all((req, res, next) => {
  5081. var json = queryString(req.url); //cid 课程id
  5082. getmysql(
  5083. req,
  5084. res,
  5085. "getCourseWorksList",
  5086. json["cid"]
  5087. );
  5088. });
  5089. //评价管理查看报告筛选获取班级
  5090. router.route("/getCourseReportClassList").all((req, res, next) => {
  5091. var json = queryString(req.url); //cid 课程id
  5092. getmysql(
  5093. req,
  5094. res,
  5095. "getCourseReportClassList",
  5096. json["cid"]
  5097. );
  5098. });
  5099. //查询上传作业--加上筛选班级
  5100. router.route("/getCourseWorks5").all((req, res, next) => {
  5101. var json = queryString(req.url); //cid 课程id,page 页数
  5102. getmysql(
  5103. req,
  5104. res,
  5105. "select_courseWorks5",
  5106. json["cid"],
  5107. json["uname"],
  5108. json["choseClass"],
  5109. json["stage"],
  5110. json["task"],
  5111. json["page"],
  5112. 10
  5113. );
  5114. });
  5115. //查询上传作业--加上筛选班级
  5116. router.route("/getCourseStageWorks").all((req, res, next) => {
  5117. var json = queryString(req.url); //cid 课程id,page 页数
  5118. getmysql(
  5119. req,
  5120. res,
  5121. "getCourseStageWorks",
  5122. json["cid"],
  5123. json["uname"],
  5124. json["choseClass"],
  5125. json["stage"],
  5126. json["task"],
  5127. json["page"],
  5128. 10
  5129. );
  5130. });
  5131. //查询上传作业--加上筛选班级
  5132. router.route("/getCourseStageWorks2").all((req, res, next) => {
  5133. var json = queryString(req.url); //cid 课程id,page 页数
  5134. getmysql(
  5135. req,
  5136. res,
  5137. "getCourseStageWorks2",
  5138. json["cid"],
  5139. json["uname"],
  5140. json["choseClass"],
  5141. json["stage"],
  5142. json["task"]
  5143. );
  5144. });
  5145. //查询上传作业--加上筛选班级
  5146. router.route("/getCourseTaskWorks").all((req, res, next) => {
  5147. var json = queryString(req.url); //cid 课程id,page 页数
  5148. getmysql(
  5149. req,
  5150. res,
  5151. "getCourseTaskWorks",
  5152. json["cid"],
  5153. json["uname"],
  5154. json["choseClass"],
  5155. json["stage"],
  5156. json["task"],
  5157. json["page"],
  5158. 10
  5159. );
  5160. });
  5161. //查询上传作业--加上筛选班级
  5162. router.route("/getCourseTaskWorks2").all((req, res, next) => {
  5163. var json = queryString(req.url); //cid 课程id,page 页数
  5164. getmysql(
  5165. req,
  5166. res,
  5167. "getCourseTaskWorks2",
  5168. json["cid"],
  5169. json["uname"],
  5170. json["choseClass"],
  5171. json["stage"],
  5172. json["task"]
  5173. );
  5174. });
  5175. //查询所有学生上传作业--加上筛选班级
  5176. router.route("/getCourseWorks6").all((req, res, next) => {
  5177. var json = queryString(req.url); //cid 课程id,page 页数
  5178. getmysql(
  5179. req,
  5180. res,
  5181. "select_courseWorks6",
  5182. json["cid"],
  5183. json["uname"],
  5184. json['choseClass'],
  5185. json["stage"],
  5186. json["task"]
  5187. );
  5188. });
  5189. //查询所有学生上传作业
  5190. router.route("/getCourseWorks4").all((req, res, next) => {
  5191. var json = queryString(req.url); //cid 课程id,page 页数
  5192. getmysql(
  5193. req,
  5194. res,
  5195. "select_courseWorks4",
  5196. json["cid"],
  5197. json["uname"],
  5198. json["stage"],
  5199. json["task"]
  5200. );
  5201. });
  5202. //查询学生课程作业
  5203. router.route("/selectStudentCourseWorks").all((req, res, next) => {
  5204. var json = queryString(req.url); //cid 课程id,page 页数
  5205. getmysql(
  5206. req,
  5207. res,
  5208. "selectStudentCourseWorks",
  5209. json["uid"],
  5210. json["cid"],
  5211. json["stage"],
  5212. json["task"],
  5213. json["page"],
  5214. 10
  5215. );
  5216. });
  5217. //查询学生课程作业
  5218. router.route("/selectStudentCourseWorksTwo").all((req, res, next) => {
  5219. var json = queryString(req.url); //cid 课程id,page 页数
  5220. getmysql(
  5221. req,
  5222. res,
  5223. "selectStudentCourseWorksTwo",
  5224. json["uid"],
  5225. json["cname"],
  5226. json["uClass"],
  5227. json["page"],
  5228. 10
  5229. );
  5230. });
  5231. //查询学生课程作业
  5232. router.route("/selectStudentCourseWorksTwo2").all((req, res, next) => {
  5233. var json = queryString(req.url); //cid 课程id,page 页数
  5234. getmysql(
  5235. req,
  5236. res,
  5237. "selectStudentCourseWorksTwo2",
  5238. json["uid"],
  5239. json["cname"],
  5240. json["uClass"],
  5241. json["userid"],
  5242. json["page"],
  5243. 10
  5244. );
  5245. });
  5246. //查询报告数据
  5247. router.route("/getCourseWorksReport").all((req, res, next) => {
  5248. var json = queryString(req.url); //cid 课程id,page 页数
  5249. getmysql(req, res, "getCourseWorksReport", json["cid"]);
  5250. });
  5251. //查询报告数据y
  5252. router.route("/getCourseWorksReport1").all((req, res, next) => {
  5253. var json = queryString(req.url); //cid 课程id
  5254. getmysql(req, res, "getCourseWorksReport1", json["cid"]);
  5255. });
  5256. //查询报告数据--根据班级
  5257. router.route("/getCourseWorksReport2").all((req, res, next) => {
  5258. var json = queryString(req.url); //cid 课程id,page 页数
  5259. getmysql(req, res, "getCourseWorksReport2", json["cid"],json["choseClass"]);
  5260. });
  5261. //查询dyList
  5262. router.route("/getCourseWorksDyList").all((req, res, next) => {
  5263. var json = queryString(req.url); //cid 课程id,page 页数
  5264. getmysql(req, res, "getCourseWorksDyList", json["cid"]);
  5265. });
  5266. //查询多个课程报告数据
  5267. router.route("/getCourseWorksReportMore").all((req, res, next) => {
  5268. var json = queryString(req.url); //cid 课程id,page 页数
  5269. getmysql(req, res, "getCourseWorksReportMore", json["cid"]);
  5270. });
  5271. //查询学生课程报告数据
  5272. router.route("/getStudentCourseWorksReport").all((req, res, next) => {
  5273. var json = queryString(req.url); //cid 课程id,page 页数
  5274. getmysql(req, res, "getStudentCourseWorksReport", json["uid"]);
  5275. });
  5276. //admin 添加项目模板文档
  5277. router.route("/addCourseTemplateAdmin").all((req, res, next) => {
  5278. postmysql(req, res, "add_courseTemplate");
  5279. });
  5280. //admin 添加项目模板文档
  5281. router.route("/deleteCourseTemplateAdmin").all((req, res, next) => {
  5282. postmysql(req, res, "delete_courseTemplate");
  5283. });
  5284. //admin 查询项目模板文档
  5285. router.route("/getCourseTemplateAdmin").all((req, res, next) => {
  5286. var json = queryString(req.url);
  5287. getmysql(req, res, "select_courseTemplate", json["page"], 10);
  5288. });
  5289. //teacher 查询项目模板
  5290. router.route("/getCourseTemplateT").all((req, res, next) => {
  5291. var json = queryString(req.url);
  5292. getmysql(req, res, "select_courseTemplateT");
  5293. });
  5294. //teacher 查询项目模板
  5295. router.route("/getTrainCourseTemplateT").all((req, res, next) => {
  5296. var json = queryString(req.url);
  5297. getmysql(req, res, "getTrainCourseTemplateT");
  5298. });
  5299. //teacher 查询项目模板
  5300. router.route("/getCourseTemplateTByOid").all((req, res, next) => {
  5301. var json = queryString(req.url);
  5302. getmysql(req, res, "getCourseTemplateTByOid", json["oid"]);
  5303. });
  5304. //teacher 查询项目模板
  5305. router.route("/getTrainCourseTemplateTByOid").all((req, res, next) => {
  5306. var json = queryString(req.url);
  5307. getmysql(req, res, "getTrainCourseTemplateTByOid", json["oid"]);
  5308. });
  5309. //目标管理查询目标模板
  5310. router.route("/selectEvaTemplate").all((req, res, next) => {
  5311. var json = queryString(req.url);
  5312. getmysql(req, res, "select_evaTemplate", json["oid"]);
  5313. });
  5314. //目标管理新增目标模板 修1
  5315. router.route("/addEvaTemplate").get((req, res, next) => {
  5316. var json = queryString(req.url);
  5317. getmysql2(req, res, "add_evaTemplate", json["t"], json["c"], json["uid"], json["oid"]);
  5318. });
  5319. //teacher 查询项目模板
  5320. router.route("/getCourseTemplateTs").all((req, res, next) => {
  5321. var json = queryString(req.url);
  5322. getmysql(req, res, "getCourseTemplateTs", json["oid"]);
  5323. });
  5324. //teacher 查询项目模板
  5325. router.route("/getCourseTemplateTStudio").all((req, res, next) => {
  5326. var json = queryString(req.url);
  5327. getmysql(req, res, "getCourseTemplateTStudio", json["oid"]);
  5328. });
  5329. //admin 查询课程
  5330. router.route("/getCourseAdmin").all((req, res, next) => {
  5331. var json = queryString(req.url);
  5332. getmysql(req, res, "select_courseAdmin", json["cn"], json["page"], 10);
  5333. });
  5334. //admin 查询模板文档
  5335. router.route("/deleteCourseAdmin").all((req, res, next) => {
  5336. postmysql(req, res, "delete_courseAdmin");
  5337. });
  5338. //设置分组
  5339. router.route("/setCourseGroup").all((req, res, next) => {
  5340. postmysql(req, res, "setCourseGroup");
  5341. });
  5342. //删除分组
  5343. router.route("/deleteCourseGroup").all((req, res, next) => {
  5344. postmysql(req, res, "deleteCourseGroup");
  5345. });
  5346. //获取分组
  5347. router.route("/getCourseGroup").all((req, res, next) => {
  5348. var json = queryString(req.url);
  5349. getmysql(req, res, "getCourseGroup", json["cid"], json["classid"]);
  5350. });
  5351. //获取分组
  5352. router.route("/getCourseGroup2").all((req, res, next) => {
  5353. var json = queryString(req.url);
  5354. getmysql(req, res, "getCourseGroup2", json["cid"], json["classid"]);
  5355. });
  5356. //加入分组
  5357. router.route("/joinCourseGroup").all((req, res, next) => {
  5358. postmysql(req, res, "joinCourseGroup");
  5359. });
  5360. //退出分组
  5361. router.route("/exitCourseGroup").all((req, res, next) => {
  5362. postmysql(req, res, "exitCourseGroup");
  5363. });
  5364. //加入分组
  5365. router.route("/joinGroup").all((req, res, next) => {
  5366. postmysql(req, res, "joinGroup");
  5367. });
  5368. //退出分组
  5369. router.route("/exitGroup").all((req, res, next) => {
  5370. postmysql(req, res, "exitGroup");
  5371. });
  5372. //查看分组
  5373. router.route("/selectGroup").all((req, res, next) => {
  5374. postmysql(req, res, "selectGroup");
  5375. });
  5376. //查询pblstudent 分页
  5377. router.route("/selectPblStudent").all((req, res, next) => {
  5378. var json = queryString(req.url);
  5379. getmysql(req, res, "selectPblStudent", json["uid"], json["org"], json["oid"], json["type"], json["n"], json["page"], json["int"]);
  5380. });
  5381. //删除pblstudent 传courseid
  5382. router.route("/deletePblStudent").all((req, res, next) => {
  5383. postmysql(req, res, "deletePblStudent");
  5384. });
  5385. //查询pblstudent单个项目详情
  5386. router.route("/selectPblStudentDetail").all((req, res, next) => {
  5387. var json = queryString(req.url);
  5388. getmysql(req, res, "selectPblStudentDetail", json["cid"]);
  5389. });
  5390. //添加pblstudent 传uid 用户id t 标题 n 选题
  5391. router.route("/addPblStudent").all((req, res, next) => {
  5392. postmysql(req, res, "addPblStudent");
  5393. });
  5394. //修改pblstudentjson内容 传 cid 课程id chapters内容
  5395. router.route("/updatePblStudentChapters").all((req, res, next) => {
  5396. postmysql(req, res, "updatePblStudentChapters");
  5397. });
  5398. //修改pblstudent 所属已完成位置 传 cid 课程id doi 已完成位置传数字
  5399. router.route("/updatePblStudentDoIndex").all((req, res, next) => {
  5400. postmysql(req, res, "updatePblStudentDoIndex");
  5401. });
  5402. //课堂观察 对比分析查询
  5403. router.route("/select_contrastObservation_data").all((req, res, next) => {
  5404. postmysql(req, res, "select_contrastObservation_data");
  5405. });
  5406. //课堂观察 对比分析查询
  5407. router.route("/update_contrastObservation_data").all((req, res, next) => {
  5408. postmysql(req, res, "update_contrastObservation_data");
  5409. });
  5410. //查询ppt在哪页
  5411. router.route("/selectPptPage").all((req, res, next) => {
  5412. var json = queryString(req.url);
  5413. getmysql(req, res, "selectPptPage", json["id"]);
  5414. });
  5415. //修改ppt页码
  5416. router.route("/updatePptPage").all((req, res, next) => {
  5417. postmysql(req, res, "updatePptPage");
  5418. });
  5419. //修改ppt操作
  5420. router.route("/updatePPTHandle").all((req, res, next) => {
  5421. postmysql(req, res, "updatePPTHandle");
  5422. });
  5423. //查询实时课堂
  5424. router.route("/getRealTimeClass").all((req, res, next) => {
  5425. var json = queryString(req.url);
  5426. getmysql(
  5427. req,
  5428. res,
  5429. "getRealTimeClass",
  5430. json["cn"],
  5431. json["uid"],
  5432. json["page"],
  5433. 10
  5434. );
  5435. });
  5436. //查询实时课堂学生
  5437. router.route("/getRealTimeClassStu").all((req, res, next) => {
  5438. var json = queryString(req.url);
  5439. getmysql(
  5440. req,
  5441. res,
  5442. "getRealTimeClassStu",
  5443. json["oid"],
  5444. json["cid"],
  5445. json["page"],
  5446. 10
  5447. );
  5448. });
  5449. //查询实时课堂学生
  5450. router.route("/getRealTimeClassById").all((req, res, next) => {
  5451. var json = queryString(req.url);
  5452. getmysql(req, res, "getRealTimeClassById", json["id"]);
  5453. });
  5454. //根据区级管理者查询案例
  5455. router.route("/selectAnliList").all((req, res, next) => {
  5456. var json = queryString(req.url);
  5457. getmysql(
  5458. req,
  5459. res,
  5460. "selectAnliList",
  5461. json["typea"],
  5462. json["typeb"],
  5463. json["typec"],
  5464. json["typed"],
  5465. json["typeE"],
  5466. json["cn"],
  5467. json["cid"],
  5468. json["title"],
  5469. json["page"],
  5470. 10
  5471. );
  5472. });
  5473. //根据区级管理者查询案例
  5474. router.route("/selectAnliListGM").all((req, res, next) => {
  5475. var json = queryString(req.url);
  5476. getmysql(
  5477. req,
  5478. res,
  5479. "selectAnliListGM",
  5480. json["typea"],
  5481. json["typeb"],
  5482. json["typec"],
  5483. json["typed"],
  5484. json["typeE"],
  5485. json["cn"],
  5486. json["cid"],
  5487. json["title"],
  5488. json["page"],
  5489. 10
  5490. );
  5491. });
  5492. //根据市级管理者查询案例
  5493. router.route("/selectAnliList1").all((req, res, next) => {
  5494. var json = queryString(req.url);
  5495. getmysql(
  5496. req,
  5497. res,
  5498. "selectAnliList1",
  5499. json["typea"],
  5500. json["typeb"],
  5501. json["typec"],
  5502. json["typed"],
  5503. json["typeE"],
  5504. json["cn"],
  5505. json["cid"],
  5506. json["title"],
  5507. json["page"],
  5508. 10
  5509. );
  5510. });
  5511. //根据省级级管理者查询案例
  5512. router.route("/selectAnliList2").all((req, res, next) => {
  5513. var json = queryString(req.url);
  5514. getmysql(
  5515. req,
  5516. res,
  5517. "selectAnliList2",
  5518. json["typea"],
  5519. json["typeb"],
  5520. json["typec"],
  5521. json["typed"],
  5522. json["typeE"],
  5523. json["cn"],
  5524. json["cid"],
  5525. json["title"],
  5526. json["page"],
  5527. 10
  5528. );
  5529. });
  5530. //删除1案例
  5531. router.route("/deleteAnli").all((req, res, next) => {
  5532. var json = queryString(req.url);
  5533. getmysql2(req, res, "deleteAnli", json["id"]);
  5534. });
  5535. //根据区县管理者查询评分
  5536. router.route("/selectPoint").all((req, res, next) => {
  5537. var json = queryString(req.url);
  5538. getmysql(
  5539. req,
  5540. res,
  5541. "selectPoint",
  5542. json["typea"],
  5543. json["typeb"],
  5544. json["typec"],
  5545. json["typed"],
  5546. json["typeE"],
  5547. json["cn"],
  5548. json["cid"],
  5549. json["title"],
  5550. json["page"],
  5551. 10
  5552. );
  5553. });
  5554. //根据市级管理者查询评分
  5555. router.route("/selectPoint1").all((req, res, next) => {
  5556. var json = queryString(req.url);
  5557. getmysql(
  5558. req,
  5559. res,
  5560. "selectPoint1",
  5561. json["typea"],
  5562. json["typeb"],
  5563. json["typec"],
  5564. json["typed"],
  5565. json["typeE"],
  5566. json["cn"],
  5567. json["cid"],
  5568. json["title"],
  5569. json["page"],
  5570. 10
  5571. );
  5572. });
  5573. //根据市级管理者查询全部评分
  5574. router.route("/selectPointAll").all((req, res, next) => {
  5575. var json = queryString(req.url);
  5576. getmysql(
  5577. req,
  5578. res,
  5579. "selectPointAll",
  5580. json["typea"],
  5581. json["typeb"],
  5582. json["typec"],
  5583. json["typed"],
  5584. json["typeE"],
  5585. json["cn"],
  5586. json["cid"],
  5587. json["title"]
  5588. );
  5589. });
  5590. //根据市级管理者查询全部评分
  5591. router.route("/selectPointAllGM").all((req, res, next) => {
  5592. var json = queryString(req.url);
  5593. getmysql(
  5594. req,
  5595. res,
  5596. "selectPointAllGM",
  5597. json["typea"],
  5598. json["typeb"],
  5599. json["typec"],
  5600. json["typed"],
  5601. json["typeE"],
  5602. json["cn"],
  5603. json["cid"],
  5604. json["title"]
  5605. );
  5606. });
  5607. //根据市级管理者查询全部评分
  5608. router.route("/selectPointAllGM2").all((req, res, next) => {
  5609. var json = queryString(req.url);
  5610. getmysql(
  5611. req,
  5612. res,
  5613. "selectPointAllGM2",
  5614. json["typea"],
  5615. json["typeb"],
  5616. json["typec"],
  5617. json["typed"],
  5618. json["typeE"],
  5619. json["cn"],
  5620. json["cid"],
  5621. json["title"],
  5622. json["numCheck"]
  5623. );
  5624. });
  5625. //根据市级管理者查询全部评分
  5626. router.route("/selectPointAllGM2Post").all((req, res, next) => {
  5627. postmysql(req, res, "selectPointAllGM2");
  5628. });
  5629. //查询分配案例
  5630. router.route("/selectCaseUser").all((req, res, next) => {
  5631. var json = queryString(req.url);
  5632. getmysql(req, res, "select_case", json["uid"]);
  5633. });
  5634. //根据用户id,课程id,阶段,任务,工具去查询协同
  5635. router.route("/selectWord").all((req, res, next) => {
  5636. var json = queryString(req.url);
  5637. getmysql(
  5638. req,
  5639. res,
  5640. "selectWord",
  5641. json["uid"],
  5642. json["cid"],
  5643. json["s"],
  5644. json["task"],
  5645. json["t"]
  5646. );
  5647. });
  5648. //根据用户id,课程id,阶段,任务,工具去查询协同
  5649. router.route("/selectWord2").all((req, res, next) => {
  5650. var json = queryString(req.url);
  5651. getmysql(
  5652. req,
  5653. res,
  5654. "selectWord2",
  5655. json["uid"],
  5656. json["cid"],
  5657. json["s"],
  5658. json["task"],
  5659. json["t"],
  5660. json["type"]
  5661. );
  5662. });
  5663. //根据用户id,课程id,阶段,任务,工具去查询协同
  5664. router.route("/selectWords").all((req, res, next) => {
  5665. var json = queryString(req.url);
  5666. getmysql(
  5667. req,
  5668. res,
  5669. "selectWords",
  5670. json["uid"],
  5671. json["cid"],
  5672. json["s"],
  5673. json["task"],
  5674. json["t"],
  5675. json["type"]
  5676. );
  5677. });
  5678. //根据用户id,课程id,阶段,任务,工具去查询协同
  5679. router.route("/selectWordsY").all((req, res, next) => {
  5680. var json = queryString(req.url);
  5681. getmysql(
  5682. req,
  5683. res,
  5684. "selectWordsY",
  5685. json["uid"],
  5686. json["cid"],
  5687. json["s"],
  5688. json["task"],
  5689. json["t"],
  5690. json["type"]
  5691. );
  5692. });
  5693. //新增协同内容
  5694. router.route("/insertWord2y").all((req, res, next) => {
  5695. var json = queryString(req.url);
  5696. // getmysql(req, res, "insertWord2y", json["uid"], json["cid"], json["s"], json["task"], json["t"], json["text"], json["type"]);
  5697. postmysql3(req, res, "insertWord2y");
  5698. });
  5699. //新增协同内容 修1
  5700. router.route("/insertWord").get((req, res, next) => {
  5701. var json = queryString(req.url);
  5702. getmysql2(
  5703. req,
  5704. res,
  5705. "insertWord",
  5706. json["uid"],
  5707. json["cid"],
  5708. json["s"],
  5709. json["task"],
  5710. json["t"],
  5711. json["text"]
  5712. );
  5713. });
  5714. //分配案例
  5715. router.route("/insertCase").all((req, res, next) => {
  5716. if (req.body[0]) {
  5717. p = [req.body[0].uid, req.body[0].box];
  5718. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insertCase"); //執行存儲過程
  5719. mysql.usselect(p, function(ret) {
  5720. res.end(JSON.stringify({ success: 1 }));
  5721. });
  5722. }
  5723. });
  5724. //新增评分
  5725. router.route("/addScore").all((req, res, next) => {
  5726. postmysql(req, res, "addScore");
  5727. });
  5728. //添加用户标签
  5729. router.route("/add_userlabel").all((req, res, next) => {
  5730. postmysql2(req, res, "add_userlabel");
  5731. });
  5732. //查询评分
  5733. router.route("/selectScore").all((req, res, next) => {
  5734. var json = queryString(req.url);
  5735. getmysql(req, res, "selectScore", json["rid"], json["suser"]);
  5736. });
  5737. //查询所有评分
  5738. router.route("/selectAllScore").all((req, res, next) => {
  5739. var json = queryString(req.url);
  5740. getmysql(req, res, "selectAllScore");
  5741. });
  5742. //查询所有评分
  5743. router.route("/selectAllScoreGM").all((req, res, next) => {
  5744. var json = queryString(req.url);
  5745. getmysql(req, res, "selectAllScoreGM");
  5746. });
  5747. //查询所有评分
  5748. router.route("/selectAllScoreGM2").all((req, res, next) => {
  5749. var json = queryString(req.url);
  5750. getmysql(req, res, "selectAllScoreGM2", json['numCheck']);
  5751. });
  5752. //查询所有学校以及组织
  5753. router.route("/selectAllSchool").all((req, res, next) => {
  5754. var json = queryString(req.url);
  5755. getmysql(req, res, "selectAllSchool");
  5756. });
  5757. //查询所有学校以及组织
  5758. router.route("/selectAllSchoolByOid").all((req, res, next) => {
  5759. var json = queryString(req.url);
  5760. getmysql(req, res, "selectAllSchoolByOid", json['oid']);
  5761. });
  5762. //根据用户id查询评分
  5763. router.route("/selectScoreByUid").all((req, res, next) => {
  5764. var json = queryString(req.url);
  5765. getmysql(req, res, "selectScoreByUid", json["uid"]);
  5766. });
  5767. //查询单个案例所有评分
  5768. router.route("/selectAnliScore").all((req, res, next) => {
  5769. var json = queryString(req.url);
  5770. getmysql(req, res, "selectAnliScore", json["rid"]);
  5771. });
  5772. //赛事推荐 修1
  5773. router.route("/updateRaceRec").get((req, res, next) => {
  5774. var json = queryString(req.url);
  5775. getmysql2(req, res, "updateRaceRec", json["id"], json["rec"]);
  5776. });
  5777. //查询数据报告学生报告列表
  5778. router.route("/selectSr").all((req, res, next) => {
  5779. var json = queryString(req.url);
  5780. getmysql(
  5781. req,
  5782. res,
  5783. "selectSr",
  5784. json["cu"],
  5785. json["cn"],
  5786. json["oid"],
  5787. json["page"],
  5788. 10
  5789. );
  5790. });
  5791. //查询数据报告班级报告列表
  5792. router.route("/selectCr").all((req, res, next) => {
  5793. var json = queryString(req.url);
  5794. getmysql(
  5795. req,
  5796. res,
  5797. "selectCr",
  5798. json["cu"],
  5799. json["cn"],
  5800. json["oid"],
  5801. json["page"],
  5802. 10
  5803. );
  5804. });
  5805. //查询数据报告查看班级报告底下学生列表
  5806. router.route("/selectCStudent").all((req, res, next) => {
  5807. var json = queryString(req.url);
  5808. getmysql(req, res, "selectCStudent", json["cid"], json["courseid"]);
  5809. });
  5810. //查询数据报告课程报告列表
  5811. router.route("/selectCourseR").all((req, res, next) => {
  5812. var json = queryString(req.url);
  5813. getmysql(
  5814. req,
  5815. res,
  5816. "selectCourseR",
  5817. json["cu"],
  5818. json["cn"],
  5819. json["cl"],
  5820. json["oid"],
  5821. json["page"],
  5822. 10
  5823. );
  5824. });
  5825. //根据学校id查询学校底下有评价的课程
  5826. router.route("/selectCourseByOid").all((req, res, next) => {
  5827. var json = queryString(req.url);
  5828. getmysql(req, res, "selectCourseByOid", json["oid"]);
  5829. });
  5830. //根据目标id和班级id查询底下有作业的课程
  5831. router.route("/selectEvaCourse").all((req, res, next) => {
  5832. var json = queryString(req.url);
  5833. getmysql(req, res, "selectEvaCourse", json["eid"], json["cid"]);
  5834. });
  5835. //teacher 查询模板
  5836. router.route("/getTemplateT").all((req, res, next) => {
  5837. var json = queryString(req.url);
  5838. getmysql(req, res, "select_templateT");
  5839. });
  5840. //思维网格 创建房间
  5841. router.route("/insertRoom").all((req, res, next) => {
  5842. postmysql(req, res, "insertRoom");
  5843. });
  5844. //删除作业阶段任务工具
  5845. router.route("/deleteStudentToolSTT").all((req, res, next) => {
  5846. postmysql(req, res, "deleteStudentToolSTT");
  5847. });
  5848. //删除作业阶段任务
  5849. router.route("/deleteStudentToolST").all((req, res, next) => {
  5850. postmysql(req, res, "deleteStudentToolST");
  5851. });
  5852. //删除作业阶段
  5853. router.route("/deleteStudentToolS").all((req, res, next) => {
  5854. postmysql(req, res, "deleteStudentToolST");
  5855. });
  5856. //协同编辑 创建房间
  5857. router.route("/insertRoomByFile").all((req, res, next) => {
  5858. //var json = queryString(req.url);
  5859. postmysql2(req, res, "insertRoomByFile");
  5860. //getmysql(req, res, "insertRoomByFile", json["uid"], json["n"], json["d"]);
  5861. });
  5862. //思维网格 查询是否是重复房间号
  5863. router.route("/checkRoomNum").all((req, res, next) => {
  5864. var json = queryString(req.url);
  5865. getmysql(req, res, "checkRoomNum", json["num"]);
  5866. });
  5867. //思维网格 查询房间列表
  5868. router.route("/selectRoomList").all((req, res, next) => {
  5869. var json = queryString(req.url);
  5870. getmysql(
  5871. req,
  5872. res,
  5873. "selectRoomList",
  5874. json["uid"],
  5875. json["oid"],
  5876. json["cid"],
  5877. json["cu"],
  5878. json["cn"]
  5879. );
  5880. });
  5881. //查询pdf列表
  5882. router.route("/selectRTC").all((req, res, next) => {
  5883. var json = queryString(req.url);
  5884. getmysql(req, res, "selectRTC", json["uid"], json["cu"], json["cn"]);
  5885. });
  5886. //协同文档 查询房间列表
  5887. router.route("/selectFileList").all((req, res, next) => {
  5888. var json = queryString(req.url);
  5889. getmysql(
  5890. req,
  5891. res,
  5892. "selectFileList",
  5893. json["uid"],
  5894. json["oid"],
  5895. json["cid"],
  5896. json["cu"],
  5897. json["cn"]
  5898. );
  5899. });
  5900. //协同编辑 查询是否是重复房间号
  5901. router.route("/checkRoomNumByFile").all((req, res, next) => {
  5902. var json = queryString(req.url);
  5903. getmysql(req, res, "checkRoomNumByFile", json["num"]);
  5904. });
  5905. //思维网格 根据房间号或者用户id查询房间信息
  5906. router.route("/selectRoom").all((req, res, next) => {
  5907. var json = queryString(req.url);
  5908. getmysql(req, res, "selectRoom", json["uid"]);
  5909. });
  5910. //思维网格 根据房间号或者用户id查询房间信息
  5911. router.route("/getRoom").all((req, res, next) => {
  5912. var json = queryString(req.url);
  5913. getmysql(req, res, "select_room", json["fid"]);
  5914. });
  5915. //协同编辑 根据房间号或者用户id查询房间信息
  5916. router.route("/selectRoomByFile").all((req, res, next) => {
  5917. var json = queryString(req.url);
  5918. getmysql(req, res, "selectRoomByFile", json["uid"]);
  5919. });
  5920. //思维网格 修改房间数据
  5921. router.route("/updateRoomData").all((req, res, next) => {
  5922. postmysql(req, res, "updateRoomData");
  5923. });
  5924. // 修1
  5925. router.route("/updateFileData").get((req, res, next) => {
  5926. var json = queryString(req.url);
  5927. var json2 = json["mode"].split(",");
  5928. getmysql2(req, res, "updateFileData", json2[0], json2[1]);
  5929. });
  5930. router.route("/select_file").all((req, res, next) => {
  5931. var json = queryString(req.url);
  5932. getmysql(req, res, "select_file", json["fid"]);
  5933. });
  5934. //思维网格 解散房间
  5935. router.route("/dismiss").all((req, res, next) => {
  5936. postmysql(req, res, "update_room");
  5937. });
  5938. //提交提问
  5939. router.route("/addProblem").all((req, res, next) => {
  5940. postmysql(req, res, "add_problem");
  5941. //cid 课程id,chid 章节id,t 提问内容,uid 用户id
  5942. });
  5943. //查询提交的提问
  5944. router.route("/getProblem").all((req, res, next) => {
  5945. var json = queryString(req.url); //cid 课程id,page 页数
  5946. getmysql(req, res, "select_problem", json["cid"], json["page"], 10);
  5947. });
  5948. //获取用户基本信息
  5949. router.route("/getUserInfo").all((req, res, next) => {
  5950. var json = queryString(req.url);
  5951. getmysql(req, res, "getUserInfo", json["uid"], json["cid"]);
  5952. });
  5953. //获取用户多个课程基本信息
  5954. router.route("/getUserInfoMore").all((req, res, next) => {
  5955. var json = queryString(req.url);
  5956. getmysql(req, res, "getUserInfoMore", json["uid"], json["cid"]);
  5957. });
  5958. //获取多个用户单个课程基本信息
  5959. router.route("/getClassUserInfoMore").all((req, res, next) => {
  5960. var json = queryString(req.url);
  5961. getmysql(req, res, "getClassUserInfoMore", json["uid"], json["cid"]);
  5962. });
  5963. //获取课程下所有有作业的学生id
  5964. router.route("/selectCourseSuid").all((req, res, next) => {
  5965. var json = queryString(req.url);
  5966. getmysql(req, res, "selectCourseSuid", json["cid"], json["courseid"]);
  5967. });
  5968. //获取项目基本信息
  5969. router.route("/getCourseInfo").all((req, res, next) => {
  5970. var json = queryString(req.url);
  5971. getmysql(req, res, "getCourseInfo", json["cid"]);
  5972. });
  5973. //课程中心 总评添加和修改功能
  5974. router.route("/opCourseScore").all((req, res, next) => {
  5975. postmysql(req, res, "opCourseScore");
  5976. });
  5977. //查询已评价功能
  5978. router.route("/getCourseScoreP").all((req, res, next) => {
  5979. var json = queryString(req.url);
  5980. getmysql(req, res, "getCourseScoreP", json["cid"], json["uid"]);
  5981. });
  5982. //查询所有已评价功能
  5983. router.route("/getCourseScore").all((req, res, next) => {
  5984. var json = queryString(req.url);
  5985. getmysql(req, res, "getCourseScore", json["cid"]);
  5986. });
  5987. //查看已有作业功能
  5988. router.route("/selectWorkByCidAi").all((req, res, next) => {
  5989. var json = queryString(req.url);
  5990. getmysql(req, res, "selectWorkByCidAi", json["cid"], json["classid"]);
  5991. });
  5992. //插叙单个学生作业
  5993. router.route("/selectWorkByCidAiByUid").all((req, res, next) => {
  5994. var json = queryString(req.url);
  5995. getmysql(req, res, "selectWorkByCidAiByUid", json["cid"], json["uid"]);
  5996. });
  5997. //获取多个项目基本信息
  5998. router.route("/getCourseInfoMore").all((req, res, next) => {
  5999. var json = queryString(req.url);
  6000. getmysql(req, res, "getCourseInfoMore", json["cid"]);
  6001. });
  6002. //获取用户基本信息
  6003. router.route("/getAllUserById").all((req, res, next) => {
  6004. var json = queryString(req.url);
  6005. getmysql(req, res, "getAllUserById", json["uid"]);
  6006. });
  6007. //获取用户基本信息
  6008. router.route("/getAllUserByIdP").all((req, res, next) => {
  6009. postmysql(req, res, "getAllUserById");
  6010. });
  6011. //作业生成报告
  6012. router.route("/getWorkData").all((req, res, next) => {
  6013. var json = queryString(req.url); //cid 课程id,page 页数
  6014. getmysql(req, res, "select_work_data", json["cid"]);
  6015. });
  6016. //查询评价体系
  6017. router.route("/getEvaluation").all((req, res, next) => {
  6018. var json = queryString(req.url); //cid 课程id,page 页数
  6019. getmysql(
  6020. req,
  6021. res,
  6022. "select_evaluation",
  6023. json["oid"],
  6024. json["n"],
  6025. json["page"],
  6026. 10
  6027. );
  6028. });
  6029. //添加评价体系
  6030. router.route("/addEvaluation").all((req, res, next) => {
  6031. postmysql(req, res, "add_evaluation");
  6032. //uid 用户id t标题 c内容
  6033. });
  6034. //修改评价体系
  6035. router.route("/updateEvaluation").all((req, res, next) => {
  6036. postmysql(req, res, "update_evaluation");
  6037. //c内容 t标题 id评价id
  6038. });
  6039. //删除评价体系
  6040. router.route("/deleteEvaluation").all((req, res, next) => {
  6041. postmysql(req, res, "delete_evaluation");
  6042. // id评价id
  6043. });
  6044. //删除评价体系前查询课程是否有该评价
  6045. router.route("/selectCourseEva").all((req, res, next) => {
  6046. var json = queryString(req.url); //cid 课程id,page 页数
  6047. getmysql(
  6048. req,
  6049. res,
  6050. "select_course_eva",
  6051. json["eid"],
  6052. );
  6053. });
  6054. //批量添加学校
  6055. router.route("/batchRegistrationSchool").post(function(req, res, next) {
  6056. let users = req.body[0];
  6057. let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
  6058. for (let i = 0; i < arr.length; i++) {
  6059. let _school = encodeURIComponent(arr[i].school);
  6060. let _org = users.org;
  6061. //用戶數據
  6062. let _data = [_school, _org, "", "1", ""];
  6063. //參數拼接,註冊
  6064. _data.unshift(_mysqlLabor[0], _mysqlLabor[1], "insertSchoolByOrg");
  6065. //用戶註冊處理
  6066. mysql.usselect(_data, function(ret) {
  6067. res.end(JSON.stringify({ success: 1 }));
  6068. });
  6069. }
  6070. });
  6071. //批量添加学生
  6072. router.route("/batchRegistrationMore").post(function(req, res, next) {
  6073. let users = req.body[0];
  6074. let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
  6075. for (let i = 0; i < arr.length; i++) {
  6076. let _username = encodeURIComponent(arr[i].name);
  6077. let _mail = encodeURIComponent(arr[i].mail)
  6078. let _password = users.password || "Coco1234";
  6079. let _alias = encodeURIComponent(arr[i].name)
  6080. let _oid = users.oid;
  6081. let _ph = encodeURIComponent(arr[i].phone ? arr[i].phone : "")
  6082. let _class = encodeURIComponent(arr[i].class)
  6083. let _sId = encodeURIComponent(arr[i].sId)
  6084. //加密密碼
  6085. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6086. //生成激活碼
  6087. let _hashstr = new Date().getTime() + "";
  6088. let _digest = crypto
  6089. .createHash("sha256")
  6090. .update(_hashstr, "utf8")
  6091. .digest("hex");
  6092. //用戶數據
  6093. let _userdata = [
  6094. _mail,
  6095. _password,
  6096. _alias,
  6097. "",
  6098. 1, //0老师 1学生
  6099. _username,
  6100. "",
  6101. generateAPIKey(_username),
  6102. _digest,
  6103. "",
  6104. _username,
  6105. _sId,
  6106. 2, //1老师 2学生
  6107. _oid,
  6108. _ph,
  6109. _class,
  6110. "",
  6111. "0",
  6112. ];
  6113. //參數拼接,註冊
  6114. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregister");
  6115. //用戶註冊處理
  6116. mysql.usselect(_userdata, function(ret) {
  6117. // let _pbluserdata = [
  6118. // ret[1][0].uid,
  6119. // _username,
  6120. // _sId,
  6121. // 2,
  6122. // _oid,
  6123. // _ph,
  6124. // _class,
  6125. // '',
  6126. // "0",
  6127. // ];
  6128. // _pbluserdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateUserByEdu");
  6129. // mysql.usselect(_pbluserdata, function(ret) {
  6130. res.end(JSON.stringify({ success: 1 }));
  6131. // });
  6132. });
  6133. }
  6134. });
  6135. //幼儿园评价
  6136. // 获取所有年级
  6137. router.route("/select_techerAllGrade").all(function(req, res, next) {
  6138. // let users = req.query;
  6139. var json = queryString(req.url);
  6140. getmysql(req, res, "select_techerAllGrade", json['cid']);
  6141. });
  6142. // 获取所有班级
  6143. router.route("/select_techerAllClass").all(function(req, res, next) {
  6144. // let users = req.query;
  6145. var json = queryString(req.url);
  6146. getmysql(req, res, "select_techerAllClass", json['cid']);
  6147. });
  6148. // 获取所有班级
  6149. router.route("/select_techerAllClass2").all(function(req, res, next) {
  6150. // let users = req.query;
  6151. var json = queryString(req.url);
  6152. getmysql(req, res, "select_techerAllClass2", json['cid'], json['gid']);
  6153. });
  6154. // 获取所有班级学生
  6155. router.route("/selectClassStudent").all(function(req, res, next) {
  6156. var json = queryString(req.url);
  6157. getmysql(req, res, "selectClassStudent", json['cid']);
  6158. });
  6159. // 获取所有班级学生
  6160. router.route("/selectClassStudent2").all(function(req, res, next) {
  6161. var json = queryString(req.url);
  6162. getmysql(req, res, "selectClassStudent2", json['cid'], json['gid']);
  6163. });
  6164. // 获取学生详情
  6165. router.route("/selectStudentDetail").all(function(req, res, next) {
  6166. // let users = req.query;
  6167. var json = queryString(req.url);
  6168. console.log(json);
  6169. getmysql(req, res, "selectStudentDetail", json['uid']);
  6170. });
  6171. // 获取学生记录筛选框
  6172. router.route("/selectVeiDoo").all(function(req, res, next) {
  6173. // let users = req.query;
  6174. var json = queryString(req.url);
  6175. // console.log(json);
  6176. getmysql(req, res, "selectVeiDoo", json['oid']);
  6177. });
  6178. // 上传学生评价
  6179. router.route("/insertRecord").all(function(req, res, next) {
  6180. // console.log(req.query);
  6181. postmysql(req, res, "insertRecord");
  6182. });
  6183. //修改openid
  6184. router.route('/UpdateOpenId').all((req, res, next) => {
  6185. postmysql(req, res, "UpdateOpenId");
  6186. });
  6187. //查询是否有openid
  6188. router.route('/checkOpenId').all((req, res, next) => {
  6189. postmysql(req, res, "checkOpenId");
  6190. });
  6191. // 获取学生记录
  6192. router.route("/selectRecord").all(function(req, res, next) {
  6193. // let users = req.query;
  6194. var json = queryString(req.url);
  6195. // console.log(json);
  6196. // let txt=
  6197. getmysql(req, res, "selectRecord", json['uid'], json['trm'], json['txt']);
  6198. });
  6199. // 获取学生记录详情
  6200. router.route("/selectRecordDetail").all(function(req, res, next) {
  6201. // let users = req.query;
  6202. var json = queryString(req.url);
  6203. // console.log(json);
  6204. getmysql(req, res, "selectRecordDetail", json['id']);
  6205. });
  6206. // 删除学生评价
  6207. router.route("/updateRecord").all(function(req, res, next) {
  6208. // console.log(req.query);
  6209. postmysql(req, res, "updateRecord");
  6210. });
  6211. // 更新学生评价
  6212. router.route("/updateRecordData").all(function(req, res, next) {
  6213. // console.log(req.query);
  6214. postmysql(req, res, "updateRecordData");
  6215. });
  6216. // 获取学生记录详情
  6217. router.route("/selectSerStudent").all(function(req, res, next) {
  6218. // let users = req.query;
  6219. var json = queryString(req.url);
  6220. // console.log(json);
  6221. getmysql(req, res, "selectSerStudent", json['id'], json['txt']);
  6222. });
  6223. // 获取学期
  6224. router.route("/selectTerm").all(function(req, res, next) {
  6225. var json = queryString(req.url);
  6226. getmysql(req, res, "selectTerm");
  6227. });
  6228. // 获取班级信息
  6229. router.route("/selectManyClassStudent").all(function(req, res, next) {
  6230. var json = queryString(req.url);
  6231. getmysql(req, res, "selectManyClassStudent", json['cid'], json['uid']);
  6232. });
  6233. //幼儿园学生评价获取学生列表
  6234. router.route("/selectStudentAndRecord").all(function(req, res, next) {
  6235. var json = queryString(req.url);
  6236. getmysql(req, res, "selectStudentAndRecord", json['cid'], json['cu'], json['cn'], json['oid'], json['org'], json['page'], 10);
  6237. });
  6238. // pbl教师端观察日记
  6239. router.route("/selectVeidooType").all(function(req, res, next) {
  6240. var json = queryString(req.url);
  6241. // console.log(json);
  6242. getmysql(req, res, "selectVeidooType", json['uid'], json['cid'], json['cu'], json['cn'], json['cm'], json['page'], 10);
  6243. });
  6244. //查询幼儿园分类
  6245. router.route("/selectSTEType").all(function(req, res, next) {
  6246. var json = queryString(req.url);
  6247. // console.log(json);
  6248. getmysql(req, res, "selectSTEType", json['org'], json['oid']);
  6249. });
  6250. //查询口语分类
  6251. router.route("/select_englishVoiceType").all(function(req, res, next) {
  6252. var json = queryString(req.url);
  6253. // console.log(json);
  6254. getmysql(req, res, "select_englishVoiceType", json['oid'], json['org']);
  6255. });
  6256. //查询我的口语分类
  6257. router.route("/selectMySubTalk").all(function(req, res, next) {
  6258. var json = queryString(req.url);
  6259. // console.log(json);
  6260. getmysql(req, res, "selectMySubTalk", json['userid']);
  6261. });
  6262. //查询学情报告雷达图数据
  6263. router.route("/selectMapStuScore").all(function(req, res, next) {
  6264. var json = queryString(req.url);
  6265. // console.log(json);
  6266. getmysql(req, res, "selectMapStuScore", json['uid'], json['year']);
  6267. });
  6268. //每个大分类下的关键证据
  6269. router.route("/selectHealthRecord").all(function(req, res, next) {
  6270. var json = queryString(req.url);
  6271. // console.log(json);
  6272. getmysql(req, res, "selectHealthRecord", json['uid'], json['year'], json['txt'], json['page'], 4);
  6273. });
  6274. //手机端 获取记录地点list
  6275. router.route("/selectSTEPlace").all(function(req, res, next) {
  6276. var json = queryString(req.url);
  6277. // console.log(json);
  6278. getmysql(req, res, "selectSTEPlace", json['org'], json['oid']);
  6279. });
  6280. //获取所有的记录进行下载
  6281. router.route("/selectClassAllRecord").all(function(req, res, next) {
  6282. var json = queryString(req.url);
  6283. // console.log(json);
  6284. getmysql(req, res, "selectClassAllRecord",json['cid'], json['id']);
  6285. });
  6286. //record页面计算班级平均分
  6287. router.route("/selectClaAverageScore").all(function(req, res, next) {
  6288. var json = queryString(req.url);
  6289. // console.log(json);
  6290. getmysql(req, res, "selectClaAverageScore", json["cu"], json["oid"], json["cn"], json["trm"], json["page"], 10);
  6291. });
  6292. //record页面下载班级分数数据
  6293. router.route("/selectAllClaAvaRescore").all(function(req, res, next) {
  6294. var json = queryString(req.url);
  6295. // console.log(json);
  6296. getmysql(req, res, "selectAllClaAvaRescore", json["cu"], json["oid"], json["cn"], json["trm"]);
  6297. });
  6298. //学情报告计算班级平均分
  6299. router.route("/selectClaAvaScore").all(function(req, res, next) {
  6300. var json = queryString(req.url);
  6301. // console.log(json);
  6302. getmysql(req, res, "selectClaAvaScore", json["cid"], json["trm"]);
  6303. });
  6304. //查询协同人员不带org的
  6305. router.route("/selectCollaborativeMembers").all(function(req, res, next) {
  6306. var json = queryString(req.url);
  6307. // console.log(json);
  6308. getmysql(req, res, "selectCollaborativeMembers", json["oid"], json["cu"], json["cn"], json["coll"]);
  6309. });
  6310. //查询协同人员带org
  6311. router.route("/selectCollaborativeMembersOrg").all(function(req, res, next) {
  6312. var json = queryString(req.url);
  6313. // console.log(json);
  6314. getmysql(req, res, "selectCollaborativeMembersOrg", json["oid"], json["cu"], json["cn"], json["coll"]);
  6315. });
  6316. // 教师发展获取数据来源表单标题
  6317. router.route("/selectExamineTestName").all(function(req, res, next) {
  6318. // var json = queryString(req.url);
  6319. // console.log(json);
  6320. postmysql(req, res, "selectExamineTestName");
  6321. // getmysql(req, res, "selectExamineTestName", json["testId"]);
  6322. });
  6323. // 教师发展 页面数据
  6324. router.route("/selectTestExamineBase").all(function(req, res, next) {
  6325. var json = queryString(req.url);
  6326. getmysql(req, res, "selectTestExamineBase", json["typ"], json["org"], json["oid"]);
  6327. });
  6328. // 教师发展 页面数据 添加时间获取
  6329. router.route("/selectTestExamineBase2").all(function(req, res, next) {
  6330. var json = queryString(req.url);
  6331. getmysql(req, res, "selectTestExamineBase2", json["typ"], json["org"], json["oid"],json['time']);
  6332. });
  6333. // 教师发展 按人员页面数据
  6334. router.route("/selectTestExaminePersonData").all(function(req, res, next) {
  6335. var json = queryString(req.url);
  6336. getmysql(req, res, "selectTestExaminePersonData", json["oid"], json["org"], json["type"], json["tname"]);
  6337. });
  6338. // 教师发展 按人员页面数据
  6339. router.route("/selectTestExaminePersonData2").all(function(req, res, next) {
  6340. postmysql(req, res, "selectTestExaminePersonData2");
  6341. });
  6342. // 教师发展 管理员提交数据
  6343. router.route("/updateExamineCogData").all(function(req, res, next) {
  6344. postmysql(req, res, "updateExamineCogData");
  6345. });
  6346. // 教师发展 管理员提交数据(新版添加了修改后保存教师记录)
  6347. router.route("/updateExamineCogDataCopy").all(function(req, res, next) {
  6348. postmysql(req, res, "updateExamineCogDataCopy");
  6349. });
  6350. // 教师发展 获取修改记录
  6351. router.route("/selectExamineOperateRecord").all(function(req, res, next) {
  6352. var json = queryString(req.url);
  6353. getmysql(req, res, "selectExamineOperateRecord", json["tid"], json["type"]);
  6354. });
  6355. // 教师发展 管理员撤回提交数据
  6356. router.route("/updateExamineState").all(function(req, res, next) {
  6357. postmysql(req, res, "updateExamineState");
  6358. });
  6359. // 教师发展 获取数据汇总
  6360. router.route("/selectTestWorksAggregate").all(function(req, res, next) {
  6361. var json = queryString(req.url);
  6362. getmysql(req, res, "selectTestWorksAggregate", json["oid"], json["org"]);
  6363. });
  6364. // 教师发展 提醒
  6365. router.route("/selectExamineTeaRemind").all(function(req, res, next) {
  6366. var json = queryString(req.url);
  6367. getmysql(req, res, "selectExamineTeaRemind", json["oid"], json["org"], json["tea"], json["ptype"]);
  6368. });
  6369. // 课程管理-文档评分
  6370. router.route("/selectWorksEvaScore").all(function(req, res, next) {
  6371. var json = queryString(req.url);
  6372. getmysql(req, res, "selectWorksEvaScore", json["uid"], json["cid"]);
  6373. });
  6374. // 课程管理-文档评分
  6375. router.route("/selectWorksEvaScoreTwo").all(function(req, res, next) {
  6376. var json = queryString(req.url);
  6377. getmysql(req, res, "selectWorksEvaScoreTwo", json["uid"], json["cid"], json["s"], json["t"], json["tool"]);
  6378. });
  6379. // 课程管理-文档评分一次性获取全部
  6380. router.route("/selectWorksEvaScoreNew").all(function(req, res, next) {
  6381. var json = queryString(req.url);
  6382. getmysql(req, res, "selectWorksEvaScoreNew", json["cid"], json["s"], json["t"]);
  6383. });
  6384. /* 新增教研室 */
  6385. router.route("/insertTeacherOfficeCopy").all(function(req, res, next) {
  6386. postmysql(req, res, "insertTeacherOfficeCopy");
  6387. });
  6388. /* 查询教研室*/
  6389. router.route("/selectTeacherOffice2").all(function(req, res, next) {
  6390. var json = queryString(req.url);
  6391. getmysql(req, res, "selectTeacherOffice2", json["cu"], json["oid"], json["cn"], json["pid"], json["page"], 10);
  6392. });
  6393. /* 查询教研室*/
  6394. router.route("/selectPerInfoTeacherOffice").all(function(req, res, next) {
  6395. var json = queryString(req.url);
  6396. getmysql(req, res, "selectPerInfoTeacherOffice", json["cu"], json["oid"], json["cn"], 6);
  6397. });
  6398. /* 查询所有教研室分类与分类下的数据*/
  6399. router.route("/selectPerInfoAllTea").all(function(req, res, next) {
  6400. var json = queryString(req.url);
  6401. getmysql(req, res, "selectPerInfoAllTea",json["oid"]);
  6402. });
  6403. /* 查询教研室类型lim */
  6404. router.route("/selectTeacherOfficeTypeLim").all(function(req, res, next) {
  6405. var json = queryString(req.url);
  6406. getmysql(req, res, "selectTeacherOfficeTypeLim", json["cu"], json["oid"], json["cn"], json["pid"], json["page"], 10);
  6407. });
  6408. /* 查询教研室类型 */
  6409. router.route("/selectTeacherOfficeType").all(function(req, res, next) {
  6410. var json = queryString(req.url);
  6411. getmysql(req, res, "selectTeacherOfficeType", json["cu"], json["oid"], json["cn"], json["pid"]);
  6412. });
  6413. // 存储学生课程分析数据
  6414. router.route("/upDateAnalysis").all(function(req, res, next) {
  6415. postmysql(req, res, "upDateAnalysis");
  6416. });
  6417. // 存储学生课程分析数据 ym
  6418. router.route("/upDateAnalysisTwo").all(function(req, res, next) {
  6419. postmysql(req, res, "upDateAnalysisTwo");
  6420. });
  6421. // 教师手动修改存储学生课程分析数据 ym
  6422. router.route("/upDateAnalysisTeacher").all(function(req, res, next) {
  6423. postmysql(req, res, "upDateAnalysisTeacher");
  6424. });
  6425. // 获取教师管理table数据
  6426. router.route("/selectOrgTeachar").all((req, res, next) => {
  6427. var json = queryString(req.url);
  6428. getmysql(
  6429. req,
  6430. res,
  6431. "selectOrgTeachar",
  6432. json["org"],
  6433. json["oid"],
  6434. json["cu"],
  6435. json["cn"],
  6436. json["page"],
  6437. 10
  6438. );
  6439. });
  6440. // 更新老师信息数据
  6441. router.route("/updateYTeacherInfo").all(function(req, res, next) {
  6442. // console.log(req.query);
  6443. postmysql(req, res, "updateYTeacherInfo");
  6444. });
  6445. //教师管理新增教师
  6446. router.route("/teacherRegistration").post(function(req, res, next) {
  6447. var users = req.body[0];
  6448. //循环注册
  6449. var _username = users.alias;
  6450. var _mail = users.username;
  6451. var _password = users.password || "Coco1234";
  6452. var _alias = users.alias;
  6453. var _org = users.org;
  6454. var _oid = users.oid;
  6455. var _ph = users.ph;
  6456. var _class = users.cid;
  6457. var _sId = users.sid;
  6458. var _typ = users.typ;
  6459. var _rol = users.rol;
  6460. //加密密碼
  6461. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6462. //生成激活碼
  6463. let _hashstr = new Date().getTime() + "";
  6464. let _digest = crypto
  6465. .createHash("sha256")
  6466. .update(_hashstr, "utf8")
  6467. .digest("hex");
  6468. //用戶數據
  6469. var _userdata = [
  6470. _mail,
  6471. _password,
  6472. _alias,
  6473. "",
  6474. 0,
  6475. _username,
  6476. "",
  6477. generateAPIKey(_username),
  6478. _digest,
  6479. "",
  6480. _username,
  6481. _sId,
  6482. _typ,
  6483. _org,
  6484. _oid,
  6485. _ph,
  6486. _class,
  6487. "",
  6488. "0",
  6489. _rol
  6490. ];
  6491. //參數拼接,註冊
  6492. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_teacherRegistration");
  6493. //用戶註冊處理
  6494. mysql.usselect(_userdata, function(ret) {
  6495. res.end(
  6496. JSON.stringify({
  6497. uid: ret[1][0].uid,
  6498. ph: _ph,
  6499. oid: _oid,
  6500. cid: _class,
  6501. success: 1,
  6502. })
  6503. );
  6504. });
  6505. });
  6506. //初始化密码
  6507. router.route("/iniPassword").post(function(req, res, next) {
  6508. let users = req.body[0];
  6509. _password = users.pa;
  6510. //加密密碼
  6511. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6512. //用戶數據
  6513. let _userList = [users.uid, _password];
  6514. _userList.unshift(_mysqlLabor[0], _mysqlLabor[1], "iniPassword");
  6515. mysql.usselect(_userList, function(ret) {
  6516. res.end(JSON.stringify({ success: 1 }));
  6517. });
  6518. });
  6519. //批量添加教师
  6520. router.route("/batchRegistrationMore1").post(function(req, res, next) {
  6521. let users = req.body[0];
  6522. let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
  6523. for (let i = 0; i < arr.length; i++) {
  6524. let _username = encodeURIComponent(arr[i].name)
  6525. let _mail = encodeURIComponent(arr[i].mail)
  6526. let _password = users.password || "Coco1234";
  6527. let _alias = encodeURIComponent(arr[i].name)
  6528. let _org = users.org;
  6529. let _oid = encodeURIComponent(arr[i].school)
  6530. let _ph = encodeURIComponent(arr[i].phone ? arr[i].phone : "")
  6531. let _class = encodeURIComponent(arr[i].class)
  6532. let _sId = encodeURIComponent(arr[i].sId)
  6533. //加密密碼
  6534. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6535. //生成激活碼
  6536. let _hashstr = new Date().getTime() + "";
  6537. let _digest = crypto
  6538. .createHash("sha256")
  6539. .update(_hashstr, "utf8")
  6540. .digest("hex");
  6541. //用戶數據
  6542. let _userdata = [
  6543. _mail,
  6544. _password,
  6545. _alias,
  6546. "",
  6547. 0, //0老师 1学生
  6548. _username,
  6549. "",
  6550. generateAPIKey(_username),
  6551. _digest,
  6552. "",
  6553. _username,
  6554. _sId,
  6555. 1, //1老师 2学生
  6556. _org,
  6557. _oid,
  6558. "",
  6559. "",
  6560. "",
  6561. "0",
  6562. ];
  6563. //參數拼接,註冊
  6564. _userdata.unshift(
  6565. _mysqluser[0],
  6566. _mysqluser[1],
  6567. "pbl_add_batchregister_oid"
  6568. );
  6569. //用戶註冊處理
  6570. mysql.usselect(_userdata, function(ret) {
  6571. res.end(JSON.stringify({ success: 1 }));
  6572. });
  6573. }
  6574. });
  6575. //赛事批量注册老师
  6576. router.route("/pbl_add_raceuser_oid").post(function(req, res, next) {
  6577. let users = req.body[0];
  6578. let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
  6579. for (let i = 0; i < arr.length; i++) {
  6580. let _username = encodeURIComponent(arr[i].name)
  6581. let _mail = encodeURIComponent(arr[i].mail)
  6582. let _password = users.password || "Coco1234";
  6583. let _oid = encodeURIComponent(arr[i].school)
  6584. //加密密碼
  6585. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6586. //生成激活碼
  6587. let _hashstr = new Date().getTime() + "";
  6588. let _digest = crypto
  6589. .createHash("sha256")
  6590. .update(_hashstr, "utf8")
  6591. .digest("hex");
  6592. //用戶數據
  6593. let _userdata = [
  6594. _mail,
  6595. _oid,
  6596. _password,
  6597. _username,
  6598. 1, //1普通教师 2市级 3省级 4市级子级评委 5县区评委 6县区子级
  6599. ];
  6600. //參數拼接,註冊
  6601. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "pbl_add_raceuser_oid");
  6602. //用戶註冊處理
  6603. mysql.usselect(_userdata, function(ret) {
  6604. res.end(JSON.stringify({ success: 1 }));
  6605. });
  6606. }
  6607. });
  6608. //新增学生
  6609. router.route("/batchRegistration").post(function(req, res, next) {
  6610. var users = req.body[0];
  6611. //循环注册
  6612. var _username = users.alias;
  6613. var _mail = users.username;
  6614. var _password = users.password || "Coco1234";
  6615. var _alias = users.alias;
  6616. var _oid = users.oid;
  6617. var _ph = users.ph;
  6618. var _class = users.cid;
  6619. var _sId = users.sid;
  6620. //加密密碼
  6621. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6622. //生成激活碼
  6623. let _hashstr = new Date().getTime() + "";
  6624. let _digest = crypto
  6625. .createHash("sha256")
  6626. .update(_hashstr, "utf8")
  6627. .digest("hex");
  6628. //用戶數據
  6629. var _userdata = [
  6630. _mail,
  6631. _password,
  6632. _alias,
  6633. "",
  6634. 1,
  6635. _username,
  6636. "",
  6637. generateAPIKey(_username),
  6638. _digest,
  6639. "",
  6640. _username,
  6641. _sId,
  6642. 2,
  6643. _oid,
  6644. _ph,
  6645. _class,
  6646. "",
  6647. "0",
  6648. ];
  6649. //參數拼接,註冊
  6650. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregister");
  6651. //用戶註冊處理
  6652. mysql.usselect(_userdata, function(ret) {
  6653. res.end(
  6654. JSON.stringify({
  6655. uid: ret[1][0].uid,
  6656. ph: _ph,
  6657. oid: _oid,
  6658. cid: _class,
  6659. success: 1,
  6660. })
  6661. );
  6662. });
  6663. });
  6664. //深圳电教馆注册
  6665. router.route("/batchRegistrationSzdjg").post(function(req, res, next) {
  6666. var users = Object.values(req.body)[0].split(",");
  6667. //循环注册
  6668. var _username = users[0]; //名字
  6669. var _mail = users[1]; //用户名 账号
  6670. var _password = "Coco1234";
  6671. var _alias = _username;
  6672. var _org = users[2];
  6673. var _oid = users[3];
  6674. var _ph = users[4];
  6675. var _class = users[5];
  6676. var _type = users[6];
  6677. var _openid = users[7];
  6678. //加密密碼
  6679. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6680. //生成激活碼
  6681. let _hashstr = new Date().getTime() + "";
  6682. let _digest = crypto
  6683. .createHash("sha256")
  6684. .update(_hashstr, "utf8")
  6685. .digest("hex");
  6686. //用戶數據
  6687. var _userdata = [
  6688. _mail,
  6689. _password,
  6690. _alias,
  6691. "",
  6692. 0,
  6693. _username,
  6694. _openid,
  6695. generateAPIKey(_username),
  6696. _digest,
  6697. "",
  6698. _username,
  6699. '',
  6700. _type,
  6701. _org,
  6702. _oid,
  6703. _ph,
  6704. _class,
  6705. "",
  6706. "0",
  6707. ];
  6708. //參數拼接,註冊
  6709. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregisterSzdjg");
  6710. //用戶註冊處理
  6711. mysql.usselect(_userdata, function(ret) {
  6712. res.end(
  6713. JSON.stringify({
  6714. uid: ret[1][0].uid,
  6715. ph: _ph,
  6716. oid: _oid,
  6717. cid: _class,
  6718. success: 1,
  6719. })
  6720. );
  6721. });
  6722. });
  6723. //深圳电教馆注册
  6724. router.route("/batchRegistrationSzdjg2").post(function(req, res, next) {
  6725. var users = Object.values(req.body)[0].split(",");
  6726. //循环注册
  6727. var _username = users[0]; //名字
  6728. var _mail = users[1]; //用户名 账号
  6729. var _password = "Coco1234";
  6730. var _alias = _username;
  6731. var _org = users[2];
  6732. var _oid = users[3];
  6733. var _ph = users[4];
  6734. var _class = users[5];
  6735. var _type = users[6];
  6736. var _openid = users[7];
  6737. var _dest = users[8];
  6738. //加密密碼
  6739. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6740. //生成激活碼
  6741. let _hashstr = new Date().getTime() + "";
  6742. let _digest = crypto
  6743. .createHash("sha256")
  6744. .update(_hashstr, "utf8")
  6745. .digest("hex");
  6746. //用戶數據
  6747. var _userdata = [
  6748. _mail,
  6749. _password,
  6750. _alias,
  6751. "",
  6752. 0,
  6753. _username,
  6754. _openid,
  6755. generateAPIKey(_username),
  6756. _digest,
  6757. "",
  6758. _username,
  6759. '',
  6760. _type,
  6761. _org,
  6762. _oid,
  6763. _ph,
  6764. _class,
  6765. "",
  6766. "0",
  6767. _dest
  6768. ];
  6769. //參數拼接,註冊
  6770. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregisterSzdjg2");
  6771. //用戶註冊處理
  6772. mysql.usselect(_userdata, function(ret) {
  6773. res.end(
  6774. JSON.stringify({
  6775. uid: ret[1][0].uid,
  6776. ph: _ph,
  6777. oid: _oid,
  6778. cid: _class,
  6779. success: 1,
  6780. })
  6781. );
  6782. });
  6783. });
  6784. //深圳电教馆注册
  6785. router.route("/batchRegistrationSzdjg3").post(function(req, res, next) {
  6786. var users = Object.values(req.body)[0].split(",");
  6787. //循环注册
  6788. var _username = users[0]; //名字
  6789. var _mail = users[1]; //用户名 账号
  6790. var _password = "Coco1234";
  6791. var _alias = _username;
  6792. var _org = users[2];
  6793. var _oid = users[3];
  6794. var _ph = users[4];
  6795. var _class = users[5];
  6796. var _type = users[6];
  6797. var _openid = users[7];
  6798. var _dest = users[8];
  6799. var _eduId = users[9];
  6800. //加密密碼
  6801. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6802. //生成激活碼
  6803. let _hashstr = new Date().getTime() + "";
  6804. let _digest = crypto
  6805. .createHash("sha256")
  6806. .update(_hashstr, "utf8")
  6807. .digest("hex");
  6808. //用戶數據
  6809. var _userdata = [
  6810. _mail,
  6811. _password,
  6812. _alias,
  6813. "",
  6814. 0,
  6815. _username,
  6816. _openid,
  6817. generateAPIKey(_username),
  6818. _digest,
  6819. "",
  6820. _username,
  6821. '',
  6822. _type,
  6823. _org,
  6824. _oid,
  6825. _ph,
  6826. _class,
  6827. "",
  6828. "0",
  6829. _dest,
  6830. _eduId
  6831. ];
  6832. //參數拼接,註冊
  6833. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregisterSzdjg3");
  6834. //用戶註冊處理
  6835. mysql.usselect(_userdata, function(ret) {
  6836. res.end(
  6837. JSON.stringify({
  6838. uid: ret[1][0].uid,
  6839. ph: _ph,
  6840. oid: _oid,
  6841. cid: _class,
  6842. success: 1,
  6843. })
  6844. );
  6845. });
  6846. });
  6847. //新增用户接口
  6848. router.route("/batchRegistrationUser").post(function(req, res, next) {
  6849. var users = req.body[0];
  6850. //循环注册
  6851. var _username = users.alias; //名字
  6852. var _mail = users.username; //用户名 账号
  6853. var _password = "Coco1234";
  6854. var _alias = _username;
  6855. var _org = users.org;
  6856. var _oid = users.oid;
  6857. var _ph = users.ph;
  6858. var _class = users.cid;
  6859. var _type = users.type;
  6860. var _openid = users.opid;
  6861. var _dest = users.dest;
  6862. var _eduId = users.eduid;
  6863. //加密密碼
  6864. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6865. //生成激活碼
  6866. let _hashstr = new Date().getTime() + "";
  6867. let _digest = crypto
  6868. .createHash("sha256")
  6869. .update(_hashstr, "utf8")
  6870. .digest("hex");
  6871. //用戶數據
  6872. var _userdata = [
  6873. _mail,
  6874. _password,
  6875. _alias,
  6876. "",
  6877. 0,
  6878. _username,
  6879. _openid,
  6880. generateAPIKey(_username),
  6881. _digest,
  6882. "",
  6883. _username,
  6884. '',
  6885. _type,
  6886. _org,
  6887. _oid,
  6888. _ph,
  6889. _class,
  6890. "",
  6891. "0",
  6892. _dest,
  6893. _eduId
  6894. ];
  6895. //參數拼接,註冊
  6896. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregisterSzdjg3");
  6897. //用戶註冊處理
  6898. mysql.usselect(_userdata, function(ret) {
  6899. res.end(
  6900. JSON.stringify({
  6901. uid: ret[1][0].uid,
  6902. ph: _ph,
  6903. oid: _oid,
  6904. cid: _class,
  6905. success: 1,
  6906. })
  6907. );
  6908. });
  6909. });
  6910. //新增教师
  6911. router.route("/batchRegistration1").post(function(req, res, next) {
  6912. var users = req.body[0];
  6913. //循环注册
  6914. var _username = users.alias;
  6915. var _mail = users.username;
  6916. var _password = users.password || "Coco1234";
  6917. var _alias = users.alias;
  6918. var _org = users.org;
  6919. var _oid = users.oid;
  6920. var _ph = users.ph;
  6921. var _class = users.cid;
  6922. var _sId = users.sid;
  6923. //加密密碼
  6924. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6925. //生成激活碼
  6926. let _hashstr = new Date().getTime() + "";
  6927. let _digest = crypto
  6928. .createHash("sha256")
  6929. .update(_hashstr, "utf8")
  6930. .digest("hex");
  6931. //用戶數據
  6932. var _userdata = [
  6933. _mail,
  6934. _password,
  6935. _alias,
  6936. "",
  6937. 0,
  6938. _username,
  6939. "",
  6940. generateAPIKey(_username),
  6941. _digest,
  6942. "",
  6943. _username,
  6944. _sId,
  6945. 1,
  6946. _org,
  6947. _oid,
  6948. _ph,
  6949. _class,
  6950. "",
  6951. "0",
  6952. ];
  6953. //參數拼接,註冊
  6954. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregister1");
  6955. //用戶註冊處理
  6956. mysql.usselect(_userdata, function(ret) {
  6957. res.end(
  6958. JSON.stringify({
  6959. uid: ret[1][0].uid,
  6960. ph: _ph,
  6961. oid: _oid,
  6962. cid: _class,
  6963. success: 1,
  6964. })
  6965. );
  6966. });
  6967. });
  6968. router.route("/batchRegistrationOrg").post(function(req, res, next) {
  6969. var users = req.body[0];
  6970. //循环注册
  6971. var _username = users.alias;
  6972. var _mail = users.username;
  6973. var _password = users.password || "Coco1234";
  6974. var _alias = users.alias;
  6975. var _oid = users.oid;
  6976. var _ph = users.ph;
  6977. var _class = users.cid;
  6978. var _sId = users.sid;
  6979. var _org = users.org;
  6980. //加密密碼
  6981. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  6982. //生成激活碼
  6983. let _hashstr = new Date().getTime() + "";
  6984. let _digest = crypto
  6985. .createHash("sha256")
  6986. .update(_hashstr, "utf8")
  6987. .digest("hex");
  6988. //用戶數據
  6989. var _userdata = [
  6990. _mail,
  6991. _password,
  6992. _alias,
  6993. "",
  6994. 1,
  6995. _username,
  6996. "",
  6997. generateAPIKey(_username),
  6998. _digest,
  6999. "",
  7000. _username,
  7001. _sId,
  7002. 2,
  7003. _oid,
  7004. _ph,
  7005. _class,
  7006. "",
  7007. "0",
  7008. _org,
  7009. ];
  7010. //參數拼接,註冊
  7011. _userdata.unshift(_mysqluser[0], _mysqluser[1], "pbl_add_batchregister_org");
  7012. //用戶註冊處理
  7013. mysql.usselect(_userdata, function(ret) {
  7014. res.end(
  7015. JSON.stringify({
  7016. uid: ret[1][0].uid,
  7017. ph: _ph,
  7018. oid: _oid,
  7019. cid: _class,
  7020. success: 1,
  7021. })
  7022. );
  7023. });
  7024. });
  7025. router.route("/batchRegistrationMoreOrg").post(function(req, res, next) {
  7026. let users = req.body[0];
  7027. let arr = JSON.parse(decodeURIComponent(req.body[0].arr));
  7028. for (let i = 0; i < arr.length; i++) {
  7029. let _username = encodeURIComponent(arr[i].name)
  7030. let _mail = encodeURIComponent(arr[i].mail)
  7031. let _password = users.password || "Coco1234";
  7032. let _alias = encodeURIComponent(arr[i].name)
  7033. let _oid = users.oid;
  7034. let _ph = encodeURIComponent(arr[i].phone ? arr[i].phone : "")
  7035. let _class = encodeURIComponent(arr[i].class)
  7036. let _sId = encodeURIComponent(arr[i].sId)
  7037. let _org = users.org;
  7038. //加密密碼
  7039. _password = bcrypt.hashSync(_password, bcrypt.genSaltSync(10));
  7040. //生成激活碼
  7041. let _hashstr = new Date().getTime() + "";
  7042. let _digest = crypto
  7043. .createHash("sha256")
  7044. .update(_hashstr, "utf8")
  7045. .digest("hex");
  7046. //用戶數據
  7047. let _userdata = [
  7048. _mail,
  7049. _password,
  7050. _alias,
  7051. "",
  7052. 1, //0老师 1学生
  7053. _username,
  7054. "",
  7055. generateAPIKey(_username),
  7056. _digest,
  7057. "",
  7058. _username,
  7059. _sId,
  7060. 2, //1老师 2学生
  7061. _oid,
  7062. _ph,
  7063. _class,
  7064. "",
  7065. "0",
  7066. _org,
  7067. ];
  7068. //參數拼接,註冊
  7069. _userdata.unshift(
  7070. _mysqluser[0],
  7071. _mysqluser[1],
  7072. "pbl_add_batchregister_org2"
  7073. );
  7074. //用戶註冊處理
  7075. mysql.usselect(_userdata, function(ret) {
  7076. res.end(JSON.stringify({ success: 1 }));
  7077. });
  7078. }
  7079. });
  7080. //工作室管理
  7081. router.route("/updateStudioWorkNew4").all((req, res, next) => {
  7082. //学生
  7083. if (req.body[0]) {
  7084. let p = [req.body[0].cid];
  7085. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_studio_course_detail2"); //執行存儲過程
  7086. mysql.usselect(p, function(ret) {
  7087. let _unitIndex = parseInt(req.body[0].unitIndex);
  7088. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  7089. let _unitJson = JSON.parse(ret[0][0].chapters);
  7090. if (_unitJson.length - 1 < _unitIndex) {
  7091. let _i = _unitIndex - (_unitJson.length - 1);
  7092. for (let i = 0; i < _i; i++) {
  7093. _unitJson.push({
  7094. dyName: "", //单元标题
  7095. chapterInfo: [{
  7096. isread: false,
  7097. chapterid: guid(),
  7098. title: "",
  7099. courseName: "",
  7100. taskJson: [{
  7101. task: "",
  7102. taskDetail: "",
  7103. chapterData: [],
  7104. toolText: "",
  7105. toolChoose: [{
  7106. tool: [],
  7107. toolDetail: "",
  7108. toolType: 0,
  7109. askCount: 1,
  7110. askTitle: "",
  7111. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  7112. }, ],
  7113. isShowTools: false,
  7114. askCount: 1,
  7115. isFold: 0,
  7116. askTitle: "",
  7117. askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
  7118. checkJson: [{ checkCount: [], checkPerent: [] }],
  7119. homeworkList: [],
  7120. }, ],
  7121. itemCount: 1,
  7122. fileList1: [],
  7123. video: [],
  7124. testData: [],
  7125. pData: [],
  7126. templateArray: [],
  7127. }, ],
  7128. });
  7129. }
  7130. _unitJson[_unitIndex] = _chapters[_unitIndex];
  7131. } else {
  7132. _unitJson[_unitIndex] = _chapters[_unitIndex];
  7133. }
  7134. // console.log(_unitJson);
  7135. let p2 = [
  7136. req.body[0].cid,
  7137. encodeURIComponent(JSON.stringify(_unitJson)),
  7138. ];
  7139. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudioWorkNew4"); //執行存儲過程
  7140. mysql.usselect(p2, function(ret) {
  7141. res.end(JSON.stringify({ success: 1 }));
  7142. });
  7143. // res.end(JSON.stringify({ success: 1 }));
  7144. });
  7145. }
  7146. });
  7147. router.route("/updateStudioWorkNew2").all((req, res, next) => {
  7148. //学生
  7149. if (req.body[0]) {
  7150. p = [
  7151. req.body[0].cid,
  7152. req.body[0].title,
  7153. req.body[0].brief,
  7154. req.body[0].cover,
  7155. req.body[0].evaId,
  7156. req.body[0].astudent,
  7157. req.body[0].see,
  7158. req.body[0].chapters,
  7159. req.body[0].template,
  7160. req.body[0].ateacher,
  7161. ];
  7162. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudioWorkNew2"); //執行存儲過程
  7163. mysql.usselect(p, function(ret) {
  7164. let course = req.body[0].courseType;
  7165. let courseId = req.body[0].cid;
  7166. let userid = req.body[0].uid;
  7167. delStudioCourseTypeS(course, courseId, userid);
  7168. res.end(JSON.stringify({ success: 1 }));
  7169. });
  7170. }
  7171. });
  7172. router.route("/addStudioCourseWorkNew2").all((req, res, next) => {
  7173. //学生
  7174. if (req.body[0]) {
  7175. p = [
  7176. req.body[0].uid,
  7177. req.body[0].title,
  7178. req.body[0].brief,
  7179. req.body[0].cover,
  7180. req.body[0].evaId,
  7181. req.body[0].astudent,
  7182. req.body[0].see,
  7183. req.body[0].chapters,
  7184. req.body[0].template,
  7185. req.body[0].ateacher,
  7186. ];
  7187. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addStudioCourseWorkNew2"); //執行存儲過程
  7188. mysql.usselect(p, function(ret) {
  7189. let course = req.body[0].courseType;
  7190. let courseId = ret[0][0].courseId;
  7191. let userid = req.body[0].uid;
  7192. delStudioCourseTypeS(course, courseId, userid);
  7193. res.end(
  7194. JSON.stringify({
  7195. ordernumber: ret[0][0].ordernumber,
  7196. courseId: ret[0][0].courseId,
  7197. success: 1,
  7198. })
  7199. );
  7200. });
  7201. }
  7202. });
  7203. //teacher 查询项目模板
  7204. router.route("/getStudioTemplateTs").all((req, res, next) => {
  7205. var json = queryString(req.url);
  7206. getmysql(req, res, "getStudioTemplateTs", json["oid"]);
  7207. });
  7208. //查看课程
  7209. router.route("/select_studio_course_detail").all((req, res, next) => {
  7210. //学生
  7211. var json = queryString(req.url);
  7212. getmysql(req, res, "select_studio_course_detail", json["cid"]);
  7213. });
  7214. //查看课程
  7215. router.route("/select_studio_course_detail2").all((req, res, next) => {
  7216. //学生
  7217. var json = queryString(req.url);
  7218. getmysql(req, res, "select_studio_course_detail2", json["cid"]);
  7219. });
  7220. //协同恢复删除的阶段
  7221. router.route("/restoreStudioWork").all((req, res, next) => {
  7222. //学生
  7223. if (req.body[0]) {
  7224. let p = [req.body[0].cid];
  7225. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "select_studio_course_detail2"); //執行存儲過程
  7226. mysql.usselect(p, function(ret) {
  7227. let _chapid = req.body[0].chapid;
  7228. // console.log(_chapid);
  7229. let _chapters = JSON.parse(decodeURIComponent(req.body[0].chapters));
  7230. let _unitJson = JSON.parse(ret[0][0].chapters);
  7231. let _unitJson2 = [];
  7232. let chpaindex;
  7233. for (var i = 0; i < _chapters.length; i++) {
  7234. if (_chapters[i].chapterInfo[0].chapterid == _chapid) {
  7235. chpaindex = i;
  7236. }
  7237. }
  7238. for (var i = 0; i < _unitJson.length; i++) {
  7239. if (_unitJson[i].chapterInfo[0].chapterid != _chapid) {
  7240. // console.log(1);
  7241. // _unitJson.splice(i, -1)
  7242. _unitJson2.push(_unitJson[i]);
  7243. // break;
  7244. }
  7245. }
  7246. _unitJson2.splice(chpaindex, 0, _chapters[chpaindex]);
  7247. // console.log(_unitJson2);
  7248. let p2 = [
  7249. req.body[0].cid,
  7250. JSON.stringify(_unitJson2).replaceAll(/%/g, "%25"),
  7251. ];
  7252. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateStudioWorkNew4"); //執行存儲過程
  7253. mysql.usselect(p2, function(ret) {
  7254. res.end(JSON.stringify({ success: 1 }));
  7255. });
  7256. // res.end(JSON.stringify({ success: 1 }));
  7257. });
  7258. }
  7259. });
  7260. //查询分类及所有子分类
  7261. router.route("/selectAllTypeStudio").all((req, res, next) => {
  7262. var json = queryString(req.url);
  7263. getmysql(req, res, "selectAllTypeStudio", json["org"], json["oid"]);
  7264. });
  7265. //上传文件
  7266. router.route("/addStudioCourseWorksS").all((req, res, next) => {
  7267. postmysql(req, res, "addStudioCourseWorksS");
  7268. });
  7269. //删除提交的作业
  7270. router.route("/deleteStudioCourseWorkS").all((req, res, next) => {
  7271. postmysql(req, res, "deleteStudioCourseWorkS");
  7272. });
  7273. //创建新话题
  7274. router.route("/addSubTalk").all((req, res, next) => {
  7275. postmysql(req, res, "addSubTalk");
  7276. });
  7277. //创建新子分类
  7278. router.route("/addEngVType").all((req, res, next) => {
  7279. postmysql(req, res, "addEngVType");
  7280. });
  7281. router.route("/selectStudioCourseNew222").all((req, res, next) => {
  7282. var json = queryString(req.url);
  7283. getmysql(
  7284. req,
  7285. res,
  7286. "selectStudioCourseNew222",
  7287. json["type"],
  7288. json["uid"],
  7289. json["oid"],
  7290. json["org"],
  7291. json["typea"],
  7292. json["typeb"],
  7293. json["typec"],
  7294. json["typed"],
  7295. json["typef"],
  7296. json["typeE"],
  7297. json["cu"],
  7298. json["cn"],
  7299. json["page"],
  7300. json["pageSize"]
  7301. );
  7302. });
  7303. //删除1课程
  7304. router.route("/deleteStudioCourse").all((req, res, next) => {
  7305. var json = queryString(req.url);
  7306. getmysql2(req, res, "deleteStudioCourse", json["cid"]);
  7307. });
  7308. //添加分享课程数据
  7309. router.route("/addShareCourse").post((req, res, next) => {
  7310. var json = queryString(req.url);
  7311. postmysql(req, res, "addShareCourse");
  7312. });
  7313. //获取分享课程数据
  7314. router.route("/getShareCourse").all((req, res, next) => {
  7315. var json = queryString(req.url);
  7316. getmysql(req, res, "getShareCourse", json["cid"],json["type"]);
  7317. });
  7318. router.route("/delShareCourse").all((req, res, next) => {
  7319. var json = queryString(req.url);
  7320. postmysql(req, res, "delShareCourse");
  7321. });
  7322. function delStudioCourseTypeS(course, courseId, userid) {
  7323. let _courseId = courseId;
  7324. var _userdata = [_courseId];
  7325. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_studioCourseTypeS");
  7326. mysql.usselect(_userdata, function(ret) {
  7327. // console.log(ret);
  7328. addStudioCourseTypeS(userid, course, _courseId);
  7329. });
  7330. // setTimeout(() => {
  7331. // }, 1000);
  7332. }
  7333. function addStudioCourseTypeS(userid, course, _courseId) {
  7334. var _uid = userid;
  7335. var _courses = _courseId;
  7336. var _tid = JSON.parse(decodeURIComponent(course));
  7337. for (let i = 0; i < _tid.length; i++) {
  7338. if (_tid[i] == "") {
  7339. continue;
  7340. }
  7341. var _userdata = [_courses, _tid[i], _uid];
  7342. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_studioCourseTypeS");
  7343. mysql.usselect(_userdata, function(ret) {
  7344. // console.log(ret);
  7345. });
  7346. }
  7347. }
  7348. //删除作业阶段任务工具
  7349. router.route("/deleteStudioToolSTT").all((req, res, next) => {
  7350. postmysql(req, res, "deleteStudioToolSTT");
  7351. });
  7352. //删除作业阶段任务
  7353. router.route("/deleteStudioToolST").all((req, res, next) => {
  7354. postmysql(req, res, "deleteStudioToolST");
  7355. });
  7356. //删除作业阶段
  7357. router.route("/deleteStudioToolS").all((req, res, next) => {
  7358. postmysql(req, res, "deleteStudioToolST");
  7359. });
  7360. //工作管理首页查询分类
  7361. router.route("/selectStudioCourseNew22Mode").all((req, res, next) => {
  7362. var json = queryString(req.url);
  7363. getmysql(
  7364. req,
  7365. res,
  7366. "selectStudioCourseNew22Mode",
  7367. json["type"],
  7368. json["uid"],
  7369. json["oid"],
  7370. json["org"],
  7371. json["typea"],
  7372. json["typeb"],
  7373. json["typec"],
  7374. json["typed"],
  7375. json["typef"],
  7376. json["typeE"],
  7377. json["cu"],
  7378. json["cn"]
  7379. );
  7380. });
  7381. //工作管理首页查询
  7382. router.route("/selectStudioCourseNew22").all((req, res, next) => {
  7383. var json = queryString(req.url);
  7384. getmysql(
  7385. req,
  7386. res,
  7387. "selectStudioCourseNew22",
  7388. json["type"],
  7389. json["uid"],
  7390. json["oid"],
  7391. json["org"],
  7392. json["typea"],
  7393. json["typeb"],
  7394. json["typec"],
  7395. json["typed"],
  7396. json["typef"],
  7397. json["typeE"],
  7398. json["cu"],
  7399. json["cn"],
  7400. json["page"],
  7401. json["pageSize"]
  7402. );
  7403. });
  7404. //根据学校查询banner
  7405. router.route("/selectBannerByOidStudio").all((req, res, next) => {
  7406. var json = queryString(req.url);
  7407. getmysql(req, res, "selectBannerByOidStudio", json["oid"]);
  7408. });
  7409. //admin 查询banner
  7410. router.route("/getBannerStudio").all((req, res, next) => {
  7411. var json = queryString(req.url);
  7412. getmysql(req, res, "getBannerStudio");
  7413. });
  7414. //查询工作课程详情
  7415. router.route("/selectStudioCourseDetail2").all((req, res, next) => {
  7416. //学生
  7417. var json = queryString(req.url);
  7418. getmysql(req, res, "selectStudioCourseDetail2", json["courseId"]);
  7419. });
  7420. //查询工作课程详情
  7421. router.route("/selectStudioCourseDetail3").all((req, res, next) => {
  7422. //学生
  7423. var json = queryString(req.url);
  7424. getmysql(req, res, "selectStudioCourseDetail3", json["courseId"]);
  7425. });
  7426. //上传文件
  7427. router.route("/addCourseWorks4studio").all((req, res, next) => {
  7428. postmysql3(req, res, "addCourseWorks4studio");
  7429. });
  7430. //查询教师资源分类
  7431. router.route("/selectAllSourceType").all((req, res, next) => {
  7432. //学生
  7433. var json = queryString(req.url);
  7434. getmysql(req, res, "selectAllSourceType", json["oid"], json["org"]);
  7435. });
  7436. //查询资源分类
  7437. router.route("/selectAllEvaType").all((req, res, next) => {
  7438. var json = queryString(req.url);
  7439. getmysql(req, res, "selectAllEvaType", json["oid"], json["org"]);
  7440. });
  7441. router.route("/addSource").all((req, res, next) => {
  7442. //添加资源
  7443. if (req.body[0]) {
  7444. p = [
  7445. req.body[0].name,
  7446. req.body[0].url,
  7447. req.body[0].detail,
  7448. req.body[0].label,
  7449. req.body[0].userid,
  7450. ];
  7451. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addSource");
  7452. //執行存儲過程
  7453. mysql.usselect(p, function(ret) {
  7454. let course = req.body[0].courseType;
  7455. let courseId = ret[0][0].id;
  7456. let userid = req.body[0].userid;
  7457. delSourceType(course, courseId, userid);
  7458. res.end(JSON.stringify({ id: ret[0][0].id, success: 1 }));
  7459. // res.end(JSON.stringify(ret));
  7460. });
  7461. }
  7462. });
  7463. //删除1资源模板分类
  7464. router.route("/deleteCETLabel").all((req, res, next) => {
  7465. var json = queryString(req.url);
  7466. getmysql2(req, res, "deleteCETLabel", json["cid"]);
  7467. });
  7468. //添加资源模板分类
  7469. router.route("/addCETLabel").all((req, res, next) => {
  7470. postmysql(req, res, "addCETLabel");
  7471. });
  7472. //资源模板分享
  7473. router.route("/addCETShare").all((req, res, next) => {
  7474. // if (req.body[0]) {
  7475. // p = [
  7476. // req.body[0].uid,
  7477. // req.body[0].n,
  7478. // req.body[0].json,
  7479. // req.body[0].t,
  7480. // req.body[0].oid,
  7481. // ];
  7482. // p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addCETShare");
  7483. // //執行存儲過程
  7484. // mysql.usselect(p, function(ret) {
  7485. // res.end(JSON.stringify({ id: ret[0][0].id, success: 1 }));
  7486. // // res.end(JSON.stringify(ret));
  7487. // });
  7488. // }
  7489. postmysql(req, res, "addCETShare");
  7490. });
  7491. router.route("/updateSource").all((req, res, next) => {
  7492. //修改资源
  7493. if (req.body[0]) {
  7494. p = [
  7495. req.body[0].id,
  7496. req.body[0].name,
  7497. req.body[0].url,
  7498. req.body[0].detail,
  7499. req.body[0].label,
  7500. req.body[0].userid,
  7501. ];
  7502. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateSource");
  7503. //執行存儲過程
  7504. mysql.usselect(p, function(ret) {
  7505. let course = req.body[0].courseType;
  7506. let courseId = req.body[0].id;
  7507. let userid = req.body[0].userid;
  7508. delSourceType(course, courseId, userid);
  7509. res.end(JSON.stringify({ id: req.body[0].id, success: 1 }));
  7510. // res.end(JSON.stringify(ret));
  7511. });
  7512. }
  7513. });
  7514. function delSourceType(course, courseId, userid) {
  7515. let _courseId = courseId;
  7516. var _userdata = [_courseId];
  7517. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "delete_sourceType");
  7518. mysql.usselect(_userdata, function(ret) {
  7519. addSourceType(userid, course, _courseId);
  7520. });
  7521. }
  7522. function addSourceType(userid, course, _courseId) {
  7523. var _uid = userid;
  7524. var _courses = _courseId;
  7525. var _tid = JSON.parse(decodeURIComponent(course));
  7526. for (let i = 0; i < _tid.length; i++) {
  7527. if (_tid[i] == "") {
  7528. continue;
  7529. }
  7530. var _userdata = [_courses, _tid[i], _uid];
  7531. _userdata.unshift(_mysqlLabor[0], _mysqlLabor[1], "add_sourceType");
  7532. mysql.usselect(_userdata, function(ret) {
  7533. // console.log(ret);
  7534. });
  7535. }
  7536. }
  7537. //资源查询
  7538. router.route("/selectSource").all((req, res, next) => {
  7539. var json = queryString(req.url);
  7540. getmysql(
  7541. req,
  7542. res,
  7543. "selectSource",
  7544. json["uid"],
  7545. json["oid"],
  7546. json["org"],
  7547. json["typea"],
  7548. json["typeb"],
  7549. json["typeE"],
  7550. json["cn"],
  7551. json["page"],
  7552. json["pageSize"]
  7553. );
  7554. });
  7555. //评价资源查询
  7556. router.route("/selectCourseEvaT").all((req, res, next) => {
  7557. var json = queryString(req.url);
  7558. getmysql(
  7559. req,
  7560. res,
  7561. "selectCourseEvaT",
  7562. json["uid"],
  7563. json["oid"],
  7564. json["org"],
  7565. json["typea"],
  7566. json["typeb"],
  7567. json["typeE"],
  7568. json["cn"],
  7569. json["type"],
  7570. json["page"],
  7571. json["pageSize"]
  7572. );
  7573. });
  7574. //评价资源重命名 修1
  7575. router.route("/updateCourseET").get((req, res, next) => {
  7576. var json = queryString(req.url);
  7577. getmysql2(
  7578. req,
  7579. res,
  7580. "updateCourseET",
  7581. json["id"],
  7582. json["n"],
  7583. );
  7584. });
  7585. //删除1评价资源
  7586. router.route("/deleteCourseET").all((req, res, next) => {
  7587. var json = queryString(req.url);
  7588. getmysql2(
  7589. req,
  7590. res,
  7591. "deleteCourseET",
  7592. json["id"],
  7593. );
  7594. });
  7595. //添加评价资源分类 修1
  7596. router.route("/addCETType").get((req, res, next) => {
  7597. var json = queryString(req.url);
  7598. getmysql2(
  7599. req,
  7600. res,
  7601. "addCETType",
  7602. json["pid"],
  7603. json["ppid"],
  7604. json["n"],
  7605. json["uid"],
  7606. json["oid"],
  7607. );
  7608. });
  7609. //课程打开次数
  7610. router.route("/addOpenCoursenum").all((req, res, next) => {
  7611. postmysql(req, res, "addOpenCoursenum");
  7612. });
  7613. // 数据看板ai应用
  7614. router.route("/getKanbanBasedata").all((req, res, next) => {
  7615. postmysql(req, res, "getKanbanBasedata");
  7616. });
  7617. // 数据看板ai应用
  7618. router.route("/getKanbanAIdata").all((req, res, next) => {
  7619. postmysql(req, res, "getKanbanAIdata");
  7620. });
  7621. // 数据看板常规教学
  7622. router.route("/getKanbanTeadata").all((req, res, next) => {
  7623. postmysql(req, res, "getKanbanTeadata");
  7624. });
  7625. // 数据看板常规教学
  7626. router.route("/getKanbanTeaManagedata").all((req, res, next) => {
  7627. postmysql(req, res, "getKanbanTeaManagedata");
  7628. });
  7629. //数据看板-综合数据
  7630. router.route("/selectDataBoardSchool").all((req, res, next) => {
  7631. postmysql(req, res, "selectDataBoardSchool");
  7632. });
  7633. //数据看板-教师数据
  7634. router.route("/selectDataBoardTeacher").all((req, res, next) => {
  7635. postmysql(req, res, "selectDataBoardTeacher");
  7636. });
  7637. //数据看板-学生数据
  7638. router.route("/selectDataBoardStudent").all((req, res, next) => {
  7639. postmysql(req, res, "selectDataBoardStudent");
  7640. });
  7641. //数据看板-课程数据
  7642. router.route("/selectDataBoardCourse").all((req, res, next) => {
  7643. postmysql(req, res, "selectDataBoardCourse");
  7644. });
  7645. //数据看板-综合数据
  7646. router.route("/selectDataBoardSchoolNew").all((req, res, next) => {
  7647. postmysql(req, res, "selectDataBoardSchoolNew");
  7648. });
  7649. //数据看板-教师数据
  7650. router.route("/selectDataBoardTeacherNew").all((req, res, next) => {
  7651. postmysql(req, res, "selectDataBoardTeacherNew");
  7652. });
  7653. //数据看板-学生数据
  7654. router.route("/selectDataBoardStudentNew").all((req, res, next) => {
  7655. postmysql(req, res, "selectDataBoardStudentNew");
  7656. });
  7657. //数据看板-课程数据
  7658. router.route("/selectDataBoardCourseNew").all((req, res, next) => {
  7659. postmysql(req, res, "selectDataBoardCourseNew");
  7660. });
  7661. //数据看板-课程数据
  7662. router.route("/selectDataBoardStudentCourseNew").all((req, res, next) => {
  7663. postmysql(req, res, "selectDataBoardStudentCourseNew");
  7664. });
  7665. //数据看板-学生排行榜
  7666. router.route("/selectDataboardStudentRank").all((req, res, next) => {
  7667. postmysql(req, res, "selectDataboardStudentRank");
  7668. });
  7669. //数据看板-教师排行榜
  7670. router.route("/selectDataboardTeacherRank").all((req, res, next) => {
  7671. postmysql(req, res, "selectDataboardTeacherRank");
  7672. });
  7673. //数据看板-评测
  7674. router.route("/selectDataBoardTest").all((req, res, next) => {
  7675. postmysql(req, res, "selectDataBoardTest");
  7676. });
  7677. //数据看板-市级数据
  7678. router.route("/selectDataBoardCitySz").all((req, res, next) => {
  7679. postmysql(req, res, "selectDataBoardCitySz");
  7680. });
  7681. //数据看板-区级数据
  7682. router.route("/selectDataBoardAreaSz").all((req, res, next) => {
  7683. postmysql(req, res, "selectDataBoardAreaSz");
  7684. });
  7685. //数据看板-综合数据
  7686. router.route("/getDataBoardSchoolNew").all((req, res, next) => {
  7687. let p = Object.values(req.body[0]);
  7688. let d = Object.values(req.body[0]);
  7689. console.log(p)
  7690. p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
  7691. mysql.usselect(p, function(ret) {
  7692. if(!ret[0].length){
  7693. let p2 = [d[0], d[1]];
  7694. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardSchoolNew');
  7695. mysql.usselect(p2, function(ret) {
  7696. res.end(JSON.stringify(ret));
  7697. let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'1'];
  7698. p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
  7699. mysql.usselect(p3, function(ret) {})
  7700. });
  7701. }else{
  7702. console.log(1);
  7703. res.end(ret[0][0].json);
  7704. }
  7705. // res.end(JSON.stringify(ret));
  7706. });
  7707. });
  7708. //数据看板-课程数据
  7709. router.route("/getDataBoardCourseNew").all((req, res, next) => {
  7710. let p = Object.values(req.body[0]);
  7711. let d = Object.values(req.body[0]);
  7712. console.log(p)
  7713. p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
  7714. mysql.usselect(p, function(ret) {
  7715. if(!ret[0].length){
  7716. let p2 = [d[0], d[1]];
  7717. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardCourseNew');
  7718. mysql.usselect(p2, function(ret) {
  7719. res.end(JSON.stringify(ret));
  7720. let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'2'];
  7721. p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
  7722. mysql.usselect(p3, function(ret) {})
  7723. });
  7724. }else{
  7725. console.log(1);
  7726. res.end(ret[0][0].json);
  7727. }
  7728. // res.end(JSON.stringify(ret));
  7729. });
  7730. });
  7731. //数据看板-项目数据
  7732. router.route("/getDataBoardStudentCourseNew").all((req, res, next) => {
  7733. let p = Object.values(req.body[0]);
  7734. let d = Object.values(req.body[0]);
  7735. console.log(p)
  7736. p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
  7737. mysql.usselect(p, function(ret) {
  7738. if(!ret[0].length){
  7739. let p2 = [d[0], d[1]];
  7740. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardStudentCourseNew');
  7741. mysql.usselect(p2, function(ret) {
  7742. res.end(JSON.stringify(ret));
  7743. let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'3'];
  7744. p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
  7745. mysql.usselect(p3, function(ret) {})
  7746. });
  7747. }else{
  7748. console.log(1);
  7749. res.end(ret[0][0].json);
  7750. }
  7751. // res.end(JSON.stringify(ret));
  7752. });
  7753. });
  7754. //数据看板-学生数据
  7755. router.route("/getDataBoardStudentNew").all((req, res, next) => {
  7756. let p = Object.values(req.body[0]);
  7757. let d = Object.values(req.body[0]);
  7758. console.log(p)
  7759. p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
  7760. mysql.usselect(p, function(ret) {
  7761. if(!ret[0].length){
  7762. let p2 = [d[0], d[1]];
  7763. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardStudentNew');
  7764. mysql.usselect(p2, function(ret) {
  7765. res.end(JSON.stringify(ret));
  7766. let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'5'];
  7767. p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
  7768. mysql.usselect(p3, function(ret) {})
  7769. });
  7770. }else{
  7771. console.log(1);
  7772. res.end(ret[0][0].json);
  7773. }
  7774. // res.end(JSON.stringify(ret));
  7775. });
  7776. });
  7777. //数据看板-教师数据
  7778. router.route("/getDataBoardTeacherNew").all((req, res, next) => {
  7779. let p = Object.values(req.body[0]);
  7780. let d = Object.values(req.body[0]);
  7781. console.log(p)
  7782. p.unshift(_mysqlLabor[0], _mysqlLabor[1], 'getDataBoard');
  7783. mysql.usselect(p, function(ret) {
  7784. if(!ret[0].length){
  7785. let p2 = [d[0], d[1]];
  7786. p2.unshift(_mysqlLabor[0], _mysqlLabor[1], 'selectDataBoardTeacherNew');
  7787. mysql.usselect(p2, function(ret) {
  7788. res.end(JSON.stringify(ret));
  7789. let p3 = [d[0], d[1],encodeURIComponent(JSON.stringify(ret)),'4'];
  7790. p3.unshift(_mysqlLabor[0], _mysqlLabor[1], 'addDataBoard');
  7791. mysql.usselect(p3, function(ret) {})
  7792. });
  7793. }else{
  7794. console.log(1);
  7795. res.end(ret[0][0].json);
  7796. }
  7797. // res.end(JSON.stringify(ret));
  7798. });
  7799. });
  7800. //数据看板-查询项目数据长度
  7801. router.route("/getCourseLength").all((req, res, next) => {
  7802. postmysql(req, res, "getCourseLength");
  7803. });
  7804. //评测中心-上传评测
  7805. router.route("/addTestWorks").all((req, res, next) => {
  7806. postmysql(req, res, "addTestWorks");
  7807. });
  7808. //评测中心-上传评测
  7809. router.route("/addTestWorks2").all((req, res, next) => {
  7810. postmysql(req, res, "addTestWorks2");
  7811. });
  7812. //评测中心-删除评测
  7813. router.route("/deleteTestCourse").all((req, res, next) => {
  7814. postmysql(req, res, "deleteTestCourse");
  7815. });
  7816. //评测中心-批改
  7817. router.route("/addTestWorksTeacher").all((req, res, next) => {
  7818. postmysql(req, res, "addTestWorksTeacher");
  7819. });
  7820. //评测中心-复制评测
  7821. router.route("/copyTestWorks").all((req, res, next) => {
  7822. postmysql(req, res, "copyTestWorks");
  7823. });
  7824. //评测中心-查询用户测评总览
  7825. router.route("/selectTestUserY").all((req, res, next) => {
  7826. var json = queryString(req.url);
  7827. getmysql(req, res, "selectTestUserY", json["uid"], json["oid"], json["org"]);
  7828. });
  7829. //查询用户学习记录总览
  7830. router.route("/selectSRecordY").all((req, res, next) => {
  7831. var json = queryString(req.url);
  7832. getmysql(req, res, "selectSRecordY", json["uid"], json["oid"], json["org"]);
  7833. });
  7834. //查询幼儿园全部及学校分类
  7835. router.route("/selectSEAllType").all((req, res, next) => {
  7836. var json = queryString(req.url);
  7837. getmysql(req, res, "selectSEAllType", json["oid"]);
  7838. });
  7839. //根据学期查询幼儿园个人评分
  7840. router.route("/selectSETable").all((req, res, next) => {
  7841. var json = queryString(req.url);
  7842. getmysql(req, res, "selectSETable", json["uid"], json["oid"], json["org"], json["cu"]);
  7843. });
  7844. //根据学期保存幼儿园个人评分 修1
  7845. router.route("/addSRScore").get((req, res, next) => {
  7846. var json = queryString(req.url);
  7847. getmysql2(req, res, "addSRScore", json["uid"], json["j"], json["t"]);
  7848. });
  7849. //评测中心-数据 修1 这个不确定所以先加上了
  7850. router.route("/testDataBoard").get((req, res, next) => {
  7851. var json = queryString(req.url);
  7852. getmysql2(req, res, "testDataBoard", json["oid"], json["org"]);
  7853. });
  7854. //评测中心-查询用户数据
  7855. router.route("/selectTestUser").all((req, res, next) => {
  7856. var json = queryString(req.url);
  7857. getmysql(req, res, "selectTestUser", json["uid"]);
  7858. });
  7859. //评测中心-获取评测提交详情
  7860. router.route("/getTestWorks").all((req, res, next) => {
  7861. var json = queryString(req.url);
  7862. getmysql(req, res, "getTestWorks", json["cid"], json["uid"]);
  7863. });
  7864. //评测中心-获取评测提交详情
  7865. router.route("/getTestWorks2").all((req, res, next) => {
  7866. var json = queryString(req.url);
  7867. getmysql(req, res, "getTestWorks2", json["cid"], json["tid"]);
  7868. });
  7869. //评测中心-获取评测提交详情
  7870. router.route("/selectTestCourseWorks").all((req, res, next) => {
  7871. var json = queryString(req.url);
  7872. getmysql(req, res, "selectTestCourseWorks", json["cid"], json["tid"]);
  7873. });
  7874. //评测中心-获取评测提交详情
  7875. router.route("/getTestWorksPage").all((req, res, next) => {
  7876. var json = queryString(req.url);
  7877. getmysql(req, res, "getTestWorksPage", json["cid"], json["page"], json["pageSize"]);
  7878. });
  7879. //评测中心-获取评测提交详情
  7880. router.route("/getTestWorksPage3").all((req, res, next) => {
  7881. var json = queryString(req.url);
  7882. getmysql(req, res, "getTestWorksPage3", json["cid"], json["cn"], json["page"], json["pageSize"]);
  7883. });
  7884. //评测中心-获取评测提交详情
  7885. router.route("/getTestWorksNoPage").all((req, res, next) => {
  7886. var json = queryString(req.url);
  7887. getmysql(req, res, "getTestWorksNoPage", json["cid"], json["cn"]);
  7888. });
  7889. //评测中心-获取评测提交详情 yym
  7890. router.route("/getTestWorksNoPageCopy").all((req, res, next) => {
  7891. var json = queryString(req.url);
  7892. getmysql(req, res, "getTestWorksNoPageCopy", json["cid"], json["cn"], json["tim"], json["tea"]);
  7893. });
  7894. //评测中心-获取评测提交详情 yym
  7895. router.route("/getTestWorksNoPageCopy2").all((req, res, next) => {
  7896. postmysql(req, res, "getTestWorksNoPageCopy2");
  7897. });
  7898. //评测中心-智能表单ai评分
  7899. router.route("/addtestAiSco").all((req, res, next) => {
  7900. postmysql(req, res, "addtestAiSco");
  7901. });
  7902. //评测中心-智能表单ai评分
  7903. router.route("/deltestAisco").all((req, res, next) => {
  7904. postmysql(req, res, "deltestAisco");
  7905. });
  7906. //评测中心-获取智能表单ai评分
  7907. router.route("/getTestAiSco").all((req, res, next) => {
  7908. var json = queryString(req.url);
  7909. getmysql(req, res, "getTestAiSco", json["tid"]);
  7910. });
  7911. //评测中心-获取评测提交详情
  7912. router.route("/getTestWorksPage2").all((req, res, next) => {
  7913. var json = queryString(req.url);
  7914. getmysql(req, res, "getTestWorksPage2", json["cid"], json["page"], json["pageSize"]);
  7915. });
  7916. //评测中心-个人中心
  7917. router.route("/getTestWorksPerson").all((req, res, next) => {
  7918. var json = queryString(req.url);
  7919. getmysql(req, res, "getTestWorksPerson", json["uid"], json["typeid"]);
  7920. });
  7921. //教师发展-考核-查询是否有提交的的数据
  7922. router.route("/getTestExamineByUserId").all((req, res, next) => {
  7923. var json = queryString(req.url);
  7924. getmysql(req, res, "getTestExamineByUserId", json["uid"], json["type"]);
  7925. });
  7926. //教师发展-考核-查询是否有提交的的数据 加上tid查询
  7927. router.route("/getTestExamineByUserId2").all((req, res, next) => {
  7928. var json = queryString(req.url);
  7929. getmysql(req, res, "getTestExamineByUserId2", json["uid"], json["type"],json["tid"]);
  7930. });
  7931. //教师发展-考核-查询是否有提交的的数据
  7932. router.route("/addTestExamineWorks").all((req, res, next) => {
  7933. postmysql(req, res, "addTestExamineWorks");
  7934. });
  7935. //教师发展-考核-查询是否有提交的的数据 加上tid
  7936. router.route("/addTestExamineWorks2").all((req, res, next) => {
  7937. postmysql(req, res, "addTestExamineWorks2");
  7938. });
  7939. //教师发展-考核-管理员页面获取所有数据,用于计算平均分等
  7940. router.route("/selectTestExamineAllData").all((req, res, next) => {
  7941. var json = queryString(req.url);
  7942. getmysql(req, res, "selectTestExamineAllData", json["oid"], json["org"], json["type"]);
  7943. // postmysql(req, res, "selectTestExamineAllData");
  7944. });
  7945. //教师发展-考核-管理员页面获取所有数据,用于计算平均分等 ,加上对应的tid
  7946. router.route("/selectTestExamineAllData2").all((req, res, next) => {
  7947. var json = queryString(req.url);
  7948. getmysql(req, res, "selectTestExamineAllData2", json["oid"], json["org"], json["type"],json['tid']);
  7949. // postmysql(req, res, "selectTestExamineAllData");
  7950. });
  7951. //教师发展-考核-管理员页面获取二级指标数据,用于计算平均分等
  7952. router.route("/selectTestExamineSecondData").all((req, res, next) => {
  7953. var json = queryString(req.url);
  7954. getmysql(req, res, "selectTestExamineSecondData", json["oid"], json["org"], json["type"]);
  7955. // postmysql(req, res, "selectTestExamineAllData");
  7956. });
  7957. //教师发展-考核-管理员页面获取二级指标数据,用于计算平均分等 加上tid
  7958. router.route("/selectTestExamineSecondData2").all((req, res, next) => {
  7959. var json = queryString(req.url);
  7960. getmysql(req, res, "selectTestExamineSecondData2", json["oid"], json["org"], json["type"],json['tid']);
  7961. // postmysql(req, res, "selectTestExamineAllData");
  7962. });
  7963. //查询英语写作评价模板
  7964. router.route("/selectEnglishEva").all((req, res, next) => {
  7965. var json = queryString(req.url);
  7966. getmysql(req, res, "selectEnglishEva", json["oid"]);
  7967. });
  7968. //新增英语写作评价模板
  7969. router.route("/insertEnglishEva").all((req, res, next) => {
  7970. postmysql(req, res, "insertEnglishEva");
  7971. });
  7972. //获取作业数量
  7973. router.route("/getStudentCourseWorkCount").all((req, res, next) => {
  7974. postmysql(req, res, "getStudentCourseWorkCount");
  7975. });
  7976. //获取作业数量
  7977. router.route("/getCourseWorkCount").all((req, res, next) => {
  7978. postmysql(req, res, "getCourseWorkCount");
  7979. });
  7980. //根据id查询英语写作评价模板
  7981. router.route("/selectEnglishEvaById").all((req, res, next) => {
  7982. var json = queryString(req.url);
  7983. getmysql(req, res, "selectEnglishEvaById", json["id"], json["oid"]);
  7984. });
  7985. //根据id删除1英语写作评价模板
  7986. router.route("/deleteEnglishEvaById").all((req, res, next) => {
  7987. var json = queryString(req.url);
  7988. getmysql2(req, res, "deleteEnglishEvaById", json["id"]);
  7989. });
  7990. //获取评价模板
  7991. router.route("/getCourseEvaTemplate").all((req, res, next) => {
  7992. var json = queryString(req.url);
  7993. getmysql(req, res, "getCourseEvaTemplate", json["oid"], json["org"], json["n"]);
  7994. });
  7995. //案例新项目登录接口
  7996. router.route("/loginNewEvenManage").all((req, res, next) => {
  7997. postmysql(req, res, "loginNewEvenManage");
  7998. });
  7999. //案例新项目创建用户接口
  8000. router.route("/addNewRaceUser").all((req, res, next) => {
  8001. postmysql(req, res, "addNewRaceUser");
  8002. });
  8003. //查询老师的信息
  8004. router.route("/getRaceUser1").all((req, res, next) => {
  8005. var json = queryString(req.url);
  8006. getmysql(req, res, "getRaceUser1", json["uid"]);
  8007. });
  8008. //修改用户信息
  8009. router.route("/updateRaceUser1").all((req, res, next) => {
  8010. postmysql(req, res, "updateRaceUser1");
  8011. });
  8012. /* 修改评审员 修1 */
  8013. router.route("/updateReviewer").get((req, res, next) => {
  8014. var json = queryString(req.url);
  8015. getmysql2(
  8016. req,
  8017. res,
  8018. "updateReviewer",
  8019. json["n"],
  8020. json["p"],
  8021. json["t"],
  8022. json["s"],
  8023. json["uid"]
  8024. );
  8025. });
  8026. //race 查询学校
  8027. router.route("/getSchool1").all((req, res, next) => {
  8028. var json = queryString(req.url);
  8029. getmysql(req, res, "getSchool1", json["n"]);
  8030. });
  8031. //查询赛事项目列表
  8032. router.route("/selectRaceList1").all((req, res, next) => {
  8033. var json = queryString(req.url);
  8034. getmysql(req, res, "selectRaceList1", json["uid"], json["t"], json["oid"], json["org"]);
  8035. });
  8036. //修改赛事状态 修1
  8037. router.route("/updateRaceStateGM").get((req, res, next) => {
  8038. var json = queryString(req.url);
  8039. getmysql2(req, res, "updateRaceStateGM", json["id"], json["s"]);
  8040. });
  8041. //删除1案例
  8042. router.route("/deleteAnliGM").all((req, res, next) => {
  8043. var json = queryString(req.url);
  8044. getmysql2(req, res, "deleteAnliGM", json["id"]);
  8045. });
  8046. //新增赛事项目
  8047. router.route("/addRaceGM").all((req, res, next) => {
  8048. if (req.body[0]) {
  8049. p = [
  8050. req.body[0].uid,
  8051. req.body[0].info,
  8052. req.body[0].over,
  8053. req.body[0].pro,
  8054. req.body[0].act,
  8055. req.body[0].exc,
  8056. req.body[0].res,
  8057. ];
  8058. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "addRaceGM"); //執行存儲過程
  8059. mysql.usselect(p, function(ret) {
  8060. let course = req.body[0].courseType;
  8061. let courseId = ret[0][0].id;
  8062. let userid = req.body[0].uid;
  8063. delCourseType1(course, courseId, userid);
  8064. res.end(JSON.stringify({ courseId: courseId, success: 1 }));
  8065. });
  8066. }
  8067. });
  8068. //修改赛事项目
  8069. router.route("/updateRaceGM").all((req, res, next) => {
  8070. if (req.body[0]) {
  8071. p = [
  8072. req.body[0].id,
  8073. req.body[0].info,
  8074. req.body[0].over,
  8075. req.body[0].pro,
  8076. req.body[0].act,
  8077. req.body[0].exc,
  8078. req.body[0].res,
  8079. ];
  8080. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "updateRaceGM"); //執行存儲過程
  8081. mysql.usselect(p, function(ret) {
  8082. let course = req.body[0].courseType;
  8083. let courseId = req.body[0].id;
  8084. let userid = req.body[0].uid;
  8085. delCourseType1(course, courseId, userid);
  8086. res.end(JSON.stringify({ success: 1 }));
  8087. });
  8088. }
  8089. });
  8090. //查询赛事项目详情
  8091. router.route("/selectRaceDetailGM").all((req, res, next) => {
  8092. var json = queryString(req.url);
  8093. getmysql(req, res, "selectRaceDetailGM", json["id"]);
  8094. });
  8095. //查询赛事项目详情
  8096. router.route("/selectRaceDetailGM2").all((req, res, next) => {
  8097. var json = queryString(req.url);
  8098. getmysql(req, res, "selectRaceDetailGM2", json["id"]);
  8099. });
  8100. //查询赛事分类及子分类
  8101. router.route("/selectMatTypeGM").all((req, res, next) => {
  8102. var json = queryString(req.url);
  8103. getmysql(req, res, "selectMatTypeGM");
  8104. });
  8105. //添加资源库分类
  8106. router.route("/addSourceFileType").all((req, res, next) => {
  8107. postmysql(req, res, "addSourceFileType");
  8108. });
  8109. //查询资源库分类
  8110. router.route("/getSourceFileType").all((req, res, next) => {
  8111. var json = queryString(req.url);
  8112. getmysql(req, res, "getSourceFileType", json["uid"]);
  8113. });
  8114. //删除资源库分类
  8115. router.route("/deleteSoureFileType").all((req, res, next) => {
  8116. postmysql(req, res, "deleteSoureFileType");
  8117. });
  8118. //修改资源库分类名字
  8119. router.route("/updateSourceFileName").all((req, res, next) => {
  8120. postmysql(req, res, "updateSourceFileName");
  8121. });
  8122. //修改资源库分类父级
  8123. router.route("/updateSourceFileTypePid").all((req, res, next) => {
  8124. postmysql(req, res, "updateSourceFileTypePid");
  8125. });
  8126. //添加资源库
  8127. router.route("/addSourceFile").all((req, res, next) => {
  8128. postmysql(req, res, "addSourceFile");
  8129. });
  8130. //查询资源库上传文件
  8131. router.route("/getSourceFile").all((req, res, next) => {
  8132. var json = queryString(req.url);
  8133. getmysql(req, res, "getSourceFile", json["uid"], json["pid"], json["n"]);
  8134. });
  8135. //删除资源库
  8136. router.route("/deleteSourceFile").all((req, res, next) => {
  8137. postmysql(req, res, "deleteSourceFile");
  8138. });
  8139. //移动资源库
  8140. router.route("/updateSourceFilePid").all((req, res, next) => {
  8141. postmysql(req, res, "updateSourceFilePid");
  8142. });
  8143. //查询资源库上传文件
  8144. router.route("/getCourseInfoTest").all((req, res, next) => {
  8145. var json = queryString(req.url);
  8146. getmysql(req, res, "getCourseInfoTest", json["cid"]);
  8147. });
  8148. //查看已经的作业
  8149. router.route("/selectTestWorksCid").all((req, res, next) => {
  8150. var json = queryString(req.url);
  8151. getmysql(req, res, "selectTestWorksCid", json["cid"], json["uid"]);
  8152. });
  8153. //查询资源库上传文件
  8154. router.route("/getCourseInfoTestAll").all((req, res, next) => {
  8155. var json = queryString(req.url);
  8156. getmysql(req, res, "getCourseInfoTestAll", json["cid"]);
  8157. });
  8158. //查询资源库上传文件
  8159. router.route("/getCourseInfoTestAll2").all((req, res, next) => {
  8160. postmysql(req, res, "getCourseInfoTestAll");
  8161. });
  8162. //还原课程功能
  8163. router.route("/revertCourse").all((req, res, next) => {
  8164. postmysql(req, res, "revertCourse");
  8165. });
  8166. //还原课程功能
  8167. router.route("/revertCourseSz").all((req, res, next) => {
  8168. postmysql2(req, res, "revertCourse");
  8169. });
  8170. //根据课程id查询关联的表单
  8171. router.route("/selectTestCourseByCid").all((req, res, next) => {
  8172. var json = queryString(req.url);
  8173. getmysql(req, res, "selectTestCourseByCid", json["cid"]);
  8174. });
  8175. //qgt 根据用户id和文件标题获取答案来自动填写
  8176. router.route("/selectTestCourseAutoFillType3").all((req,res,next)=>{
  8177. var json = queryString(req.url);
  8178. getmysql(req, res, "selectTestCourseAutoFillType3", json["uid"],json["tit"]);
  8179. });
  8180. //qgt 课堂观察另存为模板
  8181. router.route("/insertClassroomTemplate").all((req,res,next)=>{
  8182. postmysql(req, res, "insertClassroomTemplate");
  8183. })
  8184. //qgt 课堂观察获取模板
  8185. router.route("/selectClassroomTemplate").all((req,res,next)=>{
  8186. var json = queryString(req.url);
  8187. getmysql(req, res, "selectClassroomTemplate", json["uid"],json["txt"],json["sub"],json["type1"]);
  8188. })
  8189. //qgt 课堂观察修改收藏模板
  8190. router.route("/updateClassroomTemplateCollect").all((req,res,next)=>{
  8191. postmysql(req, res, "updateClassroomTemplateCollect");
  8192. })
  8193. //qgt 课堂观察获取模板详细
  8194. router.route("/selectClassroomTemplateDetail").all((req,res,next)=>{
  8195. var json = queryString(req.url);
  8196. getmysql(req, res, "selectClassroomTemplateDetail", json["uid"],json["cid"],json['st']);
  8197. })
  8198. //qgt 课堂观察修改模板
  8199. router.route("/updateClassroomTemplateData").all((req,res,next)=>{
  8200. postmysql(req, res, "updateClassroomTemplateData");
  8201. })
  8202. //qgt设置用户默认模板
  8203. router.route("/updateClassroomDefault").all((req,res,next)=>{
  8204. postmysql(req, res, "updateClassroomDefault");
  8205. })
  8206. //qgt 获取用户默认模板
  8207. router.route("/selectClassroomDefault").all((req,res,next)=>{
  8208. var json = queryString(req.url);
  8209. getmysql(req, res, "selectClassroomDefault", json["uid"]);
  8210. })
  8211. //qgt 保存课堂助手任务面板题目
  8212. router.route("/updateCourseWorks_classRoomHelper").all((req,res,next)=>{
  8213. postmysql(req, res, "updateCourseWorks_classRoomHelper");
  8214. })
  8215. //qgt 获取课堂助手任务面板题目
  8216. router.route("/select_courseWorks_classRoomHelper").all((req,res,next)=>{
  8217. var json = queryString(req.url);
  8218. getmysql(req, res, "select_courseWorks_classRoomHelper", json["uid"],json["cid"]);
  8219. })
  8220. //qgt 获取课堂助手中当前课程所有做了选择题的数据
  8221. router.route("/select_courseWorksAll_classRoomHelper").all((req,res,next)=>{
  8222. var json = queryString(req.url);
  8223. getmysql(req, res, "select_courseWorksAll_classRoomHelper", json["uid"],json["cid"]);
  8224. })
  8225. //qgt 课堂助手倒计时面板插入数据
  8226. router.route("/insert_systemOperation_classRoomHelper").all((req,res,next)=>{
  8227. postmysql(req, res, "insert_systemOperation_classRoomHelper");
  8228. })
  8229. //qgt 课堂助手行为备忘(添加)
  8230. router.route("/insert_systemOperation_countdownBehavior").all((req,res,next)=>{
  8231. postmysql(req,res,'insert_systemOperation_countdownBehavior')
  8232. })
  8233. //lsc 课程管理行为备忘(添加)
  8234. router.route("/addCourseBehavior").all((req,res,next)=>{
  8235. console.log(req.body[0].content)
  8236. postmysql(req,res,'addCourseBehavior')
  8237. })
  8238. //qgt 课堂助手行为备忘(获取)
  8239. router.route("/select_systemOperation_countdownBehavior").all((req,res,next)=>{
  8240. var json = queryString(req.url);
  8241. getmysql(req, res, "select_systemOperation_countdownBehavior", json["uid"],json["courseId"]);
  8242. })
  8243. //qgt 课堂观察新建模板分析
  8244. router.route("/insert_smodel").all((req,res,next)=>{
  8245. postmysql(req,res,'insert_smodel')
  8246. })
  8247. //qgt 课堂观察获取用户的模板分析
  8248. router.route('/select_smodel').all((req,res,next)=>{
  8249. var json = queryString(req.url);
  8250. getmysql(req, res, "select_smodel", json["uid"]);
  8251. })
  8252. //qgt 课堂观察获取指定的分析
  8253. router.route('/select_smodelById').all((req,res,next)=>{
  8254. var json = queryString(req.url);
  8255. getmysql(req, res, "select_smodelById", json["uid"],json["mid"]);
  8256. })
  8257. //qgt 课堂观察删除指定模块
  8258. router.route("/delete_smodelById").all((req,res,next)=>{
  8259. postmysql(req,res,'delete_smodelById')
  8260. })
  8261. //qgt 课堂观察修改指定模块
  8262. router.route("/update_smodel").all((req,res,next)=>{
  8263. postmysql(req,res,'update_smodel')
  8264. })
  8265. //qgt 教师画像面板获取数据
  8266. router.route('/selectPortraitData').all((req,res,next)=>{
  8267. var json = queryString(req.url);
  8268. getmysql(req, res, "selectPortraitData", json["uid"]);
  8269. })
  8270. //qgt 修改testCourse的Cover字段
  8271. router.route('/update_testCourseCoverById').all((req,res,next)=>{
  8272. postmysql(req,res,'update_testCourseCoverById')
  8273. })
  8274. //qgt 修改课程的分屏数据
  8275. router.route('/update_courseSplitScreenData').all((req,res,next)=>{
  8276. postmysql(req,res,'update_courseSplitScreenData')
  8277. })
  8278. //qgt 获取课程的分屏数据
  8279. router.route('/select_courseSplitScreenData').all((req,res,next)=>{
  8280. var json = queryString(req.url);
  8281. getmysql(req, res, "select_courseSplitScreenData", json["cid"]);
  8282. })
  8283. //qgt 应用管理-添加类型
  8284. router.route('/insert_appStoreType').all((req,res,next)=>{
  8285. postmysql(req,res,'insert_appStoreType')
  8286. })
  8287. //qgt 应用管理-获取类型
  8288. router.route('/select_appStoreType').all((req,res,next)=>{
  8289. var json = queryString(req.url);
  8290. getmysql(req, res, "select_appStoreType", json["suserid"],json["sorg"],json["soid"],json["sstand"]);
  8291. })
  8292. //qgt 应用管理-获取类型-不获取某些类型
  8293. router.route('/select_appStoreType_exceptType').all((req,res,next)=>{
  8294. var json = queryString(req.url);
  8295. getmysql(req, res, "select_appStoreType_exceptType", json["suserid"],json["sorg"],json["soid"],json["sstand"],json["exportType"]);
  8296. })
  8297. //qgt 应用管理-添加应用
  8298. router.route('/insert_appStore').all((req,res,next)=>{
  8299. postmysql(req, res, "insert_appStore");
  8300. })
  8301. //qgt 应用管理-添加应用
  8302. router.route('/insert_appStoreJson').all((req,res,next)=>{
  8303. postmysql3(req, res, "insert_appStore");
  8304. })
  8305. //qgt 应用管理-获取应用
  8306. router.route('/select_appStore').all((req,res,next)=>{
  8307. var json = queryString(req.url);
  8308. getmysql(req, res, "select_appStore", json["uid"],json["name"],json["label"],json["type"],json["juri"],json["stand"],json['status']);
  8309. })
  8310. router.route('/select_appStore_exportType').all((req,res,next)=>{
  8311. var json = queryString(req.url);
  8312. getmysql(req, res, "select_appStore_exportType", json["uid"],json["name"],json["label"],json["type"],json["juri"],json["stand"],json['status'],json["exportType"]);
  8313. })
  8314. router.route('/select_appStore_exportType2').all((req,res,next)=>{
  8315. var json = queryString(req.url);
  8316. getmysql(req, res, "select_appStore_exportType2", json["uid"],json["name"],json["label"],json["type"],json["juri"],json["stand"],json['status'],json['model'],json["exportType"]);
  8317. })
  8318. //qgt 应用管理-修改应用
  8319. router.route('/update_appStore').all((req,res,next)=>{
  8320. postmysql(req, res, "update_appStore");
  8321. })
  8322. //qgt 应用管理-修改应用
  8323. router.route('/update_appStoreJson').all((req,res,next)=>{
  8324. postmysql3(req, res, "update_appStore");
  8325. })
  8326. //qgt 应用管理-添加收藏或者最近使用
  8327. router.route('/insert_appStoreSave').all((req,res,next)=>{
  8328. postmysql(req, res, "insert_appStoreSave");
  8329. })
  8330. //qgt 应用管理-获取收藏或者最近使用
  8331. router.route('/select_appStoreSave').all((req,res,next)=>{
  8332. var json = queryString(req.url);
  8333. getmysql(req, res, "select_appStoreSave", json["uid"],json["type"],json["limit"]);
  8334. })
  8335. //qgt 应用管理-取消收藏
  8336. router.route('/delete_appStoreSave').all((req,res,next)=>{
  8337. postmysql(req, res, "delete_appStoreSave");
  8338. })
  8339. //qgt 应用管理-删除应用
  8340. router.route('/delete_appStore').all((req,res,next)=>{
  8341. postmysql(req,res,"delete_appStore")
  8342. })
  8343. //qgt 应用管理-删除应用
  8344. router.route('/delete_appStoreJson').all((req,res,next)=>{
  8345. postmysql3(req,res,"delete_appStore")
  8346. })
  8347. //qgt banner获取
  8348. router.route('/select_bannerByoidORorg').all((req,res,next)=>{
  8349. var json = queryString(req.url);
  8350. getmysql(req, res, "select_bannerByoidORorg", json["uid"],json["oid"],json["org"],json["type"]);
  8351. })
  8352. //qgt 获取单个应用
  8353. router.route("/select_appStoreById").all((req,res,next)=>{
  8354. var json = queryString(req.url);
  8355. getmysql(req, res, "select_appStoreById", json["uid"],json["aid"]);
  8356. })
  8357. //qgt 获取应用中心得控制json
  8358. router.route("/select_appStore_controls").all((req,res,next)=>{
  8359. var json = queryString(req.url);
  8360. getmysql(req, res, "select_appStore_controls", json["uid"],json["org"],json["oid"]);
  8361. })
  8362. //qgt 教师中心-获取表单数据
  8363. router.route("/getTestWorksPerson_2type").all((req,res,next)=>{
  8364. var json = queryString(req.url);
  8365. getmysql(req, res, "getTestWorksPerson_2type", json["uid"], json["typeid"]);
  8366. })
  8367. //qgt sass管理平台-按表单查看
  8368. router.route("/selectTesttCourse_sass").all((req,res,next)=>{
  8369. var json = queryString(req.url);
  8370. getmysql(req, res, "selectTesttCourse_sass", json["uid"], json["type"],json["oid"],json["org"],json["typeId"],json["textValue"]);
  8371. })
  8372. //qgt sass管理平台-按人员查看
  8373. router.route("/selectTesttCourse2_sass").all((req,res,next)=>{
  8374. var json = queryString(req.url);
  8375. getmysql(req, res, "selectTesttCourse2_sass",json["oid"],json["org"],json["typeId"],json["textValue"]);
  8376. })
  8377. //qgt 根据oid获取是那个地区的
  8378. router.route("/select_oidArea").all((req,res,next)=>{
  8379. var json = queryString(req.url);
  8380. getmysql(req, res, "select_oidArea", json["oid"]);
  8381. })
  8382. //qgt 应用中心获取AppStoreJuri
  8383. router.route("/select_appStorJuri").all((req,res,next)=>{
  8384. var json = queryString(req.url);
  8385. getmysql(req, res, "select_appStorJuri");
  8386. })
  8387. //qgt 应用中心获取AppStoreJuri
  8388. router.route("/select_userIsAdmin").all((req,res,next)=>{
  8389. var json = queryString(req.url);
  8390. getmysql(req, res, "select_userIsAdmin", json["userId"]);
  8391. })
  8392. //qgt 课堂观察-添加任务
  8393. router.route('/insert_classroomTask').all((req,res,next)=>{
  8394. postmysql(req, res, "insert_classroomTask");
  8395. })
  8396. //qgt 课堂观察-删除任务
  8397. router.route('/delete_classroomTask').all((req,res,next)=>{
  8398. postmysql(req, res, "delete_classroomTask");
  8399. })
  8400. //qgt 课堂观察-修改任务
  8401. router.route('/update_classroomTask').all((req,res,next)=>{
  8402. postmysql(req, res, "update_classroomTask");
  8403. })
  8404. //qgt 课堂观察-查询任务
  8405. router.route('/select_classroomTask').all((req,res,next)=>{
  8406. var json = queryString(req.url);
  8407. getmysql(req, res, "select_classroomTask", json["userId"]);
  8408. })
  8409. //qgt 教学模式-添加应用
  8410. router.route("/insert_teachingMode").all((req,res,next)=>{
  8411. postmysql(req, res, "insert_teachingMode");
  8412. })
  8413. //qgt 教学模式-获取应用
  8414. router.route("/select_teachingMode").all((req,res,next)=>{
  8415. var json = queryString(req.url);
  8416. getmysql(req, res, "select_teachingMode", json["uid"],json["jur"],json["type"],json["model"],json["status"],json["search"]);
  8417. })
  8418. //qgt 教学模式-修改应用
  8419. router.route("/update_teachingMode").all((req,res,next)=>{
  8420. postmysql(req, res, "update_teachingMode");
  8421. })
  8422. //qgt 教学模式-获取单个应用详细数据
  8423. router.route("/select_teachingModeById").all((req,res,next)=>{
  8424. var json = queryString(req.url);
  8425. getmysql(req, res, "select_teachingModeById", json["uid"],json["tid"]);
  8426. })
  8427. //qgt 通过idList获取班级数据
  8428. router.route("/select_ClassByidList").all((req,res,next)=>{
  8429. var json = queryString(req.url);
  8430. getmysql(req, res, "select_ClassByidList", json["idList"]);
  8431. })
  8432. //qgt 教学空间-获取学生列表 也可以获取单个学生的数据
  8433. router.route("/select_teachingModeWorks").all((req,res,next)=>{
  8434. var json = queryString(req.url);
  8435. getmysql(req, res, "select_teachingModeWorks", json["uid"],json["tid"],json["sid"]);
  8436. })
  8437. //qgt 教学空间-插入学生数据
  8438. router.route("/insert_teachingModeWorks").all((req,res,next)=>{
  8439. postmysql(req, res, "insert_teachingModeWorks");
  8440. })
  8441. //qgt 教学空间-修改学生状态
  8442. router.route("/update_teachingModeWorks_statusAndOperatingById").all((req,res,next)=>{
  8443. postmysql(req, res, "update_teachingModeWorks_statusAndOperatingById");
  8444. })
  8445. //qgt 教学空间-通过app的id获取教学的数据
  8446. router.route("/select_teachingModeByAppUrlAndClassId").all((req,res,next)=>{
  8447. var json = queryString(req.url);
  8448. getmysql(req, res, "select_teachingModeByAppUrlAndClassId", json["uid"],json["appUrl"]);
  8449. })
  8450. //qgt 教学空间-修改学生对话数据
  8451. router.route("/update_teachingModeWorks_nodeDataAndStageAndLastChatById").all((req,res,next)=>{
  8452. postmysql(req, res, "update_teachingModeWorks_nodeDataAndStageAndLastChatById");
  8453. })
  8454. //qgt 个人空间-资料提交-修改提交的表单名称
  8455. router.route("/update_testCourseWorksNameById").all((req,res,next)=>{
  8456. postmysql(req, res, "update_testCourseWorksNameById");
  8457. })
  8458. //qgt 教学空间-删除数据
  8459. router.route("/clear_teachingMode").all((req,res,next)=>{
  8460. postmysql(req, res, "clear_teachingMode");
  8461. })
  8462. //qgt 教学空间-删除应用
  8463. router.route("/update_teachingModeIsDelete").all((req,res,next)=>{
  8464. postmysql(req, res, "update_teachingModeIsDelete");
  8465. })
  8466. //qgt 教学空间-删除学生
  8467. router.route("/delete_teachingModeWorksById").all((req,res,next)=>{
  8468. postmysql(req, res, "delete_teachingModeWorksById");
  8469. })
  8470. //qgt 教学空间-aiChat-修改学生总结
  8471. router.route("/update_teachingModeWorks_summaryById").all((req,res,next)=>{
  8472. postmysql(req, res, "update_teachingModeWorks_summaryById");
  8473. })
  8474. //qgt 课程管理-ppt模式添加课程
  8475. router.route("/insert_teacher_work_pptCourse").all((req, res, next) => {
  8476. if (req.body[0]) {
  8477. p = [
  8478. req.body[0].uid,
  8479. req.body[0].title,
  8480. req.body[0].brief,
  8481. req.body[0].cover,
  8482. req.body[0].evaId,
  8483. req.body[0].astudent,
  8484. req.body[0].see,
  8485. req.body[0].chapters,
  8486. req.body[0].template,
  8487. req.body[0].ateacher,
  8488. ];
  8489. p.unshift(_mysqlLabor[0], _mysqlLabor[1], "insert_teacher_work_pptCourse"); //執行存儲過程
  8490. mysql.usselect(p, function(ret) {
  8491. let course = req.body[0].courseType;
  8492. let courseId = ret[0][0].courseId;
  8493. let userid = req.body[0].uid;
  8494. delCourseType(course, courseId, userid);
  8495. res.end(
  8496. JSON.stringify({
  8497. ordernumber: ret[0][0].ordernumber,
  8498. courseId: ret[0][0].courseId,
  8499. success: 1,
  8500. })
  8501. );
  8502. });
  8503. }
  8504. });
  8505. //qgt 课程管理-单独修改课程的chapters
  8506. router.route("/update_course_chapters").all((req,res,next)=>{
  8507. postmysql(req, res, "update_teacher_work_new4");
  8508. })
  8509. //qgt 课程管理-添加workPage数据
  8510. router.route("/insert_workPage").all((req,res,next)=>{
  8511. postmysql(req, res, "insert_workPage");
  8512. })
  8513. //qgt workPage查询作业
  8514. router.route("/select_workPageById").all((req,res,next)=>{
  8515. var json = queryString(req.url);
  8516. getmysql(req, res, "select_workPageById", json["id"]);
  8517. })
  8518. //qgt workPage上传作业
  8519. router.route("/addCourseWorks_workPage").all((req,res,next)=>{
  8520. postmysql(req, res, "addCourseWorks_workPage");
  8521. })
  8522. //qgt workPage获取作业
  8523. router.route("/select_courseWorks_workPageData").all((req,res,next)=>{
  8524. var json = queryString(req.url);
  8525. getmysql(req, res, "select_courseWorks_workPageData", json["uid"],json["cid"], json["stage"],json["task"], json["tool"]);
  8526. })
  8527. //qgt Class根据parentid获取数据
  8528. router.route("/select_ClassByParentid").all((req,res,next)=>{
  8529. var json = queryString(req.url);
  8530. getmysql(req, res, "select_ClassByParentid", json["pid"]);
  8531. })
  8532. //教师管理 查看填写范围的教师权限
  8533. router.route("/getTestWorkTeacherCount").all((req,res,next)=>{
  8534. postmysql(req, res, "getTestWorkTeacherCount");
  8535. })
  8536. //查询教师权限
  8537. router.route('/getTypeTeacher').all((req,res,next)=>{
  8538. var json = queryString(req.url);
  8539. getmysql(req, res, "getTypeTeacher", json["cid"], json["name"], json["userid"]);
  8540. })
  8541. //删除会话记录
  8542. router.route("/deleteChat").all((req,res,next)=>{
  8543. postmysql(req, res, "deleteChat"); // id 会话id
  8544. })
  8545. //添加会话记录
  8546. router.route("/addChat").all((req,res,next)=>{
  8547. postmysql(req, res, "addChat"); // uid 用户id n 会话名称 cid chatid
  8548. })
  8549. //修改会话记录 重命名
  8550. router.route("/updateChat").all((req,res,next)=>{
  8551. postmysql(req, res, "updateChat"); // id 会话id n 会话名称
  8552. })
  8553. //获取会话记录
  8554. router.route('/getChatHistory').all((req,res,next)=>{
  8555. var json = queryString(req.url);
  8556. getmysql(req, res, "getChatHistory", json["uid"], json["n"], json["page"], json["num"]); //用户id,会话名称,页码,页数
  8557. })
  8558. //本地调用
  8559. router.route("/localPost").all((req,res,next)=>{
  8560. postmysqlLocal(req, res);
  8561. })
  8562. //本地调用
  8563. router.route("/onlinePost").all((req,res,next)=>{
  8564. postmysqlOnline(req, res);
  8565. })
  8566. //修改课程设置
  8567. router.route("/updateWorksSetting").all((req,res,next)=>{
  8568. postmysql(req, res, "updateWorksSetting");
  8569. })
  8570. //新建文件夹
  8571. router.route("/addFolder").all((req,res,next)=>{
  8572. postmysql(req, res, "addFolder");
  8573. })
  8574. ///获取新建的文件夹
  8575. router.route("/getFolder").all((req,res,next)=>{
  8576. postmysql(req, res, "getFolder");
  8577. })
  8578. //获取新建的文件夹带分页
  8579. router.route("/getFolderPage").all((req,res,next)=>{
  8580. postmysql(req, res, "getFolderPage");
  8581. })
  8582. //删除文件夹
  8583. router.route("/deleteFolder").all((req,res,next)=>{
  8584. postmysql(req, res, "deleteFolder");
  8585. })
  8586. //查询tag
  8587. router.route("/getKnowledgeTag").all((req,res,next)=>{
  8588. postmysql(req, res, "getKnowledgeTag");
  8589. })
  8590. // 上传智能体模板
  8591. router.route("/insertAppTem").all((req,res,next)=>{
  8592. postmysql(req, res, "insertAppTem");
  8593. })
  8594. // 上传智能体模板
  8595. router.route("/insertAppTem2").all((req,res,next)=>{
  8596. postmysql(req, res, "insertAppTem2");
  8597. })
  8598. // 删除智能体模板
  8599. router.route("/deleteAppTem").all((req,res,next)=>{
  8600. postmysql(req, res, "deleteAppTem");
  8601. })
  8602. // 获取智能体模板
  8603. router.route("/selectAppTem").get((req, res, next) => {
  8604. var json = queryString(req.url);
  8605. getmysql2(req, res, "selectAppTem", json["oid"], json["type"]);
  8606. });
  8607. // 获取智能体模板
  8608. router.route("/selectAppTem2").get((req, res, next) => {
  8609. var json = queryString(req.url);
  8610. getmysql2(req, res, "selectAppTem2", json["oid"], json["type"], json["subject"]);
  8611. });
  8612. // 获取智能体模板
  8613. router.route("/selectAppTem3").get((req, res, next) => {
  8614. var json = queryString(req.url);
  8615. getmysql2(req, res, "selectAppTem3", json["oid"], json["type"], json["subject"], json["area"]);
  8616. });
  8617. // 获取智能体模板
  8618. router.route("/selectAppTemById").get((req, res, next) => {
  8619. var json = queryString(req.url);
  8620. getmysql2(req, res, "selectAppTemById", json["id"]);
  8621. });
  8622. //查询文件夹详情
  8623. router.route("/getKnowledgeDetail").all((req,res,next)=>{
  8624. postmysql(req, res, "getKnowledgeDetail");
  8625. })
  8626. //修改文件夹
  8627. router.route("/updateFolder").all((req,res,next)=>{
  8628. postmysql(req, res, "updateFolder");
  8629. })
  8630. //添加标签
  8631. router.route("/addTag").all((req,res,next)=>{
  8632. postmysql(req, res, "addTag");
  8633. })
  8634. //删除标签
  8635. router.route("/deleteTag").all((req,res,next)=>{
  8636. postmysql(req, res, "deleteTag");
  8637. })
  8638. //添加上传好的知识库文件
  8639. router.route("/addFile").all((req,res,next)=>{
  8640. postmysql(req, res, "add_file");
  8641. })
  8642. //notebookllm
  8643. router.route("/add_llm").all((req,res,next)=>{
  8644. postmysql(req, res, "add_llm");
  8645. })
  8646. router.route("/upload_llm_file").all((req,res,next)=>{
  8647. postmysql(req, res, "upload_llm_file");
  8648. })
  8649. router.route("/update_llm_title").all((req,res,next)=>{
  8650. postmysql(req, res, "update_llm_title");
  8651. })
  8652. router.route("/delete_llm").all((req,res,next)=>{
  8653. postmysql(req, res, "delete_llm");
  8654. })
  8655. router.route("/get_all_llm").all((req,res,next)=>{
  8656. var json = queryString(req.url);
  8657. getmysql2(req, res, "get_all_llm", json["uid"]);
  8658. })
  8659. router.route("/get_llm").all((req,res,next)=>{
  8660. var json = queryString(req.url);
  8661. getmysql2(req, res, "get_llm", json["id"]);
  8662. })
  8663. router.route("/get_llm_chat").all((req,res,next)=>{
  8664. var json = queryString(req.url);
  8665. getmysql2(req, res, "get_llm_chat", json["id"]);
  8666. })
  8667. router.route("/add_llm_chat").all((req,res,next)=>{
  8668. postmysql(req, res, "add_llm_chat");
  8669. })
  8670. router.route("/delete_llm_chat").all((req,res,next)=>{
  8671. postmysql(req, res, "delete_llm_chat");
  8672. })
  8673. router.route("/add_llm_note").all((req,res,next)=>{
  8674. postmysql(req, res, "add_llm_note");
  8675. })
  8676. router.route("/update_llm_note_title").all((req,res,next)=>{
  8677. postmysql(req, res, "update_llm_note_title");
  8678. })
  8679. router.route("/update_llm_note_detail").all((req,res,next)=>{
  8680. postmysql(req, res, "update_llm_note_detail");
  8681. })
  8682. router.route("/delete_llm_note").all((req,res,next)=>{
  8683. postmysql(req, res, "delete_llm_note");
  8684. })
  8685. router.route("/get_all_llm_note").all((req,res,next)=>{
  8686. var json = queryString(req.url);
  8687. getmysql2(req, res, "get_all_llm_note", json["id"]);
  8688. })
  8689. router.route("/get_llm_note").all((req,res,next)=>{
  8690. var json = queryString(req.url);
  8691. getmysql2(req, res, "get_llm_note", json["id"]);
  8692. })
  8693. router.route("/get_llm_chat_id").all((req,res,next)=>{
  8694. var json = queryString(req.url);
  8695. getmysql2(req, res, "get_llm_chat_id", json["id"]);
  8696. })
  8697. router.route("/update_llm_chat_detail").all((req,res,next)=>{
  8698. postmysql(req, res, "update_llm_chat_detail");
  8699. })
  8700. router.route("/update_llm_chat_title").all((req,res,next)=>{
  8701. postmysql(req, res, "update_llm_chat_title");
  8702. })
  8703. router.route("/update_llm_role").all((req,res,next)=>{
  8704. postmysql(req, res, "update_llm_role");
  8705. })
  8706. router.route("/update_llm_sound").all((req,res,next)=>{
  8707. postmysql(req, res, "update_llm_sound");
  8708. })
  8709. router.route("/update_knowledgefile_detail").all((req,res,next)=>{
  8710. postmysql(req, res, "update_knowledgefile_detail");
  8711. })
  8712. //notebookllm
  8713. //获取智能体
  8714. router.route('/selectCoder').all((req,res,next)=>{
  8715. var json = queryString(req.url);
  8716. getmysql(req, res, "selectCoder", json["oid"],json["org"]);
  8717. })
  8718. function generateAPIKey(username) {
  8719. let timeStamp = new Date().getTime();
  8720. let hashStr = timeStamp + username;
  8721. let digest = crypto
  8722. .createHash("sha256")
  8723. .update(hashStr, "utf8")
  8724. .digest("hex");
  8725. return digest;
  8726. }
  8727. queryString = function(url) {
  8728. var a = url.split("?");
  8729. var json = querystring.parse(a[1]);
  8730. return json;
  8731. };
  8732. //post存儲過程處理
  8733. postmysql = function(req, res, functionname) {
  8734. //mode的處理
  8735. if (req.body[0]) {
  8736. p = Object.values(req.body[0]);
  8737. p.unshift(_mysqlLabor[0], _mysqlLabor[1], functionname);
  8738. //執行存儲過程
  8739. mysql.usselect(p, function(ret) {
  8740. res.end(JSON.stringify(ret));
  8741. });
  8742. }
  8743. };
  8744. //post存儲過程處理
  8745. postmysql2 = function(req, res, functionname) {
  8746. //mode的處理
  8747. if (req.body) {
  8748. p = Object.values(req.body)[0].split(",");
  8749. p.unshift(_mysqlLabor[0], _mysqlLabor[1], functionname);
  8750. //執行存儲過程
  8751. mysql.usselect(p, function(ret) {
  8752. res.end(JSON.stringify(ret));
  8753. });
  8754. }
  8755. };
  8756. //post存儲過程處理
  8757. postmysql3 = function(req, res, functionname) {
  8758. //mode的處理
  8759. if (req.body) {
  8760. p = Object.values(req.body);
  8761. p.unshift(_mysqlLabor[0], _mysqlLabor[1], functionname);
  8762. //執行存儲過程
  8763. mysql.usselect(p, function(ret) {
  8764. res.end(JSON.stringify(ret));
  8765. });
  8766. }
  8767. };
  8768. //get獲取數據庫信息
  8769. getmysql = function(req, res, functionname, ...p) {
  8770. p = p || [];
  8771. p.unshift(_getmysqlLabor[0], _getmysqlLabor[1], functionname);
  8772. //執行存儲過程
  8773. mysql.usselect(p, function(ret) {
  8774. res.end(JSON.stringify(ret));
  8775. }); //
  8776. };
  8777. //get獲取數據庫信息
  8778. getmysql2 = function(req, res, functionname, ...p) {
  8779. p = p || [];
  8780. p.unshift(_mysqlLabor[0], _mysqlLabor[1], functionname);
  8781. //執行存儲過程
  8782. mysql.usselect(p, function(ret) {
  8783. res.end(JSON.stringify(ret));
  8784. }); //
  8785. };
  8786. //get獲取數據庫信息
  8787. getmysql3 = function(req, res, functionname, ...p) {
  8788. p = p || [];
  8789. p.unshift(_getmysqlLabor2[0], _getmysqlLabor2[1], functionname);
  8790. //執行存儲過程
  8791. mysql.usselect(p, function(ret) {
  8792. res.end(JSON.stringify(ret));
  8793. }); //
  8794. };
  8795. //post存储过程处理
  8796. userpostmysql = function(req, res, functionname) {
  8797. //mode的处理
  8798. if (req.body.mode) {
  8799. p = req.body.mode.split(",");
  8800. p.unshift(_mysqluser[0], _mysqluser[1], functionname);
  8801. //执行存储过程
  8802. mysql.usselect(p, function(ret) {
  8803. res.end(JSON.stringify(ret));
  8804. });
  8805. }
  8806. };
  8807. //get获取数据库信息
  8808. usergetmysql = function(req, res, functionname, ...p) {
  8809. p = p || [];
  8810. p.unshift(_mysqluser[0], _mysqluser[1], functionname);
  8811. //执行存储过程
  8812. mysql.usselect(p, function(ret) {
  8813. res.end(JSON.stringify(ret));
  8814. }); //
  8815. };
  8816. //post存儲過程處理
  8817. postmysqlLocal = function(req, res) {
  8818. //mode的處理
  8819. if (req.body[0]) {
  8820. p = Object.values(req.body[0]);
  8821. p.unshift(_localhost[0], _localhost[1]);
  8822. //執行存儲過程
  8823. mysql.usselect(p, function(ret) {
  8824. res.end(JSON.stringify(ret));
  8825. });
  8826. }
  8827. };
  8828. postmysqlOnline = function(req, res) {
  8829. //mode的處理
  8830. if (req.body[0]) {
  8831. p = Object.values(req.body[0]);
  8832. p.unshift(_mysqlLabor[0], _mysqlLabor[1]);
  8833. //執行存儲過程
  8834. mysql.usselect(p, function(ret) {
  8835. res.end(JSON.stringify(ret));
  8836. });
  8837. }
  8838. };
  8839. module.exports = router;