|
|
|
@ -3515,7 +3515,17 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon |
|
|
|
|
string json = param.jsonParam.ToString(); |
|
|
|
|
var dict = JsonHelper.JsonToObj<Ghre_Teacher>(json); |
|
|
|
|
var staffId = dict.StaffId; |
|
|
|
|
dict.StaffId = GetStaffId(); |
|
|
|
|
|
|
|
|
|
var staff = await Db.Queryable<Ghra_Staff>().FirstAsync(x => x.StaffID == staffId); |
|
|
|
|
if (staff != null) |
|
|
|
|
{ |
|
|
|
|
dict.TeacherNo = staff.StaffNo; |
|
|
|
|
dict.TeacherName = staff.StaffName; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (await Db.Queryable<Ghre_Teacher>().AnyAsync(x => x.StaffId == staffId)) |
|
|
|
|
throw new Exception($"员工【{staff.StaffName}({staff.StaffNo})】已在讲师列表中!"); |
|
|
|
|
//dict.StaffId = GetStaffId(); |
|
|
|
|
|
|
|
|
|
id = await Db.Insertable(dict).ExecuteReturnSnowflakeIdAsync(); |
|
|
|
|
|
|
|
|
|