geupdate runKPIitemtask, helaas nog geen KPI data gevonden als child item

master
abel 2023-03-31 11:13:51 +02:00
parent 7dda21dd77
commit be22d631bc
2 changed files with 12 additions and 12 deletions

View File

@ -299,17 +299,17 @@ namespace FarmmapsApi.Services
//hier nog definieren waar in de hierarchie een KPI item is?
////the BOFEK data is a child of the cropfield
//var itemName = "bofek";
//var bofekItem = await FindChildItemAsync(cropfieldItem.Code,
// SHAPE_PROCESSED_ITEMTYPE, itemName);
//if (bofekItem == null)
//{
// _logger.LogError("Could not find the BOFEK data as a child item under the cropfield");
// return null;
//}
//the kpi data is a child of the cropfield
var itemname = "KPI";
var KPIItem = await FindChildItemAsync(cropfieldItem.Code,
CROPFIELD_ITEMTYPE, itemname); //hier moet ik dus verwijzen naar waar het KPIItem zit? ik gok dat het een cropfield item type is...
if (KPIItem == null)
{
_logger.LogError("could not find the bofek data as a child item under the cropfield");
return null;
}
return bofekItem;
return KPIItem;
}
public async Task<Item> RunAhnTask(Item cropfieldItem) {

View File

@ -144,8 +144,8 @@ namespace FarmmapsKPI
// Get KPI data
//_logger.LogInformation("Calculate KPI map for field");
//var KPIItem = await _generalService.RunKPITask(cropfieldItem);
_logger.LogInformation("Calculate KPI map for field");
var KPIItem = await _generalService.RunKPITask(cropfieldItem);// hier dus verwijzen naar de KPI task
if ((object)null == null)
{
_logger.LogError("Something went wrong while obtaining the KPI map");