培训记录页面修改

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

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

Loading…
Cancel
Save