Actualización de lote
Esta función permite actualizar un lote de órdenes de trabajo.
Parámetros de Entrada
Parámetro | Tipo | Descripción |
---|---|---|
Id CAMPO OBLIGATORIO | Integer | Identificador del lote |
externalReferenceId | String | Identificador externo |
shortDescription | String | Descripción |
action CAMPO OBLIGATORIO | String | Acción que indica el proceso a realizar. Los posibles valores son: saveBatch = Actualizar lote |
Parámetros de Salida
Parámetro | Tipo | Descripción |
---|---|---|
id | Integer | Identificador del lote |
agentId | Integer | Identificador del agente |
agentName | String | Nombre del agente |
closedDate | Date | Fecha de cierre |
dedicatedTime | Double | Tiempo dedicado (en horas) |
externalLaboratoryId | Integer | Identificador del laboratorio |
externalLaboratoryName | String | Nombre del laboratorio |
externalReferenceId | String | Identificador externo |
familyId | Integer | Identificador de la familia |
familyName | String | Nombre de la familia |
isExternalCalibration | Boolean | Indica si es una calibración externa |
openDate | Date | Fecha de apertura |
plannedClosedDate | Date | Fecha fin prevista |
plannedOpenDate | Date | Fecha inicio prevista |
serviceId | Integer | Identificador del servicio |
serviceName | String | Nombre del servicio |
serviceType | String | Tipo de servicio Los posibles valores son: D = Dietas |
shortDescription | String | Descripción |
statusId | String | Los posibles valores son: OPEN = Abierto |
registeredClosedDate | Date | Fecha fin registrada |
registeredOpenDate | Date | Fecha inicio registrada |
workOrderList | WorkOrder | Este objeto es del mismo tipo que el devuelto en el apartado 3.9 Creación de órdenes de trabajo. |
workOrderList
Este objeto es del mismo tipo que el devuelto en el apartado 3.9 Creación de órdenes de trabajo:
Parámetro | Tipo | Descripción |
---|---|---|
id | Integer | Identificador de la orden de trabajo |
agentName | String | Agente que realiza la orden de trabajo |
customerId | Integer | Identificador numérico del cliente |
customerName | String | Nombre del cliente |
externalOfferId | String | Identificador externo de oferta |
externalOrderId | String | Identificador externo de pedido |
externalReferenceId | String | Identificador externo |
groupName | String | Nombre del grupo que realiza la orden de trabajo |
itemId | Integer | Identificador del equipo |
itemTag | String | Nombre del equipo |
observations | String | Descripción |
offerCode | String | Número de oferta |
openDate | Date | Fecha y hora de la creación. Este dato coge automáticamente cuando se crea |
serviceId | Integer | Identificador del servicio |
serviceType | String | Tipo de servicio. En la creación se coge este dato si se ha indicado el servicio. Los posibles valores son: I = In situ, P = Lab. Permanente, NA = No aplica |
statusName | String | Estado de la orden de trabajo. En la creación se pone automáticamente OPEN (abierta) |
typeId | String | Tipo de orden de trabajo. Los posibles valores son: ATP = Ensayo ATP |
Códigos Error
Código | Descripción |
---|---|
1000 | Error genérico |
17000 | Lote desconocido |
17001 | Falta algún parámetro obligatorio |
17002 | Acción no válida |
17003 | El lote no tiene ninguna orden de trabajo asignada. No se puede pasar a estado PROGRESS sin órdenes de trabajo asignadas |
17004 | Acción válida pero no permitida |
Ejemplos
Llamada (Método POST)
https://servidor:8443/calibry-rest-api/rest/cif/batch/{id_Lote}/?action=saveBatch
https://servidor:8443/calibry-rest-api/rest/cif/batch/137/?action=saveBatch
https://servidor:8443/calibry-rest-api/rest/cif/batch/137/?action=setInProgressBatch
https://servidor:8443/calibry-rest-api/rest/cif/batch/137/?action=completeBatch
Headers:
Authorization
Content-Type = application/json
Body:
{
"id":"137",
"shortDescription":"Descripción Lote XYZ"
}
Respuestas
Correcta:
{
"id": 137,
"statusId": "OPEN",
"familyId": null,
"familyName": null,
"serviceId": null,
"serviceName": null,
"openDate": 1572354081957,
"closedDate": null,
"agentId": 385,
"agentName": "usuario123",
"plannedOpenDate": "1572397200000",
"plannedClosedDate": "1572483600000",
"registeredOpenDate": null,
"registeredClosedDate": null,
"dedicatedTime": "18.0",
"shortDescription": " Descripción Lote XYZ ",
"serviceType": "P",
"isExternalCalibration": "false",
"externalLaboratoryId": 133,
"externalLaboratoryName": "Laboratorio 003",
"externalReferenceId": "extRef-001",
"workOrderList":[{
"id":"1311",
"typeId":"CALIBRATION",
"statusName":"OPEN",
"openDate":"1572355073579",
"agentName":"usuario123",
"customerId":"3919",
"customerName":"Cliente123",
"observations":"",
"offerCode":"",
"externalReferenceId":"",
"serviceId":"",
"serviceType":"P",
"itemTag":"Item-001",
"itemId":12345,
"externalOfferId":"offer12345",
"externalOrderId":"order12345"
}]
}
Error:
{"code":"17002"}