Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
musica_listas_backend
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
musica_listas_backend
Commits
fe30aaf1
Commit
fe30aaf1
authored
May 06, 2019
by
Cristian Mauricio Diaz Canales
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Segundo tipo wapush-masivo
parent
cd2ebf69
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
386 additions
and
269 deletions
+386
-269
src/Command/EnviarWapushUsuariosCommand.php
src/Command/EnviarWapushUsuariosCommand.php
+32
-6
src/Entity/PluLista.php
src/Entity/PluLista.php
+181
-181
src/Utilities/EntelWapush.php
src/Utilities/EntelWapush.php
+155
-71
src/Utilities/Utiles.php
src/Utilities/Utiles.php
+1
-1
src/WsBundle/Controller/wapPushController.php
src/WsBundle/Controller/wapPushController.php
+17
-10
No files found.
src/Command/EnviarWapushUsuariosCommand.php
View file @
fe30aaf1
...
...
@@ -41,7 +41,9 @@ class EnviarWapushUsuariosCommand extends Command {
$fechaSiguiente
=
new
\DateTime
();
$ultimaFechaEjecucion
=
$this
->
em
->
getRepository
(
PluEntelWapushProximaFecha
::
class
)
->
getUltimaFechaEjecucion
();
$ejecutar
=
0
;
$arraySuscripciones
=
array
();
$arrayMsisdn
=
array
();
if
(
$ultimaFechaEjecucion
==
null
)
{
$log
->
debug
(
"No existia ultima fecha..."
);
$ejecutar
=
1
;
...
...
@@ -51,7 +53,7 @@ class EnviarWapushUsuariosCommand extends Command {
}
else
{
$log
->
debug
(
"El proceso ya se ejecuto."
);
}
if
(
$ejecutar
==
1
)
{
$suscripciones
=
$this
->
em
->
getRepository
(
PluSuscripcion
::
class
)
->
findBy
(
array
(
"susVigente"
=>
1
));
$log
->
debug
(
"suscripciones a procesar "
.
count
(
$suscripciones
));
...
...
@@ -67,14 +69,38 @@ class EnviarWapushUsuariosCommand extends Command {
$log
->
debug
(
'wappush NOOK a '
.
$suscripcion
->
getSusMsisdn
());
}
endforeach
;
$nuevaFechaSiguienteEjecucion
=
new
PluEntelWapushProximaFecha
();
$nuevaFechaSiguienteEjecucion
->
setEwfFecha
(
$fechaSiguiente
->
modify
(
'+7 days'
));
$this
->
em
->
persist
(
$nuevaFechaSiguienteEjecucion
);
$this
->
em
->
flush
();
$log
->
debug
(
"la proxima fecha de ejecucion es "
.
$nuevaFechaSiguienteEjecucion
->
getEwfFecha
()
->
format
(
"Y-m-d"
));
//AVISO DE CONTENIDO GRATUITO MASIVO
$listas
=
$this
->
em
->
getRepository
(
PluLista
::
class
)
->
findBy
(
array
(
"lisEliminado"
=>
0
,
"lisEstado"
=>
1
));
foreach
(
$listas
as
$index
=>
$lista
)
:
$log
->
debug
(
"obteniendo suscripciones asociados a la lista "
.
$lista
->
getLisId
());
foreach
(
$suscripciones
as
$index
=>
$sucripcion
)
:
if
(
$lista
->
getLisId
()
==
$suscripcion
->
getLisId
()
->
getLisId
())
{
log
->
debug
(
"Suscripcion asociado a la lista :"
.
$suscripcion
->
getSusId
());
$arraySuscripciones
[]
=
$suscripcion
->
getSusId
();
$arrayMsisdn
[]
=
}
endforeach
;
if
(
count
(
$arraySuscripciones
)
>=
1
)
{
$retornoWapPush
=
EntelWapush
::
wsGenerarPeticionWapPushMasivo
(
null
,
PluTipoWapush
::
TIPO_WP_INFO_CONTENIDO_GRATUITO
,
array
(
$arraySuscripciones
));
$log
->
debug
(
"retorno wapush masivo lista : "
.
$lista
->
getLisId
()
.
"
$retornoWapPush
"
);
if
(
$retornoWapPush
==
200
)
{
$log
->
debug
(
"wapush masivo enviado a"
.
print_r
(
$arrayMsisdn
));
}
else
{
$log
->
debug
(
'wappush masivo NOOK a '
.
print_r
(
$arrayMsisdn
)
);
}
}
endforeach
;
$log
->
debug
(
"la proxima fecha de ejecucion es "
.
$nuevaFechaSiguienteEjecucion
->
getEwfFecha
()
->
format
(
"Y-m-d"
));
}
catch
(
\Exception
$e
)
{
$io
->
success
(
print_r
(
$e
));
}
...
...
src/Entity/PluLista.php
View file @
fe30aaf1
...
...
@@ -231,7 +231,7 @@ class PluLista
/**
* @var \Plu
Imagen
* @var \Plu
Tag
*
* @ORM\ManyToOne(targetEntity="PluTag")
* @ORM\JoinColumns({
...
...
@@ -484,186 +484,186 @@ class PluLista
$this
->
tag
=
$tag
;
return
$this
;
}
public
function
getLisVpwLa
()
:
?int
{
return
$this
->
lisVpwLa
;
}
public
function
setLisVpwLa
(
?int
$lisVpwLa
)
:
self
{
$this
->
lisVpwLa
=
$lisVpwLa
;
return
$this
;
}
public
function
getLisVpwMedio
()
:
?string
{
return
$this
->
lisVpwMedio
;
}
public
function
setLisVpwMedio
(
?string
$lisVpwMedio
)
:
self
{
$this
->
lisVpwMedio
=
$lisVpwMedio
;
return
$this
;
}
public
function
getLisVpwProvider
()
:
?string
{
return
$this
->
lisVpwProvider
;
}
public
function
setLisVpwProvider
(
?string
$lisVpwProvider
)
:
self
{
$this
->
lisVpwProvider
=
$lisVpwProvider
;
return
$this
;
}
public
function
getLisVpwService
()
:
?string
{
return
$this
->
lisVpwService
;
}
public
function
setLisVpwService
(
?string
$lisVpwService
)
:
self
{
$this
->
lisVpwService
=
$lisVpwService
;
return
$this
;
}
public
function
getLisVpwCode
()
:
?string
{
return
$this
->
lisVpwCode
;
}
public
function
setLisVpwCode
(
?string
$lisVpwCode
)
:
self
{
$this
->
lisVpwCode
=
$lisVpwCode
;
return
$this
;
}
public
function
getLisWapPushType
()
:
?string
{
return
$this
->
lisWapPushType
;
}
public
function
setLisWapPushType
(
?string
$lisWapPushType
)
:
self
{
$this
->
lisWapPushType
=
$lisWapPushType
;
return
$this
;
}
public
function
getLisWapPushLa
()
:
?string
{
return
$this
->
lisWapPushLa
;
}
public
function
setLisWapPushLa
(
?string
$lisWapPushLa
)
:
self
{
$this
->
lisWapPushLa
=
$lisWapPushLa
;
return
$this
;
}
public
function
getLisWapPushService
()
:
?string
{
return
$this
->
lisWapPushService
;
}
public
function
setLisWapPushService
(
?string
$lisWapPushService
)
:
self
{
$this
->
lisWapPushService
=
$lisWapPushService
;
return
$this
;
}
public
function
getLisWapPushCode
()
:
?string
{
return
$this
->
lisWapPushCode
;
}
public
function
setLisWapPushCode
(
?string
$lisWapPushCode
)
:
self
{
$this
->
lisWapPushCode
=
$lisWapPushCode
;
return
$this
;
}
public
function
getLisWapPushProvider
()
:
?string
{
return
$this
->
lisWapPushProvider
;
}
public
function
setLisWapPushProvider
(
?string
$lisWapPushProvider
)
:
self
{
$this
->
lisWapPushProvider
=
$lisWapPushProvider
;
return
$this
;
}
public
function
getLisWapPushProviderCode
()
:
?string
{
return
$this
->
lisWapPushProviderCode
;
}
public
function
setLisWapPushProviderCode
(
?string
$lisWapPushProviderCode
)
:
self
{
$this
->
lisWapPushProviderCode
=
$lisWapPushProviderCode
;
return
$this
;
}
public
function
getLisWapPushContentType
()
:
?string
{
return
$this
->
lisWapPushContentType
;
}
public
function
setLisWapPushContentType
(
?string
$lisWapPushContentType
)
:
self
{
$this
->
lisWapPushContentType
=
$lisWapPushContentType
;
return
$this
;
}
public
function
getLisWapPushMessage
()
:
?string
{
return
$this
->
lisWapPushMessage
;
}
public
function
setLisWapPushMessage
(
?string
$lisWapPushMessage
)
:
self
{
$this
->
lisWapPushMessage
=
$lisWapPushMessage
;
return
$this
;
}
public
function
getLisWapPushUrl
()
:
?string
{
return
$this
->
lisWapPushUrl
;
}
public
function
setLisWapPushUrl
(
?string
$lisWapPushUrl
)
:
self
{
$this
->
lisWapPushUrl
=
$lisWapPushUrl
;
return
$this
;
}
public
function
getLisWapPushServiceTag
()
:
?string
{
return
$this
->
lisWapPushServiceTag
;
}
public
function
setLisWapPushServiceTag
(
?string
$lisWapPushServiceTag
)
:
self
{
$this
->
lisWapPushServiceTag
=
$lisWapPushServiceTag
;
return
$this
;
}
public
function
getLisVpwLa
()
:
?int
{
return
$this
->
lisVpwLa
;
}
public
function
setLisVpwLa
(
?int
$lisVpwLa
)
:
self
{
$this
->
lisVpwLa
=
$lisVpwLa
;
return
$this
;
}
public
function
getLisVpwMedio
()
:
?string
{
return
$this
->
lisVpwMedio
;
}
public
function
setLisVpwMedio
(
?string
$lisVpwMedio
)
:
self
{
$this
->
lisVpwMedio
=
$lisVpwMedio
;
return
$this
;
}
public
function
getLisVpwProvider
()
:
?string
{
return
$this
->
lisVpwProvider
;
}
public
function
setLisVpwProvider
(
?string
$lisVpwProvider
)
:
self
{
$this
->
lisVpwProvider
=
$lisVpwProvider
;
return
$this
;
}
public
function
getLisVpwService
()
:
?string
{
return
$this
->
lisVpwService
;
}
public
function
setLisVpwService
(
?string
$lisVpwService
)
:
self
{
$this
->
lisVpwService
=
$lisVpwService
;
return
$this
;
}
public
function
getLisVpwCode
()
:
?string
{
return
$this
->
lisVpwCode
;
}
public
function
setLisVpwCode
(
?string
$lisVpwCode
)
:
self
{
$this
->
lisVpwCode
=
$lisVpwCode
;
return
$this
;
}
public
function
getLisWapPushType
()
:
?string
{
return
$this
->
lisWapPushType
;
}
public
function
setLisWapPushType
(
?string
$lisWapPushType
)
:
self
{
$this
->
lisWapPushType
=
$lisWapPushType
;
return
$this
;
}
public
function
getLisWapPushLa
()
:
?string
{
return
$this
->
lisWapPushLa
;
}
public
function
setLisWapPushLa
(
?string
$lisWapPushLa
)
:
self
{
$this
->
lisWapPushLa
=
$lisWapPushLa
;
return
$this
;
}
public
function
getLisWapPushService
()
:
?string
{
return
$this
->
lisWapPushService
;
}
public
function
setLisWapPushService
(
?string
$lisWapPushService
)
:
self
{
$this
->
lisWapPushService
=
$lisWapPushService
;
return
$this
;
}
public
function
getLisWapPushCode
()
:
?string
{
return
$this
->
lisWapPushCode
;
}
public
function
setLisWapPushCode
(
?string
$lisWapPushCode
)
:
self
{
$this
->
lisWapPushCode
=
$lisWapPushCode
;
return
$this
;
}
public
function
getLisWapPushProvider
()
:
?string
{
return
$this
->
lisWapPushProvider
;
}
public
function
setLisWapPushProvider
(
?string
$lisWapPushProvider
)
:
self
{
$this
->
lisWapPushProvider
=
$lisWapPushProvider
;
return
$this
;
}
public
function
getLisWapPushProviderCode
()
:
?string
{
return
$this
->
lisWapPushProviderCode
;
}
public
function
setLisWapPushProviderCode
(
?string
$lisWapPushProviderCode
)
:
self
{
$this
->
lisWapPushProviderCode
=
$lisWapPushProviderCode
;
return
$this
;
}
public
function
getLisWapPushContentType
()
:
?string
{
return
$this
->
lisWapPushContentType
;
}
public
function
setLisWapPushContentType
(
?string
$lisWapPushContentType
)
:
self
{
$this
->
lisWapPushContentType
=
$lisWapPushContentType
;
return
$this
;
}
public
function
getLisWapPushMessage
()
:
?string
{
return
$this
->
lisWapPushMessage
;
}
public
function
setLisWapPushMessage
(
?string
$lisWapPushMessage
)
:
self
{
$this
->
lisWapPushMessage
=
$lisWapPushMessage
;
return
$this
;
}
public
function
getLisWapPushUrl
()
:
?string
{
return
$this
->
lisWapPushUrl
;
}
public
function
setLisWapPushUrl
(
?string
$lisWapPushUrl
)
:
self
{
$this
->
lisWapPushUrl
=
$lisWapPushUrl
;
return
$this
;
}
public
function
getLisWapPushServiceTag
()
:
?string
{
return
$this
->
lisWapPushServiceTag
;
}
public
function
setLisWapPushServiceTag
(
?string
$lisWapPushServiceTag
)
:
self
{
$this
->
lisWapPushServiceTag
=
$lisWapPushServiceTag
;
return
$this
;
}
...
...
src/Utilities/EntelWapush.php
View file @
fe30aaf1
This diff is collapsed.
Click to expand it.
src/Utilities/Utiles.php
View file @
fe30aaf1
...
...
@@ -21,7 +21,7 @@ class Utiles {
public
static
function
setLog
(
$type
=
''
,
$archivo
=
'web'
)
{
$logFechaNombre
=
$archivo
.
"_"
.
date
(
"Ymd"
)
.
".log"
;
$logPath
=
__DIR__
.
'/../../var/
project/
logs/'
.
$logFechaNombre
;
$logPath
=
__DIR__
.
'/../../var/logs/'
.
$logFechaNombre
;
$log
=
new
Logger
(
$type
);
$handler
=
new
StreamHandler
(
$logPath
,
Logger
::
DEBUG
);
$handler
->
setFormatter
(
new
LineFormatter
(
null
,
null
,
true
,
true
));
...
...
src/WsBundle/Controller/wapPushController.php
View file @
fe30aaf1
...
...
@@ -50,14 +50,18 @@ class wapPushController extends AbstractController
$logError
->
err
(
'Error en xml de entrada. xmlIN:'
.
$xmlIN
);
throw
new
HttpException
(
Response
::
HTTP_BAD_REQUEST
,
"Invalid XML"
);
}
$suscripcion
=
$em
->
getRepository
(
PluSuscripcion
::
class
)
->
find
(
$suscripcionIdIN
);
$log
->
debug
(
'validando suscripcion..'
);
if
(
$suscripcion
==
null
){
$log
->
err
(
'Suscripcion no existe en DB. xmlIN:'
.
$xmlIN
);
$logError
=
Utiles
::
setLog
(
'WsBundle\Controller\wapPushController::enviar'
,
'error/ws'
);
$logError
->
err
(
'Suscripcion no existe en DB. xmlIN:'
.
$xmlIN
);
throw
new
HttpException
(
Response
::
HTTP_BAD_REQUEST
,
"Parametros invalidos"
);
if
(
$suscripcionIn
!=
0
){
$suscripcion
=
$em
->
getRepository
(
PluSuscripcion
::
class
)
->
find
(
$suscripcionIdIN
);
$log
->
debug
(
'validando suscripcion..'
);
if
(
$suscripcion
==
null
){
$log
->
err
(
'Suscripcion no existe en DB. xmlIN:'
.
$xmlIN
);
$logError
=
Utiles
::
setLog
(
'WsBundle\Controller\wapPushController::enviar'
,
'error/ws'
);
$logError
->
err
(
'Suscripcion no existe en DB. xmlIN:'
.
$xmlIN
);
throw
new
HttpException
(
Response
::
HTTP_BAD_REQUEST
,
"Parametros invalidos"
);
}
}
else
{
$suscripcion
=
null
;
}
$tipoWappush
=
$em
->
getRepository
(
PluTipoWapush
::
class
)
->
find
(
$tipoIN
);
...
...
@@ -70,8 +74,11 @@ class wapPushController extends AbstractController
}
$log
->
debug
(
'llamando controlador procesoPeticionEnviarWapPush...'
);
EntelWapush
::
procesoPeticionEnviarWapPush
(
$xmlIN
,
$suscripcion
,
$tipoWappush
,
$em
);
if
(
$suscripcionIn
!=
0
){
EntelWapush
::
procesoPeticionEnviarWapPush
(
$xmlIN
,
$suscripcion
,
$tipoWappush
,
$em
);
}
else
{
EntelWapush
::
procesoPeticionEnviarWapPushMasivo
(
$xmlIN
,
$tipoWappush
,
$em
);
}
}
catch
(
HttpException
$e
){
$status
=
$e
->
getStatusCode
();
...
...
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