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
cf9763ad
Commit
cf9763ad
authored
Jan 03, 2023
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
1d335f0a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
11 deletions
+28
-11
AccountRepository.cs
EduSpider.Repository/AccountRepository.cs
+9
-1
LoginController.cs
EduSpider.WebApi/Controllers/User/LoginController.cs
+2
-1
TeacherManager.cs
EduSpider/Spiders/ClassInRule/TeacherManager.cs
+13
-5
appsettings.json
EduSpider/appsettings.json
+4
-4
No files found.
EduSpider.Repository/AccountRepository.cs
View file @
cf9763ad
...
...
@@ -92,7 +92,15 @@ INNER JOIN rb_student_hk s on a.Id =s.StudId and a.AccountType =2
/// <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
}
)"
;
string
sql
=
$" select * from rb_account_hk where 1=1 "
;
if
(
type
>
0
)
{
sql
+=
$" AND AccountType =
{
type
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
Account
))
{
sql
+=
$" AND Account IN(
{
Account
}
) "
;
}
return
Get
<
rb_account_hk_Extend
>(
sql
).
ToList
();
}
...
...
EduSpider.WebApi/Controllers/User/LoginController.cs
View file @
cf9763ad
...
...
@@ -95,7 +95,8 @@ namespace EduSpider.WebApi.Controllers
var
empModel
=
AccountService
.
GetEmployeeList
(
new
EmployeeInfo
()
{
EmployeeName
=
model
.
AccountName
,
EmployeeTel
=
model
.
Account
})?.
FirstOrDefault
();
if
(
empModel
!=
null
)
{
if
(
empModel
.
School_Id
==
2
||
empModel
.
School_Id
==
3
)
//HK 2023-01-03 去掉条件 || empModel.School_Id == 3
if
(
empModel
.
School_Id
==
2
)
{
return
ApiResult
.
Failed
(
message
:
$"此账号【
{
account
}
】未开通小程序功能!"
,
new
{
Error
=
2
});
}
...
...
EduSpider/Spiders/ClassInRule/TeacherManager.cs
View file @
cf9763ad
...
...
@@ -80,18 +80,26 @@ namespace EduSpider.Spiders.ClassInRule
bool
flag
=
teacherRepository
.
BatchSetTeache
(
list
.
OrderBy
(
x
=>
x
.
TeacherId
).
ToList
());
if
(
flag
)
{
string
accountIds
=
""
;
foreach
(
var
item
in
list
)
{
if
(!
string
.
IsNullOrEmpty
(
item
.
TeacherAccount
))
{
accountIds
+=
string
.
Format
(
",'{0}'"
,
item
.
TeacherAccount
);
}
}
//更新账户
IAccountRepository
accountRepository
=
new
AccountRepository
();
//获取账户表 最大的TeacherId
int
MaxTeacherId
=
accountRepository
.
GetMaxStuTeaId
(
type
:
1
);
if
(
list
.
Any
(
x
=>
x
.
TeacherId
>
MaxTeacherId
))
if
(
list
.
Any
())
{
var
teacherAccountList
=
accountRepository
.
GetStuAccountList
(
1
,
accountIds
.
TrimStart
(
','
));
List
<
rb_account_hk
>
accountList
=
new
();
foreach
(
var
item
in
list
.
Where
(
x
=>
x
.
TeacherId
>
MaxTeacherId
)
)
foreach
(
var
item
in
list
)
{
var
tempAccount
=
teacherAccountList
?.
FirstOrDefault
(
qitem
=>
qitem
.
Id
==
item
.
TeacherId
&&
qitem
.
Account
==
item
.
TeacherAccount
&&
qitem
.
AccountId
==
item
.
TeacherUid
);
accountList
.
Add
(
new
rb_account_hk
()
{
UniqueId
=
0
,
UniqueId
=
tempAccount
?.
UniqueId
??
0
,
Id
=
item
.
TeacherId
,
Account
=
item
.
TeacherAccount
,
AccountId
=
item
.
TeacherUid
,
...
...
EduSpider/appsettings.json
View file @
cf9763ad
...
...
@@ -13,9 +13,9 @@
},
//默认Token
"DefaultToken"
:
""
,
//(老账户
18140082327
ls
123456
)
(新账号
18140082527
a
123456
)
切换账号需要清楚Redis
3
号库
ClassInCookie
"ClassInAccount"
:
"18
140082327
"
,
"ClassInPwd"
:
"
ls
123456"
,
//(老账户
18140082327
ls
123456
)
(新账号
18140082527
a
123456
)
(深圳
18948170494
a
123456
)
切换账号需要清楚Redis
3
号库
ClassInCookie
"ClassInAccount"
:
"18
948170494
"
,
"ClassInPwd"
:
"
a
123456"
,
//
1
-老账户,
2
-新账号
"ClassInType"
:
"
1
"
"ClassInType"
:
"
3
"
}
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