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 InterfaceMaterialMasterJob : IJobService { private readonly IInterfaceMasterRepository repository; public InterfaceMaterialMasterJob(IInterfaceMasterRepository _repository) { this.repository = _repository; } public string ExecuteService(string parameter) { try { List sapPts = repository.GetMaterialMasterInfo(); if (sapPts.Count <= 0) { return "没有待处理的物料主数据!"; } bool bl = repository.InsertMaterialMasterInfo(sapPts); if (bl == true) { return "物料主数据同步成功!"; } else { return "物料主数据同步失败!"; } } catch (Exception ex) { LogHelper.Error("物料主数据同步错误!" + ex); return "物料主数据同步错误!" + ex.Message; } } } }