Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
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
黄奎
Education
Commits
1d041489
Commit
1d041489
authored
May 10, 2021
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
e263acbf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
27 deletions
+61
-27
LoginController.cs
Edu.WebApi/Controllers/User/LoginController.cs
+11
-6
UserController.cs
Edu.WebApi/Controllers/User/UserController.cs
+50
-21
No files found.
Edu.WebApi/Controllers/User/LoginController.cs
View file @
1d041489
...
...
@@ -390,14 +390,19 @@ namespace Edu.WebApi.Controllers.User
list
=
new
Module
.
Course
.
ClassModule
().
GetClassTimeByTId
(
tId
,
model
.
Group_Id
);
tempList
=
list
.
OrderBy
(
x
=>
x
.
NewEndPlanDateTime
).
Where
(
x
=>
x
.
TeacherId
==
model
.
AccountId
&&
x
.
NewPlanDateTime
.
HasValue
&&
System
.
DateTime
.
Now
>=
x
.
NewPlanDateTime
.
Value
.
AddMinutes
(-
10
)
&&
x
.
NewEndPlanDateTime
.
HasValue
&&
System
.
DateTime
.
Now
<
x
.
NewEndPlanDateTime
.
Value
);
if
(
tempList
==
null
||
!
tempList
.
Any
())
if
(
tempList
==
null
||
!
tempList
.
Any
())
{
tempList
=
list
.
OrderBy
(
x
=>
x
.
NewEndPlanDateTime
).
Where
(
x
=>
x
.
TeacherId
==
model
.
AccountId
&&
x
.
NewEndPlanDateTime
.
HasValue
&&
System
.
DateTime
.
Now
<
x
.
NewEndPlanDateTime
.
Value
&&
x
.
NewEndPlanDateTime
.
HasValue
&&
System
.
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
==
x
.
NewEndPlanDateTime
.
Value
.
ToString
(
"yyyy-MM-dd"
));
}
var
result
=
tempList
.
Select
(
x
=>
new
{
x
.
RoomName
,
NewPlanDateTime
=
x
.
NewPlanDateTime
.
HasValue
?
x
.
NewPlanDateTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm"
):
""
,
NewEndPlanDateTime
=
x
.
NewEndPlanDateTime
.
HasValue
?
x
.
NewEndPlanDateTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm"
)
:
""
});
return
ApiResult
.
Failed
(
message
:
$"本教室没有找到您的课"
,
data
:
result
);
var
result
=
new
{
TeacherName
=
modelTeacher
.
FirstOrDefault
()?.
TeacherName
,
tempList
=
tempList
.
Select
(
x
=>
new
{
x
.
RoomName
,
x
.
TeacherName
,
NewPlanDateTime
=
x
.
NewPlanDateTime
.
HasValue
?
x
.
NewPlanDateTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm"
)
:
""
,
NewEndPlanDateTime
=
x
.
NewEndPlanDateTime
.
HasValue
?
x
.
NewEndPlanDateTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm"
)
:
""
})
};
return
ApiResult
.
Failed
(
message
:
$"本教室没有找到您的课"
,
data
:
result
);
}
else
{
else
{
var
classModel
=
tempList
.
OrderBy
(
x
=>
x
.
NewPlanDateTime
).
FirstOrDefault
();
var
extModel
=
new
Module
.
Course
.
ClassRoomModule
().
GetClassRoomModule
(
classModel
.
ClassRoomId
);
var
classInfo
=
new
...
...
Edu.WebApi/Controllers/User/UserController.cs
View file @
1d041489
...
...
@@ -12,6 +12,7 @@ using Edu.Model.ViewModel.User;
using
Edu.Module.Log
;
using
Edu.Module.User
;
using
Edu.WebApi.Filter
;
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json
;
...
...
@@ -262,12 +263,12 @@ namespace Edu.WebApi.Controllers.User
Remark
=
base
.
ParmJObj
.
GetStringValue
(
"Remark"
),
SAddress
=
base
.
ParmJObj
.
GetStringValue
(
"SAddress"
),
SDomain
=
base
.
ParmJObj
.
GetStringValue
(
"SDomain"
),
SId
=
base
.
ParmJObj
.
GetInt
(
"SId"
),
SId
=
base
.
ParmJObj
.
GetInt
(
"SId"
),
SLinkTel
=
base
.
ParmJObj
.
GetStringValue
(
"SLinkTel"
),
SLogo
=
base
.
ParmJObj
.
GetStringValue
(
"SLogo"
),
SLogo
=
base
.
ParmJObj
.
GetStringValue
(
"SLogo"
),
SName
=
base
.
ParmJObj
.
GetStringValue
(
"SName"
),
Status
=
(
DateStateEnum
)
base
.
ParmJObj
.
GetInt
(
"Status"
),
ContractTitle
=
base
.
ParmJObj
.
GetStringValue
(
"ContractTitle"
),
Status
=
(
DateStateEnum
)
base
.
ParmJObj
.
GetInt
(
"Status"
),
ContractTitle
=
base
.
ParmJObj
.
GetStringValue
(
"ContractTitle"
),
};
extModel
.
CreateBy
=
base
.
UserInfo
.
Id
;
extModel
.
CreateTime
=
DateTime
.
Now
;
...
...
@@ -359,7 +360,7 @@ namespace Edu.WebApi.Controllers.User
{
var
query
=
new
RB_Teacher_ViewModel
()
{
IsQLeave
=
base
.
ParmJObj
.
GetInt
(
"IsQLeave"
)
IsQLeave
=
base
.
ParmJObj
.
GetInt
(
"IsQLeave"
)
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
School_Id
=
base
.
UserInfo
.
School_Id
;
...
...
@@ -390,8 +391,8 @@ namespace Edu.WebApi.Controllers.User
Dept_Id
=
base
.
ParmJObj
.
GetInt
(
"Dept_Id"
),
Post_Id
=
base
.
ParmJObj
.
GetInt
(
"Post_Id"
),
BaseStuNum
=
base
.
ParmJObj
.
GetInt
(
"BaseStuNum"
),
BaseHourFee
=
base
.
ParmJObj
.
GetDecimal
(
"BaseHourFee"
),
AuditStatus
=
AccountStatusEnum
.
Pass
BaseHourFee
=
base
.
ParmJObj
.
GetDecimal
(
"BaseHourFee"
),
AuditStatus
=
AccountStatusEnum
.
Pass
};
extModel
.
TeachTag
=
base
.
ParmJObj
.
GetStringValue
(
"TeachTag"
);
extModel
.
CreateBy
=
base
.
UserInfo
.
Id
;
...
...
@@ -452,6 +453,31 @@ namespace Edu.WebApi.Controllers.User
var
flag
=
teacherModule
.
ReApplyTeacherModule
(
TId
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 获取讲师列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
AllowAnonymous
]
public
ApiResult
GetAllTeacherList
()
{
var
query
=
new
RB_Teacher_ViewModel
()
{
IsQLeave
=
base
.
ParmJObj
.
GetInt
(
"IsQLeave"
,
0
),
Group_Id
=
base
.
ParmJObj
.
GetInt
(
"Group_Id"
,
100000
)
};
var
list
=
teacherModule
.
GetTeacherListModule
(
query
);
var
result
=
list
.
Select
(
x
=>
new
{
x
.
TeacherHead
,
x
.
TId
});
return
ApiResult
.
Success
(
data
:
result
);
}
#
endregion
#
region
助教管理
...
...
@@ -514,7 +540,7 @@ namespace Edu.WebApi.Controllers.User
AssistIntro
=
base
.
ParmJObj
.
GetStringValue
(
"AssistIntro"
),
Dept_Id
=
base
.
ParmJObj
.
GetInt
(
"Dept_Id"
),
Post_Id
=
base
.
ParmJObj
.
GetInt
(
"Post_Id"
),
AuditStatus
=
AccountStatusEnum
.
Pass
AuditStatus
=
AccountStatusEnum
.
Pass
};
extModel
.
CreateBy
=
base
.
UserInfo
.
Id
;
extModel
.
CreateTime
=
DateTime
.
Now
;
...
...
@@ -522,7 +548,7 @@ namespace Edu.WebApi.Controllers.User
extModel
.
UpdateTime
=
DateTime
.
Now
;
extModel
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
bool
flag
=
assistModule
.
SetAssistModule
(
extModel
,
isUpdateBasic
:
true
);
bool
flag
=
assistModule
.
SetAssistModule
(
extModel
,
isUpdateBasic
:
true
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
@@ -730,7 +756,7 @@ namespace Edu.WebApi.Controllers.User
qitem
.
Email
,
EmAccountId
=
qitem
.
Id
,
qitem
.
DirectSupervisor
,
DirectSupervisorName
=
qitem
.
DirectSupervisor
>
0
?
base
.
GetUserInfo
(
qitem
.
DirectSupervisor
)?.
AccountName
??
""
:
""
,
DirectSupervisorName
=
qitem
.
DirectSupervisor
>
0
?
base
.
GetUserInfo
(
qitem
.
DirectSupervisor
)?.
AccountName
??
""
:
""
,
});
return
ApiResult
.
Success
(
data
:
pageModel
);
}
...
...
@@ -775,9 +801,9 @@ namespace Edu.WebApi.Controllers.User
Education
=
(
EducationEnum
)
base
.
ParmJObj
.
GetInt
(
"Education"
),
School_Id
=
base
.
ParmJObj
.
GetInt
(
"School_Id"
),
Email
=
base
.
ParmJObj
.
GetStringValue
(
"Email"
),
DirectSupervisor
=
base
.
ParmJObj
.
GetInt
(
"DirectSupervisor"
),
Account
=
base
.
ParmJObj
.
GetStringValue
(
"Account"
),
Password
=
base
.
ParmJObj
.
GetStringValue
(
"Password"
),
DirectSupervisor
=
base
.
ParmJObj
.
GetInt
(
"DirectSupervisor"
),
Account
=
base
.
ParmJObj
.
GetStringValue
(
"Account"
),
Password
=
base
.
ParmJObj
.
GetStringValue
(
"Password"
),
};
if
(!
string
.
IsNullOrEmpty
(
extModel
.
Password
.
Trim
()))
{
...
...
@@ -905,7 +931,7 @@ namespace Edu.WebApi.Controllers.User
[
HttpPost
]
public
ApiResult
GetEmployee
()
{
var
Id
=
0
;
var
Id
=
0
;
var
AccountId
=
base
.
ParmJObj
.
GetInt
(
"AccountId"
,
0
);
var
AccountType
=
base
.
ParmJObj
.
GetInt
(
"AccountType"
,
0
);
var
extModel
=
employeeModule
.
GetEmployeeModule
(
Id
,
AccountId
,
AccountType
);
...
...
@@ -958,14 +984,17 @@ namespace Edu.WebApi.Controllers.User
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetEmployeeDirectSupervisor
()
{
public
ApiResult
SetEmployeeDirectSupervisor
()
{
var
parms
=
ParmJObj
;
int
UserId
=
parms
.
GetInt
(
"UserId"
,
0
);
int
DirectSupervisor
=
parms
.
GetInt
(
"DirectSupervisor"
,
0
);
if
(
UserId
<=
0
)
{
if
(
UserId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递用户id"
);
}
if
(
DirectSupervisor
<=
0
)
{
if
(
DirectSupervisor
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递直接主管id"
);
}
bool
flag
=
employeeModule
.
SetEmployeeDirectSupervisor
(
UserId
,
DirectSupervisor
);
...
...
@@ -1308,7 +1337,7 @@ namespace Edu.WebApi.Controllers.User
var
query
=
new
RB_Post_ViewModel
()
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
PostName
=
base
.
ParmJObj
.
GetStringValue
(
"PostName"
)
PostName
=
base
.
ParmJObj
.
GetStringValue
(
"PostName"
)
};
var
list
=
postModule
.
GetPostListModule
(
query
);
return
ApiResult
.
Success
(
data
:
list
);
...
...
@@ -1325,7 +1354,7 @@ namespace Edu.WebApi.Controllers.User
var
query
=
new
RB_Post_ViewModel
()
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
QDeptIds
=
base
.
ParmJObj
.
GetStringValue
(
"QDeptIds"
)
QDeptIds
=
base
.
ParmJObj
.
GetStringValue
(
"QDeptIds"
)
};
var
list
=
postModule
.
GetDeptPostListModule
(
query
);
return
ApiResult
.
Success
(
data
:
list
);
...
...
@@ -1397,7 +1426,7 @@ namespace Edu.WebApi.Controllers.User
QDeptIds
=
base
.
ParmJObj
.
GetStringValue
(
"QDeptIds"
),
EmployeeName
=
base
.
ParmJObj
.
GetStringValue
(
"EmployeeName"
),
//姓名
AccountTypeStr
=
base
.
ParmJObj
.
GetStringValue
(
"AccountTypeStr"
),
//人员类型【逗号分割】
IsLeave
=
base
.
ParmJObj
.
GetInt
(
"IsLeave"
),
IsLeave
=
base
.
ParmJObj
.
GetInt
(
"IsLeave"
),
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
var
list
=
employeeModule
.
GetEmployeeListModule
(
query
);
...
...
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