Added ARMS status mapper.
This commit is contained in:
@@ -7,6 +7,8 @@ using System.Text.RegularExpressions;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using FileHelpers;
|
using FileHelpers;
|
||||||
using GraphQL;
|
using GraphQL;
|
||||||
|
using Newtonsoft;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
namespace BodyshopPartner.Utils
|
namespace BodyshopPartner.Utils
|
||||||
{
|
{
|
||||||
@@ -118,6 +120,7 @@ query ENTEGRAL_EXPORT($bodyshopid: uuid!, $start: timestamptz!, $end: timestampt
|
|||||||
entegral_id
|
entegral_id
|
||||||
shopname
|
shopname
|
||||||
md_ro_statuses
|
md_ro_statuses
|
||||||
|
features
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,7 +234,7 @@ query ENTEGRAL_EXPORT($bodyshopid: uuid!, $start: timestamptz!, $end: timestampt
|
|||||||
Vehiclecolor = job.v_color?.Value,
|
Vehiclecolor = job.v_color?.Value,
|
||||||
PaintTechID = job.employee_refinish_rel?.Value == null ? "" : job.employee_refinish_rel?.employee_number?.Value,
|
PaintTechID = job.employee_refinish_rel?.Value == null ? "" : job.employee_refinish_rel?.employee_number?.Value,
|
||||||
PaintTechName = job.employee_refinish_rel?.Value == null ? "" : $"{job.employee_refinish_rel?.first_name?.Value} {job.employee_refinish_rel?.last_name?.Value}",
|
PaintTechName = job.employee_refinish_rel?.Value == null ? "" : $"{job.employee_refinish_rel?.first_name?.Value} {job.employee_refinish_rel?.last_name?.Value}",
|
||||||
ProductionStageCode = (job.actual_delivery?.Value != null || job.date_invoiced != null) ? "8D" : "33",
|
ProductionStageCode = StatusMapper(job, data.bodyshops_by_pk.features.entegral),
|
||||||
Vehiclescheduledindate = job.scheduled_in?.Value
|
Vehiclescheduledindate = job.scheduled_in?.Value
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -247,5 +250,14 @@ query ENTEGRAL_EXPORT($bodyshopid: uuid!, $start: timestamptz!, $end: timestampt
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string StatusMapper(dynamic job,dynamic features)
|
||||||
|
{
|
||||||
|
JArray j = (JArray)(features);
|
||||||
|
|
||||||
|
var x = j.Where(v => v["status"] == job.status).FirstOrDefault();
|
||||||
|
if (x == null) return "8D";
|
||||||
|
return x["code"].ToString() ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user