WebAPI

WebAPI – Labor Report

122 views 28 April, 2017 8 February, 2018 Valuekeep 0

This service allows you to retrieve and handle Labor Reports from the WOs in Valuekeep.

Below you can find an analysis of the methods available through the service.

Get Labor Reports

GET /api/mytenant/myorganization/maintenancemanagementcore/laborreports/GetWorkOrdersLaborReportsByFilter

This method allows you to retrieve a list of labor reports applying several filters. You can retrieve this list using the following filters:

  • StateKey: List of states (see the numeric part of the natural key of values in the States section, on Create a Work Order)
  • MaxRecords: Maximum number of records (you can request 200 records at a time)
  • WorkOrder: Work Order code
  • AssignedTo: User login for the employee assigned in the labor report
  • Version: Version
  • WOResponsible: Person in Charge of WO
  • WCResponsible: Person in Charge of the Work Center
  • WOOrWCResponsible: Person in Charge of the WO or Work Center

All filters are optional. The list of labor reports returned is sorted by version ascendingly. If you set the user filter, the system will only return labor reports assigned to the employee using that username.

Example:

GET /api/mytenant/myorganization/maintenancemanagementcore/laborreports/GetWorkOrdersLaborReportsByFilter?stateKey=001&stateKey=002&maxRecords=50&workorder=WO001&assignedTo=myuser&version=AAAAAAAAAAA=

Retrieves a maximum of 50 labor reports in the “Pending” and “Waiting for Approval” states, assigned to the employee with the “myuser” username and using version “AAAAAAAAAAA=” or later.

Create Labor Report

POST /api/mytenant/myorganization/maintenancemanagementcore/laborreports

This method allows you to create labor reports for work order tasks. The body of the message must follow the structure for the LaborReport resource.

Example:

{
“Date” : “2017-03-08”,
“IsDone” : “true”,
“Hours” : “4”,
“AppName” : “”,
“StartDate” : “2017-03-08T10:00:00+00:00”,
“EndDate” : “2017-03-08T14:00:00+00:00”,
“Remarks” : “remarks for this report”,
“Employee” : “0002”,
“Expertise” : “”,
“Skill” : “”,
“WorkOrder” : “OT0009”,
“Asset” : “CHLL 001”,
“Location” : “”,
“MaintenancePlan” : “PM-000001.1”,
“Task” : “T-000002”,
“UnderContract” : “false”
}

This method returns the list of reports created, including their distribution by the WO tasks. The WorkOrderReportLabor field returns the report document key, and the TaskReportId field returns the identifier of the report’s row.

The StartDate and EndDate fields are optional. If the number of hours is provided, it cannot be higher than the difference between these two dates. The maintenance plan and the task are also optional, if these are not specified, distribution will apply to all tasks of the WO’s or plan, respectively. If provided, the value of AppName must match an application with permission to create labor reports using this method.

Change Labor Report

PUT /api/mytenant/myorganization/maintenancemanagementcore/laborreports/<id>

This method allows you to change labor reports in work order tasks. The value of <id> must be the report identifier and the body of the message must follow the structure for the LaborReport resource.

Example:

PUT /api/mytenant/myorganization/maintenancemanagementcore/laborreports/4b1c176f-1308-e711-9cee-3ca9f42265f4

{
“TaskReportId”: “4b1c176f-1308-e711-9cee-3ca9f42265f4”,
“Date”: “2017-02-27T00:00:00”,
“IsDone”: true,
“Hours”: 1,
“AppName”: “”,
“StartDate”: null,
“EndDate”: null,
“Remarks”: “Remarks for this report”,
“Employee”: “0007”,
“WorkOrder”: “OT0008”,
“Asset”: “”,
“Location”: “FLOOR 0”,
“MaintenancePlan”: “MP-000001.1”,
“Task”: “T-000002”,
“WorkOrderReportLabor”: “L00019”,
“Expertise”: “”,
“Skill”: “”,
“Id”: “4b1c176f-1308-e711-9cee-3ca9f42265f4”,
“IsActive”: true,
“IsDeleted”: false,
“Version”: “AAAAAAAAw1g=”
}

After the request, the “Version” field will be updated in the returned resource.

Tags:

Foi útil?