using Estsh.Core.Model.EnumUtil;
using Estsh.Core.Models;
using Estsh.Core.Quartz.BaseService;
using Estsh.Core.Util;
using Estsh.Core.Wms.IRepositories;
namespace Estsh.Core.Wms.Jobs
{
///
/// SAP MBOM同步到WMS系统
///
public class InterfaceBomMasterJob : IJobService
{
private readonly IInterfaceMasterRepository repository;
public InterfaceBomMasterJob(IInterfaceMasterRepository _repository)
{
this.repository = _repository;
}
public string ExecuteService(string parameter)
{
try
{
List sapBoms = repository.GetBomMasterInfo();
if (sapBoms.Count <= 0)
{
return "没有待处理的BOM信息!";
}
bool bl = repository.InsertBomMasterInfo(sapBoms);
if (bl == true)
{
return "BOM信息同步成功!";
}
else
{
return "BOM信息同步失败!";
}
}
catch (Exception ex)
{
LogHelper.Error("BOM信息同步错误!" + ex);
return "BOM信息同步错误!" + ex.Message;
}
}
}
}