pbl.js 257 KB

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