Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
etl-service-ccie-mvn
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
Jose Francisco Montiel Jimenez
etl-service-ccie-mvn
Commits
300f8b9d
Commit
300f8b9d
authored
Mar 06, 2025
by
Jose Francisco Montiel Jimenez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Se agregan correos
parent
f1289317
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
340 additions
and
1 deletion
+340
-1
src/main/java/amx/ccie/dto/AnexoDTO.java
src/main/java/amx/ccie/dto/AnexoDTO.java
+116
-0
src/main/java/amx/ccie/dto/CorreosDTO.java
src/main/java/amx/ccie/dto/CorreosDTO.java
+69
-0
src/main/java/amx/ccie/etl/dao/CorreosDAO.java
src/main/java/amx/ccie/etl/dao/CorreosDAO.java
+118
-0
src/main/resources/RecursosSistema.properties
src/main/resources/RecursosSistema.properties
+37
-1
No files found.
src/main/java/amx/ccie/dto/AnexoDTO.java
0 → 100644
View file @
300f8b9d
package
amx.ccie.dto
;
import
java.io.InputStream
;
import
java.io.Serializable
;
/**
* Clase DTO que almacena un anexo
* @author Luis Javier Dávila Hernández
* @since 08/08/2024
*/
public
class
AnexoDTO
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1874987532799L
;
private
int
id
;
private
int
idAnexo
;
private
int
tipo
;
private
String
mimeType
;
private
String
nombreArchivo
;
private
InputStream
archivo
;
private
int
id_usuario
;
private
long
size
;
public
AnexoDTO
(
int
id
,
int
idAnexo
,
int
tipo
,
String
nombreArchivo
,
InputStream
archivo
){
this
.
id
=
id
;
this
.
idAnexo
=
idAnexo
;
this
.
tipo
=
tipo
;
this
.
nombreArchivo
=
nombreArchivo
;
this
.
archivo
=
archivo
;
}
public
AnexoDTO
(
int
id
,
int
idAnexo
,
int
tipo
,
String
nombreArchivo
,
InputStream
archivo
,
String
mimeType
){
this
.
id
=
id
;
this
.
idAnexo
=
idAnexo
;
this
.
tipo
=
tipo
;
this
.
nombreArchivo
=
nombreArchivo
;
this
.
archivo
=
archivo
;
this
.
mimeType
=
mimeType
;
}
public
AnexoDTO
(
int
id
,
int
idAnexo
,
int
tipo
,
String
nombreArchivo
,
InputStream
archivo
,
String
mimeType
,
int
id_usuario
,
long
size
){
this
.
id
=
id
;
this
.
idAnexo
=
idAnexo
;
this
.
tipo
=
tipo
;
this
.
nombreArchivo
=
nombreArchivo
;
this
.
archivo
=
archivo
;
this
.
mimeType
=
mimeType
;
this
.
id_usuario
=
id_usuario
;
this
.
size
=
size
;
}
public
int
getId
()
{
return
id
;
}
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
}
public
int
getIdAnexo
()
{
return
idAnexo
;
}
public
void
setIdAnexo
(
int
idAnexo
)
{
this
.
idAnexo
=
idAnexo
;
}
public
int
getTipo
()
{
return
tipo
;
}
public
void
setTipo
(
int
tipo
)
{
this
.
tipo
=
tipo
;
}
public
String
getNombreArchivo
()
{
return
nombreArchivo
;
}
public
void
setNombreArchivo
(
String
nombreArchivo
)
{
this
.
nombreArchivo
=
nombreArchivo
;
}
public
InputStream
getArchivo
()
{
return
archivo
;
}
public
void
setArchivo
(
InputStream
archivo
)
{
this
.
archivo
=
archivo
;
}
public
String
getMimeType
()
{
return
mimeType
;
}
public
void
setMimeType
(
String
mimeType
)
{
this
.
mimeType
=
mimeType
;
}
public
int
getId_usuario
()
{
return
id_usuario
;
}
public
void
setId_usuario
(
int
id_usuario
)
{
this
.
id_usuario
=
id_usuario
;
}
public
long
getSize
()
{
return
size
;
}
public
void
setSize
(
long
size
)
{
this
.
size
=
size
;
}
}
src/main/java/amx/ccie/dto/CorreosDTO.java
0 → 100644
View file @
300f8b9d
package
amx.ccie.dto
;
import
java.io.InputStream
;
import
java.util.List
;
import
java.util.ResourceBundle
;
import
javax.naming.InitialContext
;
import
javax.naming.NamingException
;
import
lombok.Data
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
/**
* Clase que contiene las propiedades del correo y configuracion del mismo
* @author Jose Francisco Montiel Jimenez
*/
@Data
public
class
CorreosDTO
{
private
final
Logger
log
=
LogManager
.
getLogger
(
this
.
getClass
());
private
final
String
NOMBRE_PORTAL
=
ResourceBundle
.
getBundle
(
"RecursosSistema"
).
getString
(
"NOM_PORT"
);
private
String
FROM
=
"repoven@www.rsvamx.com"
;
private
String
PASSWORD_EMAIL
=
""
;
private
String
FROMNAME
=
"Portal "
+
NOMBRE_PORTAL
;
private
InputStream
FILE_SEND
;
private
String
[]
TO
=
new
String
[]{
"NA"
};
private
String
[]
CC
=
new
String
[]{
"NA"
};
private
String
[]
CCO
=
new
String
[]{
"NA"
};
private
String
SUBJECT
;
private
String
BODY
;
private
String
SMTP_USERNAME
=
"adminsecret"
;
private
String
SMTP_PASSWORD
=
""
;
private
String
CONFIGSET
=
"ConfigSet"
;
private
String
HOST
;
private
int
PORT
=
Integer
.
parseInt
(
ResourceBundle
.
getBundle
(
"RecursosSistema"
).
getString
(
"JAVAMAIL_PORT"
));
private
List
<
AnexoDTO
>
ATTACHMENTS
=
null
;
private
boolean
SEND_IMAGE_INLINE
=
false
;
/***
* Constructor que instancia la variable Host
*/
public
CorreosDTO
(){
try
{
InitialContext
ctx
=
new
InitialContext
();
this
.
HOST
=
(
String
)
ctx
.
lookup
(
"string/confhostmail"
);
}
catch
(
NamingException
ex
)
{
log
.
error
(
"La variable string/confhostmail no se pudo obtener."
+
ex
);
}
}
protected
String
reemplazaCaracteres
(
String
cadena
){
return
cadena
.
replaceAll
(
"á"
,
"á"
)
.
replaceAll
(
"é"
,
"é"
)
.
replaceAll
(
"í"
,
"í"
)
.
replaceAll
(
"ó"
,
"ó"
)
.
replaceAll
(
"ú"
,
"ú"
)
.
replaceAll
(
"Á"
,
"Á"
)
.
replaceAll
(
"É"
,
"É"
)
.
replaceAll
(
"Í"
,
"Í"
)
.
replaceAll
(
"Ó"
,
"Ó"
)
.
replaceAll
(
"Ú"
,
"Ú"
)
.
replaceAll
(
"ü"
,
"ü"
)
.
replaceAll
(
"Ü"
,
"Ü"
)
.
replaceAll
(
"ñ"
,
"ñ"
)
.
replaceAll
(
"Ñ"
,
"Ñ"
);
}
}
//end class
src/main/java/amx/ccie/etl/dao/CorreosDAO.java
0 → 100644
View file @
300f8b9d
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package
amx.ccie.etl.dao
;
import
amx.ccie.dto.CorreosDTO
;
import
java.io.InputStream
;
import
java.io.UnsupportedEncodingException
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.Locale
;
import
java.util.Properties
;
import
javax.mail.Message
;
import
javax.mail.MessagingException
;
import
javax.mail.Session
;
import
javax.mail.Transport
;
import
javax.mail.internet.InternetAddress
;
import
javax.mail.internet.MimeMessage
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
/**
*
* @author montielj
*/
public
class
CorreosDAO
{
private
final
Logger
log
=
LogManager
.
getLogger
(
this
.
getClass
());
/**
* Método que envía correo electrónico con reporte de activaciones
*
* @author José Francisco Montiel Jiménez
* @param nombre : Nombre del destinatario
* @since 09/01/2025
*/
public
void
enviaCorreoReporteActivaciones
(
String
nombre
)
{
CorreosDTO
ndto
=
new
CorreosDTO
();
ndto
.
setSUBJECT
(
"Notificacion de funcionamiento de catalgos"
);
ndto
.
setBODY
(
String
.
join
(
System
.
getProperty
(
"line.separator"
),
"<style type=\"text/css\">span{font-weight: bold;}</style>"
,
"<div>"
,
"<div>"
,
"<p>Hola mundo correos</p>"
,
"</div>"
,
"</div>"
));
ndto
.
setTO
(
new
String
[]{
"coronillad@globalhitss.com"
,
"montielj@globalhitss.com"
});
configuraEnviaMail
(
ndto
);
}
/**
* *
* Envia el correo electronico
*
* @param ndto objeto de configuración de email
* @author David Coronilla
* @since 25/01/2020
*/
public
void
configuraEnviaMail
(
CorreosDTO
ndto
)
{
try
{
InternetAddress
[]
ToList
=
new
InternetAddress
[
0
];
if
(!
ndto
.
getTO
()[
0
].
equals
(
"NA"
))
{
ToList
=
new
InternetAddress
[
ndto
.
getTO
().
length
];
for
(
int
i
=
0
;
i
<
ToList
.
length
;
i
++)
{
ToList
[
i
]
=
new
InternetAddress
(
ndto
.
getTO
()[
i
]);
}
}
//end if TO
Properties
prop
=
System
.
getProperties
();
prop
.
put
(
"mail.smtp.host"
,
ndto
.
getHOST
());
prop
.
put
(
"mail.smtp.port"
,
ndto
.
getPORT
());
Session
session
=
Session
.
getDefaultInstance
(
prop
,
null
);
MimeMessage
msg
=
new
MimeMessage
(
session
);
msg
.
addHeader
(
"Content-type"
,
"text/html; charset=UTF-8"
);
msg
.
setFrom
(
new
InternetAddress
(
ndto
.
getFROM
(),
ndto
.
getFROMNAME
()));
if
(!
ndto
.
getTO
()[
0
].
equals
(
"NA"
))
{
msg
.
setRecipients
(
Message
.
RecipientType
.
TO
,
ToList
);
}
msg
.
setSubject
(
ndto
.
getSUBJECT
(),
"utf-8"
);
msg
.
setContent
(
ndto
.
getBODY
(),
"text/html"
);
Transport
.
send
(
msg
);
log
.
info
(
"*** Inicia Datos Correo Normal ***"
);
if
(
ndto
.
getTO
()
!=
null
&&
ndto
.
getTO
().
length
>
0
)
{
log
.
info
(
"Correo enviado a: "
);
for
(
String
correo
:
ndto
.
getTO
())
{
log
.
info
(
" "
+
correo
);
}
}
if
(
ndto
.
getCC
()
!=
null
&&
ndto
.
getCC
().
length
>
0
)
{
log
.
info
(
"Correo CC enviado a: "
);
for
(
String
correo
:
ndto
.
getCC
())
{
log
.
info
(
" "
+
correo
);
}
}
if
(
ndto
.
getCCO
()
!=
null
&&
ndto
.
getCCO
().
length
>
0
)
{
log
.
info
(
"Correo CCO enviado a: "
);
for
(
String
correo
:
ndto
.
getCCO
())
{
log
.
info
(
" "
+
correo
);
}
}
log
.
info
(
"Título del correo: "
+
ndto
.
getSUBJECT
());
log
.
info
(
"*** Termina Datos Correo Normal ***"
);
}
catch
(
UnsupportedEncodingException
|
MessagingException
ex
)
{
log
.
error
(
"No se envio."
);
log
.
error
(
"Error: "
,
ex
);
}
}
//end method
}
src/main/resources/RecursosSistema.properties
View file @
300f8b9d
URL_REPORTE_PDM
=
https://www.rsvamx.com:8081/amxmovil-servicefrontera-ventas/api/ventas/competidores/reporte/broadband-pdm-pais
URL_REPORTE_PDM
=
https://www.rsvamx.com:8081/amxmovil-servicefrontera-ventas/api/ventas/competidores/reporte/broadband-pdm-pais
URL_CAT_EMPLEADO
=
https://reqres.in/api/users
URL_CAT_EMPLEADO
=
https://reqres.in/api/users
URL_CAT_POKEMON
=
https://pokeapi.co/api/v2/language/9
URL_CAT_POKEMON
=
https://pokeapi.co/api/v2/language/9
\ No newline at end of file
URL_TIPO_COBERTURA
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming-paquetes/tipoCobertura
URL_MARCAS_ROAMING
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming/pac/marcas
URL_EQUIPOS
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming/marcas/
#[marca]/equipos
URL_LINEAS_NAVIERAS
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming-paquetes/lineasNavieras
URL_LINEAS_AEREAS
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming-paquetes/lineasAereas
URL_CRUCEROS_FLOTILLAS
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming-paquetes/lineas/
#[id]
URL_PAISES
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming-paquetes/paises
URL_COBERTURA_DESTINO
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming/allCoberturaByDestino/
#[IDRoamingModalidad]/equipo/[IDEquipo]
URL_CONGLOMERADO_COBERTURA_DESTINO
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming/allCoberturaByDestinoMerged/
#[IDRoamingModalidad]/equipo/[IDEquipo]
URL_PAQ_TAR_ROAMING
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming-paquetes/paquetesClaves/
#[idmodalidad]/[idzona] ?isTarifa=[isTarifa]&servicio=[servicio]
URL_PAQ_TAR_TERRESTRES
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming/paquetesTarifasTerrestre/
#[modalidad]/[pais]
URL_PAQ_TAR_TERRESTRES_MULT_PAISES
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming/paquetesTarifasTerrestre/multiple/
#[modalidad]/[pa\u00edses] telcel-api-web/api/roaming/paquetesTarifasTerrestre/multiple/2/176-195-177-5
URL_PAQ_TAR_AEREAS
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming/paquetesTarifasAerea/
#[modalidad]/[Avi\u00f3n]
URL_PAQ_TAR_AEREAS_LITE
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming/paquetesTarifasAereaLite/
#[modalidad]/[Avi\u00f3n]
URL_PAQ_TAR_MARITIMAS
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming/paquetesTarifasMaritima/
#[modalidad]/[Barco]
URL_PAQ_TAR_MARITIMAS_LITE
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming/paquetesTarifasMaritimaLite/
#[modalidad]/[Barco]
URL_LINEAS_PAQUETES
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming/lineasConPaquetesyTarifas/
#[modalidad]/[Tipo]
URL_NAVIERAS_AEROLINEAS_PAQ_TAR
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming/TransporteConPaquetesyTarifas/
#[modalidad]/[linea ]
URL_PAISES_MARCACIONES
=
http://bo-uat.telcel.com/telcel-api-web/api/roaming/paises
JAVAMAIL_PORT
=
2525
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