课程管理、课程场景、题库、试卷、课程分类新增内置字段

master
xiaochanghai 3 months ago
parent 00f6ead2c6
commit 2b44bf6361
  1. 2
      Tiobon.Core.Model/Base/Ghre/Ghre_Course.Dto.Base.cs
  2. 2
      Tiobon.Core.Model/Base/Ghre/Ghre_CourseClass.Dto.Base.cs
  3. 2
      Tiobon.Core.Model/Base/Ghre/Ghre_CourseScene.Dto.Base.cs
  4. 2
      Tiobon.Core.Model/Base/Ghre/Ghre_ExamPaper.Dto.Base.cs
  5. 2
      Tiobon.Core.Model/Base/Ghre/Ghre_Question.Dto.Base.cs
  6. 2
      Tiobon.Core.Model/Models/Ghre/Ghre_Course.cs
  7. 2
      Tiobon.Core.Model/Models/Ghre/Ghre_CourseClass.cs
  8. 2
      Tiobon.Core.Model/Models/Ghre/Ghre_CourseScene.cs
  9. 2
      Tiobon.Core.Model/Models/Ghre/Ghre_ExamPaper.cs
  10. 2
      Tiobon.Core.Model/Models/Ghre/Ghre_Question.cs
  11. 1
      Tiobon.Core.Model/View/Ghre/Ghre_Course.Dto.View.cs
  12. 4
      Tiobon.Core.Model/View/Ghre/Ghre_CourseClass.Dto.View.cs
  13. 1
      Tiobon.Core.Model/View/Ghre/Ghre_CourseScene.Dto.View.cs
  14. 1
      Tiobon.Core.Model/View/Ghre/Ghre_ExamPaper.Dto.View.cs
  15. 1
      Tiobon.Core.Model/View/Ghre/Ghre_MultipleTitle.Dto.View.cs
  16. 3
      Tiobon.Core.Model/View/Ghre/Ghre_Question.Dto.View.cs
  17. 10
      Tiobon.Core.Services/Ghre/Ghre_CourseClassServices.cs
  18. 14
      Tiobon.Core.Services/Ghre/Ghre_CourseSceneServices.cs
  19. 1
      Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs
  20. 4
      Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs
  21. 1
      Tiobon.Core.Services/Ghre/Ghre_MultipleTitleServices.cs
  22. 55
      Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs
  23. 5
      Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs

@ -278,5 +278,5 @@ public class Ghre_CourseBase
/// <summary>
/// 内置
/// </summary>
public bool? BuiltIn { get; set; }
public int? BuiltIn { get; set; }
}

@ -124,5 +124,5 @@ public class Ghre_CourseClassBase
/// <summary>
/// 内置
/// </summary>
public bool? BuiltIn { get; set; }
public int? BuiltIn { get; set; }
}

@ -164,7 +164,7 @@ public class Ghre_CourseSceneBase
/// <summary>
/// 内置
/// </summary>
public bool? BuiltIn { get; set; }
public int? BuiltIn { get; set; }
/// <summary>
/// 课程列表

@ -193,5 +193,5 @@ public class Ghre_ExamPaperBase
/// <summary>
/// 内置
/// </summary>
public bool? BuiltIn { get; set; }
public int? BuiltIn { get; set; }
}

@ -148,5 +148,5 @@ public class Ghre_QuestionBase
/// <summary>
/// 内置
/// </summary>
public bool? BuiltIn { get; set; }
public int? BuiltIn { get; set; }
}

@ -279,5 +279,5 @@ public class Ghre_Course : BasePoco
/// <summary>
/// 内置
/// </summary>
public bool? BuiltIn { get; set; }
public int? BuiltIn { get; set; }
}

@ -125,5 +125,5 @@ public class Ghre_CourseClass : BasePoco
/// <summary>
/// 内置
/// </summary>
public bool? BuiltIn { get; set; }
public int? BuiltIn { get; set; }
}

@ -165,5 +165,5 @@ public class Ghre_CourseScene : BasePoco
/// <summary>
/// 内置
/// </summary>
public bool? BuiltIn { get; set; }
public int? BuiltIn { get; set; }
}

@ -194,5 +194,5 @@ public class Ghre_ExamPaper : BasePoco
/// <summary>
/// 内置
/// </summary>
public bool? BuiltIn { get; set; }
public int? BuiltIn { get; set; }
}

@ -149,5 +149,5 @@ public class Ghre_Question : BasePoco
/// <summary>
/// 内置
/// </summary>
public bool? BuiltIn { get; set; }
public int? BuiltIn { get; set; }
}

@ -51,5 +51,6 @@ public class Ghre_CourseDto : Ghre_Course
public List<long> ExamPaperIds { get; set; } = new List<long>();
public List<long> CourseClassIds { get; set; } = new List<long>();
public List<long> CourseSceneIds1 { get; set; } = new List<long>();
public string BuiltInLabel { get; set; }
}

@ -13,7 +13,7 @@
*  
* SimonHsiao
*
*/
*/
namespace Tiobon.Core.Model.Models;
@ -33,4 +33,6 @@ public class Ghre_CourseClassDto : Ghre_CourseClass
/// 修改信息
/// </summary>
public string UpdateDataInfo { get; set; }
public string BuiltInLabel { get; set; }
}

@ -37,5 +37,6 @@ public class Ghre_CourseSceneDto : Ghre_CourseScene
public string UpdateDataInfo { get; set; }
public List<Ghre_Course> Courses { get; set; }
public string BuiltInLabel { get; set; }
}

@ -47,4 +47,5 @@ public class Ghre_ExamPaperDto : Ghre_ExamPaper
public string TotalScore1 { get; set; }
public string SetMethodLabel { get; set; }
public string CourseName { get; set; }
public string BuiltInLabel { get; set; }
}

@ -31,6 +31,7 @@ public class Ghre_MultipleTitleDto : Ghre_MultipleTitle
/// 修改信息
/// </summary>
public string UpdateDataInfo { get; set; }
public string EffectiveDate1 { get; set; }
public string StaffName { get; set; }
public string TitleName1 { get; set; }
public string TitleName2 { get; set; }

@ -56,4 +56,7 @@ public class Ghre_QuestionDto : Ghre_Question
/// 修改信息
/// </summary>
public string UpdateDataInfo { get; set; }
public string BuiltInLabel { get; set; }
}

@ -13,7 +13,15 @@ public class Ghre_CourseClassServices : BaseServices<Ghre_CourseClass, Ghre_Cour
base.BaseDal = dal;
base._caching = caching;
}
public override async Task<ServicePageResult<Ghre_CourseClassDto>> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true)
{
var data = await base.QueryFilterPage(filter, condition, IsEnable);
data.result.DT_TableDataT1.ForEach(x =>
{
x.BuiltInLabel = x.BuiltIn == 1 ? "是" : "否";
});
return data;
}
#region Excel导入

@ -1,4 +1,7 @@
namespace Tiobon.Core.Services;
using System.Net;
using Tiobon.Core.IServices;
namespace Tiobon.Core.Services;
/// <summary>
/// 课程场景 (服务)
@ -12,6 +15,15 @@ public class Ghre_CourseSceneServices : BaseServices<Ghre_CourseScene, Ghre_Cour
base.BaseDal = dal;
base._caching = caching;
}
public override async Task<ServicePageResult<Ghre_CourseSceneDto>> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true)
{
var data = await base.QueryFilterPage(filter, condition, IsEnable);
data.result.DT_TableDataT1.ForEach(x =>
{
x.BuiltInLabel = x.BuiltIn == 1 ? "是" : "否";
});
return data;
}
public override async Task<ServiceFormResult<Ghre_CourseSceneDto>> QueryForm(QueryForm body)
{

@ -193,6 +193,7 @@ public class Ghre_CourseServices : BaseServices<Ghre_Course, Ghre_CourseDto, Ins
var courseScene = courseScenes.Where(a => a.Id == x.CourseSceneId).ToList();
x.CourseSceneName = string.Join(",", courseScene.Select(a => a.SceneName + " (" + a.SceneNo + ")"));
}
x.BuiltInLabel = x.BuiltIn == 1 ? "是" : "否";
});

