Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smsManager
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cristian Mauricio Diaz Canales
smsManager
Commits
da4b464b
Commit
da4b464b
authored
May 21, 2019
by
Cristian Mauricio Diaz Canales
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
actualizacion command-contadores
parent
5de36bf5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
src/BackendBundle/Command/McafeeMigrarUsuariosCommand.php
src/BackendBundle/Command/McafeeMigrarUsuariosCommand.php
+9
-4
No files found.
src/BackendBundle/Command/McafeeMigrarUsuariosCommand.php
View file @
da4b464b
...
...
@@ -37,6 +37,7 @@ class McafeeMigrarUsuariosCommand extends ContainerAwareCommand {
$output
->
writeln
(
"COMANDO INICIADO."
);
$log
=
Utiles
::
setLog
(
'command::migrarUsuariosSuscripcion'
,
'ws/wsMigrarUsuariosMcAfee'
);
$esTxPendiente
=
false
;
$failedAlready
=
false
;
$ultimoUsuarioProcesado
=
null
;
$cantidadProcesados
=
0
;
$cantidadPendientes
=
0
;
...
...
@@ -99,7 +100,7 @@ class McafeeMigrarUsuariosCommand extends ContainerAwareCommand {
<DATA>
<CUSTOMERCONTEXT ID="'
.
$customerContextId
.
'" REQUESTTYPE="UPDATE">
<ACCOUNT/>
<ORDER PARTNERREF="'
.
$mcAfeeTx
->
getMtrReferencia
()
.
' REF="">
<ORDER PARTNERREF="'
.
$mcAfeeTx
->
getMtrReferencia
()
.
'
"
REF="">
<ITEMS>
<ITEM SKU="'
.
self
::
SKU_DESTINY
.
'" QTY="1" ACTION="TU">
<SOURCESKU>'
.
$usuarioMigrar
->
getSku
()
.
'</SOURCESKU></ITEM>
...
...
@@ -140,13 +141,14 @@ class McafeeMigrarUsuariosCommand extends ContainerAwareCommand {
$logError
=
Utiles
::
setLog
(
'command::migrarUsuariosSuscripcion'
,
'error/wsMigrarUsuariosMcAfee'
);
$logError
->
err
(
'$arrayRespuesta == NULL mara mcAfeeTx id->'
.
$mcAfeeTx
->
getMtrId
()
.
'PETICION:'
.
print_r
(
$peticion
,
TRUE
));
$cantidadPendientes
++
;
$failedAlready
=
true
;
}
$log
->
debug
(
'$arrayRespuesta McAfee->'
.
print_r
(
$arrayRespuesta
,
true
));
$mcAfeeTx
->
setMtrCodigoRetorno
(
$arrayRespuesta
[
'mcAfeeReturnCode'
]);
$log
->
debug
(
'Descripcion de la transaccion ->'
.
$arrayRespuesta
[
'mcAfeeReturnDesc'
]);
if
(
$arrayRespuesta
[
'mcAfeeReturnCode'
]
==
'1000'
||
$arrayRespuesta
[
'mcAfeeReturnCode'
]
==
'5001'
||
$arrayRespuesta
[
'mcAfeeReturnCode'
]
==
'5002'
)
{
if
(
!
$failedAlready
||
$arrayRespuesta
[
'mcAfeeReturnCode'
]
==
'1000'
||
$arrayRespuesta
[
'mcAfeeReturnCode'
]
==
'5001'
||
$arrayRespuesta
[
'mcAfeeReturnCode'
]
==
'5002'
)
{
//validacion datos Tx
if
(
$arrayRespuesta
[
'mcAfeeCostumerId'
]
==
$nuevoUsuario
->
getUmcCustomerId
()
&&
$arrayRespuesta
[
'mcAfeeOrderPartnerRef'
]
==
$mcAfeeTx
->
getMtrReferencia
())
{
/**
...
...
@@ -158,7 +160,6 @@ class McafeeMigrarUsuariosCommand extends ContainerAwareCommand {
$mcAfeeTx
->
save
();
$log
->
debug
(
'Transaccion finalizada con exito!. id Transaccion->'
.
$mcAfeeTx
->
getMtrId
());
$cantidadProcesados
++
;
}
else
{
$mcAfeeTx
->
setMtrEstado
(
McafeeTransaccion
::
ESTADO_FRACASADA
);
$mcAfeeTx
->
save
();
...
...
@@ -172,6 +173,7 @@ class McafeeMigrarUsuariosCommand extends ContainerAwareCommand {
$logError
->
err
(
'nro de referencia Respuesta->'
.
$arrayRespuesta
[
'mcAfeeOrderPartnerRef'
]
.
'y nro referencia->'
.
$mcAfeeTx
->
getMtrReferencia
());
$logError
->
err
(
'la transaccion fracaso debido a inconsistencia en los datos.'
.
print_r
(
$arrayRespuesta
,
true
));
$cantidadPendientes
++
;
$failedAlready
=
true
;
}
}
else
{
//codigo de retorno distinto de 1000 y 5001
$mcAfeeTx
->
setMtrEstado
(
McafeeTransaccion
::
ESTADO_FRACASADA
);
...
...
@@ -183,6 +185,7 @@ class McafeeMigrarUsuariosCommand extends ContainerAwareCommand {
$logError
=
Utiles
::
setLog
(
'command::migrarUsuariosSuscripcion'
,
'error/wsMigrarUsuariosMcAfee'
);
$logError
->
err
(
'returnCode distinto de 1000 y 5001 que son los exitosos.'
.
print_r
(
$arrayRespuesta
,
true
));
$cantidadPendientes
++
;
$failedAlready
=
true
;
}
}
else
{
//$respuesta ==NULL
$mcAfeeTx
->
setMtrEstado
(
McafeeTransaccion
::
ESTADO_FRACASADA
);
...
...
@@ -193,6 +196,7 @@ class McafeeMigrarUsuariosCommand extends ContainerAwareCommand {
$logError
=
Utiles
::
setLog
(
'command::migrarUsuariosSuscripcion'
,
'error/wsMigrarUsuariosMcAfee'
);
$logError
->
err
(
'respuesta NULL para peticion:'
.
print_r
(
$peticion
,
true
));
$cantidadPendientes
++
;
$failedAlready
=
true
;
}
}
catch
(
\Exception
$exc
)
{
...
...
@@ -206,6 +210,7 @@ class McafeeMigrarUsuariosCommand extends ContainerAwareCommand {
$logError
->
err
(
'Error al llamar WS. Exception:'
.
$exc
->
getMessage
()
.
' | peticion:'
.
print_r
(
$peticion
,
true
));
//return FALSE;
$cantidadPendientes
++
;
$failedAlready
=
true
;
}
$ultimoUsuarioProcesado
=
$nuevoUsuario
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment