Skip to content

Commit

Permalink
Don't call customer equipment create procedure for provider equipment
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Jan 16, 2020
1 parent 9737e0e commit 32c7f99
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/org/camunda/latera/bss/connectors/hid/hydra/Equipment.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -182,24 +182,7 @@ trait Equipment {
}
LinkedHashMap params = mergeParams(defaultParams, existingEquipment + input)

if (notEmpty(input.equipmentId)) {
logger.info("Updating equipment with params ${params}")
LinkedHashMap result = hid.execute('SI_OBJECTS_PKG.SI_OBJECTS_PUT', [
num_N_OBJECT_ID : params.equipmentId,
num_N_GOOD_ID : params.typeId ?: params.goodId,
vch_VC_NAME : params.name,
vch_VC_CODE : params.code,
num_N_FIRM_ID : params.firmId,
vch_VC_CODE_ADD : params.extCode,
vch_VC_REM : params.rem,
vch_VC_SERIAL : params.serialNo,
vch_VC_INV_NO : params.invNo,
num_N_OWNER_ID : params.ownerId,
num_N_MAIN_OBJECT_ID : params.bindMainId
])
logger.info(" Equipment id ${result.num_N_OBJECT_ID} was updated successfully!")
return result
} else {
if (isEmpty(params.equipmentId) && notEmpty(params.ownerId)) {
logger.info("Creating equipment with params ${params}")
LinkedHashMap result = hid.execute('SI_USERS_PKG.CREATE_NET_DEVICE', [
num_N_OBJECT_ID : params.equipmentId,
Expand All @@ -221,6 +204,23 @@ trait Equipment {
return updateEquipment(params)
}
return result
} else {
logger.info("Updating equipment with params ${params}")
LinkedHashMap result = hid.execute('SI_OBJECTS_PKG.SI_OBJECTS_PUT', [
num_N_OBJECT_ID : params.equipmentId,
num_N_GOOD_ID : params.typeId ?: params.goodId,
vch_VC_NAME : params.name,
vch_VC_CODE : params.code,
num_N_FIRM_ID : params.firmId,
vch_VC_CODE_ADD : params.extCode,
vch_VC_REM : params.rem,
vch_VC_SERIAL : params.serialNo,
vch_VC_INV_NO : params.invNo,
num_N_OWNER_ID : params.ownerId,
num_N_MAIN_OBJECT_ID : params.bindMainId
])
logger.info(" Equipment id ${result.num_N_OBJECT_ID} was updated successfully!")
return result
}
} catch (Exception e){
logger.error(" Error while putting new equipment!")
Expand Down

0 comments on commit 32c7f99

Please sign in to comment.