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