|
|
@ -18,50 +18,14 @@ public class GuardarSolicitudService { |
|
|
|
this.jdbcTemplate = jdbcTemplate; |
|
|
|
} |
|
|
|
|
|
|
|
public void guardarSolicitud( |
|
|
|
Long predioId, |
|
|
|
String tipoSolicitud, |
|
|
|
String nombreSolicitante, |
|
|
|
String parentesco, |
|
|
|
String tipoIdentificacion, |
|
|
|
String numIdentificacion, |
|
|
|
String usuarioId, |
|
|
|
String firma, |
|
|
|
String email, |
|
|
|
boolean vigencia, |
|
|
|
String estado, |
|
|
|
String detdesc, |
|
|
|
String firmaUsuario, |
|
|
|
String detCalif |
|
|
|
) { |
|
|
|
public void guardarSolicitud(int predioId, String tipoSolicitud, String solicitante, String parentesco, |
|
|
|
String tipoIdentificacion, String numIdentificacion, String usuarioId) { |
|
|
|
|
|
|
|
String procedureCall = "{call pk_soldigitales.sp_inssoldig(?, ?, sysdate, sysdate, ?, ?, ?, ?, ?, ?, to_date(?, 'dd/mm/yyyy hh24:mi:ss'), ?, ?, ?)}"; |
|
|
|
String query = "INSERT INTO soldigitales (PREDIOID, TIPO, FECHORA, FECHA, SOLICITANTE, PARENTESCO, TIPOIDEN, NUMIDEN, USUARIOID) " + |
|
|
|
"VALUES (?, ?, SYSDATE, ?, ?, ?, SUBSTR(?, 0, 4), ?, ?)"; |
|
|
|
|
|
|
|
|
|
|
|
jdbcTemplate.execute((Connection connection) -> { |
|
|
|
try (CallableStatement callableStatement = connection.prepareCall(procedureCall)) { |
|
|
|
// Asignar los parámetros de manera correcta |
|
|
|
callableStatement.setLong(1, predioId); // ID del predio |
|
|
|
callableStatement.setString(2, tipoSolicitud); // Tipo de solicitud |
|
|
|
callableStatement.setString(3, nombreSolicitante); // Solicitante |
|
|
|
callableStatement.setString(4, parentesco); // Parentesco |
|
|
|
callableStatement.setString(5, tipoIdentificacion); // Tipo de identificación |
|
|
|
callableStatement.setString(6, numIdentificacion); // Número de identificación |
|
|
|
callableStatement.setString(7, firma); // Firma digital |
|
|
|
callableStatement.setString(8, usuarioId); // Usuario ID |
|
|
|
callableStatement.setString(9, email); // Correo electrónico |
|
|
|
callableStatement.setString(10, "31/12/" + LocalDate.now().getYear() + " 23:59:59"); // Fecha de vigencia |
|
|
|
callableStatement.setString(11, estado); // Estado |
|
|
|
callableStatement.setString(12, detdesc); // Detalles de descuento |
|
|
|
callableStatement.setString(13, detCalif); // Detalles de cálculos // Detalles de cálculos |
|
|
|
jdbcTemplate.update(query, predioId, tipoSolicitud, LocalDate.now(), solicitante, parentesco, tipoIdentificacion, numIdentificacion, usuarioId); |
|
|
|
|
|
|
|
callableStatement.execute(); |
|
|
|
|
|
|
|
} catch (SQLException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
}); |
|
|
|
} |
|
|
|
} |