Webapi - How to create a preventive maintenance based on replacement?

Webapi - How to create a preventive maintenance based on replacement?

This method allows to create a preventive maintenance based on a replacement criterion in a simplified manner.

 

The method to be used when creating a preventive maintenance based on a replacement criterion:

 

POST url/api/mytenant/myorganization/maintenance/preventivemaintenances

 

Json example for creating a preventive maintenance:

 

1.       {

        "preventiveMaintenanceKey""PM-0001",

        "description""Preventiva planos de substituição",

        "remarks"null,

        "projectionEndDate""2021-12-18T00:00:00",

        "joinPlans"true,

        "timeZoneId""GMT Standard Time",

        "workOrderType""MP",

        "workshop""MN",

        "responsible""0006",

        "assetType"1,

        "parentLocation"null,

        "location""AUD",

        "equipment"null,

        "tool"null,

        "maintenanceRoute"null,

        "priorityLevel""N",

        "company""DEMO",

        "preventiveMaintenancePlans": [

            {

                "recurrenceConfig""{\"timeZoneOffsetMinutes\":60,\"repeatType\":\"monthly\",\"repeatEvery\":1,\"startHour\":\"2021-08-19T23:00:00.000Z\",\"startDate\":\"2021-08-19T23:00:00.000Z\",\"endType\":\"withoutenddate\",\"endCount\":0,\"endDate\":null,\"week\":{\"repeatSun\":false,\"repeatMon\":false,\"repeatTue\":false,\"repeatWed\":false,\"repeatThu\":false,\"repeatFri\":false,\"repeatSat\":false},\"month\":{\"repeatMonthType\":\"onthe\",\"repeatMonthDayNumber\":0,\"repeatMonthDayRule\":\"first\",\"repeatMonthDay\":\"Mon\"}}",

                "advanceTolerance"1,

                "delayTolerance"1,

                "events"0,

                "replacementStart"0,

                "interval"null,

                "startValue"null,

                "meterAverage"null,

                "meterStartValue"null,

                "maintenancePlan""MP-000001_1",

                "operatingState"null,

                "replacementCriteria"1,

                "mainMaintenancePlan"null,

                "meter"null,

                "expectedDuration"null

            },

            {

                "recurrenceConfig"null,

                "advanceTolerance"1,

                "delayTolerance"1,

                "events"4,

                "replacementStart"0,

                "interval"null,

                "startValue"null,

                "maintenancePlan""MP-000012_1",

                "operatingState"null,

                "replacementCriteria"3,

                "mainMaintenancePlan""MP-000001_1",

                "meter"null,

                "expectedDuration""00:30:00"

            }

        ],

        "customer"null,

        "provider"null,

        "workOrderState""OT01",

        "schedulingCriteria"1

    }

This method allows to create a preventive maintenance according to the parameters filled in:

 

i.PreventiveMaintenanceKey: Preventive maintenance key. This field is mandatory.

ii.description: Short description of the preventive maintenance. This field is mandatory.

iii.remarks: Remarks.

iv.projectionEndDate: the preventive maintenance projected end date.

v.joinPlans: Join plans. Fill in this field with true or false. If this parameter is not sent, it is filled in as true by default, that is, active.

vi.timeZoneId: Time zone. If you don't edit this parameter, the standard time zone is selected by default.

vii.workOrderType: The work order type key. Mandatory field.

viii.workshop: The key of the workshop. Mandatory field.

ix.responsible: The key of the person in charge. Mandatory field.

x.assetType: The asset type (1- location; 2- equipment; 3- tool; 4- route). Mandatory field.

xi.parentLocation: The key of the selected asset parent location. Mandatory field.

xii.location: The location's key.

xiii.equipment: The equipment key.

xiv.tool: The tool's key.

xv.maintenanceRoute: The route's key.

xvi.priorityLevel: The key of the priority level. Mandatory field.

xvii.company: The company's key. Mandatory field.

