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
68dfe2ac
Commit
68dfe2ac
authored
Dec 11, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增日志
parent
b7f2193e
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
89 additions
and
9 deletions
+89
-9
ClassLogTypeEnum.cs
Edu.Common/Enum/Course/ClassLogTypeEnum.cs
+0
-1
RB_Class_Room_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Class_Room_ViewModel.cs
+5
-0
RB_Teacher_ViewModel.cs
Edu.Model/ViewModel/User/RB_Teacher_ViewModel.cs
+5
-0
ClassModule.cs
Edu.Module.Course/ClassModule.cs
+65
-4
RB_Class_RoomRepository.cs
Edu.Repository/Course/RB_Class_RoomRepository.cs
+4
-0
RB_Class_LogRepository.cs
Edu.Repository/Log/RB_Class_LogRepository.cs
+4
-2
RB_TeacherRepository.cs
Edu.Repository/User/RB_TeacherRepository.cs
+4
-0
ClassController.cs
Edu.WebApi/Controllers/Course/ClassController.cs
+2
-2
No files found.
Edu.Common/Enum/Course/ClassLogTypeEnum.cs
View file @
68dfe2ac
...
...
@@ -25,7 +25,6 @@ namespace Edu.Common.Enum.Course
/// </summary>
[
EnumField
(
"上课记录"
)]
Class
=
3
,
/// <summary>
/// 创建班级
/// </summary>
...
...
Edu.Model/ViewModel/Course/RB_Class_Room_ViewModel.cs
View file @
68dfe2ac
...
...
@@ -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/User/RB_Teacher_ViewModel.cs
View file @
68dfe2ac
...
...
@@ -74,5 +74,10 @@ namespace Edu.Model.ViewModel.User
/// 岗位名称
/// </summary>
public
string
PostName
{
get
;
set
;
}
/// <summary>
/// 教师编号
/// </summary>
public
string
QTIds
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Module.Course/ClassModule.cs
View file @
68dfe2ac
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>
...
...
@@ -174,7 +187,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
));
}
...
...
@@ -288,6 +300,7 @@ namespace Edu.Module.Course
}
}
#
endregion
return
flag
;
}
...
...
@@ -520,7 +533,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
);
...
...
@@ -588,9 +600,12 @@ 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
(
Common
.
Enum
.
Course
.
ClassLogTypeEnum
.
Class
,
"删除【"
+
Common
.
ConvertHelper
.
FormatDate
(
planModel
?.
ClassDate
)
+
"】上课计划"
,
ClassPlanId
,
UserInfo
.
Group_Id
,
UserInfo
.
School_Id
,
UserInfo
.
Id
);
return
class_PlanRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Class_Plan_ViewModel
.
ClassPlanId
),
ClassPlanId
));
}
...
...
@@ -617,18 +632,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 +678,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 +713,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 +725,31 @@ 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
(
Common
.
Enum
.
Course
.
ClassLogTypeEnum
.
Class
,
logContent
,
extModel
.
ClassPlanId
,
extModel
.
Group_Id
,
extModel
.
School_Id
,
createBy
);
}
return
flag
;
}
...
...
Edu.Repository/Course/RB_Class_RoomRepository.cs
View file @
68dfe2ac
...
...
@@ -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 @
68dfe2ac
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
;
...
...
@@ -61,11 +62,12 @@ WHERE 1=1
var
model
=
new
RB_Class_Log
()
{
LogType
=
logType
,
LogContent
=
LogContent
,
LogContent
=
LogContent
.
TrimStart
(
','
).
TrimEnd
(
','
).
TrimStart
(
'、'
).
TrimEnd
(
'、'
)
,
ClassId
=
ClassId
,
Group_Id
=
Group_Id
,
School_Id
=
School_Id
,
CreateBy
=
CreateBy
CreateBy
=
CreateBy
,
CreateTime
=
DateTime
.
Now
,
};
return
base
.
Insert
(
model
)
>
0
;
}
...
...
Edu.Repository/User/RB_TeacherRepository.cs
View file @
68dfe2ac
...
...
@@ -69,6 +69,10 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Teacher_ViewModel
.
TId
),
query
.
TId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QTIds
))
{
builder
.
AppendFormat
(
" AND t.{0} IN({1}) "
,
nameof
(
RB_Teacher_ViewModel
.
TId
),
query
.
QTIds
);
}
}
return
Get
<
RB_Teacher_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
...
...
Edu.WebApi/Controllers/Course/ClassController.cs
View file @
68dfe2ac
...
...
@@ -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
();
}
...
...
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