Commit d0fc17a3 authored by 黄奎's avatar 黄奎

页面修改

parent c0bd0207
using EduSpider.Model.Extend; using EduSpider.Model.Entity;
using EduSpider.Model.Extend;
using System.Collections.Generic; using System.Collections.Generic;
using VTX.FW.Config;
using VTX.FW.DB;
namespace EduSpider.IRepository namespace EduSpider.IRepository
{ {
/// <summary> /// <summary>
/// 课程评价配置详情仓储接口 /// 课程评价配置详情仓储接口
/// </summary> /// </summary>
public interface ICourseCommentDetailsRepository public interface ICourseCommentDetailsRepository:IDBRepository<RB_Course_CommentDetails>, IDependency
{ {
/// <summary> /// <summary>
/// 新增修改课程评价 /// 新增修改课程评价
......
...@@ -6,13 +6,15 @@ using System.Collections.Generic; ...@@ -6,13 +6,15 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using VTX.FW.Config;
using VTX.FW.DB;
namespace EduSpider.IRepository namespace EduSpider.IRepository
{ {
/// <summary> /// <summary>
/// 课程评价配置仓储接口 /// 课程评价配置仓储接口
/// </summary> /// </summary>
public interface ICourseCommentRepository public interface ICourseCommentRepository : IDBRepository<RB_Course_Comment>, IDependency
{ {
/// <summary> /// <summary>
/// 批量新增修改课程评价 /// 批量新增修改课程评价
......
using EduSpider.Model.Entity; using EduSpider.Model.Entity;
using EduSpider.Model.Query; using EduSpider.Model.Query;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using VTX.FW.Config;
using System.Text; using VTX.FW.DB;
using System.Threading.Tasks;
namespace EduSpider.IRepository namespace EduSpider.IRepository
{ {
/// <summary> /// <summary>
/// 学员评语仓储接口 /// 学员评语仓储接口
/// </summary> /// </summary>
public interface IStuCommentRepository public interface IStuCommentRepository:IDBRepository<RB_Stu_Comment>, IDependency
{ {
/// <summary> /// <summary>
/// 新增修改学员评语 /// 新增修改学员评语
......
...@@ -80,5 +80,11 @@ namespace EduSpider.IServices ...@@ -80,5 +80,11 @@ namespace EduSpider.IServices
/// <returns></returns> /// <returns></returns>
public bool DeleteCourseCommentDetail(string DetailIds); public bool DeleteCourseCommentDetail(string DetailIds);
/// <summary>
/// 新增修改学员评价
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetStuComment(RB_Stu_Comment model);
} }
} }
using EduSpider.IRepository; using EduSpider.IRepository;
using EduSpider.Model.Entity; using EduSpider.Model.Entity;
using EduSpider.Model.Extend; using EduSpider.Model.Extend;
using EduSpider.Repository.Base;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -12,7 +13,7 @@ namespace EduSpider.Repository ...@@ -12,7 +13,7 @@ namespace EduSpider.Repository
/// <summary> /// <summary>
/// 课程评价配置详情仓储接口实现 /// 课程评价配置详情仓储接口实现
/// </summary> /// </summary>
public class CourseCommentDetailsRepository : Base.BaseRepository<RB_Course_CommentDetails>, ICourseCommentDetailsRepository public class CourseCommentDetailsRepository : BaseRepository<RB_Course_CommentDetails>, ICourseCommentDetailsRepository
{ {
/// <summary> /// <summary>
/// 新增修改课程评价 /// 新增修改课程评价
...@@ -63,6 +64,7 @@ SELECT A.* ...@@ -63,6 +64,7 @@ SELECT A.*
FROM RB_Course_CommentDetails AS A FROM RB_Course_CommentDetails AS A
WHERE 1=1 WHERE 1=1
"); ");
builder.AppendFormat(" AND A.{0}=0 ", nameof(RB_Course_CommentDetails_Extend.Status));
if (query != null) if (query != null)
{ {
if (!string.IsNullOrEmpty(query.QCourseCommentIds)) if (!string.IsNullOrEmpty(query.QCourseCommentIds))
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using EduSpider.Model.Entity; using EduSpider.Model.Entity;
using EduSpider.Model.Extend; using EduSpider.Model.Extend;
using EduSpider.Model.Query; using EduSpider.Model.Query;
using EduSpider.Repository.Base;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
...@@ -11,7 +12,7 @@ namespace EduSpider.Repository ...@@ -11,7 +12,7 @@ namespace EduSpider.Repository
/// <summary> /// <summary>
/// 课程评价配置仓储接口实现 /// 课程评价配置仓储接口实现
/// </summary> /// </summary>
public class CourseCommentRepository : Base.BaseRepository<RB_Course_Comment>, ICourseCommentRepository public class CourseCommentRepository : BaseRepository<RB_Course_Comment>, ICourseCommentRepository
{ {
/// <summary> /// <summary>
/// 课程评价配置详情仓储对象 /// 课程评价配置详情仓储对象
...@@ -65,6 +66,7 @@ SELECT A.* ...@@ -65,6 +66,7 @@ SELECT A.*
FROM RB_Course_Comment AS A FROM RB_Course_Comment AS A
WHERE 1=1 WHERE 1=1
"); ");
builder.AppendFormat(" AND A.{0}=0 ", nameof(RB_Course_Comment_Extend.Status));
if (query != null) if (query != null)
{ {
if (query.CourseId > 0) if (query.CourseId > 0)
...@@ -93,7 +95,10 @@ WHERE 1=1 ...@@ -93,7 +95,10 @@ WHERE 1=1
public bool DeleteCourseCommentRepository(string Ids) public bool DeleteCourseCommentRepository(string Ids)
{ {
string sql = string.Format("UPDATE RB_Course_Comment SET Status=1 WHERE Id IN({0}) ", Ids); string sql = string.Format("UPDATE RB_Course_Comment SET Status=1 WHERE Id IN({0}) ", Ids);
string sql2= string.Format("UPDATE RB_Course_CommentDetails SET Status=1 WHERE CourseCommentId IN({0}) ", Ids);
base.Execute(sql2);
return base.Execute(sql) > 0; return base.Execute(sql) > 0;
} }
} }
} }
...@@ -36,10 +36,9 @@ WHERE 1=1 ...@@ -36,10 +36,9 @@ WHERE 1=1
} }
if (!string.IsNullOrEmpty(query.StuIds)) if (!string.IsNullOrEmpty(query.StuIds))
{ {
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Exam_Score_Extend.StuUId), query.StuIds); builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Exam_Score_Extend.StuId), query.StuIds);
} }
} }
return Get<RB_Exam_Score_Extend>(builder.ToString()).ToList(); return Get<RB_Exam_Score_Extend>(builder.ToString()).ToList();
} }
......
...@@ -59,7 +59,7 @@ WHERE 1=1 ...@@ -59,7 +59,7 @@ WHERE 1=1
{ {
Dictionary<string, object> fileds = new() Dictionary<string, object> fileds = new()
{ {
{nameof(RB_Stu_Comment.Info),model.Info } {nameof(RB_Stu_Comment.Info),model.Info },
}; };
flag = base.UpdateOne(fileds, new WhereHelper(nameof(RB_Stu_Comment.Id), model.Id)); flag = base.UpdateOne(fileds, new WhereHelper(nameof(RB_Stu_Comment.Id), model.Id));
} }
......
...@@ -67,6 +67,12 @@ namespace EduSpider.Services ...@@ -67,6 +67,12 @@ namespace EduSpider.Services
[Autowired] [Autowired]
public ICourseCommentDetailsRepository CourseCommentDetailsRepository { get; set; } public ICourseCommentDetailsRepository CourseCommentDetailsRepository { get; set; }
/// <summary>
/// 学员评价仓储层接口
/// </summary>
[Autowired]
public IStuCommentRepository StuCommentRepository { get; set; }
/// <summary> /// <summary>
...@@ -314,5 +320,15 @@ namespace EduSpider.Services ...@@ -314,5 +320,15 @@ namespace EduSpider.Services
{ {
return CourseCommentDetailsRepository.DeleteCourseCommentDetailsRepository(DetailIds); return CourseCommentDetailsRepository.DeleteCourseCommentDetailsRepository(DetailIds);
} }
/// <summary>
/// 新增修改学员评价
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetStuComment(RB_Stu_Comment model)
{
return StuCommentRepository.SetStuCommentRepository(model);
}
} }
} }
using EduSpider.IServices; using EduSpider.IServices;
using EduSpider.Model.Entity;
using EduSpider.Model.Extend; using EduSpider.Model.Extend;
using EduSpider.WebApi.Controllers.Base; using EduSpider.WebApi.Controllers.Base;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
...@@ -16,7 +17,6 @@ namespace EduSpider.WebApi.Controllers ...@@ -16,7 +17,6 @@ namespace EduSpider.WebApi.Controllers
public class TeacherController : BaseController public class TeacherController : BaseController
{ {
/// <summary> /// <summary>
/// 课程仓储接口 /// 课程仓储接口
/// </summary> /// </summary>
...@@ -223,5 +223,33 @@ namespace EduSpider.WebApi.Controllers ...@@ -223,5 +223,33 @@ namespace EduSpider.WebApi.Controllers
var flag = CourseService.DeleteCourseCommentDetail(DetailIds); var flag = CourseService.DeleteCourseCommentDetail(DetailIds);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
[HttpPost]
[HttpGet]
/// <summary>
/// 新增修改学员评价
/// </summary>
/// <returns></returns>
public ApiResult SetStuComment()
{
var model = new RB_Stu_Comment()
{
Id=base.ReqParameters.GetInt("Id"),
HomeWorkId=base.ReqParameters.GetInt("HomeWorkId"),
StuUid=base.ReqParameters.GetInt("StuUid"),
CourseId=base.ReqParameters.GetInt("CourseId"),
Times=base.ReqParameters.GetInt("Times"),
Info=base.ReqParameters.GetString("Info"),
CreateType=base.ReqParameters.GetInt("CreateType"),
};
model.CreateTime = System.DateTime.Now;
model.CreateBy = base.BaseUserId;
model.CreateByName = base.UserInfo.AccountName;
var flag = CourseService.SetStuComment(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
} }
} }
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