Commit bcdf81a9 authored by liudong1993's avatar liudong1993
parents 6192d280 5b6621f9
using EduSpider.Model.Entity; using EduSpider.Model.Entity;
using EduSpider.Model.Query;
using System.Collections.Generic; using System.Collections.Generic;
using VTX.FW.Config; using VTX.FW.Config;
using VTX.FW.DB; using VTX.FW.DB;
...@@ -17,5 +18,13 @@ namespace EduSpider.Repository ...@@ -17,5 +18,13 @@ namespace EduSpider.Repository
/// <returns></returns> /// <returns></returns>
public bool BatchSetCourseStudentRepository(List<RB_Course_Student> courses); public bool BatchSetCourseStudentRepository(List<RB_Course_Student> courses);
/// <summary>
/// 跟进查询条件获取课程学员列表
/// </summary>
/// <param name="courseQuery"></param>
/// <returns></returns>
public List<RB_Course_Student> GetCourseStudentListRepository(CourseQuery query);
} }
} }
...@@ -15,11 +15,10 @@ namespace EduSpider.IRepository ...@@ -15,11 +15,10 @@ namespace EduSpider.IRepository
public interface IHomeWorkRepository : IDBRepository<RB_HomeWork>, IDependency public interface IHomeWorkRepository : IDBRepository<RB_HomeWork>, IDependency
{ {
/// <summary> /// <summary>
/// 批量添加学生家庭作业 /// 批量添加家庭作业
/// </summary> /// </summary>
/// <param name="homeWorks"></param> /// <param name="homeWorks"></param>
/// <returns></returns> /// <returns></returns>
public bool BatchSetHomeWorkRepository(List<RB_HomeWork> homeWorks); public bool BatchSetHomeWorkRepository(List<RB_HomeWork> homeWorks);
} }
} }
using EduSpider.Model.Entity;
using System.Collections.Generic;
using VTX.FW.Config;
using VTX.FW.DB;
namespace EduSpider.IRepository
{
/// <summary>
/// 学生作业仓储层接口
/// </summary>
public interface IStuHomeWorkRepository : IDBRepository<RB_Stu_HomeWork>, IDependency
{
/// <summary>
/// 批量添加学生家庭作业
/// </summary>
/// <param name="homeWorks"></param>
/// <returns></returns>
public bool BatchSetStuHomeWorkRepository(List<RB_Stu_HomeWork> homeWorks);
}
}
...@@ -28,7 +28,7 @@ namespace EduSpider.Model.Entity ...@@ -28,7 +28,7 @@ namespace EduSpider.Model.Entity
/// <summary> /// <summary>
/// 课程编号 /// 课程编号
/// </summary> /// </summary>
public int? course_id { get; set; } public int course_id { get; set; }
/// <summary> /// <summary>
/// 课程名称 /// 课程名称
...@@ -38,77 +38,77 @@ namespace EduSpider.Model.Entity ...@@ -38,77 +38,77 @@ namespace EduSpider.Model.Entity
/// <summary> /// <summary>
/// 作业开始时间 /// 作业开始时间
/// </summary> /// </summary>
public DateTime? start_time { get; set; } public DateTime start_time { get; set; }
/// <summary> /// <summary>
/// 作业结束时间 /// 作业结束时间
/// </summary> /// </summary>
public DateTime? end_time { get; set; } public DateTime end_time { get; set; }
/// <summary> /// <summary>
/// 作业状态(0-未开始,1-进行中,2-已结束) /// 作业状态(0-未开始,1-进行中,2-已结束)
/// </summary> /// </summary>
public int? status { get; set; } public int status { get; set; }
/// <summary> /// <summary>
/// 显示状态(0-客户端显示,1-客户端隐藏) /// 显示状态(0-客户端显示,1-客户端隐藏)
/// </summary> /// </summary>
public int? is_del { get; set; } public int is_del { get; set; }
/// <summary> /// <summary>
/// 是否公开作业(1-公开作业,2-不公开,3-公开优秀) /// 是否公开作业(1-公开作业,2-不公开,3-公开优秀)
/// </summary> /// </summary>
public string is_open { get; set; } public int is_open { get; set; }
/// <summary> /// <summary>
/// 公开方式(1-结束后) /// 公开方式(1-结束后)
/// </summary> /// </summary>
public string open_type { get; set; } public int open_type { get; set; }
/// <summary> /// <summary>
/// 是否允许补交(1-否,2-是) /// 是否允许补交(1-否,2-是)
/// </summary> /// </summary>
public string is_revise { get; set; } public int is_revise { get; set; }
/// <summary> /// <summary>
/// 学生数 /// 学生数
/// </summary> /// </summary>
public int? num { get; set; } public int num { get; set; }
/// <summary> /// <summary>
/// 优秀人数 /// 优秀人数
/// </summary> /// </summary>
public int? cream_num { get; set; } public int cream_num { get; set; }
/// <summary> /// <summary>
/// revised_num /// 补交人数
/// </summary> /// </summary>
public int? revised_num { get; set; } public int revised_num { get; set; }
/// <summary> /// <summary>
/// 已批阅 /// 已批阅
/// </summary> /// </summary>
public int? rnum { get; set; } public int rnum { get; set; }
/// <summary> /// <summary>
/// 已提交 /// 已提交
/// </summary> /// </summary>
public int? cnum { get; set; } public int cnum { get; set; }
/// <summary> /// <summary>
/// 学校编号 /// 学校编号
/// </summary> /// </summary>
public int? school_uid { get; set; } public int school_uid { get; set; }
/// <summary> /// <summary>
/// 评分机制(5-自定义,4-不评分,3-等第制,2-十分制,1-百分制) /// 评分机制(5-自定义,4-不评分,3-等第制,2-十分制,1-百分制)
/// </summary> /// </summary>
public int? score_type { get; set; } public int score_type { get; set; }
/// <summary> /// <summary>
/// 自定义分数 /// 自定义分数
/// </summary> /// </summary>
public decimal? score_value { get; set; } public decimal score_value { get; set; }
/// <summary> /// <summary>
/// 教师账号 /// 教师账号
...@@ -123,7 +123,7 @@ namespace EduSpider.Model.Entity ...@@ -123,7 +123,7 @@ namespace EduSpider.Model.Entity
/// <summary> /// <summary>
/// 教师编号 /// 教师编号
/// </summary> /// </summary>
public int? teacher_uid { get; set; } public int teacher_uid { get; set; }
/// <summary> /// <summary>
/// th_cancel /// th_cancel
...@@ -140,5 +140,29 @@ namespace EduSpider.Model.Entity ...@@ -140,5 +140,29 @@ namespace EduSpider.Model.Entity
/// </summary> /// </summary>
public DateTime update_time { get; set; } public DateTime update_time { get; set; }
/// <summary>
/// 打回订正人数
/// </summary>
public int ref_num { get; set; }
/// <summary>
/// 已订正人数
/// </summary>
public int refc_num { get; set; }
/// <summary>
/// 平均分
/// </summary>
public decimal av_score { get; set; }
/// <summary>
/// 最高分
/// </summary>
public decimal max_score { get; set; }
/// <summary>
/// 最低分
/// </summary>
public decimal min_score { get; set; }
} }
} }
using System;
using VTX.FW.Attr;
namespace EduSpider.Model.Entity
{
/// <summary>
/// 课程实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Stu_HomeWork
{
/// <summary>
/// 学生家庭作业主键编号
/// </summary>
public int stu_homework_id { get; set; }
/// <summary>
/// admire
/// </summary>
public string admire { get; set; }
/// <summary>
/// cancel
/// </summary>
public string cancel { get; set; }
/// <summary>
/// 正确数量
/// </summary>
public decimal correct { get; set; }
/// <summary>
/// 错误题数
/// </summary>
public int wrong { get; set; }
/// <summary>
/// 课程编号
/// </summary>
public int course_id { get; set; }
/// <summary>
/// is_cream
/// </summary>
public int is_cream { get; set; }
/// <summary>
/// emend
/// </summary>
public int emend { get; set; }
/// <summary>
/// 作业编号
/// </summary>
public int homework_id { get; set; }
/// <summary>
/// 作业分享Key
/// </summary>
public string homework_share_key { get; set; }
/// <summary>
/// is_draft
/// </summary>
public int is_draft { get; set; }
/// <summary>
/// is_reform
/// </summary>
public int? is_reform { get; set; }
/// <summary>
/// is_revised
/// </summary>
public int is_revised { get; set; }
/// <summary>
/// is_startd
/// </summary>
public int is_startd { get; set; }
/// <summary>
/// readover
/// </summary>
public string readover { get; set; }
/// <summary>
/// 提交时间
/// </summary>
public DateTime ref_time { get; set; }
/// <summary>
/// 评语
/// </summary>
public string comment { get; set; }
/// <summary>
/// reform
/// </summary>
public string reform { get; set; }
/// <summary>
/// school_uid
/// </summary>
public int school_uid { get; set; }
/// <summary>
/// 得分
/// </summary>
public decimal score { get; set; }
/// <summary>
/// 得分率
/// </summary>
public decimal score_p { get; set; }
/// <summary>
/// 评分机制
/// </summary>
public int score_type { get; set; }
/// <summary>
/// show_time
/// </summary>
public DateTime show_time { get; set; }
/// <summary>
/// status
/// </summary>
public string status { get; set; }
/// <summary>
/// 学生作业分享Key
/// </summary>
public string stu_homework_share_key { get; set; }
/// <summary>
/// 学生账号
/// </summary>
public string student_account { get; set; }
/// <summary>
/// 学生姓名
/// </summary>
public string student_name { get; set; }
/// <summary>
/// 学生编号
/// </summary>
public int student_uid { get; set; }
/// <summary>
/// 教师账号
/// </summary>
public string th_account { get; set; }
/// <summary>
/// th_cancel
/// </summary>
public string th_cancel { get; set; }
/// <summary>
/// 教师姓名
/// </summary>
public string th_name { get; set; }
/// <summary>
/// 教师数量
/// </summary>
public int th_num { get; set; }
/// <summary>
/// 教师创建时间
/// </summary>
public DateTime th_time { get; set; }
/// <summary>
/// 教师账号表编号
/// </summary>
public int th_uid { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime add_time { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime update_time { get; set; }
}
}
...@@ -21,5 +21,7 @@ namespace EduSpider.Model.Query ...@@ -21,5 +21,7 @@ namespace EduSpider.Model.Query
/// 课程名称 /// 课程名称
/// </summary> /// </summary>
public string courseName { get; set; } public string courseName { get; set; }
} }
} }
using EduSpider.Model.Entity; using EduSpider.Model.Entity;
using EduSpider.Model.Query;
using EduSpider.Repository.Base; using EduSpider.Repository.Base;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using VTX.FW.DB.Dapper;
namespace EduSpider.Repository namespace EduSpider.Repository
{ {
...@@ -20,5 +24,30 @@ namespace EduSpider.Repository ...@@ -20,5 +24,30 @@ namespace EduSpider.Repository
flag = base.BatchInsert(courses, isReplace: true); flag = base.BatchInsert(courses, isReplace: true);
return flag; return flag;
} }
/// <summary>
/// 跟进查询条件获取课程学员列表
/// </summary>
/// <param name="courseQuery"></param>
/// <returns></returns>
public List<RB_Course_Student> GetCourseStudentListRepository(CourseQuery query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Course_Student AS A
WHERE 1=1
");
if (query != null)
{
if (query.courseId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_Student.courseId), query.courseId);
}
}
return base.Get<RB_Course_Student>(builder.ToString(), parameters).ToList();
}
} }
} }
...@@ -11,7 +11,7 @@ namespace EduSpider.Repository ...@@ -11,7 +11,7 @@ namespace EduSpider.Repository
public class HomeWorkRepository : BaseRepository<RB_HomeWork>, IHomeWorkRepository public class HomeWorkRepository : BaseRepository<RB_HomeWork>, IHomeWorkRepository
{ {
/// <summary> /// <summary>
/// 批量添加学生家庭作业 /// 批量添加家庭作业
/// </summary> /// </summary>
/// <param name="homeWorks"></param> /// <param name="homeWorks"></param>
/// <returns></returns> /// <returns></returns>
......
using EduSpider.IRepository;
using EduSpider.Model.Entity;
using EduSpider.Repository.Base;
using System.Collections.Generic;
namespace EduSpider.Repository
{
/// <summary>
/// 学生作业仓储层实现
/// </summary>
public class StuHomeWorkRepository : BaseRepository<RB_Stu_HomeWork>, IStuHomeWorkRepository
{
/// <summary>
/// 批量添加学生家庭作业
/// </summary>
/// <param name="homeWorks"></param>
/// <returns></returns>
public bool BatchSetStuHomeWorkRepository(List<RB_Stu_HomeWork> homeWorks)
{
bool flag;
flag = base.BatchInsert(homeWorks, isReplace: true);
return flag;
}
}
}
...@@ -24,9 +24,10 @@ namespace TicketSpider.Spiders.ClassInRule ...@@ -24,9 +24,10 @@ namespace TicketSpider.Spiders.ClassInRule
Console.WriteLine("开始获取学员信息"); Console.WriteLine("开始获取学员信息");
new StudentManager().RunAsync(loginCookies); //new StudentManager().RunAsync(loginCookies);
//new CourseManager().RunCourse(loginCookies); //new CourseManager().RunCourse(loginCookies);
//new TeacherManager().RunTeacher(loginCookies); //new TeacherManager().RunTeacher(loginCookies);
//new HomeWorkManager().RunHomeWork(loginCookies);
} }
} }
} }
...@@ -31,7 +31,8 @@ namespace EduSpider.Spiders.ClassInRule ...@@ -31,7 +31,8 @@ namespace EduSpider.Spiders.ClassInRule
ICourseRepository courseRepository = new CourseRepository(); ICourseRepository courseRepository = new CourseRepository();
int totalCount = 0; int totalCount = 0;
Console.WriteLine(string.Format("开始第{0}次获取课程数据", pageCount)); Console.WriteLine(string.Format("开始第{0}次获取课程数据", pageCount));
var response = await request.PostAsync("https://console.eeo.cn/saasajax/course.ajax.php?action=getCourseList", content); string url = "https://console.eeo.cn/saasajax/course.ajax.php?action=getCourseList";
var response = await request.PostAsync(url, content);
var result = response.Content.ReadAsStringAsync().Result; var result = response.Content.ReadAsStringAsync().Result;
if (!string.IsNullOrWhiteSpace(result)) if (!string.IsNullOrWhiteSpace(result))
{ {
...@@ -69,8 +70,7 @@ namespace EduSpider.Spiders.ClassInRule ...@@ -69,8 +70,7 @@ namespace EduSpider.Spiders.ClassInRule
Console.WriteLine(string.Format("第{0}/{1}次获取课程数据", i, pageCount)); Console.WriteLine(string.Format("第{0}/{1}次获取课程数据", i, pageCount));
paramStr = string.Format(queryStr, i, perpage); paramStr = string.Format(queryStr, i, perpage);
var sub_content = new StringContent(paramStr, System.Text.Encoding.UTF8, "application/x-www-form-urlencoded"); var sub_content = new StringContent(paramStr, System.Text.Encoding.UTF8, "application/x-www-form-urlencoded");
var sub_response = await request.PostAsync("https://console.eeo.cn/saasajax/course.ajax.php?action=getCourseList", sub_content); var sub_response = await request.PostAsync(url, sub_content);
var sub_result = sub_response.Content.ReadAsStringAsync().Result; var sub_result = sub_response.Content.ReadAsStringAsync().Result;
if (!string.IsNullOrWhiteSpace(sub_result)) if (!string.IsNullOrWhiteSpace(sub_result))
{ {
...@@ -160,7 +160,8 @@ namespace EduSpider.Spiders.ClassInRule ...@@ -160,7 +160,8 @@ namespace EduSpider.Spiders.ClassInRule
ICourseStudentRepository courseStudentRepository = new CourseStudentRepository(); ICourseStudentRepository courseStudentRepository = new CourseStudentRepository();
Console.WriteLine(string.Format("开始获取{0}课程学员数据", courseId)); Console.WriteLine(string.Format("开始获取{0}课程学员数据", courseId));
var response = await request.PostAsync("https://console.eeo.cn/saasajax/student.ajax.php?action=getCourseStudentList", content); string url = "https://console.eeo.cn/saasajax/student.ajax.php?action=getCourseStudentList";
var response = await request.PostAsync(url, content);
var sutResult = response.Content.ReadAsStringAsync().Result; var sutResult = response.Content.ReadAsStringAsync().Result;
List<RB_Course_Student> list = new List<RB_Course_Student>(); List<RB_Course_Student> list = new List<RB_Course_Student>();
if (!string.IsNullOrWhiteSpace(sutResult)) if (!string.IsNullOrWhiteSpace(sutResult))
...@@ -207,7 +208,8 @@ namespace EduSpider.Spiders.ClassInRule ...@@ -207,7 +208,8 @@ namespace EduSpider.Spiders.ClassInRule
ICourseTeacherRepository courseTeacherRepository = new CourseTeacherRepository(); ICourseTeacherRepository courseTeacherRepository = new CourseTeacherRepository();
Console.WriteLine(string.Format("开始获取{0}课程老师数据", courseId)); Console.WriteLine(string.Format("开始获取{0}课程老师数据", courseId));
var response = await request.PostAsync("https://console.eeo.cn/saasajax/course.ajax.php?action=getCourseTeacherList", content); string url = "https://console.eeo.cn/saasajax/course.ajax.php?action=getCourseTeacherList";
var response = await request.PostAsync(url, content);
var teacherResult = response.Content.ReadAsStringAsync().Result; var teacherResult = response.Content.ReadAsStringAsync().Result;
List<RB_Course_Teacher> list = new List<RB_Course_Teacher>(); List<RB_Course_Teacher> list = new List<RB_Course_Teacher>();
if (!string.IsNullOrWhiteSpace(teacherResult)) if (!string.IsNullOrWhiteSpace(teacherResult))
...@@ -260,7 +262,8 @@ namespace EduSpider.Spiders.ClassInRule ...@@ -260,7 +262,8 @@ namespace EduSpider.Spiders.ClassInRule
ICourseRepository courseRepository = new CourseRepository(); ICourseRepository courseRepository = new CourseRepository();
Console.WriteLine(string.Format("开始获取{0}课程详情数据", courseId)); Console.WriteLine(string.Format("开始获取{0}课程详情数据", courseId));
var response = await request.PostAsync("https://console.eeo.cn/saasajax/course.ajax.php?action=getCourseInfo", content); string url = "https://console.eeo.cn/saasajax/course.ajax.php?action=getCourseInfo";
var response = await request.PostAsync(url, content);
var courseInfoResult = response.Content.ReadAsStringAsync().Result; var courseInfoResult = response.Content.ReadAsStringAsync().Result;
List<RB_Course> list = new List<RB_Course>(); List<RB_Course> list = new List<RB_Course>();
if (!string.IsNullOrWhiteSpace(courseInfoResult)) if (!string.IsNullOrWhiteSpace(courseInfoResult))
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment