diff --git a/Tiobon.Core.Common/Helper/DateTimeHelper.cs b/Tiobon.Core.Common/Helper/DateTimeHelper.cs
index e0e85a96..d269489a 100644
--- a/Tiobon.Core.Common/Helper/DateTimeHelper.cs
+++ b/Tiobon.Core.Common/Helper/DateTimeHelper.cs
@@ -222,6 +222,9 @@ public class DateTimeHelper
///
public static string ConvertToSecondString(object dateTime)
{
+ if (dateTime == null)
+ return "";
+
if (string.IsNullOrEmpty(Convert.ToString(dateTime)))
{
return "";
diff --git a/Tiobon.Core.Model/ViewModels/Extend/Ghre_ExamRecordExtend.cs b/Tiobon.Core.Model/ViewModels/Extend/Ghre_ExamRecordExtend.cs
index 9e941b7e..955ad132 100644
--- a/Tiobon.Core.Model/ViewModels/Extend/Ghre_ExamRecordExtend.cs
+++ b/Tiobon.Core.Model/ViewModels/Extend/Ghre_ExamRecordExtend.cs
@@ -121,7 +121,8 @@ public class ExamGroup
{
public long? GroupId { get; set; }
public long? ExamRecordId { get; set; }
- public DateTime? ExamTime { get; set; }
+ public string ExamTime { get; set; }
+ public decimal Score { get; set; }
}
public class CommentData
diff --git a/Tiobon.Core.Services/CommonServices.cs b/Tiobon.Core.Services/CommonServices.cs
index 9a25182d..b53b1aac 100644
--- a/Tiobon.Core.Services/CommonServices.cs
+++ b/Tiobon.Core.Services/CommonServices.cs
@@ -4356,6 +4356,7 @@ public partial class CommonServices : BaseServices>, ICommon
case "Apply":
case "BatchApply":
+
#region 写入数据,并判断是否有错误
string json = param.jsonParam.ToString();
var dict = JsonHelper.JsonToObj(json);
@@ -4363,6 +4364,10 @@ public partial class CommonServices : BaseServices>, ICommon
//dict.RequestNo = await GenerateContinuousSequence("Ghrh_HumanRequest", "RequestNo", "R");
id = await Db.Insertable(dict).ExecuteReturnSnowflakeIdAsync();
+ var StaffUserId = await Db.Queryable().Where(x => x.UserStaffID == dict.TeacherId).Select(x => x.UserId).FirstAsync();
+ if (StaffUserId > 0)
+ param.userId = StaffUserId;
+
sql = $"SELECT ISNULL(MAX(id)+1,1) FROM Ghre_TrainFeeApplyOrder_Boltone WHERE Id !='{id}' and len(Id) !=19";
var id1 = await Db.Ado.GetLongAsync(sql);
sql = $"UPDATE Ghre_TrainFeeApplyOrder_Boltone SET Id={id1} WHERE Id ='{id}'";
diff --git a/Tiobon.Core.Services/Ghra/Ghra_StaffServices.cs b/Tiobon.Core.Services/Ghra/Ghra_StaffServices.cs
index f9473a33..1d236bcf 100644
--- a/Tiobon.Core.Services/Ghra/Ghra_StaffServices.cs
+++ b/Tiobon.Core.Services/Ghra/Ghra_StaffServices.cs
@@ -61,7 +61,7 @@ public class Ghra_StaffServices : BaseServices().Where(x => x.ParentDeptID == entity.DeptId).FirstAsync();
+ dept = await Db.Queryable().Where(x => x.DeptID == dept.ParentDeptID).FirstAsync();
if (dept != null)
entity.ParentDeptName = dept.DeptName;
}
diff --git a/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs b/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs
index edd304fa..7d48f07c 100644
--- a/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs
+++ b/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs
@@ -689,7 +689,7 @@ public class Ghre_CourseServices : BaseServices().Where(x => x.Id == groupId).FirstAsync();
+ if (group != null)
+ {
+ group.Score = record.Score;
+ await Db.Updateable(group).UpdateColumns(it => new { it.Score }, true)
+ .ExecuteCommandAsync();
+ }
+
return ServiceResult.OprateSuccess("提交成功!");
}
@@ -882,15 +891,23 @@ public class Ghre_ExamRecordServices : BaseServices()
- .OrderByDescending(x => x.ExamTime)
- .Where(x => x.ExamRecordId == record.Id)
+ var Groups = await Db.Queryable()
+ .OrderByDescending(x => x.ExamTime)
+ .Where(x => x.ExamRecordId == record.Id)
+ .Select(x => new
+ {
+ GroupId = x.Id,
+ x.ExamRecordId,
+ ExamTime = x.ExamTime,
+ Score = x.Score
+ }).ToListAsync();
+ extend.Groups = Groups
.Select(x => new ExamGroup()
{
- GroupId = x.Id,
+ GroupId = x.GroupId,
ExamRecordId = x.ExamRecordId,
- ExamTime = x.ExamTime,
- }).ToListAsync();
+ ExamTime = x.ExamTime.ObjToString() + (x.Score != null ? $"({x.Score})" : ""),
+ }).ToList();
return ServiceResult.OprateSuccess("查询成功!", extend);
}
@@ -1158,6 +1175,10 @@ public class Ghre_ExamRecordServices : BaseServices new { it.Score }, true)
+ .ExecuteCommandAsync();
+
#region 多次考试成绩认定
if (exampaper.ScoreMethod == DIC_EXAM_PAPER_SCORE_METHOD.SYSTEM && (ScoreRecognition == "Highest" || ScoreRecognition == "Lowest"))
{
diff --git a/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs
index b44d5cc6..21d0b76c 100644
--- a/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs
+++ b/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs
@@ -1,12 +1,9 @@
using Microsoft.Extensions.Logging;
using MongoDB.Driver.Linq;
using NPOI.HSSF.UserModel;
-using NPOI.SS.Formula.Functions;
using NPOI.SS.UserModel;
using NPOI.SS.Util;
using NPOI.XSSF.UserModel;
-using Tiobon.Core.Model.Models;
-using static System.Runtime.InteropServices.JavaScript.JSType;
using static Tiobon.Core.DataAccess.ReportHelper;
using static Tiobon.Core.Model.Consts;
@@ -268,12 +265,6 @@ public class Ghre_StudyRecordServices : BaseServices Add(InsertGhre_StudyRecordInput entity)
{
- if (await Db.Queryable()
- .WhereIF(!entity.CourseId.IsNullOrEmpty(), x => x.CourseId == entity.CourseId)
- .WhereIF(!entity.CourseSceneId.IsNullOrEmpty(), x => x.CourseSceneId == entity.CourseSceneId)
- .AnyAsync(x => x.StaffId == entity.StaffId))
- throw new Exception("该用户存在相同学习记录!");
-
if (entity.BeginTime != null && entity.EndTime != null)
{
if (entity.EndTime < entity.BeginTime)
@@ -287,6 +278,14 @@ public class Ghre_StudyRecordServices : BaseServices()
+ .WhereIF(!entity.CourseId.IsNullOrEmpty(), x => x.CourseId == entity.CourseId)
+ .WhereIF(!entity.CourseSceneId.IsNullOrEmpty(), x => x.CourseSceneId == entity.CourseSceneId)
+ .Where(x => (x.CourseBeginTime <= entity.CourseBeginTime && x.CourseEndTime >= entity.CourseBeginTime) || (x.CourseBeginTime <= entity.CourseEndTime && x.CourseEndTime >= entity.CourseEndTime))
+ .AnyAsync(x => x.StaffId == entity.StaffId))
+ throw new Exception("该用户存在相同学习记录!");
+
+
entity.StudyStatus = "HasFinish";
var snap = await Db.Queryable().FirstAsync(x => x.CourseId == entity.CourseId);
@@ -719,8 +718,8 @@ public class Ghre_StudyRecordServices : BaseServices