[ADD] consultas ficha

parent 022140d1
nbproject/private/
# Created by https://www.gitignore.io/api/java,node,linux,macos,maven,windows,eclipse,java-web,netbeans,webstorm+all,jetbrains+all
# Edit at https://www.gitignore.io/?templates=java,node,linux,macos,maven,windows,eclipse,java-web,netbeans,webstorm+all,jetbrains+all
### Eclipse ###
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
# CDT- autotools
.autotools
# Java annotation processor (APT)
.factorypath
# PDT-specific (PHP Development Tools)
.buildpath
# sbteclipse plugin
.target
# Tern plugin
.tern-project
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
# Code Recommenders
.recommenders/
# Annotation Processing
.apt_generated/
# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet
### Eclipse Patch ###
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
# Annotation Processing
.apt_generated
.sts4-cache/
### Java ###
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Java-Web ###
## ignoring target file
target/
### JetBrains+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### JetBrains+all Patch ###
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
.idea/
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
*.iml
modules.xml
.idea/misc.xml
*.ipr
### Linux ###
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Maven ###
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
### NetBeans ###
**/nbproject/private/
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
\ No newline at end of file
.nb-gradle/
### Node ###
# Logs
logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless
# FuseBox cache
.fusebox/
### WebStorm+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
# Generated files
# Sensitive or high-churn files
# Gradle
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# CMake
# Mongo Explorer plugin
# File-based project format
# IntelliJ
# mpeltonen/sbt-idea plugin
# JIRA plugin
# Cursive Clojure plugin
# Crashlytics plugin (for Android Studio and IntelliJ)
# Editor-based Rest Client
# Android studio 3.1+ serialized cache file
### WebStorm+all Patch ###
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# End of https://www.gitignore.io/api/java,node,linux,macos,maven,windows,eclipse,java-web,netbeans,webstorm+all,jetbrains+all
\ No newline at end of file
......@@ -2,9 +2,7 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="f1229581-2498-4c33-b7b4-f715a5fbe428" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/src/java/trismegistoplanilla/mysqldao/FichaMysqlDAO.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/java/trismegistoplanilla/mysqldao/FichaMysqlDAO.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/java/trismegistoplanilla/mysqldao/MysqlDAOFactory.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/java/trismegistoplanilla/mysqldao/MysqlDAOFactory.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/java/trismegistoplanilla/mysqldao/PersonaMysqlDAO.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/java/trismegistoplanilla/mysqldao/PersonaMysqlDAO.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/.tmp/" />
<ignored path="$PROJECT_DIR$/temp/" />
......@@ -28,13 +26,27 @@
<session id="-1966417198">
<usages-collector id="statistics.lifecycle.project">
<counts>
<entry key="project.closed" value="1" />
<entry key="project.closed" value="2" />
<entry key="project.open.time.15" value="1" />
<entry key="project.opened" value="1" />
<entry key="project.open.time.5" value="1" />
<entry key="project.opened" value="2" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.open">
<counts>
<entry key="java" value="1" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.open">
<counts>
<entry key="PLAIN_TEXT" value="1" />
</counts>
</usages-collector>
</session>
</component>
<component name="FileEditorManager">
<leaf />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
......@@ -95,11 +107,12 @@
<updated>1541626387552</updated>
<workItem from="1541626388621" duration="785000" />
<workItem from="1541776350897" duration="159000" />
<workItem from="1541776578549" duration="539000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="944000" />
<option name="totallyTimeSpent" value="1483000" />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
......@@ -126,7 +139,40 @@
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State>
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
<collection />
</option>
<option name="COLUMN_ORDER">
<list>
<option value="0" />
<option value="1" />
<option value="2" />
<option value="3" />
</list>
</option>
</State>
</value>
</entry>
</map>
</option>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/java/trismegistoplanilla/mysqldao/FichaMysqlDAO.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-68431" />
</provider>
</entry>
</component>
</project>
\ No newline at end of file
......@@ -45,7 +45,7 @@ public class CargaFamiliarMysqlDAO implements CargaFamiliarDAO {
} catch (SQLException e) {
e.printStackTrace();
response.setStatus(false);
response.setMessage("Error: " + e.getMessage() + " \n Error Code: [" + e.getErrorCode() + "]");
response.setMessage("Error: " + e.getMessage() + " Error Code: [" + e.getErrorCode() + "]");
} finally {
try {
if (rs != null) {
......@@ -77,25 +77,29 @@ public class CargaFamiliarMysqlDAO implements CargaFamiliarDAO {
Connection cnx = null;
try {
cnx = MysqlDAOFactory.obtenerConexion(Variables.MYSQL_NUEVO_BD_NAME);
String sql
= "SELECT "
+ "cargafamiliar.apellido_paterno apellidoPaterno , "
+ "cargafamiliar.apellido_materno apellidoMaterno , "
+ "cargafamiliar.nombre nombre, "
+ "parentesco.nombre parentesco, "
+ "Format(cargafamiliar.fecha_nacimiento, 'dd/MM/yyyy') fechaNacimiento , "
+ "(cast(datediff(dd,cargafamiliar.fecha_nacimiento,getdate()) / 365.25 as int)) edad, "
+ "tipodocumento.descripcion_larga tipoDocumentoDescripcionLarga, "
+ "tipodocumento.descripcion_corta tipoDocumentoDescripcionCorta, "
+ "cargafamiliar.numero_documento numeroDocumento , "
+ "cargafamiliar.sexo sexo, "
+ "Isnull(cargafamiliar.telefono, '-') telefono "
+ "FROM carga_familiar cargafamiliar "
String sql = "SELECT "
+ " cargafamiliar.apellido_paterno apellidoPaterno, "
+ " cargafamiliar.apellido_materno apellidoMaterno, "
+ " cargafamiliar.nombre nombre, "
+ " parentesco.nombre parentesco, "
+ " cargafamiliar.fecha_nacimiento fechaNacimiento, "
+ " YEAR (CURDATE()) - YEAR ( "
+ " cargafamiliar.fecha_nacimiento "
+ " ) edad, "
+ " tipodocumento.descripcion_larga tipoDocumentoDescripcionLarga, "
+ " tipodocumento.descripcion_corta tipoDocumentoDescripcionCorta, "
+ " cargafamiliar.numero_documento numeroDocumento, "
+ " cargafamiliar.sexo sexo, "
+ " Ifnull('-', cargafamiliar.telefono) telefono "
+ "FROM "
+ " carga_familiar cargafamiliar "
+ "INNER JOIN parentesco parentesco ON parentesco.codigo_parentesco = cargafamiliar.codigo_parentesco "
+ "INNER JOIN tipo_documento tipodocumento ON tipodocumento.codigo_tipo_documento = cargafamiliar.codigo_tipo_documento "
+ "WHERE cargafamiliar.codigo_persona = ?";
+ "WHERE "
+ " cargafamiliar.codigo_persona = ?";
ps = cnx.prepareStatement(sql);
ps.setInt(1, persona.getCodigoPersona());
rs = ps.executeQuery();
while (rs.next()) {
CargaFamiliarBean cargaFamiliar = new CargaFamiliarBean();
......@@ -124,7 +128,7 @@ public class CargaFamiliarMysqlDAO implements CargaFamiliarDAO {
} catch (SQLException e) {
e.printStackTrace();
response.setStatus(false);
response.setMessage("Error: " + e.getMessage() + " \n Error Code: [" + e.getErrorCode() + "]");
response.setMessage("Error: " + e.getMessage() + " Error Code: [" + e.getErrorCode() + "]");
} finally {
try {
if (rs != null) {
......
......@@ -26,17 +26,28 @@ public class ExperienciaLaboralMysqlDAO implements ExperienciaLaboralDAO {
try {
cnx = MysqlDAOFactory.obtenerConexion(Variables.MYSQL_NUEVO_BD_NAME);
String sql
= "SELECT "
+ "experiencialaboral.nombre_empresa nombreEmpresa, "
+ "experiencialaboral.nombre_cargo nombreCargo, "
+ "Format(experiencialaboral.fecha_inicio, 'dd/MM/yyyy') fechaInicio, "
+ "Format(experiencialaboral.fecha_fin, 'dd/MM/yyyy') fechaFin, "
+ "Isnull(experiencialaboral.telefono, '-') telefono "
+ "FROM experiencia_laboral experiencialaboral "
+ "WHERE experiencialaboral.codigo_persona = ?";
String sql = "SELECT "
+ " experiencialaboral.nombre_empresa nombreEmpresa, "
+ " experiencialaboral.nombre_cargo nombreCargo, "
+ " Format( "
+ " experiencialaboral.fecha_inicio, "
+ " 'dd/MM/yyyy' "
+ " ) fechaInicio, "
+ " Format( "
+ " experiencialaboral.fecha_fin, "
+ " 'dd/MM/yyyy' "
+ " ) fechaFin, "
+ " Ifnull( "
+ " '-', "
+ " experiencialaboral.telefono "
+ " ) telefono "
+ "FROM "
+ " experiencia_laboral experiencialaboral "
+ "WHERE "
+ " experiencialaboral.codigo_persona = ?";
ps = cnx.prepareStatement(sql);
ps.setInt(1, persona.getCodigoPersona());
rs = ps.executeQuery();
while (rs.next()) {
ExperienciaLaboralBean experienciaLaboral = new ExperienciaLaboralBean();
......@@ -59,7 +70,7 @@ public class ExperienciaLaboralMysqlDAO implements ExperienciaLaboralDAO {
} catch (SQLException e) {
e.printStackTrace();
response.setStatus(false);
response.setMessage("Error: " + e.getMessage() + " \n Error Code: [" + e.getErrorCode() + "]");
response.setMessage("Error: " + e.getMessage() + " Error Code: [" + e.getErrorCode() + "]");
} finally {
try {
if (rs != null) {
......
......@@ -1027,70 +1027,120 @@ public class FichaMysqlDAO implements FichaDAO {
try {
cnx = MysqlDAOFactory.obtenerConexion(Variables.MYSQL_NUEVO_BD_NAME);
String sql
= "SELECT "
+ "ficha.codigo_ficha codigoFicha, "
+ "persona.apellido_paterno apellidoPaterno, "
+ "persona.apellido_materno apellidoMaterno, "
+ "persona.nombre nombre, "
+ "tipodocumento.descripcion_larga tipoDocumentoDescripcionLarga, "
+ "tipodocumento.descripcion_corta tipoDocumentoDescripcionCorta, "
+ "persona.numero_documento numeroDocumento, "
+ "CASE "
+ " WHEN persona.sexo = 'M' THEN 'MASCULINO' "
+ " WHEN persona.sexo = 'F' THEN 'FEMENINO' "
+ " ELSE 'SIN SEXO' "
String sql = "SELECT "
+ " ficha.codigo_ficha codigoFicha, "
+ " personal.apellidoPaterno apellidoPaterno, "
+ " personal.apellidoMaterno apellidoMaterno, "
+ " personal.nombre nombre, "
+ " tipodocumento.descripcion_larga tipoDocumentoDescripcionLarga, "
+ " tipodocumento.descripcion_corta tipoDocumentoDescripcionCorta, "
+ " personal.dni numeroDocumento, "
+ " CASE "
+ "WHEN personal.sexo = 'M' THEN "
+ " 'MASCULINO' "
+ "WHEN personal.sexo = 'F' THEN "
+ " 'FEMENINO' "
+ "ELSE "
+ " 'SIN SEXO' "
+ "END sexo, "
+ "estadocivil.nombre estadoCivil, "
+ "Format(persona.fecha_nacimiento, 'dd/MM/yyyy') fechaNacimiento, "
+ "(cast(datediff(dd,persona.fecha_nacimiento,getdate()) / 365.25 as int)) edad, "
+ "(select count(1) from carga_familiar where carga_familiar.codigo_parentesco = 3 and carga_familiar.codigo_persona = ficha.codigo_persona) nroHijos, "
+ "nacionalidad.pais pais, "
+ "nacionalidad.gentilicio gentilicio, "
+ "nacionalidad.iso iso, "
+ "Isnull(ubigeonacimiento.nombre_departamento,'-') nombreDepartamentoNacimiento, "
+ "Isnull(ubigeonacimiento.nombre_provincia,'-') nombreProvinciaNacimiento, "
+ "Isnull(ubigeonacimiento.nombre_distrito,'-') nombreDistritoNacimiento, "
+ "Isnull(persona.direccion_documento,'-') direccionDocumento, "
+ "case when persona.telefono_fijo is null then '-' when persona.telefono_fijo = '' then '-' else persona.telefono_fijo end telefonoFijo,"
+ "case when persona.telefono_movil is null then '-' when persona.telefono_movil = '' then '-' else persona.telefono_movil end telefonoMovil,"
+ "persona.correo correo, "
+ "Isnull(cast(persona.ruc as varchar), '-') ruc, "
+ "Isnull(persona.foto, 'default.jpg') foto, "
+ "ubigeoresidencia.nombre_departamento nombreDepartamentoResidencia, "
+ "ubigeoresidencia.nombre_provincia nombreProvinciaResidencia, "
+ "ubigeoresidencia.nombre_distrito nombreDistritoResidencia, "
+ "persona.direccion_residencia direccionResidencia, "
+ "persona.latitud_residencia latitudResidencia, "
+ "persona.longitud_residencia longitudResidencia, "
+ "CASE WHEN persona.fondo_pension_activo = 0 THEN 'INACTIVO' "
+ " WHEN persona.fondo_pension_activo = 1 THEN 'ACTIVO' "
+ " ELSE 'ERROR' "
+ " estadocivil.nombre estadoCivil, "
+ " Format( "
+ " personal.fechanacimiento, "
+ " 'dd/MM/yyyy' "
+ ") fechaNacimiento, "
+ " YEAR (CURDATE()) - YEAR (personal.fechanacimiento) edad, "
+ " ( "
+ " SELECT "
+ " COUNT(1) "
+ " FROM "
+ " carga_familiar "
+ " WHERE "
+ " carga_familiar.codigo_parentesco = 3 "
+ " AND carga_familiar.codigo_persona = ficha.codigo_persona "
+ ") nroHijos, "
+ " nacionalidad.pais pais, "
+ " nacionalidad.gentilicio gentilicio, "
+ " nacionalidad.iso iso, "
+ " Ifnull( "
+ " '-', "
+ " ubigeonacimiento.nombre_departamento "
+ ") nombreDepartamentoNacimiento, "
+ " Ifnull( "
+ " '-', "
+ " ubigeonacimiento.nombre_provincia "
+ ") nombreProvinciaNacimiento, "
+ " Ifnull( "
+ " '-', "
+ " ubigeonacimiento.nombre_distrito "
+ ") nombreDistritoNacimiento, "
+ " Ifnull('-', personal.direccion) direccionDocumento, "
+ " CASE "
+ "WHEN personal.telefono IS NULL THEN "
+ " '-' "
+ "WHEN personal.telefono = '' THEN "
+ " '-' "
+ "ELSE "
+ " personal.telefono "
+ "END telefonoFijo, "
+ " CASE "
+ "WHEN personal.telefono_movil IS NULL THEN "
+ " '-' "
+ "WHEN personal.telefono_movil = '' THEN "
+ " '-' "
+ "ELSE "
+ " personal.telefono_movil "
+ "END telefonoMovil, "
+ " personal.email correo, "
+ " ifnull( "
+ " '-', "
+ " CAST(personal.ruc AS CHAR(11)) "
+ ") ruc, "
+ " ifnull( "
+ " 'default.jpg', "
+ " personal.foto "
+ ") foto, "
+ " ubigeoresidencia.nombre_departamento nombreDepartamentoResidencia, "
+ " ubigeoresidencia.nombre_provincia nombreProvinciaResidencia, "
+ " ubigeoresidencia.nombre_distrito nombreDistritoResidencia, "
+ " personal.direccion direccionResidencia, "
+ " personal.latitud_residencia latitudResidencia, "
+ " personal.longitud_residencia longitudResidencia, "
+ " CASE "
+ "WHEN personal.fondo_pension_activo = 0 THEN "
+ " 'INACTIVO' "
+ "WHEN personal.fondo_pension_activo = 1 THEN "
+ " 'ACTIVO' "
+ "ELSE "
+ " 'ERROR' "
+ "END fondoPensionActivo, "
+ "fondopension.descripcion_larga fondoPensionDescripcionLarga, "
+ "fondopension.descripcion_corta fondoPensionDescripcionCorta, "
+ "persona.enlace_alfresco enlaceAlfresco, "
+ "tipo_estado_ficha.nombre estadoFicha "
+ "FROM ficha ficha "
+ "INNER JOIN persona persona ON ficha.codigo_persona = persona.codigo_persona "
+ "INNER JOIN tipo_documento tipodocumento ON tipodocumento.codigo_tipo_documento = persona.codigo_tipo_documento "
+ "INNER JOIN estado_civil estadocivil ON estadocivil.codigo_estado_civil = persona.codigo_estado_civil "
+ "INNER JOIN nacionalidad nacionalidad ON nacionalidad.codigo_nacionalidad = persona.codigo_nacionalidad "
+ "LEFT JOIN ubigeo ubigeonacimiento ON ubigeonacimiento.codigo_ubigeo = persona.codigo_ubigeo_nacimiento "
+ "INNER JOIN ubigeo ubigeoresidencia ON ubigeoresidencia.codigo_ubigeo = persona.codigo_ubigeo_residencia "
+ "INNER JOIN fondo_pension fondopension ON fondopension.codigo_fondo_pension = persona.codigo_fondo_pension "
+ "INNER JOIN estado_ficha on estado_ficha.codigo_ficha = ficha.codigo_ficha "
+ "INNER JOIN tipo_estado_ficha on tipo_estado_ficha.codigo_tipo_estado_ficha = estado_ficha.codigo_tipo_estado_ficha "
+ "where ficha.estado_registro = 1 and estado_ficha.estado_registro = 1 and ficha.codigo_persona = ?";
+ " fondopension.descripcion_larga fondoPensionDescripcionLarga, "
+ " fondopension.descripcion_corta fondoPensionDescripcionCorta, "
+ " personal.enlace_alfresco enlaceAlfresco, "
+ " tipo_estado_ficha.nombre estadoFicha "
+ "FROM "
+ " ficha ficha "
+ "INNER JOIN personal personal ON ficha.codigo_persona = personal.codper "
+ "INNER JOIN tipo_documento tipodocumento ON tipodocumento.codigo_tipo_documento = personal.codigo_tipo_documento "
+ "INNER JOIN estado_civil estadocivil ON estadocivil.codigo_estado_civil = personal.codigo_estado_civil "
+ "INNER JOIN nacionalidad nacionalidad ON nacionalidad.codigo_nacionalidad = personal.codigo_nacionalidad "
+ "LEFT JOIN ubigeo ubigeonacimiento ON ubigeonacimiento.codigo_ubigeo = personal.codigo_ubigeo_nacimiento "
+ "INNER JOIN ubigeo ubigeoresidencia ON ubigeoresidencia.codigo_ubigeo = personal.codigo_ubigeo_residencia "
+ "INNER JOIN fondo_pension fondopension ON fondopension.codigo_fondo_pension = personal.codigo_fondo_pension "
+ "INNER JOIN estado_ficha ON estado_ficha.codigo_ficha = ficha.codigo_ficha "
+ "INNER JOIN tipo_estado_ficha ON tipo_estado_ficha.codigo_tipo_estado_ficha = estado_ficha.codigo_tipo_estado_ficha "
+ "WHERE "
+ " ficha.estado_registro = 1 "
+ "AND estado_ficha.estado_registro = 1 "
+ "AND ficha.codigo_persona = ?";
ps = cnx.prepareStatement(sql);
ps.setInt(1, persona.getCodigoPersona());
ps.setInt(1, persona.getCodigoPersona());
rs = ps.executeQuery();
rs.next();
// if (rs.next()) {
ReporteBean reporte = new ReporteBean();
reporte.setCodigoFicha(rs.getInt("codigoFicha"));
// reporte.setCodigoPersona(rs.getInt("codigoPersona"));
reporte.setApellidoPaterno(rs.getString("apellidoPaterno"));
reporte.setApellidoMaterno(rs.getString("apellidoMaterno"));
reporte.setNombre(rs.getString("nombre"));
......@@ -1125,10 +1175,7 @@ public class FichaMysqlDAO implements FichaDAO {
reporte.setFondoPensionDescripcionCorta(rs.getString("fondoPensionDescripcionCorta"));
reporte.setEnlaceAlfresco(rs.getString("enlaceAlfresco"));
reporte.setEstadoFicha(rs.getString("estadoFicha"));
// JSONObject jsonReporte = new JSONObject(reporte);
// jsonArrayListarDatosFicha.put(jsonReporte);
jsonReporte = new JSONObject(reporte);
// }
JSONObject jsonObjListadoPersona = new JSONObject();
jsonObjListadoPersona.put("persona", jsonReporte);
......@@ -1174,15 +1221,16 @@ public class FichaMysqlDAO implements FichaDAO {
String condicionPorUsuario = "";
int cantidad = 0;
int numeroFilas = start + 1;
if (criterioClient.isNull("tipoBusqueda")) {
filtroListarFichas = "";
} else {
switch (criterioClient.getString("tipoBusqueda")) {
case "TIPO_DOCUMENTO":
filtroListarFichas = "and tipo_documento.codigo_tipo_documento = " + criterioClient.getInt("codigoTipoDocumento") + " and persona.numero_documento = '" + criterioClient.getString("numeroDocumento") + "'";
filtroListarFichas = "and tipo_documento.codigo_tipo_documento = " + criterioClient.getInt("codigoTipoDocumento") + " and personal.dni = '" + criterioClient.getString("numeroDocumento") + "'";
break;
case "APELLIDOS":
filtroListarFichas = "and persona.apellido_paterno like '" + criterioClient.getString("apellido") + "%'";
filtroListarFichas = "and persona.apellidoPaterno like '" + criterioClient.getString("apellido") + "%'";
break;
case "FECHA_REGISTRO":
filtroListarFichas = "and format(estado_ficha.fecha_registro, 'dd/MM/yyyy') between '" + criterioClient.getString("fechaDesde") + "' and '" + criterioClient.getString("fechaHasta") + "'";
......@@ -1199,60 +1247,40 @@ public class FichaMysqlDAO implements FichaDAO {
if (u.getCodigoProyectoDetalle() == 5) {
condicionPorUsuario = " ";
} else {
// condicionPorUsuario = " and estado_ficha.codigo_usuario in (" + u.getCodigoUsuario() + ", 0)";
condicionPorUsuario = " and ficha.codigo_ficha in (select ef.codigo_ficha from estado_ficha ef where ef.codigo_usuario = " + u.getCodigoUsuario() + " and ef.codigo_tipo_estado_ficha not in (13))";
}
String sql = "SELECT "
+ " TOP " + length + " ficha.codigo_ficha codigoficha, "
+ " persona.codigo_persona codigopersona, "
+ " ficha.codigo_ficha codigoficha, "
+ " personal.codper codigopersona, "
+ " tipo_documento.codigo_tipo_documento codigotipodocumento, "
+ " tipo_documento.descripcion_corta tipodocumentodescripcioncorta, "
+ " persona.numero_documento numerodocumento, "
+ " persona.apellido_paterno apellidopaterno, "
+ " persona.apellido_materno apellidomaterno, "
+ " persona.nombre nombre, "
+ " personal.dni numerodocumento, "
+ " personal.apellidoPaterno apellidopaterno, "
+ " personal.apellidoMaterno apellidomaterno, "
+ " personal.nombre nombre, "
+ " CASE "
+ "WHEN persona.apellido_paterno = '' "
+ "AND persona.apellido_materno = '' "
+ "AND persona.nombre = '' THEN "
+ "WHEN personal.apellidoPaterno = '' "
+ "AND personal.apellidoMaterno = '' "
+ "AND personal.nombre = '' THEN "
+ " '-' "
+ "WHEN persona.apellido_paterno IS NULL "
+ "OR persona.apellido_materno IS NULL "
+ "OR persona.nombre IS NULL THEN "
+ "WHEN personal.apellidoPaterno IS NULL "
+ "OR personal.apellidoMaterno IS NULL "
+ "OR personal.nombre IS NULL THEN "
+ " '-' "
+ "ELSE "
+ " persona.apellido_paterno + ' ' + persona.apellido_materno + ', ' + persona.nombre "
+ " personal.apellidoPaterno + ' ' + personal.apellidoMaterno + ', ' + personal.nombre "
+ "END personal, "
+ " persona.correo correo, "
+ " isnull(cargo.nombre, '-') cargo, "
+ " format ( "
+ " estado_ficha.fecha_registro, "
+ " 'dd/MM/yyyy' "
+ ") + ' ' + stuff( "
+ " replace( "
+ " RIGHT ( "
+ " CONVERT ( "
+ " VARCHAR (19), "
+ " estado_ficha.fecha_registro, "
+ " 0 "
+ " ), "
+ " 7 "
+ " ), "
+ " ' ', "
+ " '0' "
+ " ), "
+ " 6, "
+ " 0, "
+ " ' ' "
+ ") fecharegistroficha, "
+ " personal.email correo, "
+ " ifnull(cargo.nombre, '-') cargo, "
+ " estado_ficha.fecha_registro fecharegistroficha, "
+ " tipo_estado_ficha.codigo_tipo_estado_ficha codigoTipoEstadoFicha, "
+ " tipo_estado_ficha.nombre estadoficha, "
+ " '<span class=\"' + tipo_estado_ficha.estilo + '\">' + tipo_estado_ficha.nombre + '</span>' estilo "
+ "FROM "
+ " ficha "
+ "INNER JOIN persona ON persona.codigo_persona = ficha.codigo_persona "
+ "INNER JOIN tipo_documento ON tipo_documento.codigo_tipo_documento = persona.codigo_tipo_documento "
+ "INNER JOIN personal ON personal.codper = ficha.codigo_persona "
+ "INNER JOIN tipo_documento ON tipo_documento.codigo_tipo_documento = personal.codigo_tipo_documento "
+ "INNER JOIN estado_ficha ON estado_ficha.codigo_ficha = ficha.codigo_ficha "
+ "INNER JOIN tipo_estado_ficha ON tipo_estado_ficha.codigo_tipo_estado_ficha = estado_ficha.codigo_tipo_estado_ficha "
+ "LEFT JOIN ficha_laboral ON ficha_laboral.codigo_ficha = ficha.codigo_ficha "
......@@ -1263,20 +1291,26 @@ public class FichaMysqlDAO implements FichaDAO {
+ "AND ficha.estado_registro IN (0, 1) "
+ "AND ficha.codigo_ficha NOT IN ( "
+ " SELECT "
+ " TOP " + start + " f.codigo_ficha "
+ " * "
+ " FROM "
+ " ficha f "
+ " INNER JOIN estado_ficha ef ON ef.codigo_ficha = f.codigo_ficha "
+ " WHERE "
+ " ef.estado_registro = 1 "
+ " AND f.estado_registro IN (0, 1) "
+ " ORDER BY "
+ " ef.fecha_registro DESC "
+ " ( "
+ " SELECT "
+ " f.codigo_ficha "
+ " FROM "
+ " ficha f "
+ " INNER JOIN estado_ficha ef ON ef.codigo_ficha = f.codigo_ficha "
+ " WHERE "
+ " ef.estado_registro = 1 "
+ " AND f.estado_registro IN (0, 1) "
+ " ORDER BY "
+ " ef.fecha_registro DESC "
+ " LIMIT " + start + " "
+ " ) temp_tab "
+ ") "
+ " " + filtroListarFichas + condicionPorUsuario
+ "ORDER BY "
+ " estado_ficha.fecha_registro DESC";
System.out.println(sql);
+ " estado_ficha.fecha_registro DESC "
+ "LIMIT " + length + " ";
try {
conexion = MysqlDAOFactory.obtenerConexion(Variables.MYSQL_NUEVO_BD_NAME);
......@@ -1304,18 +1338,20 @@ public class FichaMysqlDAO implements FichaDAO {
JAlistarFichas.put(objListadoFicha);
}
sql = ""
+ "select "
+ "count(1) cantidad "
+ "from ficha "
+ "inner join persona ON persona.codigo_persona = ficha.codigo_persona "
+ "inner join tipo_documento ON tipo_documento.codigo_tipo_documento = persona.codigo_tipo_documento "
+ "inner join estado_ficha ON estado_ficha.codigo_ficha = ficha.codigo_ficha "
+ "inner join tipo_estado_ficha ON tipo_estado_ficha.codigo_tipo_estado_ficha = estado_ficha.codigo_tipo_estado_ficha "
+ "left join ficha_laboral ON ficha_laboral.codigo_ficha = ficha.codigo_ficha "
+ "left join area_cargo ON area_cargo.codigo_area_cargo = ficha_laboral.codigo_area_cargo "
+ "left join cargo ON cargo.codigo_cargo = area_cargo.codigo_cargo "
+ "where estado_ficha.estado_registro = 1 and ficha.estado_registro in (0,1) " + filtroListarFichas + condicionPorUsuario;
sql = "SELECT "
+ " count(1) cantidad "
+ "FROM "
+ " ficha "
+ "INNER JOIN personal ON personal.codper = ficha.codigo_persona "
+ "INNER JOIN tipo_documento ON tipo_documento.codigo_tipo_documento = personal.codigo_tipo_documento "
+ "INNER JOIN estado_ficha ON estado_ficha.codigo_ficha = ficha.codigo_ficha "
+ "INNER JOIN tipo_estado_ficha ON tipo_estado_ficha.codigo_tipo_estado_ficha = estado_ficha.codigo_tipo_estado_ficha "
+ "LEFT JOIN ficha_laboral ON ficha_laboral.codigo_ficha = ficha.codigo_ficha "
+ "LEFT JOIN area_cargo ON area_cargo.codigo_area_cargo = ficha_laboral.codigo_area_cargo "
+ "LEFT JOIN cargo ON cargo.codigo_cargo = area_cargo.codigo_cargo "
+ "WHERE "
+ " estado_ficha.estado_registro = 1 "
+ "AND ficha.estado_registro IN (0, 1) " + filtroListarFichas + condicionPorUsuario;
psCount = conexion.prepareStatement(sql);
rsCount = psCount.executeQuery();
......@@ -1362,23 +1398,27 @@ public class FichaMysqlDAO implements FichaDAO {
JSONArray JAlistarDetalleEstadoFicha = new JSONArray();
ResponseHelper response = new ResponseHelper();
String sql = ""
+ "select "
+ "tipo_estado_ficha.nombre nombreEstado, "
+ "tipo_estado_ficha.descripcion descripcionEstado, "
+ "format(estado_ficha.fecha_registro, 'dd/MM/yyyy') + ' ' + STUFF(REPLACE(RIGHT(CONVERT(varchar(19), estado_ficha.fecha_registro, 0), 7), ' ', '0'), 6, 0, ' ') fechaRegistroEstado, "
+ "estado_ficha.codigo_usuario codigoUsuario, "
+ "case "
+ "when estado_ficha.codigo_usuario = 0 then persona.apellido_paterno + ' ' + persona.apellido_materno + ' ' + persona.nombre "
+ "else trabajador_responsable.apellido_paterno + ' ' + trabajador_responsable.apellido_materno + ' ' +trabajador_responsable.nombre "
+ "end nombreUsuario "
+ "from ficha "
+ "inner join persona ON persona.codigo_persona = ficha.codigo_persona "
+ "inner join estado_ficha ON estado_ficha.codigo_ficha = ficha.codigo_ficha "
+ "inner join tipo_estado_ficha ON tipo_estado_ficha.codigo_tipo_estado_ficha = estado_ficha.codigo_tipo_estado_ficha "
+ "left join trabajador_responsable on trabajador_responsable.codigo_usuario = estado_ficha.codigo_usuario "
+ "where ficha.codigo_ficha = ? "
+ "order by estado_ficha.fecha_registro";
String sql = "SELECT "
+ " tipo_estado_ficha.nombre nombreEstado, "
+ " tipo_estado_ficha.descripcion descripcionEstado, "
+ " estado_ficha.fecha_registro fechaRegistroEstado, "
+ " estado_ficha.codigo_usuario codigoUsuario, "
+ " CASE "
+ "WHEN estado_ficha.codigo_usuario = 0 THEN "
+ " personal.apellidoPaterno + ' ' + personal.apellidoMaterno + ' ' + personal.nombre "
+ "ELSE "
+ " trabajador_responsable.apellido_paterno + ' ' + trabajador_responsable.apellido_materno + ' ' + trabajador_responsable.nombre "
+ "END nombreUsuario "
+ "FROM "
+ " ficha "
+ "INNER JOIN personal ON personal.codper = ficha.codigo_persona "
+ "INNER JOIN estado_ficha ON estado_ficha.codigo_ficha = ficha.codigo_ficha "
+ "INNER JOIN tipo_estado_ficha ON tipo_estado_ficha.codigo_tipo_estado_ficha = estado_ficha.codigo_tipo_estado_ficha "
+ "LEFT JOIN trabajador_responsable ON trabajador_responsable.codigo_usuario = estado_ficha.codigo_usuario "
+ "WHERE "
+ " ficha.codigo_ficha = ? "
+ "ORDER BY "
+ " estado_ficha.fecha_registro";
Connection conexion = null;
PreparedStatement ps = null;
......@@ -1387,6 +1427,7 @@ public class FichaMysqlDAO implements FichaDAO {
conexion = MysqlDAOFactory.obtenerConexion(Variables.MYSQL_NUEVO_BD_NAME);
ps = conexion.prepareStatement(sql);
ps.setInt(1, f.getCodigoFicha());
rs = ps.executeQuery();
while (rs.next()) {
DetalleEstadoFichaBean def = new DetalleEstadoFichaBean();
......@@ -1398,6 +1439,7 @@ public class FichaMysqlDAO implements FichaDAO {
JSONObject objDetalleEstadoFicha = new JSONObject(def);
JAlistarDetalleEstadoFicha.put(objDetalleEstadoFicha);
}
JSONObject objDetalleEstadoFicha = new JSONObject();
objDetalleEstadoFicha.put("detallesEstadoFicha", JAlistarDetalleEstadoFicha);
response.setStatus(true);
......@@ -1434,54 +1476,114 @@ public class FichaMysqlDAO implements FichaDAO {
JSONArray JAlistarDatosAdministrativos = new JSONArray();
ResponseHelper response = new ResponseHelper();
String sql = ""
+ "select "
+ "ficha_laboral.codigo_ficha codigoFicha, "
+ "format(ficha_laboral.fecha_ingreso,'dd/MM/yyyy') fechaIngreso, "
+ "format(ficha_laboral.fecha_fin,'dd/MM/yyyy') fechaTermino, "
+ "sede.nombre sede, "
+ "area.nombre area, "
+ "cargo.nombre cargo, "
+ "case "
+ "when ficha_laboral.tipo_ficha = 'A' then "
+ "("
+ "select codigo_area_cargo_tipo_pago "
+ "from sueldo_administrativo "
+ "where estado_registro = 1 "
+ "and codigo_ficha = " + f.getCodigoFicha() + " "
+ ") "
+ "when ficha_laboral.tipo_ficha = 'D' then "
+ "( "
+ "select codigo_area_cargo_tipo_pago "
+ "from sueldo_docente "
+ "where estado_registro = 1 "
+ "and codigo_ficha = " + f.getCodigoFicha() + " "
// String sql = ""
// + "select "
// + "ficha_laboral.codigo_ficha codigoFicha, "
// + "format(ficha_laboral.fecha_ingreso,'dd/MM/yyyy') fechaIngreso, "
// + "format(ficha_laboral.fecha_fin,'dd/MM/yyyy') fechaTermino, "
// + "sede.nombre sede, "
// + "area.nombre area, "
// + "cargo.nombre cargo, "
// + "case "
// + "when ficha_laboral.tipo_ficha = 'A' then "
// + "("
// + "select codigo_area_cargo_tipo_pago "
// + "from sueldo_administrativo "
// + "where estado_registro = 1 "
// + "and codigo_ficha = " + f.getCodigoFicha() + " "
// + ") "
// + "when ficha_laboral.tipo_ficha = 'D' then "
// + "( "
// + "select codigo_area_cargo_tipo_pago "
// + "from sueldo_docente "
// + "where estado_registro = 1 "
// + "and codigo_ficha = " + f.getCodigoFicha() + " "
// + ") "
// + "end codigoAreaCargoTipoPago, "
// + "case "
// + " when ficha_laboral.tipo_ficha = 'A' then "
// + " ( "
// + " select tipo_pago.nombre from tipo_pago "
// + " inner join area_cargo_tipo_pago ON area_cargo_tipo_pago.codigo_tipo_pago = tipo_pago.codigo_tipo_pago "
// + " inner join sueldo_administrativo ON sueldo_administrativo.codigo_area_cargo_tipo_pago = area_cargo_tipo_pago.codigo_area_cargo_tipo_pago "
// + " where sueldo_administrativo.codigo_ficha = ficha_laboral.codigo_ficha and sueldo_administrativo.estado_registro = 1 "
// + " ) "
// + " when ficha_laboral.tipo_ficha = 'D' then "
// + " ( "
// + " select tipo_pago.nombre from tipo_pago "
// + " inner join area_cargo_tipo_pago ON area_cargo_tipo_pago.codigo_tipo_pago = tipo_pago.codigo_tipo_pago "
// + " inner join sueldo_docente ON sueldo_docente.codigo_area_cargo_tipo_pago = area_cargo_tipo_pago.codigo_area_cargo_tipo_pago "
// + " where sueldo_docente.codigo_ficha = ficha_laboral.codigo_ficha and sueldo_docente.estado_registro = 1 "
// + " ) "
// + "end tipoPago, "
// + "case when ficha_laboral.tipo_ficha = 'A' then 'ADMINISTRATIVO' else 'DOCENTE' end tipoFicha "
// + "from ficha_laboral "
// + "inner join sede_area ON sede_area.codigo_sede_area = ficha_laboral.codigo_sede_area "
// + "inner join sede ON sede.codigo_sede = sede_area.codigo_sede "
// + "inner join area_cargo ON area_cargo.codigo_area_cargo = ficha_laboral.codigo_area_cargo "
// + "inner join area ON area.codigo_area = area_cargo.codigo_area "
// + "inner join cargo ON cargo.codigo_cargo = area_cargo.codigo_cargo "
// + "where ficha_laboral.codigo_ficha = ?";
String sql = "SELECT "
+ " ficha.codigo_ficha codigoficha, "
+ " personal.codper codigopersona, "
+ " tipo_documento.codigo_tipo_documento codigotipodocumento, "
+ " tipo_documento.descripcion_corta tipodocumentodescripcioncorta, "
+ " personal.dni numerodocumento, "
+ " personal.apellidoPaterno apellidopaterno, "
+ " personal.apellidoMaterno apellidomaterno, "
+ " personal.nombre nombre, "
+ " CASE "
+ "WHEN personal.apellidoPaterno = '' "
+ "AND personal.apellidoMaterno = '' "
+ "AND personal.nombre = '' THEN "
+ " '-' "
+ "WHEN personal.apellidoPaterno IS NULL "
+ "OR personal.apellidoMaterno IS NULL "
+ "OR personal.nombre IS NULL THEN "
+ " '-' "
+ "ELSE "
+ " personal.apellidoPaterno + ' ' + personal.apellidoMaterno + ', ' + personal.nombre "
+ "END personal, "
+ " personal.email correo, "
+ " ifnull(cargo.nombre, '-') cargo, "
+ " estado_ficha.fecha_registro fecharegistroficha, "
+ " tipo_estado_ficha.codigo_tipo_estado_ficha codigoTipoEstadoFicha, "
+ " tipo_estado_ficha.nombre estadoficha, "
+ " '<span class=\"' + tipo_estado_ficha.estilo + '\">' + tipo_estado_ficha.nombre + '</span>' estilo "
+ "FROM "
+ " ficha "
+ "INNER JOIN personal ON personal.codper = ficha.codigo_persona "
+ "INNER JOIN tipo_documento ON tipo_documento.codigo_tipo_documento = personal.codigo_tipo_documento "
+ "INNER JOIN estado_ficha ON estado_ficha.codigo_ficha = ficha.codigo_ficha "
+ "INNER JOIN tipo_estado_ficha ON tipo_estado_ficha.codigo_tipo_estado_ficha = estado_ficha.codigo_tipo_estado_ficha "
+ "LEFT JOIN ficha_laboral ON ficha_laboral.codigo_ficha = ficha.codigo_ficha "
+ "LEFT JOIN area_cargo ON area_cargo.codigo_area_cargo = ficha_laboral.codigo_area_cargo "
+ "LEFT JOIN cargo ON cargo.codigo_cargo = area_cargo.codigo_cargo "
+ "WHERE "
+ " estado_ficha.estado_registro = 1 "
+ "AND ficha.estado_registro IN (0, 1) "
+ "AND ficha.codigo_ficha NOT IN ( "
+ " SELECT "
+ " * "
+ " FROM "
+ " ( "
+ " SELECT "
+ " f.codigo_ficha "
+ " FROM "
+ " ficha f "
+ " INNER JOIN estado_ficha ef ON ef.codigo_ficha = f.codigo_ficha "
+ " WHERE "
+ " ef.estado_registro = 1 "
+ " AND f.estado_registro IN (0, 1) "
+ " ORDER BY "
+ " ef.fecha_registro DESC "
+ " LIMIT 0 "
+ " ) temp_tab "
+ ") "
+ "end codigoAreaCargoTipoPago, "
+ "case "
+ " when ficha_laboral.tipo_ficha = 'A' then "
+ " ( "
+ " select tipo_pago.nombre from tipo_pago "
+ " inner join area_cargo_tipo_pago ON area_cargo_tipo_pago.codigo_tipo_pago = tipo_pago.codigo_tipo_pago "
+ " inner join sueldo_administrativo ON sueldo_administrativo.codigo_area_cargo_tipo_pago = area_cargo_tipo_pago.codigo_area_cargo_tipo_pago "
+ " where sueldo_administrativo.codigo_ficha = ficha_laboral.codigo_ficha and sueldo_administrativo.estado_registro = 1 "
+ " ) "
+ " when ficha_laboral.tipo_ficha = 'D' then "
+ " ( "
+ " select tipo_pago.nombre from tipo_pago "
+ " inner join area_cargo_tipo_pago ON area_cargo_tipo_pago.codigo_tipo_pago = tipo_pago.codigo_tipo_pago "
+ " inner join sueldo_docente ON sueldo_docente.codigo_area_cargo_tipo_pago = area_cargo_tipo_pago.codigo_area_cargo_tipo_pago "
+ " where sueldo_docente.codigo_ficha = ficha_laboral.codigo_ficha and sueldo_docente.estado_registro = 1 "
+ " ) "
+ "end tipoPago, "
+ "case when ficha_laboral.tipo_ficha = 'A' then 'ADMINISTRATIVO' else 'DOCENTE' end tipoFicha "
+ "from ficha_laboral "
+ "inner join sede_area ON sede_area.codigo_sede_area = ficha_laboral.codigo_sede_area "
+ "inner join sede ON sede.codigo_sede = sede_area.codigo_sede "
+ "inner join area_cargo ON area_cargo.codigo_area_cargo = ficha_laboral.codigo_area_cargo "
+ "inner join area ON area.codigo_area = area_cargo.codigo_area "
+ "inner join cargo ON cargo.codigo_cargo = area_cargo.codigo_cargo "
+ "where ficha_laboral.codigo_ficha = ?";
+ "ORDER BY "
+ " estado_ficha.fecha_registro DESC "
+ "LIMIT 20";
Connection conexion = null;
PreparedStatement ps = null, psCostos = null;
......
......@@ -26,26 +26,46 @@ public class FormacionAcademicaMysqlDAO implements FormacionAcademicaDAO {
try {
cnx = MysqlDAOFactory.obtenerConexion(Variables.MYSQL_NUEVO_BD_NAME);
String sql
= "SELECT "
+ "formacionacademica.nombre_centro_estudio centroEstudios, "
+ "nivelestudio.nombre nivelEstudio, "
+ "estadoestudio.nombre estadoEstudio, "
+ "Format(formacionacademica.fecha_inicio, 'dd/MM/yyyy') fechaInicio, "
+ "isnull(Format(formacionacademica.fecha_fin, 'dd/MM/yyyy'),'-') fechaFin, "
+ "Isnull(formacionacademica.documento_adjunto, 'NO TIENE DOCUMENTO ADJUNTO') documentoAdjunto,"
+ "IsNull(formacionacademica.carrera_profesional,'-') carreraProfesional, "
+ "formacionacademica.sector_institucion sectorInstitucion, "
+ "Isnull(formacionacademica.numero_colegiatura, '-') numeroColegiatura, "
+ "Isnull(formacionacademica.observacion, '-') observacion "
+ "FROM formacion_academica formacionacademica "
String sql = "SELECT "
+ " formacionacademica.nombre_centro_estudio centroEstudios, "
+ " nivelestudio.nombre nivelEstudio, "
+ " estadoestudio.nombre estadoEstudio, "
+ " formacionacademica.fecha_inicio fechaInicio, "
+ " ifnull( "
+ " '-', "
+ " Format( "
+ " formacionacademica.fecha_fin, "
+ " 'dd/MM/yyyy' "
+ " ) "
+ " ) fechaFin, "
+ " Ifnull( "
+ " 'NO TIENE DOCUMENTO ADJUNTO', "
+ " formacionacademica.documento_adjunto "
+ " ) documentoAdjunto, "
+ " IfNull( "
+ " '-', "
+ " formacionacademica.carrera_profesional "
+ " ) carreraProfesional, "
+ " formacionacademica.sector_institucion sectorInstitucion, "
+ " Ifnull( "
+ " '-', "
+ " formacionacademica.numero_colegiatura "
+ " ) numeroColegiatura, "
+ " Ifnull( "
+ " '-', "
+ " formacionacademica.observacion "
+ " ) observacion "
+ "FROM "
+ " formacion_academica formacionacademica "
+ "INNER JOIN nivel_estado nivelestado ON nivelestado.codigo_nivel_estado = formacionacademica.codigo_nivel_estado "
+ "INNER JOIN estado_estudio estadoestudio ON estadoestudio.codigo_estado_estudio = nivelestado.codigo_estado_estudio "
+ "INNER JOIN nivel_estudio nivelestudio ON nivelestudio.codigo_nivel_estudio = nivelestado.codigo_nivel_estudio "
+ "where formacionacademica.codigo_persona = ?";
+ "WHERE "
+ " formacionacademica.codigo_persona = ?";
ps = cnx.prepareStatement(sql);
ps.setInt(1, persona.getCodigoPersona());
rs = ps.executeQuery();
while (rs.next()) {
FormacionAcademicaBean formacionAcademica = new FormacionAcademicaBean();
......@@ -73,7 +93,7 @@ public class FormacionAcademicaMysqlDAO implements FormacionAcademicaDAO {
} catch (SQLException e) {
e.printStackTrace();
response.setStatus(false);
response.setMessage("Error: " + e.getMessage() + " \n Error Code: [" + e.getErrorCode() + "]");
response.setMessage("Error: " + e.getMessage() + " Error Code: [" + e.getErrorCode() + "]");
} finally {
try {
if (rs != null) {
......
......@@ -31,195 +31,195 @@ import trismegistoplanilla.utilities.DateTimeServer;
public class DetalleLoteFichaAdministrativaServlet extends HttpServlet {
private static final long serialVersionUID = 7658135208116415341L;
private static final long serialVersionUID = 7658135208116415341L;
@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String accion = request.getParameter("accion");
if (accion.equals("imprimirLote")) {
imprimirLote(request, response);
}
}
@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String accion = request.getParameter("accion");
if (accion.equals("imprimirLote")) {
imprimirLote(request, response);
}
}
private void imprimirLote(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
private void imprimirLote(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// PrintWriter out = response.getWriter();
String numeroLote = request.getParameter("numeroLote");
int numeroFilas = Integer.parseInt(request.getParameter("numeroFilas"));
String json = request.getParameter("data");
JSONArray JAResponse = new JSONArray(json);
String numeroLote = request.getParameter("numeroLote");
int numeroFilas = Integer.parseInt(request.getParameter("numeroFilas"));
String json = request.getParameter("data");
JSONArray JAResponse = new JSONArray(json);
// out.println(numeroLote);
// out.println(numeroFilas);
// out.println(json);
createPDF(request, response, numeroLote, JAResponse);
}
private void createPDF(HttpServletRequest request, HttpServletResponse response, String numeroLote, JSONArray JAResponse) throws ServletException, IOException {
String fileName = "loteAdministrativo" + numeroLote + ".pdf";
response.setContentType("application/pdf");
response.setHeader("Expires", "0");
response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0");
response.setHeader("Content-Disposition", "inline; filename=" + fileName);
response.setHeader("Accept-Ranges", "bytes");
try {
Document documento = new Document(PageSize.A4.rotate(), 5, 5, 5, 5);
PdfWriter writer = PdfWriter.getInstance(documento, response.getOutputStream());
MyFooter event = new MyFooter();
writer.setPageEvent(event);
documento.open();
// logo saco oliveros y sistema helicoidal
Image logoSOSH = Image.getInstance("C:\\_AppServ\\www\\img\\so_sh.png");
logoSOSH.scaleToFit(200, 200);
logoSOSH.setAlignment(Chunk.ALIGN_LEFT);
Image logoAPE = Image.getInstance("C:\\_AppServ\\www\\img\\ap.png");
logoAPE.scaleToFit(200, 200);
logoAPE.setAlignment(Chunk.ALIGN_RIGHT);
// tabla logo
PdfPTable tablaLogo = new PdfPTable(2);
tablaLogo.setWidthPercentage(100);
PdfPCell celda1 = new PdfPCell();
PdfPCell celda2 = new PdfPCell();
celda1.setBorder(Rectangle.NO_BORDER);
celda2.setBorder(Rectangle.NO_BORDER);
celda1.addElement(logoSOSH);
celda2.addElement(logoAPE);
tablaLogo.addCell(celda1);
tablaLogo.addCell(celda2);
documento.add(tablaLogo);
// titulo principal
Paragraph titulo = new Paragraph("HABER ADMINISTRATIVO",
FontFactory.getFont("arial", 22, Font.UNDERLINE, BaseColor.BLACK));
titulo.setAlignment(Element.ALIGN_CENTER);
documento.add(titulo);
// lote
Paragraph lote = new Paragraph("N° LOTE " + numeroLote,
FontFactory.getFont("arial", 22, Font.BOLD, BaseColor.BLACK));
lote.setAlignment(Element.ALIGN_CENTER);
documento.add(lote);
// salto de linea
documento.add(new Phrase(""));
// cabecera
String[] cabecera = {"NRO", "APELLIDOS Y NOMBRES", "TIPO DOC.", "NRO DOC.", "ESCALAFÓN", "PROPUESTO", "PRESIDENCIA", "OBSERVACIÓN"};
PdfPTable tablaData = new PdfPTable(cabecera.length);
tablaData.setWidths(new float[]{0.5f, 3, 1, 1, 1, 1, 1, 4});
tablaData.setWidthPercentage(100);
for (int i = 0; i < cabecera.length; i++) {
switch (i) {
case 4:
tablaData.addCell(createCell("SUELDO (S/.)", 0.5f, 3, Element.ALIGN_CENTER, Font.BOLD));
break;
case 5:
break;
case 6:
break;
default:
tablaData.addCell(createCell("", 0, 1, Element.ALIGN_CENTER, Font.BOLD));
break;
}
}
for (String tituloCabecera : cabecera) {
tablaData.addCell(createCell(tituloCabecera, 0.5f, 1, Element.ALIGN_CENTER, Font.BOLD));
}
// data
for (int i = 0; i < cabecera.length; i++) {
if (i < JAResponse.length()) {
JSONObject data = JAResponse.getJSONObject(i);
tablaData.addCell(createCell("" + (i + 1), 0.5f, 1, Element.ALIGN_CENTER, Font.NORMAL));
tablaData.addCell(createCell(data.getString("apellidoPaterno") + " " + data.getString("apellidoMaterno") + ", " + data.getString("nombre"), 0.5f, 1, Element.ALIGN_LEFT, Font.NORMAL));
tablaData.addCell(createCell(data.getString("tipoDocumento"), 0.5f, 1, Element.ALIGN_LEFT, Font.NORMAL));
tablaData.addCell(createCell(data.getString("numeroDocumento"), 0.5f, 1, Element.ALIGN_LEFT, Font.NORMAL));
tablaData.addCell(createCell(data.getString("sueldoEscalafon"), 0.5f, 1, Element.ALIGN_CENTER, Font.NORMAL));
tablaData.addCell(createCell(data.getString("sueldoMensual"), 0.5f, 1, Element.ALIGN_CENTER, Font.NORMAL));
tablaData.addCell(createCell("", 0.5f, 1, Element.ALIGN_LEFT, Font.NORMAL));
tablaData.addCell(createCell("", 0.5f, 1, Element.ALIGN_LEFT, Font.NORMAL));
} else {
break;
}
}
documento.add(tablaData);
// salto de linea
documento.add(Chunk.NEWLINE);
documento.add(Chunk.NEWLINE);
documento.add(Chunk.NEWLINE);
documento.add(Chunk.NEWLINE);
documento.add(Chunk.NEWLINE);
// responsables
String[] responsables = new String[]{"Fabianna Janeht Gonzáles Saavedra", "Wilmer Carrasco Beas"};
// cargos
String[] cargos = new String[]{"Directora General", "Presidente de la A.C.E.S.O"};
PdfPTable tablaAutorizacion = new PdfPTable(responsables.length);
PdfPCell cellFirma = new PdfPCell(new Phrase("______________________________"));
cellFirma.setBorder(Rectangle.NO_BORDER);
PdfPCell cellResponsable = null;
PdfPCell cellCargo = null;
// firmas
for (int i = 0; i < responsables.length; i++) {
tablaAutorizacion.addCell(cellFirma);
}
// repsonsables
for (int i = 0; i < responsables.length; i++) {
cellResponsable = new PdfPCell(new Phrase(responsables[i]));
cellResponsable.setBorder(Rectangle.NO_BORDER);
tablaAutorizacion.addCell(cellResponsable);
}
// cargos
for (int i = 0; i < responsables.length; i++) {
cellCargo = new PdfPCell(new Phrase(cargos[i]));
cellCargo.setBorder(Rectangle.NO_BORDER);
tablaAutorizacion.addCell(cellCargo);
}
documento.add(tablaAutorizacion);
documento.close();
} catch (DocumentException e) {
throw new IOException(e.getMessage());
}
}
public PdfPCell createCell(String content, float borderWidth, int colspan, int alignment, int textStyle) {
Font f = new Font(Font.FontFamily.HELVETICA, 7, textStyle, GrayColor.BLACK);
PdfPCell cell = new PdfPCell(new Phrase(content, f));
cell.setBorderWidth(borderWidth);
cell.setColspan(colspan);
cell.setHorizontalAlignment(alignment);
return cell;
}
class MyFooter extends PdfPageEventHelper {
Font ffont = new Font(Font.FontFamily.COURIER, 5, Font.BOLD);
@Override
public void onEndPage(PdfWriter writer, Document document) {
createPDF(request, response, numeroLote, JAResponse);
}
private void createPDF(HttpServletRequest request, HttpServletResponse response, String numeroLote, JSONArray JAResponse) throws ServletException, IOException {
String fileName = "loteAdministrativo" + numeroLote + ".pdf";
response.setContentType("application/pdf");
response.setHeader("Expires", "0");
response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0");
response.setHeader("Content-Disposition", "inline; filename=" + fileName);
response.setHeader("Accept-Ranges", "bytes");
try {
Document documento = new Document(PageSize.A4.rotate(), 5, 5, 5, 5);
PdfWriter writer = PdfWriter.getInstance(documento, response.getOutputStream());
MyFooter event = new MyFooter();
writer.setPageEvent(event);
documento.open();
// logo saco oliveros y sistema helicoidal
Image logoSOSH = Image.getInstance("C:\\AppServ\\www\\img\\so_sh.png");
logoSOSH.scaleToFit(200, 200);
logoSOSH.setAlignment(Chunk.ALIGN_LEFT);
Image logoAPE = Image.getInstance("C:\\AppServ\\www\\img\\ap.png");
logoAPE.scaleToFit(200, 200);
logoAPE.setAlignment(Chunk.ALIGN_RIGHT);
// tabla logo
PdfPTable tablaLogo = new PdfPTable(2);
tablaLogo.setWidthPercentage(100);
PdfPCell celda1 = new PdfPCell();
PdfPCell celda2 = new PdfPCell();
celda1.setBorder(Rectangle.NO_BORDER);
celda2.setBorder(Rectangle.NO_BORDER);
celda1.addElement(logoSOSH);
celda2.addElement(logoAPE);
tablaLogo.addCell(celda1);
tablaLogo.addCell(celda2);
documento.add(tablaLogo);
// titulo principal
Paragraph titulo = new Paragraph("HABER ADMINISTRATIVO",
FontFactory.getFont("arial", 22, Font.UNDERLINE, BaseColor.BLACK));
titulo.setAlignment(Element.ALIGN_CENTER);
documento.add(titulo);
// lote
Paragraph lote = new Paragraph("N° LOTE " + numeroLote,
FontFactory.getFont("arial", 22, Font.BOLD, BaseColor.BLACK));
lote.setAlignment(Element.ALIGN_CENTER);
documento.add(lote);
// salto de linea
documento.add(new Phrase(""));
// cabecera
String[] cabecera = {"NRO", "APELLIDOS Y NOMBRES", "TIPO DOC.", "NRO DOC.", "ESCALAFÓN", "PROPUESTO", "PRESIDENCIA", "OBSERVACIÓN"};
PdfPTable tablaData = new PdfPTable(cabecera.length);
tablaData.setWidths(new float[]{0.5f, 3, 1, 1, 1, 1, 1, 4});
tablaData.setWidthPercentage(100);
for (int i = 0; i < cabecera.length; i++) {
switch (i) {
case 4:
tablaData.addCell(createCell("SUELDO (S/.)", 0.5f, 3, Element.ALIGN_CENTER, Font.BOLD));
break;
case 5:
break;
case 6:
break;
default:
tablaData.addCell(createCell("", 0, 1, Element.ALIGN_CENTER, Font.BOLD));
break;
}
}
for (String tituloCabecera : cabecera) {
tablaData.addCell(createCell(tituloCabecera, 0.5f, 1, Element.ALIGN_CENTER, Font.BOLD));
}
// data
for (int i = 0; i < cabecera.length; i++) {
if (i < JAResponse.length()) {
JSONObject data = JAResponse.getJSONObject(i);
tablaData.addCell(createCell("" + (i + 1), 0.5f, 1, Element.ALIGN_CENTER, Font.NORMAL));
tablaData.addCell(createCell(data.getString("apellidoPaterno") + " " + data.getString("apellidoMaterno") + ", " + data.getString("nombre"), 0.5f, 1, Element.ALIGN_LEFT, Font.NORMAL));
tablaData.addCell(createCell(data.getString("tipoDocumento"), 0.5f, 1, Element.ALIGN_LEFT, Font.NORMAL));
tablaData.addCell(createCell(data.getString("numeroDocumento"), 0.5f, 1, Element.ALIGN_LEFT, Font.NORMAL));
tablaData.addCell(createCell(data.getString("sueldoEscalafon"), 0.5f, 1, Element.ALIGN_CENTER, Font.NORMAL));
tablaData.addCell(createCell(data.getString("sueldoMensual"), 0.5f, 1, Element.ALIGN_CENTER, Font.NORMAL));
tablaData.addCell(createCell("", 0.5f, 1, Element.ALIGN_LEFT, Font.NORMAL));
tablaData.addCell(createCell("", 0.5f, 1, Element.ALIGN_LEFT, Font.NORMAL));
} else {
break;
}
}
documento.add(tablaData);
// salto de linea
documento.add(Chunk.NEWLINE);
documento.add(Chunk.NEWLINE);
documento.add(Chunk.NEWLINE);
documento.add(Chunk.NEWLINE);
documento.add(Chunk.NEWLINE);
// responsables
String[] responsables = new String[]{"Fabianna Janeht Gonzáles Saavedra", "Wilmer Carrasco Beas"};
// cargos
String[] cargos = new String[]{"Directora General", "Presidente de la A.C.E.S.O"};
PdfPTable tablaAutorizacion = new PdfPTable(responsables.length);
PdfPCell cellFirma = new PdfPCell(new Phrase("______________________________"));
cellFirma.setBorder(Rectangle.NO_BORDER);
PdfPCell cellResponsable = null;
PdfPCell cellCargo = null;
// firmas
for (int i = 0; i < responsables.length; i++) {
tablaAutorizacion.addCell(cellFirma);
}
// repsonsables
for (int i = 0; i < responsables.length; i++) {
cellResponsable = new PdfPCell(new Phrase(responsables[i]));
cellResponsable.setBorder(Rectangle.NO_BORDER);
tablaAutorizacion.addCell(cellResponsable);
}
// cargos
for (int i = 0; i < responsables.length; i++) {
cellCargo = new PdfPCell(new Phrase(cargos[i]));
cellCargo.setBorder(Rectangle.NO_BORDER);
tablaAutorizacion.addCell(cellCargo);
}
documento.add(tablaAutorizacion);
documento.close();
} catch (DocumentException e) {
throw new IOException(e.getMessage());
}
}
public PdfPCell createCell(String content, float borderWidth, int colspan, int alignment, int textStyle) {
Font f = new Font(Font.FontFamily.HELVETICA, 7, textStyle, GrayColor.BLACK);
PdfPCell cell = new PdfPCell(new Phrase(content, f));
cell.setBorderWidth(borderWidth);
cell.setColspan(colspan);
cell.setHorizontalAlignment(alignment);
return cell;
}
class MyFooter extends PdfPageEventHelper {
Font ffont = new Font(Font.FontFamily.COURIER, 5, Font.BOLD);
@Override
public void onEndPage(PdfWriter writer, Document document) {
// String timeStamp = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(Calendar.getInstance().getTime());
String datetime = DateTimeServer.getDateTimeServer();
PdfContentByte cb = writer.getDirectContent();
Phrase footer = new Phrase(datetime, ffont);
ColumnText.showTextAligned(cb, Element.ALIGN_CENTER,
footer,
(document.right() - document.left()) / 2 + document.leftMargin(),
document.bottom() - 1, 0);
}
}
String datetime = DateTimeServer.getDateTimeServer();
PdfContentByte cb = writer.getDirectContent();
Phrase footer = new Phrase(datetime, ffont);
ColumnText.showTextAligned(cb, Element.ALIGN_CENTER,
footer,
(document.right() - document.left()) / 2 + document.leftMargin(),
document.bottom() - 1, 0);
}
}
}
......@@ -117,11 +117,11 @@ public class DetalleLoteFichaDocenteServlet extends HttpServlet {
documento.open();
// logo saco oliveros y sistema helicoidal
Image logoSOSH = Image.getInstance("C:\\_AppServ\\www\\img\\so_sh.png");
Image logoSOSH = Image.getInstance("C:\\AppServ\\www\\img\\so_sh.png");
logoSOSH.scaleToFit(200, 200);
logoSOSH.setAlignment(Chunk.ALIGN_LEFT);
Image logoAPE = Image.getInstance("C:\\_AppServ\\www\\img\\ap.png");
Image logoAPE = Image.getInstance("C:\\AppServ\\www\\img\\ap.png");
logoAPE.scaleToFit(200, 200);
logoAPE.setAlignment(Chunk.ALIGN_RIGHT);
......
......@@ -1743,12 +1743,12 @@ public class FichaServlet extends HttpServlet {
documento.open();
// logo saco oliveros y sistema helicoidal
Image logoSOSH = Image.getInstance("C:\\_AppServ\\www\\img\\so_sh.png");
Image logoSOSH = Image.getInstance("C:\\AppServ\\www\\img\\so_sh.png");
logoSOSH.scaleToFit(100, 100);
logoSOSH.setAlignment(Chunk.ALIGN_LEFT);
// logo apeiron
Image logoAPE = Image.getInstance("C:\\_AppServ\\www\\img\\ap.png");
Image logoAPE = Image.getInstance("C:\\AppServ\\www\\img\\ap.png");
logoAPE.scaleToFit(100, 100);
logoAPE.setAlignment(Chunk.ALIGN_RIGHT);
......@@ -1795,7 +1795,7 @@ public class FichaServlet extends HttpServlet {
tablaDatosPersonales.addCell(createCell(objPersona.getString("gentilicio"), 0.5f, 1, 1, Element.ALIGN_LEFT, Font.NORMAL, contentBodySize, Rectangle.NO_BORDER, 5));
// foto
if (objPersona.getString("foto").equals("")) {
String foto = "C:\\_AppServ\\www\\img\\default.jpeg"; // 128 x 128
String foto = "C:\\AppServ\\www\\img\\default.jpeg"; // 128 x 128
Image image = Image.getInstance(foto);
PdfPCell cellImage = new PdfPCell();
cellImage.addElement(image);
......@@ -1807,12 +1807,12 @@ public class FichaServlet extends HttpServlet {
cellImage.setPaddingBottom(5);
tablaDatosPersonales.addCell(cellImage);
} else {
String foto = "C:\\_AppServ\\www\\img\\" + objPersona.getString("foto"); // 128 x 128
String foto = "C:\\AppServ\\www\\img\\" + objPersona.getString("foto"); // 128 x 128
// validar si la imagen si existe
File file = new File(foto);
if (!file.exists()) {
foto = "C:\\_AppServ\\www\\img\\default.jpg"; // 128 x 128
foto = "C:\\AppServ\\www\\img\\default.jpg"; // 128 x 128
}
Image image = Image.getInstance(foto);
......@@ -2015,12 +2015,12 @@ public class FichaServlet extends HttpServlet {
documento.open();
// logo saco oliveros y sistema helicoidal
Image logoSOSH = Image.getInstance("C:\\_AppServ\\www\\img\\so_sh.png");
Image logoSOSH = Image.getInstance("C:\\AppServ\\www\\img\\so_sh.png");
logoSOSH.scaleToFit(100, 100);
logoSOSH.setAlignment(Chunk.ALIGN_LEFT);
// logo apeiron
Image logoAPE = Image.getInstance("C:\\_AppServ\\www\\img\\ap.png");
Image logoAPE = Image.getInstance("C:\\AppServ\\www\\img\\ap.png");
logoAPE.scaleToFit(100, 100);
logoAPE.setAlignment(Chunk.ALIGN_RIGHT);
......
......@@ -1045,7 +1045,6 @@ public class FichaSqlserverDAO implements FichaDAO {
String sql
= "SELECT "
+ "ficha.codigo_ficha codigoFicha, "
// + "ficha.codigo_persona codigoPersona, "
+ "persona.apellido_paterno apellidoPaterno, "
+ "persona.apellido_materno apellidoMaterno, "
+ "persona.nombre nombre, "
......@@ -1101,12 +1100,12 @@ public class FichaSqlserverDAO implements FichaDAO {
ps = cnx.prepareStatement(sql);
ps.setInt(1, persona.getCodigoPersona());
System.out.println(ps);
rs = ps.executeQuery();
rs.next();
// if (rs.next()) {
ReporteBean reporte = new ReporteBean();
reporte.setCodigoFicha(rs.getInt("codigoFicha"));
// reporte.setCodigoPersona(rs.getInt("codigoPersona"));
reporte.setApellidoPaterno(rs.getString("apellidoPaterno"));
reporte.setApellidoMaterno(rs.getString("apellidoMaterno"));
reporte.setNombre(rs.getString("nombre"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment