Commit abdc31b7 authored by 黄奎's avatar 黄奎

页面修改

parent 67213dd1
......@@ -881,8 +881,10 @@ namespace Edu.Module.Course
oldCourseRate = chapterRepository.GetEntity(model.ChapterId)?.CourseRate ?? Common.Enum.Course.CourseRateEnum.OTHER;
}
flag = chapterRepository.Update(fileds, new WhereHelper(nameof(RB_Course_Chapter_ViewModel.ChapterId), model.ChapterId));
if (flag && model.ParentId == 0) {
if (oldCourseRate != model.CourseRate) {
if (flag && model.ParentId == 0)
{
if (oldCourseRate != model.CourseRate)
{
//修改了等级了 重新初始化
System.Threading.Tasks.Task.Run(() =>
{
......@@ -893,7 +895,8 @@ namespace Edu.Module.Course
}
else
{
if (model.ParentId == 0) {
if (model.ParentId == 0)
{
//查询当前等级对应的NO
int CourseGradeId = chapterRepository.GetMaxChapterGradeNo(model.CourseId, model.ChapterNo, model.CourseRate, model.Group_Id);
model.ChapterGradeNo = CourseGradeId + 1;
......@@ -1073,18 +1076,9 @@ namespace Edu.Module.Course
var courseList = chapterRepository.GetCourseChapterListExtRepository();
if (courseList != null && courseList.Count > 0)
{
foreach (var item in courseList)
var tempCourseList = courseList.Where(qitem => qitem.CourseId == 58 || qitem.CourseId == 10);
foreach (var item in tempCourseList)
{
//if (item.CourseId == 285 || item.CourseId == 215 )
//{
// continue;
//}
//else
//{
//}
List<RB_Course_Chapter_ViewModel> result = new List<RB_Course_Chapter_ViewModel>();
var chapterQuery = new RB_Course_Chapter_ViewModel() { CourseId = item.CourseId };
var sourceList = GetChapterListModule(chapterQuery,isQueryWords:true);
......@@ -1147,14 +1141,14 @@ namespace Edu.Module.Course
}
index++;
}
chapterRepository.DeleteByCourseIdRepository(item.CourseId);
course_WordsRepository.DeleteWordsByCourseIdRepository(item.CourseId);
//chapterRepository.DeleteByCourseIdRepository(item.CourseId);
//course_WordsRepository.DeleteWordsByCourseIdRepository(item.CourseId);
chapterRepository.SetBatchInsertCourseChapterRepository(result);
if (wordsList != null && wordsList.Count > 0)
{
course_WordsRepository.BatchInsertCourseWordsRepository(wordsList);
}
//chapterRepository.SetBatchInsertCourseChapterRepository(result);
//if (wordsList != null && wordsList.Count > 0)
//{
// course_WordsRepository.BatchInsertCourseWordsRepository(wordsList);
//}
}
string str = Common.Plugin.JsonHelper.Serialize(result);
}
......
......@@ -127,6 +127,9 @@ namespace Edu.Repository.Course
/// <param name="param"></param>
/// <returns></returns>
public bool SetBatchCurrentHoursRepository(List<RB_Course_Chapter_ViewModel> param)
{
bool flag = false;
try
{
StringBuilder builder = new StringBuilder();
builder.Append("INSERT INTO rb_course_chapter (ChapterId, CurrentHours) VALUES");
......@@ -136,7 +139,13 @@ namespace Edu.Repository.Course
});
builder = builder.Remove(builder.Length - 1, 1);
builder.Append("ON DUPLICATE KEY UPDATE CurrentHours=VALUES(CurrentHours);");
return Execute(builder.ToString()) > 0;
flag= Execute(builder.ToString()) > 0;
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "SetBatchCurrentHoursRepository");
}
return flag;
}
/// <summary>
......
......@@ -671,7 +671,6 @@ namespace Edu.WebApi.Controllers.Course
Objectives = base.ParmJObj.GetStringValue("Objectives"),
Requirement = base.ParmJObj.GetStringValue("Requirement"),
CourseRate = (CourseRateEnum)base.ParmJObj.GetInt("CourseRate"),
//CurrentHours=base.ParmJObj.GetInt("CurrentHours"),
};
extModel.Status = DateStateEnum.Normal;
......
......@@ -147,7 +147,7 @@ namespace Edu.WebApi.Timers
marketTimer = new System.Timers.Timer()
{
Interval = (1000 * 60) * (60*1) //5分钟执行一次
Interval = (1000 * 60) * (20) //20分钟执行一次
};
marketTimer.Elapsed += new System.Timers.ElapsedEventHandler(DealMarketConsultantData);
marketTimer.Enabled = true;
......
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