|
|
@ -4,23 +4,39 @@ import java.sql.Date; |
|
|
|
import java.time.LocalDate; |
|
|
|
|
|
|
|
public class Ticket { |
|
|
|
private int id; |
|
|
|
private String subject; |
|
|
|
private String description; |
|
|
|
private String status; |
|
|
|
private LocalDate dateCreate; |
|
|
|
private final int id; |
|
|
|
private final String subject; |
|
|
|
private final String description; |
|
|
|
private final String status; |
|
|
|
private final LocalDate dateCreate; |
|
|
|
private LocalDate dateClose; |
|
|
|
private User author; |
|
|
|
private Integer trackerId; |
|
|
|
private String type; |
|
|
|
|
|
|
|
|
|
|
|
public Ticket(int id, String subject, String description, String status, String dateCreate, Integer trackerId) { |
|
|
|
|
|
|
|
public Ticket(int id, String subject, String description, String status, String dateCreate, String dateClose, Integer trackerId, String type) { |
|
|
|
this.id = id; |
|
|
|
this.subject = subject; |
|
|
|
this.description = description; |
|
|
|
this.status = status; |
|
|
|
this.dateCreate = LocalDate.parse(dateCreate); |
|
|
|
// Manejo de la fecha de creación |
|
|
|
if (dateCreate != null && !dateCreate.isEmpty()) { |
|
|
|
this.dateCreate = LocalDate.parse(dateCreate); // Solo se parsea si no está vacío |
|
|
|
} else { |
|
|
|
this.dateCreate = null; // Si está vacío, asignar null |
|
|
|
} |
|
|
|
|
|
|
|
// Manejo de la fecha de cierre |
|
|
|
if (dateClose != null && !dateClose.isEmpty()) { |
|
|
|
this.dateClose = LocalDate.parse(dateClose); // Solo se parsea si no está vacío |
|
|
|
} else { |
|
|
|
this.dateClose = null; // Si está vacío, asignar null |
|
|
|
} |
|
|
|
this.author = author; |
|
|
|
this.trackerId = trackerId; |
|
|
|
this.type = type; |
|
|
|
} |
|
|
|
|
|
|
|
public int getId() { |
|
|
@ -56,9 +72,22 @@ public class Ticket { |
|
|
|
} |
|
|
|
|
|
|
|
public void setTrackerId(Integer tipoId) { |
|
|
|
this.trackerId = trackerId; |
|
|
|
this.trackerId = tipoId; |
|
|
|
} |
|
|
|
|
|
|
|
public LocalDate getDateClose() { |
|
|
|
return dateClose; |
|
|
|
} |
|
|
|
|
|
|
|
public void setDateClose(LocalDate dateClose) { |
|
|
|
this.dateClose = dateClose; |
|
|
|
} |
|
|
|
|
|
|
|
public void setType(String type) { |
|
|
|
this.type = type; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static class User { |
|
|
|
private String username; |
|
|
|
|
|
|
@ -95,4 +124,27 @@ public class Ticket { |
|
|
|
return "N/A"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getType() { |
|
|
|
if (trackerId == null) { |
|
|
|
return "Desconocido"; |
|
|
|
} |
|
|
|
return switch (trackerId) { |
|
|
|
case 4 -> "Acceso/Permiso/Bajas"; |
|
|
|
case 5 -> "Soporte de Software"; |
|
|
|
case 6 -> "Capacitacion de Software"; |
|
|
|
case 7 -> "Configuracion de Software"; |
|
|
|
case 8 -> "Desarrollo de Software"; |
|
|
|
case 9 -> "Digitalizacion GIS"; |
|
|
|
case 10 -> "Documento"; |
|
|
|
case 11 -> "Reporte"; |
|
|
|
case 13 -> "DML"; |
|
|
|
case 14 -> "DCL"; |
|
|
|
case 15 -> "DDL"; |
|
|
|
case 16 -> "Mantenimiento Correctivo"; |
|
|
|
case 17 -> "Actividad"; |
|
|
|
default -> "N/A"; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |