获取我的学习

master
xiaochanghai 11 months ago
parent 923aac7ea6
commit 44b8e0f3a3
  1. 3083
      Model/Tiobon.Web.pdm
  2. 13
      Tiobon.Core.Api/Controllers/Ghre/Ghre_StudyRecordController.cs
  3. 55
      Tiobon.Core.Api/Tiobon.Core.Model.xml
  4. 14
      Tiobon.Core.Api/Tiobon.Core.xml
  5. 3
      Tiobon.Core.IServices/Ghre/IGhre_StudyRecordServices.cs
  6. 22
      Tiobon.Core.Model/Base/Ghre/Ghre_StudyRecord.Dto.Base.cs
  7. 22
      Tiobon.Core.Model/Models/Ghre/Ghre_StudyRecord.cs
  8. 42
      Tiobon.Core.Model/ViewModels/Extend/Ghre_StudyRecordESS.cs
  9. 122
      Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs
  10. 55
      Tiobon.Core/Tiobon.Core.Model.xml
  11. 14
      Tiobon.Core/Tiobon.Core.xml

File diff suppressed because it is too large Load Diff

@ -25,4 +25,17 @@ public class Ghre_StudyRecordController : BaseController<IGhre_StudyRecordServic
return await _service.QueryESSSearchFields(body);
}
#endregion
#region 获取ESS查询条件
/// <summary>
/// 获取ESS查询条件
/// </summary>
/// <param name="body"></param>
/// <returns></returns>
[HttpPost, Route("QueryESS")]
public async Task<ServicePageResult<Ghre_StudyRecordESS>> QueryESS([FromBody] QueryBody body)
{
return await _service.QueryESS(body, "");
}
#endregion
}

@ -3520,6 +3520,21 @@
课程ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecordBase.StudyRuleId">
<summary>
必选修规则ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecordBase.JoinTime">
<summary>
加入时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecordBase.DeadlineTime">
<summary>
截止时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecordBase.BeginTime">
<summary>
开始时间
@ -3530,6 +3545,11 @@
结束时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecordBase.StudyProgress">
<summary>
学习进度
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecordBase.RemarkSz">
<summary>
备注
@ -8456,6 +8476,21 @@
课程ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecord.StudyRuleId">
<summary>
必选修规则ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecord.JoinTime">
<summary>
加入时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecord.DeadlineTime">
<summary>
截止时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecord.BeginTime">
<summary>
开始时间
@ -8466,6 +8501,11 @@
结束时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecord.StudyProgress">
<summary>
学习进度
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecord.RemarkSz">
<summary>
备注
@ -12140,5 +12180,20 @@
学分
</summary>
</member>
<member name="P:Tiobon.Core.Model.Ghre_StudyRecordESS.StaffId">
<summary>
员工ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Ghre_StudyRecordESS.CourseSnapId">
<summary>
课程快照ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Ghre_StudyRecordESS.CourseId">
<summary>
课程ID
</summary>
</member>
</members>
</doc>

@ -898,6 +898,20 @@
培训记录(Controller)
</summary>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghre_StudyRecordController.QueryESSSearchFields(Tiobon.Core.Common.QueryBody)">
<summary>
获取ESS查询条件
</summary>
<param name="body"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghre_StudyRecordController.QueryESS(Tiobon.Core.Common.QueryBody)">
<summary>
获取ESS查询条件
</summary>
<param name="body"></param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghre_TeacherAttachmentController">
<summary>
Ghre_TeacherAttachment(Controller)

@ -11,5 +11,8 @@ namespace Tiobon.Core.IServices
public interface IGhre_StudyRecordServices :IBaseServices<Ghre_StudyRecord, Ghre_StudyRecordDto, InsertGhre_StudyRecordInput, EditGhre_StudyRecordInput>
{
Task<ServiceResult<CoursePublicSearch>> QueryESSSearchFields(QueryBody body);
Task<ServicePageResult<Ghre_StudyRecordESS>> QueryESS(QueryBody filter, string condition, bool? IsEnable = true);
}
}

