Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
EduSpider
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
EduSpider
Commits
1f63d8bb
Commit
1f63d8bb
authored
Jun 09, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1111
parent
86ae5043
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
97 additions
and
97 deletions
+97
-97
UserReidsCache.cs
EduSpider.Cache/User/UserReidsCache.cs
+1
-1
IAccountRepository.cs
EduSpider.IRepository/IAccountRepository.cs
+3
-3
ICourseRepository.cs
EduSpider.IRepository/ICourseRepository.cs
+5
-5
IStudentRepository.cs
EduSpider.IRepository/IStudentRepository.cs
+3
-3
ITeacherRepository.cs
EduSpider.IRepository/ITeacherRepository.cs
+2
-2
IAccountService.cs
EduSpider.IServices/IAccountService.cs
+2
-2
rb_account_hk.cs
EduSpider.Model/Entity/rb_account_hk.cs
+1
-1
rb_course_hk.cs
EduSpider.Model/Entity/rb_course_hk.cs
+1
-1
rb_student_hk.cs
EduSpider.Model/Entity/rb_student_hk.cs
+1
-1
rb_teacher_hk.cs
EduSpider.Model/Entity/rb_teacher_hk.cs
+1
-1
RB_Account_Extend.cs
EduSpider.Model/Extend/RB_Account_Extend.cs
+1
-1
AccountRepository.cs
EduSpider.Repository/AccountRepository.cs
+15
-15
CourseRepository.cs
EduSpider.Repository/CourseRepository.cs
+14
-14
CourseStudentRepository.cs
EduSpider.Repository/CourseStudentRepository.cs
+1
-1
CourseTeacherRepository.cs
EduSpider.Repository/CourseTeacherRepository.cs
+4
-4
StuCommentDetailsRepository.cs
EduSpider.Repository/StuCommentDetailsRepository.cs
+1
-1
StuHomeWorkRepository.cs
EduSpider.Repository/StuHomeWorkRepository.cs
+1
-1
StudentRepository.cs
EduSpider.Repository/StudentRepository.cs
+5
-5
TeacherRepository.cs
EduSpider.Repository/TeacherRepository.cs
+2
-2
AccountService.cs
EduSpider.Services/AccountService.cs
+5
-5
ExamService.cs
EduSpider.Services/ExamService.cs
+3
-3
LoginController.cs
EduSpider.WebApi/Controllers/User/LoginController.cs
+3
-3
Program.cs
EduSpider/Program.cs
+7
-7
CourseManager.cs
EduSpider/Spiders/ClassInRule/CourseManager.cs
+5
-5
StudentManager.cs
EduSpider/Spiders/ClassInRule/StudentManager.cs
+4
-4
TeacherManager.cs
EduSpider/Spiders/ClassInRule/TeacherManager.cs
+6
-6
No files found.
EduSpider.Cache/User/UserReidsCache.cs
View file @
1f63d8bb
...
...
@@ -130,7 +130,7 @@ namespace EduSpider.Cache.User
if
(
NewId
>
0
)
{
string
token
=
""
;
var
model
=
accountRepository
.
GetAccountList
(
new
Model
.
Extend
.
RB_Account
_Extend
()
var
model
=
accountRepository
.
GetAccountList
(
new
Model
.
Extend
.
rb_account_hk
_Extend
()
{
Id
=
NewId
})?.
FirstOrDefault
();
...
...
EduSpider.IRepository/IAccountRepository.cs
View file @
1f63d8bb
...
...
@@ -13,17 +13,17 @@ namespace EduSpider.Repository
/// <summary>
/// 账号仓储接口
/// </summary>
public
interface
IAccountRepository
:
IDBRepository
<
RB_Account
>,
IDependency
public
interface
IAccountRepository
:
IDBRepository
<
rb_account_hk
>,
IDependency
{
/// <summary>
/// 批量新增
/// </summary>
/// <param name="accounts"></param>
/// <returns></returns>
public
bool
BatchSetAccount
(
List
<
RB_Account
>
accounts
);
public
bool
BatchSetAccount
(
List
<
rb_account_hk
>
accounts
);
int
GetMaxStuTeaId
(
int
type
);
public
List
<
RB_Account_Extend
>
GetAccountList
(
RB_Account
_Extend
demodel
);
public
List
<
rb_account_hk_Extend
>
GetAccountList
(
rb_account_hk
_Extend
demodel
);
}
}
EduSpider.IRepository/ICourseRepository.cs
View file @
1f63d8bb
...
...
@@ -9,21 +9,21 @@ namespace EduSpider.Repository
/// <summary>
/// 课程仓储接口
/// </summary>
public
interface
ICourseRepository
:
IDBRepository
<
RB_Course
>,
IDependency
public
interface
ICourseRepository
:
IDBRepository
<
rb_course_hk
>,
IDependency
{
/// <summary>
/// 批量新增课程
/// </summary>
/// <param name="courses"></param>
/// <returns></returns>
public
bool
BatchSetCourseRepository
(
List
<
RB_Course
>
courses
);
public
bool
BatchSetCourseRepository
(
List
<
rb_course_hk
>
courses
);
/// <summary>
/// 批量新增修改课程指定字段
/// </summary>
/// <param name="courses"></param>
/// <returns></returns>
public
bool
BatchSetCourseOtherRepository
(
List
<
RB_Course
>
courses
);
public
bool
BatchSetCourseOtherRepository
(
List
<
rb_course_hk
>
courses
);
/// <summary>
/// 获取课程分页列表
...
...
@@ -33,13 +33,13 @@ namespace EduSpider.Repository
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Course
>
GetCoursePageRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
CourseQuery
query
);
public
List
<
rb_course_hk
>
GetCoursePageRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
CourseQuery
query
);
/// <summary>
/// 获取课程列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Course
>
GetCourseListRepository
(
CourseQuery
query
);
public
List
<
rb_course_hk
>
GetCourseListRepository
(
CourseQuery
query
);
}
}
EduSpider.IRepository/IStudentRepository.cs
View file @
1f63d8bb
...
...
@@ -6,14 +6,14 @@ using VTX.FW.DB;
namespace
EduSpider.IRepository
{
public
interface
IStudentRepository
:
IDBRepository
<
RB_Student
>,
IDependency
public
interface
IStudentRepository
:
IDBRepository
<
rb_student_hk
>,
IDependency
{
/// <summary>
/// 批量操作学生资料
/// </summary>
/// <param name="students"></param>
/// <returns></returns>
public
bool
BatchSetStudent
(
List
<
RB_Student
>
students
);
List
<
RB_Student
>
GetListForStuName
(
string
stuNames
);
public
bool
BatchSetStudent
(
List
<
rb_student_hk
>
students
);
List
<
rb_student_hk
>
GetListForStuName
(
string
stuNames
);
}
}
EduSpider.IRepository/ITeacherRepository.cs
View file @
1f63d8bb
...
...
@@ -12,13 +12,13 @@ namespace EduSpider.Repository
/// <summary>
/// 老师仓储接口
/// </summary>
public
interface
ITeacherRepository
:
IDBRepository
<
RB_Teacher
>,
IDependency
public
interface
ITeacherRepository
:
IDBRepository
<
rb_teacher_hk
>,
IDependency
{
/// <summary>
/// 批量新增老师
/// </summary>
/// <param name="teachers"></param>
/// <returns></returns>
public
bool
BatchSetTeache
(
List
<
RB_Teacher
>
teachers
);
public
bool
BatchSetTeache
(
List
<
rb_teacher_hk
>
teachers
);
}
}
EduSpider.IServices/IAccountService.cs
View file @
1f63d8bb
...
...
@@ -13,7 +13,7 @@ namespace EduSpider.IServices
/// </summary>
public
interface
IAccountService
:
IDependency
{
List
<
RB_Account_Extend
>
GetAccountList
(
RB_Account
_Extend
demodel
);
bool
UpdateAccountUnionId
(
RB_Account
_Extend
model
);
List
<
rb_account_hk_Extend
>
GetAccountList
(
rb_account_hk
_Extend
demodel
);
bool
UpdateAccountUnionId
(
rb_account_hk
_Extend
model
);
}
}
EduSpider.Model/Entity/
RB_Account
.cs
→
EduSpider.Model/Entity/
rb_account_hk
.cs
View file @
1f63d8bb
...
...
@@ -10,7 +10,7 @@ namespace EduSpider.Model.Entity
{
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Account
public
class
rb_account_hk
{
/// <summary>
/// 唯一key
...
...
EduSpider.Model/Entity/
RB_Course
.cs
→
EduSpider.Model/Entity/
rb_course_hk
.cs
View file @
1f63d8bb
...
...
@@ -9,7 +9,7 @@ namespace EduSpider.Model.Entity
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Course
public
class
rb_course_hk
{
/// <summary>
/// 课程编号
...
...
EduSpider.Model/Entity/
RB_Student
.cs
→
EduSpider.Model/Entity/
rb_student_hk
.cs
View file @
1f63d8bb
...
...
@@ -9,7 +9,7 @@ namespace EduSpider.Model.Entity
{
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Student
public
class
rb_student_hk
{
public
DateTime
AddTime
{
get
;
set
;
}
...
...
EduSpider.Model/Entity/
RB_Teacher
.cs
→
EduSpider.Model/Entity/
rb_teacher_hk
.cs
View file @
1f63d8bb
...
...
@@ -9,7 +9,7 @@ namespace EduSpider.Model.Entity
{
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Teacher
public
class
rb_teacher_hk
{
/// <summary>
/// TeacherId
...
...
EduSpider.Model/Extend/RB_Account_Extend.cs
View file @
1f63d8bb
...
...
@@ -10,7 +10,7 @@ namespace EduSpider.Model.Extend
{
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Account_Extend
:
RB_Account
public
class
rb_account_hk_Extend
:
rb_account_hk
{
/// <summary>
/// 帐号名称
...
...
EduSpider.Repository/AccountRepository.cs
View file @
1f63d8bb
...
...
@@ -12,14 +12,14 @@ namespace EduSpider.Repository
/// <summary>
/// 账号仓储层
/// </summary>
public
class
AccountRepository
:
BaseRepository
<
RB_Account
>,
IAccountRepository
public
class
AccountRepository
:
BaseRepository
<
rb_account_hk
>,
IAccountRepository
{
/// <summary>
/// 批量新增账号
/// </summary>
/// <param name="accounts"></param>
/// <returns></returns>
public
bool
BatchSetAccount
(
List
<
RB_Account
>
accounts
)
public
bool
BatchSetAccount
(
List
<
rb_account_hk
>
accounts
)
{
return
base
.
BatchInsert
(
accounts
,
isReplace
:
true
);
}
...
...
@@ -29,44 +29,44 @@ namespace EduSpider.Repository
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Account_Extend
>
GetAccountList
(
RB_Account
_Extend
demodel
)
public
List
<
rb_account_hk_Extend
>
GetAccountList
(
rb_account_hk
_Extend
demodel
)
{
string
where
=
" 1=1 "
;
if
(
demodel
.
Id
>
0
)
{
where
+=
$" and t.
{
nameof
(
RB_Account
_Extend
.
Id
)}
=
{
demodel
.
Id
}
"
;
where
+=
$" and t.
{
nameof
(
rb_account_hk
_Extend
.
Id
)}
=
{
demodel
.
Id
}
"
;
}
if
(
demodel
.
AccountType
>
0
)
{
where
+=
$" and t.
{
nameof
(
RB_Account
_Extend
.
AccountType
)}
=
{(
int
)
demodel
.
AccountType
}
"
;
where
+=
$" and t.
{
nameof
(
rb_account_hk
_Extend
.
AccountType
)}
=
{(
int
)
demodel
.
AccountType
}
"
;
}
if
(
demodel
.
AccountId
>
0
)
{
where
+=
$" and t.
{
nameof
(
RB_Account
_Extend
.
AccountId
)}
=
{
demodel
.
AccountId
}
"
;
where
+=
$" and t.
{
nameof
(
rb_account_hk
_Extend
.
AccountId
)}
=
{
demodel
.
AccountId
}
"
;
}
if
(
demodel
.
Status
>=
0
)
{
where
+=
$" and t.
{
nameof
(
RB_Account
_Extend
.
Status
)}
=
{(
int
)
demodel
.
Status
}
"
;
where
+=
$" and t.
{
nameof
(
rb_account_hk
_Extend
.
Status
)}
=
{(
int
)
demodel
.
Status
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
Account
))
{
where
+=
$" and t.
{
nameof
(
RB_Account
_Extend
.
Account
)}
='
{
demodel
.
Account
}
'"
;
where
+=
$" and t.
{
nameof
(
rb_account_hk
_Extend
.
Account
)}
='
{
demodel
.
Account
}
'"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
Password
))
{
where
+=
$" and t.
{
nameof
(
RB_Account
_Extend
.
Password
)}
='
{
demodel
.
Password
}
'"
;
where
+=
$" and t.
{
nameof
(
rb_account_hk
_Extend
.
Password
)}
='
{
demodel
.
Password
}
'"
;
}
string
sql
=
$@"
select * from(
SELECT a.UniqueId,a.Id,a.Account,a.`Password`,a.AccountType,a.AccountId,t.TeacherName AS AccountName,t.Logo as UserIcon,a.Status FROM rb_account a
INNER JOIN rb_teacher t on a.Id =t.TeacherId and a.AccountType =1
SELECT a.UniqueId,a.Id,a.Account,a.`Password`,a.AccountType,a.AccountId,t.TeacherName AS AccountName,t.Logo as UserIcon,a.Status FROM rb_account
_hk
a
INNER JOIN rb_teacher
_hk
t on a.Id =t.TeacherId and a.AccountType =1
UNION
SELECT a.UniqueId,a.Id,a.Account,a.`Password`,a.AccountType,a.AccountId,s.StudentName AS AccountName,'' as UserIcon,a.Status FROM rb_account a
INNER JOIN rb_student s on a.Id =s.StudId and a.AccountType =2
SELECT a.UniqueId,a.Id,a.Account,a.`Password`,a.AccountType,a.AccountId,s.StudentName AS AccountName,'' as UserIcon,a.Status FROM rb_account
_hk
a
INNER JOIN rb_student
_hk
s on a.Id =s.StudId and a.AccountType =2
) t where
{
where
}
"
;
return
Get
<
RB_Account
_Extend
>(
sql
).
ToList
();
return
Get
<
rb_account_hk
_Extend
>(
sql
).
ToList
();
}
/// <summary>
...
...
@@ -76,7 +76,7 @@ INNER JOIN rb_student s on a.Id =s.StudId and a.AccountType =2
/// <returns></returns>
public
int
GetMaxStuTeaId
(
int
type
)
{
string
sql
=
$" select max(Id) from
RB_Account
where AccountType =
{
type
}
"
;
string
sql
=
$" select max(Id) from
rb_account_hk
where AccountType =
{
type
}
"
;
var
obj
=
ExecuteScalar
(
sql
);
return
obj
==
null
?
0
:
Convert
.
ToInt32
(
obj
);
}
...
...
EduSpider.Repository/CourseRepository.cs
View file @
1f63d8bb
...
...
@@ -11,14 +11,14 @@ namespace EduSpider.Repository
/// <summary>
/// 课程仓储层
/// </summary>
public
class
CourseRepository
:
BaseRepository
<
RB_Course
>,
ICourseRepository
public
class
CourseRepository
:
BaseRepository
<
rb_course_hk
>,
ICourseRepository
{
/// <summary>
/// 批量新增课程
/// </summary>
/// <param name="courses"></param>
/// <returns></returns>
public
bool
BatchSetCourseRepository
(
List
<
RB_Course
>
courses
)
public
bool
BatchSetCourseRepository
(
List
<
rb_course_hk
>
courses
)
{
bool
flag
;
flag
=
base
.
BatchInsert
(
courses
,
isReplace
:
true
);
...
...
@@ -30,11 +30,11 @@ namespace EduSpider.Repository
/// </summary>
/// <param name="courses"></param>
/// <returns></returns>
public
bool
BatchSetCourseOtherRepository
(
List
<
RB_Course
>
courses
)
public
bool
BatchSetCourseOtherRepository
(
List
<
rb_course_hk
>
courses
)
{
var
parameters
=
new
DynamicParameters
();
string
sql
=
@"
UPDATE
RB_Course
UPDATE
rb_course_hk
SET courseWare=@courseWare,coverImg=@coverImg,courseType=@courseType,addTime=@addTime
WHERE courseId=@courseId "
;
parameters
.
Add
(
"courseWare"
,
courses
[
0
].
CourseWare
);
...
...
@@ -50,28 +50,28 @@ WHERE courseId=@courseId ";
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Course
>
GetCourseListRepository
(
CourseQuery
query
)
public
List
<
rb_course_hk
>
GetCourseListRepository
(
CourseQuery
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
();
builder
.
AppendFormat
(
@"
SELECT A.*
FROM
RB_Course
AS A
FROM
rb_course_hk
AS A
WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
CourseName
))
{
builder
.
AppendFormat
(
" AND A.{0} LIKE @courseName "
,
nameof
(
RB_Course
.
CourseName
));
builder
.
AppendFormat
(
" AND A.{0} LIKE @courseName "
,
nameof
(
rb_course_hk
.
CourseName
));
parameters
.
Add
(
"courseName"
,
"%"
+
query
.
CourseName
.
Trim
()
+
"%"
);
}
if
(
query
.
CourseId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course
.
CourseId
),
query
.
CourseId
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
rb_course_hk
.
CourseId
),
query
.
CourseId
);
}
}
return
base
.
Get
<
RB_Course
>(
builder
.
ToString
(),
parameters
).
ToList
();
return
base
.
Get
<
rb_course_hk
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
/// <summary>
...
...
@@ -82,28 +82,28 @@ WHERE 1=1
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Course
>
GetCoursePageRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
CourseQuery
query
)
public
List
<
rb_course_hk
>
GetCoursePageRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
CourseQuery
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
();
builder
.
AppendFormat
(
@"
SELECT A.*
FROM
RB_Course
AS A
FROM
rb_course_hk
AS A
WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
CourseName
))
{
builder
.
AppendFormat
(
" AND A.{0} LIKE @courseName "
,
nameof
(
RB_Course
.
CourseName
));
builder
.
AppendFormat
(
" AND A.{0} LIKE @courseName "
,
nameof
(
rb_course_hk
.
CourseName
));
parameters
.
Add
(
"courseName"
,
"%"
+
query
.
CourseName
.
Trim
()
+
"%"
);
}
if
(
query
.
CourseId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course
.
CourseId
),
query
.
CourseId
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
rb_course_hk
.
CourseId
),
query
.
CourseId
);
}
}
return
base
.
GetPage
<
RB_Course
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
return
base
.
GetPage
<
rb_course_hk
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
}
}
EduSpider.Repository/CourseStudentRepository.cs
View file @
1f63d8bb
...
...
@@ -37,7 +37,7 @@ namespace EduSpider.Repository
StringBuilder
builder
=
new
();
builder
.
AppendFormat
(
@"
SELECT A.*,B.courseName,B.teacherId,B.teacherName,B.teacherLogo,B.CoverImg,B.courseStatus,B.completeNum,B.totalClassNum
FROM RB_Course_Student AS A INNER JOIN
RB_Course
AS B ON A.courseId=B.courseId
FROM RB_Course_Student AS A INNER JOIN
rb_course_hk
AS B ON A.courseId=B.courseId
WHERE 1=1
"
);
if
(
query
!=
null
)
...
...
EduSpider.Repository/CourseTeacherRepository.cs
View file @
1f63d8bb
...
...
@@ -37,7 +37,7 @@ namespace EduSpider.Repository
StringBuilder
builder
=
new
();
builder
.
AppendFormat
(
@"
SELECT A.*,B.courseName,B.teacherId,B.teacherName,B.teacherLogo,B.CoverImg,B.courseStatus,B.completeNum,B.totalClassNum
FROM RB_Course_Teacher AS A INNER JOIN
RB_Course
AS B ON A.courseId=B.courseId
FROM RB_Course_Teacher AS A INNER JOIN
rb_course_hk
AS B ON A.courseId=B.courseId
WHERE 1=1
"
);
if
(
query
!=
null
)
...
...
@@ -55,17 +55,17 @@ WHERE 1=1
//进行中
if
(
query
.
QCourseState
==
1
)
{
builder
.
AppendFormat
(
" AND B.{0} IN({1}) AND B.totalClassNum<>B.completeNum "
,
nameof
(
RB_Course
.
CourseStatus
),
1
);
builder
.
AppendFormat
(
" AND B.{0} IN({1}) AND B.totalClassNum<>B.completeNum "
,
nameof
(
rb_course_hk
.
CourseStatus
),
1
);
}
//已完成
if
(
query
.
QCourseState
==
2
)
{
builder
.
AppendFormat
(
" AND B.{0} IN({1}) "
,
nameof
(
RB_Course
.
CourseStatus
),
3
);
builder
.
AppendFormat
(
" AND B.{0} IN({1}) "
,
nameof
(
rb_course_hk
.
CourseStatus
),
3
);
}
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
KeyWords
))
{
builder
.
AppendFormat
(
" AND B.{0} LIKE @KeyWords "
,
nameof
(
RB_Course
.
CourseName
));
builder
.
AppendFormat
(
" AND B.{0} LIKE @KeyWords "
,
nameof
(
rb_course_hk
.
CourseName
));
parameters
.
Add
(
"KeyWords"
,
"%"
+
query
.
KeyWords
.
Trim
()
+
"%"
);
}
}
...
...
EduSpider.Repository/StuCommentDetailsRepository.cs
View file @
1f63d8bb
...
...
@@ -74,7 +74,7 @@ namespace EduSpider.Repository
StringBuilder
builder
=
new
();
builder
.
AppendFormat
(
@"
SELECT A.*,s.StudentName as StuName
FROM RB_Stu_CommentDetails AS A LEFT JOIN rb_student s on A.StuUid = s.StudentUid
FROM RB_Stu_CommentDetails AS A LEFT JOIN rb_student
_hk
s on A.StuUid = s.StudentUid
WHERE 1=1
"
);
if
(
query
!=
null
)
...
...
EduSpider.Repository/StuHomeWorkRepository.cs
View file @
1f63d8bb
...
...
@@ -40,7 +40,7 @@ namespace EduSpider.Repository
builder
.
AppendFormat
(
@"
SELECT A.*,B.homework_title,B.score_value,C.courseName
FROM RB_Stu_HomeWork AS A LEFT JOIN rb_homework AS B ON A.homework_id=B.homework_id
LEFT JOIN rb_course AS C ON A.course_id=C.courseId
LEFT JOIN rb_course
_hk
AS C ON A.course_id=C.courseId
WHERE 1=1
"
);
if
(
query
!=
null
)
...
...
EduSpider.Repository/StudentRepository.cs
View file @
1f63d8bb
...
...
@@ -6,9 +6,9 @@ using System.Linq;
namespace
EduSpider.Repository
{
public
class
StudentRepository
:
BaseRepository
<
RB_Student
>,
IStudentRepository
public
class
StudentRepository
:
BaseRepository
<
rb_student_hk
>,
IStudentRepository
{
public
bool
BatchSetStudent
(
List
<
RB_Student
>
students
)
public
bool
BatchSetStudent
(
List
<
rb_student_hk
>
students
)
{
bool
flag
;
flag
=
base
.
BatchInsert
(
students
,
isReplace
:
true
);
...
...
@@ -20,10 +20,10 @@ namespace EduSpider.Repository
/// </summary>
/// <param name="stuNames"></param>
/// <returns></returns>
public
List
<
RB_Student
>
GetListForStuName
(
string
stuNames
)
public
List
<
rb_student_hk
>
GetListForStuName
(
string
stuNames
)
{
string
sql
=
$"select StudId,StudentUid,StudentName from
RB_Student
where StudentName in(
{
stuNames
}
) order by StudId desc"
;
return
Get
<
RB_Student
>(
sql
).
ToList
();
string
sql
=
$"select StudId,StudentUid,StudentName from
rb_student_hk
where StudentName in(
{
stuNames
}
) order by StudId desc"
;
return
Get
<
rb_student_hk
>(
sql
).
ToList
();
}
}
}
EduSpider.Repository/TeacherRepository.cs
View file @
1f63d8bb
...
...
@@ -11,14 +11,14 @@ namespace EduSpider.Repository
/// <summary>
/// 老师仓储层
/// </summary>
public
class
TeacherRepository
:
BaseRepository
<
RB_Teacher
>,
ITeacherRepository
public
class
TeacherRepository
:
BaseRepository
<
rb_teacher_hk
>,
ITeacherRepository
{
/// <summary>
/// 批量新增老师
/// </summary>
/// <param name="teachers"></param>
/// <returns></returns>
public
bool
BatchSetTeache
(
List
<
RB_Teacher
>
teachers
)
public
bool
BatchSetTeache
(
List
<
rb_teacher_hk
>
teachers
)
{
return
base
.
BatchInsert
(
teachers
,
isReplace
:
true
);
}
...
...
EduSpider.Services/AccountService.cs
View file @
1f63d8bb
...
...
@@ -29,7 +29,7 @@ namespace EduSpider.Services
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Account_Extend
>
GetAccountList
(
RB_Account
_Extend
demodel
)
public
List
<
rb_account_hk_Extend
>
GetAccountList
(
rb_account_hk
_Extend
demodel
)
{
return
accountRepository
.
GetAccountList
(
demodel
);
}
...
...
@@ -39,15 +39,15 @@ namespace EduSpider.Services
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
UpdateAccountUnionId
(
RB_Account
_Extend
model
)
public
bool
UpdateAccountUnionId
(
rb_account_hk
_Extend
model
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
()
{
{
nameof
(
RB_Account
_Extend
.
OpenId
),
model
.
OpenId
},
{
nameof
(
RB_Account
_Extend
.
UnionId
),
model
.
UnionId
},
{
nameof
(
rb_account_hk
_Extend
.
OpenId
),
model
.
OpenId
},
{
nameof
(
rb_account_hk
_Extend
.
UnionId
),
model
.
UnionId
},
};
List
<
WhereHelper
>
wheres
=
new
()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Account
_Extend
.
Id
),
FiledName
=
nameof
(
rb_account_hk
_Extend
.
Id
),
FiledValue
=
model
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
...
...
EduSpider.Services/ExamService.cs
View file @
1f63d8bb
...
...
@@ -79,7 +79,7 @@ namespace EduSpider.Services
public
object
GetExamStuScoreInfo
(
int
examId
,
int
stuId
,
int
stuUId
)
{
if
(
stuUId
>
0
)
{
var
accountModel
=
AccountRepository
.
GetAccountList
(
new
RB_Account
_Extend
()
{
AccountId
=
stuUId
,
AccountType
=
Utility
.
Enum
.
AccountTypeEnum
.
Student
}).
FirstOrDefault
();
var
accountModel
=
AccountRepository
.
GetAccountList
(
new
rb_account_hk
_Extend
()
{
AccountId
=
stuUId
,
AccountType
=
Utility
.
Enum
.
AccountTypeEnum
.
Student
}).
FirstOrDefault
();
if
(
accountModel
==
null
)
{
return
""
;
}
stuId
=
accountModel
.
Id
;
}
...
...
@@ -176,7 +176,7 @@ namespace EduSpider.Services
/// <returns></returns>
public
string
ImportExcelForStuExamScore
(
string
path_server
,
int
courseId
,
string
examName
,
int
userId
)
{
var
umodel
=
AccountRepository
.
GetAccountList
(
new
Model
.
Extend
.
RB_Account
_Extend
()
{
Id
=
userId
,
AccountType
=
Utility
.
Enum
.
AccountTypeEnum
.
Teacher
}).
FirstOrDefault
();
var
umodel
=
AccountRepository
.
GetAccountList
(
new
Model
.
Extend
.
rb_account_hk
_Extend
()
{
Id
=
userId
,
AccountType
=
Utility
.
Enum
.
AccountTypeEnum
.
Teacher
}).
FirstOrDefault
();
if
(
umodel
==
null
||
umodel
.
Status
==
Utility
.
Enum
.
DateStateEnum
.
Delete
||
umodel
.
AccountType
!=
Utility
.
Enum
.
AccountTypeEnum
.
Teacher
)
{
return
"没有权限操作"
;
}
var
EQlist
=
StuExamScoreHelper
.
GetStuExamScoreData
(
path_server
,
out
List
<
StuScoreModel
>
StuList
);
if
(
EQlist
.
Any
())
...
...
@@ -260,7 +260,7 @@ namespace EduSpider.Services
/// <returns></returns>
public
string
ImportExcelForStuExamScore_V2
(
string
path_server
,
int
courseId
,
string
examName
,
int
userId
)
{
var
umodel
=
AccountRepository
.
GetAccountList
(
new
Model
.
Extend
.
RB_Account
_Extend
()
{
Id
=
userId
}).
FirstOrDefault
();
var
umodel
=
AccountRepository
.
GetAccountList
(
new
Model
.
Extend
.
rb_account_hk
_Extend
()
{
Id
=
userId
}).
FirstOrDefault
();
if
(
umodel
==
null
||
umodel
.
Status
==
Utility
.
Enum
.
DateStateEnum
.
Delete
||
umodel
.
AccountType
!=
Utility
.
Enum
.
AccountTypeEnum
.
Teacher
)
{
return
"没有权限操作"
;
}
var
EQlist
=
StuExamScoreHelper
.
GetStuExamScoreData
(
path_server
,
out
List
<
StuScoreModel
>
StuList
);
if
(
EQlist
.
Any
())
...
...
EduSpider.WebApi/Controllers/User/LoginController.cs
View file @
1f63d8bb
...
...
@@ -59,7 +59,7 @@ namespace EduSpider.WebApi.Controllers
string
OpenId
=
jobj
.
GetString
(
"OpenId"
);
int
AccountType
=
jobj
.
GetInt
(
"AccountType"
,
1
);
var
model
=
AccountService
.
GetAccountList
(
new
RB_Account
_Extend
()
var
model
=
AccountService
.
GetAccountList
(
new
rb_account_hk
_Extend
()
{
Account
=
account
.
Trim
(),
AccountType
=
(
Utility
.
Enum
.
AccountTypeEnum
)
AccountType
...
...
@@ -134,7 +134,7 @@ namespace EduSpider.WebApi.Controllers
}
int
AccountType
=
jobj
.
GetInt
(
"AccountType"
,
2
);
var
model
=
AccountService
.
GetAccountList
(
new
RB_Account
_Extend
()
var
model
=
AccountService
.
GetAccountList
(
new
rb_account_hk
_Extend
()
{
Account
=
account
.
Trim
(),
AccountType
=
(
Utility
.
Enum
.
AccountTypeEnum
)
AccountType
...
...
@@ -314,7 +314,7 @@ namespace EduSpider.WebApi.Controllers
}
int
AccountType
=
parms
.
GetInt
(
"AccountType"
,
1
);
var
model
=
AccountService
.
GetAccountList
(
new
RB_Account
_Extend
()
var
model
=
AccountService
.
GetAccountList
(
new
rb_account_hk
_Extend
()
{
Account
=
account
.
Trim
(),
AccountType
=
(
Utility
.
Enum
.
AccountTypeEnum
)
AccountType
...
...
EduSpider/Program.cs
View file @
1f63d8bb
...
...
@@ -12,15 +12,15 @@ namespace EduSpider
{
var
stopTime
=
1000
*
60
*
30
;
//30分钟执行一次
//
while (true)
//
{
//
//ClassIn数据
//
new ClassInFlow().StartAsync();
//
Thread.Sleep(stopTime);
//
}
while
(
true
)
{
//ClassIn数据
new
ClassInFlow
().
StartAsync
();
Thread
.
Sleep
(
stopTime
);
}
//校管家数据
SchoolTaskHelper
.
RunTask
();
//
SchoolTaskHelper.RunTask();
Console
.
ReadLine
();
...
...
EduSpider/Spiders/ClassInRule/CourseManager.cs
View file @
1f63d8bb
...
...
@@ -108,9 +108,9 @@ namespace EduSpider.Spiders.ClassInRule
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public
static
List
<
RB_Course
>
ParseJson
(
string
data
)
public
static
List
<
rb_course_hk
>
ParseJson
(
string
data
)
{
List
<
RB_Course
>
list
=
new
();
List
<
rb_course_hk
>
list
=
new
();
JArray
courseArray
=
JArray
.
Parse
(
data
);
if
(
courseArray
!=
null
&&
courseArray
.
Count
>
0
)
{
...
...
@@ -122,7 +122,7 @@ namespace EduSpider.Spiders.ClassInRule
{
expiryTime
=
new
DateTime
(
0001
,
01
,
01
);
}
list
.
Add
(
new
RB_Course
()
list
.
Add
(
new
rb_course_hk
()
{
CourseId
=
courseObj
.
GetInt
(
"courseId"
),
CourseName
=
courseObj
.
GetString
(
"courseName"
),
...
...
@@ -271,7 +271,7 @@ namespace EduSpider.Spiders.ClassInRule
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
;
List
<
RB_Course
>
list
=
new
();
List
<
rb_course_hk
>
list
=
new
();
if
(!
string
.
IsNullOrWhiteSpace
(
courseInfoResult
))
{
JObject
courseRootObj
=
JObject
.
Parse
(
courseInfoResult
);
...
...
@@ -283,7 +283,7 @@ namespace EduSpider.Spiders.ClassInRule
{
expiryTime
=
new
DateTime
(
0001
,
01
,
01
);
}
var
courseModel
=
new
RB_Course
()
var
courseModel
=
new
rb_course_hk
()
{
CourseId
=
courseObj
.
GetInt
(
"courseId"
),
CourseName
=
courseObj
.
GetString
(
"courseName"
),
...
...
EduSpider/Spiders/ClassInRule/StudentManager.cs
View file @
1f63d8bb
...
...
@@ -27,7 +27,7 @@ namespace EduSpider.Spiders.ClassInRule
IAccountRepository
accountRepository
=
new
AccountRepository
();
//获取账户表 最大的TeacherId
int
MaxStuId
=
accountRepository
.
GetMaxStuTeaId
(
type
:
2
);
List
<
RB_Account
>
accountList
=
new
();
List
<
rb_account_hk
>
accountList
=
new
();
#
endregion
while
(
pageIndex
<=
pageCount
)
...
...
@@ -56,11 +56,11 @@ namespace EduSpider.Spiders.ClassInRule
#
region
组装实体
var
stus
=
new
List
<
RB_Student
>();
var
stus
=
new
List
<
rb_student_hk
>();
var
stuArray
=
(
data
[
"studentList"
]
as
JArray
);
foreach
(
JObject
x
in
stuArray
)
{
stus
.
Add
(
new
RB_Student
()
stus
.
Add
(
new
rb_student_hk
()
{
AddTime
=
ConvertHelper
.
UnixToDateTime
(
x
.
GetString
(
"addTime"
)),
StudentAccount
=
x
.
GetString
(
"studentAccount"
),
...
...
@@ -84,7 +84,7 @@ namespace EduSpider.Spiders.ClassInRule
if
(
stus
.
Any
(
x
=>
x
.
StudId
>
MaxStuId
))
{
foreach
(
var
item
in
stus
.
Where
(
x
=>
x
.
StudId
>
MaxStuId
))
{
accountList
.
Add
(
new
RB_Account
()
accountList
.
Add
(
new
rb_account_hk
()
{
UniqueId
=
0
,
Id
=
item
.
StudId
,
...
...
EduSpider/Spiders/ClassInRule/TeacherManager.cs
View file @
1f63d8bb
...
...
@@ -24,7 +24,7 @@ namespace EduSpider.Spiders.ClassInRule
{
int
perpage
=
20
,
pageIndex
=
1
,
pageCount
=
1
;
var
request
=
Utility
.
HttpHelper
.
GenerateHttp
(
cookie
);
List
<
RB_Teacher
>
list
=
new
();
List
<
rb_teacher_hk
>
list
=
new
();
while
(
true
)
{
string
paramStr
=
string
.
Format
(
"page={0}&perpage={1}"
,
pageIndex
,
perpage
);
...
...
@@ -81,10 +81,10 @@ namespace EduSpider.Spiders.ClassInRule
int
MaxTeacherId
=
accountRepository
.
GetMaxStuTeaId
(
type
:
1
);
if
(
list
.
Any
(
x
=>
x
.
TeacherId
>
MaxTeacherId
))
{
List
<
RB_Account
>
accountList
=
new
();
List
<
rb_account_hk
>
accountList
=
new
();
foreach
(
var
item
in
list
.
Where
(
x
=>
x
.
TeacherId
>
MaxTeacherId
))
{
accountList
.
Add
(
new
RB_Account
()
accountList
.
Add
(
new
rb_account_hk
()
{
UniqueId
=
0
,
Id
=
item
.
TeacherId
,
...
...
@@ -107,9 +107,9 @@ namespace EduSpider.Spiders.ClassInRule
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public
static
List
<
RB_Teacher
>
ParseJson
(
string
data
)
public
static
List
<
rb_teacher_hk
>
ParseJson
(
string
data
)
{
List
<
RB_Teacher
>
list
=
new
();
List
<
rb_teacher_hk
>
list
=
new
();
JArray
courseArray
=
JArray
.
Parse
(
data
);
if
(
courseArray
!=
null
&&
courseArray
.
Count
>
0
)
{
...
...
@@ -121,7 +121,7 @@ namespace EduSpider.Spiders.ClassInRule
{
Logo
=
"https://console.eeo.cn/upload/images/"
+
Logo
;
}
list
.
Add
(
new
RB_Teacher
()
list
.
Add
(
new
rb_teacher_hk
()
{
TeacherId
=
rObj
.
GetInt
(
"id"
),
TeacherUid
=
rObj
.
GetInt
(
"uid"
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment