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
4e70c537
Commit
4e70c537
authored
Jul 19, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户登录新增校区验证
parent
db738349
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
91 additions
and
4 deletions
+91
-4
IAccountRepository.cs
EduSpider.IRepository/IAccountRepository.cs
+7
-4
IAccountService.cs
EduSpider.IServices/IAccountService.cs
+7
-0
EmployeeInfo.cs
EduSpider.Model/Extend/EmployeeInfo.cs
+29
-0
AccountRepository.cs
EduSpider.Repository/AccountRepository.cs
+30
-0
AccountService.cs
EduSpider.Services/AccountService.cs
+10
-0
LoginController.cs
EduSpider.WebApi/Controllers/User/LoginController.cs
+8
-0
No files found.
EduSpider.IRepository/IAccountRepository.cs
View file @
4e70c537
using
EduSpider.Model.Entity
;
using
EduSpider.Model.Extend
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VTX.FW.Config
;
using
VTX.FW.DB
;
...
...
@@ -25,5 +21,12 @@ namespace EduSpider.Repository
int
GetMaxStuTeaId
(
int
type
);
public
List
<
rb_account_hk_Extend
>
GetAccountList
(
rb_account_hk_Extend
demodel
);
/// <summary>
/// 获取教师信息
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
EmployeeInfo
>
GetEmployeeListRepository
(
EmployeeInfo
query
);
}
}
EduSpider.IServices/IAccountService.cs
View file @
4e70c537
...
...
@@ -23,5 +23,12 @@ namespace EduSpider.IServices
/// <param name="model"></param>
/// <returns></returns>
public
bool
UpdatePassword
(
rb_account_hk_Extend
model
);
/// <summary>
/// 获取员工信息
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
EmployeeInfo
>
GetEmployeeList
(
EmployeeInfo
query
);
}
}
EduSpider.Model/Extend/EmployeeInfo.cs
0 → 100644
View file @
4e70c537
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
EduSpider.Model.Extend
{
/// <summary>
/// 员工信息
/// </summary>
public
class
EmployeeInfo
{
/// <summary>
/// 校区编号
/// </summary>
public
int
School_Id
{
get
;
set
;
}
/// <summary>
/// 员工姓名
/// </summary>
public
string
EmployeeName
{
get
;
set
;
}
/// <summary>
/// 员工电话
/// </summary>
public
string
EmployeeTel
{
get
;
set
;
}
}
}
EduSpider.Repository/AccountRepository.cs
View file @
4e70c537
...
...
@@ -80,5 +80,35 @@ INNER JOIN rb_student_hk s on a.Id =s.StudId and a.AccountType =2
var
obj
=
ExecuteScalar
(
sql
);
return
obj
==
null
?
0
:
Convert
.
ToInt32
(
obj
);
}
/// <summary>
/// 获取教师信息
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
EmployeeInfo
>
GetEmployeeListRepository
(
EmployeeInfo
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.* FROM
(
SELECT A.School_Id,A.TeacherName AS EmployeeName,A.TeacherTel AS EmployeeTel
FROM rb_teacher AS A
UNION ALL
SELECT A.School_Id,A.MName AS EmployeeName,A.MTel AS EmployeeTel
FROM rb_manager AS A
) AS A
WHERE 1=1
"
);
if
(!
string
.
IsNullOrEmpty
(
query
.
EmployeeName
)
||
!
string
.
IsNullOrEmpty
(
query
.
EmployeeTel
))
{
builder
.
AppendFormat
(
" AND (A.EmployeeName='{0}' OR A.EmployeeTel='{1}') "
,
query
.
EmployeeName
.
Trim
(),
query
.
EmployeeTel
.
Trim
());
return
Get
<
EmployeeInfo
>(
builder
.
ToString
()).
ToList
();
}
else
{
return
new
List
<
EmployeeInfo
>();
}
}
}
}
EduSpider.Services/AccountService.cs
View file @
4e70c537
...
...
@@ -81,5 +81,15 @@ namespace EduSpider.Services
};
return
accountRepository
.
Update
(
keyValues
,
wheres
);
}
/// <summary>
/// 获取员工信息列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
EmployeeInfo
>
GetEmployeeList
(
EmployeeInfo
query
)
{
return
accountRepository
.
GetEmployeeListRepository
(
query
);
}
}
}
EduSpider.WebApi/Controllers/User/LoginController.cs
View file @
4e70c537
...
...
@@ -89,6 +89,14 @@ namespace EduSpider.WebApi.Controllers
return
ApiResult
.
Failed
(
message
:
$"此账号【
{
account
}
】已禁用"
,
new
{
Error
=
2
});
}
if
(
model
.
AccountType
==
Utility
.
Enum
.
AccountTypeEnum
.
Teacher
)
{
var
empModel
=
AccountService
.
GetEmployeeList
(
new
EmployeeInfo
()
{
EmployeeName
=
model
.
AccountName
,
EmployeeTel
=
model
.
Account
})?.
FirstOrDefault
();
if
(
empModel
!=
null
&&
empModel
.
School_Id
!=
1
)
{
return
ApiResult
.
Failed
(
message
:
$"此账号【
{
account
}
】未开通小程序功能!"
,
new
{
Error
=
2
});
}
}
#
region
获取进阶思维小程序端
token
BaseUserInfo
UserInfo
=
new
()
{
BaseUserId
=
model
.
UniqueId
};
string
token
=
JwtHelper
.
CreateToken
(
UserInfo
,
Config
.
JwtSecretKey
,
Config
.
JwtExpirTime
);
...
...
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