@ -6,7 +6,7 @@
*
* Ver
*
*V0.01 2024/7/16 13:01:53 SimonHsiao
*V0.01 2024/7/18 10:47:16 SimonHsiao
*
* Copyright(c) 2024 Tiobon Corporation. All Rights Reserved.
*
@ -41,6 +41,21 @@ namespace Tiobon.Core.Model.Models
/// </summary>
public long? CourseId { get; set; }
/// <summary>
/// 必选修规则ID
/// </summary>
public long? StudyRuleId { get; set; }
/// <summary>
/// 加入时间
/// </summary>
public DateTime? JoinTime { get; set; }
/// <summary>
/// 截止时间
/// </summary>
public DateTime? DeadlineTime { get; set; }
/// <summary>
/// 开始时间
/// </summary>
@ -51,6 +66,11 @@ namespace Tiobon.Core.Model.Models
/// </summary>
public DateTime? EndTime { get; set; }
/// <summary>
/// 学习进度
/// </summary>
public int? StudyProgress { get; set; }
/// <summary>
/// 备注
/// </summary>

@ -6,7 +6,7 @@
*
* Ver
*
*V0.01 2024/7/16 13:01:53 SimonHsiao
*V0.01 2024/7/18 10:47:16 SimonHsiao
*
* Copyright(c) 2024 Tiobon Corporation. All Rights Reserved.
*
@ -43,6 +43,21 @@ namespace Tiobon.Core.Model.Models
/// </summary>
public long? CourseId { get; set; }
/// <summary>
/// 必选修规则ID
/// </summary>
public long? StudyRuleId { get; set; }
/// <summary>
/// 加入时间
/// </summary>
public DateTime? JoinTime { get; set; }
/// <summary>
/// 截止时间
/// </summary>
public DateTime? DeadlineTime { get; set; }
/// <summary>
/// 开始时间
/// </summary>
@ -53,6 +68,11 @@ namespace Tiobon.Core.Model.Models
/// </summary>
public DateTime? EndTime { get; set; }
/// <summary>
/// 学习进度
/// </summary>
public int? StudyProgress { get; set; }
/// <summary>
/// 备注
/// </summary>

@ -0,0 +1,42 @@
namespace Tiobon.Core.Model;
public class Ghre_StudyRecordESS
{
public int Id { get; set; }
/// <summary>
/// 员工ID
/// </summary>
public int? StaffId { get; set; }
/// <summary>
/// 课程快照ID
/// </summary>
public long? CourseSnapId { get; set; }
/// <summary>
/// 课程ID
/// </summary>
public long? CourseId { get; set; }
public string CoverUrl { get; set; }
public bool? UseDefaultCoverImage { get; set; }
public string DefaultCoverImageName { get; set; }
public string CourseName { get; set; }
public int? StandardHour { get; set; }
public int? CreditPoints { get; set; }
public string CourseBeginDate { get; set; }
public string CourseEndDate { get; set; }
public string ExamDate { get; set; }
public string ExamBeginDate { get; set; }
public string ExamEndDate { get; set; }
public bool? ShowStudyBtn { get; set; } = true;
public bool? DisableStudyBtn { get; set; } = false;
public bool? ShowExamBtn { get; set; } = true;
public bool? DisableExamBtn { get; set; } = false;
public bool? ShowFeedbackBtn { get; set; } = true;
public bool? DisableFeedbackBtn { get; set; } = true;
public int StudyProgress { get; set; } = 0;
}

