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
88cd1d5b
Commit
88cd1d5b
authored
Dec 14, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
d49a93e3
bca5cc00
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
327 additions
and
81 deletions
+327
-81
ClassLogTypeEnum.cs
Edu.Common/Enum/Course/ClassLogTypeEnum.cs
+0
-1
UserInfo.cs
Edu.Model/CacheModel/UserInfo.cs
+5
-0
RB_Class_Room_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Class_Room_ViewModel.cs
+5
-0
RB_Menu_Function_ViewModel.cs
Edu.Model/ViewModel/System/RB_Menu_Function_ViewModel.cs
+5
-0
RB_Teacher_ViewModel.cs
Edu.Model/ViewModel/User/RB_Teacher_ViewModel.cs
+2
-3
ClassModule.cs
Edu.Module.Course/ClassModule.cs
+140
-20
TeachingRewardsModule.cs
Edu.Module.Course/TeachingRewardsModule.cs
+1
-1
MenuModule.cs
Edu.Module.System/MenuModule.cs
+22
-1
AssistModule.cs
Edu.Module.User/AssistModule.cs
+7
-15
TeacherModule.cs
Edu.Module.User/TeacherModule.cs
+7
-14
RB_Class_RoomRepository.cs
Edu.Repository/Course/RB_Class_RoomRepository.cs
+4
-0
RB_Class_LogRepository.cs
Edu.Repository/Log/RB_Class_LogRepository.cs
+10
-8
RB_Menu_FunctionRepository.cs
Edu.Repository/System/RB_Menu_FunctionRepository.cs
+40
-0
RB_AccountRepository.cs
Edu.Repository/User/RB_AccountRepository.cs
+2
-6
RB_TeacherRepository.cs
Edu.Repository/User/RB_TeacherRepository.cs
+2
-2
BaseController.cs
Edu.WebApi/Controllers/BaseController.cs
+20
-0
ClassController.cs
Edu.WebApi/Controllers/Course/ClassController.cs
+49
-9
LoginController.cs
Edu.WebApi/Controllers/User/LoginController.cs
+6
-0
UserController.cs
Edu.WebApi/Controllers/User/UserController.cs
+0
-1
No files found.
Edu.Common/Enum/Course/ClassLogTypeEnum.cs
View file @
88cd1d5b
...
...
@@ -25,7 +25,6 @@ namespace Edu.Common.Enum.Course
/// </summary>
[
EnumField
(
"上课记录"
)]
Class
=
3
,
/// <summary>
/// 创建班级
/// </summary>
...
...
Edu.Model/CacheModel/UserInfo.cs
View file @
88cd1d5b
...
...
@@ -94,5 +94,10 @@ namespace Edu.Model.CacheModel
/// 岗位名称
/// </summary>
public
string
PostName
{
get
;
set
;
}
/// <summary>
/// 功能权限列表
/// </summary>
public
object
ActionMenuList
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/Course/RB_Class_Room_ViewModel.cs
View file @
88cd1d5b
...
...
@@ -37,5 +37,10 @@ namespace Edu.Model.ViewModel.Course
/// 状态字符串
/// </summary>
public
string
StatusStr
{
get
{
return
this
.
Status
.
ToName
();
}
}
/// <summary>
/// 教室编号【查询使用】
/// </summary>
public
string
QRoomIds
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/System/RB_Menu_Function_ViewModel.cs
View file @
88cd1d5b
...
...
@@ -11,5 +11,10 @@ namespace Edu.Model.ViewModel.System
/// 菜单名称
/// </summary>
public
string
MenuName
{
get
;
set
;
}
/// <summary>
/// 菜单列表
/// </summary>
public
string
MenuUrl
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/User/RB_Teacher_ViewModel.cs
View file @
88cd1d5b
...
...
@@ -75,9 +75,8 @@ namespace Edu.Model.ViewModel.User
/// </summary>
public
string
PostName
{
get
;
set
;
}
/// <summary>
/// 教师ids
/// 教师编号
/// </summary>
public
string
Teacher
Ids
{
get
;
set
;
}
public
string
QT
Ids
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Module.Course/ClassModule.cs
View file @
88cd1d5b
using
Edu.AOP.CustomerAttribute
;
using
Edu.Common.Enum
;
using
Edu.Model.CacheModel
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Model.ViewModel.User
;
using
Edu.Repository.Course
;
using
Edu.Repository.Log
;
using
Edu.Repository.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -63,6 +65,17 @@ namespace Edu.Module.Course
/// 课程日志记录表
/// </summary>
private
readonly
Repository
.
User
.
RB_StudentRepository
studentRepository
=
new
Repository
.
User
.
RB_StudentRepository
();
/// <summary>
/// 教室仓储层对象
/// </summary>
private
readonly
RB_Class_RoomRepository
class_RoomRepository
=
new
RB_Class_RoomRepository
();
/// <summary>
/// 教师仓储层对象
/// </summary>
private
readonly
RB_TeacherRepository
teacherRepository
=
new
RB_TeacherRepository
();
/// <summary>
/// 获取班级列表
/// </summary>
...
...
@@ -116,6 +129,21 @@ namespace Edu.Module.Course
return
list
;
}
/// <summary>
/// 获取班级日志分页列表
/// </summary>
/// <param name="pageIndex">当前页</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowsCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Class_Log_ViewModel
>
GetClassLogPageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Class_Log_ViewModel
query
)
{
return
classLogRepository
.
GetClassLogPageListRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
}
/// <summary>
/// 检查班级是否存在
/// </summary>
...
...
@@ -174,7 +202,6 @@ namespace Edu.Module.Course
{
nameof
(
RB_Class_ViewModel
.
ClassType
),
model
.
ClassType
},
{
nameof
(
RB_Class_ViewModel
.
DefaultTimeJson
),
model
.
DefaultTimeJson
},
{
nameof
(
RB_Class_ViewModel
.
DateJson
),
model
.
DateJson
},
//{ nameof(RB_Class_ViewModel.CompleteProgress),model.CompleteProgress},
};
flag
=
classRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Class_ViewModel
.
ClassId
),
model
.
ClassId
));
}
...
...
@@ -183,7 +210,17 @@ namespace Edu.Module.Course
var
newId
=
classRepository
.
Insert
(
model
);
model
.
ClassId
=
newId
;
flag
=
newId
>
0
;
classLogRepository
.
AddClassLogRepository
(
Common
.
Enum
.
Course
.
ClassLogTypeEnum
.
CreateClass
,
"创建班级"
,
newId
,
model
.
Group_Id
,
model
.
School_Id
,
model
.
CreateBy
);
var
classLogModel
=
new
Model
.
Entity
.
Log
.
RB_Class_Log
()
{
LogType
=
Common
.
Enum
.
Course
.
ClassLogTypeEnum
.
CreateClass
,
LogContent
=
"创建班级"
,
ClassId
=
newId
,
Group_Id
=
model
.
Group_Id
,
School_Id
=
model
.
School_Id
,
CreateBy
=
model
.
CreateBy
,
CreateTime
=
System
.
DateTime
.
Now
};
classLogRepository
.
AddClassLogRepository
(
classLogModel
);
}
#
region
阶梯报价
...
...
@@ -263,7 +300,7 @@ namespace Edu.Module.Course
//班级上课计划列表
List
<
RB_Class_Plan_ViewModel
>
classPlanList
=
CreateClassPlanList
(
model
,
defaultPlanTimeList
);
model
.
ClassPlanList
=
classPlanList
;
if
(
model
.
ClassPlanList
!=
null
&&
model
.
ClassPlanList
.
Count
>
0
)
{
...
...
@@ -288,6 +325,7 @@ namespace Edu.Module.Course
}
}
#
endregion
return
flag
;
}
...
...
@@ -296,13 +334,13 @@ namespace Edu.Module.Course
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
private
List
<
RB_Class_Plan_ViewModel
>
CreateClassPlanList
(
RB_Class_ViewModel
model
,
List
<
RB_Class_Time_ViewModel
>
defaultPlanTimeList
)
private
List
<
RB_Class_Plan_ViewModel
>
CreateClassPlanList
(
RB_Class_ViewModel
model
,
List
<
RB_Class_Time_ViewModel
>
defaultPlanTimeList
)
{
List
<
RB_Class_Plan_ViewModel
>
classPlanList
=
new
List
<
RB_Class_Plan_ViewModel
>();
double
totalMinutes
=
0
;
foreach
(
var
item
in
defaultPlanTimeList
)
{
var
startDate
=
Convert
.
ToDateTime
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
+
" "
+
item
.
StartTime
+
":00"
);
var
startDate
=
Convert
.
ToDateTime
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
+
" "
+
item
.
StartTime
+
":00"
);
var
endDate
=
Convert
.
ToDateTime
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
+
" "
+
item
.
EndTime
+
":00"
);
TimeSpan
span
=
endDate
.
Subtract
(
startDate
);
if
(
span
.
TotalMinutes
>
0
)
...
...
@@ -520,7 +558,6 @@ namespace Edu.Module.Course
{
extModel
.
DefaultTimeList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
RB_Class_Time_ViewModel
>>(
extModel
.
DefaultTimeJson
);
}
if
(!
string
.
IsNullOrEmpty
(
extModel
.
DateJson
)
&&
extModel
.
ClassStyle
!=
Common
.
Enum
.
Course
.
ClassStyleEnum
.
OnLine
)
{
extModel
.
WeekDayList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
string
>>(
extModel
.
DateJson
);
...
...
@@ -567,7 +604,7 @@ namespace Edu.Module.Course
item
.
PlanTimeList
=
timeList
?.
Where
(
qitem
=>
qitem
.
ClassPlanId
==
item
.
ClassPlanId
)?.
ToList
();
list
.
Add
(
new
{
IsEndDate
=
item
.
ClassDate
<=
today
?
true
:
false
,
IsEndDate
=
item
.
ClassDate
<=
today
,
item
.
ClassPlanId
,
item
.
ClassId
,
item
.
ClassDate
,
...
...
@@ -588,9 +625,20 @@ namespace Edu.Module.Course
/// 根据计划编号删除上课计划
/// </summary>
/// <param name="ClassPlanId"></param>
/// <param name="UserInfo">用户信息</param>
/// <returns></returns>
public
bool
RemoveClassPlanModule
(
int
ClassPlanId
)
public
bool
RemoveClassPlanModule
(
int
ClassPlanId
,
UserInfo
UserInfo
)
{
var
planModel
=
class_PlanRepository
.
GetEntity
(
ClassPlanId
);
classLogRepository
.
AddClassLogRepository
(
new
Model
.
Entity
.
Log
.
RB_Class_Log
()
{
LogType
=
Common
.
Enum
.
Course
.
ClassLogTypeEnum
.
Class
,
LogContent
=
"删除【"
+
Common
.
ConvertHelper
.
FormatDate
(
planModel
?.
ClassDate
)
+
"】上课计划"
,
ClassId
=
planModel
.
ClassId
,
CreateBy
=
UserInfo
.
Id
,
Group_Id
=
UserInfo
.
Group_Id
,
School_Id
=
UserInfo
.
School_Id
,
});
return
class_PlanRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Class_Plan_ViewModel
.
ClassPlanId
),
ClassPlanId
));
}
...
...
@@ -617,18 +665,45 @@ namespace Edu.Module.Course
/// 新增修改班级上课计划
/// </summary>
/// <param name="extModel"></param>
/// <param name="createBy">操作人</param>
/// <returns></returns>
public
virtual
bool
SetClassPlanModule
(
RB_Class_Plan_ViewModel
extModel
)
public
virtual
bool
SetClassPlanModule
(
RB_Class_Plan_ViewModel
extModel
,
int
createBy
)
{
bool
flag
;
string
logContent
=
""
;
if
(
extModel
.
ClassPlanId
>
0
)
{
var
oldPlanModel
=
class_PlanRepository
.
GetEntity
(
extModel
.
ClassPlanId
);
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Class_Plan_ViewModel
.
ClassRoomId
),
extModel
.
ClassRoomId
},
{
nameof
(
RB_Class_Plan_ViewModel
.
TeacherId
),
extModel
.
TeacherId
},
{
nameof
(
RB_Class_Plan_ViewModel
.
ClassDate
),
extModel
.
ClassDate
},
};
if
(
oldPlanModel
.
ClassRoomId
!=
extModel
.
ClassRoomId
)
{
string
roomIds
=
oldPlanModel
.
ClassRoomId
+
","
+
extModel
.
ClassRoomId
;
var
roomList
=
class_RoomRepository
.
GetClassRoomListRepository
(
new
RB_Class_Room_ViewModel
()
{
QRoomIds
=
roomIds
});
logContent
+=
string
.
Format
(
",教室由【{0}】修改为【{1}】."
,
(
roomList
?.
Where
(
qitem
=>
qitem
.
RoomId
==
oldPlanModel
.
ClassRoomId
)?.
FirstOrDefault
()?.
RoomName
??
""
),
(
roomList
?.
Where
(
qitem
=>
qitem
.
RoomId
==
extModel
.
ClassRoomId
)?.
FirstOrDefault
()?.
RoomName
??
""
)
);
}
if
(
oldPlanModel
.
TeacherId
!=
extModel
.
TeacherId
)
{
string
tIds
=
oldPlanModel
.
TeacherId
+
","
+
extModel
.
TeacherId
;
var
teacherList
=
teacherRepository
.
GetTeacherListRepository
(
new
RB_Teacher_ViewModel
()
{
QTIds
=
tIds
});
logContent
+=
string
.
Format
(
",讲师由【{0}】修改为【{1}】."
,
(
teacherList
?.
Where
(
qitem
=>
qitem
.
TId
==
oldPlanModel
.
TeacherId
)?.
FirstOrDefault
()?.
TeacherName
??
""
),
(
teacherList
?.
Where
(
qitem
=>
qitem
.
TId
==
extModel
.
TeacherId
)?.
FirstOrDefault
()?.
TeacherName
??
""
)
);
}
if
(
oldPlanModel
.
ClassDate
!=
extModel
.
ClassDate
)
{
logContent
+=
string
.
Format
(
",日期由【{0}】修改为【{1}】."
,
Common
.
ConvertHelper
.
FormatDate
(
oldPlanModel
.
ClassDate
),
Common
.
ConvertHelper
.
FormatDate
(
extModel
.
ClassDate
));
}
flag
=
class_PlanRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Class_Plan_ViewModel
.
ClassPlanId
),
extModel
.
ClassPlanId
));
}
else
...
...
@@ -636,6 +711,7 @@ namespace Edu.Module.Course
var
newId
=
class_PlanRepository
.
Insert
(
extModel
);
extModel
.
ClassPlanId
=
newId
;
flag
=
newId
>
0
;
logContent
=
"新增【"
+
Common
.
ConvertHelper
.
FormatDate
(
extModel
?.
ClassDate
)
+
"】上课计划"
;
}
var
oldPlanList
=
class_TimeRepository
.
GetClassTimeListRepository
(
new
RB_Class_Time_ViewModel
()
{
...
...
@@ -670,6 +746,7 @@ namespace Edu.Module.Course
{
if
(
dItem
.
ClassTimeId
>
0
)
{
logContent
+=
string
.
Format
(
",删除{0}上课时间【{1} - {2}】"
,
Common
.
ConvertHelper
.
FormatDate
(
extModel
.
ClassDate
),
dItem
.
StartTime
,
dItem
.
EndTime
);
class_TimeRepository
.
Delete
(
dItem
.
ClassTimeId
);
}
}
...
...
@@ -681,14 +758,40 @@ namespace Edu.Module.Course
item
.
School_Id
=
extModel
.
School_Id
;
if
(
item
.
ClassTimeId
==
0
)
{
logContent
+=
string
.
Format
(
",新增{0}上课时间【{1} - {2}】"
,
Common
.
ConvertHelper
.
FormatDate
(
extModel
.
ClassDate
),
item
.
StartTime
,
item
.
EndTime
);
flag
=
class_TimeRepository
.
Insert
(
item
)
>
0
;
}
else
{
var
oldModel
=
oldPlanList
?.
Where
(
qitem
=>
qitem
.
ClassTimeId
==
item
.
ClassTimeId
)?.
FirstOrDefault
();
if
(
oldModel
!=
null
)
{
if
(
oldModel
.
StartTime
!=
item
.
StartTime
)
{
logContent
+=
string
.
Format
(
",{0}上课开始时间由【{1}】修改为【{2}】"
,
Common
.
ConvertHelper
.
FormatDate
(
extModel
.
ClassDate
),
oldModel
.
StartTime
,
item
.
EndTime
);
}
if
(
oldModel
.
EndTime
!=
item
.
EndTime
)
{
logContent
+=
string
.
Format
(
",{0}上课结束时间由【{1}】修改为【{2}】"
,
Common
.
ConvertHelper
.
FormatDate
(
extModel
.
ClassDate
),
oldModel
.
EndTime
,
item
.
EndTime
);
}
}
flag
=
class_TimeRepository
.
Update
(
item
);
}
}
}
if
(!
string
.
IsNullOrEmpty
(
logContent
))
{
classLogRepository
.
AddClassLogRepository
(
new
Model
.
Entity
.
Log
.
RB_Class_Log
()
{
LogType
=
Common
.
Enum
.
Course
.
ClassLogTypeEnum
.
Class
,
LogContent
=
logContent
,
ClassId
=
extModel
.
ClassId
,
Group_Id
=
extModel
.
Group_Id
,
School_Id
=
extModel
.
School_Id
,
CreateBy
=
createBy
});
}
return
flag
;
}
...
...
@@ -697,12 +800,14 @@ namespace Edu.Module.Course
/// </summary>
/// <param name="classId">班级编号</param>
/// <returns></returns>
public
object
GetClassStudentListModule
(
int
classId
)
public
object
GetClassStudentListModule
(
int
classId
,
int
school_Id
,
int
group_Id
)
{
List
<
object
>
list
=
new
List
<
object
>();
var
orderStudentList
=
order_GuestRepository
.
GetList
(
new
RB_Order_Guest_ViewModel
()
{
ClassId
=
classId
ClassId
=
classId
,
Group_Id
=
group_Id
,
School_Id
=
school_Id
}).
Where
(
x
=>
x
.
GuestState
==
1
).
ToList
();
var
classModel
=
GetClassModule
(
classId
);
var
courseModel
=
courseRepository
.
GetEntity
((
classModel
?.
CouseId
??
0
));
...
...
@@ -765,8 +870,17 @@ namespace Edu.Module.Course
}
if
(
flag
)
{
classLogRepository
.
AddClassLogRepository
(
Common
.
Enum
.
Course
.
ClassLogTypeEnum
.
DropOutStudent
,
studentName
+
" 学员因"
+
dropOutRemark
+
"退课"
,
classId
,
group_Id
,
school_Id
,
createBy
);
var
classLogModel
=
new
Model
.
Entity
.
Log
.
RB_Class_Log
()
{
LogType
=
Common
.
Enum
.
Course
.
ClassLogTypeEnum
.
DropOutStudent
,
LogContent
=
studentName
+
" 学员因"
+
dropOutRemark
+
"退课"
,
ClassId
=
classId
,
Group_Id
=
group_Id
,
School_Id
=
school_Id
,
CreateBy
=
createBy
,
CreateTime
=
System
.
DateTime
.
Now
};
classLogRepository
.
AddClassLogRepository
(
classLogModel
);
}
return
flag
;
}
...
...
@@ -780,9 +894,8 @@ namespace Edu.Module.Course
[
TransactionCallHandler
]
public
bool
AddClassStudentDropOutModule
(
RB_Order_Guest_ViewModel
model
,
string
CreateName
)
{
bool
flag
=
false
;
//写日志
flag
=
order_GuestRepository
.
Insert
(
model
)
>
0
;
bool
flag
=
order_GuestRepository
.
Insert
(
model
)
>
0
;
if
(
flag
)
{
//更新学生的状态
...
...
@@ -793,7 +906,17 @@ namespace Edu.Module.Course
//写日志
studentRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Student_ViewModel
.
StuId
),
model
.
StudentId
));
classLogRepository
.
AddClassLogRepository
(
Common
.
Enum
.
Course
.
ClassLogTypeEnum
.
AddStudent
,
CreateName
+
"邀请 "
+
model
.
GuestName
+
" 加入班级"
,
model
.
ClassId
,
model
.
Group_Id
,
model
.
School_Id
,
model
.
CreateBy
);
var
classLogModel
=
new
Model
.
Entity
.
Log
.
RB_Class_Log
()
{
LogType
=
Common
.
Enum
.
Course
.
ClassLogTypeEnum
.
AddStudent
,
LogContent
=
CreateName
+
"邀请 "
+
model
.
GuestName
+
" 加入班级"
,
ClassId
=
model
.
ClassId
,
Group_Id
=
model
.
Group_Id
,
School_Id
=
model
.
School_Id
,
CreateBy
=
model
.
CreateBy
,
CreateTime
=
System
.
DateTime
.
Now
};
classLogRepository
.
AddClassLogRepository
(
classLogModel
);
}
return
flag
;
}
...
...
@@ -808,14 +931,11 @@ namespace Edu.Module.Course
[
TransactionCallHandler
]
public
bool
AddClassCheckModule
(
List
<
RB_Class_Check_ViewModel
>
list
)
{
bool
flag
=
false
;
//写日志
flag
=
classCheckRepository
.
InsertBatch
(
list
);
bool
flag
=
classCheckRepository
.
InsertBatch
(
list
);
return
flag
;
}
/// <summary>
/// 获取班级上课记录
/// </summary>
...
...
Edu.Module.Course/TeachingRewardsModule.cs
View file @
88cd1d5b
...
...
@@ -282,7 +282,7 @@ namespace Edu.Module.Course
var
dlist
=
teaching_BonusDetailRepository
.
GetList
(
new
RB_Teaching_BonusDetail_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
BonusIds
=
bonusIds
});
//获取所有的教师
string
teacherIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
TeacherIds
));
var
tlist
=
teacherRepository
.
GetTeacherListRepository
(
new
RB_Teacher_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
Teacher
Ids
=
teacherIds
});
var
tlist
=
teacherRepository
.
GetTeacherListRepository
(
new
RB_Teacher_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
QT
Ids
=
teacherIds
});
foreach
(
var
item
in
list
)
{
...
...
Edu.Module.System/MenuModule.cs
View file @
88cd1d5b
...
...
@@ -149,7 +149,7 @@ namespace Edu.Module.System
/// <returns></returns>
public
List
<
MenuTree_ViewModel
>
GetTreeMenuModule
(
RB_Menu_ViewModel
query
,
int
roleId
=
0
)
{
List
<
RB_Menu_ViewModel
>
list
=
new
List
<
RB_Menu_ViewModel
>()
;
List
<
RB_Menu_ViewModel
>
list
;
if
(
roleId
<=
0
)
{
list
=
GetMenuListModule
(
query
);
...
...
@@ -251,6 +251,27 @@ namespace Edu.Module.System
return
functionRepository
.
GetMenuFunctionListRepository
(
query
);
}
/// <summary>
/// 根据岗位编号获取岗位角色菜单功能权限
/// </summary>
/// <param name="postIds">岗位编号</param>
/// <returns></returns>
public
List
<
RB_Menu_Function_ViewModel
>
GetPostMenuFunctionListModule
(
string
postIds
)
{
return
functionRepository
.
GetPostMenuFunctionListRepository
(
postIds
);
}
/// <summary>
/// 判断用户是否有某项功能权限
/// </summary>
/// <param name="actionCode">权限编码</param>
/// <param name="postIds">岗位编号【可以多个】</param>
/// <returns></returns>
public
bool
CheckUserFunctionModule
(
string
actionCode
,
string
postIds
)
{
return
functionRepository
.
CheckUserFunctionRepository
(
actionCode
,
postIds
);
}
/// <summary>
/// 新增修改菜单功能权限
/// </summary>
...
...
Edu.Module.User/AssistModule.cs
View file @
88cd1d5b
...
...
@@ -119,6 +119,10 @@ namespace Edu.Module.User
}
else
{
if
(
model
.
LeaveStatus
!=
LeaveStatusEnum
.
Departure
)
{
model
.
LeaveTime
=
null
;
}
fileds
.
Add
(
nameof
(
RB_Assist
.
IDCard
),
model
.
IDCard
);
fileds
.
Add
(
nameof
(
RB_Assist
.
Sex
),
model
.
Sex
);
fileds
.
Add
(
nameof
(
RB_Assist
.
EntryTime
),
model
.
EntryTime
);
...
...
@@ -203,7 +207,7 @@ namespace Edu.Module.User
/// <param name="model"></param>
/// <param name="isUpdateBasic">是否更新基础资料</param>
/// <returns></returns>
public
bool
SetAssistDeptModule
(
RB_Assist
model
,
bool
isUpdateBasic
=
false
)
public
bool
SetAssistDeptModule
(
RB_Assist
model
)
{
bool
flag
;
if
(
model
.
AId
>
0
)
...
...
@@ -211,21 +215,16 @@ namespace Edu.Module.User
var
oldModel
=
GetAssistModule
(
model
.
AId
);
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Assist
.
UpdateBy
),
model
.
UpdateBy
},
{
nameof
(
RB_Assist
.
UpdateTime
),
model
.
UpdateTime
},
{
nameof
(
RB_Assist
.
Dept_Id
),
model
.
Dept_Id
},
// {nameof(RB_Assist.Post_Id),model.Post_Id },
};
string
logContent
=
""
;
if
(
model
.
Dept_Id
!=
oldModel
.
Dept_Id
)
{
var
deptList
=
departmentRepository
.
GetDepartmentListRepository
(
new
RB_Department_ViewModel
()
{
QDeptIds
=
model
.
Dept_Id
+
","
+
oldModel
.
Dept_Id
});
logContent
+=
string
.
Format
(
",将部门由【{0}】修改为【{1}】。"
,
(
deptList
.
Where
(
qitem
=>
qitem
.
DeptId
==
oldModel
.
Dept_Id
)?.
FirstOrDefault
()?.
DeptName
??
""
),
(
deptList
.
Where
(
qitem
=>
qitem
.
DeptId
==
model
.
Dept_Id
)?.
FirstOrDefault
()?.
DeptName
??
""
));
}
if
(!
string
.
IsNullOrEmpty
(
logContent
))
{
//新增日志
...
...
@@ -249,7 +248,7 @@ namespace Edu.Module.User
/// <param name="model"></param>
/// <param name="isUpdateBasic">是否更新基础资料</param>
/// <returns></returns>
public
bool
SetAssistPostModule
(
RB_Assist
model
,
bool
isUpdateBasic
=
false
)
public
bool
SetAssistPostModule
(
RB_Assist
model
)
{
bool
flag
;
if
(
model
.
AId
>
0
)
...
...
@@ -261,15 +260,12 @@ namespace Edu.Module.User
{
nameof
(
RB_Assist
.
UpdateTime
),
model
.
UpdateTime
},
{
nameof
(
RB_Assist
.
Post_Id
),
model
.
Post_Id
},
};
string
logContent
=
""
;
if
(
model
.
Post_Id
!=
oldModel
.
Post_Id
)
{
var
postList
=
postRepository
.
GetPostListRepository
(
new
RB_Post_ViewModel
()
{
QPostIds
=
model
.
Post_Id
+
","
+
oldModel
.
Post_Id
});
logContent
+=
string
.
Format
(
",将岗位由【{0}】修改为【{1}】。"
,
(
postList
.
Where
(
qitem
=>
qitem
.
PostId
==
oldModel
.
Post_Id
)?.
FirstOrDefault
()?.
PostName
??
""
),
(
postList
.
Where
(
qitem
=>
qitem
.
PostId
==
model
.
Post_Id
)?.
FirstOrDefault
()?.
PostName
??
""
));
}
if
(!
string
.
IsNullOrEmpty
(
logContent
))
{
//新增日志
...
...
@@ -291,9 +287,8 @@ namespace Edu.Module.User
/// 添加修改助教离职时间
/// </summary>
/// <param name="model"></param>
/// <param name="isUpdateBasic">是否更新基础资料</param>
/// <returns></returns>
public
bool
SetAssistLeaveTimeModule
(
RB_Assist
model
,
bool
isUpdateBasic
=
false
)
public
bool
SetAssistLeaveTimeModule
(
RB_Assist
model
)
{
bool
flag
;
if
(
model
.
AId
>
0
)
...
...
@@ -307,9 +302,7 @@ namespace Edu.Module.User
{
nameof
(
RB_Assist
.
UpdateTime
),
model
.
UpdateTime
},
};
string
logContent
=
""
;
if
(
model
.
LeaveStatus
!=
oldModel
.
LeaveStatus
)
{
logContent
+=
string
.
Format
(
",将在职状态由【{0}】修改为【{1}】。"
,
oldModel
.
LeaveStatus
.
ToName
(),
model
.
LeaveStatus
.
ToName
());
...
...
@@ -318,7 +311,6 @@ namespace Edu.Module.User
{
logContent
+=
string
.
Format
(
",将离职时间由【{0}】修改为【{1}】。"
,
oldModel
?.
LeaveTime
,
model
.
LeaveTime
);
}
if
(!
string
.
IsNullOrEmpty
(
logContent
))
{
//新增日志
...
...
Edu.Module.User/TeacherModule.cs
View file @
88cd1d5b
...
...
@@ -125,6 +125,10 @@ namespace Edu.Module.User
}
else
{
if
(
model
.
LeaveStatus
!=
LeaveStatusEnum
.
Departure
)
{
model
.
LeaveTime
=
null
;
}
fileds
.
Add
(
nameof
(
RB_Teacher_ViewModel
.
IDCard
),
model
.
IDCard
);
fileds
.
Add
(
nameof
(
RB_Teacher_ViewModel
.
Sex
),
model
.
Sex
);
fileds
.
Add
(
nameof
(
RB_Teacher_ViewModel
.
EntryTime
),
model
.
EntryTime
);
...
...
@@ -201,9 +205,8 @@ namespace Edu.Module.User
/// 新增修改讲师
/// </summary>
/// <param name="model"></param>
/// <param name="isUpdateBasic">是否更新基础资料</param>
/// <returns></returns>
public
bool
SetTeacherDeptModule
(
RB_Teacher_ViewModel
model
,
bool
isUpdateBasic
=
false
)
public
bool
SetTeacherDeptModule
(
RB_Teacher_ViewModel
model
)
{
bool
flag
;
if
(
model
.
TId
>
0
)
...
...
@@ -211,7 +214,6 @@ namespace Edu.Module.User
var
oldModel
=
GetTeacherModule
(
model
.
TId
);
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Teacher_ViewModel
.
UpdateBy
),
model
.
UpdateBy
},
{
nameof
(
RB_Teacher_ViewModel
.
UpdateTime
),
model
.
UpdateTime
},
{
nameof
(
RB_Teacher_ViewModel
.
Dept_Id
),
model
.
Dept_Id
},
...
...
@@ -223,7 +225,6 @@ namespace Edu.Module.User
var
deptList
=
departmentRepository
.
GetDepartmentListRepository
(
new
RB_Department_ViewModel
()
{
QDeptIds
=
model
.
Dept_Id
+
","
+
oldModel
.
Dept_Id
});
logContent
+=
string
.
Format
(
",将部门由【{0}】修改为【{1}】。"
,
(
deptList
.
Where
(
qitem
=>
qitem
.
DeptId
==
oldModel
.
Dept_Id
)?.
FirstOrDefault
()?.
DeptName
??
""
),
(
deptList
.
Where
(
qitem
=>
qitem
.
DeptId
==
model
.
Dept_Id
)?.
FirstOrDefault
()?.
DeptName
??
""
));
}
if
(!
string
.
IsNullOrEmpty
(
logContent
))
{
//新增日志
...
...
@@ -245,9 +246,8 @@ namespace Edu.Module.User
/// 新增修改讲师
/// </summary>
/// <param name="model"></param>
/// <param name="isUpdateBasic">是否更新基础资料</param>
/// <returns></returns>
public
bool
SetTeacherPostModule
(
RB_Teacher_ViewModel
model
,
bool
isUpdateBasic
=
false
)
public
bool
SetTeacherPostModule
(
RB_Teacher_ViewModel
model
)
{
bool
flag
;
if
(
model
.
TId
>
0
)
...
...
@@ -255,20 +255,16 @@ namespace Edu.Module.User
var
oldModel
=
GetTeacherModule
(
model
.
TId
);
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Teacher_ViewModel
.
UpdateBy
),
model
.
UpdateBy
},
{
nameof
(
RB_Teacher_ViewModel
.
UpdateTime
),
model
.
UpdateTime
},
{
nameof
(
RB_Teacher_ViewModel
.
Post_Id
),
model
.
Post_Id
},
};
string
logContent
=
""
;
if
(
model
.
Post_Id
!=
oldModel
.
Post_Id
)
{
var
postList
=
postRepository
.
GetPostListRepository
(
new
RB_Post_ViewModel
()
{
QPostIds
=
model
.
Post_Id
+
","
+
oldModel
.
Post_Id
});
logContent
+=
string
.
Format
(
",将岗位由【{0}】修改为【{1}】。"
,
(
postList
.
Where
(
qitem
=>
qitem
.
PostId
==
oldModel
.
Post_Id
)?.
FirstOrDefault
()?.
PostName
??
""
),
(
postList
.
Where
(
qitem
=>
qitem
.
PostId
==
model
.
Post_Id
)?.
FirstOrDefault
()?.
PostName
??
""
));
}
if
(!
string
.
IsNullOrEmpty
(
logContent
))
{
//新增日志
...
...
@@ -290,9 +286,8 @@ namespace Edu.Module.User
/// 新增修改讲师
/// </summary>
/// <param name="model"></param>
/// <param name="isUpdateBasic">是否更新基础资料</param>
/// <returns></returns>
public
bool
SetTeacherLeaveTimeModule
(
RB_Teacher_ViewModel
model
,
bool
isUpdateBasic
=
false
)
public
bool
SetTeacherLeaveTimeModule
(
RB_Teacher_ViewModel
model
)
{
bool
flag
;
if
(
model
.
TId
>
0
)
...
...
@@ -300,13 +295,11 @@ namespace Edu.Module.User
var
oldModel
=
GetTeacherModule
(
model
.
TId
);
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Teacher_ViewModel
.
UpdateBy
),
model
.
UpdateBy
},
{
nameof
(
RB_Teacher_ViewModel
.
UpdateTime
),
model
.
UpdateTime
},
{
nameof
(
RB_Teacher_ViewModel
.
LeaveStatus
),
model
.
LeaveStatus
},
{
nameof
(
RB_Teacher_ViewModel
.
LeaveTime
),
model
.
LeaveTime
}
};
string
logContent
=
""
;
if
(
model
.
LeaveStatus
!=
oldModel
.
LeaveStatus
)
{
...
...
Edu.Repository/Course/RB_Class_RoomRepository.cs
View file @
88cd1d5b
...
...
@@ -82,6 +82,10 @@ WHERE 1=1
builder
.
AppendFormat
(
" AND A.{0} LIKE @RoomName "
,
nameof
(
RB_Class_Room_ViewModel
.
RoomName
));
parameters
.
Add
(
"RoomName"
,
"%"
+
query
.
RoomName
.
Trim
()
+
"%"
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QRoomIds
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Class_Room_ViewModel
.
RoomId
),
query
.
QRoomIds
);
}
}
return
Get
<
RB_Class_Room_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
...
...
Edu.Repository/Log/RB_Class_LogRepository.cs
View file @
88cd1d5b
using
Edu.Common.Enum.Course
;
using
Edu.Model.Entity.Log
;
using
Edu.Model.ViewModel.Course
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
...
...
@@ -56,16 +57,17 @@ WHERE 1=1
/// <param name="School_Id">校区编号</param>
/// <param name="CreateBy">创建人</param>
/// <returns></returns>
public
bool
AddClassLogRepository
(
ClassLogTypeEnum
logType
,
string
LogContent
,
int
ClassId
,
int
Group_Id
,
int
School_Id
,
int
CreateBy
)
public
bool
AddClassLogRepository
(
RB_Class_Log
model
)
{
var
model
=
new
RB_Class_Log
()
var
new
model
=
new
RB_Class_Log
()
{
LogType
=
logType
,
LogContent
=
LogContent
,
ClassId
=
ClassId
,
Group_Id
=
Group_Id
,
School_Id
=
School_Id
,
CreateBy
=
CreateBy
LogType
=
model
.
LogType
,
LogContent
=
model
.
LogContent
.
TrimStart
(
','
).
TrimEnd
(
','
).
TrimStart
(
'、'
).
TrimEnd
(
'、'
),
ClassId
=
model
.
ClassId
,
Group_Id
=
model
.
Group_Id
,
School_Id
=
model
.
School_Id
,
CreateBy
=
model
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
};
return
base
.
Insert
(
model
)
>
0
;
}
...
...
Edu.Repository/System/RB_Menu_FunctionRepository.cs
View file @
88cd1d5b
using
Edu.Common.Enum
;
using
Edu.Model.Entity.System
;
using
Edu.Model.ViewModel.System
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
...
...
@@ -78,5 +79,44 @@ WHERE 1=1
return
new
List
<
RB_Menu_Function_ViewModel
>();
}
}
/// <summary>
/// 根据岗位编号获取岗位角色菜单功能权限
/// </summary>
/// <param name="postIds">岗位编号</param>
/// <returns></returns>
public
List
<
RB_Menu_Function_ViewModel
>
GetPostMenuFunctionListRepository
(
string
postIds
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*,IFNULL(B.MenuName,'') AS MenuName,IFNULL(B.MenuUrl,'') AS MenuUrl
FROM RB_Menu_Function AS A LEFT JOIN rb_menu AS B ON A.MenuId=B.MenuId
WHERE 1=1 AND A.Id IN(SELECT Action_Id FROM rb_role_functionpermission WHERE Role_Id IN (SELECT RoleId FROM rb_post_role WHERE PostId IN({0})))
"
,
postIds
);
return
Get
<
RB_Menu_Function_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 判断用户是否有某项功能权限
/// </summary>
/// <param name="actionCode">权限编码</param>
/// <param name="postIds">岗位编号【可以多个】</param>
/// <returns></returns>
public
bool
CheckUserFunctionRepository
(
string
actionCode
,
string
postIds
)
{
int
result
=
0
;
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT 1
FROM RB_Menu_Function AS A
WHERE 1=1 AND A.FunctionCode='{0}' AND A.Id IN(SELECT Action_Id FROM rb_role_functionpermission WHERE Role_Id IN (SELECT RoleId FROM rb_post_role WHERE PostId IN({1})))
"
,
actionCode
.
Trim
(),
postIds
);
var
obj
=
base
.
ExecuteScalar
(
builder
.
ToString
());
if
(
obj
!=
null
)
{
Int32
.
TryParse
(
obj
.
ToString
(),
out
result
);
}
return
result
>
0
;
}
}
}
\ No newline at end of file
Edu.Repository/User/RB_AccountRepository.cs
View file @
88cd1d5b
...
...
@@ -215,10 +215,6 @@ FROM
{
where
.
AppendFormat
(
" AND A.{0}='{1}' "
,
nameof
(
Employee_ViewModel
.
Account
),
query
.
Account
.
Trim
());
}
//if (query.Id > 0)
//{
// where.AppendFormat(" AND A.{0}={1} ", nameof(Employee_ViewModel.Id), query.Id);
//}
if
(!
string
.
IsNullOrEmpty
(
query
.
QIds
))
{
where
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
Employee_ViewModel
.
Id
),
query
.
QIds
);
...
...
@@ -270,11 +266,11 @@ FROM
}
if
(!
string
.
IsNullOrEmpty
(
query
.
StartLeaveTime
))
{
where
.
AppendFormat
(
" AND b.{0}>='{1}' "
,
nameof
(
Employee_ViewModel
.
LeaveTime
),
query
.
StartLeaveTime
);
where
.
AppendFormat
(
" AND
B.LeaveStatus=4 AND
b.{0}>='{1}' "
,
nameof
(
Employee_ViewModel
.
LeaveTime
),
query
.
StartLeaveTime
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
EndLeaveTime
))
{
where
.
AppendFormat
(
" AND b.{0}<='{1} 23:59:59' "
,
nameof
(
Employee_ViewModel
.
LeaveTime
),
query
.
EndLeaveTime
);
where
.
AppendFormat
(
" AND
B.LeaveStatus=4 AND
b.{0}<='{1} 23:59:59' "
,
nameof
(
Employee_ViewModel
.
LeaveTime
),
query
.
EndLeaveTime
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
StartBirthDate
))
{
...
...
Edu.Repository/User/RB_TeacherRepository.cs
View file @
88cd1d5b
...
...
@@ -69,9 +69,9 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Teacher_ViewModel
.
TId
),
query
.
TId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
Teacher
Ids
))
if
(!
string
.
IsNullOrEmpty
(
query
.
QT
Ids
))
{
builder
.
AppendFormat
(
" AND t.{0}
in({1}) "
,
nameof
(
RB_Teacher_ViewModel
.
TId
),
query
.
Teacher
Ids
);
builder
.
AppendFormat
(
" AND t.{0}
IN({1}) "
,
nameof
(
RB_Teacher_ViewModel
.
TId
),
query
.
QT
Ids
);
}
}
return
Get
<
RB_Teacher_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
...
...
Edu.WebApi/Controllers/BaseController.cs
View file @
88cd1d5b
...
...
@@ -8,6 +8,7 @@ using Newtonsoft.Json;
using
Newtonsoft.Json.Linq
;
using
Edu.Model.CacheModel
;
using
Edu.Cache.User
;
using
Edu.Module.System
;
namespace
Edu.WebApi.Controllers
{
...
...
@@ -17,6 +18,10 @@ namespace Edu.WebApi.Controllers
[
EnableCors
(
"AllowCors"
)]
public
class
BaseController
:
ControllerBase
{
/// <summary>
/// 菜单处理类对象
/// </summary>
private
readonly
MenuModule
menuModule
=
new
MenuModule
();
/// <summary>
/// 整理前端传递的post参数
...
...
@@ -72,5 +77,20 @@ namespace Edu.WebApi.Controllers
return
userInfo
;
}
}
/// <summary>
/// 判断用户是否有功能权限
/// </summary>
/// <param name="actionCode">权限编码</param>
/// <returns></returns>
public
bool
CheckUserActionAuth
(
string
actionCode
)
{
bool
flag
=
false
;
if
(
this
.
UserInfo
!=
null
&&
this
.
UserInfo
.
PostId
>
0
)
{
flag
=
menuModule
.
CheckUserFunctionModule
(
actionCode
,
this
.
UserInfo
.
PostId
.
ToString
());
}
return
flag
;
}
}
}
\ No newline at end of file
Edu.WebApi/Controllers/Course/ClassController.cs
View file @
88cd1d5b
...
...
@@ -287,7 +287,7 @@ namespace Edu.WebApi.Controllers.Course
public
ApiResult
RemoveClassPlan
()
{
var
ClassPlanId
=
base
.
ParmJObj
.
GetInt
(
"ClassPlanId"
);
var
flag
=
classModule
.
RemoveClassPlanModule
(
ClassPlanId
);
var
flag
=
classModule
.
RemoveClassPlanModule
(
ClassPlanId
,
base
.
UserInfo
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
@@ -343,7 +343,7 @@ namespace Edu.WebApi.Controllers.Course
}
}
}
var
flag
=
classModule
.
SetClassPlanModule
(
extModel
);
var
flag
=
classModule
.
SetClassPlanModule
(
extModel
,
base
.
UserInfo
.
Id
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
@@ -359,7 +359,8 @@ namespace Edu.WebApi.Controllers.Course
public
ApiResult
GetClassStudent
()
{
var
classId
=
base
.
ParmJObj
.
GetInt
(
"ClassId"
);
var
data
=
classModule
.
GetClassStudentListModule
(
classId
);
var
schoolId
=
base
.
ParmJObj
.
GetInt
(
"School_Id"
);
var
data
=
classModule
.
GetClassStudentListModule
(
classId
,
schoolId
,
base
.
UserInfo
.
Group_Id
);
return
ApiResult
.
Success
(
data
:
data
);
}
...
...
@@ -395,11 +396,10 @@ namespace Edu.WebApi.Controllers.Course
}
}
}
var
orderGuestList
=
classModule
.
GetOrderGuest
(
new
RB_Order_Guest_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
School_Id
=
data
.
School_Id
,
ClassId
=
data
.
ClassId
});
var
checkLogList
=
classModule
.
GetClassCheckListRepository
(
new
RB_Class_Check_ViewModel
{
Group_Id
=
data
.
Group_Id
,
School_Id
=
data
.
School_Id
,
ClassId
=
data
.
ClassId
,
StartDate
=
data
.
ClassDate
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
EndDate
=
data
.
ClassDate
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
});
List
<
object
>
guestList
=
new
List
<
object
>();
foreach
(
var
item
in
orderGuestList
)
foreach
(
var
item
in
orderGuestList
.
Where
(
x
=>
x
.
GuestState
==
1
)
)
{
guestList
.
Add
(
new
{
...
...
@@ -411,10 +411,10 @@ namespace Edu.WebApi.Controllers.Course
CreateTimeStr
=
Common
.
ConvertHelper
.
FormatTime
(
item
.
CreateTime
),
item
.
Mobile
,
item
.
OrderId
,
IsCheck
=
(
checkLogList
!=
null
&&
checkLogList
.
Any
())
?
checkLogList
.
Where
(
x
=>
x
.
OrderGuestId
==
item
.
Id
).
FirstOrDefault
()?.
CheckStatus
??
-
1
:
-
1
IsCheck
=
(
checkLogList
!=
null
&&
checkLogList
.
Any
())
?
checkLogList
.
Where
(
x
=>
x
.
OrderGuestId
==
item
.
Id
).
FirstOrDefault
()?.
CheckStatus
??
-
1
:
-
1
});
}
return
ApiResult
.
Success
(
data
:
new
{
data
.
TeacherName
,
data
.
RoomName
,
TotalHour
=
Convert
.
ToInt32
(
totalMinutes
/
60
),
ClassNum
=
Convert
.
ToInt32
(
totalMinutes
/
45
),
ClassDate
=
data
.
ClassDate
.
ToString
(
"yyyy-MM-dd"
),
GuestList
=
guestList
});
return
ApiResult
.
Success
(
data
:
new
{
data
.
TeacherName
,
data
.
RoomName
,
TotalHour
=
Convert
.
ToInt32
(
totalMinutes
/
60
),
ClassNum
=
Convert
.
ToInt32
(
totalMinutes
/
45
),
ClassDate
=
data
.
ClassDate
.
ToString
(
"yyyy-MM-dd"
),
GuestList
=
guestList
});
}
/// <summary>
...
...
@@ -437,7 +437,7 @@ namespace Edu.WebApi.Controllers.Course
return
ApiResult
.
Failed
(
"班级信息不存在"
);
}
bool
result
=
classModule
.
UpdateClassStudentDropOutModule
(
ids
,
dropOutRemark
,
classId
,
base
.
UserInfo
.
Id
,
classModel
.
Group_Id
,
classModel
.
School_Id
,
studentName
);
return
ApiResult
.
Success
();
return
result
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
@@ -459,8 +459,9 @@ namespace Edu.WebApi.Controllers.Course
model
.
UpdateBy
=
base
.
UserInfo
.
Id
;
model
.
CreateTime
=
System
.
DateTime
.
Now
;
model
.
UpdateTime
=
model
.
CreateTime
;
model
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
bool
result
=
classModule
.
AddClassStudentDropOutModule
(
model
,
base
.
UserInfo
.
AccountName
);
return
ApiResult
.
Success
();
return
result
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 获取教室页列表
...
...
@@ -553,6 +554,45 @@ namespace Edu.WebApi.Controllers.Course
return
result
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
(
"签到失败"
);
}
/// <summary>
/// 获取班级日志
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetClassLogPageList
()
{
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Class_Log_ViewModel
()
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
School_Id
=
base
.
ParmJObj
.
GetInt
(
"School_Id"
),
ClassId
=
base
.
ParmJObj
.
GetInt
(
"ClassId"
),
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
var
list
=
classModule
.
GetClassLogPageListRepository
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
foreach
(
var
item
in
list
)
{
if
(
item
.
CreateBy
>
0
)
{
item
.
CreateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
AccountName
??
""
;
}
}
var
resultList
=
list
.
Select
(
x
=>
new
{
LogTypeStr
=
EnumHelper
.
ToName
(
x
.
LogType
),
x
.
LogContent
,
CreateYear
=
x
.
CreateTime
.
ToString
(
"yyyy"
),
CreateMonth
=
x
.
CreateTime
.
ToString
(
"MM"
),
CreateDay
=
x
.
CreateTime
.
ToString
(
"dd"
),
CreatHour
=
x
.
CreateTime
.
ToString
(
"HH:mm:ss"
),
x
.
CreateByName
});
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
resultList
;
return
ApiResult
.
Success
(
data
:
pageModel
);
}
#
endregion
#
region
获取学员信息
...
...
Edu.WebApi/Controllers/User/LoginController.cs
View file @
88cd1d5b
...
...
@@ -91,6 +91,8 @@ namespace Edu.WebApi.Controllers.User
{
MenuType
=
accountType
},
postIds
:
model
.
Post_Id
.
ToString
());
//获取功能权限列表
var
actionList
=
menuModule
.
GetPostMenuFunctionListModule
(
model
.
Post_Id
.
ToString
());
UserInfo
obj
=
new
UserInfo
{
Id
=
model
.
Id
,
...
...
@@ -110,6 +112,7 @@ namespace Edu.WebApi.Controllers.User
DeptName
=
model
.
DeptName
,
PostId
=
model
.
Post_Id
,
PostName
=
model
.
PostName
,
ActionMenuList
=
actionList
?.
Select
(
qitem
=>
new
{
qitem
.
FunctionCode
,
qitem
.
FunctionName
,
qitem
.
MenuName
,
qitem
.
MenuUrl
}),
};
UserReidsCache
.
UserInfoSet
(
Cache
.
CacheKey
.
User_Login_Key
+
model
.
Id
,
obj
,
Common
.
Config
.
JwtExpirTime
);
return
ApiResult
.
Success
(
data
:
obj
);
...
...
@@ -143,6 +146,9 @@ namespace Edu.WebApi.Controllers.User
MenuType
=
(
int
)
userInfo
.
AccountType
},
userInfo
.
PostId
.
ToString
());
userInfo
.
MenuList
=
treeList
;
//获取功能权限列表
var
actionList
=
menuModule
.
GetPostMenuFunctionListModule
(
userInfo
.
PostId
.
ToString
());
userInfo
.
ActionMenuList
=
actionList
?.
Select
(
qitem
=>
new
{
qitem
.
FunctionCode
,
qitem
.
FunctionName
,
qitem
.
MenuName
,
qitem
.
MenuUrl
});
}
return
ApiResult
.
Success
(
data
:
userInfo
);
}
...
...
Edu.WebApi/Controllers/User/UserController.cs
View file @
88cd1d5b
...
...
@@ -671,7 +671,6 @@ namespace Edu.WebApi.Controllers.User
pageModel
.
PageData
=
list
.
Select
((
qitem
,
i
)
=>
new
{
Id
=
(
pageModel
.
PageSize
*
(
pageModel
.
PageIndex
-
1
))
+
i
+
1
,
// qitem.Id,
qitem
.
UserIcon
,
qitem
.
EmployeeName
,
qitem
.
SchoolName
,
...
...
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