pbl.js 255 KB

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