@ -192,5 +192,127 @@ namespace Tiobon.Core.Services
return ServiceResult<CoursePublicSearch>.OprateSuccess("", entity);
}
#endregion
#region 获取我的学习
/// <summary>
///
/// </summary>
/// <param name="filter"></param>
/// <param name="condition"></param>
/// <param name="IsEnable"></param>
/// <returns></returns>
public async Task<ServicePageResult<Ghre_StudyRecordESS>> QueryESS(QueryBody filter, string condition, bool? IsEnable = true)
{
if (string.IsNullOrWhiteSpace(filter.orderBy))
filter.orderBy = "JoinTime DESC";
if (filter.pageSize == 0)
filter.pageSize = 10000;
var countSql = @$" SELECT COUNT(1) FROM Ghre_StudyRecord_V";
var sql = @$" SELECT A.Id,
A.StaffId,
A.CourseSnapId,
A.CourseId,
A.CoverUrl,
A.UseDefaultCoverImage,
A.DefaultCoverImageName,
A.CourseName,
A.StandardHour,
A.CreditPoints,
A.BeginTime CourseBeginDate,
A.EndTime CourseEndDate,
A.ExamDate,
A.ExamBeginDate,
A.ExamEndDate,
A.JoinTime,
A.CourseClassId,
A.CourseSceneId,
A.CourseType
FROM Ghre_StudyRecord_V A";
string conditions = $" WHERE UserId={App.User.ID} ";
if (IsEnable == true)
conditions += " AND IsEnable = 1";
else if (IsEnable == false)
conditions += " AND IsEnable = 0";
if (!string.IsNullOrWhiteSpace(condition))
conditions += " AND " + condition;
if (filter.jsonParam != null)
foreach (JProperty jProperty in filter.jsonParam.Properties())
{
var name = jProperty.Name;
var value = jProperty.Value.ToString();
if (name == "page" || name == "pageSize")
continue;
//if (name == "Date")
//{
// var jsonParam = JsonConvert.DeserializeObject<JsonParam1>(value);
// conditions += $" AND (Date BETWEEN '{jsonParam.columnValue[0]}' AND '{jsonParam.columnValue[1]}')";
// continue;
//}
if (!string.IsNullOrWhiteSpace(value))
{
var jsonParam = JsonConvert.DeserializeObject<JsonParam>(value);
switch (jsonParam.operationKey)
{
case "Include":
conditions += $" AND {name} LIKE '%{jsonParam.columnValue}%'";
break;
case "NotInclude":
conditions += $" AND {name} NOT LIKE '%{jsonParam.columnValue}%'";
break;
case "IsNull":
conditions += $" AND {name} IS NULL";
break;
case "NotNull":
conditions += $" AND {name} IS NOT NULL";
break;
case "Equal":
conditions += $" AND {name} ='{jsonParam.columnValue}'";
break;
case "NotEqual":
conditions += $" AND {name} !='{jsonParam.columnValue}'";
break;
case "GreaterOrEqual"://大于等于
conditions += $" AND {name} >='{jsonParam.columnValue}'";
break;
case "Greater"://大于
conditions += $" AND {name} >'{jsonParam.columnValue}'";
break;
case "LessOrEqual"://小于等于
conditions += $" AND {name} <='{jsonParam.columnValue}'";
break;
case "Less"://小于
conditions += $" AND {name} <'{jsonParam.columnValue}'";
break;
default:
break;
}
}
}
sql += conditions;
countSql += conditions;
int total = await Db.Ado.GetIntAsync(countSql);
sql = "SELECT * FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY " + filter.orderBy + ") NUM FROM (SELECT * FROM (" + sql + " ";
sql += ") A ) B ) C";
sql += " WHERE NUM <= " + filter.pageNum * filter.pageSize + " AND NUM >" + (filter.pageNum - 1) * filter.pageSize;
var entitys = await Db.Ado.SqlQueryAsync<Ghre_StudyRecordESS>(sql);
return new ServicePageResult<Ghre_StudyRecordESS>(filter.pageNum, total, filter.pageSize, entitys);
}
#endregion
}
}

@ -3520,6 +3520,21 @@
课程ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecordBase.StudyRuleId">
<summary>
必选修规则ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecordBase.JoinTime">
<summary>
加入时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecordBase.DeadlineTime">
<summary>
截止时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecordBase.BeginTime">
<summary>
开始时间
@ -3530,6 +3545,11 @@
结束时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecordBase.StudyProgress">
<summary>
学习进度
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecordBase.RemarkSz">
<summary>
备注
@ -8456,6 +8476,21 @@
课程ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecord.StudyRuleId">
<summary>
必选修规则ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecord.JoinTime">
<summary>
加入时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecord.DeadlineTime">
<summary>
截止时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecord.BeginTime">
<summary>
开始时间
@ -8466,6 +8501,11 @@
结束时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecord.StudyProgress">
<summary>
学习进度
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_StudyRecord.RemarkSz">
<summary>
备注
@ -12140,5 +12180,20 @@
学分
</summary>
</member>
<member name="P:Tiobon.Core.Model.Ghre_StudyRecordESS.StaffId">
<summary>
员工ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Ghre_StudyRecordESS.CourseSnapId">
<summary>
课程快照ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Ghre_StudyRecordESS.CourseId">
<summary>
课程ID
</summary>
</member>
</members>
</doc>

@ -898,6 +898,20 @@
培训记录(Controller)
</summary>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghre_StudyRecordController.QueryESSSearchFields(Tiobon.Core.Common.QueryBody)">
<summary>
获取ESS查询条件
</summary>
<param name="body"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghre_StudyRecordController.QueryESS(Tiobon.Core.Common.QueryBody)">
<summary>
获取ESS查询条件
</summary>
<param name="body"></param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghre_TeacherAttachmentController">
<summary>
Ghre_TeacherAttachment(Controller)

Loading…
Cancel
Save