@ -1,4 +1,5 @@
using MongoDB.Driver.Linq;
using NPOI.SS.Formula.Functions;
using System.Net;
using System.Text.RegularExpressions;
@ -118,9 +119,8 @@ public class Ghre_ExamPaperServices : BaseServices<Ghre_ExamPaper, Ghre_ExamPape
}
catch (Exception)
{
}
x.BuiltInLabel = x.BuiltIn == 1 ? "是" : "否";
});
return new ServicePageResult<Ghre_ExamPaperDto>(body.pageNum, data.result.DT_TablePageInfoT1.TotalCount, body.pageSize, data1);

@ -34,6 +34,7 @@ public class Ghre_MultipleTitleServices : BaseServices<Ghre_MultipleTitle, Ghre_
list.ForEach(x =>
{
x.StaffName = staffs.Where(o => o.StaffID == x.StaffId).FirstOrDefault()?.StaffName;
x.EffectiveDate1 = DateTimeHelper.ConvertToDayString(x.EffectiveDate);
if (x.TitleId1 != null)
x.TitleName1 = titles.Where(o => o.TitleID == x.TitleId1).FirstOrDefault()?.TitleName;
if (x.TitleId2 != null)

@ -261,53 +261,80 @@ public class Ghre_PlanServices : BaseServices<Ghre_Plan, Ghre_PlanDto, InsertGhr
var data = Mapper.Map(result.result.DT_TableDataT1).ToANew<List<UshioPlanReport>>();
data.ForEach(d =>
data.ForEach(async d =>
{
d.M1_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Month == 1).Sum(x => x.Count);
int year = d.Year.Value;
if (d.InOrOut == "In")
{
d.M1_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Year == year && x.ExamDate.Month == 1).Sum(x => x.Count);
d.M2_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Year == year && x.ExamDate.Month == 2).Sum(x => x.Count);
d.M3_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Year == year && x.ExamDate.Month == 3).Sum(x => x.Count);
d.M4_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Year == year && x.ExamDate.Month == 4).Sum(x => x.Count);
d.M5_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Year == year && x.ExamDate.Month == 5).Sum(x => x.Count);
d.M6_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Year == year && x.ExamDate.Month == 6).Sum(x => x.Count);
d.M7_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Year == year && x.ExamDate.Month == 7).Sum(x => x.Count);
d.M8_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Year == year && x.ExamDate.Month == 8).Sum(x => x.Count);
d.M9_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Year == year && x.ExamDate.Month == 9).Sum(x => x.Count);
d.M10_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Year == year && x.ExamDate.Month == 10).Sum(x => x.Count);
d.M11_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Year == year && x.ExamDate.Month == 11).Sum(x => x.Count);
d.M12_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Year == year && x.ExamDate.Month == 12).Sum(x => x.Count);
}
else
{
var sql = $"select TrainDays,BeginDate,EndDate from [120.26.205.42].[GhrUshio].[dbo].Ushio_ExternalTrainApply where TrainNeeds like '%{d.Id}%'";
var applys = await DbAccess.QueryListAsync<Ushio_ExternalTrainApply>(sql);
d.M1_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 1).Sum(x => x.TrainDays);
d.M2_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 2).Sum(x => x.TrainDays);
d.M3_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 3).Sum(x => x.TrainDays);
d.M4_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 4).Sum(x => x.TrainDays);
d.M5_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 5).Sum(x => x.TrainDays);
d.M6_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 6).Sum(x => x.TrainDays);
d.M7_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 7).Sum(x => x.TrainDays);
d.M8_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 8).Sum(x => x.TrainDays);
d.M9_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 9).Sum(x => x.TrainDays);
d.M10_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 10).Sum(x => x.TrainDays);
d.M11_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 11).Sum(x => x.TrainDays);
d.M12_Count = applys.Where(x => x.BeginDate.Year == year && x.BeginDate.Month == 12).Sum(x => x.TrainDays);
}
if (d.M1_Count > 0 && d.TrainNum > 0)
d.M1_CompletionRate = d.M1_Count / d.TrainNum;
d.M2_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Month == 2).Sum(x => x.Count);
if (d.M2_Count > 0 && d.TrainNum > 0)
d.M2_CompletionRate = d.M2_Count / d.TrainNum;
d.M3_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Month == 3).Sum(x => x.Count);
if (d.M3_Count > 0 && d.TrainNum > 0)
d.M3_CompletionRate = d.M3_Count / d.TrainNum;
d.M4_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Month == 4).Sum(x => x.Count);
if (d.M4_Count > 0 && d.TrainNum > 0)
d.M4_CompletionRate = d.M4_Count / d.TrainNum;
d.M5_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Month == 5).Sum(x => x.Count);
if (d.M5_Count > 0 && d.TrainNum > 0)
d.M5_CompletionRate = d.M5_Count / d.TrainNum;
d.M6_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Month == 6).Sum(x => x.Count);
if (d.M6_Count > 0 && d.TrainNum > 0)
d.M6_CompletionRate = d.M6_Count / d.TrainNum;
d.M7_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Month == 7).Sum(x => x.Count);
if (d.M7_Count > 0 && d.TrainNum > 0)
d.M7_CompletionRate = d.M7_Count / d.TrainNum;
d.M8_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Month == 8).Sum(x => x.Count);
if (d.M8_Count > 0 && d.TrainNum > 0)
d.M8_CompletionRate = d.M8_Count / d.TrainNum;
d.M9_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Month == 9).Sum(x => x.Count);
if (d.M9_Count > 0 && d.TrainNum > 0)
d.M9_CompletionRate = d.M9_Count / d.TrainNum;
d.M10_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Month == 10).Sum(x => x.Count);
if (d.M10_Count > 0 && d.TrainNum > 0)
d.M10_CompletionRate = d.M10_Count / d.TrainNum;
d.M11_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Month == 11).Sum(x => x.Count);
if (d.M11_Count > 0 && d.TrainNum > 0)
d.M11_CompletionRate = d.M11_Count / d.TrainNum;
d.M12_Count = studyRecordGroup1.Where(x => x.PlanId == d.Id && x.ExamDate.Month == 12).Sum(x => x.Count);
if (d.M12_Count > 0 && d.TrainNum > 0)
d.M12_CompletionRate = d.M12_Count / d.TrainNum;
@ -320,7 +347,7 @@ public class Ghre_PlanServices : BaseServices<Ghre_Plan, Ghre_PlanDto, InsertGhr
menuName = filter.menuName
};
var module = await _commonServices.GetModuleInfoAsync(param);
var result1 = new ServicePageResult<UshioPlanReport>(filter.pageNum, result.result.DT_TablePageInfoT1.TotalCount, filter.pageSize, data);
var result1 = new ServicePageResult<UshioPlanReport>(filter.pageNum, result.result.DT_TablePageInfoT1.TotalCount, filter.pageSize, data);
result1.result.JM_TableColumnT1 = module.Data.JM_TableColumnT1;
var yearField = module.Data.JM_TableColumnT1.TableColumn.Where(x => x.field == "Year").SingleOrDefault();

@ -1,4 +1,5 @@
using NPOI.HSSF.UserModel;
using NPOI.SS.Formula.Functions;
using NPOI.SS.UserModel;
using NPOI.SS.Util;
using NPOI.XSSF.UserModel;
@ -146,6 +147,8 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt
x.DifficultyLevelLabel = await GetParaLabel("DifficultyLevel", x.DifficultyLevel);
x.QuestionTypeLabel = await GetParaLabel("QuestionType", x.QuestionType);
x.BuiltInLabel = x.BuiltIn == 1 ? "是" : "否";
if (x.CourseId != null)
{
var course = courses.Where(a => a.Id == x.CourseId).FirstOrDefault();
@ -273,7 +276,7 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt
var courseClass = courses.Where(a => x.CourseIds.Contains(a.Id.ToString())).ToList();
x.CourseName = string.Join(",", courseClass.Select(a => a.CourseName + " (" + a.CourseNo + ")"));
}
x.BuiltInLabel = x.BuiltIn == 1 ? "是" : "否";
});

Loading…
Cancel
Save