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 WMSSalesAndDeliveryPlanJob : IJobService
{
private readonly IWmsNjsiResultRepository repository ;
private static readonly string TABLE_NAME = "WMS_NJSI" ;
private static readonly string INTERFACE_NAME = "InsertSalesAndDeliveryPlanInfo" ;
public WMSSalesAndDeliveryPlanJob ( IWmsNjsiResultRepository _repository )
{
this . repository = _repository ;
}
public string ExecuteService ( string parameter )
{
try
{
List < WmsNjsi > wmsNjsis = repository . GetRusultInfo ( TABLE_NAME ) ;
if ( wmsNjsis . Count < = 0 )
{
return "没有待处理的销售发货结果非JIS信息! " ;
}
SapInterfaceResult result = repository . doResultsPush ( wmsNjsis , TABLE_NAME , INTERFACE_NAME ) ;
return result . message ;
}
catch ( Exception ex )
{
LogHelper . Error ( "销售发货结果非JIS接口错误! " + ex ) ;
return "销售发货结果非JIS接口错误! " + ex . Message ;
}
}
}
public interface IWmsNjsiResultRepository : IWmsResultRepository < WmsNjsi >
{
}
public class WmsNjsiResultRepository : WmsResultRepository < WmsNjsi > , IWmsNjsiResultRepository
{
public WmsNjsiResultRepository ( DapperDbContext _dapperDbContext ) : base ( _dapperDbContext )
{
}
}
}