Commit d8357e37 authored by liudong1993's avatar liudong1993
parents 58716f5a 4aed7e8b
using EduSpider.Model.Entity;
using EduSpider.Model.Extend;
using System.Collections.Generic;
using VTX.FW.Config;
using VTX.FW.DB;
namespace EduSpider.IRepository
{
/// <summary>
/// 课程评价配置详情仓储接口
/// </summary>
public interface ICourseCommentDetailsRepository:IDBRepository<RB_Course_CommentDetails>, IDependency
{
/// <summary>
/// 新增修改课程评价
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public bool SetCourseCommentDetailsRepository(List<RB_Course_CommentDetails_Extend> list);
/// <summary>
/// 获取课程评价配置列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Course_CommentDetails_Extend> GetCourseCommentDetailsListRepository(RB_Course_CommentDetails_Extend query);
/// <summary>
/// 根据编号删除课程评价详情配置
/// </summary>
/// <param name="DetailIds"></param>
/// <returns></returns>
public bool DeleteCourseCommentDetailsRepository(string DetailIds);
}
}
using EduSpider.Model.Entity;
using EduSpider.Model.Extend;
using EduSpider.Model.Query;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VTX.FW.Config;
using VTX.FW.DB;
namespace EduSpider.IRepository
{
/// <summary>
/// 课程评价配置仓储接口
/// </summary>
public interface ICourseCommentRepository : IDBRepository<RB_Course_Comment>, IDependency
{
/// <summary>
/// 批量新增修改课程评价
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetCourseCommentRepository(RB_Course_Comment_Extend model);
/// <summary>
/// 获取课程评价配置列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Course_Comment_Extend> GetCourseCommentListRepository(CourseQuery query);
/// <summary>
/// 根据编号删除课程评价
/// </summary>
/// <param name="Ids"></param>
/// <returns></returns>
public bool DeleteCourseCommentRepository(string Ids);
}
}
using EduSpider.Model.Entity;
using EduSpider.Model.Query;
using System.Collections.Generic;
using VTX.FW.Config;
using VTX.FW.DB;
namespace EduSpider.IRepository
{
/// <summary>
/// 学员评语仓储接口
/// </summary>
public interface IStuCommentRepository:IDBRepository<RB_Stu_Comment>, IDependency
{
/// <summary>
/// 新增修改学员评语
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetStuCommentRepository(RB_Stu_Comment model);
/// <summary>
/// 查询学员评语列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Stu_Comment> GetStuCommentListRepository(CourseQuery query);
}
}
......@@ -22,7 +22,7 @@ namespace EduSpider.IServices
/// <returns></returns>
public List<RB_Course_Student_Extend> GetStuCourseList(CourseQuery query);
/// <summary>
/// 获取学员考试和家庭作业列表
/// </summary>
......@@ -50,5 +50,41 @@ namespace EduSpider.IServices
/// <param name="query"></param>
/// <returns></returns>
public List<object> GetHomeWorkDetails(CourseQuery query);
/// <summary>
/// 新增修改课程评价配置
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetCourseComment(RB_Course_Comment_Extend model);
/// <summary>
/// 获取课程评价配置列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Course_Comment_Extend> GetCourseCommentList(CourseQuery query);
/// <summary>
/// 根据评价编号删除课程评价配置
/// </summary>
/// <param name="Ids"></param>
/// <returns></returns>
public bool DeleteCourseComment(string Ids);
/// <summary>
/// 根据编号删除课程评价详情配置
/// </summary>
/// <param name="DetailIds"></param>
/// <returns></returns>
public bool DeleteCourseCommentDetail(string DetailIds);
/// <summary>
/// 新增修改学员评价
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetStuComment(RB_Stu_Comment model);
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VTX.FW.Attr;
namespace EduSpider.Model.Entity
{
/// <summary>
/// 课程评价配置实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Course_Comment
{
/// <summary>
/// 编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 课程编号
/// </summary>
public int CourseId { get; set; }
/// <summary>
/// 评价标题
/// </summary>
public string Title { get; set; }
/// <summary>
/// 显示类型(1-全部可见,2-部分可见,3-不可见)
/// </summary>
public int ShowType { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 删除状态(0-正常,1-删除)
/// </summary>
public int Status { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VTX.FW.Attr;
namespace EduSpider.Model.Entity
{
/// <summary>
/// 课程评价配置详情实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Course_CommentDetails
{
/// <summary>
/// 课程评价详情主键编号
/// </summary>
public int DetailId { get; set; }
/// <summary>
/// 课程评价主表编号
/// </summary>
public int CourseCommentId { get; set; }
/// <summary>
/// 开始值
/// </summary>
public decimal StartNum { get; set; }
/// <summary>
/// 结束值
/// </summary>
public decimal EndNum { get; set; }
/// <summary>
/// 评价内容
/// </summary>
public string Info { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public int 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; }
}
}
using System;
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 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; }
}
}
using EduSpider.Model.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EduSpider.Model.Extend
{
/// <summary>
/// 课程评价配置详情扩展实体类
/// </summary>
public class RB_Course_CommentDetails_Extend : RB_Course_CommentDetails
{
/// <summary>
/// 课程评价配置编号【查询使用】
/// </summary>
public string QCourseCommentIds { get; set; }
}
}
using EduSpider.Model.Entity;
using System.Collections.Generic;
namespace EduSpider.Model.Extend
{
/// <summary>
/// 课程评价配置扩展实体类
/// </summary>
public class RB_Course_Comment_Extend : RB_Course_Comment
{
/// <summary>
/// 课程评价配置详情列表
/// </summary>
public List<RB_Course_CommentDetails_Extend> CommentDetails { get; set; }
}
}
using EduSpider.IRepository;
using EduSpider.Model.Entity;
using EduSpider.Model.Extend;
using EduSpider.Repository.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EduSpider.Repository
{
/// <summary>
/// 课程评价配置详情仓储接口实现
/// </summary>
public class CourseCommentDetailsRepository : BaseRepository<RB_Course_CommentDetails>, ICourseCommentDetailsRepository
{
/// <summary>
/// 新增修改课程评价
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public bool SetCourseCommentDetailsRepository(List<RB_Course_CommentDetails_Extend> list)
{
bool flag = true;
if (list != null && list.Count > 0)
{
foreach (var item in list)
{
if (flag)
{
if (item.DetailId > 0)
{
Dictionary<string, object> fileds = new()
{
{nameof(RB_Course_CommentDetails.StartNum),item.StartNum },
{nameof(RB_Course_CommentDetails.EndNum),item.EndNum },
{nameof(RB_Course_CommentDetails.Info),item.Info },
};
flag = base.UpdateOne(fileds, new VTX.FW.DB.WhereHelper(nameof(RB_Course_CommentDetails.DetailId), item.DetailId));
}
else
{
var newId = base.Insert(item);
item.DetailId = newId;
flag = newId > 0;
}
}
}
}
return flag;
}
/// <summary>
/// 获取课程评价配置列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Course_CommentDetails_Extend> GetCourseCommentDetailsListRepository(RB_Course_CommentDetails_Extend query)
{
StringBuilder builder = new();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Course_CommentDetails AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}=0 ", nameof(RB_Course_CommentDetails_Extend.Status));
if (query != null)
{
if (!string.IsNullOrEmpty(query.QCourseCommentIds))
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Course_CommentDetails_Extend.CourseCommentId), query.QCourseCommentIds);
}
}
return Get<RB_Course_CommentDetails_Extend>(builder.ToString()).ToList();
}
/// <summary>
/// 根据编号删除课程评价详情配置
/// </summary>
/// <param name="DetailIds"></param>
/// <returns></returns>
public bool DeleteCourseCommentDetailsRepository(string DetailIds)
{
string sql = string.Format("UPDATE RB_Course_CommentDetails SET Status=1 WHERE DetailId IN({0}) ", DetailIds);
return base.Execute(sql) > 0;
}
}
}
using EduSpider.IRepository;
using EduSpider.Model.Entity;
using EduSpider.Model.Extend;
using EduSpider.Model.Query;
using EduSpider.Repository.Base;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace EduSpider.Repository
{
/// <summary>
/// 课程评价配置仓储接口实现
/// </summary>
public class CourseCommentRepository : BaseRepository<RB_Course_Comment>, ICourseCommentRepository
{
/// <summary>
/// 课程评价配置详情仓储对象
/// </summary>
private readonly CourseCommentDetailsRepository courseCommentDetailsRepository = new();
/// <summary>
/// 批量新增修改课程评价
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetCourseCommentRepository(RB_Course_Comment_Extend model)
{
bool flag;
if (model.Id > 0)
{
Dictionary<string, object> fileds = new()
{
{ nameof(RB_Course_Comment_Extend.Title), model.Title },
{ nameof(RB_Course_Comment_Extend.ShowType), model.ShowType },
};
flag = base.UpdateOne(fileds, new VTX.FW.DB.WhereHelper(nameof(RB_Course_Comment_Extend.Id), model.Id));
}
else
{
var newId = base.Insert(model);
model.Id = newId;
flag = newId > 0;
}
if (model.CommentDetails != null && model.CommentDetails.Count > 0)
{
foreach (var item in model.CommentDetails)
{
item.CourseCommentId = model.Id;
}
flag = courseCommentDetailsRepository.SetCourseCommentDetailsRepository(model.CommentDetails);
}
return flag;
}
/// <summary>
/// 获取课程评价配置列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Course_Comment_Extend> GetCourseCommentListRepository(CourseQuery query)
{
StringBuilder builder = new();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Course_Comment AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}=0 ", nameof(RB_Course_Comment_Extend.Status));
if (query != null)
{
if (query.CourseId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_Comment_Extend.CourseId), query.CourseId);
}
}
var list = Get<RB_Course_Comment_Extend>(builder.ToString()).ToList();
if (list != null && list.Count > 0)
{
string Ids = string.Join(",", list.Select(qitem => qitem.Id));
List<RB_Course_CommentDetails_Extend> detailsList = courseCommentDetailsRepository.GetCourseCommentDetailsListRepository(new RB_Course_CommentDetails_Extend() { QCourseCommentIds = Ids });
foreach (var item in list)
{
item.CommentDetails = detailsList?.Where(qitem => qitem.CourseCommentId == item.Id)?.ToList() ?? new List<RB_Course_CommentDetails_Extend>();
}
}
return list;
}
/// <summary>
/// 根据编号删除课程评价配置
/// </summary>
/// <param name="Ids"></param>
/// <returns></returns>
public bool DeleteCourseCommentRepository(string 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;
}
}
}
......@@ -36,10 +36,9 @@ WHERE 1=1
}
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();
}
......
using EduSpider.IRepository;
using EduSpider.Model.Entity;
using EduSpider.Model.Query;
using EduSpider.Repository.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VTX.FW.DB;
namespace EduSpider.Repository
{
/// <summary>
/// 学员评语仓储接口实现
/// </summary>
public class StuCommentRepository : BaseRepository<RB_Stu_Comment>, IStuCommentRepository
{
/// <summary>
/// 获取学员评语列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Stu_Comment> GetStuCommentListRepository(CourseQuery query)
{
StringBuilder builder = new();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Stu_Comment AS A
WHERE 1=1
");
if (query != null)
{
if (query.CourseId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Stu_Comment.CourseId), query.CourseId);
}
if (!string.IsNullOrWhiteSpace(query.StuIds))
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Stu_Comment.StuUid), query.StuIds);
}
if (query.HomeWorkId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Stu_Comment.HomeWorkId), query.HomeWorkId);
}
}
return Get<RB_Stu_Comment>(builder.ToString()).ToList();
}
/// <summary>
/// 新增修改学员评语
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetStuCommentRepository(RB_Stu_Comment model)
{
bool flag;
if (model.Id > 0)
{
Dictionary<string, object> fileds = new()
{
{nameof(RB_Stu_Comment.Info),model.Info },
};
flag = base.UpdateOne(fileds, new WhereHelper(nameof(RB_Stu_Comment.Id), model.Id));
}
else
{
var newId = base.Insert(model);
model.Id = newId;
flag = newId > 0;
}
return flag;
}
}
}
......@@ -3,6 +3,7 @@ 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;
......@@ -19,6 +20,11 @@ namespace EduSpider.Repository
/// </summary>
private readonly CommentRepository commentRepository = new();
/// <summary>
/// 学员评论仓储层对象
/// </summary>
private readonly StuCommentRepository stuCommentRepository = new();
/// <summary>
/// 批量添加学生家庭作业
/// </summary>
......@@ -99,6 +105,7 @@ WHERE 1=1
RowNum++;
}
}
var commentList= stuCommentRepository.GetStuCommentListRepository(new CourseQuery() { CourseId = query.CourseId, StuIds = query.StuIds });
ExamWorkResult firstComment = null;
ExamWorkResult secondComment = null;
......@@ -117,7 +124,16 @@ WHERE 1=1
Title = firstList.LastOrDefault().ThName + "老师的评语",
Comment = commentModel?.Info
};
stuCommentRepository.Insert(new RB_Stu_Comment()
{
Id = 0,
CourseId = query.CourseId,
StuUid = Convert.ToInt32(query.StuIds),
Info = commentModel?.Info,
CreateByName = firstList.LastOrDefault().ThName,
CreateTime = firstList.LastOrDefault().CreateTime.AddMinutes(1),
Times = 1
});
}
if (homeWorkList.Count >= 9)
{
......@@ -131,6 +147,17 @@ WHERE 1=1
Title = secondList.LastOrDefault().ThName + "老师的评语",
Comment = commentModel?.Info
};
stuCommentRepository.Insert(new RB_Stu_Comment()
{
Id = 0,
CourseId = query.CourseId,
StuUid = Convert.ToInt32(query.StuIds),
Info = commentModel?.Info,
CreateByName = secondList.LastOrDefault().ThName,
CreateTime = secondList.LastOrDefault().CreateTime.AddMinutes(1),
Times = 2
});
}
if (homeWorkList.Count >= 13)
{
......@@ -144,6 +171,16 @@ WHERE 1=1
Title = thirdList.LastOrDefault().ThName + "老师的评语",
Comment = commentModel?.Info
};
stuCommentRepository.Insert(new RB_Stu_Comment()
{
Id = 0,
CourseId = query.CourseId,
StuUid = Convert.ToInt32(query.StuIds),
Info = commentModel?.Info,
CreateByName = thirdList.LastOrDefault().ThName,
CreateTime = thirdList.LastOrDefault().CreateTime.AddMinutes(1),
Times =3
});
}
}
......
......@@ -55,7 +55,25 @@ namespace EduSpider.Services
[Autowired]
public IExam_ScoreRepository Exam_ScoreRepository { get; set; }
/// <summary>
/// 课程评价配置仓储接口
/// </summary>
[Autowired]
public ICourseCommentRepository CourseCommentRepository { get; set; }
/// <summary>
/// 课程评价详情配置仓储接口
/// </summary>
[Autowired]
public ICourseCommentDetailsRepository CourseCommentDetailsRepository { get; set; }
/// <summary>
/// 学员评价仓储层接口
/// </summary>
[Autowired]
public IStuCommentRepository StuCommentRepository { get; set; }
/// <summary>
/// 获取学员课程列表
......@@ -112,8 +130,8 @@ namespace EduSpider.Services
Score_p = score_p,
ExamRank = item.Rank,
ExamRankRate = item.RankRate,
ExamId= item.ExamId,
ExamScoreId=item.Id,
ExamId = item.ExamId,
ExamScoreId = item.Id,
});
}
}
......@@ -171,7 +189,7 @@ namespace EduSpider.Services
item.ResultType,
item.ResultTypeStr,
item.Title,
TimeTile=subTitle,
TimeTile = subTitle,
CreateTime = createTime,
DataObj = obj
});
......@@ -253,13 +271,64 @@ namespace EduSpider.Services
{
HomeWorkId = item.homework_id,
HomeWorkTitle = item.Homework_title,
Status= item.status,
Status = item.status,
StatusStr = str,
});
}
}
return result;
}
/// <summary>
/// 新增修改课程评价配置
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetCourseComment(RB_Course_Comment_Extend model)
{
return CourseCommentRepository.SetCourseCommentRepository(model);
}
/// <summary>
/// 获取课程评价配置列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Course_Comment_Extend> GetCourseCommentList(CourseQuery query)
{
var list = CourseCommentRepository.GetCourseCommentListRepository(query);
return list;
}
/// <summary>
/// 根据评价编号删除课程评价配置
/// </summary>
/// <param name="Ids"></param>
/// <returns></returns>
public bool DeleteCourseComment(string Ids)
{
return CourseCommentRepository.DeleteCourseCommentRepository(Ids);
}
/// <summary>
/// 根据编号删除课程评价详情配置
/// </summary>
/// <param name="DetailIds"></param>
/// <returns></returns>
public bool DeleteCourseCommentDetail(string 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.Model.Entity;
using EduSpider.Model.Extend;
using EduSpider.WebApi.Controllers.Base;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
using VTX.FW.Api;
using VTX.FW.Attr;
......@@ -13,6 +16,7 @@ namespace EduSpider.WebApi.Controllers
/// </summary>
public class TeacherController : BaseController
{
/// <summary>
/// 课程仓储接口
/// </summary>
......@@ -30,7 +34,7 @@ namespace EduSpider.WebApi.Controllers
var query = new Model.Query.CourseQuery()
{
TeacherIds = base.BaseUserId.ToString(),
KeyWords=base.ReqParameters.GetString("KeyWords"),
KeyWords = base.ReqParameters.GetString("KeyWords"),
};
//全部课程
List<object> AllCourseList = new();
......@@ -39,7 +43,7 @@ namespace EduSpider.WebApi.Controllers
//进行中
List<object> NotFinishList = new();
var list = CourseService.GetTeacherCourseList(query);
if (list != null && list.Count > 0)
{
foreach (var item in list)
......@@ -128,5 +132,122 @@ namespace EduSpider.WebApi.Controllers
var list = CourseService.GetHomeWorkDetails(query);
return ApiResult.Success(data: list);
}
/// <summary>
/// 获取课程评语列表
/// </summary>
/// <returns></returns>
[HttpPost]
[HttpGet]
public ApiResult GetCourseCommentList()
{
var query = new Model.Query.CourseQuery()
{
CourseId = base.ReqParameters.GetInt("CourseId")
};
var list = CourseService.GetCourseCommentList(query);
return ApiResult.Success(data: list);
}
/// <summary>
/// 新增可以课程评语
/// </summary>
/// <returns></returns>
[HttpPost]
[HttpGet]
public ApiResult SetCourseComment()
{
var model = new RB_Course_Comment_Extend()
{
Id = base.ReqParameters.GetInt("Id"),
CourseId = base.ReqParameters.GetInt("CourseId"),
Title = base.ReqParameters.GetString("Title"),
ShowType = base.ReqParameters.GetInt("ShowType"),
};
model.CreateBy = base.BaseUserId;
model.CreateTime = System.DateTime.Now;
model.Status = 0;
model.CommentDetails = new List<RB_Course_CommentDetails_Extend>();
string commentDetails = base.ReqParameters.GetString("CommentDetails");
if (!string.IsNullOrWhiteSpace(commentDetails))
{
JArray array = JArray.Parse(commentDetails);
if (array != null && array.Count > 0)
{
foreach (var jItem in array)
{
var sObj = JObject.Parse(jItem.ToString());
var details = new RB_Course_CommentDetails_Extend()
{
DetailId = sObj.GetInt("DetailId"),
CourseCommentId = sObj.GetInt("CourseCommentId"),
StartNum = sObj.GetDecimal("StartNum"),
EndNum = sObj.GetDecimal("EndNum"),
Info = sObj.GetString("Info"),
Status = 0,
CreateBy = base.BaseUserId,
CreateTime = System.DateTime.Now,
UpdateBy = base.BaseUserId,
UpdateTime = System.DateTime.Now,
};
model.CommentDetails.Add(details);
}
}
}
var flag = CourseService.SetCourseComment(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 删除课程评语
/// </summary>
/// <returns></returns>
[HttpPost]
[HttpGet]
public ApiResult RemoveCourseComment()
{
string Ids = base.ReqParameters.GetString("Ids");
var flag = CourseService.DeleteCourseComment(Ids);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 根据编号删除课程评价详情配置
/// </summary>
/// <returns></returns>
[HttpPost]
[HttpGet]
public ApiResult RemoveCourseCommentDetail()
{
string DetailIds = base.ReqParameters.GetString("DetailIds");
var flag = CourseService.DeleteCourseCommentDetail(DetailIds);
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();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DeleteExistingFiles>False</DeleteExistingFiles>
<ExcludeApp_Data>False</ExcludeApp_Data>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>G:\Publish\jinjieapi.oytour.com</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
</PropertyGroup>
</Project>
\ No newline at end of file
......@@ -14,9 +14,9 @@ namespace TicketSpider.Spiders.ClassInRule
public class ClassInAccountManager
{
private static object lockerSafe= new object();
private static readonly object lockerSafe= new();
private static string _loginCookies = null;//"locationArgumentLang=zh-CN; sensorsdata2015jssdkcross={\"distinct_id\":\"12780052\",\"first_id\":\"180e074a47f92f-06489d0bb8915b-6b3e555b-1327104-180e074a4805d2\",\"props\":{\"$latest_traffic_source_type\":\"直接流量\",\"$latest_search_keyword\":\"未取到值_直接打开\",\"$latest_referrer\":\"\"},\"$device_id\":\"180e074a47f92f-06489d0bb8915b-6b3e555b-1327104-180e074a4805d2\"}; _eeos_uid=12780052; _eeos_useraccount=18140082327; _eeos_userlogo=/upload/images/20200126/709df9532bee722f2268_70.jpg; _eeos_domain=.eeo.cn; _eeos_sid=12780052; _eeos_nsid=kspGu2gfMu+U2EFgLpSGyg==; __tk_id=5792ca4f7a6655c40c4431fbdb729da4; PHPSESSID=l5aanmebp5lvpcbg630ccfha37; _eeos_traffic=EqlIOFq4S2hz5FTTtHzNUViBYcWCixrJYMCF6Y5yJuD8eq8ZwPvVSHMvUkLFA5lzNoaTrDBpGhEY7ykZ9lwMAsNJoNiDt2xKQBr9csRmiBE=";
private static string _loginCookies = "";//"locationArgumentLang=zh-CN; sensorsdata2015jssdkcross={\"distinct_id\":\"12780052\",\"first_id\":\"180e074a47f92f-06489d0bb8915b-6b3e555b-1327104-180e074a4805d2\",\"props\":{\"$latest_traffic_source_type\":\"直接流量\",\"$latest_search_keyword\":\"未取到值_直接打开\",\"$latest_referrer\":\"\"},\"$device_id\":\"180e074a47f92f-06489d0bb8915b-6b3e555b-1327104-180e074a4805d2\"}; _eeos_uid=12780052; _eeos_useraccount=18140082327; _eeos_userlogo=/upload/images/20200126/709df9532bee722f2268_70.jpg; _eeos_domain=.eeo.cn; _eeos_sid=12780052; _eeos_nsid=kspGu2gfMu+U2EFgLpSGyg==; __tk_id=5792ca4f7a6655c40c4431fbdb729da4; PHPSESSID=l5aanmebp5lvpcbg630ccfha37; _eeos_traffic=EqlIOFq4S2hz5FTTtHzNUViBYcWCixrJYMCF6Y5yJuD8eq8ZwPvVSHMvUkLFA5lzNoaTrDBpGhEY7ykZ9lwMAsNJoNiDt2xKQBr9csRmiBE=";
private static bool _openHeartTimer = false;
......@@ -183,7 +183,7 @@ namespace TicketSpider.Spiders.ClassInRule
var bgX = GetBoundary(fileBgPath,fileBlockPath);
Console.WriteLine($"读取背景缺口边界X坐标: {bgX}");
Actions action = new Actions(driver);
Actions action = new(driver);
var sliderButton = driver.FindElement(By.Id("tcaptcha_drag_button"));
if (sliderButton != null)
{
......
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