using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autofac;
using Bowin.Common.Log;
using EMIS.CommonLogic.UniversityManage.AdministrativeOrgan;
using EMIS.CommonLogic.SystemServices;
namespace EMIS.Services.ScheduleJob
{
public class SysHROrgUserJob : EAPServiceJob
{
///
/// 重写 MyJob 方法
///
///
protected override bool MyJob()
{
var result = true;
try
{
LogHelper.WriteLog(LogType.ServiceLog, "----开始同步工作流人员及组织架构-----");
using (var scop = Program.AutofacContainer.BeginLifetimeScope())
{
IDepartmentServices DepartmentServices = scop.Resolve();
IUserServices UserServices = scop.Resolve();
DepartmentServices.SynHRServices();
UserServices.SynHRServices();
}
LogHelper.WriteLog(LogType.ServiceLog, "----结束同步工作流人员及组织架构-----");
}
catch (System.Exception err)
{
LogHelper.WriteLog(LogType.ServiceLog, "----同步工作流人员及组织架构处理异常-----");
LogHelper.WriteLog(LogType.ServiceLog, err.Message);
result = false;
}
return result;
}
}
}