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
9f18c3ca
Commit
9f18c3ca
authored
Jun 07, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
abf73c7e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
347 additions
and
22 deletions
+347
-22
IStuCommentDetailsRepository.cs
EduSpider.IRepository/IStuCommentDetailsRepository.cs
+63
-0
IStuCommentRepository.cs
EduSpider.IRepository/IStuCommentRepository.cs
+1
-1
RB_Stu_CommentDetails.cs
EduSpider.Model/Entity/RB_Stu_CommentDetails.cs
+88
-0
RB_Stu_CommentDetails_Extend.cs
EduSpider.Model/Extend/RB_Stu_CommentDetails_Extend.cs
+20
-0
CourseQuery.cs
EduSpider.Model/Query/CourseQuery.cs
+2
-7
StuCommentDetailsRepository.cs
EduSpider.Repository/StuCommentDetailsRepository.cs
+161
-0
StuCommentRepository.cs
EduSpider.Repository/StuCommentRepository.cs
+8
-6
StuHomeWorkRepository.cs
EduSpider.Repository/StuHomeWorkRepository.cs
+2
-6
TeacherController.cs
EduSpider.WebApi/Controllers/Student/TeacherController.cs
+2
-2
No files found.
EduSpider.IRepository/IStuCommentDetailsRepository.cs
0 → 100644
View file @
9f18c3ca
using
EduSpider.Model.Entity
;
using
EduSpider.Model.Extend
;
using
EduSpider.Model.Query
;
using
System.Collections.Generic
;
using
VTX.FW.Config
;
using
VTX.FW.DB
;
namespace
EduSpider.IRepository
{
/// <summary>
/// 学生评论详情仓储接口
/// </summary>
public
interface
IStuCommentDetailsRepository
:
IDBRepository
<
RB_Stu_CommentDetails
>,
IDependency
{
/// <summary>
/// 批量新增修改学员评论详情
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public
bool
BatchSetStuCommentDetails
(
List
<
RB_Stu_CommentDetails
>
list
);
/// <summary>
/// 获取学员评价详情
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Stu_CommentDetails_Extend
>
GetStuCommentDetailsListRepository
(
RB_Stu_CommentDetails_Extend
query
);
/// <summary>
/// 修改学生评价
/// </summary>
/// <param name="Ids"></param>
/// <param name="Info"></param>
/// <returns></returns>
public
bool
SetStuCommentDetailsInfoRepository
(
string
Ids
,
string
Info
);
/// <summary>
/// 修改学员评论状态
/// </summary>
/// <param name="ShowType"></param>
/// <param name="Ids"></param>
/// <returns></returns>
public
bool
SetStuCommentDetailsShowTypeRepository
(
int
ShowType
,
string
Ids
);
/// <summary>
/// 根据课程评论次数修改可见等级
/// </summary>
/// <param name="CourseId">课程编号</param>
/// <param name="Times">次数</param>
/// <param name="ShowType">可见性</param>
/// <returns></returns>
public
bool
SetStuCommentShowTypeByTimesRepository
(
int
CourseId
,
int
Times
,
int
ShowType
);
/// <summary>
/// 根据编号删除学员评论
/// </summary>
/// <param name="Ids"></param>
/// <returns></returns>
public
bool
DeleteStuCommentRepository
(
string
Ids
);
}
}
EduSpider.IRepository/IStuCommentRepository.cs
View file @
9f18c3ca
...
...
@@ -17,7 +17,7 @@ namespace EduSpider.IRepository
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetStuCommentRepository
(
RB_Stu_Comment_Extend
model
);
public
bool
SetStuCommentRepository
(
RB_Stu_Comment_Extend
model
,
bool
IsAdd
=
false
);
/// <summary>
/// 批量新增学员评价
...
...
EduSpider.Model/Entity/RB_Stu_CommentDetails.cs
0 → 100644
View file @
9f18c3ca
using
System
;
using
VTX.FW.Attr
;
namespace
EduSpider.Model.Entity
{
/// <summary>
/// 学员评价详情表实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Stu_CommentDetails
{
/// <summary>
/// 主键编号
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 学员评价主表编号
/// </summary>
public
int
CommentMainId
{
get
;
set
;
}
/// <summary>
/// 开始作业编号
/// </summary>
public
int
StartHomeWorkId
{
get
;
set
;
}
/// <summary>
/// 家庭作业编号
/// </summary>
public
int
HomeWorkId
{
get
;
set
;
}
/// <summary>
/// 学员登录编号
/// </summary>
public
int
StuUid
{
get
;
set
;
}
/// <summary>
/// 课程编号
/// </summary>
public
int
CourseId
{
get
;
set
;
}
/// <summary>
/// 评语次数
/// </summary>
public
int
Times
{
get
;
set
;
}
/// <summary>
/// 评语
/// </summary>
public
string
Info
{
get
;
set
;
}
/// <summary>
/// 创建类型(1-系统创建,2-老师创建)
/// </summary>
public
int
CreateType
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
CreateTime
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
/// <summary>
/// 创建人姓名
/// </summary>
public
string
CreateByName
{
get
;
set
;
}
/// <summary>
/// 显示类型(1-全部可见,2-部分可见,3-不可见)
/// </summary>
public
int
ShowType
{
get
;
set
;
}
/// <summary>
/// 删除状态(0-正常,1-删除)
/// </summary>
public
int
Status
{
get
;
set
;
}
/// <summary>
/// 多个作业编号
/// </summary>
public
string
HomeWorkIds
{
get
;
set
;
}
}
}
EduSpider.Model/Extend/RB_Stu_CommentDetails_Extend.cs
0 → 100644
View file @
9f18c3ca
using
EduSpider.Model.Entity
;
namespace
EduSpider.Model.Extend
{
/// <summary>
/// 学员评价详情扩展实体类
/// </summary>
public
class
RB_Stu_CommentDetails_Extend
:
RB_Stu_CommentDetails
{
/// <summary>
/// 学员评价主表编号
/// </summary>
public
string
QCommentMainIds
{
get
;
set
;
}
/// <summary>
/// 学生名称
/// </summary>
public
string
StuName
{
get
;
set
;
}
}
}
EduSpider.Model/Query/CourseQuery.cs
View file @
9f18c3ca
...
...
@@ -46,14 +46,9 @@
public
int
HomeWorkId
{
get
;
set
;
}
/// <summary>
/// 开始作业编号
/// </summary>
public
int
StartHomeWorkId
{
get
;
set
;
}
/// <summary>
/// 结束作业编号
/// 作业编号
/// </summary>
public
int
EndHomeWorkId
{
get
;
set
;
}
public
string
QHomeWorkIds
{
get
;
set
;
}
/// <summary>
/// 创建类型(1-系统创建,2-老师创建)
...
...
EduSpider.Repository/StuCommentDetailsRepository.cs
0 → 100644
View file @
9f18c3ca
using
EduSpider.IRepository
;
using
EduSpider.Model.Entity
;
using
EduSpider.Model.Extend
;
using
EduSpider.Model.Query
;
using
EduSpider.Repository.Base
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VTX.FW.DB.Dapper
;
namespace
EduSpider.Repository
{
/// <summary>
/// 学员评论详情仓储接口
/// </summary>
public
class
StuCommentDetailsRepository
:
BaseRepository
<
RB_Stu_CommentDetails
>,
IStuCommentDetailsRepository
{
/// <summary>
/// 批量新增修改学员评论详情
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public
bool
BatchSetStuCommentDetails
(
List
<
RB_Stu_CommentDetails
>
list
)
{
bool
flag
=
false
;
foreach
(
var
item
in
list
)
{
var
defaultModel
=
GetStuCommentDetailsListRepository
(
new
RB_Stu_CommentDetails_Extend
()
{
CourseId
=
item
.
CourseId
,
Times
=
item
.
Times
,
StuUid
=
item
.
StuUid
,
HomeWorkId
=
item
.
HomeWorkId
,
}).
FirstOrDefault
();
string
createTimeStr
=
""
;
if
(
defaultModel
!=
null
)
{
createTimeStr
=
VTX
.
FW
.
Helper
.
ConvertHelper
.
FormatTime
(
defaultModel
.
CreateTime
.
AddSeconds
(
1
));
}
else
{
var
homeWorkModel
=
new
StuHomeWorkRepository
().
GetStuHomeWorkDetailsListRepository
(
new
CourseQuery
()
{
CourseId
=
item
.
CourseId
,
HomeWorkId
=
item
.
HomeWorkId
,
StuIds
=
item
.
StuUid
.
ToString
()
}).
FirstOrDefault
();
if
(
homeWorkModel
!=
null
)
{
createTimeStr
=
VTX
.
FW
.
Helper
.
ConvertHelper
.
FormatTime
(
homeWorkModel
.
add_time
.
AddSeconds
(
1
));
}
}
if
(!
string
.
IsNullOrEmpty
(
createTimeStr
))
{
item
.
CreateTime
=
Convert
.
ToDateTime
(
createTimeStr
);
}
else
{
item
.
CreateTime
=
DateTime
.
Now
;
}
// flag = base.Insert(item) > 0;
}
flag
=
base
.
BatchInsert
(
list
);
return
flag
;
}
/// <summary>
/// 获取学员评价详情
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Stu_CommentDetails_Extend
>
GetStuCommentDetailsListRepository
(
RB_Stu_CommentDetails_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*,s.StudentName as StuName
FROM RB_Stu_CommentDetails AS A LEFT JOIN rb_student s on A.StuUid = s.StudentUid
WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
QCommentMainIds
))
{
builder
.
AppendFormat
(
@" AND A.{0} IN({1}) "
,
nameof
(
RB_Stu_CommentDetails_Extend
.
CommentMainId
),
query
.
QCommentMainIds
);
}
if
(
query
.
CommentMainId
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0} IN({1}) "
,
nameof
(
RB_Stu_CommentDetails_Extend
.
CommentMainId
),
query
.
CommentMainId
);
}
if
(
query
.
CourseId
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0} IN({1}) "
,
nameof
(
RB_Stu_CommentDetails_Extend
.
CourseId
),
query
.
CourseId
);
}
if
(
query
.
Times
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0} IN({1}) "
,
nameof
(
RB_Stu_CommentDetails_Extend
.
Times
),
query
.
Times
);
}
if
(
query
.
StuUid
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0} IN({1}) "
,
nameof
(
RB_Stu_CommentDetails_Extend
.
StuUid
),
query
.
StuUid
);
}
if
(
query
.
HomeWorkId
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0} ={1} "
,
nameof
(
RB_Stu_CommentDetails_Extend
.
HomeWorkId
),
query
.
HomeWorkId
);
}
}
return
Get
<
RB_Stu_CommentDetails_Extend
>(
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 修改学生评价
/// </summary>
/// <param name="Ids"></param>
/// <param name="Info"></param>
/// <returns></returns>
public
bool
SetStuCommentDetailsInfoRepository
(
string
Ids
,
string
Info
)
{
string
sql
=
string
.
Format
(
"UPDATE RB_Stu_CommentDetails SET Info=@Info WHERE Id IN({0}) "
,
Ids
);
DynamicParameters
parameters
=
new
DynamicParameters
();
parameters
.
Add
(
"Info"
,
Info
);
return
base
.
Execute
(
sql
,
parameters
)
>
0
;
}
/// <summary>
/// 根据课程编号和次数修改评价可见状态
/// </summary>
/// <param name="CourseId"></param>
/// <param name="Times"></param>
/// <param name="ShowType"></param>
/// <returns></returns>
public
bool
SetStuCommentShowTypeByTimesRepository
(
int
CourseId
,
int
Times
,
int
ShowType
)
{
string
sql
=
string
.
Format
(
"UPDATE RB_Stu_CommentDetails SET ShowType={0} WHERE CourseId={1} AND Times={2}"
,
ShowType
,
CourseId
,
Times
);
return
base
.
Execute
(
sql
)
>
0
;
}
/// <summary>
/// 修改学员评论可见状态
/// </summary>
/// <param name="ShowType"></param>
/// <param name="Ids"></param>
/// <returns></returns>
public
bool
SetStuCommentDetailsShowTypeRepository
(
int
ShowType
,
string
Ids
)
{
string
sql
=
string
.
Format
(
"UPDATE RB_Stu_CommentDetails SET ShowType={0} WHERE Id IN({1}) "
,
ShowType
,
Ids
);
return
base
.
Execute
(
sql
)
>
0
;
}
/// <summary>
/// 根据编号删除评论
/// </summary>
/// <param name="Ids"></param>
/// <returns></returns>
public
bool
DeleteStuCommentRepository
(
string
Ids
)
{
string
sql
=
string
.
Format
(
"UPDATE RB_Stu_CommentDetails SET Status=1 WHERE Id IN({0}) "
,
Ids
);
return
base
.
Execute
(
sql
)
>
0
;
}
}
}
EduSpider.Repository/StuCommentRepository.cs
View file @
9f18c3ca
...
...
@@ -22,11 +22,14 @@ namespace EduSpider.Repository
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetStuCommentRepository
(
RB_Stu_Comment_Extend
model
)
public
bool
SetStuCommentRepository
(
RB_Stu_Comment_Extend
model
,
bool
IsAdd
=
false
)
{
bool
flag
=
false
;
var
oldModel
=
GetCourseCommentTimesListRepository
(
new
CourseQuery
()
{
CourseId
=
model
.
CourseId
,
CreateCommentType
=
model
.
CreateType
,
CommentTimes
=
model
.
Times
}).
FirstOrDefault
();
model
.
Id
=
oldModel
?.
Id
??
0
;
if
(!
IsAdd
)
{
var
oldModel
=
GetCourseCommentTimesListRepository
(
new
CourseQuery
()
{
CourseId
=
model
.
CourseId
,
CreateCommentType
=
model
.
CreateType
,
CommentTimes
=
model
.
Times
}).
FirstOrDefault
();
model
.
Id
=
oldModel
?.
Id
??
0
;
}
if
(
model
.
Id
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
...
...
@@ -126,8 +129,7 @@ WHERE 1=1
var
homeworkList
=
new
StuHomeWorkRepository
().
GetStuHomeWorkDetailsListRepository
(
new
CourseQuery
()
{
CourseId
=
model
.
CourseId
,
StartHomeWorkId
=
model
.
Details
[
0
].
StartHomeWorkId
,
EndHomeWorkId
=
model
.
Details
[
0
].
HomeWorkId
QHomeWorkIds
=
model
.
Details
[
0
].
HomeWorkIds
,
});
var
courseComment
=
new
RB_Course_Comment_Extend
();
var
defaultComment
=
new
RB_Comment_Extend
();
...
...
@@ -171,7 +173,7 @@ WHERE 1=1
}
}
flag
=
SetStuCommentRepository
(
model
);
flag
=
SetStuCommentRepository
(
model
,
IsAdd
:
true
);
return
flag
;
}
}
...
...
EduSpider.Repository/StuHomeWorkRepository.cs
View file @
9f18c3ca
...
...
@@ -61,13 +61,9 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Stu_HomeWork_Extend
.
homework_id
),
query
.
HomeWorkId
);
}
if
(
query
.
StartHomeWorkId
>
0
)
if
(
!
string
.
IsNullOrEmpty
(
query
.
QHomeWorkIds
)
)
{
builder
.
AppendFormat
(
" AND A.{0}>={1} "
,
nameof
(
RB_Stu_HomeWork_Extend
.
homework_id
),
query
.
StartHomeWorkId
);
}
if
(
query
.
EndHomeWorkId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}<={1} "
,
nameof
(
RB_Stu_HomeWork_Extend
.
homework_id
),
query
.
EndHomeWorkId
);
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Stu_HomeWork_Extend
.
homework_id
),
query
.
QHomeWorkIds
);
}
}
var
dataList
=
Get
<
RB_Stu_HomeWork_Extend
>(
builder
.
ToString
()).
ToList
();
...
...
EduSpider.WebApi/Controllers/Student/TeacherController.cs
View file @
9f18c3ca
...
...
@@ -206,7 +206,7 @@ namespace EduSpider.WebApi.Controllers
CourseId
=
base
.
ReqParameters
.
GetInt
(
"CourseId"
),
CourseName
=
base
.
ReqParameters
.
GetString
(
"CourseName"
),
};
var
courseRuleList
=
CourseService
.
GetCourseCommentList
(
query
);
var
courseRuleList
=
CourseService
.
GetCourseCommentList
(
query
)
.
OrderBy
(
qitem
=>
qitem
.
Times
).
ToList
()
;
List
<
object
>
result
=
new
List
<
object
>();
if
(
courseRuleList
!=
null
&&
courseRuleList
.
Count
>
0
)
{
...
...
@@ -230,7 +230,7 @@ namespace EduSpider.WebApi.Controllers
}
else
{
var
sysCommentList
=
CourseService
.
GetSysComment
(
new
CourseQuery
()
{
KeyWords
=
query
.
CourseName
,
CommentTimes
=
query
.
CommentTimes
});
var
sysCommentList
=
CourseService
.
GetSysComment
(
new
CourseQuery
()
{
KeyWords
=
query
.
CourseName
,
CommentTimes
=
query
.
CommentTimes
})
.
OrderBy
(
qitem
=>
qitem
.
Times
).
ToList
()
;
if
(
sysCommentList
!=
null
&&
sysCommentList
.
Count
>
0
)
{
foreach
(
var
item
in
sysCommentList
)
...
...
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