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
570250cb
Commit
570250cb
authored
Jul 21, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
59416faf
13c46c86
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
929 additions
and
32 deletions
+929
-32
GuestClassHoursEarlyWarningEnum.cs
Edu.Common/Enum/Course/GuestClassHoursEarlyWarningEnum.cs
+39
-0
RB_Student_EventLog.cs
Edu.Model/Entity/User/RB_Student_EventLog.cs
+87
-0
RB_Order_Guest_Extend.cs
Edu.Model/ViewModel/Course/RB_Order_Guest_Extend.cs
+174
-0
RB_Student_EventLog_ViewModel.cs
Edu.Model/ViewModel/User/RB_Student_EventLog_ViewModel.cs
+29
-0
ClassModule.cs
Edu.Module.Course/ClassModule.cs
+80
-1
EducationContractModule.cs
Edu.Module.Course/EducationContractModule.cs
+1
-1
StudentBillModule.cs
Edu.Module.Course/StudentBillModule.cs
+20
-0
NoticeModule.cs
Edu.Module.User/NoticeModule.cs
+1
-1
RB_Order_GuestRepository.cs
Edu.Repository/Course/RB_Order_GuestRepository.cs
+114
-1
RB_Student_EventLogRepository.cs
Edu.Repository/User/RB_Student_EventLogRepository.cs
+97
-0
StuController.cs
Edu.WebApi/Controllers/Course/StuController.cs
+161
-26
TeacherClassController.cs
Edu.WebApi/Controllers/Course/TeacherClassController.cs
+126
-2
No files found.
Edu.Common/Enum/Course/GuestClassHoursEarlyWarningEnum.cs
0 → 100644
View file @
570250cb
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Edu.Common.Plugin
;
namespace
Edu.Common.Enum.Course
{
public
enum
GuestClassHoursEarlyWarningEnum
{
/// <summary>
/// 无
/// </summary>
[
EnumField
(
"无"
)]
All
=
0
,
/// <summary>
/// 不足5课时
/// </summary>
[
EnumField
(
"不足5课时"
)]
NotFive
=
1
,
/// <summary>
/// 不足10课时
/// </summary>
[
EnumField
(
"不足10课时"
)]
NotTen
=
2
,
/// <summary>
/// 不足15课时
/// </summary>
[
EnumField
(
"不足15课时"
)]
NotFifteen
=
3
,
/// <summary>
/// 不足20课时
/// </summary>
[
EnumField
(
"不足20课时"
)]
NotTwenty
=
4
,
}
}
Edu.Model/Entity/User/RB_Student_EventLog.cs
0 → 100644
View file @
570250cb
using
Edu.Common.Enum
;
using
System
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.User
{
/// <summary>
/// 学员事件记录实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Student_EventLog
{
/// <summary>
/// 主键事件编号
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// (学生编号)
/// </summary>
public
int
StuId
{
get
;
set
;
}
/// <summary>
/// 标题
/// </summary>
public
string
Title
{
get
;
set
;
}
/// <summary>
/// 类型(1-处分,2-奖励)
/// </summary>
public
int
EventType
{
get
;
set
;
}
/// <summary>
/// 内容
/// </summary>
public
string
EventContent
{
get
;
set
;
}
/// <summary>
/// 图片
/// </summary>
public
string
EventPic
{
get
;
set
;
}
/// <summary>
/// 集团编号
/// </summary>
public
int
Group_Id
{
get
;
set
;
}
/// <summary>
/// 学校编号
/// </summary>
public
int
School_Id
{
get
;
set
;
}
/// <summary>
/// 删除状态
/// </summary>
public
DateStateEnum
Status
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
CreateTime
{
get
;
set
;
}
/// <summary>
/// 修改人
/// </summary>
public
int
UpdateBy
{
get
;
set
;
}
/// <summary>
/// 更新时间
/// </summary>
public
DateTime
UpdateTime
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Course/RB_Order_Guest_Extend.cs
0 → 100644
View file @
570250cb
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Edu.Model.Entity.Course
;
namespace
Edu.Model.ViewModel.Course
{
/// <summary>
/// 学员名单扩展表
/// </summary>
public
class
RB_Order_Guest_Extend
:
RB_Order_Guest
{
/// <summary>
/// 合同编号
/// </summary>
public
string
ContractNo
{
get
;
set
;
}
/// <summary>
/// 合同id
/// </summary>
public
int
ContractId
{
get
;
set
;
}
/// <summary>
/// 课程id
/// </summary>
public
int
CourseId
{
get
;
set
;
}
/// <summary>
/// 课程名称
/// </summary>
public
string
CourseName
{
get
;
set
;
}
/// <summary>
/// 班级名称
/// </summary>
public
string
ClassName
{
get
;
set
;
}
/// <summary>
/// 班号
/// </summary>
public
string
ClassNo
{
get
;
set
;
}
/// <summary>
/// 老师id
/// </summary>
public
int
Teacher_Id
{
get
;
set
;
}
/// <summary>
/// 老师名称
/// </summary>
public
string
TeacherName
{
get
;
set
;
}
/// <summary>
///下单时间
/// </summary>
public
DateTime
?
OrderTime
{
get
;
set
;
}
/// <summary>
///结束下单时间
/// </summary>
public
DateTime
?
EndOrderTime
{
get
;
set
;
}
/// <summary>
/// 业务员
/// </summary>
public
int
EnterID
{
get
;
set
;
}
/// <summary>
/// 业务员
/// </summary>
public
string
EnterName
{
get
;
set
;
}
/// <summary>
/// 应收金额
/// </summary>
public
decimal
PreferPrice
{
get
;
set
;
}
/// <summary>
/// 实收金额
/// </summary>
public
decimal
Income
{
get
;
set
;
}
/// <summary>
/// 退款金额
/// </summary>
public
decimal
Refund
{
get
;
set
;
}
/// <summary>
/// 平台税金
/// </summary>
public
decimal
PlatformTax
{
get
;
set
;
}
/// <summary>
/// 剩余课时
/// </summary>
public
int
SurplusHours
{
get
;
set
;
}
/// <summary>
/// 缺勤次数
/// </summary>
public
int
AbsenceNum
{
get
;
set
;
}
/// <summary>
/// 请假次数
/// </summary>
public
int
LeaveNum
{
get
;
set
;
}
/// <summary>
/// 事件数
/// </summary>
public
int
EventlogNum
{
get
;
set
;
}
/// <summary>
/// 是否生效 (查询对应:(0-全部 1-未生效,2-正常,3-休学,4-完课)) (生效状态(0-未生效,1-生效中,2-完成))
/// </summary>
public
int
?
EffectStatus
{
get
;
set
;
}
/// <summary>
/// 订单报入类型(查询的时候0-全部1-正常报入,2-插班报入,3-续费订单,4-转班订单,5-分拆订单)
/// </summary>
public
int
JoinType
{
get
;
set
;
}
/// <summary>
/// 学生id(rb_student 表中的id)
/// </summary>
public
int
Student_Id
{
get
;
set
;
}
/// <summary>
/// 预警类型(0-全部,1-不足5课时,)
/// </summary>
public
Common
.
Enum
.
Course
.
GuestClassHoursEarlyWarningEnum
EarlyWarning
{
get
;
set
;
}
/// <summary>
/// 学员状态
/// </summary>
public
string
GuestStateStr
{
get
{
string
str
=
""
;
switch
(
this
.
GuestState
)
{
case
1
:
str
=
"正常"
;
break
;
case
2
:
str
=
"退学"
;
break
;
case
3
:
str
=
"申请退学中"
;
break
;
case
4
:
str
=
"驳回申请"
;
break
;
case
5
:
str
=
"停课"
;
break
;
case
6
:
str
=
"停课申请中"
;
break
;
case
7
:
str
=
"完结"
;
break
;
case
8
:
str
=
"转班申请中"
;
break
;
}
return
str
;
}
}
/// <summary>
/// 学员状态
/// </summary>
public
string
JoinTypeStr
{
get
{
string
str
=
""
;
switch
(
this
.
JoinType
)
{
case
1
:
str
=
"正常报入"
;
break
;
case
2
:
str
=
"插班报入"
;
break
;
case
3
:
str
=
"续费订单"
;
break
;
case
4
:
str
=
"转班订单"
;
break
;
case
5
:
str
=
"分拆订单"
;
break
;
}
return
str
;
}
}
}
}
Edu.Model/ViewModel/User/RB_Student_EventLog_ViewModel.cs
0 → 100644
View file @
570250cb
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Edu.Model.Entity.User
;
namespace
Edu.Model.ViewModel.User
{
/// <summary>
/// 学员事件记录扩展实体
/// </summary>
public
class
RB_Student_EventLog_ViewModel
:
RB_Student_EventLog
{
/// <summary>
/// 事件图片
/// </summary>
public
List
<
string
>
EventPicList
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
string
CreateByName
{
get
;
set
;
}
/// <summary>
/// 更新人
/// </summary>
public
string
UpdateByName
{
get
;
set
;
}
}
}
Edu.Module.Course/ClassModule.cs
View file @
570250cb
...
...
@@ -154,6 +154,12 @@ namespace Edu.Module.Course
/// </summary>
private
readonly
RB_User_ChangeLogRepository
user_ChangeLogRepository
=
new
RB_User_ChangeLogRepository
();
/// <summary>
/// 学员事件记录仓储层
/// </summary>
private
readonly
RB_Student_EventLogRepository
student_EventLogRepository
=
new
RB_Student_EventLogRepository
();
/// <summary>
/// 获取班级列表
/// </summary>
...
...
@@ -3428,6 +3434,78 @@ namespace Edu.Module.Course
/// <summary>
/// 获取学员事件记录分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Student_EventLog_ViewModel
>
GetStudentEventLogPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Student_EventLog_ViewModel
query
)
{
return
student_EventLogRepository
.
GetStudentEventLogPageList
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
}
/// <summary>
///删除学员事件
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
DelStudentEventLog
(
int
Id
,
int
UpdateBy
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_EventLog_ViewModel
.
Status
),
1
},
{
nameof
(
RB_Student_EventLog_ViewModel
.
UpdateBy
),
UpdateBy
},
{
nameof
(
RB_Student_EventLog_ViewModel
.
UpdateTime
),
System
.
DateTime
.
Now
},
};
return
student_EventLogRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Student_EventLog_ViewModel
.
Id
),
Id
));
}
/// <summary>
/// 新增/修改学员事件
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetStudentEventLog
(
RB_Student_EventLog_ViewModel
model
)
{
bool
flag
=
false
;
if
(
model
.
Id
==
0
)
{
flag
=
student_EventLogRepository
.
Insert
(
model
)
>
0
;
}
else
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_EventLog_ViewModel
.
EventContent
),
model
.
EventContent
},
{
nameof
(
RB_Student_EventLog_ViewModel
.
EventType
),
model
.
EventType
},
{
nameof
(
RB_Student_EventLog_ViewModel
.
Title
),
model
.
Title
},
{
nameof
(
RB_Student_EventLog_ViewModel
.
EventPic
),
model
.
EventPic
},
};
flag
=
student_EventLogRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Student_EventLog_ViewModel
.
Id
),
model
.
Id
));
}
return
flag
;
}
/// <summary>
/// 获取学员事件记录列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Student_EventLog_ViewModel
>
GetStudentEventLogList
(
RB_Student_EventLog_ViewModel
query
)
{
return
student_EventLogRepository
.
GetStudentEventLogList
(
query
);
}
#
endregion
...
...
@@ -3468,5 +3546,6 @@ namespace Edu.Module.Course
}
#
endregion
}
}
}
Edu.Module.Course/EducationContractModule.cs
View file @
570250cb
...
...
@@ -90,7 +90,7 @@ namespace Edu.Module.Course
public
object
GetStudentInfoModule
(
int
OrderId
,
int
GuestId
)
{
var
obj
=
new
object
();
var
glist
=
order_GuestRepository
.
GetOrderGuestListRepository
(
new
RB_Order_Guest_ViewModel
()
{
OrderId
=
OrderId
,
GuestState
=
1
});
var
glist
=
order_GuestRepository
.
GetOrderGuestListRepository
(
new
RB_Order_Guest_ViewModel
()
{
OrderId
=
OrderId
});
var
orderModel
=
orderRepository
.
GetEntity
(
OrderId
);
var
guestModel
=
glist
.
Where
(
qitem
=>
qitem
.
Id
==
GuestId
)?.
FirstOrDefault
();
var
classModel
=
new
RB_Class_ViewModel
();
...
...
Edu.Module.Course/StudentBillModule.cs
View file @
570250cb
...
...
@@ -397,5 +397,25 @@ namespace Edu.Module.Course
}
#
endregion
#
region
学员名单
/// <summary>
/// 获取学员名单分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="demodel"></param>
/// <param name="orderIds"></param>
/// <returns></returns>
public
List
<
RB_Order_Guest_Extend
>
GetAllStudentPage
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Order_Guest_Extend
demodel
)
{
var
orderstudentList
=
order_GuestRepository
.
GetAllStudentPage
(
pageIndex
,
pageSize
,
out
rowsCount
,
demodel
);
return
orderstudentList
;
}
#
endregion
}
}
Edu.Module.User/NoticeModule.cs
View file @
570250cb
...
...
@@ -372,7 +372,7 @@ namespace Edu.Module.User
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Notice
.
NoticeState
),(
int
)
demodel
.
NoticeState
},
{
nameof
(
RB_Notice
.
UpdateBy
),
demodel
.
UpdateBy
},
//
{ nameof(RB_Notice.UpdateBy),demodel.UpdateBy},
{
nameof
(
RB_Notice
.
UpdateTime
),
DateTime
.
Now
},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
...
...
Edu.Repository/Course/RB_Order_GuestRepository.cs
View file @
570250cb
...
...
@@ -629,7 +629,120 @@ INNER JOIN rb_temporary_invitation as ti on ti.OrderGuestId=a.Id
WHERE
{
where
}
"
;
return
Get
<
RB_Order_Guest_ViewModel
>(
sql
).
ToList
();
}
#
endregion
#
endregion
#
region
学员名单
/// <summary>
/// 获取学员名单分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="demodel"></param>
/// <param name="orderIds"></param>
/// <returns></returns>
public
List
<
RB_Order_Guest_Extend
>
GetAllStudentPage
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Order_Guest_Extend
demodel
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT a.*,contract.ContractNo,contract.Id as ContractId,b.CourseId,IFNULL(C.CourseName,'') AS CourseName
,class.ClassName,class.ClassNo,class.Teacher_Id,teacher.TeacherName,b.CreateTime as OrderTime,b.EnterID,b.PreferPrice,b.Income,b.Refund,b.PlatformTax,
(a.TotalHours-a.CompleteHours) as SurplusHours,gc.AbsenceNum,gc.LeaveNum,eventlog.EventlogNum,b.EffectStatus,b.JoinType,sog.Student_Id
FROM RB_Order_Guest AS A LEFT JOIN rb_order AS B ON A.OrderId=B.OrderId
LEFT JOIN rb_education_contract as contract on contract.GuestId=a.Id and contract.`Status`=0
LEFT JOIN rb_student_orderguest as sog on sog.GuestId=a.Id and sog.`Status`=0
LEFT JOIN rb_class as class on class.ClassId=b.ClassId
LEFT JOIN rb_course AS C ON (B.CourseId=C.CourseId AND B.CourseId>0 AND B.OrderType=1)
LEFT JOIN rb_teacher as teacher on teacher.TId=class.Teacher_Id
LEFT JOIN (SELECT OrderGuestId,
SUM(CASE CheckStatus WHEN 1 THEN 1 ELSE 0 END) as AbsenceNum,
SUM(CASE CheckStatus WHEN 2 THEN 1 ELSE 0 END) as LeaveNum
from rb_class_check where `Status`=0 and CheckStatus <>0 GROUP BY OrderGuestId) as gc on gc.OrderGuestId=a.Id
LEFT JOIN (SELECT StuId,COUNT(*) as EventlogNum from rb_student_eventlog where `Status`=0 GROUP BY StuId) as eventlog on eventlog.StuId=sog.Student_Id
WHERE 1=1 and A.Status=0 and class.Status=0 and class.ClassStatus <>4 and b.OrderState<>3
"
);
if
(
demodel
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
$@" AND A.
{
nameof
(
RB_Order_Guest_Extend
.
Group_Id
)}
=
{
demodel
.
Group_Id
}
"
);
}
if
(
demodel
.
School_Id
>
0
)
{
builder
.
AppendFormat
(
$@" AND A.
{
nameof
(
RB_Order_Guest_Extend
.
School_Id
)}
=
{
demodel
.
School_Id
}
"
);
}
if
(
demodel
.
CourseId
>
0
)
{
builder
.
AppendFormat
(
$@" AND B.
{
nameof
(
RB_Order_Guest_Extend
.
CourseId
)}
=
{
demodel
.
CourseId
}
"
);
}
if
(
demodel
.
ClassId
>
0
)
{
builder
.
AppendFormat
(
$@" AND B.
{
nameof
(
RB_Order_Guest_Extend
.
ClassId
)}
=
{
demodel
.
ClassId
}
"
);
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
GuestName
))
{
builder
.
AppendFormat
(
$@" AND A.
{
nameof
(
RB_Order_Guest_Extend
.
GuestName
)}
like '%
{
demodel
.
GuestName
}
%'"
);
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
ClassNo
))
{
builder
.
AppendFormat
(
$@" AND class.
{
nameof
(
RB_Order_Guest_Extend
.
ClassNo
)}
like '%
{
demodel
.
ClassNo
}
%'"
);
}
if
(
demodel
.
OrderId
>
0
)
{
builder
.
AppendFormat
(
$@" AND A.
{
nameof
(
RB_Order_Guest_Extend
.
OrderId
)}
=
{
demodel
.
OrderId
}
"
);
}
if
(
demodel
.
EnterID
>
0
)
{
builder
.
AppendFormat
(
$@" AND B.
{
nameof
(
RB_Order_Guest_Extend
.
EnterID
)}
=
{
demodel
.
EnterID
}
"
);
}
if
(
demodel
.
OrderTime
.
HasValue
)
{
builder
.
AppendFormat
(
$@" AND DATE_FORMAT(B.CreateTime,'%y-%m-%d')>=DATE_FORMAT('
{
demodel
.
OrderTime
.
Value
.
ToString
(
"yyyy-MM-dd"
)}
','%y-%m-%d')"
);
}
if
(
demodel
.
EndOrderTime
.
HasValue
)
{
builder
.
AppendFormat
(
$@" AND DATE_FORMAT(B.CreateTime,'%y-%m-%d')<=DATE_FORMAT('
{
demodel
.
EndOrderTime
.
Value
.
ToString
(
"yyyy-MM-dd"
)}
','%y-%m-%d')"
);
}
if
(
demodel
.
EffectStatus
.
HasValue
)
{
if
(
demodel
.
EffectStatus
==
0
)
{
builder
.
AppendFormat
(
$@" AND B.
{
nameof
(
RB_Order_Guest_Extend
.
EffectStatus
)}
=0"
);
}
else
{
builder
.
AppendFormat
(
$@" AND B.
{
nameof
(
RB_Order_Guest_Extend
.
EffectStatus
)}
>0"
);
builder
.
AppendFormat
(
$@" AND A.
{
nameof
(
RB_Order_Guest_Extend
.
GuestState
)}
=
{
demodel
.
GuestState
}
"
);
}
}
if
(
demodel
.
JoinType
>
0
)
{
builder
.
AppendFormat
(
$@" AND B.
{
nameof
(
RB_Order_Guest_Extend
.
JoinType
)}
=
{
demodel
.
JoinType
}
"
);
}
if
(
demodel
.
EarlyWarning
==
Common
.
Enum
.
Course
.
GuestClassHoursEarlyWarningEnum
.
NotFifteen
)
{
builder
.
AppendFormat
(
$@" AND (a.TotalHours-a.CompleteHours) <15 "
);
}
else
if
(
demodel
.
EarlyWarning
==
Common
.
Enum
.
Course
.
GuestClassHoursEarlyWarningEnum
.
NotFive
)
{
builder
.
AppendFormat
(
$@" AND (a.TotalHours-a.CompleteHours) <5 "
);
}
else
if
(
demodel
.
EarlyWarning
==
Common
.
Enum
.
Course
.
GuestClassHoursEarlyWarningEnum
.
NotTen
)
{
builder
.
AppendFormat
(
$@" AND (a.TotalHours-a.CompleteHours) <10 "
);
}
else
if
(
demodel
.
EarlyWarning
==
Common
.
Enum
.
Course
.
GuestClassHoursEarlyWarningEnum
.
NotTwenty
)
{
builder
.
AppendFormat
(
$@" AND (a.TotalHours-a.CompleteHours) <20 "
);
}
builder
.
AppendFormat
(
$@" order by A.
{
nameof
(
RB_Order_Guest_Extend
.
Id
)}
desc"
);
return
GetPage
<
RB_Order_Guest_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
}
#
endregion
}
}
Edu.Repository/User/RB_Student_EventLogRepository.cs
0 → 100644
View file @
570250cb
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
Edu.Common.Enum
;
using
Edu.Model.Entity.User
;
using
Edu.Model.ViewModel.User
;
using
VT.FW.DB.Dapper
;
namespace
Edu.Repository.User
{
/// <summary>
/// 学员事件记录仓储层
/// </summary>
public
class
RB_Student_EventLogRepository
:
BaseRepository
<
RB_Student_EventLog
>
{
/// <summary>
/// 获取学员事件记录分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Student_EventLog_ViewModel
>
GetStudentEventLogPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Student_EventLog_ViewModel
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@" SELECT t.* FROM RB_Student_EventLog AS t WHERE 1=1 "
);
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_EventLog_ViewModel
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
if
(
query
!=
null
)
{
if
(
query
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_EventLog_ViewModel
.
Group_Id
),
query
.
Group_Id
);
}
if
(
query
.
School_Id
>
0
)
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_EventLog_ViewModel
.
School_Id
),
query
.
School_Id
);
}
if
(
query
.
StuId
>
0
)
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_EventLog_ViewModel
.
StuId
),
query
.
StuId
);
}
if
(
query
.
EventType
>
0
)
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_EventLog_ViewModel
.
EventType
),
query
.
EventType
);
}
}
return
GetPage
<
RB_Student_EventLog_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
/// <summary>
/// 获取学员事件记录列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Student_EventLog_ViewModel
>
GetStudentEventLogList
(
RB_Student_EventLog_ViewModel
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@" SELECT t.* FROM RB_Student_EventLog AS t WHERE 1=1 "
);
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_EventLog_ViewModel
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
if
(
query
!=
null
)
{
if
(
query
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_EventLog_ViewModel
.
Group_Id
),
query
.
Group_Id
);
}
if
(
query
.
School_Id
>
0
)
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_EventLog_ViewModel
.
School_Id
),
query
.
School_Id
);
}
if
(
query
.
StuId
>
0
)
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_EventLog_ViewModel
.
StuId
),
query
.
StuId
);
}
if
(
query
.
Id
>
0
)
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_EventLog_ViewModel
.
Id
),
query
.
Id
);
}
if
(
query
.
EventType
>
0
)
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_EventLog_ViewModel
.
EventType
),
query
.
EventType
);
}
}
return
Get
<
RB_Student_EventLog_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
}
}
Edu.WebApi/Controllers/Course/StuController.cs
View file @
570250cb
This diff is collapsed.
Click to expand it.
Edu.WebApi/Controllers/Course/TeacherClassController.cs
View file @
570250cb
...
...
@@ -7,6 +7,7 @@ using Edu.Common.API;
using
Edu.Common.Enum.Course
;
using
Edu.Common.Plugin
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Model.ViewModel.User
;
using
Edu.Module.Course
;
using
Edu.Module.Finance
;
using
Edu.WebApi.Filter
;
...
...
@@ -258,11 +259,12 @@ namespace Edu.WebApi.Controllers.Course
item
.
IsRenewOrder
,
item
.
RenewOrderId
,
item
.
JoinType
,
JoinTypeName
=
item
.
JoinType
.
ToName
(),
JoinTypeName
=
item
.
JoinType
.
ToName
(),
item
.
TargetJoinType
,
TargetJoinTypeName
=
item
.
TargetJoinType
.
ToName
(),
TargetJoinTypeName
=
item
.
TargetJoinType
.
ToName
(),
item
.
TargetOrderId
,
item
.
SourceOrderId
,
item
.
StudentId
});
}
pageModel
.
Count
=
rowsCount
;
...
...
@@ -271,6 +273,128 @@ namespace Edu.WebApi.Controllers.Course
}
#
region
学员事件记录
/// <summary>
/// 获取学员事件记录分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetStudentEventLogPageList
()
{
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Student_EventLog_ViewModel
()
{
StuId
=
base
.
ParmJObj
.
GetInt
(
"StuId"
),
EventType
=
base
.
ParmJObj
.
GetInt
(
"EventType"
)
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
List
<
object
>
result
=
new
List
<
object
>();
var
list
=
classModule
.
GetStudentEventLogPageList
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
foreach
(
var
item
in
list
)
{
if
(
item
.
CreateBy
>
0
)
{
item
.
CreateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
AccountName
??
""
;
}
if
(
item
.
UpdateBy
>
0
)
{
item
.
UpdateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
UpdateBy
)?.
AccountName
??
""
;
}
if
(!
string
.
IsNullOrWhiteSpace
(
item
.
EventPic
))
{
item
.
EventPicList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
string
>>(
item
.
EventPic
);
}
else
{
item
.
EventPicList
=
new
List
<
string
>();
}
result
.
Add
(
new
{
item
.
EventPicList
,
item
.
EventPic
,
item
.
Id
,
item
.
EventType
,
item
.
CreateByName
,
item
.
EventContent
,
item
.
Title
,
CreateTime
=
item
.
CreateTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
});
}
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
result
;
return
ApiResult
.
Success
(
data
:
pageModel
);
}
/// <summary>
/// 新增学员事件记录
/// </summary>
/// <returns></returns>
public
ApiResult
GetSetStudentEventLog
()
{
var
query
=
new
RB_Student_EventLog_ViewModel
()
{
StuId
=
base
.
ParmJObj
.
GetInt
(
"StuId"
),
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
),
School_Id
=
base
.
ParmJObj
.
GetInt
(
"School_Id"
),
EventType
=
base
.
ParmJObj
.
GetInt
(
"EventType"
),
EventContent
=
base
.
ParmJObj
.
GetStringValue
(
"EventContent"
),
Title
=
base
.
ParmJObj
.
GetStringValue
(
"Title"
),
};
try
{
query
.
EventPicList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
string
>>(
base
.
ParmJObj
.
GetStringValue
(
"EventPicList"
));
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"GetSetStudentEventLog"
);
}
if
(
query
.
EventPicList
!=
null
&&
query
.
EventPicList
.
Any
())
{
query
.
EventPic
=
Common
.
Plugin
.
JsonHelper
.
Serialize
(
query
.
EventPicList
);
}
else
{
query
.
EventPic
=
""
;
}
if
(
string
.
IsNullOrWhiteSpace
(
query
.
Title
))
{
return
ApiResult
.
Failed
(
"学员事件记录标题不能为空"
);
}
if
(
string
.
IsNullOrWhiteSpace
(
query
.
EventContent
))
{
return
ApiResult
.
Failed
(
"学员事件记录内容不能为空"
);
}
if
(
query
.
EventType
!=
1
&&
query
.
EventType
!=
2
)
{
return
ApiResult
.
Failed
(
"学员事件记录类型错误"
);
}
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
;
if
(
query
.
Id
==
0
)
{
query
.
CreateBy
=
base
.
UserInfo
.
Id
;
query
.
CreateTime
=
System
.
DateTime
.
Now
;
}
query
.
UpdateBy
=
base
.
UserInfo
.
Id
;
query
.
UpdateTime
=
System
.
DateTime
.
Now
;
var
result
=
classModule
.
SetStudentEventLog
(
query
);
return
result
?
ApiResult
.
Success
(
"添加学员事件记录成功"
)
:
ApiResult
.
Failed
(
"添加学员事件记录失败"
);
}
/// <summary>
/// 删除学员事件记录
/// </summary>
/// <returns></returns>
public
ApiResult
GetDelStudentEventLog
()
{
int
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
);
var
result
=
classModule
.
DelStudentEventLog
(
Id
,
base
.
UserInfo
.
Id
);
return
result
?
ApiResult
.
Success
(
"删除学员事件记录成功"
)
:
ApiResult
.
Failed
(
"删除学员事件记录失败"
);
}
#
endregion
/// <summary>
...
...
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