Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 84.25 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package snp.gob.bo.entidades.notificacion;
  7.  
  8. import java.io.File;
  9. import java.io.FileReader;
  10. import java.io.IOException;
  11. import java.io.Serializable;
  12. import java.text.DateFormat;
  13. import java.text.DateFormatSymbols;
  14. import java.text.ParseException;
  15. import java.text.SimpleDateFormat;
  16. import java.util.ArrayList;
  17. import java.util.Date;
  18. import java.util.HashMap;
  19. import java.util.List;
  20. import java.util.Map;
  21. import java.util.logging.Level;
  22. import java.util.logging.Logger;
  23. import javax.annotation.PostConstruct;
  24. import javax.faces.application.FacesMessage;
  25. import javax.faces.bean.ManagedBean;
  26. import javax.faces.bean.ManagedProperty;
  27. import javax.faces.bean.ViewScoped;
  28. import javax.faces.context.FacesContext;
  29. import javax.servlet.ServletOutputStream;
  30. import javax.servlet.http.HttpServletResponse;
  31. import net.sf.jasperreports.engine.JREmptyDataSource;
  32. import net.sf.jasperreports.engine.JRException;
  33. import net.sf.jasperreports.engine.JasperExportManager;
  34. import net.sf.jasperreports.engine.JasperFillManager;
  35. import net.sf.jasperreports.engine.JasperPrint;
  36. import net.sf.jasperreports.engine.JasperRunManager;
  37. import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
  38. //import org.apache.commons.io.FileUtils;
  39. import org.apache.tools.ant.util.FileUtils;
  40. import org.primefaces.context.RequestContext;
  41. import org.primefaces.event.SelectEvent;
  42. import snp.gob.bo.entidades.bean.common.AbstractManagedBean;
  43. import snp.gob.bo.gimodel.entidad.Dominio;
  44. import snp.gob.bo.gimodel.entidad.LogTrans;
  45. import snp.gob.bo.gimodel.entidad.ModModificacion;
  46. import snp.gob.bo.gimodel.entidad.Notificacion;
  47. import snp.gob.bo.gimodel.entidad.RenSolicitudRenovacion;
  48. import snp.gob.bo.gimodel.entidad.Seguimiento;
  49. import snp.gob.bo.gimodel.entidad.SigSignoMarca;
  50. import snp.gob.bo.gimodel.entidad.Usuario;
  51. import snp.gob.bo.gimodel.servicio.ComunService;
  52. import snp.gob.bo.gimodel.servicio.DominioService;
  53. import snp.gob.bo.gimodel.servicio.LogTransService;
  54. import snp.gob.bo.gimodel.servicio.ModModificacionService;
  55. import snp.gob.bo.gimodel.servicio.NotificacionService;
  56. import snp.gob.bo.gimodel.servicio.RenSolicitudRenovacionService;
  57. import snp.gob.bo.gimodel.servicio.SigHistorialService;
  58. import snp.gob.bo.gimodel.servicio.SigSignoMarcaService;
  59. import snp.gob.bo.gimodel.servicio.UsuarioPaginaService;
  60. import snp.gob.bo.gimodel.servicio.UsuarioService;
  61.  
  62. /**
  63. *
  64. * @author levi
  65. */
  66. @ManagedBean
  67. @ViewScoped
  68. public class NotiPeticionDialogController extends AbstractManagedBean implements Serializable {
  69.  
  70. private Integer numIntoBloque;
  71. private String descripcion;
  72. private String demanSolicitante;
  73. private String demanApoderado;
  74. private String demanFojas;
  75. private String demanNotificarCon;
  76. private String demanCelular;
  77. private String demanDomicilio;
  78. private String creaModifieli;
  79. private String expediente;
  80. private boolean habAdiciona;
  81. private boolean habModifica;
  82. private boolean habElimina;
  83. private boolean habNotifica;
  84. private boolean habBuscar;
  85. private boolean habGuardaCamb;
  86. private Integer pos;
  87. private Date fechaIngreso;
  88.  
  89. private String numero;
  90. private String gestion;
  91. private String extension;
  92. private boolean habOposocion = true;
  93.  
  94. private String danteMarca;
  95. private String danteSolicitante;
  96. private String danteApoderado;
  97. private String danteFojas;
  98. private String danteNotificarCon;
  99. private String danteCelular;
  100. private String danteDomicilio;
  101.  
  102. private String dadoMarca;
  103. private String dadoSolicitante;
  104. private String dadoApoderado;
  105. private String dadoFojas;
  106. private String dadoNotificarCon;
  107. private String dadoCelular;
  108. private String dadoDomicilio;
  109. private String var;
  110.  
  111. private String template;
  112. private String codigoPrin = ""; //Codgio con el que se busca todo , puede ser idTramite
  113. private String tipoTramite = "";//Con este se ve si es de signos o renovaciones o modificaciones o oposicion
  114. private String comboExpediente;
  115. private String obsPeticion;
  116. private String text;
  117. private Integer numBloque;
  118. private Integer numBloqueBusca;
  119.  
  120. private Long idUsuarioSesion;
  121. private List<Dominio> listaTipoNotifi = new ArrayList<Dominio>();
  122. private List<Notificacion> listaAPeticion = new ArrayList<Notificacion>();
  123. private List<Notificacion> listaEscoge = new ArrayList<Notificacion>();
  124. List<HistorialPojo> listHistPo = new ArrayList<HistorialPojo>();
  125. private List<Usuario> listUsuario = new ArrayList<Usuario>();
  126.  
  127. // parametros del reporte
  128. private Map<String, Object> parametros = new HashMap<String, Object>();
  129. private String nroBloque;
  130. private String operador;
  131. private String usuario;
  132. private String fechaIng;
  133. private String horaIng;
  134. private String imgSenapi;
  135. private Long logtrans;
  136. private List<NotiPeticionListPojo> listNotiPeticionList = new ArrayList<NotiPeticionListPojo>();
  137. private List<Notificacion> listaAPeticionRepo = new ArrayList<>();
  138.  
  139. private boolean habImpr;
  140. @ManagedProperty(value = "#{usuarioPaginaService}")
  141. private UsuarioPaginaService usuarioPaginaService;
  142. @ManagedProperty(value = "#{notificacionService}")
  143. private NotificacionService notificacionService;
  144. @ManagedProperty(value = "#{dominioService}")
  145. private DominioService dominioService;
  146. @ManagedProperty(value = "#{comunService}")
  147. private ComunService comunService;
  148. @ManagedProperty(value = "#{usuarioService}")
  149. private UsuarioService usuarioService;
  150. @ManagedProperty(value = "#{logTransService}")
  151. private LogTransService logTransService;
  152. @ManagedProperty(value = "#{sigSignoMarcaService}")
  153. private SigSignoMarcaService sigSignoMarcaService;
  154. @ManagedProperty(value = "#{sigHistorialService}")
  155. private SigHistorialService sigHistorialService;
  156.  
  157. @ManagedProperty(value = "#{modModificacionService}")
  158. private ModModificacionService modModificacionService;
  159. @ManagedProperty(value = "#{renSolicitudRenovacionService}")
  160. private RenSolicitudRenovacionService renSolicitudRenovacionService;
  161.  
  162. @PostConstruct
  163. public void init() {
  164.  
  165. try {
  166. /*estas dos lineas de codigo de abajo reflejan que se puede sacar texto html de un archivo, par que lo plasme en el objeto editor de primefaces,
  167. y de porsi el primefaces ya lo formatea
  168. */
  169. /*String varhtml = FileUtils.readFully(new FileReader(new File("/home/levi/Documentos/PROYECTOS/SISInterno/SistemaInterno/giview/src/main/java/snp/gob/bo/entidades/notificacion/html_1.txt")));
  170. text=varhtml;
  171.  
  172. */
  173. /*el codigo de abajo es para definir desde base si este boton esta habilitado o no*/
  174. // habImpr=usuarioPaginaService.estadoBotonUsuario(super.getIdUsuarioSession().toString(), "btnNotificaImpr");
  175.  
  176. System.out.println("ID USUARIO::" + super.getIdUsuarioSession());
  177. System.out.println("id etapa:::" + super.getIdEtapaSession());
  178. idUsuarioSesion = super.getIdUsuarioSession();
  179. numBloque = notificacionService.obtieneBloqueNuevo(idUsuarioSesion.intValue());
  180. //System.out.println("numBloque es:"+numBloque);
  181. //Estas 4 lineas de aqui abajo espara que saque el idlogtranas y se intserte en tabla de notificaicon
  182. Date fechaSistema = comunService.obtenerFechaHoraServidor(1L);
  183. List<Usuario> listUsuario = usuarioService.listaUsuarioXidPagina(idUsuarioSesion);
  184. LogTrans logTransGuardado = logTransService.crudLogTrans(new LogTrans(idUsuarioSesion, fechaSistema), 1);
  185. logtrans = logTransGuardado.getIdLogTrans();
  186.  
  187. if (numBloque == null) {
  188. numBloque = 1;
  189.  
  190. }
  191. listaTipoNotifi = dominioService.obtenerListadoDominio("tipo_tramite_notificacion");
  192.  
  193. Map<String, String[]> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterValuesMap();
  194. if (params.get("datosGenerales") == null || params.get("datosGenerales").equals("")) {
  195. template = "./../WEB-INF/facelets/templates/Template.xhtml";
  196.  
  197. } else {
  198.  
  199. template = "./../WEB-INF/facelets/templates/DialogTemplate.xhtml";
  200. codigoPrin = params.get("datosGenerales")[0];
  201. tipoTramite = params.get("datosGenerales")[1];
  202. System.out.println("codigoPrin:" + codigoPrin);
  203. System.out.println("tipoTramite:" + tipoTramite);
  204. Map<String, Object> sessionMap = FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
  205.  
  206. Notificacion notifica = (Notificacion) sessionMap.get("notifiObj");
  207. if (!tipoTramite.equals("oposicion")) {
  208. habOposocion = true;
  209.  
  210. //Aqui llenaria según lo que me pasen ya sea en un objeto o en variables
  211. comboExpediente = notifica.getTipo_tramite_notificacion();
  212.  
  213. numero = notifica.getExpediente();
  214. if (notifica.getGestion() == null || notifica.getGestion().equals("")) {
  215. gestion = "";
  216. } else {
  217. gestion = notifica.getGestion().toString();
  218. }
  219.  
  220. extension = notifica.getExtension();
  221. descripcion = notifica.getDemandante();
  222. demanSolicitante = notifica.getDemandante_solic();
  223. demanApoderado = notifica.getDemandante_apod();
  224. demanFojas = notifica.getDemandante_fojas();
  225. demanNotificarCon = notifica.getDemandante_con();
  226. demanCelular = notifica.getDemandante_cel();
  227. demanDomicilio = notifica.getDemandante_direc();
  228. } else {
  229. System.out.println("Es oposicion::" + comboExpediente);
  230. habOposocion = false;
  231. comboExpediente = "OPOSICION SIG";
  232. numero = notifica.getExpediente();
  233. extension = notifica.getExtension();
  234. danteMarca = notifica.getDemandante();
  235. danteSolicitante = notifica.getDemandante_solic();
  236. danteApoderado = notifica.getDemandante_apod();
  237. danteFojas = notifica.getDemandante_fojas();
  238. danteNotificarCon = notifica.getDemandante_con();
  239. danteCelular = notifica.getDemandante_cel();
  240. danteDomicilio = notifica.getDemandante_direc();
  241.  
  242. dadoMarca = notifica.getDemandado();
  243. dadoSolicitante = notifica.getDemandado_solic();
  244. dadoApoderado = notifica.getDemandado_apod();
  245. dadoFojas = notifica.getDemandado_fojas();
  246. dadoNotificarCon = notifica.getDemandado_con();
  247. dadoCelular = notifica.getDemandado_cel();
  248. dadoDomicilio = notifica.getDemandado_direc();
  249.  
  250. }
  251. sessionMap.remove("notifiObj");
  252.  
  253. }
  254.  
  255. fechaIngreso = new Date();
  256. numIntoBloque = 1;
  257. creaModifieli = "1";
  258. habModifica = false;
  259. habAdiciona = false;
  260. habElimina = false;
  261. habBuscar = true;
  262.  
  263. /**
  264. * *****estos dato son para exclusivamente llenar
  265. * oposiciones*******
  266. */
  267. /* danteMarca = "AVG";
  268. danteSolicitante = "Marcelo Saldaña";
  269. danteApoderado = "Victor Cruz";
  270. danteFojas = "10";
  271. danteNotificarCon = "Decreto";
  272. danteCelular = "2484848";
  273. danteDomicilio = "LA PAZ, JUANA AZURDUY DE PADILLA, ROSENDO GUTIERREZ, 1000";
  274.  
  275. dadoMarca = "AVG";
  276. dadoSolicitante = "Sergio Estrada";
  277. dadoApoderado = "Juan Manuel SOlorzano";
  278. dadoFojas = "12";
  279. dadoNotificarCon = "Decreto";
  280. dadoCelular = "22342342";
  281. dadoDomicilio = "LA PAZ, Zona Alto Tejar Calle las Palomillas, 213";*/
  282. } catch (Exception ex) {
  283. Logger.getLogger(NotiPeticionDialogController.class.getName()).log(Level.SEVERE, null, ex);
  284. }
  285.  
  286. }
  287.  
  288. //Metodo cuando apreta Buscar en la parte superior primera
  289. public void buscaModi() throws Exception {
  290. listaAPeticion.clear();
  291. //Actualiza en numero de bloque que se escogio, y su correlativo del tramite a la lista de la tabla derecha
  292.  
  293. numBloque = numBloqueBusca;
  294. listaAPeticion = notificacionService.getNotificacionXbloqueXusuariosol(numBloqueBusca, idUsuarioSesion);//Elk idUsuario A Revisar
  295.  
  296. numIntoBloque = (Integer) listaAPeticion.size() + 1;
  297. //Pregunto por opcion de modificar ya que tambien existe la opcion consulta
  298. if (creaModifieli.equals("2")) {
  299.  
  300. for (int i = 0; i <= listaAPeticion.size() - 1; i++) {
  301. //Pregunto por preenviado , basta que encuentre uno para que se deshabilite el boton de "Adicionar" ya que cuando esta en etapa de modificacion y
  302. // en estado enviado no puede adicionar mas tramites. Iual lo hace el sistema antiguo.
  303. if (listaAPeticion.get(i).getDemandante_cod_estado().equals("PREE")) {
  304. habAdiciona = false;
  305. habElimina = false;
  306. habGuardaCamb = false;
  307. habNotifica = false;
  308. }
  309. if (listaAPeticion.get(i).getDemandante_cod_estado().equals("ENV")) {
  310. habAdiciona = false;
  311. habElimina = false;
  312. habGuardaCamb = true;
  313. habNotifica = false;
  314. }
  315. if (!listaAPeticion.get(i).getDemandante_cod_estado().equals("PREE") && !listaAPeticion.get(i).getDemandante_cod_estado().equals("ENV")) {
  316. habAdiciona = true;
  317. habElimina = true;
  318. habGuardaCamb = true;
  319. habNotifica = true;
  320. break;
  321. }
  322.  
  323. /* if (!listaAPeticion.get(i).getDemandante_cod_estado().equals("PREE") && !listaAPeticion.get(i).getDemandante_cod_estado().equals("ENV")) {
  324. habAdiciona = true;
  325. habElimina = true;
  326. habGuardaCamb = true;
  327.  
  328. } else {
  329. habAdiciona = false;
  330. habElimina = false;
  331. habGuardaCamb = false;
  332. }*/
  333. }
  334. }
  335. //System.out.println("tam listaAPeticion::"+listaAPeticion.size());
  336.  
  337. }
  338.  
  339. public void vaAnteriorLote() throws Exception {
  340. numBloque = numBloqueBusca - 1;
  341. listaAPeticion = notificacionService.getNotificacionXbloqueXusuariosol(numBloque, idUsuarioSesion);//Elk idUsuario A Revisar
  342. numIntoBloque = (Integer) listaAPeticion.size() + 1;
  343. numBloqueBusca = numBloque;
  344. if (creaModifieli.equals("2")) {
  345.  
  346. for (int i = 0; i <= listaAPeticion.size() - 1; i++) {
  347. //Pregunto por preenviado , basta que encuentre uno para que se deshabilite el boton de "Adicionar" ya que cuando esta en etapa de modificacion y
  348. // en estado enviado no puede adicionar mas tramites. Iual lo hace el sistema antiguo.
  349.  
  350. if (listaAPeticion.get(i).getDemandante_cod_estado().equals("PREE")) {
  351. habAdiciona = false;
  352. habElimina = false;
  353. habGuardaCamb = false;
  354. habNotifica = false;
  355. }
  356. if (listaAPeticion.get(i).getDemandante_cod_estado().equals("ENV")) {
  357. habAdiciona = false;
  358. habElimina = false;
  359. habGuardaCamb = true;
  360. habNotifica = false;
  361. }
  362. if (!listaAPeticion.get(i).getDemandante_cod_estado().equals("PREE") && !listaAPeticion.get(i).getDemandante_cod_estado().equals("ENV")) {
  363. habAdiciona = true;
  364. habElimina = true;
  365. habGuardaCamb = true;
  366. habNotifica = true;
  367. }
  368.  
  369. /* if (!listaAPeticion.get(i).getDemandante_cod_estado().equals("PREE")) {
  370. habAdiciona = true;
  371. habElimina = true;
  372. habGuardaCamb = true;
  373.  
  374. } else {
  375. habAdiciona = false;
  376. habElimina = false;
  377. habGuardaCamb = false;
  378. }
  379. */
  380. }
  381. }
  382.  
  383. }
  384.  
  385. public void vaSiguienteLote() throws Exception {
  386. numBloque = numBloqueBusca + 1;
  387. listaAPeticion = notificacionService.getNotificacionXbloqueXusuariosol(numBloque, idUsuarioSesion);//Elk idUsuario A Revisar
  388. numIntoBloque = (Integer) listaAPeticion.size() + 1;
  389. numBloqueBusca = numBloque;
  390. if (creaModifieli.equals("2")) {
  391.  
  392. for (int i = 0; i <= listaAPeticion.size() - 1; i++) {
  393. //Pregunto por preenviado , basta que encuentre uno para que se deshabilite el boton de "Adicionar" ya que cuando esta en etapa de modificacion y
  394. // en estado enviado no puede adicionar mas tramites. Iual lo hace el sistema antiguo.
  395. if (listaAPeticion.get(i).getDemandante_cod_estado().equals("PREE")) {
  396. habAdiciona = false;
  397. habElimina = false;
  398. habGuardaCamb = false;
  399. habNotifica = false;
  400. }
  401. if (listaAPeticion.get(i).getDemandante_cod_estado().equals("ENV")) {
  402. habAdiciona = false;
  403. habElimina = false;
  404. habGuardaCamb = true;
  405. habNotifica = false;
  406. }
  407. if (!listaAPeticion.get(i).getDemandante_cod_estado().equals("PREE") && !listaAPeticion.get(i).getDemandante_cod_estado().equals("ENV")) {
  408. habAdiciona = true;
  409. habElimina = true;
  410. habGuardaCamb = true;
  411. habNotifica = true;
  412. }
  413.  
  414. /*if (!listaAPeticion.get(i).getDemandante_cod_estado().equals("PREE")) {
  415. habAdiciona = true;
  416. habElimina = true;
  417. habGuardaCamb = true;
  418.  
  419. } else {
  420. habAdiciona = false;
  421. habElimina = false;
  422. habGuardaCamb = false;
  423. }*/
  424. }
  425. }
  426. }
  427.  
  428. public void busca() throws Exception {
  429. //Esta parte se desencripta con su codigo de VICTOR
  430. Long smBuscar;
  431. // System.out.println("En buscar el combo su valor::" + comboExpediente);
  432.  
  433. if (comboExpediente.equals("SM")) {
  434. smBuscar = comunService.codificarCodigoSM(numero, gestion, extension);
  435. // System.out.println("SM codificacdo ::" + smBuscar);
  436. habOposocion = true;
  437. /* if(this.numero.length() == 1)
  438. {
  439. numero="00000"+numero;
  440. }
  441. if(extension.equals(""))
  442. {
  443. extension="00";
  444. }
  445. smBuscar =this.gestion+this.numero+this.extension;*/
  446. System.out.println("El sm a buscar::" + smBuscar);
  447. List<Notificacion> listNotiDatosDemandante = new ArrayList<Notificacion>();
  448.  
  449. listNotiDatosDemandante = notificacionService.listaNotificacionDatosSM(smBuscar);
  450. //System.out.println("DEMANDADO::"+listNotiDatosDemandante.get(0).getDemandante());
  451.  
  452. descripcion = listNotiDatosDemandante.get(0).getDemandante();
  453. demanSolicitante = listNotiDatosDemandante.get(0).getDemandante_solic();
  454. demanApoderado = listNotiDatosDemandante.get(0).getDemandante_apod();
  455. //demanFojas = ;
  456. // demanNotificarCon = "";
  457. demanCelular = listNotiDatosDemandante.get(0).getDemandante_cel();
  458. demanDomicilio = listNotiDatosDemandante.get(0).getDemandante_direc();
  459.  
  460. }
  461. if (comboExpediente.equals("SR")) {
  462. habOposocion = true;
  463. List<Notificacion> listNotiDatosDemandante = new ArrayList<Notificacion>();
  464. listNotiDatosDemandante = notificacionService.listaNotificacionDatosSR(Long.valueOf(this.numero), Long.valueOf(this.gestion));
  465. descripcion = listNotiDatosDemandante.get(0).getDemandante();
  466. demanSolicitante = listNotiDatosDemandante.get(0).getDemandante_solic();
  467. demanApoderado = listNotiDatosDemandante.get(0).getDemandante_apod();
  468. //demanFojas = ;
  469. // demanNotificarCon = "";
  470. demanCelular = listNotiDatosDemandante.get(0).getDemandante_cel();
  471. demanDomicilio = listNotiDatosDemandante.get(0).getDemandante_direc();
  472. }
  473. if (comboExpediente.equals("ST-S") || comboExpediente.equals("ST-C") || comboExpediente.equals("ST-E") || comboExpediente.equals("ST")|| comboExpediente.equals("ST-H")
  474. || comboExpediente.equals("SF-S") || comboExpediente.equals("SF-C") || comboExpediente.equals("SF-E") || comboExpediente.equals("SF") || comboExpediente.equals("SF-H")
  475. || comboExpediente.equals("LU-S") || comboExpediente.equals("LU-C") || comboExpediente.equals("LU-E") || comboExpediente.equals("LU") || comboExpediente.equals("LU-H")
  476. || comboExpediente.equals("CD-S") || comboExpediente.equals("CD-C") || comboExpediente.equals("CD-E") || comboExpediente.equals("CD") || comboExpediente.equals("CD-H")
  477. || comboExpediente.equals("CN-S") || comboExpediente.equals("CN-C") || comboExpediente.equals("CN-E") || comboExpediente.equals("CN") || comboExpediente.equals("CN-H")
  478. ) {
  479. habOposocion = true;
  480. List<Notificacion> listNotiDatosDemandante = new ArrayList<Notificacion>();
  481. listNotiDatosDemandante = notificacionService.listaNotificacionDatosModi(comboExpediente, Long.valueOf(numero), Long.valueOf(gestion));
  482.  
  483. descripcion = listNotiDatosDemandante.get(0).getDemandante();
  484. demanSolicitante = listNotiDatosDemandante.get(0).getDemandante_solic();
  485. demanApoderado = listNotiDatosDemandante.get(0).getDemandante_apod();
  486. //demanFojas = ;
  487. // demanNotificarCon = "";
  488. demanCelular = listNotiDatosDemandante.get(0).getDemandante_cel();
  489. demanDomicilio = listNotiDatosDemandante.get(0).getDemandante_direc();
  490. }
  491. //if(comboExpediente.equals("NR"))//Para el caso de registros
  492. if (comboExpediente.equals("N° REG")) {
  493. habOposocion = true;
  494. List<Notificacion> listNotiDatosDemandante = new ArrayList<Notificacion>();
  495. listNotiDatosDemandante = notificacionService.listaNotificacionDatosSMNumReg(Long.valueOf(numero), this.extension);
  496. descripcion = listNotiDatosDemandante.get(0).getDemandante();
  497. demanSolicitante = listNotiDatosDemandante.get(0).getDemandante_solic();
  498. demanApoderado = listNotiDatosDemandante.get(0).getDemandante_apod();
  499. //demanFojas = ;
  500. // demanNotificarCon = "";
  501. demanCelular = listNotiDatosDemandante.get(0).getDemandante_cel();
  502. demanDomicilio = listNotiDatosDemandante.get(0).getDemandante_direc();
  503. }
  504. //if(comboExpediente.equals("NPS"))//Para el caso de registros
  505. if (comboExpediente.equals("N° PUB SIGNO")) {
  506. // System.out.println("entra por numero publicacion");
  507. habOposocion = true;
  508. List<Notificacion> listNotiDatosDemandante = new ArrayList<Notificacion>();
  509. listNotiDatosDemandante = notificacionService.listaNotificacionDatosSMNumPubl(Long.valueOf(numero));
  510. descripcion = listNotiDatosDemandante.get(0).getDemandante();
  511. demanSolicitante = listNotiDatosDemandante.get(0).getDemandante_solic();
  512. demanApoderado = listNotiDatosDemandante.get(0).getDemandante_apod();
  513. //demanFojas = ;
  514. // demanNotificarCon = "";
  515. demanCelular = listNotiDatosDemandante.get(0).getDemandante_cel();
  516. demanDomicilio = listNotiDatosDemandante.get(0).getDemandante_direc();
  517. }
  518. //if(comboExpediente.equals("OS"))
  519. if (comboExpediente.equals("OPOSICION SIG")) {
  520. habOposocion = false;
  521. List<Notificacion> listNotiDatosOpo = new ArrayList<Notificacion>();
  522. listNotiDatosOpo = notificacionService.listaNotificacionDatosOpo(Long.valueOf(numero), Long.valueOf(extension));
  523. danteMarca = listNotiDatosOpo.get(0).getDemandante();
  524. danteSolicitante = listNotiDatosOpo.get(0).getDemandante_solic();
  525. danteApoderado = listNotiDatosOpo.get(0).getDemandante_apod();
  526. danteFojas = listNotiDatosOpo.get(0).getDemandante_fojas();
  527. danteNotificarCon = listNotiDatosOpo.get(0).getDemandante_con();
  528. danteCelular = listNotiDatosOpo.get(0).getDemandante_cel();
  529. danteDomicilio = listNotiDatosOpo.get(0).getDemandante_direc();
  530.  
  531. dadoMarca = listNotiDatosOpo.get(0).getDemandado();
  532. dadoSolicitante = listNotiDatosOpo.get(0).getDemandado_solic();
  533. dadoApoderado = listNotiDatosOpo.get(0).getDemandado_apod();
  534. dadoFojas = listNotiDatosOpo.get(0).getDemandado_fojas();
  535. dadoNotificarCon = listNotiDatosOpo.get(0).getDemandado_con();
  536. dadoCelular = listNotiDatosOpo.get(0).getDemandado_cel();
  537. dadoDomicilio = listNotiDatosOpo.get(0).getDemandado_direc();
  538.  
  539. }
  540. if (comboExpediente.equals("CANCELACION") || comboExpediente.equals("NULIDAD SIG")) {
  541. habOposocion = false;
  542.  
  543. List<Notificacion> listNotiDatosDemandante = new ArrayList<Notificacion>();
  544. listNotiDatosDemandante = notificacionService.listaNotificacionDatosSMNumReg(Long.valueOf(numero), this.extension);
  545. danteMarca = "";
  546. danteSolicitante = "";
  547. danteApoderado = "";
  548. danteFojas = "";
  549. danteNotificarCon = "";
  550. danteCelular = "";
  551. danteDomicilio = "";
  552. dadoMarca = listNotiDatosDemandante.get(0).getDemandante();;
  553. dadoSolicitante = listNotiDatosDemandante.get(0).getDemandante_solic();;
  554. dadoApoderado = listNotiDatosDemandante.get(0).getDemandante_apod();
  555.  
  556. dadoCelular = listNotiDatosDemandante.get(0).getDemandante_cel();
  557. dadoDomicilio = listNotiDatosDemandante.get(0).getDemandante_direc();
  558.  
  559. }
  560.  
  561. }
  562.  
  563. public void adicionaTabla() throws Exception {
  564.  
  565. Notificacion notifica = new Notificacion();
  566. notifica.setIdlogtrans(1L);//por Revisar
  567. //Pregunta si en eel combo esta elegido oposicion
  568. //if(!comboExpediente.equals("OS"))
  569. if (!comboExpediente.equals("OPOSICION SIG") && !comboExpediente.equals("CANCELACION") && !comboExpediente.equals("NULIDAD SIG")) {
  570. if (creaModifieli.equals("1")) {
  571. Integer bloque = notificacionService.obtieneBloqueNuevo(this.idUsuarioSesion.intValue());//por Revisar
  572. if (bloque == null) {
  573. bloque = 1;
  574.  
  575. }
  576.  
  577. notifica.setBloque(bloque);
  578. }
  579. if (creaModifieli.equals("2")) {
  580. notifica.setBloque(numBloque);
  581. }
  582. notifica.setNro_exped(listaAPeticion.size() + 1);
  583. notifica.setId_usuario_solicitante(idUsuarioSesion);//por Revisar
  584. notifica.setTipo_tramite_notificacion(this.comboExpediente);
  585. notifica.setExpediente(this.numero);
  586. if (this.gestion != null && !this.gestion.equals("")) {
  587. notifica.setGestion(Integer.parseInt(this.gestion));
  588.  
  589. }
  590. notifica.setExtension(this.extension);
  591. notifica.setDemandante(this.descripcion);
  592. notifica.setDemandante_cod_estado("PREE");
  593. notifica.setDemandante_solic(demanSolicitante);
  594. notifica.setDemandante_apod(demanApoderado);
  595. notifica.setDemandante_fojas(demanFojas);
  596. notifica.setDemandante_con(demanNotificarCon);
  597. notifica.setDemandante_direc(demanDomicilio);
  598. notifica.setDemandante_cel(demanCelular);
  599. notifica.setFecha_ingreso(fechaIngreso);
  600. notifica.setObs(this.obsPeticion);
  601. notifica.setHistorial("");//por Revisar
  602. listaAPeticion.add(notifica);
  603. limpiaVar();
  604. numIntoBloque = (Integer) listaAPeticion.size() + 1;
  605. } //Cuando es oposciion accede a este else
  606. else {
  607. if (creaModifieli.equals("1")) {
  608. Integer bloque = notificacionService.obtieneBloqueNuevo(this.idUsuarioSesion.intValue());//por Revisar
  609. if (bloque == null) {
  610. bloque = 1;
  611.  
  612. }
  613. notifica.setBloque(bloque);
  614. }
  615. if (creaModifieli.equals("2")) {
  616. notifica.setBloque(numBloque);
  617. }
  618. notifica.setNro_exped(listaAPeticion.size() + 1);
  619. notifica.setId_usuario_solicitante(idUsuarioSesion);//por Revisar
  620. notifica.setTipo_tramite_notificacion(this.comboExpediente);
  621. notifica.setExpediente(this.numero);
  622. if (this.gestion != null && !this.gestion.equals("")) {
  623. notifica.setGestion(Integer.parseInt(this.gestion));
  624.  
  625. }
  626. notifica.setExtension(this.extension);
  627.  
  628. notifica.setDemandante(danteMarca);
  629. notifica.setDemandante_cod_estado("PREE");
  630. notifica.setDemandante_solic(danteSolicitante);
  631. notifica.setDemandante_apod(danteApoderado);
  632. notifica.setDemandante_fojas(danteFojas);
  633. notifica.setDemandante_con(danteNotificarCon);
  634. notifica.setDemandante_direc(danteDomicilio);
  635. notifica.setDemandante_cel(danteCelular);
  636. notifica.setDemandado(dadoMarca);
  637. notifica.setDemandado_cod_estado("PREE");
  638. notifica.setDemandado_solic(dadoSolicitante);
  639. notifica.setDemandado_apod(dadoApoderado);
  640. notifica.setDemandado_fojas(dadoFojas);
  641. notifica.setDemandado_con(dadoNotificarCon);
  642. notifica.setDemandado_direc(dadoDomicilio);
  643. notifica.setDemandado_cel(dadoCelular);
  644. notifica.setObs(this.obsPeticion);
  645. notifica.setHistorial("");//por Revisar
  646. listaAPeticion.add(notifica);
  647. limpiaVarOposiciones();
  648. numIntoBloque = (Integer) listaAPeticion.size() + 1;
  649.  
  650. }
  651. }
  652.  
  653. //ESTE METODO lo UTILIZABA ANTERIORMENTE PARA CONVERTIR agarrar el campo nombre dado el codigo , pero no es necesario ya que aurita solo
  654. //estoy trabajando con el campo nombre para todo, quizas depsues lo necesite
  655. public String getNombreTipoNotificacion(String codigo) throws Exception {
  656. List<Dominio> listaDominio = dominioService.obtenerListadoDominioXCodigo("tipo_tramite_notificacion", codigo);
  657. if (listaDominio.size() != 0) {
  658. return listaDominio.get(0).getNombre();
  659. } else {
  660. return "";
  661. }
  662.  
  663. }
  664.  
  665. public void modificaTabla() throws Exception {
  666. DateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
  667. if (!listaAPeticion.get(pos).getDemandante_cod_estado().equals("PREE") && !listaAPeticion.get(pos).getDemandante_cod_estado().equals("ENV")) {
  668. FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "No puede modificar, este trámite ya esta del lado del Notificador", "");
  669. FacesContext.getCurrentInstance().addMessage(null, message);
  670. } else {
  671. /*
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678. */
  679. // System.out.println("tipo_::" + listaAPeticion.get(pos).getTipo_tramite_notificacion());
  680.  
  681. Notificacion notiAModifi = listaAPeticion.get(pos);
  682. notiAModifi.setTipo_tramite_notificacion(this.comboExpediente);
  683. notiAModifi.setExpediente(this.numero);
  684. if (!this.gestion.endsWith("")) {
  685. notiAModifi.setGestion(Integer.parseInt(this.gestion));
  686.  
  687. }
  688. notiAModifi.setExtension(this.extension);
  689.  
  690. if (!listaAPeticion.get(pos).getTipo_tramite_notificacion().equals("OPOSICION SIG")
  691. && !comboExpediente.equals("CANCELACION")
  692. && !comboExpediente.equals("NULIDAD SIG")) {
  693.  
  694. notiAModifi.setDemandante(descripcion);
  695. notiAModifi.setDemandante_solic(demanSolicitante);
  696. notiAModifi.setDemandante_apod(demanApoderado);
  697. notiAModifi.setDemandante_fojas(demanFojas);
  698. notiAModifi.setDemandante_con(demanNotificarCon);
  699. notiAModifi.setDemandante_cel(demanCelular);
  700. notiAModifi.setDemandante_direc(demanDomicilio);
  701. notiAModifi.setObs(obsPeticion);
  702. } else {
  703. notiAModifi.setDemandante(danteMarca);
  704. // notiAModifi.setDemandante_cod_estado("PREE");
  705. notiAModifi.setDemandante_solic(danteSolicitante);
  706. notiAModifi.setDemandante_apod(danteApoderado);
  707. notiAModifi.setDemandante_fojas(danteFojas);
  708. notiAModifi.setDemandante_con(danteNotificarCon);
  709. notiAModifi.setDemandante_direc(danteDomicilio);
  710. notiAModifi.setDemandante_cel(danteCelular);
  711. notiAModifi.setDemandado(dadoMarca);
  712. // notiAModifi.setDemandado_cod_estado("PREE");
  713. notiAModifi.setDemandado_solic(dadoSolicitante);
  714. notiAModifi.setDemandado_apod(dadoApoderado);
  715. notiAModifi.setDemandado_fojas(dadoFojas);
  716. notiAModifi.setDemandado_con(dadoNotificarCon);
  717. notiAModifi.setDemandado_direc(dadoDomicilio);
  718. notiAModifi.setDemandado_cel(dadoCelular);
  719.  
  720. }
  721. if (creaModifieli.equals("2")) { //Aqui verifico si ya esta en estado enviado , entonces coloco adiciono en el campo historial como modificado
  722. if (listaAPeticion.get(pos).getDemandante_cod_estado().equals("ENV")) {
  723. listaAPeticion.get(pos).setHistorial(listaAPeticion.get(pos).getHistorial() + ";"
  724. + "MODIFICADO: "
  725. + usuarioService.listaUsuarioXidPagina(listaAPeticion.get(pos).getId_usuario_solicitante()).get(0).getNombre()
  726. + " "
  727. + usuarioService.listaUsuarioXidPagina(listaAPeticion.get(pos).getId_usuario_solicitante()).get(0).getPrimer_apellido()
  728. // listaAPeticion.get(pos).getId_usuario_solicitante()
  729.  
  730. + "," + df.format(new Date()));
  731. }
  732.  
  733. }
  734.  
  735. listaAPeticion.set(pos, notiAModifi);
  736. }
  737.  
  738. }
  739.  
  740. public void onRowSelect(SelectEvent event) {
  741.  
  742. try {
  743.  
  744. //Esta variable de pos se queda en memoria del ultimo doble click que haga//
  745. pos = ((Notificacion) event.getObject()).getNro_exped() - 1;
  746. //System.out.println("pos"+pos);
  747. // System.out.println("posicion::"+posicion);
  748. this.comboExpediente = listaEscoge.get(0).getTipo_tramite_notificacion();
  749. if (!comboExpediente.equals("OPOSICION SIG") && !comboExpediente.equals("CANCELACION")
  750. && !comboExpediente.equals("NULIDAD SIG")) {
  751. // System.out.println("Entra a oposiciones1");
  752. habOposocion = true;
  753. this.comboExpediente = listaEscoge.get(0).getTipo_tramite_notificacion();
  754. this.numero = listaEscoge.get(0).getExpediente();
  755. if (listaEscoge.get(0).getGestion() != null && !listaEscoge.get(0).getGestion().equals("")) {
  756. this.gestion = listaEscoge.get(0).getGestion().toString();
  757. } else {
  758. this.gestion = "";
  759. }
  760.  
  761. this.extension = listaEscoge.get(0).getExtension();
  762. this.descripcion = listaEscoge.get(0).getDemandante();
  763. this.demanSolicitante = listaEscoge.get(0).getDemandante_solic();
  764. this.demanApoderado = listaEscoge.get(0).getDemandante_apod();
  765. this.demanFojas = listaEscoge.get(0).getDemandante_fojas();
  766. this.demanNotificarCon = listaEscoge.get(0).getDemandante_con();
  767. this.demanCelular = listaEscoge.get(0).getDemandante_cel();
  768. this.demanDomicilio = listaEscoge.get(0).getDemandante_direc();
  769. this.obsPeticion = listaEscoge.get(0).getObs();
  770. //expediente = listaEscoge.get(0).getExpediente();
  771. llenaDatosAdmni(listaEscoge.get(0));
  772. } else {
  773. // System.out.println("Entra a oposiciones2");
  774. habOposocion = false;
  775. this.comboExpediente = listaEscoge.get(0).getTipo_tramite_notificacion();
  776. this.numero = listaEscoge.get(0).getExpediente();
  777. //this.gestion=listaEscoge.get(0).getGestion().toString();
  778. this.extension = listaEscoge.get(0).getExtension();
  779. this.danteMarca = listaEscoge.get(0).getDemandante();
  780. this.danteSolicitante = listaEscoge.get(0).getDemandante_solic();
  781. this.danteApoderado = listaEscoge.get(0).getDemandante_apod();
  782. this.danteFojas = listaEscoge.get(0).getDemandante_fojas();
  783. this.danteNotificarCon = listaEscoge.get(0).getDemandante_con();
  784. this.danteDomicilio = listaEscoge.get(0).getDemandante_direc();
  785. this.danteCelular = listaEscoge.get(0).getDemandante_cel();
  786. this.dadoMarca = listaEscoge.get(0).getDemandado();
  787. this.dadoSolicitante = listaEscoge.get(0).getDemandado_solic();
  788. this.dadoApoderado = listaEscoge.get(0).getDemandado_apod();
  789. this.dadoFojas = listaEscoge.get(0).getDemandado_fojas();
  790. this.dadoNotificarCon = listaEscoge.get(0).getDemandado_con();
  791. this.dadoDomicilio = listaEscoge.get(0).getDemandado_direc();
  792. this.dadoCelular = listaEscoge.get(0).getDemandado_cel();
  793. this.obsPeticion = listaEscoge.get(0).getObs();
  794. llenaDatosAdmni(listaEscoge.get(0));
  795.  
  796. }
  797.  
  798. } catch (ParseException ex) {
  799. Logger.getLogger(NotiPeticionDialogController.class.getName()).log(Level.SEVERE, null, ex);
  800. }
  801.  
  802. }
  803.  
  804. public void llenaDatosAdmni(Notificacion notiEscogido) throws ParseException {
  805.  
  806. listHistPo.clear();
  807. if (notiEscogido.getHistorial() != null && !notiEscogido.getHistorial().equals("")) {
  808. String[] listPadre = notiEscogido.getHistorial().split(";");
  809.  
  810. for (int i = 0; i <= listPadre.length - 1; i++) {
  811. HistorialPojo historial = new HistorialPojo();
  812. String[] hijo = listPadre[i].split(",");
  813. historial.setNum(i + 1);
  814. historial.setHistorial(hijo[0]);
  815. //historial.setFecha(new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").parse(hijo[1]));//A revisar
  816.  
  817. historial.setFecha(hijo[1]);//A revisar
  818. listHistPo.add(historial);
  819. }
  820. }
  821.  
  822. }
  823.  
  824. public void eliminaTabla() {
  825.  
  826. // System.out.println("tam listaEscoge" + listaEscoge.size());
  827. for (int i = 0; i <= listaEscoge.size() - 1; i++) {
  828. listaAPeticion.remove(listaEscoge.get(i));
  829. }
  830. ordenaTabla();
  831. numIntoBloque = (Integer) listaAPeticion.size() + 1;
  832. limpiaVar();
  833. //System.out.println("Nuevo tamaño::" + listaAPeticion.size());
  834.  
  835. }
  836.  
  837. public void ordenaTabla() {
  838. for (int i = 0; i <= listaAPeticion.size() - 1; i++) {
  839. listaAPeticion.get(i).setNro_exped(i + 1);
  840.  
  841. }
  842.  
  843. }
  844.  
  845. public void limpiaVar() {
  846. comboExpediente = "SM";
  847. numero = "";
  848. gestion = "";
  849. extension = "";
  850. obsPeticion = "";
  851. descripcion = "";
  852. demanSolicitante = "";
  853. demanApoderado = "";
  854. demanFojas = "";
  855. demanNotificarCon = "";
  856. demanCelular = "";
  857. demanDomicilio = "";
  858. obsPeticion = "";
  859. }
  860.  
  861. public void limpiaVarOposiciones() {
  862. danteMarca = "";
  863. danteSolicitante = "";
  864. danteApoderado = "";
  865. danteFojas = "";
  866. danteNotificarCon = "";
  867. danteCelular = "";
  868. danteDomicilio = "";
  869.  
  870. dadoMarca = "";
  871. dadoSolicitante = "";
  872. dadoApoderado = "";
  873. dadoFojas = "";
  874. dadoNotificarCon = "";
  875. dadoCelular = "";
  876. dadoDomicilio = "";
  877.  
  878. obsPeticion = "";
  879.  
  880. }
  881.  
  882. public void limpiaTodo() throws Exception {
  883. descripcion = "";
  884. demanSolicitante = "";
  885. demanApoderado = "";
  886. demanFojas = "";
  887. demanNotificarCon = "";
  888. demanCelular = "";
  889. demanDomicilio = "";
  890. listaAPeticion.clear();
  891.  
  892. }
  893.  
  894. public void cambiaRadioButon() throws Exception {
  895.  
  896. if (creaModifieli.equals("1")) {
  897. habAdiciona = false;
  898. habElimina = false;
  899. habModifica = false;
  900. habBuscar = true;
  901. numBloqueBusca = null;
  902. numBloque = notificacionService.obtieneBloqueNuevo(idUsuarioSesion.intValue());
  903. numIntoBloque = 1;
  904. habGuardaCamb = false;
  905. limpiaVar();
  906.  
  907. listaAPeticion.clear();//Tambien debo limpiar mi tabla de la derecha , esto no pongo en el metodo limpiaVar() ya que otros metodos usan esto y siempre que se ejecuta borrair aa mi tabal derecha , y no es el caso
  908. }
  909. if (creaModifieli.equals("2")) {
  910. habAdiciona = false;
  911. habElimina = false;
  912. habModifica = false;
  913. habBuscar = false;
  914. //cereamos el numero de bloque y su correlativo solo cuando cambia a modificar para que de a entender que no eligio ningun bloque
  915. numBloque = 0;
  916. numIntoBloque = 0;
  917. listaAPeticion.clear();
  918. // limpiaVar(); No limpiar porque quizas al bloque que escogio quiera insertar el agarrado
  919. }
  920. if (creaModifieli.equals("3")) {
  921. habAdiciona = true;
  922. habElimina = true;
  923. habModifica = true;
  924. habBuscar = false;
  925. limpiaVar();
  926. }
  927. }
  928.  
  929. public void imprime2() throws JRException, IOException, Exception {
  930. ////////////////////////////IMPRIMO EL REPORTE E NSI////////////////////////////////
  931. String imageSenapi = FacesContext.getCurrentInstance().getExternalContext().getRealPath("/imagen/Logo senapi");
  932.  
  933. Map<String, Object> parametros;
  934. parametros = new HashMap<String, Object>();
  935. String var1 = "{\\rtf1\\ansi\\deff0"
  936. + "{\\colortbl;\\red0\\green0\\blue0;\\red255\\green0\\blue0;}"
  937. + "This line is the default color\\line"
  938. + "\\cf2"
  939. + "This line is red\\line"
  940. + "\\cf1"
  941. + "This line is the default color"
  942. + "}";
  943. //El codigo de abajo muestra que podemos agarrar un archivo cuyo contenido es texto en formato RTF
  944. //String rtfText = FileUtils.readFully(new FileReader(new File("/home/levi/Documentos/PROYECTOS/SISInterno/SistemaInterno/giview/src/main/java/snp/gob/bo/entidades/notificacion/rtf1.txt")));
  945. //se ha creado un servicio solo para probar qeu en un campo de BD tipo String tiene contenido en formato RTF e igual ese lo puede agarrar, para este ejemplo en la tabla usuariopagina
  946. String rtfText = usuarioPaginaService.obtieneHabalitado();
  947.  
  948. /**
  949. * *********Para html*********
  950. */
  951. //se agarra un .txt con formato adentro de html, pero no funciona no agarra
  952. String varhtml = FileUtils.readFully(new FileReader(new File("/home/levi/Documentos/PROYECTOS/SISInterno/SistemaInterno/giview/src/main/java/snp/gob/bo/entidades/notificacion/html_1.txt")));
  953.  
  954. parametros.put("variable", rtfText);
  955. // System.out.println("varhtml"+varhtml);
  956. // parametros.put("varhtml", varhtml);
  957.  
  958. ///////imprimer el reporte en si/////////////////
  959. File jasper = new File(FacesContext.getCurrentInstance().getExternalContext().getRealPath("/reportes/prueba/MyReports/prueba.jasper"));
  960. HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
  961. //con esta instruccion se crea otra ventana en el que se mostrara el reporte
  962. response.addHeader("Content-Disposition", "attachment; filename=Publicacion.pdf");
  963.  
  964. //Se enviaran al reporte solamente parametros, de los cuales el que corresponde a la Collection se enviara como vacio
  965. byte[] bytes;
  966.  
  967. bytes = JasperRunManager.runReportToPdf(jasper.getPath(), parametros, new JREmptyDataSource());
  968.  
  969. response.setContentLength(bytes.length);
  970.  
  971. ServletOutputStream outStream = response.getOutputStream();
  972.  
  973. outStream.write(bytes, 0, bytes.length);
  974. outStream.flush();
  975. outStream.close();
  976. FacesContext.getCurrentInstance().responseComplete();
  977.  
  978. }
  979.  
  980. /**
  981. *
  982. * Metodo para validar si una cadena string es un numero.
  983. *
  984. * Creado: Ruben Ramirez Fecha: 09/12/2016
  985. *
  986. * @param cadena
  987. * @return
  988. */
  989. public boolean validar(String cadena) {
  990. return cadena.matches("[A-Z].*");
  991. }
  992.  
  993. /**
  994. * metodo para el paso de parametros al reporte lista de peticiones de
  995. * acuerdo al bloque de peticiones por usuario.
  996. *
  997. * Creado: Ruben Ramirez Fecha: 24/11/2016
  998. *
  999. * @throws net.sf.jasperreports.engine.JRException
  1000. * @throws java.io.IOException
  1001. */
  1002. public void imprime() throws JRException, IOException, Exception {
  1003. // System.out.println("IMPRIME LA PETICION NOTIFICACION");
  1004. listaAPeticionRepo = notificacionService.getNotificacionXbloqueXusuariosol(numBloque, idUsuarioSesion);
  1005.  
  1006. if (listaAPeticionRepo.size() > 0) {
  1007.  
  1008. imgSenapi = FacesContext.getCurrentInstance().getExternalContext().getRealPath("/images/logoNuevo.jpg");
  1009. nroBloque = "" + numBloque;
  1010.  
  1011. listUsuario = usuarioService.listaUsuarioXidPagina(idUsuarioSesion);
  1012. Usuario user = listUsuario.get(0);
  1013.  
  1014. operador = user.getNombre() + " " + user.getPrimer_apellido();
  1015.  
  1016. usuario = devuelveNombreJuridicoONatural(user.getNombre(), user.getPrimer_apellido(), user.getSegundo_apellido());
  1017.  
  1018. if (usuario != null) {
  1019. usuario = usuario.toUpperCase();
  1020. }
  1021.  
  1022. // brinda formato a la fecha y hora de registros date.
  1023. DateFormatSymbols dateFormatSymbols = new DateFormatSymbols();
  1024. dateFormatSymbols.setWeekdays(new String[]{
  1025. "",
  1026. "domingo",
  1027. "lunes",
  1028. "martes",
  1029. "miércoles",
  1030. "jueves",
  1031. "viernes",
  1032. "sábado"});
  1033.  
  1034. dateFormatSymbols.setMonths(new String[]{
  1035. "enero",
  1036. "febrero",
  1037. "marzo",
  1038. "abril",
  1039. "mayo",
  1040. "junio",
  1041. "julio",
  1042. "agosto",
  1043. "septiembre",
  1044. "octubre",
  1045. "noviembre",
  1046. "diciembre"});
  1047.  
  1048. SimpleDateFormat formateador1 = new SimpleDateFormat("EEEEE, dd MMMM, yyyy", dateFormatSymbols);
  1049. SimpleDateFormat formateador2 = new SimpleDateFormat("hh:mm a");
  1050. SimpleDateFormat formateador3 = new SimpleDateFormat("dd/MM/yyyy");
  1051.  
  1052. // fecha actual de al base de datos
  1053. Date fechaPresente = comunService.obtenerFechaHoraServidor(1L);
  1054.  
  1055. if (fechaPresente != null) {
  1056. fechaIng = formateador1.format(fechaPresente);
  1057. horaIng = formateador2.format(fechaPresente);
  1058. }
  1059.  
  1060. int i = 0;
  1061. for (Notificacion item : listaAPeticionRepo) {
  1062. if (item.getDemandado_cod_estado() != "PREE" && item.getDemandante_cod_estado() != "PREE") {
  1063. i++;
  1064. NotiPeticionListPojo noti = new NotiPeticionListPojo();
  1065. noti.setN("" + i);
  1066. noti.setTramite(item.getTipo_tramite_notificacion());
  1067. noti.setNro(item.getExpediente());
  1068. if (item.getGestion() != null && item.getGestion() > 0) {
  1069. noti.setGestion("" + item.getGestion());
  1070. }
  1071. if (item.getExtension() != null) {
  1072. if (!item.getExtension().trim().equals("")) {
  1073. if (this.validar(item.getExtension())) {
  1074. noti.setExtension(item.getExtension());
  1075. }
  1076. }
  1077. }
  1078.  
  1079. noti.setDemandante(item.getDemandante());
  1080. noti.setDemandado(item.getDemandado());
  1081.  
  1082. if (item.getDemandante_fecha_noti() != null) {
  1083. noti.setDemandanteFecha(formateador3.format(item.getDemandante_fecha_noti()));
  1084. }
  1085. if (item.getDemandado_fecha_noti() != null) {
  1086. noti.setDemandadoFecha(formateador3.format(item.getDemandado_fecha_noti()));
  1087. }
  1088. noti.setDemandanteCon(item.getDemandante_con());
  1089. noti.setDemandadoCon(item.getDemandado_con());
  1090.  
  1091. noti.setDemandanteFojas(item.getDemandante_fojas());
  1092. noti.setDemandadoFojas(item.getDemandado_fojas());
  1093.  
  1094. listNotiPeticionList.add(noti);
  1095. }
  1096. }
  1097. if (listNotiPeticionList.size() > 0) {
  1098. JRBeanCollectionDataSource itemsJRBean = new JRBeanCollectionDataSource(listNotiPeticionList);
  1099. parametros.put("nroBloque", nroBloque);
  1100. parametros.put("operador", operador);
  1101. parametros.put("fechaIngreso", fechaIng);
  1102. parametros.put("horaIngreso", horaIng);
  1103. parametros.put("imgSenapi", imgSenapi);
  1104. parametros.put("dataNoti", itemsJRBean);
  1105. parametros.put("usuario", usuario);
  1106. String filename = "Notificacion.pdf";
  1107. String jasperPath = "/template/notificacion/NotiNotificacion.jasper";
  1108. this.PDFSD(parametros, jasperPath, filename);
  1109. listNotiPeticionList.clear();
  1110. } else {
  1111. FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "BLOQUE NO SELECCIONADO", "Seleccione un bloque.");
  1112. FacesContext.getCurrentInstance().addMessage(null, message);
  1113. }
  1114. } else {
  1115. FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "BLOQUE NO SELECCIONADO", "Seleccione un bloque.");
  1116. FacesContext.getCurrentInstance().addMessage(null, message);
  1117. }
  1118. }
  1119.  
  1120. /**
  1121. * Metodo para generar el reporte en formato pdf
  1122. *
  1123. * Creado: Ruben Ramirez Fecha: 24/11/2016
  1124. *
  1125. * @param params
  1126. * @param jasperPath
  1127. * @param fileName
  1128. *
  1129. * @throws net.sf.jasperreports.engine.JRException
  1130. * @throws java.io.IOException
  1131. */
  1132. public void PDFSD(Map<String, Object> params, String jasperPath, String fileName) throws JRException, IOException {
  1133. String relativeWebPath = FacesContext.getCurrentInstance().getExternalContext().getRealPath(jasperPath);
  1134. File file = new File(relativeWebPath);
  1135. JasperPrint print = JasperFillManager.fillReport(file.getPath(), params, new JREmptyDataSource());
  1136. HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
  1137. response.addHeader("Content-Disposition", "attachment; filename=" + fileName);
  1138. ServletOutputStream stream = response.getOutputStream();
  1139. JasperExportManager.exportReportToPdfStream(print, stream);
  1140. FacesContext.getCurrentInstance().responseComplete();
  1141. }
  1142.  
  1143. public String devuelveNombreJuridicoONatural(String nombre, String primerApellido, String segundoApellido) {
  1144. String campoNombreRazonSocial = " ";
  1145. if (nombre != null && !nombre.equals("")) {
  1146. campoNombreRazonSocial = nombre;
  1147. }
  1148. if (primerApellido != null && !primerApellido.equals("")) {
  1149. campoNombreRazonSocial = campoNombreRazonSocial + " " + primerApellido;
  1150. }
  1151. if (segundoApellido != null && !segundoApellido.equals("")) {
  1152. campoNombreRazonSocial = campoNombreRazonSocial + " " + segundoApellido;
  1153. }
  1154. return campoNombreRazonSocial;
  1155. }
  1156.  
  1157. public void guardaNotificacion() throws Exception {
  1158. // System.out.println("/************************/");
  1159. // System.out.println("ENTRA A GUARDAR LA PETICION DE NOTIFICACIÓN.....");
  1160. if (creaModifieli.equals("1")) {
  1161. notificacionService.guardaListaNotificaciones(listaAPeticion);
  1162. //He limpiado todo y creado nuevo numero de bloque para no tener que ver en BD: si existe bloque se updetea, y si no se crea
  1163. //prefiero obligar al usuario a que entre a la opcion modificar , si es qeu se ha equivocado con el insertado
  1164. numIntoBloque = 1;
  1165. numBloque = notificacionService.obtieneBloqueNuevo(idUsuarioSesion.intValue());
  1166.  
  1167. limpiaTodo();
  1168.  
  1169. FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Bloque creado", "Se creará un nuevo bloque ahora.");
  1170. FacesContext.getCurrentInstance().addMessage(null, message);
  1171. // listaAPeticion
  1172. }
  1173. if (creaModifieli.equals("2")) {
  1174. // System.out.println("bloque::"+listaAPeticion.get(0).getBloque());
  1175. // System.out.println("seciencua::"+listaAPeticion.get(0).getNro_exped());
  1176. notificacionService.modificaListaNotificaciones(listaAPeticion);
  1177. FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Bloque modificado", "");
  1178. FacesContext.getCurrentInstance().addMessage(null, message);
  1179.  
  1180. }
  1181.  
  1182. }
  1183.  
  1184. //Guarda en el historial de signos
  1185.  
  1186. public void guardaHistorial(List<Notificacion> lista) throws Exception {
  1187. Long sm;
  1188.  
  1189. for (int i = 0; i <= lista.size() - 1; i++) {
  1190. String desc = "[Status: ";
  1191.  
  1192. // System.out.println("desc::"+desc);
  1193. if (lista.get(i).getTipo_tramite_notificacion().equals("SM")) {
  1194. if (lista.get(i).getExtension() == null) {
  1195. sm = comunService.codificarCodigoSM(lista.get(i).getExpediente(), lista.get(i).getGestion().toString(), "");
  1196. } else {
  1197.  
  1198. sm = comunService.codificarCodigoSM(lista.get(i).getExpediente(), lista.get(i).getGestion().toString(), lista.get(i).getExtension());
  1199. }
  1200.  
  1201. SigSignoMarca signoMarca = sigSignoMarcaService.listaSigSignoMarcaXSM(sm);
  1202. // System.out.println("lista.get(i).getEstado_marca()::"+lista.get(i).getEstado_marca());
  1203. desc = desc + dominioService.obtenerNombrePorCodigoDominio(lista.get(i).getEstado_marca(), "estado_marca") + "]";
  1204. sigHistorialService.generarHistorialNotificacion(signoMarca, idUsuarioSesion, "PETICION DE NOTIFICACION", desc);
  1205. }
  1206. if (lista.get(i).getTipo_tramite_notificacion().equals("N° REG")) {
  1207. SigSignoMarca signoMarca = sigSignoMarcaService.listaSigSignoMarcaXRegistro(Long.parseLong(lista.get(i).getExpediente()), lista.get(i).getExtension(), "");
  1208. if(lista.get(i).getEstado_marca() != null && lista.get(i).getEstado_marca()!="")
  1209. {
  1210. desc = desc + dominioService.obtenerNombrePorCodigoDominio(lista.get(i).getEstado_marca(), "estado_marca") + "]";
  1211. sigHistorialService.generarHistorialNotificacion(signoMarca, idUsuarioSesion, "PETICION DE NOTIFICACION", desc);
  1212. }
  1213. }
  1214. if (lista.get(i).getTipo_tramite_notificacion().equals("N° PUB SIGNO")) {
  1215. SigSignoMarca signoMarca = sigSignoMarcaService.listaSigSignoMarcaXPublicacion(Long.parseLong(lista.get(i).getExpediente()));
  1216. desc = desc + dominioService.obtenerNombrePorCodigoDominio(lista.get(i).getEstado_marca(), "estado_marca") + "]";
  1217. sigHistorialService.generarHistorialNotificacion(signoMarca, idUsuarioSesion, "PETICION DE NOTIFICACION", desc);
  1218. }
  1219. if ((!lista.get(i).getTipo_tramite_notificacion().equals("SM"))
  1220. && (!lista.get(i).getTipo_tramite_notificacion().equals("SR"))
  1221. && (!lista.get(i).getTipo_tramite_notificacion().equals("N° REG"))
  1222. && (!lista.get(i).getTipo_tramite_notificacion().equals("N° PUB SIGNO"))
  1223. && (!lista.get(i).getTipo_tramite_notificacion().equals("CANCELACION"))
  1224. && (!lista.get(i).getTipo_tramite_notificacion().equals("OPOSICION SIG"))
  1225. && (!lista.get(i).getTipo_tramite_notificacion().equals("NULIDAD SIG"))
  1226. && (!lista.get(i).getTipo_tramite_notificacion().equals("BQ"))
  1227. && (!lista.get(i).getTipo_tramite_notificacion().equals("CE"))) {
  1228. ModModificacion modi = modModificacionService.buscarModModificacionXCodigo(lista.get(i).getTipo_tramite_notificacion(),
  1229. Long.parseLong(lista.get(i).getExpediente()),
  1230. lista.get(i).getGestion());
  1231. // System.out.println("estado_marca::" + lista.get(i).getEstado_marca());
  1232. if(lista.get(i).getEstado_marca() != null && !lista.get(i).getEstado_marca().equals(""))
  1233. { desc = desc + dominioService.obtenerNombrePorCodigoDominio(lista.get(i).getEstado_marca(), "estado_modificacion") + "]";
  1234. // System.out.println("desc::" + desc);
  1235. sigHistorialService.generarHistorialModifiNotificacion(modi, idUsuarioSesion, "PETICION DE NOTIFICACION", desc);
  1236. }
  1237. }
  1238. if (lista.get(i).getTipo_tramite_notificacion().equals("SR")) {
  1239. RenSolicitudRenovacion ren = renSolicitudRenovacionService.buscaSolicitudRenovacionPorNumeroSrYGestion(Long.parseLong(lista.get(i).getExpediente()),
  1240. lista.get(i).getGestion());
  1241.  
  1242. if(lista.get(i).getEstado_marca() != null && !lista.get(i).getEstado_marca().equals(""))
  1243. {
  1244. desc = desc + dominioService.obtenerNombrePorCodigoDominio(lista.get(i).getEstado_marca(), "estado_renovacion") + "]";
  1245. sigHistorialService.generarHistorialRenoNotificacion(ren, idUsuarioSesion, "PETICION DE NOTIFICACION", desc);
  1246. }
  1247. }
  1248.  
  1249. }
  1250. }
  1251.  
  1252. public void enviaNotificacion() throws Exception {
  1253.  
  1254. //System.out.println("/************************/");
  1255. // System.out.println("ENVIA LA NOTIFICACIÓN.....");
  1256. DateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
  1257.  
  1258. //System.out.println("Entra a EnviaNotificacaoin");
  1259. String bandera = "no";
  1260. if (creaModifieli.equals("1")) {
  1261. //He limpiado todo y creado nuevo numero de bloque para no tener que ver en BD: si existe bloque se updetea, y si no se crea
  1262. //prefiero obligar al usuario a que entre a la opcion modificar , si es qeu se ha equivocado con el insertado
  1263.  
  1264. for (int i = 0; i <= listaAPeticion.size() - 1; i++) {
  1265. // System.out.println("tipo_tramite0::::" + listaAPeticion.get(i).getTipo_tramite_notificacion());
  1266. listaAPeticion.get(i).setFecha_ingreso(new Date());
  1267. if (!listaAPeticion.get(i).getTipo_tramite_notificacion().equals("OPOSICION SIG") && !listaAPeticion.get(i).getTipo_tramite_notificacion().equals("CANCELACION")
  1268. && !listaAPeticion.get(i).getTipo_tramite_notificacion().equals("NULIDAD SIG")) {
  1269. listaAPeticion.get(i).setDemandante_cod_estado("ENV");
  1270.  
  1271. } else {
  1272. listaAPeticion.get(i).setDemandante_cod_estado("ENV");
  1273. listaAPeticion.get(i).setDemandado_cod_estado("ENV");
  1274. }
  1275. listaAPeticion.get(i).setHistorial("ADICIONADO: "
  1276. + usuarioService.listaUsuarioXidPagina(listaAPeticion.get(i).getId_usuario_solicitante()).get(0).getNombre()
  1277. + " "
  1278. + usuarioService.listaUsuarioXidPagina(listaAPeticion.get(i).getId_usuario_solicitante()).get(0).getPrimer_apellido()
  1279. + "," + df.format(new Date()));
  1280. listaAPeticion.get(i).setIdlogtrans(logtrans);
  1281. //seteo el ultimo estado en que se encuentra el tramie par aque al devolver de notificacion se vuelva a su estado original el campo estado_marca
  1282. listaAPeticion.get(i).setEstado_marca(obtieneEstadoActualTramite(listaAPeticion.get(i)));
  1283. }
  1284. notificacionService.guardaListaNotificaciones(listaAPeticion);
  1285. numIntoBloque = 1;
  1286. numBloque = notificacionService.obtieneBloqueNuevo(idUsuarioSesion.intValue());
  1287. // System.out.println("tipo_tramite1::::" + listaAPeticion.get(0).getTipo_tramite_notificacion());
  1288. // System.out.println("antes de entatr0:::" + listaAPeticion.size());
  1289. //updetea el estado_marca a 'NOT' a todos de la lista
  1290. guardaEstadoNotifica(listaAPeticion);
  1291. //////////////////////////////
  1292. guardaHistorial(listaAPeticion);
  1293. limpiaTodo();
  1294.  
  1295. FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "BLOQUE ENVIADO A NOTIFICACION", "Se creará un nuevo bloque ahora.");
  1296. FacesContext.getCurrentInstance().addMessage(null, message);
  1297. //logtrans
  1298. }
  1299. if (creaModifieli.equals("2")) {
  1300. //En este for se valida que si hay algun estado con Pree su siguiente estado por default seria ENV, por eso la bandera
  1301. //En caso contrario debe dejar pasar su estado por default ya que su estado no debe modificarse, excepto cuando es PREE
  1302. for (int j = 0; j <= listaAPeticion.size() - 1; j++) {
  1303. if (listaAPeticion.get(j).getDemandante_cod_estado().equals("PREE")) {
  1304. bandera = "si";
  1305. }
  1306.  
  1307. }
  1308. if (bandera.equals("si")) {
  1309. for (int i = 0; i <= listaAPeticion.size() - 1; i++) {
  1310. if (!listaAPeticion.get(i).getTipo_tramite_notificacion().equals("OPOSICION SIG")) {
  1311. listaAPeticion.get(i).setDemandante_cod_estado("ENV");
  1312.  
  1313. } else {
  1314. listaAPeticion.get(i).setDemandante_cod_estado("ENV");
  1315. listaAPeticion.get(i).setDemandado_cod_estado("ENV");
  1316. }
  1317. listaAPeticion.get(i).setHistorial("ADICIONADO: "
  1318. + usuarioService.listaUsuarioXidPagina(listaAPeticion.get(i).getId_usuario_solicitante()).get(0).getNombre()
  1319. + " "
  1320. + usuarioService.listaUsuarioXidPagina(listaAPeticion.get(i).getId_usuario_solicitante()).get(0).getPrimer_apellido()
  1321. + "," + df.format(new Date()));
  1322. listaAPeticion.get(i).setIdlogtrans(logtrans);
  1323. listaAPeticion.get(i).setFecha_ingreso(new Date());
  1324. //seteo el ultimo estado en que se encuentra el tramie par aque al devolver de notificacion se vuelva a su estado original el campo estado_marca
  1325. listaAPeticion.get(i).setEstado_marca(obtieneEstadoActualTramite(listaAPeticion.get(i)));
  1326. }
  1327. notificacionService.modificaListaNotificaciones(listaAPeticion);
  1328. FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "BLOQUE MODIFICADO Y ENVIADO A NOTIFICACION", "");
  1329. FacesContext.getCurrentInstance().addMessage(null, message);
  1330. habAdiciona = true;
  1331. habElimina = true;
  1332. habGuardaCamb = true;
  1333.  
  1334. } else {
  1335.  
  1336. notificacionService.modificaListaNotificaciones(listaAPeticion);
  1337. FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "BLOQUE MODIFICADO Y ENVIADO A NOTIFICACION", "");
  1338. FacesContext.getCurrentInstance().addMessage(null, message);
  1339.  
  1340. }
  1341. // System.out.println("antes de entatr1:::" + listaAPeticion.size());
  1342. guardaEstadoNotifica(listaAPeticion);
  1343. guardaHistorial(listaAPeticion);
  1344. }
  1345.  
  1346. }
  1347.  
  1348. //devolvera el estado actual del tamite, para que cuando devuelva notificacion retome ese mismo estado
  1349.  
  1350. public String obtieneEstadoActualTramite(Notificacion noti) throws Exception {
  1351. // System.out.println("ENTRAAA::::" + noti.getTipo_tramite_notificacion());
  1352. String estado = null;
  1353. Long sm;
  1354. // if(super.getIdEtapaSession()==3 ||super.getIdEtapaSession()==7)
  1355. // {
  1356. if (noti.getTipo_tramite_notificacion().equals("SM")) {
  1357. if (noti.getExtension() == null) {
  1358. sm = comunService.codificarCodigoSM(noti.getExpediente(), noti.getGestion().toString(), "");
  1359. } else {
  1360.  
  1361. sm = comunService.codificarCodigoSM(noti.getExpediente(), noti.getGestion().toString(), noti.getExtension());
  1362. }
  1363.  
  1364. SigSignoMarca signoMarca = sigSignoMarcaService.listaSigSignoMarcaXSM(sm);
  1365. estado = signoMarca.getEstadoMarca();
  1366.  
  1367. }
  1368. if (noti.getTipo_tramite_notificacion().equals("N° REG")) {
  1369. SigSignoMarca signoMarca = sigSignoMarcaService.listaSigSignoMarcaXRegistro(Long.parseLong(noti.getExpediente()), noti.getExtension(), "");
  1370. if(signoMarca != null)
  1371. { estado = signoMarca.getEstadoMarca();
  1372.  
  1373. }
  1374.  
  1375. }
  1376. if (noti.getTipo_tramite_notificacion().equals("N° PUB SIGNO")) {
  1377. SigSignoMarca signoMarca = sigSignoMarcaService.listaSigSignoMarcaXPublicacion(Long.parseLong(noti.getExpediente()));
  1378. estado = signoMarca.getEstadoMarca();
  1379.  
  1380. }
  1381. if ((!noti.getTipo_tramite_notificacion().equals("SM"))
  1382. && (!noti.getTipo_tramite_notificacion().equals("SR"))
  1383. && (!noti.getTipo_tramite_notificacion().equals("N° REG"))
  1384. && (!noti.getTipo_tramite_notificacion().equals("N° PUB SIGNO"))
  1385. && (!noti.getTipo_tramite_notificacion().equals("CANCELACION"))
  1386. && (!noti.getTipo_tramite_notificacion().equals("OPOSICION SIG"))
  1387. && (!noti.getTipo_tramite_notificacion().equals("NULIDAD SIG"))
  1388. && (!noti.getTipo_tramite_notificacion().equals("BQ"))
  1389. && (!noti.getTipo_tramite_notificacion().equals("CE"))) {
  1390. ModModificacion modi = modModificacionService.buscarModModificacionXCodigo(noti.getTipo_tramite_notificacion(),
  1391. Long.parseLong(noti.getExpediente()),
  1392. noti.getGestion());
  1393. if(modi != null)
  1394. { //System.out.println("El estado de modi aqui:" + modi.getEstado_modificacion());
  1395. estado = modi.getEstado_modificacion();
  1396. }
  1397. else{
  1398. System.out.println("El exoediente:"+ Long.parseLong(noti.getExpediente())+" es nulo.");
  1399. }
  1400. }
  1401. if (noti.getTipo_tramite_notificacion().equals("SR")) {
  1402. RenSolicitudRenovacion ren = renSolicitudRenovacionService.buscaSolicitudRenovacionPorNumeroSrYGestion(Long.parseLong(noti.getExpediente()),
  1403. noti.getGestion());
  1404. estado = ren.getEstado_renovacion();
  1405. }
  1406.  
  1407. //}
  1408. return estado;
  1409.  
  1410. }
  1411.  
  1412. //este metodo cambia el estado de "Situacion actual" a "notificacion" en la pantalla de examen de signos
  1413. public void guardaEstadoNotifica(List<Notificacion> lista) throws Exception {
  1414. Long sm;
  1415. //System.out.println("tipo_tramite1::::"+lista.get(0).getTipo_tramite_notificacion());
  1416. //System.out.println("Entra....");
  1417. for (int i = 0; i <= lista.size() - 1; i++) {
  1418. if (lista.get(i).getTipo_tramite_notificacion().equals("SM")) {
  1419. // System.out.println("tipo_tramite::"+lista.get(i).getTipo_tramite_notificacion()+"gestion::"+ lista.get(i).getGestion().toString());
  1420. if (listaAPeticion.get(i).getExtension() == null) {
  1421. sm = comunService.codificarCodigoSM(lista.get(i).getExpediente(), lista.get(i).getGestion().toString(), "");
  1422. } else {
  1423.  
  1424. sm = comunService.codificarCodigoSM(lista.get(i).getExpediente(), lista.get(i).getGestion().toString(), lista.get(i).getExtension());
  1425. }
  1426.  
  1427. SigSignoMarca signoMarca = sigSignoMarcaService.listaSigSignoMarcaXSM(sm);
  1428.  
  1429. signoMarca.setEstadoMarca("NOT");
  1430. sigSignoMarcaService.crudSigSignoMarca(signoMarca, 2);
  1431.  
  1432. }
  1433. if (lista.get(i).getTipo_tramite_notificacion().equals("N° REG")) {
  1434. SigSignoMarca signoMarca = sigSignoMarcaService.listaSigSignoMarcaXRegistro(Long.parseLong(lista.get(i).getExpediente()), lista.get(i).getExtension(), "");
  1435. if(signoMarca != null)
  1436. { signoMarca.setEstadoMarca("NOT");
  1437. sigSignoMarcaService.crudSigSignoMarca(signoMarca, 2);
  1438. }
  1439. }
  1440. if (lista.get(i).getTipo_tramite_notificacion().equals("N° PUB SIGNO")) {
  1441. SigSignoMarca signoMarca = sigSignoMarcaService.listaSigSignoMarcaXPublicacion(Long.parseLong(lista.get(i).getExpediente()));
  1442. signoMarca.setEstadoMarca("NOT");
  1443. sigSignoMarcaService.crudSigSignoMarca(signoMarca, 2);
  1444. }
  1445.  
  1446. }
  1447.  
  1448. }
  1449.  
  1450. public void saleDialogo() {
  1451.  
  1452. RequestContext.getCurrentInstance().closeDialog("a");
  1453.  
  1454. }
  1455.  
  1456. public boolean isHabImpr() {
  1457. return habImpr;
  1458. }
  1459.  
  1460. public void setHabImpr(boolean habImpr) {
  1461. this.habImpr = habImpr;
  1462. }
  1463.  
  1464. public ComunService getComunService() {
  1465. return comunService;
  1466. }
  1467.  
  1468. public void setComunService(ComunService comunService) {
  1469. this.comunService = comunService;
  1470. }
  1471.  
  1472. public void eliminaBloque() {
  1473. this.listaAPeticion.clear();
  1474.  
  1475. }
  1476.  
  1477. public List<HistorialPojo> getListHistPo() {
  1478. return listHistPo;
  1479. }
  1480.  
  1481. public void setListHistPo(List<HistorialPojo> listHistPo) {
  1482. this.listHistPo = listHistPo;
  1483. }
  1484.  
  1485. public Integer getNumBloqueBusca() {
  1486. return numBloqueBusca;
  1487. }
  1488.  
  1489. public void setNumBloqueBusca(Integer numBloqueBusca) {
  1490. this.numBloqueBusca = numBloqueBusca;
  1491. }
  1492.  
  1493. public List<Dominio> getListaTipoNotifi() {
  1494. return listaTipoNotifi;
  1495. }
  1496.  
  1497. public void setListaTipoNotifi(List<Dominio> listaTipoNotifi) {
  1498. this.listaTipoNotifi = listaTipoNotifi;
  1499. }
  1500.  
  1501. public Integer getNumBloque() {
  1502. return numBloque;
  1503. }
  1504.  
  1505. public void setNumBloque(Integer numBloque) {
  1506. this.numBloque = numBloque;
  1507. }
  1508.  
  1509. public String getText() {
  1510. System.out.println("en el get:" + text);
  1511. return text;
  1512. }
  1513.  
  1514. public void setText(String text) {
  1515. System.out.println("en el set:" + text);
  1516. this.text = text;
  1517. }
  1518.  
  1519. public String getComboExpediente() {
  1520. return comboExpediente;
  1521. }
  1522.  
  1523. public void setComboExpediente(String comboExpediente) {
  1524. this.comboExpediente = comboExpediente;
  1525. }
  1526.  
  1527. public String getCodigoPrin() {
  1528. return codigoPrin;
  1529. }
  1530.  
  1531. public void setCodigoPrin(String codigoPrin) {
  1532. this.codigoPrin = codigoPrin;
  1533. }
  1534.  
  1535. public String getTipoTramite() {
  1536. return tipoTramite;
  1537. }
  1538.  
  1539. public void setTipoTramite(String tipoTramite) {
  1540. this.tipoTramite = tipoTramite;
  1541. }
  1542.  
  1543. public String getTemplate() {
  1544. return template;
  1545. }
  1546.  
  1547. public void setTemplate(String template) {
  1548. this.template = template;
  1549. }
  1550.  
  1551. public String getVar() {
  1552. return var;
  1553. }
  1554.  
  1555. public void setVar(String var) {
  1556. this.var = var;
  1557. }
  1558.  
  1559. public boolean getHabOposocion() {
  1560. return habOposocion;
  1561. }
  1562.  
  1563. public void setHabOposocion(boolean habOposocion) {
  1564. this.habOposocion = habOposocion;
  1565. }
  1566.  
  1567. public boolean getHabBuscar() {
  1568. return habBuscar;
  1569. }
  1570.  
  1571. public void setHabBuscar(boolean habBuscar) {
  1572. this.habBuscar = habBuscar;
  1573. }
  1574.  
  1575. public String getNumero() {
  1576. return numero;
  1577. }
  1578.  
  1579. public void setNumero(String numero) {
  1580. this.numero = numero;
  1581. }
  1582.  
  1583. public String getGestion() {
  1584. return gestion;
  1585. }
  1586.  
  1587. public void setGestion(String gestion) {
  1588. this.gestion = gestion;
  1589. }
  1590.  
  1591. public String getExtension() {
  1592. return extension;
  1593. }
  1594.  
  1595. public void setExtension(String extension) {
  1596. this.extension = extension;
  1597. }
  1598.  
  1599. public Date getFechaIngreso() {
  1600. return fechaIngreso;
  1601. }
  1602.  
  1603. public void setFechaIngreso(Date fechaIngreso) {
  1604. this.fechaIngreso = fechaIngreso;
  1605. }
  1606.  
  1607. public String getExpediente() {
  1608. return expediente;
  1609. }
  1610.  
  1611. public void setExpediente(String expediente) {
  1612. this.expediente = expediente;
  1613. }
  1614.  
  1615. public Integer getPos() {
  1616. return pos;
  1617. }
  1618.  
  1619. public void setPos(Integer pos) {
  1620. this.pos = pos;
  1621. }
  1622.  
  1623. public boolean getHabAdiciona() {
  1624. return habAdiciona;
  1625. }
  1626.  
  1627. public void setHabAdiciona(boolean habAdiciona) {
  1628. this.habAdiciona = habAdiciona;
  1629. }
  1630.  
  1631. public boolean getHabModifica() {
  1632. return habModifica;
  1633. }
  1634.  
  1635. public void setHabModifica(boolean habModifica) {
  1636. this.habModifica = habModifica;
  1637. }
  1638.  
  1639. public boolean isHabNotifica() {
  1640. return habNotifica;
  1641. }
  1642.  
  1643. public void setHabNotifica(boolean habNotifica) {
  1644. this.habNotifica = habNotifica;
  1645. }
  1646.  
  1647. public List<NotiPeticionListPojo> getListNotiPeticionList() {
  1648. return listNotiPeticionList;
  1649. }
  1650.  
  1651. public void setListNotiPeticionList(List<NotiPeticionListPojo> listNotiPeticionList) {
  1652. this.listNotiPeticionList = listNotiPeticionList;
  1653. }
  1654.  
  1655. public boolean getHabElimina() {
  1656. return habElimina;
  1657. }
  1658.  
  1659. public void setHabElimina(boolean habElimina) {
  1660. this.habElimina = habElimina;
  1661. }
  1662.  
  1663. public Integer getNumIntoBloque() {
  1664. return numIntoBloque;
  1665. }
  1666.  
  1667. public void setNumIntoBloque(Integer numIntoBloque) {
  1668. this.numIntoBloque = numIntoBloque;
  1669. }
  1670.  
  1671. public String getCreaModifieli() {
  1672. return creaModifieli;
  1673. }
  1674.  
  1675. public void setCreaModifieli(String creaModifieli) {
  1676. this.creaModifieli = creaModifieli;
  1677. }
  1678.  
  1679. public String getDescripcion() {
  1680. return descripcion;
  1681. }
  1682.  
  1683. public void setDescripcion(String descripcion) {
  1684. this.descripcion = descripcion;
  1685. }
  1686.  
  1687. public String getDemanSolicitante() {
  1688. return demanSolicitante;
  1689. }
  1690.  
  1691. public void setDemanSolicitante(String demanSolicitante) {
  1692. this.demanSolicitante = demanSolicitante;
  1693. }
  1694.  
  1695. public String getDemanApoderado() {
  1696. return demanApoderado;
  1697. }
  1698.  
  1699. public void setDemanApoderado(String demanApoderado) {
  1700. this.demanApoderado = demanApoderado;
  1701. }
  1702.  
  1703. public String getDemanFojas() {
  1704. return demanFojas;
  1705. }
  1706.  
  1707. public void setDemanFojas(String demanFojas) {
  1708. this.demanFojas = demanFojas;
  1709. }
  1710.  
  1711. public String getDemanNotificarCon() {
  1712. return demanNotificarCon;
  1713. }
  1714.  
  1715. public void setDemanNotificarCon(String demanNotificarCon) {
  1716. this.demanNotificarCon = demanNotificarCon;
  1717. }
  1718.  
  1719. public String getDemanCelular() {
  1720. return demanCelular;
  1721. }
  1722.  
  1723. public void setDemanCelular(String demanCelular) {
  1724. this.demanCelular = demanCelular;
  1725. }
  1726.  
  1727. public String getDemanDomicilio() {
  1728. return demanDomicilio;
  1729. }
  1730.  
  1731. public void setDemanDomicilio(String demanDomicilio) {
  1732. this.demanDomicilio = demanDomicilio;
  1733. }
  1734.  
  1735. public List<Notificacion> getListaAPeticion() {
  1736. return listaAPeticion;
  1737. }
  1738.  
  1739. public void setListaAPeticion(List<Notificacion> listaAPeticion) {
  1740. this.listaAPeticion = listaAPeticion;
  1741. }
  1742.  
  1743. public List<Notificacion> getListaEscoge() {
  1744. return listaEscoge;
  1745. }
  1746.  
  1747. public void setListaEscoge(List<Notificacion> listaEscoge) {
  1748. this.listaEscoge = listaEscoge;
  1749. }
  1750.  
  1751. public boolean getHabGuardaCamb() {
  1752. return habGuardaCamb;
  1753. }
  1754.  
  1755. public void setHabGuardaCamb(boolean habGuardaCamb) {
  1756. this.habGuardaCamb = habGuardaCamb;
  1757. }
  1758.  
  1759. public String getDanteMarca() {
  1760. return danteMarca;
  1761. }
  1762.  
  1763. public void setDanteMarca(String danteMarca) {
  1764. this.danteMarca = danteMarca;
  1765. }
  1766.  
  1767. public String getDanteSolicitante() {
  1768. return danteSolicitante;
  1769. }
  1770.  
  1771. public void setDanteSolicitante(String danteSolicitante) {
  1772. this.danteSolicitante = danteSolicitante;
  1773. }
  1774.  
  1775. public String getDanteApoderado() {
  1776. return danteApoderado;
  1777. }
  1778.  
  1779. public void setDanteApoderado(String danteApoderado) {
  1780. this.danteApoderado = danteApoderado;
  1781. }
  1782.  
  1783. public String getDanteFojas() {
  1784. return danteFojas;
  1785. }
  1786.  
  1787. public void setDanteFojas(String danteFojas) {
  1788. this.danteFojas = danteFojas;
  1789. }
  1790.  
  1791. public String getDanteNotificarCon() {
  1792. return danteNotificarCon;
  1793. }
  1794.  
  1795. public void setDanteNotificarCon(String danteNotificarCon) {
  1796. this.danteNotificarCon = danteNotificarCon;
  1797. }
  1798.  
  1799. public String getDanteCelular() {
  1800. return danteCelular;
  1801. }
  1802.  
  1803. public void setDanteCelular(String danteCelular) {
  1804. this.danteCelular = danteCelular;
  1805. }
  1806.  
  1807. public String getDanteDomicilio() {
  1808. return danteDomicilio;
  1809. }
  1810.  
  1811. public void setDanteDomicilio(String danteDomicilio) {
  1812. this.danteDomicilio = danteDomicilio;
  1813. }
  1814.  
  1815. public String getDadoMarca() {
  1816. return dadoMarca;
  1817. }
  1818.  
  1819. public void setDadoMarca(String dadoMarca) {
  1820. this.dadoMarca = dadoMarca;
  1821. }
  1822.  
  1823. public String getDadoSolicitante() {
  1824. return dadoSolicitante;
  1825. }
  1826.  
  1827. public void setDadoSolicitante(String dadoSolicitante) {
  1828. this.dadoSolicitante = dadoSolicitante;
  1829. }
  1830.  
  1831. public String getDadoApoderado() {
  1832. return dadoApoderado;
  1833. }
  1834.  
  1835. public void setDadoApoderado(String dadoApoderado) {
  1836. this.dadoApoderado = dadoApoderado;
  1837. }
  1838.  
  1839. public String getDadoFojas() {
  1840. return dadoFojas;
  1841. }
  1842.  
  1843. public void setDadoFojas(String dadoFojas) {
  1844. this.dadoFojas = dadoFojas;
  1845. }
  1846.  
  1847. public String getDadoNotificarCon() {
  1848. return dadoNotificarCon;
  1849. }
  1850.  
  1851. public void setDadoNotificarCon(String dadoNotificarCon) {
  1852. this.dadoNotificarCon = dadoNotificarCon;
  1853. }
  1854.  
  1855. public String getDadoCelular() {
  1856. return dadoCelular;
  1857. }
  1858.  
  1859. public void setDadoCelular(String dadoCelular) {
  1860. this.dadoCelular = dadoCelular;
  1861. }
  1862.  
  1863. public String getDadoDomicilio() {
  1864. return dadoDomicilio;
  1865. }
  1866.  
  1867. public void setDadoDomicilio(String dadoDomicilio) {
  1868. this.dadoDomicilio = dadoDomicilio;
  1869. }
  1870.  
  1871. public UsuarioPaginaService getUsuarioPaginaService() {
  1872. return usuarioPaginaService;
  1873. }
  1874.  
  1875. public void setUsuarioPaginaService(UsuarioPaginaService usuarioPaginaService) {
  1876. this.usuarioPaginaService = usuarioPaginaService;
  1877. }
  1878.  
  1879. public String getObsPeticion() {
  1880. return obsPeticion;
  1881. }
  1882.  
  1883. public void setObsPeticion(String obsPeticion) {
  1884. this.obsPeticion = obsPeticion;
  1885. }
  1886.  
  1887. public NotificacionService getNotificacionService() {
  1888. return notificacionService;
  1889. }
  1890.  
  1891. public void setNotificacionService(NotificacionService notificacionService) {
  1892. this.notificacionService = notificacionService;
  1893. }
  1894.  
  1895. public DominioService getDominioService() {
  1896. return dominioService;
  1897. }
  1898.  
  1899. public void setDominioService(DominioService dominioService) {
  1900. this.dominioService = dominioService;
  1901. }
  1902.  
  1903. public Long getIdUsuarioSesion() {
  1904. return idUsuarioSesion;
  1905. }
  1906.  
  1907. public void setIdUsuarioSesion(Long idUsuarioSesion) {
  1908. this.idUsuarioSesion = idUsuarioSesion;
  1909. }
  1910.  
  1911. public List<Usuario> getListUsuario() {
  1912. return listUsuario;
  1913. }
  1914.  
  1915. public void setListUsuario(List<Usuario> listUsuario) {
  1916. this.listUsuario = listUsuario;
  1917. }
  1918.  
  1919. public Map<String, Object> getParametros() {
  1920. return parametros;
  1921. }
  1922.  
  1923. public void setParametros(Map<String, Object> parametros) {
  1924. this.parametros = parametros;
  1925. }
  1926.  
  1927. public String getNroBloque() {
  1928. return nroBloque;
  1929. }
  1930.  
  1931. public void setNroBloque(String nroBloque) {
  1932. this.nroBloque = nroBloque;
  1933. }
  1934.  
  1935. public String getOperador() {
  1936. return operador;
  1937. }
  1938.  
  1939. public void setOperador(String operador) {
  1940. this.operador = operador;
  1941. }
  1942.  
  1943. public String getFechaIng() {
  1944. return fechaIng;
  1945. }
  1946.  
  1947. public void setFechaIng(String fechaIng) {
  1948. this.fechaIng = fechaIng;
  1949. }
  1950.  
  1951. public String getHoraIng() {
  1952. return horaIng;
  1953. }
  1954.  
  1955. public void setHoraIng(String horaIng) {
  1956. this.horaIng = horaIng;
  1957. }
  1958.  
  1959. public String getImgSenapi() {
  1960. return imgSenapi;
  1961. }
  1962.  
  1963. public void setImgSenapi(String imgSenapi) {
  1964. this.imgSenapi = imgSenapi;
  1965. }
  1966.  
  1967. public UsuarioService getUsuarioService() {
  1968. return usuarioService;
  1969. }
  1970.  
  1971. public void setUsuarioService(UsuarioService usuarioService) {
  1972. this.usuarioService = usuarioService;
  1973. }
  1974.  
  1975. public Long getLogtrans() {
  1976. return logtrans;
  1977. }
  1978.  
  1979. public void setLogtrans(Long logtrans) {
  1980. this.logtrans = logtrans;
  1981. }
  1982.  
  1983. public LogTransService getLogTransService() {
  1984. return logTransService;
  1985. }
  1986.  
  1987. public void setLogTransService(LogTransService logTransService) {
  1988. this.logTransService = logTransService;
  1989. }
  1990.  
  1991. public SigSignoMarcaService getSigSignoMarcaService() {
  1992. return sigSignoMarcaService;
  1993. }
  1994.  
  1995. public void setSigSignoMarcaService(SigSignoMarcaService sigSignoMarcaService) {
  1996. this.sigSignoMarcaService = sigSignoMarcaService;
  1997. }
  1998.  
  1999. public SigHistorialService getSigHistorialService() {
  2000. return sigHistorialService;
  2001. }
  2002.  
  2003. public void setSigHistorialService(SigHistorialService sigHistorialService) {
  2004. this.sigHistorialService = sigHistorialService;
  2005. }
  2006.  
  2007. public ModModificacionService getModModificacionService() {
  2008. return modModificacionService;
  2009. }
  2010.  
  2011. public void setModModificacionService(ModModificacionService modModificacionService) {
  2012. this.modModificacionService = modModificacionService;
  2013. }
  2014.  
  2015. public RenSolicitudRenovacionService getRenSolicitudRenovacionService() {
  2016. return renSolicitudRenovacionService;
  2017. }
  2018.  
  2019. public void setRenSolicitudRenovacionService(RenSolicitudRenovacionService renSolicitudRenovacionService) {
  2020. this.renSolicitudRenovacionService = renSolicitudRenovacionService;
  2021. }
  2022.  
  2023. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement