You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
using Estsh.Core.Dapper ;
using Estsh.Core.Model.EnumUtil ;
using Estsh.Core.Model.Result ;
using Estsh.Core.Models ;
using Estsh.Core.Quartz.BaseService ;
using Estsh.Core.Repositories ;
using Estsh.Core.Util ;
using Estsh.Core.Wms.IRepositories ;
using Estsh.Core.Wms.Repositories ;
namespace Estsh.Core.Wms.Jobs
{
/// <summary>
/// WMS把库存物料的转储( 从SAP的一个库存地点到另一个库存地点, 或报废出库, 委外发运、零星出入库) 执行结果传到SAP
/// </summary>
public class WMSInventoryDumpResultJob : IJobService
{
private readonly IWmsMovrResultRepository repository ;
private static readonly string TABLE_NAME = "WMS_MOVR" ;
private static readonly string INTERFACE_NAME = "InsertInventoryDumpResultInfo" ;
public WMSInventoryDumpResultJob ( IWmsMovrResultRepository _repository )
{
this . repository = _repository ;
}
public string ExecuteService ( string parameter )
{
try
{
List < WmsMovr > wmsMovrs = repository . GetRusultInfo ( TABLE_NAME ) ;
if ( wmsMovrs . Count < = 0 )
{
return "没有待处理的库存转储结果信息!" ;
}
SapInterfaceResult result = repository . doResultsPush ( wmsMovrs , TABLE_NAME , INTERFACE_NAME ) ;
return result . message ;
}
catch ( Exception ex )
{
LogHelper . Error ( "库存转储结果接口错误!" + ex ) ;
return "库存转储结果接口错误!" + ex . Message ;
}
}
}
public interface IWmsMovrResultRepository : IWmsResultRepository < WmsMovr >
{
}
public class WmsMovrResultRepository : WmsResultRepository < WmsMovr > , IWmsMovrResultRepository
{
public WmsMovrResultRepository ( DapperDbContext _dapperDbContext ) : base ( _dapperDbContext )
{
}
}
}