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
bf5fbddd
Commit
bf5fbddd
authored
Dec 15, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同步学生账号修改
parent
92cc6561
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
3 deletions
+25
-3
IAccountRepository.cs
EduSpider.IRepository/IAccountRepository.cs
+7
-0
AccountRepository.cs
EduSpider.Repository/AccountRepository.cs
+11
-0
StudentManager.cs
EduSpider/Spiders/ClassInRule/StudentManager.cs
+7
-3
No files found.
EduSpider.IRepository/IAccountRepository.cs
View file @
bf5fbddd
...
...
@@ -20,6 +20,13 @@ namespace EduSpider.Repository
int
GetMaxStuTeaId
(
int
type
);
/// <summary>
/// 获取账号信息
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
public
List
<
rb_account_hk_Extend
>
GetStuAccountList
(
int
type
,
string
Account
);
public
List
<
rb_account_hk_Extend
>
GetAccountList
(
rb_account_hk_Extend
demodel
);
/// <summary>
...
...
EduSpider.Repository/AccountRepository.cs
View file @
bf5fbddd
...
...
@@ -85,6 +85,17 @@ INNER JOIN rb_student_hk s on a.Id =s.StudId and a.AccountType =2
return
obj
==
null
?
0
:
Convert
.
ToInt32
(
obj
);
}
/// <summary>
/// 获取账号信息
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
public
List
<
rb_account_hk_Extend
>
GetStuAccountList
(
int
type
,
string
Account
)
{
string
sql
=
$" select * from rb_account_hk where AccountType =
{
type
}
and Account IN(
{
Account
}
)"
;
return
Get
<
rb_account_hk_Extend
>(
sql
).
ToList
();
}
/// <summary>
/// 获取教师信息
/// </summary>
...
...
EduSpider/Spiders/ClassInRule/StudentManager.cs
View file @
bf5fbddd
...
...
@@ -61,6 +61,7 @@ namespace EduSpider.Spiders.ClassInRule
#
region
组装实体
var
stus
=
new
List
<
rb_student_hk
>();
var
stuArray
=
(
data
[
"studentList"
]
as
JArray
);
string
accountIds
=
""
;
foreach
(
JObject
x
in
stuArray
)
{
var
xModel
=
new
rb_student_hk
()
...
...
@@ -85,6 +86,7 @@ namespace EduSpider.Spiders.ClassInRule
xModel
.
StudentAccount
=
mobile
;
}
}
accountIds
+=
string
.
Format
(
",'{0}'"
,
xModel
.
StudentAccount
);
stus
.
Add
(
xModel
);
}
courseRepository
.
BatchSetStudent
(
stus
);
...
...
@@ -93,13 +95,15 @@ namespace EduSpider.Spiders.ClassInRule
#
endregion
#
region
写入账号
if
(
stus
.
Any
(
x
=>
x
.
StudId
>
MaxStuId
))
if
(
stus
.
Any
())
{
foreach
(
var
item
in
stus
.
Where
(
x
=>
x
.
StudId
>
MaxStuId
))
var
stuAccountList
=
accountRepository
.
GetStuAccountList
(
1
,
accountIds
.
TrimStart
(
','
));
foreach
(
var
item
in
stus
)
{
var
tempAccount
=
stuAccountList
?.
FirstOrDefault
(
qitem
=>
qitem
.
Id
==
item
.
StudId
&&
qitem
.
Account
==
item
.
StudentAccount
&&
qitem
.
AccountId
==
item
.
StudentUid
);
accountList
.
Add
(
new
rb_account_hk
()
{
UniqueId
=
0
,
UniqueId
=
tempAccount
?.
UniqueId
??
0
,
Id
=
item
.
StudId
,
Account
=
item
.
StudentAccount
,
AccountId
=
item
.
StudentUid
,
...
...
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