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
62c03c5b
Commit
62c03c5b
authored
Jun 07, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
评价修改
parent
795786fc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
250 additions
and
427 deletions
+250
-427
IStuCommentRepository.cs
EduSpider.IRepository/IStuCommentRepository.cs
+4
-43
ICourseService.cs
EduSpider.IServices/ICourseService.cs
+12
-11
RB_Stu_Comment.cs
EduSpider.Model/Entity/RB_Stu_Comment.cs
+41
-68
RB_Stu_Comment_Extend.cs
EduSpider.Model/Extend/RB_Stu_Comment_Extend.cs
+16
-12
CourseCommentDetailsRepository.cs
EduSpider.Repository/CourseCommentDetailsRepository.cs
+1
-1
StuCommentRepository.cs
EduSpider.Repository/StuCommentRepository.cs
+60
-201
StuHomeWorkRepository.cs
EduSpider.Repository/StuHomeWorkRepository.cs
+47
-7
CourseService.cs
EduSpider.Services/CourseService.cs
+25
-35
TeacherController.cs
EduSpider.WebApi/Controllers/Student/TeacherController.cs
+43
-48
TimedTaskServices.cs
EduSpider.WebApi/Timers/TimedTaskServices.cs
+1
-1
No files found.
EduSpider.IRepository/IStuCommentRepository.cs
View file @
62c03c5b
...
...
@@ -8,7 +8,7 @@ using VTX.FW.DB;
namespace
EduSpider.IRepository
{
/// <summary>
/// 学员评
语
仓储接口
/// 学员评
价
仓储接口
/// </summary>
public
interface
IStuCommentRepository
:
IDBRepository
<
RB_Stu_Comment
>,
IDependency
{
...
...
@@ -17,59 +17,20 @@ namespace EduSpider.IRepository
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetStuCommentRepository
(
RB_Stu_Comment
model
);
public
bool
SetStuCommentRepository
(
RB_Stu_Comment
_Extend
model
);
/// <summary>
/// 批量新增学员评价
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public
bool
BatchSetStuCommentRepository
(
List
<
RB_Stu_Comment
>
list
,
StuCommentType
commentType
);
/// <summary>
/// 查询学员评语列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Stu_Comment
>
GetStuCommentListRepository
(
CourseQuery
query
);
/// <summary>
/// 修改学员评论状态
/// </summary>
/// <param name="ShowType"></param>
/// <param name="Ids"></param>
/// <returns></returns>
public
bool
SetStuCommentShowTypeRepository
(
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
);
public
bool
BatchSetStuCommentRepository
(
RB_Stu_Comment_Extend
model
,
StuCommentType
commentType
);
/// <summary>
/// 获取系统生成评论次数
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Stu_Comment
>
GetCourseCommentTimesListRepository
(
CourseQuery
query
);
/// <summary>
/// 获取评论列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Stu_Comment_Extend
>
GetStuCommentList
(
CourseQuery
query
);
public
List
<
RB_Stu_Comment_Extend
>
GetCourseCommentTimesListRepository
(
CourseQuery
query
);
}
}
EduSpider.IServices/ICourseService.cs
View file @
62c03c5b
...
...
@@ -80,26 +80,27 @@ namespace EduSpider.IServices
/// <returns></returns>
public
bool
DeleteCourseCommentDetail
(
string
DetailIds
);
/// <summary>
/// 新增修改学员评价
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetStuComment
(
RB_Stu_Comment
model
);
/// <summary>
/// 批量新增学员评价
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public
bool
BatchSetStuComment
(
List
<
RB_Stu_Comment
>
list
,
StuCommentType
commentType
);
public
bool
BatchSetStuComment
(
RB_Stu_Comment_Extend
model
,
StuCommentType
commentType
);
/// <summary>
/// 获取学员评价列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Stu_Comment_Extend
>
GetStuCommentList
(
CourseQuery
query
);
public
List
<
RB_Stu_CommentDetails_Extend
>
GetStuCommentDetailsList
(
RB_Stu_CommentDetails_Extend
query
);
/// <summary>
/// 修改学生评价
/// </summary>
/// <param name="Ids"></param>
/// <param name="Info"></param>
/// <returns></returns>
public
bool
SetStuCommentDetailsInfo
(
string
Ids
,
string
Info
);
/// <summary>
/// 修改学员评论状态
...
...
@@ -107,7 +108,7 @@ namespace EduSpider.IServices
/// <param name="ShowType"></param>
/// <param name="Ids"></param>
/// <returns></returns>
public
bool
SetStuCommentShowType
(
int
ShowType
,
string
Ids
);
public
bool
SetStuComment
Details
ShowType
(
int
ShowType
,
string
Ids
);
/// <summary>
/// 根据课程评论次数修改可见等级
...
...
@@ -130,7 +131,7 @@ namespace EduSpider.IServices
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Stu_Comment
>
GetCourseCommentTimesList
(
CourseQuery
query
);
public
List
<
RB_Stu_Comment
_Extend
>
GetCourseCommentTimesList
(
CourseQuery
query
);
/// <summary>
/// 获取系统评价配置
...
...
EduSpider.Model/Entity/RB_Stu_Comment.cs
View file @
62c03c5b
...
...
@@ -4,77 +4,50 @@ using VTX.FW.Attr;
namespace
EduSpider.Model.Entity
{
/// <summary>
/// 学员评
语
实体类
/// 学员评
价主表
实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Stu_Comment
{
/// <summary>
/// 主键编号
/// </summary>
public
int
Id
{
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
int
Id
{
get
;
set
;
}
/// <summary>
/// 次数
/// </summary>
public
int
Times
{
get
;
set
;
}
/// <summary>
/// 课程编号
/// </summary>
public
int
CourseId
{
get
;
set
;
}
/// <summary>
/// 评论标题
/// </summary>
public
string
Title
{
get
;
set
;
}
/// <summary>
/// 创建类型(1-系统创建,2-老师创建)
/// </summary>
public
int
CreateType
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
CreateTime
{
get
;
set
;
}
/// <summary>
/// 创建人姓名
/// </summary>
public
string
CreateByName
{
get
;
set
;
}
}
}
EduSpider.Model/Extend/RB_Stu_Comment_Extend.cs
View file @
62c03c5b
using
EduSpider.Model.Entity
;
using
System
;
using
VTX.FW.Attr
;
using
System.Collections.Generic
;
namespace
EduSpider.Model.Extend
{
/// <summary>
/// 学生评价扩展
/// </summary>
public
class
RB_Stu_Comment_Extend
:
RB_Stu_Comment
{
/// <summary>
/// 学生姓名
/// </summary>
public
string
StuName
{
get
;
set
;
}
}
/// <summary>
/// 学生评价主表扩展实体类
/// </summary>
public
class
RB_Stu_Comment_Extend
:
RB_Stu_Comment
{
/// <summary>
/// 学员评论详情列表
/// </summary>
public
List
<
RB_Stu_CommentDetails
>
Details
{
get
;
set
;
}
/// <summary>
/// 显示类型
/// </summary>
public
int
ShowType
{
get
;
set
;
}
}
}
EduSpider.Repository/CourseCommentDetailsRepository.cs
View file @
62c03c5b
...
...
@@ -82,7 +82,7 @@ WHERE 1=1
/// <returns></returns>
public
bool
DeleteCourseCommentDetailsRepository
(
string
DetailIds
)
{
string
sql
=
string
.
Format
(
"
UPDATE
RB_Course_CommentDetails SET Status=1 WHERE DetailId IN({0}) "
,
DetailIds
);
string
sql
=
string
.
Format
(
"
UPDATE
RB_Course_CommentDetails SET Status=1 WHERE DetailId IN({0}) "
,
DetailIds
);
return
base
.
Execute
(
sql
)
>
0
;
}
}
...
...
EduSpider.Repository/StuCommentRepository.cs
View file @
62c03c5b
This diff is collapsed.
Click to expand it.
EduSpider.Repository/StuHomeWorkRepository.cs
View file @
62c03c5b
...
...
@@ -98,7 +98,8 @@ WHERE 1=1
{
List
<
ExamWorkResult
>
homeWorkList
=
new
();
//学员评论列表
var
commentList
=
new
StuCommentRepository
().
GetStuCommentListRepository
(
new
CourseQuery
()
{
CourseId
=
cItem
.
course_id
,
StuIds
=
sItem
.
student_uid
.
ToString
()
});
var
commentList
=
new
StuCommentDetailsRepository
().
GetStuCommentDetailsListRepository
(
new
RB_Stu_CommentDetails_Extend
()
{
CourseId
=
cItem
.
course_id
,
StuUid
=
sItem
.
student_uid
});
var
tempDataList
=
dataList
.
Where
(
qitem
=>
qitem
.
course_id
==
cItem
.
course_id
&&
qitem
.
student_uid
==
sItem
.
student_uid
).
ToList
();
if
(
tempDataList
!=
null
&&
tempDataList
.
Count
>
0
)
{
...
...
@@ -155,8 +156,19 @@ WHERE 1=1
}
if
(
tempModel
==
null
||
(
tempModel
!=
null
&&
tempModel
.
Id
<=
0
))
{
//新增系统生成评价
new
StuCommentRepository
().
SetStuCommentRepository
(
new
RB_Stu_Comment
()
var
f_model
=
new
RB_Stu_Comment_Extend
()
{
Id
=
0
,
Times
=
1
,
CourseId
=
cItem
.
course_id
,
CreateType
=
1
,
CreateByName
=
firstList
.
LastOrDefault
().
ThName
,
CreateTime
=
firstStartTime
,
ShowType
=
3
,
Details
=
new
List
<
RB_Stu_CommentDetails
>()
};
f_model
.
Title
=
string
.
Format
(
"第{0}次评价"
,
f_model
.
Times
);
f_model
.
Details
.
Add
(
new
RB_Stu_CommentDetails
()
{
Id
=
0
,
StartHomeWorkId
=
firstList
.
FirstOrDefault
().
Stu_HomeWork_Id
,
...
...
@@ -170,6 +182,8 @@ WHERE 1=1
CreateTime
=
firstStartTime
,
ShowType
=
3
,
});
//新增系统生成评价
new
StuCommentRepository
().
SetStuCommentRepository
(
f_model
);
}
}
}
...
...
@@ -203,7 +217,19 @@ WHERE 1=1
if
(
secondModel
==
null
||
(
secondModel
!=
null
&&
secondModel
.
Id
<=
0
))
{
new
StuCommentRepository
().
SetStuCommentRepository
(
new
RB_Stu_Comment
()
var
s_model
=
new
RB_Stu_Comment_Extend
()
{
Id
=
0
,
Times
=
2
,
CourseId
=
cItem
.
course_id
,
CreateType
=
1
,
CreateByName
=
secondList
.
LastOrDefault
().
ThName
,
CreateTime
=
secondTime
,
ShowType
=
3
,
Details
=
new
List
<
RB_Stu_CommentDetails
>()
};
s_model
.
Title
=
string
.
Format
(
"第{0}次评价"
,
s_model
.
Times
);
s_model
.
Details
.
Add
(
new
RB_Stu_CommentDetails
()
{
Id
=
0
,
StartHomeWorkId
=
secondList
.
FirstOrDefault
().
Stu_HomeWork_Id
,
...
...
@@ -217,6 +243,7 @@ WHERE 1=1
CreateTime
=
secondTime
,
ShowType
=
3
,
});
new
StuCommentRepository
().
SetStuCommentRepository
(
s_model
);
}
}
}
...
...
@@ -249,7 +276,19 @@ WHERE 1=1
}
if
(
thirdModel
==
null
||
(
thirdModel
!=
null
&&
thirdModel
.
Id
<=
0
))
{
new
StuCommentRepository
().
SetStuCommentRepository
(
new
RB_Stu_Comment
()
var
t_model
=
new
RB_Stu_Comment_Extend
()
{
Id
=
0
,
Times
=
3
,
CourseId
=
cItem
.
course_id
,
CreateType
=
1
,
CreateByName
=
thirdList
.
LastOrDefault
().
ThName
,
CreateTime
=
thirdList
.
LastOrDefault
().
CreateTime
.
AddMinutes
(
thirdNum
),
ShowType
=
3
,
Details
=
new
List
<
RB_Stu_CommentDetails
>()
};
t_model
.
Title
=
string
.
Format
(
"第{0}次评价"
,
t_model
.
Times
);
t_model
.
Details
.
Add
(
new
RB_Stu_CommentDetails
()
{
Id
=
0
,
StartHomeWorkId
=
thirdList
.
FirstOrDefault
().
Stu_HomeWork_Id
,
...
...
@@ -263,6 +302,7 @@ WHERE 1=1
CreateTime
=
thirdList
.
LastOrDefault
().
CreateTime
.
AddMinutes
(
thirdNum
),
ShowType
=
3
,
});
new
StuCommentRepository
().
SetStuCommentRepository
(
t_model
);
}
}
}
...
...
@@ -309,7 +349,7 @@ WHERE 1=1
}
//学员评论列表
var
commentList
=
new
StuComment
Repository
().
GetStuCommentListRepository
(
new
CourseQuery
()
{
CourseId
=
query
.
CourseId
,
StuIds
=
query
.
StuIds
});
var
commentList
=
new
StuComment
DetailsRepository
().
GetStuCommentDetailsListRepository
(
new
RB_Stu_CommentDetails_Extend
()
{
CourseId
=
query
.
CourseId
,
StuUid
=
Convert
.
ToInt32
(
query
.
StuIds
)
});
ExamWorkResult
firstComment
=
null
;
ExamWorkResult
secondComment
=
null
;
...
...
@@ -437,7 +477,7 @@ WHERE 1=1
/// <param name="CourseId"></param>
/// <param name="Stu_HomeWork_Id"></param>
/// <returns></returns>
private
static
RB_Stu_Comment
GetSystemCreateComment
(
List
<
RB_Stu_Comment
>
commentList
,
int
CourseId
,
int
Stu_HomeWork_Id
)
private
static
RB_Stu_Comment
Details_Extend
GetSystemCreateComment
(
List
<
RB_Stu_CommentDetails_Extend
>
commentList
,
int
CourseId
,
int
Stu_HomeWork_Id
)
{
var
tempModel
=
commentList
.
Where
(
qitem
=>
qitem
.
CourseId
==
CourseId
&&
qitem
.
HomeWorkId
==
Stu_HomeWork_Id
&&
qitem
.
CreateType
==
1
).
FirstOrDefault
();
return
tempModel
;
...
...
EduSpider.Services/CourseService.cs
View file @
62c03c5b
...
...
@@ -8,8 +8,6 @@ using EduSpider.Repository;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VTX.FW.Attr
;
namespace
EduSpider.Services
...
...
@@ -73,6 +71,11 @@ namespace EduSpider.Services
[
Autowired
]
public
IStuCommentRepository
StuCommentRepository
{
get
;
set
;
}
/// <summary>
/// 学员评价详情仓储接口
/// </summary>
[
Autowired
]
public
IStuCommentDetailsRepository
StuCommentDetailsRepository
{
get
;
set
;
}
/// <summary>
...
...
@@ -354,48 +357,35 @@ namespace EduSpider.Services
}
/// <summary>
///
新增修改
学员评价
///
批量新增
学员评价
/// </summary>
/// <param name="
model
"></param>
/// <param name="
list
"></param>
/// <returns></returns>
public
bool
SetStuComment
(
RB_Stu_Comment
model
)
public
bool
BatchSetStuComment
(
RB_Stu_Comment_Extend
model
,
StuCommentType
commentType
)
{
if
(
model
.
Id
<=
0
&&
model
.
HomeWorkId
>
0
)
{
var
stuHomeWork
=
StuHomeWorkRepository
.
GetStuHomeWorkDetailsListRepository
(
new
CourseQuery
()
{
CourseId
=
model
.
CourseId
,
HomeWorkId
=
model
.
HomeWorkId
,
StuIds
=
model
.
StuUid
.
ToString
()
}).
FirstOrDefault
();
if
(
stuHomeWork
!=
null
)
{
model
.
CreateTime
=
stuHomeWork
.
add_time
.
AddSeconds
(
1
);
}
}
return
StuCommentRepository
.
SetStuCommentRepository
(
model
);
return
StuCommentRepository
.
BatchSetStuCommentRepository
(
model
,
commentType
);
}
/// <summary>
///
批量新增学员评价
///
获取学员评价列表
/// </summary>
/// <param name="
list
"></param>
/// <param name="
query
"></param>
/// <returns></returns>
public
bool
BatchSetStuComment
(
List
<
RB_Stu_Comment
>
list
,
StuCommentType
commentType
)
public
List
<
RB_Stu_CommentDetails_Extend
>
GetStuCommentDetailsList
(
RB_Stu_CommentDetails_Extend
query
)
{
return
StuCommentRepository
.
BatchSetStuCommentRepository
(
list
,
commentType
);
var
list
=
StuCommentDetailsRepository
.
GetStuCommentDetailsListRepository
(
query
);
return
list
;
}
/// <summary>
///
获取学员评价列表
///
修改学生评语
/// </summary>
/// <param name="query"></param>
/// <param name="Ids"></param>
/// <param name="Info"></param>
/// <returns></returns>
public
List
<
RB_Stu_Comment_Extend
>
GetStuCommentList
(
CourseQuery
query
)
public
bool
SetStuCommentDetailsInfo
(
string
Ids
,
string
Info
)
{
var
list
=
StuCommentRepository
.
GetStuCommentList
(
query
);
return
list
;
return
StuCommentDetailsRepository
.
SetStuCommentDetailsInfoRepository
(
Ids
,
Info
);
}
/// <summary>
...
...
@@ -404,9 +394,9 @@ namespace EduSpider.Services
/// <param name="ShowType"></param>
/// <param name="Ids"></param>
/// <returns></returns>
public
bool
SetStuCommentShowType
(
int
ShowType
,
string
Ids
)
public
bool
SetStuComment
Details
ShowType
(
int
ShowType
,
string
Ids
)
{
return
StuComment
Repository
.
SetStuComment
ShowTypeRepository
(
ShowType
,
Ids
);
return
StuComment
DetailsRepository
.
SetStuCommentDetails
ShowTypeRepository
(
ShowType
,
Ids
);
}
/// <summary>
...
...
@@ -418,7 +408,7 @@ namespace EduSpider.Services
/// <returns></returns>
public
bool
SetStuCommentShowTypeByTimes
(
int
CourseId
,
int
Times
,
int
ShowType
)
{
return
StuCommentRepository
.
SetStuCommentShowTypeByTimesRepository
(
CourseId
,
Times
,
ShowType
);
return
StuComment
Details
Repository
.
SetStuCommentShowTypeByTimesRepository
(
CourseId
,
Times
,
ShowType
);
}
...
...
@@ -429,7 +419,7 @@ namespace EduSpider.Services
/// <returns></returns>
public
bool
RemoveStuComment
(
string
Ids
)
{
return
StuCommentRepository
.
DeleteStuCommentRepository
(
Ids
);
return
StuComment
Details
Repository
.
DeleteStuCommentRepository
(
Ids
);
}
/// <summary>
...
...
@@ -437,7 +427,7 @@ namespace EduSpider.Services
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Stu_Comment
>
GetCourseCommentTimesList
(
CourseQuery
query
)
public
List
<
RB_Stu_Comment
_Extend
>
GetCourseCommentTimesList
(
CourseQuery
query
)
{
var
list
=
StuCommentRepository
.
GetCourseCommentTimesListRepository
(
query
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
...
...
@@ -445,7 +435,7 @@ namespace EduSpider.Services
foreach
(
var
item
in
list
)
{
int
ShowType
=
3
;
var
subList
=
StuComment
Repository
.
GetStuCommentListRepository
(
new
CourseQuery
()
{
CourseId
=
item
.
CourseId
,
Comment
Times
=
item
.
Times
});
var
subList
=
StuComment
DetailsRepository
.
GetStuCommentDetailsListRepository
(
new
RB_Stu_CommentDetails_Extend
()
{
CourseId
=
item
.
CourseId
,
Times
=
item
.
Times
});
if
(
subList
!=
null
&&
subList
.
Count
>
0
)
{
var
totalCount
=
subList
.
Count
;
...
...
EduSpider.WebApi/Controllers/Student/TeacherController.cs
View file @
62c03c5b
...
...
@@ -341,69 +341,64 @@ namespace EduSpider.WebApi.Controllers
public
ApiResult
BatchSetStuComment
()
{
var
stuListStr
=
base
.
ReqParameters
.
GetString
(
"ChooseStuList"
);
var
model
=
new
RB_Stu_Comment_Extend
()
{
Id
=
base
.
ReqParameters
.
GetInt
(
"Id"
),
Times
=
base
.
ReqParameters
.
GetInt
(
"Times"
),
CourseId
=
base
.
ReqParameters
.
GetInt
(
"CourseId"
),
Title
=
base
.
ReqParameters
.
GetString
(
"Title"
),
CreateType
=
2
,
CreateTime
=
System
.
DateTime
.
Now
,
CreateBy
=
base
.
BaseUserId
,
CreateByName
=
base
.
UserInfo
.
AccountName
,
ShowType
=
3
,
Details
=
new
List
<
RB_Stu_CommentDetails
>()
};
StuCommentType
commentType
=
new
StuCommentType
()
{
CommentId
=
base
.
ReqParameters
.
GetInt
(
"CommentId"
),
CommentType
=
base
.
ReqParameters
.
GetInt
(
"CommentType"
),
IsDefault
=
base
.
ReqParameters
.
GetInt
(
"IsDefault"
)
};
List
<
RB_Stu_Comment
>
list
=
new
();
List
<
RB_Stu_Comment
Details
>
list
=
new
();
if
(!
string
.
IsNullOrWhiteSpace
(
stuListStr
))
{
JArray
jArray
=
JArray
.
Parse
(
stuListStr
);
if
(
jArray
!=
null
&&
jArray
.
Count
>
0
)
{
var
homeworkIds
=
base
.
ReqParameters
.
GetString
(
"HomeWorkIds"
);
List
<
int
>
homeIds
=
new
List
<
int
>();
if
(!
string
.
IsNullOrWhiteSpace
(
homeworkIds
))
{
homeIds
=
VTX
.
FW
.
Helper
.
JsonHelper
.
Deserialize
<
List
<
int
>>(
homeworkIds
);
}
foreach
(
var
jItem
in
jArray
)
{
JObject
stuObj
=
JObject
.
Parse
(
jItem
.
ToString
());
var
model
=
new
RB_Stu_Comment
()
var
subModel
=
new
RB_Stu_CommentDetails
()
{
Id
=
base
.
ReqParameters
.
GetInt
(
"Id"
),
StartHomeWorkId
=
base
.
ReqParameters
.
GetInt
(
"StartHomeWorkId"
),
StartHomeWorkId
=
base
.
ReqParameters
.
GetInt
(
"StartHomeWorkId"
),
HomeWorkId
=
base
.
ReqParameters
.
GetInt
(
"HomeWorkId"
),
StuUid
=
stuObj
.
GetInt
(
"StuId"
),
CourseId
=
base
.
ReqParameters
.
GetInt
(
"CourseId"
),
Times
=
base
.
ReqParameters
.
GetInt
(
"Times"
),
Info
=
base
.
ReqParameters
.
GetString
(
"Info"
),
CreateType
=
2
,
HomeWorkIds
=
string
.
Join
(
","
,
homeIds
)
};
m
odel
.
ShowType
=
3
;
m
odel
.
Status
=
0
;
m
odel
.
CreateTime
=
System
.
DateTime
.
Now
;
m
odel
.
CreateBy
=
base
.
BaseUserId
;
m
odel
.
CreateByName
=
base
.
UserInfo
.
AccountName
;
list
.
Add
(
m
odel
);
subM
odel
.
ShowType
=
3
;
subM
odel
.
Status
=
0
;
subM
odel
.
CreateTime
=
System
.
DateTime
.
Now
;
subM
odel
.
CreateBy
=
base
.
BaseUserId
;
subM
odel
.
CreateByName
=
base
.
UserInfo
.
AccountName
;
list
.
Add
(
subM
odel
);
}
}
}
var
flag
=
CourseService
.
BatchSetStuComment
(
list
,
commentType
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 指定作业后添加评价
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
HttpGet
]
public
ApiResult
SetStuComment
()
{
var
model
=
new
RB_Stu_Comment
()
{
Id
=
base
.
ReqParameters
.
GetInt
(
"Id"
),
HomeWorkId
=
base
.
ReqParameters
.
GetInt
(
"HomeWorkId"
),
StuUid
=
base
.
ReqParameters
.
GetInt
(
"StuId"
),
CourseId
=
base
.
ReqParameters
.
GetInt
(
"CourseId"
),
Times
=
0
,
Info
=
base
.
ReqParameters
.
GetString
(
"Info"
),
CreateType
=
2
,
};
model
.
ShowType
=
3
;
model
.
Status
=
0
;
model
.
CreateTime
=
System
.
DateTime
.
Now
;
model
.
CreateBy
=
base
.
BaseUserId
;
model
.
CreateByName
=
base
.
UserInfo
.
AccountName
;
var
flag
=
CourseService
.
SetStuComment
(
model
);
model
.
Details
=
list
;
var
flag
=
CourseService
.
BatchSetStuComment
(
model
,
commentType
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
@@ -416,12 +411,9 @@ namespace EduSpider.WebApi.Controllers
[
HttpGet
]
public
ApiResult
SetStuCommentInfo
()
{
var
model
=
new
RB_Stu_Comment
()
{
Id
=
base
.
ReqParameters
.
GetInt
(
"Id"
),
Info
=
base
.
ReqParameters
.
GetString
(
"Info"
),
};
var
flag
=
CourseService
.
SetStuComment
(
model
);
string
Id
=
base
.
ReqParameters
.
GetString
(
"Id"
);
string
Info
=
base
.
ReqParameters
.
GetString
(
"Info"
);
var
flag
=
CourseService
.
SetStuCommentDetailsInfo
(
Id
,
Info
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
@@ -436,7 +428,7 @@ namespace EduSpider.WebApi.Controllers
{
string
Ids
=
base
.
ReqParameters
.
GetString
(
"Ids"
);
int
ShowType
=
base
.
ReqParameters
.
GetInt
(
"ShowType"
);
var
flag
=
CourseService
.
SetStuCommentShowType
(
ShowType
,
Ids
);
var
flag
=
CourseService
.
SetStuComment
Details
ShowType
(
ShowType
,
Ids
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
@@ -466,7 +458,7 @@ namespace EduSpider.WebApi.Controllers
var
query
=
new
CourseQuery
()
{
CourseId
=
base
.
ReqParameters
.
GetInt
(
"CourseId"
),
CreateCommentType
=
1
//
CreateCommentType = 1
};
List
<
object
>
result
=
new
();
var
list
=
CourseService
.
GetCourseCommentTimesList
(
query
);
...
...
@@ -489,7 +481,9 @@ namespace EduSpider.WebApi.Controllers
}
result
.
Add
(
new
{
item
.
Id
,
item
.
Times
,
item
.
Title
,
item
.
CourseId
,
item
.
CreateType
,
CreateTypeStr
=
item
.
CreateType
==
1
?
"系统创建"
:
"老师创建"
,
...
...
@@ -512,13 +506,14 @@ namespace EduSpider.WebApi.Controllers
[
HttpGet
]
public
ApiResult
GetStuCommentList
()
{
var
query
=
new
CourseQuery
()
var
query
=
new
RB_Stu_CommentDetails_Extend
()
{
CourseId
=
base
.
ReqParameters
.
GetInt
(
"CourseId"
),
CommentTimes
=
base
.
ReqParameters
.
GetInt
(
"CommentTimes"
)
Times
=
base
.
ReqParameters
.
GetInt
(
"CommentTimes"
),
CommentMainId
=
base
.
ReqParameters
.
GetInt
(
"CommentMainId"
),
};
List
<
object
>
result
=
new
();
var
list
=
CourseService
.
GetStuCommentList
(
query
);
var
list
=
CourseService
.
GetStuComment
Details
List
(
query
);
if
(
list
.
Any
())
{
foreach
(
var
item
in
list
)
...
...
EduSpider.WebApi/Timers/TimedTaskServices.cs
View file @
62c03c5b
...
...
@@ -32,7 +32,7 @@ namespace EduSpider.WebApi.Timers
{
VTX
.
FW
.
Helper
.
LogHelper
.
WriteInfo
(
"StartAsync"
,
"定时任务被启动"
);
int
Interval
=
0
;
Interval
=
2
;
Interval
=
10000
;
//Interval = 1;
//绑定定时任务
//设置延迟时间
...
...
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