pbl.js 271 KB

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