|
|
|
@ -99,6 +99,13 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
if (ids.Count > 0) |
|
|
|
|
attachments = await Db.Queryable<Ghre_Attachment>().Where(x => ids.Contains(x.TableName)).ToListAsync(); |
|
|
|
|
|
|
|
|
|
attachments.ForEach(x => |
|
|
|
|
{ |
|
|
|
|
x.PhysicsPath = "/Advanced" + x.PhysicsPath; |
|
|
|
|
x.RelativePath = "/Advanced" + x.RelativePath; |
|
|
|
|
x.ThumbnailPath = "/Advanced" + x.ThumbnailPath; |
|
|
|
|
x.FileURL = "/Advanced" + x.FileURL; |
|
|
|
|
}); |
|
|
|
|
entitys.ForEach(async x => |
|
|
|
|
{ |
|
|
|
|
x.ScoreMethodLabel = await GetParaLabel("ScoreMethod", x.ScoreMethod); |
|
|
|
@ -107,6 +114,8 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
//x.StudyStatusLabel = await GetParaLabel("TrainingStudyStatus", x.StudyStatus); |
|
|
|
|
if (x.IsPass != null) |
|
|
|
|
x.IsPassLabel = x.IsPass == true ? "合格" : "不合格"; |
|
|
|
|
if (x.FinallyIsPass != null) |
|
|
|
|
x.FinallyIsPassLabel = x.FinallyIsPass == true ? "合格" : "不合格"; |
|
|
|
|
x.Attachments = attachments.Where(o => o.TableName == x.Id.ToString()).ToList(); |
|
|
|
|
//x.InStatusLabel = x.InStatus == "1" ? "在职" : null; |
|
|
|
|
//x.InStatusLabel = x.InStatus == "2" ? "离职" : null; |
|
|
|
@ -188,22 +197,22 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
return ServiceResult.OprateSuccess("修改成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public async Task<ServiceResult> ModifyIsPass(string examRecordId, EditGhre_ExamRecordInput edit) |
|
|
|
|
public async Task<ServiceResult> ModifyFinallyIsPass(string examRecordId, EditGhre_ExamRecordInput edit) |
|
|
|
|
{ |
|
|
|
|
var entity = await QuerySingle(examRecordId); |
|
|
|
|
if (entity != null && entity.ExamId != null) |
|
|
|
|
if (await Db.Queryable<Ghre_Exam>().Where(x => x.Id == entity.ExamId.Value && x.Status == "Disabled").AnyAsync()) |
|
|
|
|
return ServiceResult.OprateFailed($"该考试已归档,不可进行调整!"); |
|
|
|
|
|
|
|
|
|
if (entity.ActualScore is null && entity.AdjustScore is null) |
|
|
|
|
return ServiceResult.OprateFailed($"请先变更调整分或实操分!"); |
|
|
|
|
//if (entity.ActualScore is null && entity.AdjustScore is null) |
|
|
|
|
// return ServiceResult.OprateFailed($"请先变更调整分或实操分!"); |
|
|
|
|
|
|
|
|
|
entity.IsPass = edit.IsPass ?? false; |
|
|
|
|
entity.FinallyIsPass = edit.FinallyIsPass ?? false; |
|
|
|
|
|
|
|
|
|
//string score1 = Regex.Replace(entity.Score.ToString(), @"\.(0+)$", "") + "/" + Regex.Replace(entity.Score.ToString(), @"\.(0+)$", ""); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await Update(entity, ["IsPass", "UpdateTime", "UpdateBy"]); |
|
|
|
|
await Update(entity, ["FinallyIsPass", "UpdateTime", "UpdateBy"]); |
|
|
|
|
|
|
|
|
|
return ServiceResult.OprateSuccess("修改成功!"); |
|
|
|
|
} |
|
|
|
@ -968,7 +977,8 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
var examPaper = await Db.Queryable<Ghre_ExamPaper>().FirstAsync(x => x.Id == record.ExamPaperId); |
|
|
|
|
record.IsPass = examPaper.PassScore > (record.Score + record.AdjustScore) ? false : true; |
|
|
|
|
|
|
|
|
|
await Db.Updateable(record).UpdateColumns(it => new { it.IsPass }, true)//true表示追加AOP赋值列 |
|
|
|
|
record.FinallyIsPass = record.IsPass; |
|
|
|
|
await Db.Updateable(record).UpdateColumns(it => new { it.IsPass, it.FinallyIsPass }, true)//true表示追加AOP赋值列 |
|
|
|
|
.ExecuteCommandAsync(); |
|
|
|
|
|
|
|
|
|
await Db.Deleteable<Ghre_CreditPoint>().Where(x => x.ExamId == studyRecord.ExamId).ExecuteCommandAsync(); |
|
|
|
@ -1272,14 +1282,14 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
#region 提交附件 |
|
|
|
|
public async Task<ServiceResult> SubmitAttachment(long examRecordId, List<InsertGhre_AttachmentInput> attachments) |
|
|
|
|
{ |
|
|
|
|
var paths = attachments.Select(x => x.PhysicsPath).Distinct().ToList(); |
|
|
|
|
var path = attachments.Select(x => x.RelativePath.Replace("/Advanced", null)).Distinct().ToList(); |
|
|
|
|
await Db.Updateable<Ghre_Attachment>() |
|
|
|
|
.SetColumns(it => new Ghre_Attachment() { TableName = null }) |
|
|
|
|
.Where(it => it.TableName == examRecordId.ObjToString()) |
|
|
|
|
.ExecuteCommandAsync(); |
|
|
|
|
await Db.Updateable<Ghre_Attachment>() |
|
|
|
|
.SetColumns(it => new Ghre_Attachment() { TableName = examRecordId.ObjToString() }) |
|
|
|
|
.Where(it => paths.Contains(it.PhysicsPath)) |
|
|
|
|
.Where(it => path.Contains(it.RelativePath)) |
|
|
|
|
.ExecuteCommandAsync(); |
|
|
|
|
return ServiceResult.OprateSuccess("保存成功!"); |
|
|
|
|
} |
|
|
|
|