Fitment related changes
This commit is contained in:
@@ -52,7 +52,7 @@ namespace PartSource.Automation.Jobs.POC
|
|||||||
{
|
{
|
||||||
BaseVehicleId = baseVehicleId
|
BaseVehicleId = baseVehicleId
|
||||||
},
|
},
|
||||||
MfrCode = new[] { "BOS", "TRI" },
|
MfrCode = new[] { "CSD" },
|
||||||
PartType = new[] { new PartType { Id = 8852 } },
|
PartType = new[] { new PartType { Id = 8852 } },
|
||||||
Criterion = new[]
|
Criterion = new[]
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -43,10 +43,10 @@ namespace PartSource.Automation.Jobs
|
|||||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2008:Do not create tasks without passing a TaskScheduler", Justification = "<Pending>")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2008:Do not create tasks without passing a TaskScheduler", Justification = "<Pending>")]
|
||||||
public async Task Run(CancellationToken token, params string[] arguments)
|
public async Task Run(CancellationToken token, params string[] arguments)
|
||||||
{
|
{
|
||||||
_whiSeoService.TruncateFitmentTables();
|
_whiSeoService.TruncateFitmentTables();
|
||||||
// _whiSeoService.GetFiles(_seoDataType);
|
_whiSeoService.GetFiles(_seoDataType);
|
||||||
|
|
||||||
string directory = Path.Combine(_ftpConfiguration.Destination, _seoDataType.ToString().ToLowerInvariant());
|
string directory = Path.Combine(_ftpConfiguration.Destination, _seoDataType.ToString().ToLowerInvariant());
|
||||||
DirectoryInfo directoryInfo = new DirectoryInfo(directory);
|
DirectoryInfo directoryInfo = new DirectoryInfo(directory);
|
||||||
|
|
||||||
ConcurrentQueue<IGrouping<string, FileInfo>> fileGroups = new ConcurrentQueue<IGrouping<string, FileInfo>>();
|
ConcurrentQueue<IGrouping<string, FileInfo>> fileGroups = new ConcurrentQueue<IGrouping<string, FileInfo>>();
|
||||||
@@ -96,9 +96,9 @@ namespace PartSource.Automation.Jobs
|
|||||||
|
|
||||||
Task.WaitAll(taskArray);
|
Task.WaitAll(taskArray);
|
||||||
|
|
||||||
_whiSeoService.CreateFitmentView();
|
// _whiSeoService.CreateFitmentView();
|
||||||
|
|
||||||
_whiSeoService.SaveNotes(_noteDictionary);
|
//_whiSeoService.SaveNotes(_noteDictionary);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Decompress(FileInfo fileInfo)
|
public string Decompress(FileInfo fileInfo)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace PartSource.Automation.Jobs
|
|||||||
public async Task Run(CancellationToken token, params string[] arguments)
|
public async Task Run(CancellationToken token, params string[] arguments)
|
||||||
{
|
{
|
||||||
_whiSeoService.TruncateVehicleTable();
|
_whiSeoService.TruncateVehicleTable();
|
||||||
// _whiSeoService.GetFiles(_seoDataType);
|
_whiSeoService.GetFiles(_seoDataType);
|
||||||
|
|
||||||
string directory = Path.Combine(_ftpConfiguration.Destination, _seoDataType.ToString().ToLowerInvariant());
|
string directory = Path.Combine(_ftpConfiguration.Destination, _seoDataType.ToString().ToLowerInvariant());
|
||||||
DirectoryInfo directoryInfo = new DirectoryInfo(directory);
|
DirectoryInfo directoryInfo = new DirectoryInfo(directory);
|
||||||
@@ -123,9 +123,9 @@ namespace PartSource.Automation.Jobs
|
|||||||
&& int.TryParse(columns[35], out int engineConfigId)
|
&& int.TryParse(columns[35], out int engineConfigId)
|
||||||
&& int.TryParse(columns[36], out int vehicleToEngineConfigId))
|
&& int.TryParse(columns[36], out int vehicleToEngineConfigId))
|
||||||
{
|
{
|
||||||
if (regionId == 2 && new[] { 5, 6, 7 }.Contains(vehicleTypeId))
|
if (regionId == 2 && new[] { 5, 6, 7 }.Contains(vehicleTypeId))
|
||||||
{
|
{
|
||||||
dataTable.Rows.Add(new object[] { year, makeId, makeName, modelId, modelName, regionId, regionName, vehicleTypeId, engineConfigId, engineDescription, baseVehicleId, vehicleToEngineConfigId, submodelId, submodelName });
|
dataTable.Rows.Add(new object[] { year, makeId, makeName, modelId, modelName, regionId, regionName, vehicleTypeId, engineConfigId, engineDescription, baseVehicleId, vehicleToEngineConfigId, submodelId, submodelName });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,11 @@ namespace PartSource.Automation.Jobs
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
products = await _shopifyClient.Products.Get(new Dictionary<string, object> { { "limit", 250 } });
|
products = await _shopifyClient.Products.Get(new Dictionary<string, object> { { "limit", 250 }, { "product_type", "CA111-SC250-FL25049_Entry Ball Joints" } });
|
||||||
|
//products = new List<Product>
|
||||||
|
//{
|
||||||
|
// await _shopifyClient.Products.GetById(4388919574575)
|
||||||
|
//};
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -62,8 +66,8 @@ namespace PartSource.Automation.Jobs
|
|||||||
IEnumerable<Metafield> metafields = await _shopifyClient.Metafields.Get(new Dictionary<string, object> { { "metafield[owner_id]", product.Id }, { "metafield[owner_resource]", "product" } });
|
IEnumerable<Metafield> metafields = await _shopifyClient.Metafields.Get(new Dictionary<string, object> { { "metafield[owner_id]", product.Id }, { "metafield[owner_resource]", "product" } });
|
||||||
importData = new ImportData
|
importData = new ImportData
|
||||||
{
|
{
|
||||||
LineCode = metafields.FirstOrDefault(m => m.Key == "custom_label_0").Value ?? string.Empty,
|
LineCode = metafields.FirstOrDefault(m => m.Key == "custom_label_0")?.Value ?? string.Empty,
|
||||||
PartNumber = metafields.FirstOrDefault(m => m.Key == "custom_label_1").Value ?? string.Empty,
|
PartNumber = metafields.FirstOrDefault(m => m.Key == "custom_label_1")?.Value ?? string.Empty,
|
||||||
VariantSku = product.Variants[0].Sku // They know we can't do fitment for variants
|
VariantSku = product.Variants[0].Sku // They know we can't do fitment for variants
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ namespace PartSource.Automation
|
|||||||
// //.StartsAt(DateTime.Today.AddHours(25))
|
// //.StartsAt(DateTime.Today.AddHours(25))
|
||||||
// )
|
// )
|
||||||
|
|
||||||
.HasJob<UpdatePricing>(options => options.HasInterval(new TimeSpan(24, 0, 0))
|
.HasJob<UpdateFitment>(options => options.HasInterval(new TimeSpan(24, 0, 0))
|
||||||
//.HasDependency<ExecuteSsisPackages>()
|
//.HasDependency<ExecuteSsisPackages>()
|
||||||
// .StartsAt(DateTime.Today.AddHours(28))
|
// .StartsAt(DateTime.Today.AddHours(28))
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user