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.Util ;
using Estsh.Core.Wms.IRepositories ;
using Estsh.Core.Wms.Repositories ;
namespace Estsh.Core.Wms.Jobs
{
/// <summary>
/// WMS将每次发运的信息传递给SAP,SAP用于创建交货单。
/// </summary>
public class WMSSalesAndShippingResultsJob : IJobService
{
private readonly IWmsJisResultRepository repository ;
private static readonly string TABLE_NAME = "WMS_JIS" ;
private static readonly string INTERFACE_NAME = "InsertSalesAndShippingResultsInfo" ;
public WMSSalesAndShippingResultsJob ( IWmsJisResultRepository _repository )
{
this . repository = _repository ;
}
public string ExecuteService ( string parameter )
{
try
{
List < WmsJis > wmsJis = repository . GetRusultInfo ( ) ;
if ( wmsJis . Count < = 0 )
{
return "没有待处理的销售发货结果JIS信息! " ;
}
SapInterfaceResult result = repository . doResultsPush ( wmsJis , TABLE_NAME , INTERFACE_NAME ) ;
return result . message ;
}
catch ( Exception ex )
{
LogHelper . Error ( "销售发货结果JIS接口错误! " + ex ) ;
return "销售发货结果JIS接口错误! " + ex . Message ;
}
}
}
public interface IWmsJisResultRepository : IWmsResultRepository < WmsJis >
{
}
public class WmsJisResultRepository : WmsResultRepository < WmsJis > , IWmsJisResultRepository
{
public WmsJisResultRepository ( DapperDbContext _dapperDbContext ) : base ( _dapperDbContext )
{
}
}
}