pbl.js 260 KB

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