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把物料的零星出(入)指令传到WMS
///
public class InterfaceSporadicEntryAndExitJob : IJobService
{
private readonly IInterfaceMasterRepository repository;
public InterfaceSporadicEntryAndExitJob(IInterfaceMasterRepository _repository)
{
this.repository = _repository;
}
public string ExecuteService(string parameter)
{
try
{
List sapMiscos = repository.GetSporadicEntryAndExitInfo();
if (sapMiscos.Count <= 0)
{
return "没有待处理的零星出入库信息!";
}
bool bl = repository.InsertSporadicEntryAndExitInfo(sapMiscos);
if (bl == true)
{
return "零星出入库信息同步成功!";
}
else
{
return "零星出入库信息同步失败!";
}
}
catch (Exception ex)
{
LogHelper.Error("零星出入库信息同步错误!" + ex);
return "零星出入库信息同步错误!" + ex.Message;
}
}
}
}