xviii.preventiveMaintenancePlans: Scheduled worksheet.

    1. recurrenceConfig: Recurrence configuration. Mandatory for preventive maintenances based in recurrence.
      1. repeatType: daily for a daily recurrence; weekly for a weekly recurrence; monthly for a monthly recurrence.
      2. repeatEvery: Happens every added number. For example, if monthly is selected and you insert a 2 here, this means that it will happen every 2 months.
      3. startHour: Start date;
      4. endType: Without end date (withoutenddate); ends after X (number) of occurrences (endCount); ends in the date X (endDate).
      5. repeatSun: Sunday. Insert true or false.
      6. repeatMon: Monday. Insert true or false.
      7. repeatTue: Tuesday. Insert true or false.
      8. repeatWed: Wednesday. Insert true or false.
      9. repeatThu: Thursday. Insert true or false.
      10. repeatFri: Friday. Insert true or false.
      11. repeatSat: Saturday. Insert true or false.
      12. repeatMonthDayNumber: Occurs every first day of the month.
      13. repeatMonthDayRule: Occurs on the first, second, third,... or last day of the month.
      14. repeatMonthDay: Occurs Sunday (Sun), Monday (Mon); Tuesday (Tue); Wednesday (Wed); Thursday (Thu); Friday (Fri); Saturday (Sat); Day; Week day; Weekend day.
    2. advanceTolerance: advance tolerance number.
    3. delayTolerance: delay tolerance number.
    4. events: number of events.
    5. replacementStart: Starts at. Defines the number of events being saved before starting to replace the main plan with another plan.
    6. interval: Interval value. Mandatory field for preventive maintenances based on meters.
    7. startValue: Start value. Mandatory field for preventive maintenances based on meters.
    8. maintenanceplan: The maintenance plan key. Mandatory field.
    9. operatingState: The key of the operating state.
    10. replacementCriteria: Replacement criteria. (0 - none; 1- main (Multiplier); 3- replacement).
    11. mainMaintenancePlan: The maintenance plan key.
    12. meter: The meter's key. Mandatory field for preventive maintenances based on meters.
    13. expectedDuration: Expected duration of the preventive plan. The format is the following: d.hh:mm:ss (d - days, hh - hours, mm - minutes, ss - seconds).

xix.customer: The customer's key.

xx.provider: The supplier's key.

xxi.workOrderState: The key of the WO state.

schedulingCriteria: Scheduling. (1- Fixed date; 2- Opening date; 3- Closing date). Mandatory field.
    • Related Articles

    • WebAPI - How to create preventive maintenance based on meters?

      This method allows to create a preventive maintenance based on a meter in a simplified manner. The method to be used when creating a preventive maintenance based on a meter: POST url/api/mytenant/myorganization/maintenance/preventivemaintenances Json ...
    • Webapi - How to create a preventive maintenance based on recurrence?

      This method allows to create a preventive maintenance based on daily and monthly recurrence in a simplified manner. The method to be used when creating a preventive maintenance based in 2 recurrence plans, for example, daily and monthly is: POST ...
    • WebAPI – How do I create work orders?

      This method offers a simple way of creating a Work Order for a specific Asset, Location, Tool or Route. The method to be used to create a work order is: POST /api/mytenant/myorganization/maintenance/workorders/newWorkOrderInfo Json example to create ...
    • WebAPI - How to create a tool?

      This method allows to create a tool in a simplified manner. The method to be used when creating a tool is: POST url/api/mytenant/myorganization/assetmanagementcore/equipmentItems Json example for creating a tool: 1. { "equipmentKey": "PCR", ...
    • WebAPI – How do I update a work order?

      This method offers a simplified way of performing changes to the Work orders. The method to be used to create a work order is:    POST /api/mytenant/myorganization/maintenance/workorders/updateWorkOrderInfo/{{companyKey}}/{{workOrderKey}} The ...