|
|
|
@ -203,6 +203,19 @@ public class Ghre_StudyRuleServices : BaseServices<Ghre_StudyRule, Ghre_StudyRul |
|
|
|
|
if (!entity.JobIds.IsNull() && entity.JobIds.Any()) |
|
|
|
|
entity.JobId = JsonHelper.ObjToJson(entity.JobIds); |
|
|
|
|
|
|
|
|
|
var companyCode = await QueryCompanyCode(); |
|
|
|
|
if (companyCode != "Viavi") |
|
|
|
|
if (entity.TrainType == "NewStaff") |
|
|
|
|
{ |
|
|
|
|
if (!entity.ZoneIds.Any() && |
|
|
|
|
!entity.DeptIds.Any() && |
|
|
|
|
!entity.TitleIds.Any() && |
|
|
|
|
!entity.GradeIds.Any() && |
|
|
|
|
!entity.JobIds.Any()) |
|
|
|
|
throw new Exception("厂区、部门、职称、职等、岗位,至少填写任一个才能保存!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var result = await base.Add(entity); |
|
|
|
|
|
|
|
|
|
if (entity.Staffs != null && entity.Staffs.Any()) |
|
|
|
@ -239,6 +252,18 @@ public class Ghre_StudyRuleServices : BaseServices<Ghre_StudyRule, Ghre_StudyRul |
|
|
|
|
if (!entity.JobIds.IsNull()) |
|
|
|
|
entity.JobId = JsonHelper.ObjToJson(entity.JobIds); |
|
|
|
|
|
|
|
|
|
var companyCode = await QueryCompanyCode(); |
|
|
|
|
if (companyCode != "Viavi") |
|
|
|
|
if (entity.TrainType == "NewStaff") |
|
|
|
|
{ |
|
|
|
|
if (!entity.ZoneIds.Any() && |
|
|
|
|
!entity.DeptIds.Any() && |
|
|
|
|
!entity.TitleIds.Any() && |
|
|
|
|
!entity.GradeIds.Any() && |
|
|
|
|
!entity.JobIds.Any()) |
|
|
|
|
throw new Exception("厂区、部门、职称、职等、岗位,至少填写任一个才能保存!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var result = await base.Update(Id, entity); |
|
|
|
|
await _ghre_StudyRuleStaffServices.Delete(x => x.StudyRuleId == Id); |
|
|
|
|
|
|
|
|
|