|
|
@ -0,0 +1,161 @@ |
|
|
|
package mx.gob.jumapacelaya.views.verificacionfirma; |
|
|
|
|
|
|
|
import com.vaadin.flow.component.HtmlComponent; |
|
|
|
import com.vaadin.flow.component.UI; |
|
|
|
import com.vaadin.flow.component.html.H2; |
|
|
|
import com.vaadin.flow.component.html.H4; |
|
|
|
import com.vaadin.flow.component.html.Paragraph; |
|
|
|
import com.vaadin.flow.component.html.Span; |
|
|
|
import com.vaadin.flow.component.notification.Notification; |
|
|
|
import com.vaadin.flow.component.orderedlayout.HorizontalLayout; |
|
|
|
import com.vaadin.flow.component.orderedlayout.VerticalLayout; |
|
|
|
import com.vaadin.flow.router.BeforeEnterEvent; |
|
|
|
import com.vaadin.flow.router.BeforeEnterObserver; |
|
|
|
import com.vaadin.flow.router.PageTitle; |
|
|
|
import com.vaadin.flow.router.Route; |
|
|
|
import de.f0rce.signaturepad.SignaturePad; |
|
|
|
import mx.gob.jumapacelaya.Services.PredioService; |
|
|
|
import mx.gob.jumapacelaya.models.Predio; |
|
|
|
import mx.gob.jumapacelaya.views.MainLayout; |
|
|
|
|
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
|
|
|
|
@PageTitle("Solicitud de Verificación PGO-Toma Independiente") |
|
|
|
@Route(value = "pgotoma", layout = MainLayout.class) |
|
|
|
public class PgoTomaIndepen extends VerticalLayout implements BeforeEnterObserver { |
|
|
|
|
|
|
|
private final PredioService predioService; |
|
|
|
private Predio predio; |
|
|
|
Span nombreCliente = new Span(); |
|
|
|
|
|
|
|
public PgoTomaIndepen(PredioService predioService) { |
|
|
|
this.predioService = predioService; |
|
|
|
this.predio = (Predio) UI.getCurrent().getSession().getAttribute("predio"); |
|
|
|
|
|
|
|
if (predio == null) { |
|
|
|
Notification.show("No se ha proporcionado un predio válido.", 3000, Notification.Position.MIDDLE); |
|
|
|
UI.getCurrent().navigate("verificacion"); |
|
|
|
} |
|
|
|
|
|
|
|
cabezera(); |
|
|
|
titulo(); |
|
|
|
body(); |
|
|
|
sign(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void cabezera() { |
|
|
|
|
|
|
|
HorizontalLayout encabezadoLayout = new HorizontalLayout(); |
|
|
|
encabezadoLayout.setWidthFull(); |
|
|
|
encabezadoLayout.setPadding(true); |
|
|
|
|
|
|
|
// Obtener la fecha actual del sistema |
|
|
|
LocalDate fechaSistema = LocalDate.now(); |
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("EEEE d 'de' MMMM 'del' yyyy"); |
|
|
|
String fechaFormateada = fechaSistema.format(formatter); |
|
|
|
|
|
|
|
Span fecha = new Span(); |
|
|
|
fecha.setText("Celaya, Guanajuato a " + fechaFormateada); |
|
|
|
|
|
|
|
H2 presolicitud = new H2(); |
|
|
|
presolicitud.setText("Firma Solicitud"); |
|
|
|
|
|
|
|
encabezadoLayout.add(fecha); |
|
|
|
encabezadoLayout.addAndExpand(new HorizontalLayout()); |
|
|
|
encabezadoLayout.add(presolicitud); |
|
|
|
this.add(encabezadoLayout); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void titulo() { |
|
|
|
|
|
|
|
VerticalLayout tituloLayout = new VerticalLayout(); |
|
|
|
|
|
|
|
H2 lblTitulo = new H2(); |
|
|
|
lblTitulo.setText("JUNTA MUNICIPAL DE AGUA POTABLE Y ALCANTARILLADO DE CELAYA, GTO"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tituloLayout.add(lblTitulo); |
|
|
|
|
|
|
|
this.add(tituloLayout); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void body() { |
|
|
|
VerticalLayout bodyLayout = new VerticalLayout(); |
|
|
|
|
|
|
|
H4 lblPresente = new H4(); |
|
|
|
lblPresente.setText("Firma la Solicitud:"); |
|
|
|
|
|
|
|
H4 lblAtt = new H4(); |
|
|
|
lblAtt.setText("ATENTAMENTE:"); |
|
|
|
|
|
|
|
Paragraph parrafo1 = new Paragraph(); |
|
|
|
parrafo1.getElement().setProperty("innerHTML", |
|
|
|
"Con Base al Art. 171 del Reglamento, el Organismo Operador del Servicio le pueden apoyar con personal técnico adecuado " + |
|
|
|
"para llevar a cabo la revisión la cual tendrá como objetivo primordial corroborar el correcto funcionamiento " + |
|
|
|
"de las instalaciones hidráulicas.<br/>Por lo que deberá de cumplir con lo siguiente: " + |
|
|
|
"<br/>" + |
|
|
|
"<ol>" + |
|
|
|
"<li>Evidencia fotográfica de que ya cancelo la toma compartida de acuerdo al diagrama que se le entrego.</li>" + |
|
|
|
"<li>Evidencia de que ya cuenta con instalaciones internas independientes.</li>" + |
|
|
|
"<li>La persona que atenderá en el domicilio debe ser mayor de edad.</li>" + |
|
|
|
"</ol>" |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
Paragraph parrafo2 = new Paragraph(); |
|
|
|
parrafo2.getElement().setProperty("innerHTML", |
|
|
|
"En caso de que no garantice que cuenta con lo anterior o que acudan al domicilio y nadie atienda al verificador, " + |
|
|
|
"ya no será posible reprogramar la orden de trabajo y tendrá que contratar al personal técnico para que revise " + |
|
|
|
"sus instalaciones internas, haciéndose responsable de cualquier anomalía en su consumo. Agradecemos su comprensión." |
|
|
|
); |
|
|
|
|
|
|
|
HtmlComponent parrafo3 = new HtmlComponent("p"); |
|
|
|
parrafo3.getElement().setProperty("innerHTML", |
|
|
|
"Predio, " + predio.getPredioid() + " ubicado en " + predio.getDirecmostrar() + ", a nombre de " + predio.getNomcliente() + "." |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
bodyLayout.add(lblPresente, parrafo1, parrafo2, parrafo3, lblAtt); |
|
|
|
this.add(bodyLayout); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void sign() { |
|
|
|
VerticalLayout signLayout = new VerticalLayout(); |
|
|
|
SignaturePad userPad = new SignaturePad(); |
|
|
|
userPad.setBackgroundColor("#FFFFFF"); |
|
|
|
userPad.setHeight("200px"); |
|
|
|
userPad.setPenColor("#000000"); |
|
|
|
userPad.getElement().getStyle().set("border", "1px solid black"); |
|
|
|
|
|
|
|
|
|
|
|
Span predioCliente = new Span("Predio: " + predio.getPredioid()); |
|
|
|
Span contratoCliente = new Span("Contrato: " + predio.getContrato()); |
|
|
|
|
|
|
|
|
|
|
|
signLayout.add(userPad, nombreCliente, predioCliente, contratoCliente); |
|
|
|
signLayout.setSpacing(false); |
|
|
|
signLayout.setAlignItems(Alignment.CENTER); |
|
|
|
this.setSpacing(false); |
|
|
|
this.add(signLayout); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void beforeEnter(BeforeEnterEvent event) { |
|
|
|
String solicitante = event.getLocation().getQueryParameters().getParameters().get("solicitante") != null |
|
|
|
? event.getLocation().getQueryParameters().getParameters().get("solicitante").stream().findFirst().orElse(null) |
|
|
|
: null; |
|
|
|
|
|
|
|
if (solicitante != null && !solicitante.isEmpty()) { |
|
|
|
nombreCliente.setText("Nombre del Solicitante: " + solicitante); |
|
|
|
|
|
|
|
} else { |
|
|
|
nombreCliente.setText("Sin solicitante"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |