Commit 4bb317ba authored by 黄奎's avatar 黄奎

新增字段

parent d64363f0
...@@ -24,5 +24,13 @@ namespace EduSpider.IRepository ...@@ -24,5 +24,13 @@ namespace EduSpider.IRepository
/// <param name="query"></param> /// <param name="query"></param>
/// <returns></returns> /// <returns></returns>
public List<RB_Stu_Comment> GetStuCommentListRepository(CourseQuery query); 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);
} }
} }
...@@ -93,5 +93,13 @@ namespace EduSpider.IServices ...@@ -93,5 +93,13 @@ namespace EduSpider.IServices
/// <param name="query"></param> /// <param name="query"></param>
/// <returns></returns> /// <returns></returns>
public List<RB_Stu_Comment> GetStuCommentList(CourseQuery query); public List<RB_Stu_Comment> GetStuCommentList(CourseQuery query);
/// <summary>
/// 修改学员评论状态
/// </summary>
/// <param name="ShowType"></param>
/// <param name="Ids"></param>
/// <returns></returns>
public bool SetStuCommentShowType(int ShowType, string Ids);
} }
} }
...@@ -60,5 +60,9 @@ namespace EduSpider.Model.Entity ...@@ -60,5 +60,9 @@ namespace EduSpider.Model.Entity
/// </summary> /// </summary>
public string CreateByName { get; set; } public string CreateByName { get; set; }
/// <summary>
/// 显示类型(1-全部可见,2-部分可见,3-不可见)
/// </summary>
public int ShowType { get; set; }
} }
} }
...@@ -71,5 +71,17 @@ WHERE 1=1 ...@@ -71,5 +71,17 @@ WHERE 1=1
} }
return flag; return flag;
} }
/// <summary>
/// 修改学员评论状态
/// </summary>
/// <param name="ShowType"></param>
/// <param name="Ids"></param>
/// <returns></returns>
public bool SetStuCommentShowTypeRepository(int ShowType, string Ids)
{
string sql = string.Format("UPDATE RB_Stu_Comment SET ShowType={0} WHERE Id IN({1}) ", ShowType, Ids);
return base.Execute(sql) > 0;
}
} }
} }
...@@ -277,7 +277,7 @@ namespace EduSpider.Services ...@@ -277,7 +277,7 @@ namespace EduSpider.Services
item.student_name, item.student_name,
item.student_uid, item.student_uid,
item.score, item.score,
item.score_p, score_p=item.score_p*100,
add_time = VTX.FW.Helper.ConvertHelper.FormatDate(item.add_time) add_time = VTX.FW.Helper.ConvertHelper.FormatDate(item.add_time)
}); });
} }
...@@ -356,5 +356,16 @@ namespace EduSpider.Services ...@@ -356,5 +356,16 @@ namespace EduSpider.Services
var list = StuCommentRepository.GetStuCommentListRepository(query); var list = StuCommentRepository.GetStuCommentListRepository(query);
return list; return list;
} }
/// <summary>
/// 修改学员评论状态
/// </summary>
/// <param name="ShowType"></param>
/// <param name="Ids"></param>
/// <returns></returns>
public bool SetStuCommentShowType(int ShowType, string Ids)
{
return StuCommentRepository.SetStuCommentShowTypeRepository(ShowType, Ids);
}
} }
} }
...@@ -9,6 +9,7 @@ using VTX.FW.Api; ...@@ -9,6 +9,7 @@ using VTX.FW.Api;
using VTX.FW.Attr; using VTX.FW.Attr;
using VTX.FW.Helper; using VTX.FW.Helper;
using System.Linq; using System.Linq;
using EduSpider.Model.Query;
namespace EduSpider.WebApi.Controllers namespace EduSpider.WebApi.Controllers
{ {
...@@ -38,14 +39,14 @@ namespace EduSpider.WebApi.Controllers ...@@ -38,14 +39,14 @@ namespace EduSpider.WebApi.Controllers
TeacherIds = userInfo.AccountId.ToString(), TeacherIds = userInfo.AccountId.ToString(),
KeyWords = base.ReqParameters.GetString("KeyWords"), KeyWords = base.ReqParameters.GetString("KeyWords"),
}; };
//全部课程 //全部课程
List<object> AllCourseList = new(); List<object> AllCourseList = new();
//已结课 //已结课
List<object> FinishList = new(); List<object> FinishList = new();
//进行中 //进行中
List<object> NotFinishList = new(); List<object> NotFinishList = new();
var list = CourseService.GetTeacherCourseList(query).Where(qitem=>qitem.CourseStatus==1 || qitem.CompleteNum==qitem.TotalClassNum).ToList(); var list = CourseService.GetTeacherCourseList(query).Where(qitem => qitem.CourseStatus == 1 || qitem.CompleteNum == qitem.TotalClassNum).ToList();
if (list != null && list.Count > 0) if (list != null && list.Count > 0)
{ {
...@@ -61,7 +62,7 @@ namespace EduSpider.WebApi.Controllers ...@@ -61,7 +62,7 @@ namespace EduSpider.WebApi.Controllers
item.TeacherName, item.TeacherName,
}; };
AllCourseList.Add(obj); AllCourseList.Add(obj);
if (item.CompleteNum==item.TotalClassNum) if (item.CompleteNum == item.TotalClassNum)
{ {
FinishList.Add(obj); FinishList.Add(obj);
} }
...@@ -238,13 +239,13 @@ namespace EduSpider.WebApi.Controllers ...@@ -238,13 +239,13 @@ namespace EduSpider.WebApi.Controllers
{ {
var model = new RB_Stu_Comment() var model = new RB_Stu_Comment()
{ {
Id=base.ReqParameters.GetInt("Id"), Id = base.ReqParameters.GetInt("Id"),
HomeWorkId=base.ReqParameters.GetInt("HomeWorkId"), HomeWorkId = base.ReqParameters.GetInt("HomeWorkId"),
StuUid=base.ReqParameters.GetInt("StuUid"), StuUid = base.ReqParameters.GetInt("StuUid"),
CourseId=base.ReqParameters.GetInt("CourseId"), CourseId = base.ReqParameters.GetInt("CourseId"),
Times=base.ReqParameters.GetInt("Times"), Times = base.ReqParameters.GetInt("Times"),
Info=base.ReqParameters.GetString("Info"), Info = base.ReqParameters.GetString("Info"),
CreateType=base.ReqParameters.GetInt("CreateType"), CreateType = base.ReqParameters.GetInt("CreateType"),
}; };
model.CreateTime = System.DateTime.Now; model.CreateTime = System.DateTime.Now;
model.CreateBy = base.BaseUserId; model.CreateBy = base.BaseUserId;
...@@ -252,5 +253,37 @@ namespace EduSpider.WebApi.Controllers ...@@ -252,5 +253,37 @@ namespace EduSpider.WebApi.Controllers
var flag = CourseService.SetStuComment(model); var flag = CourseService.SetStuComment(model);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
[HttpPost]
[HttpGet]
/// <summary>
/// 修改学员评论状态
/// </summary>
/// <returns></returns>
public ApiResult SetStuCommentShowType()
{
string Ids = base.ReqParameters.GetString("Ids");
int ShowType = base.ReqParameters.GetInt("ShowType");
var flag = CourseService.SetStuCommentShowType(ShowType, Ids);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
[HttpPost]
[HttpGet]
/// <summary>
/// 获取学员评论列表
/// </summary>
/// <returns></returns>
public ApiResult GetStuCommentList()
{
var query = new CourseQuery()
{
};
var list = CourseService.GetStuCommentList(query);
return ApiResult.Success(data: list);
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment