addONU: Adicionado função de vincular ao TopSapp_par5 desfazer
Signed-off-by: Rodrigo Bertoldo de Sousa Martins <rodrigo.sousa.577@gmail.com>
This commit is contained in:
1 parent
94e93e46a4
commit
929293d174
3 files changed
-33
No files matched your search
@@ -6252,14 +6252,6 @@ Digite /help para ver todos os comandos disponíveis!
|
|||||||
const resultado = await this.topsapp.atualizarFTTH(idCliente, idServico, ftthData, location);
|
const resultado = await this.topsapp.atualizarFTTH(idCliente, idServico, ftthData, location);
|
||||||
|
|
||||||
if (resultado.success) {
|
if (resultado.success) {
|
||||||
// Provisionar para sincronizar onuid e serviceport do OLT → TopSapp
|
|
||||||
try {
|
|
||||||
const provResult = await this.topsapp.provisionarServico(idCliente, idServico, location);
|
|
||||||
console.log(`🔄 ProvisionarServico resultado:`, JSON.stringify(provResult?.data || provResult));
|
|
||||||
} catch (provError) {
|
|
||||||
console.warn(`⚠️ ProvisionarServico falhou (não-fatal):`, provError.message);
|
|
||||||
}
|
|
||||||
|
|
||||||
await this.bot.sendMessage(chatId,
|
await this.bot.sendMessage(chatId,
|
||||||
`✅ *ONU vinculada com sucesso no TopSapp!*\n\n` +
|
`✅ *ONU vinculada com sucesso no TopSapp!*\n\n` +
|
||||||
`📱 *Serial:* \`${ftthData.serial}\`\n` +
|
`📱 *Serial:* \`${ftthData.serial}\`\n` +
|
||||||
|
|||||||
@@ -859,23 +859,6 @@ class TopSappAPI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Provisionar manualmente um serviço (sincroniza dados do OLT → TopSapp)
|
|
||||||
*/
|
|
||||||
async provisionarServico(idCliente, idServico, location = '', credentials) {
|
|
||||||
const instance = this.getInstanceByLocation(location);
|
|
||||||
try {
|
|
||||||
const session = await this.getValidSession(instance, credentials);
|
|
||||||
return await this.makeRequest('ProvisionarServico', {
|
|
||||||
idUsuario: session.idUsuario || 1,
|
|
||||||
idCliente: parseInt(idCliente),
|
|
||||||
idServico: parseInt(idServico)
|
|
||||||
}, instance, credentials);
|
|
||||||
} catch (error) {
|
|
||||||
return { success: false, error: error.message };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listar todas as instâncias disponíveis
|
* Listar todas as instâncias disponíveis
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1279,14 +1279,6 @@ class TopSappManager {
|
|||||||
return await this.api.atualizarFTTH(idCliente, idServico, ftthData, location, credentials);
|
return await this.api.atualizarFTTH(idCliente, idServico, ftthData, location, credentials);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Provisionar manualmente um serviço (sincroniza dados do OLT → TopSapp)
|
|
||||||
*/
|
|
||||||
async provisionarServico(idCliente, idServico, location = '') {
|
|
||||||
if (!this.isReady()) return { success: false, error: 'TopSapp não configurado' };
|
|
||||||
const credentials = this.config.getCredentialsByLocation(location);
|
|
||||||
return await this.api.provisionarServico(idCliente, idServico, location, credentials);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = TopSappManager;
|
module.exports = TopSappManager;
|
||||||
Reference in new issue
Block a user