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