培训记录页面修改

master
xiaochanghai 10 months ago
parent 7b9879e5d1
commit ca5ceed30a
  1. 12
      Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs

@ -51,12 +51,12 @@ public class Ghre_StudyRecordServices : BaseServices<Ghre_StudyRecord, Ghre_Stud
var sql = @$" SELECT *
FROM Ghre_StudyRecord_V A";
string conditions = " WHERE 1=1 ";
string conditions = " WHERE BeginTime IS NOT NULL ";
if (await Db.Queryable<Ghrs_Menu>().Where(x => x.DataPrivType == "Priv" && x.MenuNo == filter.menuName).AnyAsync())
{
var staffIds = await GetUserStaffPrivIds((int)App.User.ID);
if (staffIds.Any())
conditions = $" WHERE StaffId IN ({string.Join(",", staffIds.Select(id => "'" + id + "'"))})";
conditions = $" WHERE BeginTime IS NOT NULL AND StaffId IN ({string.Join(",", staffIds.Select(id => "'" + id + "'"))})";
}
if (IsEnable == true)
@ -136,7 +136,7 @@ public class Ghre_StudyRecordServices : BaseServices<Ghre_StudyRecord, Ghre_Stud
var sql = @$" SELECT *
FROM Ghre_StudyRecord_V A";
string conditions = " WHERE 1=1 ";
string conditions = $" WHERE BeginTime IS NOT NULL AND UserId= {App.User.ID} ";
var IsEnable = true;
string condition = string.Empty;
if (IsEnable == true)
@ -274,6 +274,7 @@ public class Ghre_StudyRecordServices : BaseServices<Ghre_StudyRecord, Ghre_Stud
var snap = await Db.Queryable<Ghre_CourseSnap>().FirstAsync(x => x.CourseId == entity.CourseId);
entity.CourseSnapId = snap?.Id;
if (entity.CourseType.IsNullOrEmpty())
entity.CourseType = "ManualInsert";
var result = await base.Add(entity);
@ -700,9 +701,10 @@ public class Ghre_StudyRecordServices : BaseServices<Ghre_StudyRecord, Ghre_Stud
AdjustScore = AdjustScore ?? 0,
IsPass = isPass == "是" ? true : false,
ExamDate = dtExamDate,
CourseBeginTime = dtCourseBeginTime,
CourseEndTime = dtCourseEndTime,
BeginTime = dtCourseBeginTime,
EndTime = dtCourseEndTime,
RemarkSz = remarkSz,
CourseType = "ExcelImport"
};
await Add(insert);
}

Loading…
Cancel
Save