Commit 9af65dff authored by 黄奎's avatar 黄奎

页面修改

parent 4f4a93ab
......@@ -20,6 +20,7 @@ using System.Text.RegularExpressions;
using VT.FW.DB;
using Edu.Repository.Grade;
using Edu.Common.Enum.Question;
using System.Threading.Tasks;
namespace Edu.Module.Course
{
......@@ -1165,26 +1166,36 @@ namespace Edu.Module.Course
/// </summary>
public void RunWordsUrlModule()
{
var list= course_WordsRepository.GetCourseWordsListRepository(new RB_Course_Words_Extend() {});
var list = course_WordsRepository.GetCourseWordsListRepository(new RB_Course_Words_Extend() { }).Where(qitem => string.IsNullOrEmpty(qitem.FileUrl)).ToList();
string newPath = @"G:\WebFile\EduSystem\CourseWords";
var fileList = Common.Plugin.FileHelper.GetFileList(newPath);
if (list != null && list.Count > 0 && fileList != null && fileList.Count > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>();
foreach (var item in list.Where(qitem=>string.IsNullOrEmpty(qitem.FileUrl)))
{
if (string.IsNullOrEmpty(item.FileUrl))
//Task.Run(() =>
//{
Dictionary<string, object> fileds = new Dictionary<string, object>();
foreach (var item in list.Where(qitem => string.IsNullOrEmpty(qitem.FileUrl)))
{
var tempWords = fileList.Where(qitem => (qitem.FileName.Replace("。","") == item.WordContent.ToUpper() + ".mp3") || (qitem.FileName.Replace("。", "") == item.WordContent.ToLower() + ".mp3") || (qitem.FileName.Replace("。", "") == item.WordWrite + ".mp3") || (qitem.FileName.Replace("。", "") == item.ChineseMean + ".mp3"))?.FirstOrDefault();
if (tempWords != null)
if (string.IsNullOrEmpty(item.FileUrl))
{
fileds.Clear();
string newFileUrl = @"/EduSystem/CourseWords/" + tempWords.FileName;
fileds.Add(nameof(RB_Course_Words_Extend.FileUrl), newFileUrl);
bool flag = course_WordsRepository.Update(fileds, new WhereHelper(nameof(RB_Course_Words_Extend.Id), item.Id));
var tempWords = fileList.Where(qitem => (qitem.FileName.ToLower() ==
item.WordContent.ToLower()
.Replace("(", "(")
.Replace(")", ")")
.Replace("~", "〜")
.Replace("。","")
.Replace(@"\n","") + ".mp3")
)?.FirstOrDefault();
if (tempWords != null)
{
fileds.Clear();
string newFileUrl = @"/EduSystem/CourseWords/" + tempWords.FileName;
fileds.Add(nameof(RB_Course_Words_Extend.FileUrl), newFileUrl);
bool flag = course_WordsRepository.Update(fileds, new WhereHelper(nameof(RB_Course_Words_Extend.Id), item.Id));
}
}
}
}
//});
}
}
......
......@@ -68,7 +68,7 @@ namespace Edu.WebApi.Controllers.User
[AllowAnonymous]
public ApiResult Test()
{
//new OrderModule().RunStudentadvisorModule();
return ApiResult.Success();
}
......
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