Commit 3f5a101c213e87ec4a023038f49bbc2af8d7d77a

Authored by Pamela
2 parents b3e646ef 8c30fd40
Exists in master

Merge branch 'correcao-rateio-retidos' into 'master'

Correcao rateio retidos



See merge request !6
Showing 27 changed files with 1927 additions and 751 deletions   Show diff stats
META-INF/application.xml
... ... @@ -872,6 +872,10 @@
872 872 </module>
873 873  
874 874 <module>
  875 + <ejb>ControladorAnaliseGeracaoContaGCOM.jar</ejb>
  876 + </module>
  877 +
  878 + <module>
875 879 <java>gcom.jar</java>
876 880 </module>
877 881  
... ...
descriptors/faturamento/META-INF/ejb-jar.xml 0 → 100644
... ... @@ -0,0 +1,45 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
  3 +<ejb-jar>
  4 + <display-name>Controladores de Faturamento</display-name>
  5 + <ejb-client-jar>ControladoresFaturamento.jar</ejb-client-jar>
  6 + <enterprise-beans>
  7 + <session>
  8 + <display-name>ControladorAnaliseGeracaoContaGCOM</display-name>
  9 + <ejb-name>ControladorAnaliseGeracaoContaGCOM</ejb-name>
  10 + <local-home>gcom.faturamento.controladores.ControladorAnaliseGeracaoContaLocalHome</local-home>
  11 + <local>gcom.faturamento.controladores.ControladorAnaliseGeracaoContaLocal</local>
  12 + <ejb-class>gcom.faturamento.controladores.ControladorAnaliseGeracaoConta</ejb-class>
  13 + <session-type>Stateless</session-type>
  14 + <transaction-type>Container</transaction-type>
  15 + </session>
  16 +
  17 + <session>
  18 + <display-name>ControladorDebitoACobrarGCOM</display-name>
  19 + <ejb-name>ControladorDebitoACobrarGCOM</ejb-name>
  20 + <local-home>gcom.faturamento.controladores.ControladorDebitoACobrarLocalHome</local-home>
  21 + <local>gcom.faturamento.controladores.ControladorDebitoACobrarLocal</local>
  22 + <ejb-class>gcom.faturamento.controladores.ControladorDebitoACobrar</ejb-class>
  23 + <session-type>Stateless</session-type>
  24 + <transaction-type>Container</transaction-type>
  25 + </session>
  26 + </enterprise-beans>
  27 +
  28 + <assembly-descriptor>
  29 + <container-transaction>
  30 + <method>
  31 + <ejb-name>ControladorAnaliseGeracaoContaGCOM</ejb-name>
  32 + <method-name>*</method-name>
  33 + </method>
  34 + <trans-attribute>Required</trans-attribute>
  35 + </container-transaction>
  36 +
  37 + <container-transaction>
  38 + <method>
  39 + <ejb-name>ControladorDebitoACobrarGCOM</ejb-name>
  40 + <method-name>*</method-name>
  41 + </method>
  42 + <trans-attribute>Required</trans-attribute>
  43 + </container-transaction>
  44 + </assembly-descriptor>
  45 +</ejb-jar>
0 46 \ No newline at end of file
... ...
descriptors/faturamento/META-INF/jboss.xml 0 → 100644
... ... @@ -0,0 +1,17 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
  3 +<jboss>
  4 + <enterprise-beans>
  5 + <session>
  6 + <ejb-name>ControladorAnaliseGeracaoContaGCOM</ejb-name>
  7 + <jndi-name>ControladorAnaliseGeracaoContaGCOM</jndi-name>
  8 + <local-jndi-name>ControladorAnaliseGeracaoContaGCOM</local-jndi-name>
  9 + </session>
  10 +
  11 + <session>
  12 + <ejb-name>ControladorDebitoACobrarGCOM</ejb-name>
  13 + <jndi-name>ControladorDebitoACobrarGCOM</jndi-name>
  14 + <local-jndi-name>ControladorDebitoACobrarGCOM</local-jndi-name>
  15 + </session>
  16 + </enterprise-beans>
  17 +</jboss>
0 18 \ No newline at end of file
... ...
src/gcom/arrecadacao/repositorio/RepositorioDevolucao.java 0 → 100644
... ... @@ -0,0 +1,58 @@
  1 +package gcom.arrecadacao.repositorio;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.Collection;
  5 +import java.util.List;
  6 +
  7 +import org.hibernate.Session;
  8 +
  9 +import gcom.arrecadacao.Devolucao;
  10 +import gcom.faturamento.credito.CreditoARealizar;
  11 +import gcom.util.ErroRepositorioException;
  12 +import gcom.util.HibernateUtil;
  13 +
  14 +public class RepositorioDevolucao {
  15 +
  16 + private static RepositorioDevolucao instance;
  17 +
  18 + private RepositorioDevolucao(){}
  19 +
  20 + public static RepositorioDevolucao getInstance(){
  21 + if (instance == null){
  22 + instance = new RepositorioDevolucao();
  23 + }
  24 +
  25 + return instance;
  26 + }
  27 +
  28 + public boolean existeCreditoComDevolucao(Collection<CreditoARealizar> creditosRealizar) throws ErroRepositorioException{
  29 + return !buscarDevolucaoPorCreditoRealizar(creditosRealizar).isEmpty();
  30 + }
  31 +
  32 + @SuppressWarnings("unchecked")
  33 + public Collection<Devolucao> buscarDevolucaoPorCreditoRealizar(Collection<CreditoARealizar> creditosARealizar) throws ErroRepositorioException{
  34 +
  35 + Collection<Devolucao> resultado = new ArrayList<Devolucao>();
  36 +
  37 + Session session = HibernateUtil.getSession();
  38 +
  39 + List<Integer> ids = new ArrayList<Integer>();
  40 +
  41 + for (CreditoARealizar credito : creditosARealizar) {
  42 + ids.add(credito.getId());
  43 + }
  44 +
  45 + try {
  46 + resultado = (Collection<Devolucao>) session.createQuery("select devolucao from Devolucao as devolucao inner join devolucao.creditoRealizar crar "
  47 + + "where crar.id in (:ids)")
  48 + .setParameterList("ids", ids)
  49 + .list();
  50 + } catch (Exception e) {
  51 + throw new ErroRepositorioException(e);
  52 + }finally{
  53 + session.close();
  54 + }
  55 +
  56 + return resultado;
  57 + }
  58 +}
... ...
src/gcom/arrecadacao/repositorio/RepositorioPagamento.java 0 → 100644
... ... @@ -0,0 +1,120 @@
  1 +package gcom.arrecadacao.repositorio;
  2 +
  3 +import java.util.Collection;
  4 +import java.util.List;
  5 +
  6 +import org.hibernate.Session;
  7 +
  8 +import gcom.faturamento.debito.DebitoACobrar;
  9 +import gcom.util.ErroRepositorioException;
  10 +import gcom.util.HibernateUtil;
  11 +
  12 +public class RepositorioPagamento{
  13 +
  14 + private static RepositorioPagamento instance;
  15 +
  16 + private RepositorioPagamento() {}
  17 +
  18 + public static RepositorioPagamento getInstancia() {
  19 + if (instance == null){
  20 + instance = new RepositorioPagamento();
  21 + }
  22 +
  23 + return instance;
  24 + }
  25 +
  26 + public boolean debitoSemPagamento(Integer idDebito) throws ErroRepositorioException{
  27 + Session session = HibernateUtil.getSession();
  28 +
  29 + StringBuilder sql = new StringBuilder();
  30 + sql.append("select count(pg) from Pagamento pg")
  31 + .append(" where pg.debitoACobrarGeral.id = :idDebito");
  32 +
  33 + int count = 0;
  34 +
  35 + try {
  36 + count = (Integer) session.createQuery(sql.toString())
  37 + .setParameter("idDebito", idDebito)
  38 + .uniqueResult();
  39 +
  40 + } catch (Exception e) {
  41 + throw new ErroRepositorioException(e);
  42 + } finally{
  43 + session.close();
  44 + }
  45 +
  46 + return (count == 0) ? true : false;
  47 + }
  48 +
  49 + public boolean guiaPaga(Integer idGuia) throws ErroRepositorioException{
  50 + Session session = HibernateUtil.getSession();
  51 +
  52 + StringBuilder sql = new StringBuilder();
  53 + sql.append("select count(pg) from Pagamento pg")
  54 + .append(" where pg.guiaPagamento.id = :idGuia");
  55 +
  56 + int count = 0;
  57 + try {
  58 +
  59 + count = (Integer) session.createQuery(sql.toString())
  60 + .setParameter("idGuia", idGuia)
  61 + .uniqueResult();
  62 + } catch (Exception e) {
  63 + throw new ErroRepositorioException(e);
  64 + }finally{
  65 + session.close();
  66 + }
  67 +
  68 + return count == 0 ? false: true;
  69 + }
  70 +
  71 + public boolean contaPaga(Integer idConta) throws ErroRepositorioException{
  72 + Session session = HibernateUtil.getSession();
  73 +
  74 + StringBuilder sql = new StringBuilder();
  75 + sql.append("select count(pg) from Pagamento pg")
  76 + .append(" where pg.contaGeral.id = :idConta");
  77 +
  78 + int count = 0;
  79 + try {
  80 + count = (Integer) session.createQuery(sql.toString())
  81 + .setParameter("idConta", idConta)
  82 + .uniqueResult();
  83 + } catch (Exception e) {
  84 + throw new ErroRepositorioException(e);
  85 + }finally{
  86 + session.close();
  87 + }
  88 +
  89 + return count == 0 ? false: true;
  90 + }
  91 +
  92 + public boolean existeDebitoSemPagamento(Collection<DebitoACobrar> debitosCobrar) throws ErroRepositorioException{
  93 + boolean existeDebitoSemPagamento = false;
  94 +
  95 + for (DebitoACobrar debitoCobrar : debitosCobrar) {
  96 + if (debitoSemPagamento(debitoCobrar.getId())){
  97 + existeDebitoSemPagamento = true;
  98 + break;
  99 + }
  100 + }
  101 +
  102 + return existeDebitoSemPagamento;
  103 + }
  104 +
  105 + public void apagarPagamentosDasConta(List<Integer> ids) throws ErroRepositorioException{
  106 + Session session = HibernateUtil.getSession();
  107 +
  108 + String delete = "update arrecadacao.pagamento set cnta_id = null where cnta_id in (:ids)";
  109 +
  110 + try {
  111 + session.createSQLQuery(delete)
  112 + .setParameter("ids", ids)
  113 + .executeUpdate();
  114 + } catch (Exception e) {
  115 + throw new ErroRepositorioException(e);
  116 + }finally{
  117 + session.close();
  118 + }
  119 + }
  120 +}
... ...
src/gcom/atendimentopublico/ligacaoagua/LigacaoAgua.java
1 1 package gcom.atendimentopublico.ligacaoagua;
2 2  
  3 +import java.util.Date;
  4 +import java.util.Set;
  5 +
  6 +import org.apache.commons.lang.builder.ToStringBuilder;
  7 +
3 8 import gcom.atendimentopublico.LigacaoOrigem;
4 9 import gcom.atendimentopublico.ordemservico.SupressaoMotivo;
5 10 import gcom.cadastro.imovel.Imovel;
... ... @@ -9,11 +14,6 @@ import gcom.micromedicao.hidrometro.HidrometroInstalacaoHistorico;
9 14 import gcom.util.filtro.Filtro;
10 15 import gcom.util.filtro.ParametroSimples;
11 16  
12   -import java.util.Date;
13   -import java.util.Set;
14   -
15   -import org.apache.commons.lang.builder.ToStringBuilder;
16   -
17 17 @ControleAlteracao
18 18 public class LigacaoAgua extends ObjetoTransacao {
19 19  
... ... @@ -417,4 +417,12 @@ public class LigacaoAgua extends ObjetoTransacao {
417 417 public void setMedicaoHistoricos(Set medicaoHistoricos) {
418 418 this.medicaoHistoricos = medicaoHistoricos;
419 419 }
  420 +
  421 + public boolean existeHidrometroInstalado() {
  422 + boolean existe = false;
  423 + if (hidrometroInstalacaoHistorico != null) {
  424 + existe = hidrometroInstalacaoHistorico.getDataRetirada() == null;
  425 + }
  426 + return existe;
  427 + }
420 428 }
... ...
src/gcom/cadastro/imovel/Imovel.java
1 1 package gcom.cadastro.imovel;
2 2  
  3 +import java.math.BigDecimal;
  4 +import java.util.Date;
  5 +import java.util.Iterator;
  6 +import java.util.Set;
  7 +
  8 +import org.apache.commons.lang.builder.HashCodeBuilder;
  9 +
3 10 import gcom.atendimentopublico.ligacaoagua.LigacaoAgua;
4 11 import gcom.atendimentopublico.ligacaoagua.LigacaoAguaSituacao;
5 12 import gcom.atendimentopublico.ligacaoesgoto.LigacaoEsgoto;
... ... @@ -20,6 +27,7 @@ import gcom.cadastro.localidade.SetorComercial;
20 27 import gcom.cadastro.tarifasocial.TarifaSocialDadoEconomia;
21 28 import gcom.cobranca.CobrancaSituacao;
22 29 import gcom.cobranca.CobrancaSituacaoTipo;
  30 +import gcom.enums.Status;
23 31 import gcom.faturamento.FaturamentoSituacaoMotivo;
24 32 import gcom.faturamento.FaturamentoSituacaoTipo;
25 33 import gcom.faturamento.FaturamentoTipo;
... ... @@ -38,14 +46,6 @@ import gcom.util.ConstantesSistema;
38 46 import gcom.util.filtro.Filtro;
39 47 import gcom.util.filtro.ParametroSimples;
40 48  
41   -import java.math.BigDecimal;
42   -import java.util.Date;
43   -import java.util.Iterator;
44   -import java.util.Set;
45   -
46   -import org.apache.commons.lang.builder.HashCodeBuilder;
47   -import org.apache.commons.lang.builder.ToStringBuilder;
48   -
49 49 @ControleAlteracao()
50 50 public class Imovel extends ObjetoTransacao implements IImovel {
51 51  
... ... @@ -2299,4 +2299,89 @@ public class Imovel extends ObjetoTransacao implements IImovel {
2299 2299  
2300 2300 public void setHidrometroMarca(HidrometroMarca hidrometroMarca) {
2301 2301 }
  2302 +
  2303 + public boolean existeHidrometro() {
  2304 + return existeHidrometroAgua() || existeHidrometroPoco();
  2305 + }
  2306 +
  2307 + public boolean existeHidrometroAgua() {
  2308 + return ligacaoAgua != null && ligacaoAgua.getHidrometroInstalacaoHistorico() != null && ligacaoAgua.existeHidrometroInstalado();
  2309 + }
  2310 +
  2311 + public boolean existeHidrometroPoco() {
  2312 + return hidrometroInstalacaoHistorico != null;
  2313 + }
  2314 +
  2315 + public boolean possuiEsgoto() {
  2316 + return ligacaoEsgoto != null;
  2317 + }
  2318 +
  2319 + public boolean esgotoLigado() {
  2320 + return ligacaoEsgotoSituacao.getId().equals(LigacaoEsgotoSituacao.LIGADO);
  2321 + }
  2322 +
  2323 + public boolean pertenceACondominio() {
  2324 + return imovelCondominio != null;
  2325 + }
  2326 +
  2327 + public boolean isCondominio() {
  2328 + return indicadorImovelCondominio != null && indicadorImovelCondominio == Status.ATIVO.getId();
  2329 + }
  2330 +
  2331 + public boolean faturamentoEsgotoAtivo() {
  2332 + return ligacaoEsgotoSituacao != null && ligacaoEsgotoSituacao.getIndicadorFaturamentoSituacao() != null
  2333 + && ligacaoEsgotoSituacao.getIndicadorFaturamentoSituacao().shortValue() == Status.ATIVO.getId();
  2334 + }
  2335 +
  2336 + public boolean faturamentoAguaAtivo() {
  2337 + return ligacaoAguaSituacao != null && ligacaoAguaSituacao.getIndicadorFaturamentoSituacao() != null
  2338 + && ligacaoAguaSituacao.getIndicadorFaturamentoSituacao().shortValue() == Status.ATIVO.getId();
  2339 + }
  2340 +
  2341 + public boolean paralisacaoFaturamento() {
  2342 + return faturamentoSituacaoTipo != null && faturamentoSituacaoTipo.getIndicadorParalisacaoFaturamento() == Status.ATIVO.getId();
  2343 + }
  2344 +
  2345 + public boolean faturamentoAguaValido() {
  2346 + return faturamentoSituacaoTipo != null && faturamentoSituacaoTipo.getIndicadorValidoAgua() == Status.ATIVO.getId();
  2347 + }
  2348 +
  2349 + public boolean aguaLigada() {
  2350 + return ligacaoAguaSituacao.getId().equals(LigacaoAguaSituacao.LIGADO);
  2351 + }
  2352 +
  2353 + public boolean useNovaChecagemGerarConta(){
  2354 + int [] ids = new int[]{7814933,7814950
  2355 + ,7815085,7815093,7816723,7814852,7814836,7815735,7815530,7815549
  2356 + ,7815557,7814259,7815611,7815654,7814291,7814321,7815026,7814410
  2357 + ,7815034,7814488,7814798,7814283,7814305,7814313,7814364,7814330
  2358 + ,7814380,7814356,7814402,7814461,7814470,7814542,7814550,7814810
  2359 + ,7814860,7814879,7814887,7814925,7815042,7814968,7814976,7815000
  2360 + ,7815050,7815522,7815620,7815670,7815689,7815743,7814275,7814607
  2361 + ,7814429,7814496,7814526,7814569,7814941,7814984,7815069,7815484
  2362 + ,7815492,7815506,7816634,7815565,7815697,7815719,7816626,7814437
  2363 + ,7815514,7814828,7814844,7816618,7815573,7816642,7816650,7814909
  2364 + ,7814453,7814917,7814267,7814240,7815727,7814348,7814399,7814534
  2365 + ,7814895,7814500,
  2366 + 7627750 ,7629028,7629737,7628200,7629400,7629672,7629150,7629699
  2367 + ,7628137,7628129,7630034,7630000,7629974,7629958,7628960,7627718
  2368 + ,7627530,7627521,7627742,7628773,7628714,7628676,7628668,7628978
  2369 + ,7629524,7627513,7629427,7629451,7629494,7629540,7629575,7629591
  2370 + ,7629605,7629613,7629320,7629346,7629362,7628234,7629753,7629761
  2371 + ,7629770,7629796,7629818,7629842,7629877,7629745,7629907,7629923
  2372 + ,7628927,7628900,7628889,7629559,7629621,7629630,7629648,7629664
  2373 + ,7627483,7629702,7629710,7629729,7629087,7629109,7629168,7629370
  2374 + ,7630050,7629460,7629486,7627475,7629516,7629044,7628994,7628838
  2375 + ,7628862,7628811,7628803,7629303,7628242,7628226,7628218,7628188
  2376 + ,7628170,7628161,7628153,7628145,7628943,7627700,7628609,7629443
  2377 + ,7627491,7629311};
  2378 +
  2379 + for (int i =0; i< ids.length; i++){
  2380 + if (ids[i] == id.intValue()){
  2381 + return true;
  2382 + }
  2383 + }
  2384 +
  2385 + return false;
  2386 + }
2302 2387 }
... ...
src/gcom/enums/Status.java 0 → 100644
... ... @@ -0,0 +1,26 @@
  1 +package gcom.enums;
  2 +
  3 +public enum Status {
  4 + ATIVO( (short) 1), INATIVO( (short) 2);
  5 +
  6 + private short id;
  7 +
  8 + Status(short s){
  9 + this.id = s;
  10 + }
  11 +
  12 + public short getId(){
  13 + return id;
  14 + }
  15 +
  16 + public static Status parse(short id) {
  17 + Status status = null;
  18 + for (Status item : Status.values()) {
  19 + if (item.getId() == id) {
  20 + status = item;
  21 + break;
  22 + }
  23 + }
  24 + return status;
  25 + }
  26 +}
0 27 \ No newline at end of file
... ...
src/gcom/faturamento/ControladorFaturamentoFINAL.java
1 1 package gcom.faturamento;
2 2  
  3 +import java.io.BufferedReader;
  4 +import java.io.BufferedWriter;
  5 +import java.io.File;
  6 +import java.io.FileOutputStream;
  7 +import java.io.IOException;
  8 +import java.io.InputStreamReader;
  9 +import java.io.OutputStreamWriter;
  10 +import java.math.BigDecimal;
  11 +import java.math.RoundingMode;
  12 +import java.text.DateFormat;
  13 +import java.text.ParseException;
  14 +import java.text.SimpleDateFormat;
  15 +import java.util.ArrayList;
  16 +import java.util.Calendar;
  17 +import java.util.Collection;
  18 +import java.util.Collections;
  19 +import java.util.Comparator;
  20 +import java.util.Date;
  21 +import java.util.GregorianCalendar;
  22 +import java.util.HashMap;
  23 +import java.util.HashSet;
  24 +import java.util.Iterator;
  25 +import java.util.LinkedHashMap;
  26 +import java.util.List;
  27 +import java.util.ListIterator;
  28 +import java.util.Map;
  29 +import java.util.Set;
  30 +import java.util.Vector;
  31 +import java.util.zip.ZipOutputStream;
  32 +
  33 +import javax.ejb.CreateException;
  34 +import javax.ejb.EJBException;
  35 +import javax.ejb.SessionContext;
  36 +
  37 +import org.apache.commons.fileupload.FileItem;
  38 +import org.jboss.logging.Logger;
  39 +
  40 +import br.com.danhil.BarCode.Interleaved2of5;
3 41 import gcom.arrecadacao.ContratoDemanda;
4   -import gcom.arrecadacao.ControladorArrecadacaoLocal;
5   -import gcom.arrecadacao.ControladorArrecadacaoLocalHome;
6 42 import gcom.arrecadacao.Devolucao;
7 43 import gcom.arrecadacao.FiltroDevolucao;
8 44 import gcom.arrecadacao.IRepositorioArrecadacao;
... ... @@ -20,35 +56,23 @@ import gcom.arrecadacao.pagamento.GuiaPagamentoItem;
20 56 import gcom.arrecadacao.pagamento.GuiaPagamentoItemPK;
21 57 import gcom.arrecadacao.pagamento.Pagamento;
22 58 import gcom.arrecadacao.pagamento.PagamentoHistorico;
23   -import gcom.atendimentopublico.ControladorAtendimentoPublicoLocal;
24   -import gcom.atendimentopublico.ControladorAtendimentoPublicoLocalHome;
25   -import gcom.atendimentopublico.ligacaoagua.ControladorLigacaoAguaLocal;
26   -import gcom.atendimentopublico.ligacaoagua.ControladorLigacaoAguaLocalHome;
27 59 import gcom.atendimentopublico.ligacaoagua.FiltroLigacaoAguaSituacao;
28 60 import gcom.atendimentopublico.ligacaoagua.LigacaoAgua;
29 61 import gcom.atendimentopublico.ligacaoagua.LigacaoAguaSituacao;
30 62 import gcom.atendimentopublico.ligacaoagua.LigacaoAguaSituacaoConsumoTipo;
31   -import gcom.atendimentopublico.ligacaoesgoto.ControladorLigacaoEsgotoLocal;
32   -import gcom.atendimentopublico.ligacaoesgoto.ControladorLigacaoEsgotoLocalHome;
33 63 import gcom.atendimentopublico.ligacaoesgoto.FiltroLigacaoEsgotoSituacao;
34 64 import gcom.atendimentopublico.ligacaoesgoto.LigacaoEsgoto;
35 65 import gcom.atendimentopublico.ligacaoesgoto.LigacaoEsgotoSituacao;
36 66 import gcom.atendimentopublico.ligacaoesgoto.LigacaoEsgotoSituacaoConsumoTipo;
37 67 import gcom.atendimentopublico.ordemservico.FiltroOrdemServico;
38 68 import gcom.atendimentopublico.ordemservico.OrdemServico;
39   -import gcom.atendimentopublico.registroatendimento.ControladorRegistroAtendimentoLocal;
40   -import gcom.atendimentopublico.registroatendimento.ControladorRegistroAtendimentoLocalHome;
41 69 import gcom.atendimentopublico.registroatendimento.EspecificacaoTipoValidacao;
42 70 import gcom.atendimentopublico.registroatendimento.FiltroRegistroAtendimento;
43 71 import gcom.atendimentopublico.registroatendimento.FiltroRegistroAtendimentoSolicitante;
44 72 import gcom.atendimentopublico.registroatendimento.RegistroAtendimento;
45 73 import gcom.atendimentopublico.registroatendimento.RegistroAtendimentoSolicitante;
46   -import gcom.batch.ControladorBatchLocal;
47   -import gcom.batch.ControladorBatchLocalHome;
48 74 import gcom.batch.RepositorioBatchHBM;
49 75 import gcom.batch.UnidadeProcessamento;
50   -import gcom.cadastro.ControladorCadastroLocal;
51   -import gcom.cadastro.ControladorCadastroLocalHome;
52 76 import gcom.cadastro.EnvioEmail;
53 77 import gcom.cadastro.IRepositorioCadastro;
54 78 import gcom.cadastro.RepositorioCadastroHBM;
... ... @@ -59,8 +83,6 @@ import gcom.cadastro.cliente.ClienteGuiaPagamento;
59 83 import gcom.cadastro.cliente.ClienteImovel;
60 84 import gcom.cadastro.cliente.ClienteRelacaoTipo;
61 85 import gcom.cadastro.cliente.ClienteTipo;
62   -import gcom.cadastro.cliente.ControladorClienteLocal;
63   -import gcom.cadastro.cliente.ControladorClienteLocalHome;
64 86 import gcom.cadastro.cliente.EsferaPoder;
65 87 import gcom.cadastro.cliente.FiltroCliente;
66 88 import gcom.cadastro.cliente.FiltroClienteGuiaPagamento;
... ... @@ -70,13 +92,9 @@ import gcom.cadastro.cliente.IClienteConta;
70 92 import gcom.cadastro.cliente.IRepositorioClienteImovel;
71 93 import gcom.cadastro.cliente.RepositorioClienteImovelHBM;
72 94 import gcom.cadastro.empresa.Empresa;
73   -import gcom.cadastro.endereco.ControladorEnderecoLocal;
74   -import gcom.cadastro.endereco.ControladorEnderecoLocalHome;
75 95 import gcom.cadastro.endereco.Logradouro;
76 96 import gcom.cadastro.endereco.LogradouroBairro;
77 97 import gcom.cadastro.geografico.Bairro;
78   -import gcom.cadastro.geografico.ControladorGeograficoLocal;
79   -import gcom.cadastro.geografico.ControladorGeograficoLocalHome;
80 98 import gcom.cadastro.imovel.Categoria;
81 99 import gcom.cadastro.imovel.ControladorImovelLocal;
82 100 import gcom.cadastro.imovel.ControladorImovelLocalHome;
... ... @@ -93,8 +111,6 @@ import gcom.cadastro.imovel.RepositorioImovelHBM;
93 111 import gcom.cadastro.imovel.Subcategoria;
94 112 import gcom.cadastro.imovel.bean.EmitirConsumoImovelCondominimoHelper;
95 113 import gcom.cadastro.imovel.bean.ImovelMicromedicao;
96   -import gcom.cadastro.localidade.ControladorLocalidadeLocal;
97   -import gcom.cadastro.localidade.ControladorLocalidadeLocalHome;
98 114 import gcom.cadastro.localidade.FiltroGerenciaRegional;
99 115 import gcom.cadastro.localidade.FiltroLocalidade;
100 116 import gcom.cadastro.localidade.FiltroQuadra;
... ... @@ -116,8 +132,6 @@ import gcom.cobranca.CobrancaDocumentoItem;
116 132 import gcom.cobranca.CobrancaForma;
117 133 import gcom.cobranca.CobrancaSituacao;
118 134 import gcom.cobranca.ComandoEmpresaCobrancaContaHelper;
119   -import gcom.cobranca.ControladorCobrancaLocal;
120   -import gcom.cobranca.ControladorCobrancaLocalHome;
121 135 import gcom.cobranca.DocumentoTipo;
122 136 import gcom.cobranca.EmpresaCobrancaConta;
123 137 import gcom.cobranca.FiltroCobrancaDocumentoItem;
... ... @@ -129,8 +143,6 @@ import gcom.cobranca.bean.ContaValoresHelper;
129 143 import gcom.cobranca.bean.GuiaPagamentoValoresHelper;
130 144 import gcom.cobranca.bean.ObterDebitoImovelOuClienteHelper;
131 145 import gcom.cobranca.contratoparcelamento.ContratoParcelamentoItem;
132   -import gcom.cobranca.contratoparcelamento.ControladorContratoParcelamentoLocal;
133   -import gcom.cobranca.contratoparcelamento.ControladorContratoParcelamentoLocalHome;
134 146 import gcom.cobranca.contratoparcelamento.FiltroContratoParcelamentoItem;
135 147 import gcom.cobranca.parcelamento.Parcelamento;
136 148 import gcom.cobranca.parcelamento.ParcelamentoSituacao;
... ... @@ -243,8 +255,8 @@ import gcom.faturamento.debito.FiltroDebitoACobrarGeral;
243 255 import gcom.faturamento.debito.FiltroDebitoTipo;
244 256 import gcom.faturamento.debito.FiltroDebitoTipoVigencia;
245 257 import gcom.faturamento.debito.IDebitoCobrado;
246   -import gcom.financeiro.ControladorFinanceiroLocal;
247   -import gcom.financeiro.ControladorFinanceiroLocalHome;
  258 +import gcom.faturamento.repositorio.RepositorioFaturamentoSituacao;
  259 +import gcom.faturamento.repositorio.RepositorioFaturamentoSituacaoTipo;
248 260 import gcom.financeiro.FinanciamentoTipo;
249 261 import gcom.financeiro.ResumoFaturamento;
250 262 import gcom.financeiro.lancamento.LancamentoItem;
... ... @@ -283,8 +295,6 @@ import gcom.micromedicao.medicao.FiltroMedicaoHistoricoSql;
283 295 import gcom.micromedicao.medicao.MedicaoHistorico;
284 296 import gcom.micromedicao.medicao.MedicaoTipo;
285 297 import gcom.relatorio.faturamento.ConsumoTarifaRelatorioHelper;
286   -import gcom.relatorio.faturamento.ControladorRelatorioFaturamentoLocal;
287   -import gcom.relatorio.faturamento.ControladorRelatorioFaturamentoLocalHome;
288 298 import gcom.relatorio.faturamento.FaturamentoLigacoesMedicaoIndividualizadaRelatorioHelper;
289 299 import gcom.relatorio.faturamento.RelatorioAnaliticoFaturamentoHelper;
290 300 import gcom.relatorio.faturamento.RelatorioFaturaClienteResponsavel;
... ... @@ -296,11 +306,7 @@ import gcom.relatorio.faturamento.conta.ContaLinhasDescricaoServicosTarifasTotal
296 306 import gcom.relatorio.faturamento.conta.ContasEmitidasRelatorioHelper;
297 307 import gcom.relatorio.faturamento.conta.RelatorioContasCanceladasRetificadasHelper;
298 308 import gcom.relatorio.faturamento.conta.RelatorioMapaControleConta;
299   -import gcom.seguranca.ControladorPermissaoEspecialLocal;
300   -import gcom.seguranca.ControladorPermissaoEspecialLocalHome;
301 309 import gcom.seguranca.acesso.Abrangencia;
302   -import gcom.seguranca.acesso.ControladorAcessoLocal;
303   -import gcom.seguranca.acesso.ControladorAcessoLocalHome;
304 310 import gcom.seguranca.acesso.Funcionalidade;
305 311 import gcom.seguranca.acesso.Operacao;
306 312 import gcom.seguranca.acesso.OperacaoEfetuada;
... ... @@ -310,12 +316,11 @@ import gcom.seguranca.acesso.usuario.UsuarioAcao;
310 316 import gcom.seguranca.acesso.usuario.UsuarioAcaoUsuarioHelper;
311 317 import gcom.seguranca.transacao.ControladorTransacaoLocal;
312 318 import gcom.seguranca.transacao.ControladorTransacaoLocalHome;
313   -import gcom.spcserasa.ControladorSpcSerasaLocal;
314   -import gcom.spcserasa.ControladorSpcSerasaLocalHome;
315 319 import gcom.tarefa.TarefaRelatorio;
316 320 import gcom.util.Calculos;
317 321 import gcom.util.ConstantesJNDI;
318 322 import gcom.util.ConstantesSistema;
  323 +import gcom.util.ControladorComum;
319 324 import gcom.util.ControladorException;
320 325 import gcom.util.ControladorUtilLocal;
321 326 import gcom.util.ControladorUtilLocalHome;
... ... @@ -337,47 +342,7 @@ import gcom.util.filtro.ParametroNulo;
337 342 import gcom.util.filtro.ParametroSimples;
338 343 import gcom.util.filtro.ParametroSimplesDiferenteDe;
339 344  
340   -import java.io.BufferedReader;
341   -import java.io.BufferedWriter;
342   -import java.io.File;
343   -import java.io.FileOutputStream;
344   -import java.io.IOException;
345   -import java.io.InputStreamReader;
346   -import java.io.OutputStreamWriter;
347   -import java.math.BigDecimal;
348   -import java.math.RoundingMode;
349   -import java.text.DateFormat;
350   -import java.text.ParseException;
351   -import java.text.SimpleDateFormat;
352   -import java.util.ArrayList;
353   -import java.util.Calendar;
354   -import java.util.Collection;
355   -import java.util.Collections;
356   -import java.util.Comparator;
357   -import java.util.Date;
358   -import java.util.GregorianCalendar;
359   -import java.util.HashMap;
360   -import java.util.HashSet;
361   -import java.util.Iterator;
362   -import java.util.LinkedHashMap;
363   -import java.util.List;
364   -import java.util.ListIterator;
365   -import java.util.Map;
366   -import java.util.Set;
367   -import java.util.Vector;
368   -import java.util.zip.ZipOutputStream;
369   -
370   -import javax.ejb.CreateException;
371   -import javax.ejb.EJBException;
372   -import javax.ejb.SessionBean;
373   -import javax.ejb.SessionContext;
374   -
375   -import org.apache.commons.fileupload.FileItem;
376   -import org.jboss.logging.Logger;
377   -
378   -import br.com.danhil.BarCode.Interleaved2of5;
379   -
380   -public class ControladorFaturamentoFINAL implements SessionBean {
  345 +public class ControladorFaturamentoFINAL extends ControladorComum {
381 346  
382 347 private static final long serialVersionUID = 1L;
383 348  
... ... @@ -392,6 +357,8 @@ public class ControladorFaturamentoFINAL implements SessionBean {
392 357 protected IRepositorioClienteImovel repositorioClienteImovel;
393 358 protected IRepositorioCadastro repositorioCadastro;
394 359 protected IRepositorioImovel repositorioImovel;
  360 + protected RepositorioFaturamentoSituacao repositorioFaturamentoSituacao;
  361 + protected RepositorioFaturamentoSituacaoTipo repositorioFaturamentoSituacaoTipo;
395 362  
396 363 private static Logger logger = Logger.getLogger(ControladorFaturamentoFINAL.class);
397 364  
... ... @@ -405,6 +372,8 @@ public class ControladorFaturamentoFINAL implements SessionBean {
405 372 repositorioClienteImovel = RepositorioClienteImovelHBM.getInstancia();
406 373 repositorioCadastro = RepositorioCadastroHBM.getInstancia();
407 374 repositorioImovel = RepositorioImovelHBM.getInstancia();
  375 + repositorioFaturamentoSituacao = RepositorioFaturamentoSituacao.getInstance();
  376 + repositorioFaturamentoSituacaoTipo = RepositorioFaturamentoSituacaoTipo.getInstance();
408 377 }
409 378  
410 379 public Integer informarConsumoMinimoParametro(
... ... @@ -485,506 +454,9 @@ public class ControladorFaturamentoFINAL implements SessionBean {
485 454 this.sessionContext = sessionContext;
486 455 }
487 456  
488   - private ControladorRegistroAtendimentoLocal getControladorRegistroAtendimento() {
489   - ControladorRegistroAtendimentoLocalHome localHome = null;
490   - ControladorRegistroAtendimentoLocal local = null;
491   -
492   - // pega a instância do ServiceLocator.
493 457  
494   - ServiceLocator locator = null;
495 458  
496   - try {
497   - locator = ServiceLocator.getInstancia();
498   - localHome = (ControladorRegistroAtendimentoLocalHome) locator
499   - .getLocalHome(ConstantesJNDI.CONTROLADOR_REGISTRO_ATENDIMENTO_SEJB);
500   - // guarda a referencia de um objeto capaz de fazer chamadas à
501   - // objetos remotamente
502   - local = localHome.create();
503 459  
504   - return local;
505   - } catch (CreateException e) {
506   - throw new SistemaException(e);
507   - } catch (ServiceLocatorException e) {
508   - throw new SistemaException(e);
509   - }
510   - }
511   -
512   - /**
513   - * Retorna o valor de controladorLocalidade
514   - *
515   - * @return O valor de controladorLocalidade
516   - */
517   - private ControladorLocalidadeLocal getControladorLocalidade() {
518   - ControladorLocalidadeLocalHome localHome = null;
519   - ControladorLocalidadeLocal local = null;
520   -
521   - // pega a instância do ServiceLocator.
522   -
523   - ServiceLocator locator = null;
524   -
525   - try {
526   - locator = ServiceLocator.getInstancia();
527   - localHome = (ControladorLocalidadeLocalHome) locator
528   - .getLocalHome(ConstantesJNDI.CONTROLADOR_LOCALIDADE_SEJB);
529   - // guarda a referencia de um objeto capaz de fazer chamadas à
530   - // objetos remotamente
531   - local = localHome.create();
532   -
533   - return local;
534   - } catch (CreateException e) {
535   - throw new SistemaException(e);
536   - } catch (ServiceLocatorException e) {
537   - throw new SistemaException(e);
538   - }
539   - }
540   -
541   - /**
542   - * Retorna o valor de controladorSpcSerasa
543   - *
544   - * @return O valor de controladorSpcSerasa
545   - */
546   - private ControladorSpcSerasaLocal getControladorSpcSerasa() {
547   - ControladorSpcSerasaLocalHome localHome = null;
548   - ControladorSpcSerasaLocal local = null;
549   -
550   - // pega a instância do ServiceLocator.
551   -
552   - ServiceLocator locator = null;
553   -
554   - try {
555   - locator = ServiceLocator.getInstancia();
556   - localHome = (ControladorSpcSerasaLocalHome) locator
557   - .getLocalHome(ConstantesJNDI.CONTROLADOR_SPC_SERASA_SEJB);
558   - // guarda a referencia de um objeto capaz de fazer chamadas à
559   - // objetos remotamente
560   - local = localHome.create();
561   -
562   - return local;
563   - } catch (CreateException e) {
564   - throw new SistemaException(e);
565   - } catch (ServiceLocatorException e) {
566   - throw new SistemaException(e);
567   - }
568   - }
569   -
570   - private ControladorLigacaoAguaLocal getControladorLigacaoAgua() {
571   - ControladorLigacaoAguaLocalHome localHome = null;
572   - ControladorLigacaoAguaLocal local = null;
573   -
574   - // pega a instância do ServiceLocator.
575   -
576   - ServiceLocator locator = null;
577   -
578   - try {
579   - locator = ServiceLocator.getInstancia();
580   - localHome = (ControladorLigacaoAguaLocalHome) locator
581   - .getLocalHome(ConstantesJNDI.CONTROLADOR_LIGACAO_AGUA_SEJB);
582   - // guarda a referencia de um objeto capaz de fazer chamadas à
583   - // objetos remotamente
584   - local = localHome.create();
585   -
586   - return local;
587   - } catch (CreateException e) {
588   - throw new SistemaException(e);
589   - } catch (ServiceLocatorException e) {
590   - throw new SistemaException(e);
591   - }
592   - }
593   -
594   - private ControladorLigacaoEsgotoLocal getControladorLigacaoEsgoto() {
595   - ControladorLigacaoEsgotoLocalHome localHome = null;
596   - ControladorLigacaoEsgotoLocal local = null;
597   -
598   - // pega a instância do ServiceLocator.
599   -
600   - ServiceLocator locator = null;
601   -
602   - try {
603   - locator = ServiceLocator.getInstancia();
604   - localHome = (ControladorLigacaoEsgotoLocalHome) locator
605   - .getLocalHome(ConstantesJNDI.CONTROLADOR_LIGACAO_ESGOTO_SEJB);
606   - // guarda a referencia de um objeto capaz de fazer chamadas à
607   - // objetos remotamente
608   - local = localHome.create();
609   -
610   - return local;
611   - } catch (CreateException e) {
612   - throw new SistemaException(e);
613   - } catch (ServiceLocatorException e) {
614   - throw new SistemaException(e);
615   - }
616   - }
617   -
618   - /**
619   - * Retorna o valor de ControladorAtendimentoPublico
620   - *
621   - * @return O valor de ControladorAtendimentoPublico
622   - */
623   - protected ControladorAtendimentoPublicoLocal getControladorAtendimentoPublico() {
624   - ControladorAtendimentoPublicoLocalHome localHome = null;
625   - ControladorAtendimentoPublicoLocal local = null;
626   -
627   - // pega a instância do ServiceLocator.
628   -
629   - ServiceLocator locator = null;
630   -
631   - try {
632   - locator = ServiceLocator.getInstancia();
633   - localHome = (ControladorAtendimentoPublicoLocalHome) locator
634   - .getLocalHome(ConstantesJNDI.CONTROLADOR_ATENDIMENTO_PUBLICO_SEJB);
635   - // guarda a referencia de um objeto capaz de fazer chamadas à
636   - // objetos remotamente
637   - local = localHome.create();
638   -
639   - return local;
640   - } catch (CreateException e) {
641   - throw new SistemaException(e);
642   - } catch (ServiceLocatorException e) {
643   - throw new SistemaException(e);
644   - }
645   - }
646   -
647   - /**
648   - * Retorna o valor de controladorAcesso
649   - *
650   - * @return O valor de controladorAcesso
651   - */
652   - protected ControladorAcessoLocal getControladorAcesso() {
653   - ControladorAcessoLocalHome localHome = null;
654   - ControladorAcessoLocal local = null;
655   -
656   - // pega a instância do ServiceLocator.
657   -
658   - ServiceLocator locator = null;
659   -
660   - try {
661   - locator = ServiceLocator.getInstancia();
662   -
663   - localHome = (ControladorAcessoLocalHome) locator
664   - .getLocalHome(ConstantesJNDI.CONTROLADOR_ACESSO_SEJB);
665   - // guarda a referencia de um objeto capaz de fazer chamadas à
666   - // objetos remotamente
667   - local = localHome.create();
668   -
669   - return local;
670   - } catch (CreateException e) {
671   - throw new SistemaException(e);
672   - } catch (ServiceLocatorException e) {
673   - throw new SistemaException(e);
674   - }
675   - }
676   -
677   - protected ControladorFinanceiroLocal getControladorFinanceiro() {
678   - ControladorFinanceiroLocalHome localHome = null;
679   - ControladorFinanceiroLocal local = null;
680   -
681   - // pega a instância do ServiceLocator.
682   -
683   - ServiceLocator locator = null;
684   -
685   - try {
686   - locator = ServiceLocator.getInstancia();
687   -
688   - localHome = (ControladorFinanceiroLocalHome) locator
689   - .getLocalHomePorEmpresa(ConstantesJNDI.CONTROLADOR_FINANCEIRO_SEJB);
690   - // guarda a referencia de um objeto capaz de fazer chamadas à
691   - // objetos remotamente
692   - local = localHome.create();
693   -
694   - return local;
695   - } catch (CreateException e) {
696   - throw new SistemaException(e);
697   - } catch (ServiceLocatorException e) {
698   - throw new SistemaException(e);
699   - }
700   - }
701   -
702   - protected ControladorArrecadacaoLocal getControladorArrecadacao() {
703   - ControladorArrecadacaoLocalHome localHome = null;
704   - ControladorArrecadacaoLocal local = null;
705   -
706   - // pega a instância do ServiceLocator.
707   -
708   - ServiceLocator locator = null;
709   -
710   - try {
711   - locator = ServiceLocator.getInstancia();
712   -
713   - localHome = (ControladorArrecadacaoLocalHome) locator
714   - .getLocalHomePorEmpresa(ConstantesJNDI.CONTROLADOR_ARRECADACAO_SEJB);
715   -
716   - local = localHome.create();
717   -
718   - return local;
719   - } catch (CreateException e) {
720   - throw new SistemaException(e);
721   - } catch (ServiceLocatorException e) {
722   - throw new SistemaException(e);
723   - }
724   - }
725   -
726   - protected ControladorCobrancaLocal getControladorCobranca() {
727   - ControladorCobrancaLocalHome localHome = null;
728   - ControladorCobrancaLocal local = null;
729   -
730   - // pega a instância do ServiceLocator.
731   -
732   - ServiceLocator locator = null;
733   -
734   - try {
735   - locator = ServiceLocator.getInstancia();
736   -
737   - localHome = (ControladorCobrancaLocalHome) locator
738   - .getLocalHomePorEmpresa(ConstantesJNDI.CONTROLADOR_COBRANCA_SEJB);
739   - // guarda a referencia de um objeto capaz de fazer chamadas à
740   - // objetos remotamente
741   - local = localHome.create();
742   -
743   - return local;
744   - } catch (CreateException e) {
745   - throw new SistemaException(e);
746   - } catch (ServiceLocatorException e) {
747   - throw new SistemaException(e);
748   - }
749   - }
750   -
751   - /**
752   - * Retorna o valor de controladorEndereco
753   - *
754   - * @return O valor de controladorEndereco
755   - */
756   - protected ControladorEnderecoLocal getControladorEndereco() {
757   - ControladorEnderecoLocalHome localHome = null;
758   - ControladorEnderecoLocal local = null;
759   -
760   - // pega a instância do ServiceLocator.
761   -
762   - ServiceLocator locator = null;
763   -
764   - try {
765   - locator = ServiceLocator.getInstancia();
766   -
767   - localHome = (ControladorEnderecoLocalHome) locator
768   - .getLocalHome(ConstantesJNDI.CONTROLADOR_ENDERECO_SEJB);
769   - // guarda a referencia de um objeto capaz de fazer chamadas à
770   - // objetos remotamente
771   - local = localHome.create();
772   -
773   - return local;
774   - } catch (CreateException e) {
775   - throw new SistemaException(e);
776   - } catch (ServiceLocatorException e) {
777   - throw new SistemaException(e);
778   - }
779   -
780   - }
781   -
782   - /**
783   - * Retorna o valor de controladorCliente
784   - *
785   - * @return O valor de controladorCliente
786   - */
787   - protected ControladorClienteLocal getControladorCliente() {
788   - ControladorClienteLocalHome localHome = null;
789   - ControladorClienteLocal local = null;
790   -
791   - // pega a instância do ServiceLocator.
792   -
793   - ServiceLocator locator = null;
794   -
795   - try {
796   - locator = ServiceLocator.getInstancia();
797   -
798   - localHome = (ControladorClienteLocalHome) locator
799   - .getLocalHome(ConstantesJNDI.CONTROLADOR_CLIENTE_SEJB);
800   - // guarda a referencia de um objeto capaz de fazer chamadas à
801   - // objetos remotamente
802   - local = localHome.create();
803   -
804   - return local;
805   - } catch (CreateException e) {
806   - throw new SistemaException(e);
807   - } catch (ServiceLocatorException e) {
808   - throw new SistemaException(e);
809   - }
810   -
811   - }
812   -
813   - /**
814   - * Retorna o valor de ControladorGeograficoLocal
815   - *
816   - * @return O valor de ControladorGeograficoLocal
817   - */
818   - protected ControladorGeograficoLocal getControladorGeografico() {
819   -
820   - ControladorGeograficoLocalHome localHome = null;
821   - ControladorGeograficoLocal local = null;
822   -
823   - // pega a instância do ServiceLocator.
824   -
825   - ServiceLocator locator = null;
826   -
827   - try {
828   - locator = ServiceLocator.getInstancia();
829   -
830   - localHome = (ControladorGeograficoLocalHome) locator
831   - .getLocalHome(ConstantesJNDI.CONTROLADOR_GEOGRAFICO_SEJB);
832   - // guarda a referencia de um objeto capaz de fazer chamadas
833   - // objetos remotamente
834   - local = localHome.create();
835   -
836   - return local;
837   - } catch (CreateException e) {
838   - throw new SistemaException(e);
839   - } catch (ServiceLocatorException e) {
840   - throw new SistemaException(e);
841   - }
842   - }
843   -
844   - protected ControladorBatchLocal getControladorBatch() {
845   - ControladorBatchLocalHome localHome = null;
846   - ControladorBatchLocal local = null;
847   -
848   - // pega a instância do ServiceLocator.
849   -
850   - ServiceLocator locator = null;
851   -
852   - try {
853   - locator = ServiceLocator.getInstancia();
854   -
855   - localHome = (ControladorBatchLocalHome) locator
856   - .getLocalHome(ConstantesJNDI.CONTROLADOR_BATCH_SEJB);
857   - // guarda a referencia de um objeto capaz de fazer chamadas à
858   - // objetos remotamente
859   - local = localHome.create();
860   -
861   - return local;
862   - } catch (CreateException e) {
863   - throw new SistemaException(e);
864   - } catch (ServiceLocatorException e) {
865   - throw new SistemaException(e);
866   - }
867   - }
868   -
869   - /**
870   - * Retorna o controladorCadastro
871   - *
872   - * @author Thiago Tenório
873   - * @date 18/08/2006
874   - *
875   - */
876   - protected ControladorCadastroLocal getControladorCadastro() {
877   - ControladorCadastroLocalHome localHome = null;
878   - ControladorCadastroLocal local = null;
879   -
880   - ServiceLocator locator = null;
881   - try {
882   - locator = ServiceLocator.getInstancia();
883   - localHome = (ControladorCadastroLocalHome) locator
884   - .getLocalHomePorEmpresa(ConstantesJNDI.CONTROLADOR_CADASTRO_SEJB);
885   -
886   - local = localHome.create();
887   -
888   - return local;
889   - } catch (CreateException e) {
890   - throw new SistemaException(e);
891   - } catch (ServiceLocatorException e) {
892   - throw new SistemaException(e);
893   - }
894   - }
895   -
896   - /**
897   - * Retorna o valor de controladorEndereco
898   - *
899   - * @return O valor de controladorEndereco
900   - */
901   - protected ControladorPermissaoEspecialLocal getControladorPermissaoEspecial() {
902   - ControladorPermissaoEspecialLocalHome localHome = null;
903   - ControladorPermissaoEspecialLocal local = null;
904   -
905   - // pega a instância do ServiceLocator.
906   -
907   - ServiceLocator locator = null;
908   -
909   - try {
910   - locator = ServiceLocator.getInstancia();
911   -
912   - localHome = (ControladorPermissaoEspecialLocalHome) locator
913   - .getLocalHome(ConstantesJNDI.CONTROLADOR_PERMISSAO_ESPECIAL_SEJB);
914   - // guarda a referencia de um objeto capaz de fazer chamadas à
915   - // objetos remotamente
916   - local = localHome.create();
917   -
918   - return local;
919   - } catch (CreateException e) {
920   - throw new SistemaException(e);
921   - } catch (ServiceLocatorException e) {
922   - throw new SistemaException(e);
923   - }
924   -
925   - }
926   -
927   - /**
928   - * Retorna o valor de ControladorRelaotorioFaturamentoLocal
929   - *
930   - * @return O valor de ControladorRelaotorioFaturamentoLocal
931   - */
932   - protected ControladorRelatorioFaturamentoLocal getControladorRelatorioFaturamento() {
933   - ControladorRelatorioFaturamentoLocalHome localHome = null;
934   - ControladorRelatorioFaturamentoLocal local = null;
935   -
936   - // pega a instância do ServiceLocator.
937   -
938   - ServiceLocator locator = null;
939   -
940   - try {
941   - locator = ServiceLocator.getInstancia();
942   -
943   - localHome = (ControladorRelatorioFaturamentoLocalHome) locator
944   - .getLocalHome(ConstantesJNDI.CONTROLADOR_RELATORIO_FATURAMENTO_SEJB);
945   - // guarda a referencia de um objeto capaz de fazer chamadas à
946   - // objetos remotamente
947   - local = localHome.create();
948   -
949   - return local;
950   - } catch (CreateException e) {
951   - throw new SistemaException(e);
952   - } catch (ServiceLocatorException e) {
953   - throw new SistemaException(e);
954   - }
955   -
956   - }
957   -
958   - /**
959   - * Retorna o valor de ControladorContratoParcelamentoLocal
960   - *
961   - * @return O valor de ControladorContratoParcelamentoLocal
962   - */
963   - protected ControladorContratoParcelamentoLocal getControladorContratoParcelamento() {
964   - ControladorContratoParcelamentoLocalHome localHome = null;
965   - ControladorContratoParcelamentoLocal local = null;
966   -
967   - // pega a instância do ServiceLocator.
968   -
969   - ServiceLocator locator = null;
970   -
971   - try {
972   - locator = ServiceLocator.getInstancia();
973   -
974   - localHome = (ControladorContratoParcelamentoLocalHome) locator
975   - .getLocalHome(ConstantesJNDI.CONTROLADOR_CONTRATO_PARCELAMENTO_SEJB);
976   - // guarda a referencia de um objeto capaz de fazer chamadas à
977   - // objetos remotamente
978   - local = localHome.create();
979   -
980   - return local;
981   - } catch (CreateException e) {
982   - throw new SistemaException(e);
983   - } catch (ServiceLocatorException e) {
984   - throw new SistemaException(e);
985   - }
986   -
987   - }
988 460  
989 461 /**
990 462 * Remove todas as rotas da tabela faturamentoAtivCronRota
... ... @@ -2117,6 +1589,33 @@ public class ControladorFaturamentoFINAL implements SessionBean {
2117 1589 return contaTipo;
2118 1590 }
2119 1591  
  1592 + private boolean deveFaturar(Imovel imovel, Integer anoMesFaturamento) throws ControladorException {
  1593 + boolean faturar = true;
  1594 +
  1595 + try {
  1596 + if (imovel.getFaturamentoSituacaoTipo() != null) {
  1597 +
  1598 + Collection<FaturamentoSituacaoHistorico> faturamentosSituacaoHistorico = repositorioFaturamentoSituacao.faturamentosHistoricoVigentesPorImovel(imovel.getId());
  1599 + FaturamentoSituacaoHistorico faturamentoSituacaoHistorico = faturamentosSituacaoHistorico.iterator().next();
  1600 +
  1601 + FaturamentoSituacaoTipo tipo = repositorioFaturamentoSituacaoTipo.situacaoTipoDoImovel(imovel.getId());
  1602 +
  1603 + if ((faturamentoSituacaoHistorico != null
  1604 + && anoMesFaturamento >= faturamentoSituacaoHistorico.getAnoMesFaturamentoSituacaoInicio()
  1605 + && anoMesFaturamento <= faturamentoSituacaoHistorico.getAnoMesFaturamentoSituacaoFim())
  1606 + && tipo.paralisacaoFaturamentoAtivo()
  1607 + && imovel.faturamentoAguaValido()) {
  1608 + faturar = false;
  1609 + }
  1610 + }
  1611 + } catch (Exception e) {
  1612 + throw new ControladorException("Erro ao verificar se imovel deve faturar", e);
  1613 + }
  1614 +
  1615 +
  1616 + return faturar;
  1617 + }
  1618 +
2120 1619 /**
2121 1620 * Determina os dados do faturamento do imóvel.
2122 1621 * [UC0113] - Faturar Grupo de Faturamento
... ... @@ -2167,9 +1666,21 @@ public class ControladorFaturamentoFINAL implements SessionBean {
2167 1666 helperValoresAguaEsgoto = this.determinarValoresFaturamentoAguaEsgoto(imovel, anoMesFaturamentoGrupo, colecaoCategoriaOUSubcategoria,
2168 1667 faturamentoGrupo, consumoHistoricoAgua, consumoHistoricoEsgoto);
2169 1668 }
  1669 +
  1670 + boolean valoresAguaEsgotoZerados = false;
  1671 + if (imovel.faturamentoAguaAtivo() || imovel.faturamentoEsgotoAtivo() || imovel.existeHidrometro()) {
  1672 + valoresAguaEsgotoZerados = !deveFaturar(imovel, anoMesFaturamentoGrupo);
  1673 + }
  1674 +
  1675 + boolean gerarConta = false;
  1676 +
  1677 + if (imovel.useNovaChecagemGerarConta()){
  1678 + gerarConta = getControladorAnaliseGeracaoConta().verificarGeracaoConta(valoresAguaEsgotoZerados, anoMesFaturamentoGrupo, imovel);
  1679 + }else{
  1680 + gerarConta = this.verificarNaoGeracaoConta(imovel, helperValoresAguaEsgoto.getValorTotalAgua(),
  1681 + helperValoresAguaEsgoto.getValorTotalEsgoto(), anoMesFaturamentoGrupo, false);
  1682 + }
2170 1683  
2171   - boolean gerarConta = this.verificarNaoGeracaoConta(imovel, helperValoresAguaEsgoto.getValorTotalAgua(),
2172   - helperValoresAguaEsgoto.getValorTotalEsgoto(), anoMesFaturamentoGrupo, false);
2173 1684  
2174 1685 if (gerarConta) {
2175 1686  
... ... @@ -66120,46 +65631,10 @@ public class ControladorFaturamentoFINAL implements SessionBean {
66120 65631 throws ControladorException {
66121 65632  
66122 65633 DeterminarValoresFaturamentoAguaEsgotoHelper helper = new DeterminarValoresFaturamentoAguaEsgotoHelper();
66123   -
66124   - if (consumoHistoricoAgua != null) {
66125   - helper.setConsumoHistoricoAgua(consumoHistoricoAgua);
66126   -
66127   - if (consumoHistoricoAgua.getIndicadorFaturamento() != null) {
66128   - helper.setIndicadorFaturamentoAgua(consumoHistoricoAgua.getIndicadorFaturamento());
66129   - }
66130   -
66131   - if (consumoHistoricoAgua.getNumeroConsumoFaturadoMes() != null) {
66132   - helper.setConsumoFaturadoAgua(consumoHistoricoAgua.getNumeroConsumoFaturadoMes());
66133   - }
66134   -
66135   - if (consumoHistoricoAgua.getConsumoRateio() != null) {
66136   - helper.setConsumoRateioAgua(consumoHistoricoAgua.getConsumoRateio());
66137   - }
66138   -
66139   - if (consumoHistoricoAgua.getConsumoTipo() != null) {
66140   - helper.setConsumoTipoAgua(consumoHistoricoAgua.getConsumoTipo());
66141   - }
66142   - }
66143   -
66144   - if (consumoHistoricoEsgoto != null) {
66145   - helper.setConsumoHistoricoEsgoto(consumoHistoricoEsgoto);
66146   -
66147   - if (consumoHistoricoEsgoto.getIndicadorFaturamento() != null) {
66148   - helper.setIndicadorFaturamentoEsgoto(consumoHistoricoEsgoto.getIndicadorFaturamento());
66149   - }
66150   -
66151   - if (consumoHistoricoEsgoto.getNumeroConsumoFaturadoMes() != null) {
66152   - helper.setConsumoFaturadoEsgoto(consumoHistoricoEsgoto.getNumeroConsumoFaturadoMes());
66153   - }
66154   -
66155   - if (consumoHistoricoEsgoto.getConsumoRateio() != null) {
66156   - helper.setConsumoRateioEsgoto(consumoHistoricoEsgoto.getConsumoRateio());
66157   - }
66158   -
66159   - if (consumoHistoricoEsgoto.getConsumoTipo() != null) {
66160   - helper.setConsumoTipoEsgoto(consumoHistoricoEsgoto.getConsumoTipo());
66161   - }
66162   - }
  65634 +
  65635 + helper.atribuirConsumoHistoricoAgua(consumoHistoricoAgua);
  65636 +
  65637 + helper.atribuirConsumoHistoricoEsgoto(consumoHistoricoEsgoto);
66163 65638  
66164 65639 int consumoMinimoLigacao = getControladorMicromedicao().obterConsumoMinimoLigacao(imovel, null);
66165 65640 helper.setConsumoMinimoLigacao(consumoMinimoLigacao);
... ... @@ -66183,20 +65658,8 @@ public class ControladorFaturamentoFINAL implements SessionBean {
66183 65658 anoMesFaturamento);
66184 65659  
66185 65660 if (medicaoHistoricoAgua != null) {
66186   -
66187   - // DATA_LEITURA_ANTERIOR
66188   - if (medicaoHistoricoAgua.getDataLeituraAnteriorFaturamento() != null) {
66189   -
66190   - helper.setDataLeituraAnterior(medicaoHistoricoAgua
66191   - .getDataLeituraAnteriorFaturamento());
66192   - }
66193   -
66194   - // DATA_LEITURA_ATUAL
66195   - if (medicaoHistoricoAgua.getDataLeituraAtualFaturamento() != null) {
66196   -
66197   - helper.setDataLeituraAtual(medicaoHistoricoAgua
66198   - .getDataLeituraAtualFaturamento());
66199   - }
  65661 + helper.setDataLeituraAnterior(medicaoHistoricoAgua.getDataLeituraAnteriorFaturamento());
  65662 + helper.setDataLeituraAtual(medicaoHistoricoAgua.getDataLeituraAtualFaturamento());
66200 65663 }
66201 65664 }
66202 65665  
... ... @@ -75581,20 +75044,6 @@ public class ControladorFaturamentoFINAL implements SessionBean {
75581 75044 return false;
75582 75045 }
75583 75046  
75584   - /**
75585   - *
75586   - *
75587   - * @author Pamela Gatinho
75588   - * @date 06/03/2013
75589   - *
75590   - * Metodo que obtem o extrato de quitação de débitos de um imóvel para
75591   - * um determinado ano.
75592   - *
75593   - * @return ExtratoQuitacao
75594   - * @param anoReferencia
75595   - * @param idImovel
75596   - * @throws ControladorException
75597   - */
75598 75047 public ExtratoQuitacao obterExtratoQuitacaoImovel(Integer idImovel,
75599 75048 Integer anoReferencia) throws ControladorException {
75600 75049 try {
... ... @@ -75607,23 +75056,6 @@ public class ControladorFaturamentoFINAL implements SessionBean {
75607 75056 }
75608 75057 }
75609 75058  
75610   - /**
75611   - *
75612   - *
75613   - * Alteração para contabilizar em contas diferentes valores arrecadados até
75614   - * 31/12/2012
75615   - *
75616   - * [UC0155] - Encerrar Faturamento do Mês
75617   - *
75618   - * @author Wellington Rocha
75619   - *
75620   - * @param anoMesReferencia
75621   - * @param idLocalidade
75622   - * @param idCategoria
75623   - * @param idsOrigemCredito
75624   - *
75625   - * @throws ControladorException
75626   - */
75627 75059 private BigDecimal[] obterDiferencaValoresCreditosRealizadosContaRetificadaDuplicidadeAte201212(
75628 75060 int anoMesReferencia, int idLocalidade, int idCategoria,
75629 75061 Integer[] idsOrigemCredito) throws ControladorException {
... ...
src/gcom/faturamento/FaturamentoSituacaoTipo.java
1 1 package gcom.faturamento;
2 2  
  3 +import java.io.Serializable;
  4 +import java.util.Date;
  5 +
  6 +import org.apache.commons.lang.builder.ToStringBuilder;
  7 +
  8 +import gcom.enums.Status;
3 9 import gcom.interceptor.ControleAlteracao;
4 10 import gcom.interceptor.ObjetoTransacao;
5 11 import gcom.micromedicao.leitura.LeituraAnormalidadeConsumo;
... ... @@ -7,11 +13,6 @@ import gcom.micromedicao.leitura.LeituraAnormalidadeLeitura;
7 13 import gcom.util.filtro.Filtro;
8 14 import gcom.util.filtro.ParametroSimples;
9 15  
10   -import java.io.Serializable;
11   -import java.util.Date;
12   -
13   -import org.apache.commons.lang.builder.ToStringBuilder;
14   -
15 16 @ControleAlteracao()
16 17 /** @author Hibernate CodeGenerator */
17 18 public class FaturamentoSituacaoTipo extends ObjetoTransacao implements Serializable {
... ... @@ -256,14 +257,8 @@ public class FaturamentoSituacaoTipo extends ObjetoTransacao implements Serializ
256 257 Filtro filtro = retornaFiltro();
257 258 return filtro;
258 259 }
259   - /*public Short getIndicadorFaturamentoParalisacaoEsgoto() {
260   - return indicadorFaturamentoParalisacaoEsgoto;
261   - }
262 260  
263   - public void setIndicadorFaturamentoParalisacaoEsgoto(
264   - Short indicadorFaturamentoParalisacaoEsgoto) {
265   - this.indicadorFaturamentoParalisacaoEsgoto = indicadorFaturamentoParalisacaoEsgoto;
266   - }*/
267   -
268   -
  261 + public boolean paralisacaoFaturamentoAtivo() {
  262 + return indicadorParalisacaoFaturamento != null && indicadorParalisacaoFaturamento.shortValue() == Status.ATIVO.getId();
  263 + }
269 264 }
... ...
src/gcom/faturamento/controladores/ControladorAnaliseGeracaoConta.java 0 → 100644
... ... @@ -0,0 +1,85 @@
  1 +package gcom.faturamento.controladores;
  2 +
  3 +import java.util.Collection;
  4 +
  5 +import javax.ejb.CreateException;
  6 +
  7 +import gcom.arrecadacao.repositorio.RepositorioDevolucao;
  8 +import gcom.cadastro.imovel.Imovel;
  9 +import gcom.enums.Status;
  10 +import gcom.faturamento.credito.CreditoARealizar;
  11 +import gcom.faturamento.debito.DebitoACobrar;
  12 +import gcom.faturamento.debito.DebitoCreditoSituacao;
  13 +import gcom.faturamento.repositorio.RepositorioCreditoARealizar;
  14 +import gcom.util.ControladorComum;
  15 +import gcom.util.ControladorException;
  16 +
  17 +public class ControladorAnaliseGeracaoConta extends ControladorComum {
  18 + private static final long serialVersionUID = 5517389533745886938L;
  19 +
  20 + private RepositorioCreditoARealizar creditoRealizarRepositorio;
  21 +
  22 + private RepositorioDevolucao repositorioDevolucao;
  23 +
  24 + public ControladorAnaliseGeracaoConta(){}
  25 +
  26 + public void ejbCreate() throws CreateException {
  27 + creditoRealizarRepositorio = RepositorioCreditoARealizar.getInstance();
  28 + repositorioDevolucao = RepositorioDevolucao.getInstance();
  29 + }
  30 +
  31 + public boolean verificarGeracaoConta(boolean aguaEsgotoZerados, int anoMesFaturamento, Imovel imovel) throws ControladorException {
  32 + return verificarSituacaoImovelParaGerarConta(aguaEsgotoZerados, imovel) || verificarDebitosECreditosParaGerarConta(anoMesFaturamento, imovel) || verificarSituacaoDeCondominio(aguaEsgotoZerados, imovel);
  33 + }
  34 +
  35 + public boolean verificarSituacaoDeCondominio(boolean aguaEsgotoZerados, Imovel imovel) {
  36 + return aguaEsgotoZerados && !imovel.aguaLigada() && !imovel.esgotoLigado() && imovel.pertenceACondominio();
  37 + }
  38 +
  39 + public boolean verificarDebitosECreditosParaGerarConta(int anoMesFaturamento, Imovel imovel) throws ControladorException{
  40 + boolean segundaCondicaoGerarConta = true;
  41 +
  42 + try {
  43 + Collection<DebitoACobrar> debitosACobrar = getControladorDebitoACobrar().debitosCobrarSemPagamentos(imovel.getId());
  44 + if (naoHaDebitosACobrar(debitosACobrar) || imovel.paralisacaoFaturamento()) {
  45 + return false;
  46 + }
  47 +
  48 + Collection<CreditoARealizar> creditosARealizar = creditoRealizarRepositorio.buscarCreditoRealizarPorImovel(imovel.getId(),
  49 + DebitoCreditoSituacao.NORMAL,
  50 + anoMesFaturamento);
  51 +
  52 + if (naoHaCreditoARealizar(creditosARealizar) || repositorioDevolucao.existeCreditoComDevolucao(creditosARealizar)) {
  53 + segundaCondicaoGerarConta = haDebitosCobrarAtivos(debitosACobrar);
  54 + }
  55 + } catch (Exception e) {
  56 + throw new ControladorException("Erro ao verificar debitos e creditos para gerar conta", e);
  57 + }
  58 +
  59 +
  60 + return segundaCondicaoGerarConta;
  61 + }
  62 +
  63 + public boolean verificarSituacaoImovelParaGerarConta(boolean valoresAguaEsgotoZerados, Imovel imovel) {
  64 + return !(valoresAguaEsgotoZerados || (!valoresAguaEsgotoZerados && !imovel.aguaLigada() && !imovel.esgotoLigado() && !imovel.pertenceACondominio()));
  65 + }
  66 +
  67 + private boolean haDebitosCobrarAtivos(Collection<DebitoACobrar> debitosACobrar) {
  68 + boolean haDebitosCobrarAtivos = false;
  69 + for (DebitoACobrar debitoACobrar: debitosACobrar) {
  70 + if (debitoACobrar.getDebitoTipo().getIndicadorGeracaoConta().shortValue() == Status.ATIVO.getId()) {
  71 + haDebitosCobrarAtivos = true;
  72 + break;
  73 + }
  74 + }
  75 + return haDebitosCobrarAtivos;
  76 + }
  77 +
  78 + private boolean naoHaCreditoARealizar(Collection<CreditoARealizar> creditosRealizar) {
  79 + return creditosRealizar == null || creditosRealizar.isEmpty();
  80 + }
  81 +
  82 + private boolean naoHaDebitosACobrar(Collection<DebitoACobrar> debitosACobrar) {
  83 + return debitosACobrar == null || debitosACobrar.isEmpty();
  84 + }
  85 +}
... ...
src/gcom/faturamento/controladores/ControladorAnaliseGeracaoContaLocal.java 0 → 100644
... ... @@ -0,0 +1,13 @@
  1 +package gcom.faturamento.controladores;
  2 +
  3 +import gcom.cadastro.imovel.Imovel;
  4 +import gcom.util.ControladorException;
  5 +
  6 +public interface ControladorAnaliseGeracaoContaLocal extends javax.ejb.EJBLocalObject {
  7 +
  8 + public boolean verificarGeracaoConta(boolean aguaEsgotoZerados, int anoMesFaturamento, Imovel imovel) throws ControladorException;
  9 +
  10 + public boolean verificarDebitosECreditosParaGerarConta(int anoMesFaturamento, Imovel imovel) throws ControladorException;
  11 +
  12 + public boolean verificarSituacaoImovelParaGerarConta(boolean valoresAguaEsgotoZerados, Imovel imovel);
  13 +}
... ...
src/gcom/faturamento/controladores/ControladorAnaliseGeracaoContaLocalHome.java 0 → 100644
... ... @@ -0,0 +1,7 @@
  1 +package gcom.faturamento.controladores;
  2 +
  3 +import javax.ejb.CreateException;
  4 +
  5 +public interface ControladorAnaliseGeracaoContaLocalHome extends javax.ejb.EJBLocalHome {
  6 + public ControladorAnaliseGeracaoContaLocal create() throws CreateException;
  7 +}
0 8 \ No newline at end of file
... ...
src/gcom/faturamento/controladores/ControladorDebitoACobrar.java 0 → 100644
... ... @@ -0,0 +1,77 @@
  1 +package gcom.faturamento.controladores;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.Collection;
  5 +import java.util.List;
  6 +
  7 +import javax.ejb.CreateException;
  8 +
  9 +import gcom.arrecadacao.repositorio.RepositorioPagamento;
  10 +import gcom.cadastro.sistemaparametro.SistemaParametro;
  11 +import gcom.faturamento.debito.DebitoACobrar;
  12 +import gcom.faturamento.repositorio.RepositorioDebitoACobrar;
  13 +import gcom.util.ControladorComum;
  14 +import gcom.util.ControladorException;
  15 +import gcom.util.ErroRepositorioException;
  16 +
  17 +public class ControladorDebitoACobrar extends ControladorComum{
  18 + private static final long serialVersionUID = -6230958913028633457L;
  19 +
  20 + private RepositorioDebitoACobrar debitoCobrarRepositorio;
  21 +
  22 + private RepositorioPagamento repositorioPagamento;
  23 +
  24 + public void ejbCreate() throws CreateException {
  25 + repositorioPagamento = RepositorioPagamento.getInstancia();
  26 + debitoCobrarRepositorio = RepositorioDebitoACobrar.getInstancia();
  27 + }
  28 +
  29 + public Collection<DebitoACobrar> debitosCobrarVigentes(Integer idImovel) throws ControladorException{
  30 +
  31 + Collection<DebitoACobrar> debitos = new ArrayList<DebitoACobrar>();
  32 + try {
  33 +
  34 + SistemaParametro sistemaParametro = getControladorUtil().pesquisarParametrosDoSistema();
  35 +
  36 + Collection<DebitoACobrar> lista = debitoCobrarRepositorio.debitosCobrarPorImovelComPendenciaESemRevisao(idImovel);
  37 +
  38 + Integer anoMesFaturamento = sistemaParametro.getAnoMesFaturamento();
  39 +
  40 + for (DebitoACobrar debito : lista) {
  41 + if (!(debito.pertenceParcelamento(anoMesFaturamento))){
  42 + debitos.add(debito);
  43 + }
  44 + }
  45 + } catch (ErroRepositorioException e) {
  46 + throw new ControladorException("Erro ao pesquisar debitos a cobrar vigentes", e);
  47 + }
  48 +
  49 +
  50 + return debitos;
  51 + }
  52 +
  53 + public Collection<DebitoACobrar> debitosCobrarSemPagamentos(Integer idImovel) throws ControladorException {
  54 + Collection<DebitoACobrar> debitos = new ArrayList<DebitoACobrar>();
  55 +
  56 + try {
  57 + SistemaParametro sistemaParametro = getControladorUtil().pesquisarParametrosDoSistema();
  58 +
  59 + Integer anoMesFaturamento = sistemaParametro.getAnoMesFaturamento();
  60 +
  61 + Collection<DebitoACobrar> lista = debitoCobrarRepositorio.debitosCobrarPorImovelComPendenciaESemRevisao(idImovel);
  62 +
  63 + for (DebitoACobrar debito : lista) {
  64 + if (!debito.pertenceParcelamento(anoMesFaturamento) && repositorioPagamento.debitoSemPagamento(debito.getId())){
  65 + debitos.add(debito);
  66 + }
  67 + }
  68 + } catch (ErroRepositorioException e) {
  69 + throw new ControladorException("Erro ao pesquisar debitos a cobrar sem pagamentos", e);
  70 + }
  71 + return debitos;
  72 + }
  73 +
  74 + public void atualizarDebitoCobrar(List<DebitoACobrar> debitosCobrar) throws ErroRepositorioException{
  75 + debitoCobrarRepositorio.atualizarDebitoCobrar(debitosCobrar);
  76 + }
  77 +}
... ...
src/gcom/faturamento/controladores/ControladorDebitoACobrarLocal.java 0 → 100644
... ... @@ -0,0 +1,17 @@
  1 +package gcom.faturamento.controladores;
  2 +
  3 +import java.util.Collection;
  4 +import java.util.List;
  5 +
  6 +import gcom.faturamento.debito.DebitoACobrar;
  7 +import gcom.util.ControladorException;
  8 +import gcom.util.ErroRepositorioException;
  9 +
  10 +public interface ControladorDebitoACobrarLocal extends javax.ejb.EJBLocalObject {
  11 +
  12 + public Collection<DebitoACobrar> debitosCobrarVigentes(Integer idImovel) throws ControladorException;
  13 +
  14 + public Collection<DebitoACobrar> debitosCobrarSemPagamentos(Integer idImovel) throws ControladorException;
  15 +
  16 + public void atualizarDebitoCobrar(List<DebitoACobrar> debitosCobrar) throws ErroRepositorioException;
  17 +}
... ...
src/gcom/faturamento/controladores/ControladorDebitoACobrarLocalHome.java 0 → 100644
... ... @@ -0,0 +1,7 @@
  1 +package gcom.faturamento.controladores;
  2 +
  3 +import javax.ejb.CreateException;
  4 +
  5 +public interface ControladorDebitoACobrarLocalHome extends javax.ejb.EJBLocalHome {
  6 + public ControladorDebitoACobrarLocal create() throws CreateException;
  7 +}
0 8 \ No newline at end of file
... ...
src/gcom/faturamento/debito/DebitoACobrar.hbm.xml
... ... @@ -28,6 +28,8 @@
28 28 <property name="anoMesReferenciaPrestacao" type="java.lang.Integer" column="dbac_amreferenciaprestacao" length="4"/>
29 29 <property name="numeroParcelasAntecipadas" type="java.lang.Integer" column="dbac_nnparcelasantecipadas" length="4"/>
30 30 <property name="dataRevisao" type="java.sql.Date" column="dbac_dtrevisao" length="4"/>
  31 + <property name="situacaoAtual" type="java.lang.Integer" column="dcst_idatual" length="2" insert="false" update="false"/>
  32 +
31 33 <!-- associations -->
32 34 <!-- bi-directional one-to-many association to DebitoACobrarCategoria -->
33 35 <set name="debitoACobrarCategorias" lazy="true" inverse="true" cascade="delete">
... ...
src/gcom/faturamento/debito/DebitoACobrar.java
1 1 package gcom.faturamento.debito;
2 2  
  3 +import java.math.BigDecimal;
  4 +import java.util.Date;
  5 +import java.util.Set;
  6 +
3 7 import gcom.atendimentopublico.ligacaoagua.LigacaoAgua;
4 8 import gcom.atendimentopublico.ordemservico.OrdemServico;
5 9 import gcom.atendimentopublico.registroatendimento.RegistroAtendimento;
... ... @@ -19,12 +23,6 @@ import gcom.seguranca.acesso.usuario.Usuario;
19 23 import gcom.util.filtro.Filtro;
20 24 import gcom.util.filtro.ParametroSimples;
21 25  
22   -import java.math.BigDecimal;
23   -import java.util.Date;
24   -import java.util.Set;
25   -
26   -import org.apache.commons.lang.builder.ToStringBuilder;
27   -
28 26  
29 27 /** @author Hibernate CodeGenerator */
30 28 @ControleAlteracao()
... ... @@ -166,6 +164,8 @@ public class DebitoACobrar extends ObjetoTransacao {
166 164 private Date dataRevisao;
167 165  
168 166 private ContaMotivoRevisao contaMotivoRevisao;
  167 +
  168 + private Integer situacaoAtual;
169 169  
170 170 public String[] retornaCamposChavePrimaria(){
171 171 String[] retorno = new String[1];
... ... @@ -702,22 +702,12 @@ public class DebitoACobrar extends ObjetoTransacao {
702 702 this.anoMesReferenciaPrestacao = anoMesReferenciaPrestacao;
703 703 }
704 704  
705   - /**
706   - * Realiza o calculo de quantas parcelas falta para cobrar
707   - * numero total de prestações menos
708   - * numero de parcelas cobradas menos
709   - * numero de parcelas bonus
710   - *
711   - * @author Vivianne Sousa
712   - * @created 21/02/2008
713   - */
714 705 public short getParcelasRestanteComBonus(){
715 706  
716   - short retorno = Short.parseShort(""+
717   - (getNumeroPrestacaoDebito() - getNumeroPrestacaoCobradas()));
  707 + short retorno = (short) (getNumeroPrestacaoDebito() - getNumeroPrestacaoCobradas());
718 708  
719 709 if (getNumeroParcelaBonus() != null){
720   - retorno = Short.parseShort(""+ (retorno - getNumeroParcelaBonus().shortValue()));
  710 + retorno = (short) (retorno - getNumeroParcelaBonus().shortValue());
721 711 }
722 712  
723 713 return retorno;
... ... @@ -727,10 +717,6 @@ public class DebitoACobrar extends ObjetoTransacao {
727 717 this.valorTotalDebito = valorTotalDebito;
728 718 }
729 719  
730   - /**
731   - * @author Vivianne Sousa
732   - * @created 21/02/2008
733   - */
734 720 public BigDecimal getValorTotalComBonus(){
735 721  
736 722 //caso o número de parcelas já cobradas seja igual
... ... @@ -768,10 +754,6 @@ public class DebitoACobrar extends ObjetoTransacao {
768 754 }
769 755 }
770 756  
771   - /**
772   - * @author Vivianne Sousa
773   - * @created 21/02/2008
774   - */
775 757 public short getNumeroPrestacaoDebitoMenosBonus() {
776 758 short retorno =getNumeroPrestacaoDebito();
777 759  
... ... @@ -782,23 +764,12 @@ public class DebitoACobrar extends ObjetoTransacao {
782 764 return retorno;
783 765 }
784 766  
785   - /**
786   - * @author Vivianne Sousa
787   - * @created 15/04/2008
788   - */
789 767 public BigDecimal getValorPrestacao(){
790   -
791   - //truncando o resultado com 2 casas decimais
792   - BigDecimal retornoDivisao =
793   - this.valorDebito.divide(new BigDecimal(numeroPrestacaoDebito),2,BigDecimal.ROUND_DOWN);
  768 + BigDecimal retornoDivisao = this.valorDebito.divide(new BigDecimal(numeroPrestacaoDebito),2,BigDecimal.ROUND_DOWN);
794 769  
795 770 return retornoDivisao;
796 771 }
797 772  
798   - /**
799   - * @author Vivianne Sousa
800   - * @created 17/04/2008
801   - */
802 773 public short getNumeroPrestacaoCobradasMaisBonus() {
803 774 short retorno =getNumeroPrestacaoCobradas();
804 775  
... ... @@ -809,16 +780,10 @@ public class DebitoACobrar extends ObjetoTransacao {
809 780 return retorno;
810 781 }
811 782  
812   - /**
813   - * @return Retorna o campo usuario.
814   - */
815 783 public Usuario getUsuario() {
816 784 return usuario;
817 785 }
818 786  
819   - /**
820   - * @param usuario O usuario a ser setado.
821   - */
822 787 public void setUsuario(Usuario usuario) {
823 788 this.usuario = usuario;
824 789 }
... ... @@ -831,7 +796,15 @@ public class DebitoACobrar extends ObjetoTransacao {
831 796 this.dataRevisao = dataRevisao;
832 797 }
833 798  
834   - public ContaMotivoRevisao getContaMotivoRevisao() {
  799 + public Integer getSituacaoAtual() {
  800 + return situacaoAtual;
  801 + }
  802 +
  803 + public void setSituacaoAtual(Integer situacaoAtual) {
  804 + this.situacaoAtual = situacaoAtual;
  805 + }
  806 +
  807 + public ContaMotivoRevisao getContaMotivoRevisao() {
835 808 return contaMotivoRevisao;
836 809 }
837 810  
... ... @@ -839,24 +812,8 @@ public class DebitoACobrar extends ObjetoTransacao {
839 812 this.contaMotivoRevisao = contaMotivoRevisao;
840 813 }
841 814  
842   - /**
843   - * @author Rômulo Aurélio
844   - * @created 28/08/2008
845   - */
846 815 public BigDecimal getValorParcela(){
847   -
848 816 return getValorPrestacao();
849   -
850   -// short retorno =getNumeroPrestacaoDebito();
851   -//
852   -// if (getNumeroParcelaBonus() != null){
853   -// retorno = Short.parseShort(""+ (retorno - getNumeroParcelaBonus().shortValue()));
854   -// }
855   -// //truncando o resultado com 2 casas decimais
856   -// BigDecimal retornoDivisao =
857   -// this.valorDebito.divide(new BigDecimal(retorno),2,BigDecimal.ROUND_DOWN);
858   -//
859   -// return retornoDivisao;
860 817 }
861 818  
862 819 public short getNumeroPrestacaoRestante() {
... ... @@ -906,4 +863,15 @@ public class DebitoACobrar extends ObjetoTransacao {
906 863  
907 864 return retorno;
908 865 }
  866 +
  867 + public boolean pertenceParcelamento(int anoMesReferencia) {
  868 + return parcelamento != null
  869 + && parcelamento.getAnoMesReferenciaFaturamento() != null
  870 + && parcelamento.getAnoMesReferenciaFaturamento() >= anoMesReferencia
  871 + && this.naPrimeiraParcela();
  872 + }
  873 +
  874 + private boolean naPrimeiraParcela() {
  875 + return numeroPrestacaoCobradas == 0;
  876 + }
909 877 }
... ...
src/gcom/faturamento/repositorio/RepositorioCreditoARealizar.java 0 → 100644
... ... @@ -0,0 +1,118 @@
  1 +package gcom.faturamento.repositorio;
  2 +
  3 +import java.sql.Timestamp;
  4 +import java.util.ArrayList;
  5 +import java.util.Collection;
  6 +import java.util.Date;
  7 +import java.util.List;
  8 +
  9 +import org.hibernate.Session;
  10 +
  11 +import gcom.faturamento.credito.CreditoARealizar;
  12 +import gcom.util.ErroRepositorioException;
  13 +import gcom.util.HibernateUtil;
  14 +
  15 +public class RepositorioCreditoARealizar {
  16 +
  17 + private static RepositorioCreditoARealizar instance = null;
  18 +
  19 + private RepositorioCreditoARealizar() {}
  20 +
  21 + public static RepositorioCreditoARealizar getInstance(){
  22 + if (instance == null){
  23 + instance = new RepositorioCreditoARealizar();
  24 + }
  25 +
  26 + return instance;
  27 + }
  28 +
  29 + @SuppressWarnings("unchecked")
  30 + public Collection<CreditoARealizar> buscarCreditoRealizarPorImovel(Integer imovelId, Integer debitoCreditoSituacaoAtual, int anoMesFaturamento) throws ErroRepositorioException{
  31 +
  32 + Session session = HibernateUtil.getSession();
  33 +
  34 + StringBuilder consulta = new StringBuilder();
  35 +
  36 + Collection<CreditoARealizar> retorno = new ArrayList<CreditoARealizar>();
  37 +
  38 + try {
  39 + consulta.append(" select crar ")
  40 + .append(" from CreditoARealizar as crar ")
  41 + .append(" inner join crar.imovel as imov ")
  42 + .append(" inner join crar.quadra ")
  43 + .append(" inner join crar.localidade ")
  44 + .append(" inner join crar.creditoTipo ")
  45 + .append(" inner join crar.lancamentoItemContabil ")
  46 + .append(" inner join crar.creditoOrigem ")
  47 + .append(" inner join crar.creditoARealizarGeral ")
  48 + .append(" left outer join crar.parcelamento parc ")
  49 + .append(" where imov.id = :imovelId ")
  50 + .append(" and crar.debitoCreditoSituacaoAtual = :debitoCreditoSituacaoAtualId ")
  51 + .append(" and (crar.numeroPrestacaoRealizada < ")
  52 + .append(" (crar.numeroPrestacaoCredito - coalesce(crar.numeroParcelaBonus, 0)) ")
  53 + .append(" or crar.valorResidualMesAnterior > 0) ")
  54 + .append(" and (parc.id is null or crar.numeroPrestacaoRealizada > 0 or (parc.id is not null ")
  55 + .append(" and crar.numeroPrestacaoRealizada = 0 and parc.anoMesReferenciaFaturamento < :anoMesFaturamento) ) ");
  56 +
  57 + retorno = (Collection<CreditoARealizar>) session.createQuery(consulta.toString())
  58 + .setParameter("imovelId", imovelId)
  59 + .setParameter("debitoCreditoSituacaoAtualId", debitoCreditoSituacaoAtual)
  60 + .setParameter("anoMesFaturamento", anoMesFaturamento)
  61 + .list();
  62 + } catch (Exception e) {
  63 + throw new ErroRepositorioException(e);
  64 + } finally{
  65 + session.close();
  66 + }
  67 +
  68 + return retorno;
  69 + }
  70 +
  71 + public void atualizarParcelas(Integer referencia, List<Integer> idsImoveis) throws ErroRepositorioException{
  72 + Session session = HibernateUtil.getSession();
  73 +
  74 + StringBuilder sql = new StringBuilder();
  75 + sql.append("update faturamento.credito_a_realizar ")
  76 + .append(" set crar_nnprestacaorealizadas = crar_nnprestacaorealizadas - 1, ")
  77 + .append(" crar_tmultimaalteracao = :data ")
  78 + .append(" where crar_amreferenciaprestacao >= :referencia")
  79 + .append(" and crar_nnprestacaorealizadas > 0 ")
  80 + .append(" and (crar_nnprestacaocredito > 1 or (crar_nnprestacaocredito = 1 and crar_vlresidualmesanterior = 0.00)) ")
  81 + .append(" and imov_id in (:ids)");
  82 +
  83 + try {
  84 + session.createSQLQuery(sql.toString())
  85 + .setParameter("referencia", referencia)
  86 + .setParameter("data", new Timestamp(new Date().getTime()))
  87 + .setParameter("ids", idsImoveis)
  88 + .executeUpdate();
  89 + } catch (Exception e) {
  90 + throw new ErroRepositorioException(e);
  91 + } finally{
  92 + session.close();
  93 + }
  94 + }
  95 +
  96 + public void atualizarValorResidual(List<Integer> idsImoveis) throws ErroRepositorioException{
  97 + Session session = HibernateUtil.getSession();
  98 +
  99 + StringBuilder sql = new StringBuilder();
  100 + sql.append("update faturamento.credito_a_realizar set ")
  101 + .append(" crar_vlresidualmesanterior = coalesce(crar_vlresidualconcedidomes, 0) , ")
  102 + .append(" crar_vlresidualconcedidomes = null, ")
  103 + .append(" crar_tmultimaalteracao = :data ")
  104 + .append(" where crar_nnprestacaorealizadas > 0")
  105 + .append(" and imov_id in (:ids)");
  106 +
  107 + try {
  108 + session.createSQLQuery(sql.toString())
  109 + .setParameter("data", new Timestamp(new Date().getTime()))
  110 + .setParameter("ids", idsImoveis)
  111 + .executeUpdate();
  112 + } catch (Exception e) {
  113 + throw new ErroRepositorioException(e);
  114 + } finally{
  115 + session.close();
  116 + }
  117 + }
  118 +}
0 119 \ No newline at end of file
... ...
src/gcom/faturamento/repositorio/RepositorioDebitoACobrar.java 0 → 100644
... ... @@ -0,0 +1,115 @@
  1 +package gcom.faturamento.repositorio;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.Collection;
  5 +import java.util.Date;
  6 +import java.util.List;
  7 +
  8 +import org.hibernate.Session;
  9 +
  10 +import gcom.faturamento.debito.DebitoACobrar;
  11 +import gcom.faturamento.debito.DebitoCreditoSituacao;
  12 +import gcom.util.ErroRepositorioException;
  13 +import gcom.util.HibernateUtil;
  14 +
  15 +public class RepositorioDebitoACobrar{
  16 +
  17 + private static RepositorioDebitoACobrar instancia;
  18 +
  19 + private RepositorioDebitoACobrar() {}
  20 +
  21 + public static RepositorioDebitoACobrar getInstancia() {
  22 + if (instancia == null){
  23 + instancia = new RepositorioDebitoACobrar();
  24 + }
  25 +
  26 + return instancia;
  27 + }
  28 +
  29 +
  30 + @SuppressWarnings("unchecked")
  31 + public Collection<DebitoACobrar> debitosCobrarPorImovelComPendenciaESemRevisao(Integer idImovel) throws ErroRepositorioException{
  32 + Session session = HibernateUtil.getSession();
  33 +
  34 + StringBuilder sql = new StringBuilder();
  35 + sql.append("select dc from DebitoACobrar dc ")
  36 + .append(" inner join fetch dc.debitoTipo dt ")
  37 + .append(" left join dc.parcelamento parc ")
  38 + .append(" where dc.imovel.id = :idImovel ")
  39 + .append(" and dc.numeroPrestacaoCobradas < (dc.numeroPrestacaoDebito - coalesce(dc.numeroParcelaBonus, 0))")
  40 + .append(" and dc.dataRevisao is null")
  41 + .append(" and dc.contaMotivoRevisao is null")
  42 + .append(" and dc.situacaoAtual = :situacao");
  43 +
  44 + Collection<DebitoACobrar> debitos = new ArrayList<DebitoACobrar>();
  45 +
  46 + try {
  47 + debitos = (Collection<DebitoACobrar>) session.createQuery(sql.toString())
  48 + .setParameter("idImovel", idImovel)
  49 + .setParameter("situacao", DebitoCreditoSituacao.NORMAL)
  50 + .list();
  51 + } catch (Exception e) {
  52 + throw new ErroRepositorioException(e);
  53 + }finally{
  54 + session.close();
  55 + }
  56 +
  57 + return debitos;
  58 + }
  59 +
  60 + public void reduzirParcelasCobradas(Integer referencia, Integer grupoFaturamento, List<Integer> idsImoveis) throws ErroRepositorioException{
  61 + Session session = HibernateUtil.getSession();
  62 +
  63 + try {
  64 + if (idsImoveis != null && idsImoveis.size() > 0){
  65 + StringBuilder sql = new StringBuilder();
  66 + sql.append(" update faturamento.debito_a_cobrar ")
  67 + .append(" set dbac_nnprestacaocobradas = dbac_nnprestacaocobradas - 1 ")
  68 + .append(" where dbac_amreferenciaprestacao >= :referencia ")
  69 + .append(" and dbac_nnprestacaocobradas > 0 ")
  70 + .append(" and imov_id in (:ids)");
  71 +
  72 + session.createSQLQuery(sql.toString())
  73 + .setParameter("referencia", referencia)
  74 + .setParameterList("ids", idsImoveis)
  75 + .executeUpdate();
  76 + }
  77 +
  78 + } catch (Exception e) {
  79 + throw new ErroRepositorioException(e);
  80 + }finally{
  81 + session.close();
  82 + }
  83 + }
  84 +
  85 + public void atualizarDebitoCobrar(List<DebitoACobrar> debitos) throws ErroRepositorioException {
  86 + for (DebitoACobrar debitoACobrar : debitos) {
  87 + atualizarDebitoCobrar(debitoACobrar);
  88 + }
  89 + }
  90 +
  91 + public void atualizarDebitoCobrar(DebitoACobrar debitoCobrar) throws ErroRepositorioException {
  92 + Session session = HibernateUtil.getSession();
  93 +
  94 + StringBuffer sql = new StringBuffer();
  95 +
  96 + sql.append(" update DebitoACobrar dc set");
  97 + sql.append(" dc.anoMesReferenciaPrestacao = :anoMesPrestacao, ");
  98 + sql.append(" dc.numeroPrestacaoCobradas = :numeroPrestacao, ");
  99 + sql.append(" dc.ultimaAlteracao = :dataAtual ");
  100 + sql.append(" where dc.id = :idDebitoAcobrar");
  101 +
  102 + try {
  103 + session.createQuery(sql.toString())
  104 + .setParameter("numeroPrestacao", debitoCobrar.getNumeroPrestacaoCobradas())
  105 + .setParameter("idDebitoAcobrar", debitoCobrar.getId())
  106 + .setParameter("anoMesPrestacao", debitoCobrar.getAnoMesReferenciaPrestacao())
  107 + .setParameter("dataAtual", new Date())
  108 + .executeUpdate();
  109 + } catch (Exception e) {
  110 + throw new ErroRepositorioException(e);
  111 + }finally{
  112 + session.close();
  113 + }
  114 + }
  115 +}
... ...
src/gcom/faturamento/repositorio/RepositorioFaturamentoSituacao.java 0 → 100644
... ... @@ -0,0 +1,59 @@
  1 +package gcom.faturamento.repositorio;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.Collection;
  5 +
  6 +import org.hibernate.Session;
  7 +
  8 +import gcom.faturamento.FaturamentoSituacaoHistorico;
  9 +import gcom.util.ErroRepositorioException;
  10 +import gcom.util.HibernateUtil;
  11 +
  12 +public class RepositorioFaturamentoSituacao {
  13 +
  14 + private static RepositorioFaturamentoSituacao instance;
  15 +
  16 + private RepositorioFaturamentoSituacao(){}
  17 +
  18 + public static RepositorioFaturamentoSituacao getInstance(){
  19 + if (instance == null){
  20 + instance = new RepositorioFaturamentoSituacao();
  21 + }
  22 +
  23 + return instance;
  24 + }
  25 +
  26 + public Collection<FaturamentoSituacaoHistorico> faturamentosHistoricoVigentesPorImovel(Integer imovelId) throws ErroRepositorioException{
  27 + Collection<FaturamentoSituacaoHistorico> retorno = situacoesEspeciaisFaturamentoVigentes(imovelId);
  28 +
  29 + if(retorno == null || retorno.isEmpty()) {
  30 + return new ArrayList<FaturamentoSituacaoHistorico>();
  31 + } else {
  32 + return retorno;
  33 + }
  34 + }
  35 +
  36 + @SuppressWarnings("unchecked")
  37 + public Collection<FaturamentoSituacaoHistorico> situacoesEspeciaisFaturamentoVigentes(Integer idImovel) throws ErroRepositorioException{
  38 + Session session = HibernateUtil.getSession();
  39 +
  40 + StringBuilder sql = new StringBuilder();
  41 + sql.append(" select t from FaturamentoSituacaoHistorico as t" )
  42 + .append(" where t.imovel.id = :idImovel ")
  43 + .append(" and t.anoMesFaturamentoRetirada is null" );
  44 +
  45 + Collection<FaturamentoSituacaoHistorico> retorno = new ArrayList<FaturamentoSituacaoHistorico>();
  46 +
  47 + try {
  48 + retorno = (Collection<FaturamentoSituacaoHistorico>) session.createQuery(sql.toString())
  49 + .setParameter("idImovel", idImovel)
  50 + .list();
  51 + } catch (Exception e) {
  52 + throw new ErroRepositorioException(e);
  53 + }finally{
  54 + session.close();
  55 + }
  56 +
  57 + return retorno;
  58 + }
  59 +}
... ...
src/gcom/faturamento/repositorio/RepositorioFaturamentoSituacaoTipo.java 0 → 100644
... ... @@ -0,0 +1,45 @@
  1 +package gcom.faturamento.repositorio;
  2 +
  3 +import org.hibernate.NonUniqueResultException;
  4 +import org.hibernate.Session;
  5 +
  6 +import gcom.faturamento.FaturamentoSituacaoTipo;
  7 +import gcom.util.ErroRepositorioException;
  8 +import gcom.util.HibernateUtil;
  9 +
  10 +public class RepositorioFaturamentoSituacaoTipo {
  11 +
  12 + private static RepositorioFaturamentoSituacaoTipo instance;
  13 +
  14 + private RepositorioFaturamentoSituacaoTipo(){}
  15 +
  16 + public static RepositorioFaturamentoSituacaoTipo getInstance(){
  17 + if (instance == null){
  18 + instance = new RepositorioFaturamentoSituacaoTipo();
  19 + }
  20 +
  21 + return instance;
  22 + }
  23 +
  24 +
  25 + public FaturamentoSituacaoTipo situacaoTipoDoImovel(Integer idImovel) throws ErroRepositorioException{
  26 + Session session = HibernateUtil.getSession();
  27 +
  28 + StringBuilder sql = new StringBuilder();
  29 + sql.append(" select tipo ")
  30 + .append(" from Imovel imovel ")
  31 + .append(" inner join imovel.faturamentoSituacaoTipo tipo ")
  32 + .append(" where imovel.id = :idImovel ");
  33 +
  34 + try {
  35 + return (FaturamentoSituacaoTipo) session.createQuery(sql.toString())
  36 + .setParameter("idImovel", idImovel)
  37 + .setMaxResults(1)
  38 + .uniqueResult();
  39 + } catch (NonUniqueResultException e) {
  40 + return null;
  41 + }catch (Exception e){
  42 + throw new ErroRepositorioException(e);
  43 + }
  44 + }
  45 +}
... ...
src/gcom/persistence/util/QueryUpdateBuilder.java 0 → 100644
... ... @@ -0,0 +1,130 @@
  1 +package gcom.persistence.util;
  2 +import java.util.HashMap;
  3 +import java.util.Map;
  4 +import java.util.Set;
  5 +
  6 +import org.hibernate.Query;
  7 +import org.hibernate.Session;
  8 +
  9 +
  10 +public class QueryUpdateBuilder {
  11 +
  12 + private Session session;
  13 +
  14 + private StringBuffer sqlStatement;
  15 + private StringBuffer sqlConditions;
  16 + private Query query;
  17 +
  18 + private Map<String, Object> parameters;
  19 +
  20 + public QueryUpdateBuilder(Session session, Class<?> klass){
  21 + this.session = session;
  22 +
  23 + parameters = new HashMap<String, Object>();
  24 + sqlStatement = new StringBuffer();
  25 + sqlConditions = new StringBuffer();
  26 +
  27 + sqlStatement.append("UPDATE ");
  28 + sqlStatement.append(klass.getSimpleName());
  29 + sqlStatement.append(" SET");
  30 + }
  31 +
  32 + public StringBuffer appendIfNotNull(String field, Object value) {
  33 + if (value != null) {
  34 + sqlStatement.append(" ");
  35 + sqlStatement.append(field);
  36 + sqlStatement.append(" = ");
  37 + sqlStatement.append(":");
  38 + sqlStatement.append(field);
  39 + sqlStatement.append(",");
  40 +
  41 + parameters.put(field, value);
  42 + }
  43 +
  44 + return sqlStatement;
  45 + }
  46 +
  47 + public StringBuffer appendCondition(String condition, String operator, Object value) {
  48 + if (sqlConditions.toString().isEmpty()) {
  49 + sqlConditions.append(" WHERE");
  50 + }
  51 +
  52 + sqlConditions.append(" ");
  53 + sqlConditions.append(condition);
  54 + sqlConditions.append(" ");
  55 + sqlConditions.append(operator);
  56 + sqlConditions.append(" :");
  57 + sqlConditions.append(condition);
  58 +
  59 + parameters.put(condition, value);
  60 +
  61 + return sqlConditions;
  62 + }
  63 +
  64 + public StringBuffer appendAndCondition(String condition, String operator, Object value) {
  65 + sqlConditions.append(" AND");
  66 +
  67 + return appendCondition(condition, operator, value);
  68 + }
  69 +
  70 + public StringBuffer appendOrCondition(String condition, String operator, Object value) {
  71 + sqlConditions.append(" OR");
  72 +
  73 + return appendCondition(condition, operator, value);
  74 + }
  75 +
  76 + public Query createUpdateQuery() {
  77 + query = (Query) session.createQuery(sql());
  78 +
  79 + Set<String> idsValue = parameters.keySet();
  80 + for (String idValue : idsValue) {
  81 + setParameterIfNotNull(idValue, parameters.get(idValue));
  82 + }
  83 +
  84 + return query;
  85 + }
  86 +
  87 + public StringBuffer getSqlStatement() {
  88 + return sqlStatement;
  89 + }
  90 +
  91 + public void setSqlStatement(StringBuffer sqlStatement) {
  92 + this.sqlStatement = sqlStatement;
  93 + }
  94 +
  95 + public StringBuffer getSqlConditions() {
  96 + return sqlConditions;
  97 + }
  98 +
  99 + public void setSqlConditions(StringBuffer sqlConditions) {
  100 + this.sqlConditions = sqlConditions;
  101 + }
  102 +
  103 + public Query getQuery() {
  104 + return query;
  105 + }
  106 +
  107 + public void setQuery(Query query) {
  108 + this.query = query;
  109 + }
  110 +
  111 + public Map<String, Object> getParameters() {
  112 + return parameters;
  113 + }
  114 +
  115 + public void setParameters(Map<String, Object> parameters) {
  116 + this.parameters = parameters;
  117 + }
  118 +
  119 + public String sql() {
  120 + return sqlStatement.substring(0, sqlStatement.length() - 1).concat(sqlConditions.toString());
  121 + }
  122 +
  123 + private Query setParameterIfNotNull(String name, Object value) {
  124 + if (value != null){
  125 + query.setParameter(name, value);
  126 + }
  127 +
  128 + return query;
  129 + }
  130 +}
... ...
src/gcom/properties/constantes_jndi.properties
1   -################################################################## # UTIL ################################################################### ## # FuncoesEJB ## funcoesEJB = FuncoesEJB ## # Controladores ## ControladorTabelaAuxiliar = ControladorTabelaAuxiliarGCOM ControladorUtil = ControladorUtilGCOM ControladorEndereco = ControladorEnderecoGCOM ControladorImovel = ControladorImovelGCOM ControladorMicromedicao = ControladorMicromedicaoGCOM ControladorCliente = ControladorClienteGCOM ControladorLocalidade = ControladorLocalidadeGCOM ControladorGeografico = ControladorGeograficoGCOM ControladorFaturamento = ControladorFaturamentoGCOM ControladorTarifaSocial = ControladorTarifaSocialGCOM QueueControladorFaturamento = queue/ControladorBatchFaturamentoGCOM QueueControladorArrecadacao = queue/ControladorBatchArrecadacaoGCOM QueueControladorMicromedicao = queue/ControladorBatchMicromedicaoGCOM ControladorTransacao = ControladorTransacaoGCOM ControladorArrecadacao = ControladorArrecadacaoGCOM ControladorAcesso = ControladorAcessoGCOM ControladorGerencialCadastro = ControladorGerencialCadastroGCOM ControladorGerencialCobranca = ControladorGerencialCobrancaGCOM ControladorGerencialFaturamento = ControladorGerencialFaturamentoGCOM ControladorUsuario = ControladorUsuarioGCOM ControladorGerencial = ControladorGerencialGCOM ControladorGerencialMicromedicao = ControladorGerencialMicromedicaoGCOM ControladorGerencialArrecadacao = ControladorGerencialArrecadacaoGCOM ControladorAtendimentoPublico = ControladorAtendimentoPublicoGCOM ControladorBatch = ControladorBatchGCOM ControladorUnidade = ControladorUnidadeGCOM ControladorRegistroAtendimento = ControladorRegistroAtendimentoGCOM ControladorOrdemServico = ControladorOrdemServicoGCOM ControladorLigacaoEsgoto = ControladorLigacaoEsgotoGCOM ControladorLigacaoAgua = ControladorLigacaoAguaGCOM ControladorPermissaoEspecial = ControladorPermissaoEspecialGCOM ControladorOperacional = ControladorOperacionalGCOM ControladorCadastro = ControladorCadastroGCOM ControladorGerencialImovel = ControladorGerencialImovelGCOM ControladorRelatorioFaturamento = ControladorRelatorioFaturamentoGCOM ControladorCobranca = ControladorCobrancaGCOM ControladorFinanceiro = ControladorFinanceiroGCOM ControladorCadastroCOMPESA = ControladorCadastroCOMPESA ControladorCadastroCAER = ControladorCadastroCAER ControladorCadastroCAERN = ControladorCadastroCAERN ControladorCadastroCOSANPA = ControladorCadastroCOSANPA ControladorCadastroJUAZEIRO = ControladorCadastroJUAZEIRO ControladorCadastroCOSAMA = ControladorCadastroCOSAMA ControladorFaturamentoCOMPESA = ControladorFaturamentoCOMPESA ControladorFaturamentoCAER = ControladorFaturamentoCAER ControladorFaturamentoCAERN = ControladorFaturamentoCAERN ControladorFaturamentoCOSANPA = ControladorFaturamentoCOSANPA ControladorFaturamentoJUAZEIRO = ControladorFaturamentoJUAZEIRO ControladorFaturamentoCOSAMA = ControladorFaturamentoCOSAMA ControladorArrecadacaoCOMPESA = ControladorArrecadacaoCOMPESA ControladorArrecadacaoCAER = ControladorArrecadacaoCAER ControladorArrecadacaoCAERN = ControladorArrecadacaoCAERN ControladorArrecadacaoCOSANPA = ControladorArrecadacaoCOSANPA ControladorArrecadacaoJUAZEIRO = ControladorArrecadacaoJUAZEIRO ControladorArrecadacaoCOSAMA = ControladorArrecadacaoCOSAMA ControladorCobrancaCOMPESA = ControladorCobrancaCOMPESA ControladorCobrancaCAER = ControladorCobrancaCAER ControladorCobrancaCAERN = ControladorCobrancaCAERN ControladorCobrancaCOSANPA = ControladorCobrancaCOSANPA ControladorCobrancaJUAZEIRO = ControladorCobrancaJUAZEIRO ControladorCobrancaCOSAMA = ControladorCobrancaCOSAMA ControladorFinanceiroCOMPESA = ControladorFinanceiroCOMPESA ControladorFinanceiroCAER = ControladorFinanceiroCAER ControladorFinanceiroCAERN = ControladorFinanceiroCAERN ControladorFinanceiroCOSANPA = ControladorFinanceiroCOSANPA ControladorFinanceiroJUAZEIRO = ControladorFinanceiroJUAZEIRO ControladorFinanceiroCOSAMA = ControladorFinanceiroCOSAMA ControladorSpcSerasa = ControladorSpcSerasaGCOM ControladorIntegracao = ControladorIntegracaoGCOM ControladorContratoParcelamento = ControladorContratoParcelamentoGCOM ControladorAtualizacaoCadastral = ControladorAtualizacaoCadastralGCOM QueueBatchConsistirLeiturasCalcularConsumosMDB = queue/BatchConsistirLeiturasCalcularConsumosMDB QueueBatchGerarDadosParaLeituraMDB = queue/BatchGerarDadosParaLeituraMDB QueueBatchFaturarGrupoFaturamentoMDB = queue/BatchFaturarGrupoFaturamentoMDB QueueBatchEfetuarRateioConsumoMDB = queue/BatchEfetuarRateioConsumoMDB QueueBatchGerarDebitoACobrarDeAcrescimoPorImpontualidadeMDB = queue/BatchGerarDebitoACobrarDeAcrescimoPorImpontualidadeMDB QueueBatchGerarTaxaEntregaOutroEnderecoMDB = queue/BatchGerarTaxaEntregaOutroEnderecoMDB QueueBatchGerarDadosDiariosArrecadacaoMDB = queue/BatchGerarDadosDiariosArrecadacaoMDB QueueBatchGerarAtividadeAcaoCobrancaMDB = queue/BatchGerarAtividadeAcaoCobrancaMDB QueueBatchEmitirContasMDB = queue/BatchEmitirContasMDB QueueBatchClassificarPagamentosDevolucoesMDB = queue/BatchClassificarPagamentosDevolucoesMDB QueueBatchEncerrarArrecadacaoMesMDB = queue/BatchEncerrarArrecadacaoMesMDB QueueBatchGerarDebitoACobrarDoacaoMDB = queue/BatchGerarDebitoACobrarDoacaoMDB QueueBatchEncerrarFaturamentoMesMDB = queue/BatchEncerrarFaturamentoMesMDB QueueBatchGerarResumoLigacoesEconomiasMDB = queue/BatchGerarResumoLigacoesEconomiasMDB QueueBatchGerarResumoSituacaoEspecialFaturamentoMDB = queue/BatchGerarResumoSituacaoEspecialFaturamentoMDB QueueBatchGerarResumoAcoesCobrancaCronogramaMDB = queue/BatchGerarResumoAcoesCobrancaCronogramaMDB QueueBatchGerarResumoAnormalidadesMDB = queue/BatchGerarResumoAnormalidadesMDB QueueBatchGerarResumoSituacaoEspecialCobrancaMDB = queue/BatchGerarResumoSituacaoEspecialCobrancaMDB QueueBatchEmitirExtratoConsumoImovelCondominioMDB = queue/BatchEmitirExtratoConsumoImovelCondominioMDB QueueBatchGerarFaturaClienteResponsavelMDB = queue/BatchGerarFaturaClienteResponsavelMDB QueueBatchGerarHistoricoParaEncerrarArrecadacaoMesMDB = queue/BatchGerarHistoricoParaEncerrarArrecadacaoMesMDB QueueBatchGerarHistoricoParaEncerrarFaturamentoMesMDB = queue/BatchGerarHistoricoParaEncerrarFaturamentoMesMDB QueueBatchDesfazerParcelamentoPorEntradaNaoPagaMDB = queue/BatchDesfazerParcelamentoPorEntradaNaoPagaMDB QueueBatchGerarHistoricoContaMDB = queue/BatchGerarHistoricoContaMDB QueueBatchGerarResumoInstalacoesHidrometrosMDB = queue/BatchGerarResumoInstalacoesHidrometrosMDB QueueBatchGerarResumoConsumoAguaMDB = queue/BatchGerarResumoConsumoAguaMDB QueueBatchInserirResumoAcoesCobrancaCronogramaMDB = queue/BatchInserirResumoAcoesCobrancaCronogramaMDB QueueBatchGerarResumoLeituraAnormalidadeMDB = queue/BatchGerarResumoLeituraAnormalidadeMDB QueueBatchGerarResumoParcelamentoMDB = queue/BatchGerarResumoParcelamentoMDB QueueBatchGerarLancamentosContabeisFaturamentoMDB = queue/BatchGerarLancamentosContabeisFaturamentoMDB QueueBatchGerarLancamentosContabeisArrecadacaoMDB = queue/BatchGerarLancamentosContabeisArrecadacaoMDB QueueBatchGerarLancamentosContabeisAvisosBancariosMDB = queue/BatchGerarLancamentosContabeisAvisosBancariosMDB QueueBatchGerarResumoHidrometroMDB = queue/BatchGerarResumoHidrometroMDB QueueBatchGerarResumoRegistroAtendimentoMDB = queue/BatchGerarResumoRegistroAtendimentoMDB QueueBatchGerarResumoHistogramaAguaEsgotoMDB = queue/BatchGerarResumoHistogramaAguaEsgotoMDB QueueBatchGerarResumoFaturamentoAguaEsgotoMDB = queue/BatchGerarResumoFaturamentoAguaEsgotoMDB QueueBatchEmitirBoletimCadastroMDB = queue/BatchEmitirBoletimCadastroMDB QueueBatchGerarResumoArrecadacaoMDB = queue/BatchGerarResumoArrecadacaoMDB QueueBatchGerarResumoDevedoresDuvidososMDB = queue/BatchGerarResumoDevedoresDuvidososMDB QueueBatchApagarResumoDevedoresDuvidososMDB = queue/BatchApagarResumoDevedoresDuvidososMDB QueueBatchGerarResumoAcoesCobrancaEventualMDB = queue/BatchGerarResumoAcoesCobrancaEventualMDB QueueBatchAtualizarResumoDevedoresDuvidososMDB = queue/BatchAtualizarResumoDevedoresDuvidososMDB QueueBatchInserirResumoAcoesCobrancaEventualMDB = queue/BatchInserirResumoAcoesCobrancaEventualMDB QueueBatchGerarLancamentosContabeisDevedoresDuvidososMDB = queue/BatchGerarLancamentosContabeisDevedoresDuvidososMDB QueueBatchGerarResumoPendenciaMDB = queue/BatchGerarResumoPendenciaMDB QueueBatchGerarGuiaPagamentoPorClienteResumoPendenciaMDB = queue/BatchGerarGuiaPagamentoPorClienteResumoPendenciaMDB QueueBatchGerarResumoMetasMDB = queue/BatchGerarResumoMetasMDB QueueBatchGerarResumoMetasAcumuladoMDB = queue/BatchGerarResumoMetasAcumuladoMDB QueueBatchEmitirContasOrgaoPublicoMDB = queue/BatchEmitirContasOrgaoPublicoMDB QueueBatchGerarArquivoTextoParaLeituristaMDB = queue/BatchGerarArquivoTextoParaLeituristaMDB QueueBatchGerarResumoColetaEsgotoMDB = queue/BatchGerarResumoColetaEsgotoMDB QueueBatchGerarContasAReceberContabilMDB = queue/BatchGerarContasAReceberContabilMDB QueueBatchGerarResumoDocumentosAReceberMDB = queue/BatchGerarResumoDocumentosAReceberMDB QueueBatchProcessarCobrancaDocumentosItensMDB = queue/BatchProcessarCobrancaDocumentosItensMDB QueueBatchGerarResumoDiarioNegativacaoMDB = queue/BatchGerarResumoDiarioNegativacaoMDB QueueExecutarComandoNegativacaoMDB = queue/BatchExecutarComandoNegativacaoMDB QueueBatchAtualizarLigacaoAguaLigadoAnaliseParaLigadoMDB = queue/BatchAtualizarLigacaoAguaLigadoAnaliseParaLigadoMDB QueueBatchAtualizarNumeroExecucaoResumoNegativacaoMDB = queue/BatchAtualizarNumeroExecucaoResumoNegativacaoMDB QueueBatchGerarMovimentoExclusaoNegativacaoMDB = queue/BatchGerarMovimentoExclusaoNegativacaoMDB QueueBatchGerarMovimentoRetornoNegativacaoMDB = queue/BatchGerarMovimentoRetornoNegativacaoMDB QueueBatchAtualizarDiferencaAcumuladaNoMesMDB = queue/BatchAtualizarDiferencaAcumuladaNoMesMDB QueueBatchGerarMovimentoHidrometroMDB = queue/BatchGerarMovimentoHidrometroMDB ################################################################## # UTIL ################################################################### ## # FuncoesEJB ## ## # Controladores ## QueueBatchGerarResumoAcoesCobrancaCronogramaEncerrarOSMDB = queue/BatchGerarResumoAcoesCobrancaCronogramaEncerrarOSMDB QueueBatchGerarResumoReFaturamentoMDB = queue/BatchGerarResumoReFaturamentoMDB QueueBatchExecutarComandoEncerramentoRAMDB = queue/BatchExecutarComandoEncerramentoRAMDB QueueBatchGerarValorVolumesConsumidosNaoFaturadosMDB = queue/BatchGerarValorVolumesConsumidosNaoFaturadosMDB QueueBatchGerarResumoIndicadoresComercializacaoMDB = queue/BatchGerarResumoIndicadoresComercializacaoMDB QueueBatchGerarResumoIndicadoresMicromedicaoMDB = queue/BatchGerarResumoIndicadoresMicromedicaoMDB QueueBatchGerarResumoIndicadoresFaturamentoMDB = queue/BatchGerarResumoIndicadoresFaturamentoMDB QueueBatchGerarResumoIndicadoresCobrancaMDB = queue/BatchGerarResumoIndicadoresCobrancaMDB QueueBatchGerarResumoFaturamentoMDB = queue/BatchGerarResumoFaturamentoMDB QueueBatchGerarResumoReFaturamentoOlapMDB = queue/BatchGerarResumoReFaturamentoOlapMDB QueueBatchAtualizaQuantidadeParcelaPagaConsecutivaParcelaBonusMDB = queue/BatchAtualizaQuantidadeParcelaPagaConsecutivaParcelaBonusMDB QueueBatchExecutarComandoNegativacaoMDB = queue/BatchExecutarComandoNegativacaoMDB QueueBatchRelatorioContasBaixadasContabilmenteMDB = queue/BatchRelatorioContasBaixadasContabilmenteMDB QueueBatchIncluirDebitoACobrarEntradaParcelamentoNaoPagaMDB = queue/BatchIncluirDebitoACobrarEntradaParcelamentoNaoPagaMDB QueueBatchAtualizarPagamentosContasCobrancaMDB = queue/BatchAtualizarPagamentosContasCobrancaMDB QueueBatchGerarMovimentoContasCobrancaPorEmpresaMDB = queue/BatchGerarMovimentoContasCobrancaPorEmpresaMDB QueueBatchGerarArquivoTextoContasCobrancaMDB = queue/BatchGerarArquivoTextoContasCobrancaEmpresaMDB QueueBatchGerarCreditoSituacaoEspecialFaturamentoMDB = queue/BatchGerarCreditoSituacaoEspecialFaturamentoMDB QueueBatchGerarMovimentoExtensaoContasCobrancaPorEmpresaMDB = queue/BatchGerarMovimentoExtensaoContasCobrancaPorEmpresaMDB QueueBatchAtualizarAutosInfracaoPrazoRecursoVencidoMDB = queue/BatchAtualizarAutosInfracaoPrazoRecursoVencidoMDB QueueBatchGerarCartasCampanhaSolidariedadeCriancaParaNegociacaoAVistaMDB = queue/BatchGerarCartasCampanhaSolidariedadeCriancaParaNegociacaoAVistaMDB QueueBatchEmitirCartasCampanhaSolidariedadeCriancaParaNegociacaoAVistaMDB = queue/BatchEmitirCartasCampanhaSolidariedadeCriancaParaNegociacaoAVistaMDB QueueBatchGerarMovimentoHidrometroMDB = queue/BatchGerarMovimentoHidrometroMDB QueueBatchAtualizarConjuntoHidrometroMDB = queue/BatchAtualizarConjuntoHidrometroMDB QueueBatchGerarTabelasTemporariasAtualizacaoCadastralMDB = queue/BatchGerarTabelasTemporariasAtualizacaoCadastralMDB QueueBatchGerarArquivoTextoAtualizacaoCadastralMDB = queue/BatchGerarArquivoTextoAtualizacaoCadastralMDB QueueBatchEmitirBoletosMDB = queue/BatchEmitirBoletosMDB QueueBatchRetificarConjuntoContaConsumosMDB = queue/BatchRetificarConjuntoContaConsumosMDB
2   - QueueBatchGerarBonusTarifaSocialMDB = queue/BatchGerarBonusTarifaSocialMDB QueueBatchExcluirImoveisDaTarifaSocialMDB = queue/BatchExcluirImoveisDaTarifaSocialMDB QueueBatchGerarArquivoTextoPagamentosContasCobrancaEmpresaMDB = queue/BatchGerarArquivoTextoPagamentosContasCobrancaEmpresaMDB QueueBatchGerarResumoNegativacaoMDB = queue/BatchGerarResumoNegativacaoMDB QueueBatchAcompanharPagamentoDoParcelamentoMDB = queue/BatchAcompanharPagamentoDoParcelamentoMDB QueueBatchGerarCartasDeFinalDeAnoMDB = queue/BatchGerarCartasDeFinalDeAnoMDB QueueBatchEmitirCartasDeFinalDeAnoMDB = queue/BatchEmitirCartasDeFinalDeAnoMDB QueueBatchGerarArquivoTextoContasProjetosEspeciaisMDB = queue/BatchGerarArquivoTextoContasProjetosEspeciaisMDB QueueBatchInserirPagamentosFaturasEspeciaisMDB = queue/BatchInserirPagamentosFaturasEspeciaisMDB QueueBatchSuspenderImovelEmProgramaEspecialMDB = queue/BatchSuspenderImovelEmProgramaEspecialMDB QueueBatchGerarResumoSimulacaoFaturamentoMDB = queue/BatchGerarResumoSimulacaoFaturamentoMDB QueueBatchEmitirOrdemDeFiscalizacaoMDB = queue/BatchEmitirOrdemDeFiscalizacaoMDB QueueBatchGerarArquivoOrdemDeFiscalizacaoMDB = queue/BatchGerarArquivoOrdemDeFiscalizacaoMDB QueueBatchDeterminarConfirmacaoDaNegativacaoMDB = queue/BatchDeterminarConfirmacaoDaNegativacaoMDB QueueBatchEnvioEmailContaParaClienteMDB = queue/BatchEnvioEmailContaParaClienteMDB QueueBatchGerarResumoPendenciaPorAnoMDB = queue/BatchGerarResumoPendenciaPorAnoMDB QueueBatchAtualizarComandoAtividadeAcaoCobrancaMDB = queue/BatchAtualizarComandoAtividadeAcaoCobrancaMDB QueueBatchEmitirDocumentoCobrancaMDB = queue/BatchEmitirDocumentoCobrancaMDB QueueBatchAtualizarCodigoDebitoAutomaticoMDB = queue/BatchAtualizarCodigoDebitoAutomaticoMDB QueueBatchGerarDadosDeclaracaoQuitacaoAnualDebitosMDB = queue/BatchGerarDadosDeclaracaoQuitacaoAnualDebitosMDB QueueBatchGerarArquivoTextoDeclaracaoQuitacaoAnualDebitosMDB = queue/BatchGerarArquivoTextoDeclaracaoQuitacaoAnualDebitosMDB QueueBatchGerarResumoLigacoesEconomiasPorAnoMDB = queue/BatchGerarResumoLigacoesEconomiasPorAnoMDB QueueBatchGerarResumoReceitaMDB = queue/BatchGerarResumoReceitaMDB QueueBatchGerarResumoConsumoAguaPorAnoMDB = queue/BatchGerarResumoConsumoAguaPorAnoMDB QueueBatchGerarResumoFaturamentoPorAnoMDB = queue/BatchGerarResumoFaturamentoPorAnoMDB QueueBatchGerarResumoIndicadoresMicromedicaoPorAnoMDB = queue/BatchGerarResumoIndicadoresMicromedicaoPorAnoMDB QueueBatchGerarResumoArrecadacaoPorAnoMDB = queue/BatchGerarResumoArrecadacaoPorAnoMDB QueueBatchGerarResumoColetaEsgotoPorAnoMDB = queue/BatchGerarResumoColetaEsgotoPorAnoMDB QueueBatchGerarResumoRegistroAtendimentoPorAnoMDB = queue/BatchGerarResumoRegistroAtendimentoPorAnoMDB QueueBatchGerarResumoInstalacoesHidrometrosPorAnoMDB = queue/BatchGerarResumoInstalacoesHidrometrosPorAnoMDB QueueBatchGerarResumoParcelamentoPorAnoMDB = queue/BatchGerarResumoParcelamentoPorAnoMDB QueueBatchGerarTaxaPercentualTarifaMinimaCortadoMDB = queue/BatchGerarTaxaPercentualTarifaMinimaCortadoMDB QueueBatchGerarResumoReFaturamentoNovoMDB = queue/BatchGerarResumoReFaturamentoNovoMDB QueueBatchAlterarInscricaoImovelMDB = queue/BatchAlterarInscricaoImovelMDB QueueBatchGerarPrescreverDebitosDeImoveisMDB = queue/BatchGerarPrescreverDebitosDeImoveisMDB QueueBatchVerificarFaturamentoImoveisCortadosMDB = queue/BatchVerificarFaturamentoImoveisCortadosMDB QueueBatchGerarResumoHistogramaAguaEsgotoSemQuadraMDB = queue/BatchGerarResumoHistogramaAguaEsgotoSemQuadraMDB QueueBatchReligarImoveisCortadosComConsumoRealMDB = queue/BatchReligarImoveisCortadosComConsumoRealMDB QueueBatchPrescreverDebitosImoveisPublicosManualMDB = queue/BatchPrescreverDebitosImoveisPublicosManualMDB QueueBatchPrescreverDebitosImoveisPublicosAutomaticoMDB = queue/BatchPrescreverDebitosImoveisPublicosAutomaticoMDB QueueBatchProcessarEncerramentoOSAcaoCobrancaMDB = queue/BatchProcessarEncerramentoOSAcaoCobrancaMDB QueueBatchAutomatizarPerfisDeGrandesConsumidoresMDB = queue/BatchAutomatizarPerfisDeGrandesConsumidoresMDB QueueBatchGerarRAOSAnormalidadeConsumoMDB = queue/BatchGerarRAOSAnormalidadeConsumoMDB QueueBatchProcessarComandoGeradoMDB = queue/BatchProcessarComandoGeradoMDB QueueBatchGerarCartaTarifaSocialMDB = queue/BatchGerarCartaTarifaSocialMDB QueueBatchRetirarImovelTarifaSocialMDB = queue/BatchRetirarImovelTarifaSocialMDB QueueBatchGerarTxtImpressaoContasBrailleMDB = queue/BatchGerarTxtImpressaoContasBrailleMDB QueueBatchEncerrarComandosDeCobrancaPorEmpresaMDB = queue/BatchEncerrarComandosDeCobrancaPorEmpresaMDB QueueBatchGerarTxtOsInspecaoAnormalidadeMDB = queue/BatchGerarTxtOsInspecaoAnormalidadeMDB QueueBatchProcessarArquivoTxtEncerramentoOSCobrancaMDB = queue/BatchProcessarArquivoTxtEncerramentoOSCobrancaMDB QueueBatchGerarArquivoTextoOSContasPagasParceladasMDB = queue/BatchGerarArquivoTextoOSContasPagasParceladasMDB QueueBatchEncerrarComandoOSSeletivaInspecaoAnormalidadeMDB = queue/BatchEncerrarComandoOSSeletivaInspecaoAnormalidadeMDB QueueBatchProgramacaoAutoRoteiroAcompServicoMDB = queue/BatchProgramacaoAutoRoteiroAcompServicoMDB QueueBatchGerarDadosArquivoAcompanhamentoServicoMDB = queue/BatchGerarDadosArquivoAcompanhamentoServicoMDB QueueBatchProcessarEncerramentoOSFiscalizacaoDecursoPrazoMDB = queue/BatchProcessarEncerramentoOSFiscalizacaoDecursoPrazoMDB QueueBatchSuspenderLeituraParaImovelComHidrometroRetiradoMDB = queue/BatchSuspenderLeituraParaImovelComHidrometroRetiradoMDB QueueBatchSuspenderLeituraParaImovelComConsumoRealNaoSuperiorA10MDB = queue/BatchSuspenderLeituraParaImovelComConsumoRealNaoSuperiorA10MDB QueueBatchGerarDadosRelatorioBIGMDB = queue/BatchGerarDadosRelatorioBIGMDB QueueBatchProcessarPagamentosDiferencaDoisReaisMDB = queue/BatchProcessarPagamentosDiferencaDoisReaisMDB QueueBatchCancelarGuiasPagamentoNaoPagasMDB = queue/BatchCancelarGuiasPagamentoNaoPagas QueueBatchAtualizacaoCadastralMDB = queue/BatchAtualizacaoCadastralMDB QueueBatchGerarDadosReceitasAFaturarResumoMDB = queue/BatchGerarDadosReceitasAFaturarResumoMDB
3 1 \ No newline at end of file
  2 +################################################################## # UTIL ################################################################### ## # FuncoesEJB ## funcoesEJB = FuncoesEJB ## # Controladores ## ControladorDebitoACobrar = ControladorDebitoACobrarGCOM ControladorAnaliseGeracaoConta = ControladorAnaliseGeracaoContaGCOM ControladorTabelaAuxiliar = ControladorTabelaAuxiliarGCOM ControladorUtil = ControladorUtilGCOM ControladorEndereco = ControladorEnderecoGCOM ControladorImovel = ControladorImovelGCOM ControladorMicromedicao = ControladorMicromedicaoGCOM ControladorCliente = ControladorClienteGCOM ControladorLocalidade = ControladorLocalidadeGCOM ControladorGeografico = ControladorGeograficoGCOM ControladorFaturamento = ControladorFaturamentoGCOM ControladorTarifaSocial = ControladorTarifaSocialGCOM QueueControladorFaturamento = queue/ControladorBatchFaturamentoGCOM QueueControladorArrecadacao = queue/ControladorBatchArrecadacaoGCOM QueueControladorMicromedicao = queue/ControladorBatchMicromedicaoGCOM ControladorTransacao = ControladorTransacaoGCOM ControladorArrecadacao = ControladorArrecadacaoGCOM ControladorAcesso = ControladorAcessoGCOM ControladorGerencialCadastro = ControladorGerencialCadastroGCOM ControladorGerencialCobranca = ControladorGerencialCobrancaGCOM ControladorGerencialFaturamento = ControladorGerencialFaturamentoGCOM ControladorUsuario = ControladorUsuarioGCOM ControladorGerencial = ControladorGerencialGCOM ControladorGerencialMicromedicao = ControladorGerencialMicromedicaoGCOM ControladorGerencialArrecadacao = ControladorGerencialArrecadacaoGCOM ControladorAtendimentoPublico = ControladorAtendimentoPublicoGCOM ControladorBatch = ControladorBatchGCOM ControladorUnidade = ControladorUnidadeGCOM ControladorRegistroAtendimento = ControladorRegistroAtendimentoGCOM ControladorOrdemServico = ControladorOrdemServicoGCOM ControladorLigacaoEsgoto = ControladorLigacaoEsgotoGCOM ControladorLigacaoAgua = ControladorLigacaoAguaGCOM ControladorPermissaoEspecial = ControladorPermissaoEspecialGCOM ControladorOperacional = ControladorOperacionalGCOM ControladorCadastro = ControladorCadastroGCOM ControladorGerencialImovel = ControladorGerencialImovelGCOM ControladorRelatorioFaturamento = ControladorRelatorioFaturamentoGCOM ControladorCobranca = ControladorCobrancaGCOM ControladorFinanceiro = ControladorFinanceiroGCOM ControladorCadastroCOMPESA =ControladorCadastroCOMPESA ControladorCadastroCOMPESA ControladorCadastroCOMPESAControladorCadastroCAER =ControladorCadastroCAER ControladorCadastroCAER ControladorCadastroCAERControladorCadastroCAERN =ControladorCadastroCAERN ControladorCadastroCAERN ControladorCadastroCAERNControladorCadastroCOSANPA =ControladorCadastroCOSANPA ControladorCadastroCOSANPA ControladorCadastroCOSANPAControladorCadastroJUAZEIRO =ControladorCadastroJUAZEIRO ControladorCadastroJUAZEIRO ControladorCadastroJUAZEIROControladorCadastroCOSAMA = ControladorCadastroCOSAMA ControladorFaturamentoCOMPESA = ControladorFaturamentoCOMPESA ControladorFaturamentoCAER = ControladorFaturamentoCAER ControladorFaturamentoCAERN = ControladorFaturamentoCAERN ControladorFaturamentoCOSANPA = ControladorFaturamentoCOSANPA ControladorFaturamentoJUAZEIRO = ControladorFaturamentoJUAZEIRO ControladorFaturamentoCOSAMA = ControladorFaturamentoCOSAMA ControladorArrecadacaoCOMPESA = ControladorArrecadacaoCOMPESA ControladorArrecadacaoCAER = ControladorArrecadacaoCAER ControladorArrecadacaoCAERN = ControladorArrecadacaoCAERN ControladorArrecadacaoCOSANPA = ControladorArrecadacaoCOSANPA ControladorArrecadacaoJUAZEIRO = ControladorArrecadacaoJUAZEIRO ControladorArrecadacaoCOSAMA = ControladorArrecadacaoCOSAMA ControladorCobrancaCOMPESA = ControladorCobrancaCOMPESA ControladorCobrancaCAER = ControladorCobrancaCAER ControladorCobrancaCAERN = ControladorCobrancaCAERN ControladorCobrancaCOSANPA = ControladorCobrancaCOSANPA ControladorCobrancaJUAZEIRO = ControladorCobrancaJUAZEIRO ControladorCobrancaCOSAMA = ControladorCobrancaCOSAMA ControladorFinanceiroCOMPESA = ControladorFinanceiroCOMPESA ControladorFinanceiroCAER = ControladorFinanceiroCAER ControladorFinanceiroCAERN = ControladorFinanceiroCAERN ControladorFinanceiroCOSANPA = ControladorFinanceiroCOSANPA ControladorFinanceiroJUAZEIRO = ControladorFinanceiroJUAZEIRO ControladorFinanceiroCOSAMA = ControladorFinanceiroCOSAMA ControladorSpcSerasa = ControladorSpcSerasaGCOM ControladorIntegracao = ControladorIntegracaoGCOM ControladorContratoParcelamento = ControladorContratoParcelamentoGCOM ControladorAtualizacaoCadastral = ControladorAtualizacaoCadastralGCOM QueueBatchConsistirLeiturasCalcularConsumosMDB = queue/BatchConsistirLeiturasCalcularConsumosMDB QueueBatchGerarDadosParaLeituraMDB = queue/BatchGerarDadosParaLeituraMDB QueueBatchFaturarGrupoFaturamentoMDB = queue/BatchFaturarGrupoFaturamentoMDB QueueBatchEfetuarRateioConsumoMDB = queue/BatchEfetuarRateioConsumoMDB QueueBatchGerarDebitoACobrarDeAcrescimoPorImpontualidadeMDB = queue/BatchGerarDebitoACobrarDeAcrescimoPorImpontualidadeMDB QueueBatchGerarTaxaEntregaOutroEnderecoMDB = queue/BatchGerarTaxaEntregaOutroEnderecoMDB QueueBatchGerarDadosDiariosArrecadacaoMDB = queue/BatchGerarDadosDiariosArrecadacaoMDB QueueBatchGerarAtividadeAcaoCobrancaMDB = queue/BatchGerarAtividadeAcaoCobrancaMDB QueueBatchEmitirContasMDB = queue/BatchEmitirContasMDB QueueBatchClassificarPagamentosDevolucoesMDB = queue/BatchClassificarPagamentosDevolucoesMDB QueueBatchEncerrarArrecadacaoMesMDB = queue/BatchEncerrarArrecadacaoMesMDB QueueBatchGerarDebitoACobrarDoacaoMDB = queue/BatchGerarDebitoACobrarDoacaoMDB QueueBatchEncerrarFaturamentoMesMDB = queue/BatchEncerrarFaturamentoMesMDB QueueBatchGerarResumoLigacoesEconomiasMDB = queue/BatchGerarResumoLigacoesEconomiasMDB QueueBatchGerarResumoSituacaoEspecialFaturamentoMDB = queue/BatchGerarResumoSituacaoEspecialFaturamentoMDB QueueBatchGerarResumoAcoesCobrancaCronogramaMDB = queue/BatchGerarResumoAcoesCobrancaCronogramaMDB QueueBatchGerarResumoAnormalidadesMDB = queue/BatchGerarResumoAnormalidadesMDB QueueBatchGerarResumoSituacaoEspecialCobrancaMDB = queue/BatchGerarResumoSituacaoEspecialCobrancaMDB QueueBatchEmitirExtratoConsumoImovelCondominioMDB = queue/BatchEmitirExtratoConsumoImovelCondominioMDB QueueBatchGerarFaturaClienteResponsavelMDB = queue/BatchGerarFaturaClienteResponsavelMDB QueueBatchGerarHistoricoParaEncerrarArrecadacaoMesMDB = queue/BatchGerarHistoricoParaEncerrarArrecadacaoMesMDB QueueBatchGerarHistoricoParaEncerrarFaturamentoMesMDB = queue/BatchGerarHistoricoParaEncerrarFaturamentoMesMDB QueueBatchDesfazerParcelamentoPorEntradaNaoPagaMDB = queue/BatchDesfazerParcelamentoPorEntradaNaoPagaMDB QueueBatchGerarHistoricoContaMDB = queue/BatchGerarHistoricoContaMDB QueueBatchGerarResumoInstalacoesHidrometrosMDB = queue/BatchGerarResumoInstalacoesHidrometrosMDB QueueBatchGerarResumoConsumoAguaMDB = queue/BatchGerarResumoConsumoAguaMDB QueueBatchInserirResumoAcoesCobrancaCronogramaMDB = queue/BatchInserirResumoAcoesCobrancaCronogramaMDB QueueBatchGerarResumoLeituraAnormalidadeMDB = queue/BatchGerarResumoLeituraAnormalidadeMDB QueueBatchGerarResumoParcelamentoMDB = queue/BatchGerarResumoParcelamentoMDB QueueBatchGerarLancamentosContabeisFaturamentoMDB = queue/BatchGerarLancamentosContabeisFaturamentoMDB QueueBatchGerarLancamentosContabeisArrecadacaoMDB = queue/BatchGerarLancamentosContabeisArrecadacaoMDB QueueBatchGerarLancamentosContabeisAvisosBancariosMDB = queue/BatchGerarLancamentosContabeisAvisosBancariosMDB QueueBatchGerarResumoHidrometroMDB = queue/BatchGerarResumoHidrometroMDB QueueBatchGerarResumoRegistroAtendimentoMDB = queue/BatchGerarResumoRegistroAtendimentoMDB QueueBatchGerarResumoHistogramaAguaEsgotoMDB = queue/BatchGerarResumoHistogramaAguaEsgotoMDB QueueBatchGerarResumoFaturamentoAguaEsgotoMDB = queue/BatchGerarResumoFaturamentoAguaEsgotoMDB QueueBatchEmitirBoletimCadastroMDB = queue/BatchEmitirBoletimCadastroMDB QueueBatchGerarResumoArrecadacaoMDB = queue/BatchGerarResumoArrecadacaoMDB QueueBatchGerarResumoDevedoresDuvidososMDB = queue/BatchGerarResumoDevedoresDuvidososMDB QueueBatchApagarResumoDevedoresDuvidososMDB = queue/BatchApagarResumoDevedoresDuvidososMDB QueueBatchGerarResumoAcoesCobrancaEventualMDB = queue/BatchGerarResumoAcoesCobrancaEventualMDB QueueBatchAtualizarResumoDevedoresDuvidososMDB = queue/BatchAtualizarResumoDevedoresDuvidososMDB QueueBatchInserirResumoAcoesCobrancaEventualMDB = queue/BatchInserirResumoAcoesCobrancaEventualMDB QueueBatchGerarLancamentosContabeisDevedoresDuvidososMDB = queue/BatchGerarLancamentosContabeisDevedoresDuvidososMDB QueueBatchGerarResumoPendenciaMDB = queue/BatchGerarResumoPendenciaMDB QueueBatchGerarGuiaPagamentoPorClienteResumoPendenciaMDB = queue/BatchGerarGuiaPagamentoPorClienteResumoPendenciaMDB QueueBatchGerarResumoMetasMDB = queue/BatchGerarResumoMetasMDB QueueBatchGerarResumoMetasAcumuladoMDB = queue/BatchGerarResumoMetasAcumuladoMDB QueueBatchEmitirContasOrgaoPublicoMDB = queue/BatchEmitirContasOrgaoPublicoMDB QueueBatchGerarArquivoTextoParaLeituristaMDB = queue/BatchGerarArquivoTextoParaLeituristaMDB QueueBatchGerarResumoColetaEsgotoMDB = queue/BatchGerarResumoColetaEsgotoMDB QueueBatchGerarContasAReceberContabilMDB = queue/BatchGerarContasAReceberContabilMDB QueueBatchGerarResumoDocumentosAReceberMDB = queue/BatchGerarResumoDocumentosAReceberMDB QueueBatchProcessarCobrancaDocumentosItensMDB = queue/BatchProcessarCobrancaDocumentosItensMDB QueueBatchGerarResumoDiarioNegativacaoMDB = queue/BatchGerarResumoDiarioNegativacaoMDB QueueExecutarComandoNegativacaoMDB = queue/BatchExecutarComandoNegativacaoMDB QueueBatchAtualizarLigacaoAguaLigadoAnaliseParaLigadoMDB = queue/BatchAtualizarLigacaoAguaLigadoAnaliseParaLigadoMDB QueueBatchAtualizarNumeroExecucaoResumoNegativacaoMDB = queue/BatchAtualizarNumeroExecucaoResumoNegativacaoMDB QueueBatchGerarMovimentoExclusaoNegativacaoMDB = queue/BatchGerarMovimentoExclusaoNegativacaoMDB QueueBatchGerarMovimentoRetornoNegativacaoMDB = queue/BatchGerarMovimentoRetornoNegativacaoMDB QueueBatchAtualizarDiferencaAcumuladaNoMesMDB = queue/BatchAtualizarDiferencaAcumuladaNoMesMDB QueueBatchGerarMovimentoHidrometroMDB = queue/BatchGerarMovimentoHidrometroMDB ################################################################## # UTIL ################################################################### ## # FuncoesEJB ## ## # Controladores ## QueueBatchGerarResumoAcoesCobrancaCronogramaEncerrarOSMDB = queue/BatchGerarResumoAcoesCobrancaCronogramaEncerrarOSMDB QueueBatchGerarResumoReFaturamentoMDB = queue/BatchGerarResumoReFaturamentoMDB QueueBatchExecutarComandoEncerramentoRAMDB = queue/BatchExecutarComandoEncerramentoRAMDB QueueBatchGerarValorVolumesConsumidosNaoFaturadosMDB = queue/BatchGerarValorVolumesConsumidosNaoFaturadosMDB QueueBatchGerarResumoIndicadoresComercializacaoMDB = queue/BatchGerarResumoIndicadoresComercializacaoMDB QueueBatchGerarResumoIndicadoresMicromedicaoMDB = queue/BatchGerarResumoIndicadoresMicromedicaoMDB QueueBatchGerarResumoIndicadoresFaturamentoMDB = queue/BatchGerarResumoIndicadoresFaturamentoMDB QueueBatchGerarResumoIndicadoresCobrancaMDB =queue/BatchGerarResumoIndicadoresCobrancaMDB queue/BatchGerarResumoIndicadoresCobrancaMDB queue/BatchGerarResumoIndicadoresCobrancaMDBQueueBatchGerarResumoFaturamentoMDB =queue/BatchGerarResumoFaturamentoMDB queue/BatchGerarResumoFaturamentoMDB queue/BatchGerarResumoFaturamentoMDBQueueBatchGerarResumoReFaturamentoOlapMDB = queue/BatchGerarResumoReFaturamentoOlapMDB QueueBatchAtualizaQuantidadeParcelaPagaConsecutivaParcelaBonusMDB = queue/BatchAtualizaQuantidadeParcelaPagaConsecutivaParcelaBonusMDB QueueBatchExecutarComandoNegativacaoMDB = queue/BatchExecutarComandoNegativacaoMDB QueueBatchRelatorioContasBaixadasContabilmenteMDB = queue/BatchRelatorioContasBaixadasContabilmenteMDB QueueBatchIncluirDebitoACobrarEntradaParcelamentoNaoPagaMDB =queue/BatchIncluirDebitoACobrarEntradaParcelamentoNaoPagaMDB queue/BatchIncluirDebitoACobrarEntradaParcelamentoNaoPagaMDB queue/BatchIncluirDebitoACobrarEntradaParcelamentoNaoPagaMDBQueueBatchAtualizarPagamentosContasCobrancaMDB =queue/BatchAtualizarPagamentosContasCobrancaMDB queue/BatchAtualizarPagamentosContasCobrancaMDB queue/BatchAtualizarPagamentosContasCobrancaMDBQueueBatchGerarMovimentoContasCobrancaPorEmpresaMDB =queue/BatchGerarMovimentoContasCobrancaPorEmpresaMDB queue/BatchGerarMovimentoContasCobrancaPorEmpresaMDB queue/BatchGerarMovimentoContasCobrancaPorEmpresaMDBQueueBatchGerarArquivoTextoContasCobrancaMDB = queue/BatchGerarArquivoTextoContasCobrancaEmpresaMDB QueueBatchGerarCreditoSituacaoEspecialFaturamentoMDB = queue/BatchGerarCreditoSituacaoEspecialFaturamentoMDB QueueBatchGerarMovimentoExtensaoContasCobrancaPorEmpresaMDB = queue/BatchGerarMovimentoExtensaoContasCobrancaPorEmpresaMDB QueueBatchAtualizarAutosInfracaoPrazoRecursoVencidoMDB = queue/BatchAtualizarAutosInfracaoPrazoRecursoVencidoMDB QueueBatchGerarCartasCampanhaSolidariedadeCriancaParaNegociacaoAVistaMDB = queue/BatchGerarCartasCampanhaSolidariedadeCriancaParaNegociacaoAVistaMDB QueueBatchEmitirCartasCampanhaSolidariedadeCriancaParaNegociacaoAVistaMDB = queue/BatchEmitirCartasCampanhaSolidariedadeCriancaParaNegociacaoAVistaMDB QueueBatchGerarMovimentoHidrometroMDB = queue/BatchGerarMovimentoHidrometroMDB QueueBatchAtualizarConjuntoHidrometroMDB = queue/BatchAtualizarConjuntoHidrometroMDB QueueBatchGerarTabelasTemporariasAtualizacaoCadastralMDB = queue/BatchGerarTabelasTemporariasAtualizacaoCadastralMDB QueueBatchGerarArquivoTextoAtualizacaoCadastralMDB = queue/BatchGerarArquivoTextoAtualizacaoCadastralMDB QueueBatchEmitirBoletosMDB = queue/BatchEmitirBoletosMDB QueueBatchRetificarConjuntoContaConsumosMDB = queue/BatchRetificarConjuntoContaConsumosMDB
  3 + QueueBatchGerarBonusTarifaSocialMDB = queue/BatchGerarBonusTarifaSocialMDB QueueBatchExcluirImoveisDaTarifaSocialMDB = queue/BatchExcluirImoveisDaTarifaSocialMDB QueueBatchGerarArquivoTextoPagamentosContasCobrancaEmpresaMDB = queue/BatchGerarArquivoTextoPagamentosContasCobrancaEmpresaMDB QueueBatchGerarResumoNegativacaoMDB = queue/BatchGerarResumoNegativacaoMDB QueueBatchAcompanharPagamentoDoParcelamentoMDB = queue/BatchAcompanharPagamentoDoParcelamentoMDB QueueBatchGerarCartasDeFinalDeAnoMDB = queue/BatchGerarCartasDeFinalDeAnoMDB QueueBatchEmitirCartasDeFinalDeAnoMDB = queue/BatchEmitirCartasDeFinalDeAnoMDB QueueBatchGerarArquivoTextoContasProjetosEspeciaisMDB = queue/BatchGerarArquivoTextoContasProjetosEspeciaisMDB QueueBatchInserirPagamentosFaturasEspeciaisMDB = queue/BatchInserirPagamentosFaturasEspeciaisMDB QueueBatchSuspenderImovelEmProgramaEspecialMDB = queue/BatchSuspenderImovelEmProgramaEspecialMDB QueueBatchGerarResumoSimulacaoFaturamentoMDB = queue/BatchGerarResumoSimulacaoFaturamentoMDB QueueBatchEmitirOrdemDeFiscalizacaoMDB = queue/BatchEmitirOrdemDeFiscalizacaoMDB QueueBatchGerarArquivoOrdemDeFiscalizacaoMDB =queue/BatchGerarArquivoOrdemDeFiscalizacaoMDB queue/BatchGerarArquivoOrdemDeFiscalizacaoMDB queue/BatchGerarArquivoOrdemDeFiscalizacaoMDBQueueBatchDeterminarConfirmacaoDaNegativacaoMDB = queue/BatchDeterminarConfirmacaoDaNegativacaoMDB QueueBatchEnvioEmailContaParaClienteMDB = queue/BatchEnvioEmailContaParaClienteMDB QueueBatchGerarResumoPendenciaPorAnoMDB =queue/BatchGerarResumoPendenciaPorAnoMDB queue/BatchGerarResumoPendenciaPorAnoMDB queue/BatchGerarResumoPendenciaPorAnoMDBQueueBatchAtualizarComandoAtividadeAcaoCobrancaMDB =queue/BatchAtualizarComandoAtividadeAcaoCobrancaMDB queue/BatchAtualizarComandoAtividadeAcaoCobrancaMDB queue/BatchAtualizarComandoAtividadeAcaoCobrancaMDBQueueBatchEmitirDocumentoCobrancaMDB = queue/BatchEmitirDocumentoCobrancaMDB QueueBatchAtualizarCodigoDebitoAutomaticoMDB = queue/BatchAtualizarCodigoDebitoAutomaticoMDB QueueBatchGerarDadosDeclaracaoQuitacaoAnualDebitosMDB =queue/BatchGerarDadosDeclaracaoQuitacaoAnualDebitosMDB queue/BatchGerarDadosDeclaracaoQuitacaoAnualDebitosMDB queue/BatchGerarDadosDeclaracaoQuitacaoAnualDebitosMDBQueueBatchGerarArquivoTextoDeclaracaoQuitacaoAnualDebitosMDB = queue/BatchGerarArquivoTextoDeclaracaoQuitacaoAnualDebitosMDB QueueBatchGerarResumoLigacoesEconomiasPorAnoMDB = queue/BatchGerarResumoLigacoesEconomiasPorAnoMDB QueueBatchGerarResumoReceitaMDB = queue/BatchGerarResumoReceitaMDB QueueBatchGerarResumoConsumoAguaPorAnoMDB = queue/BatchGerarResumoConsumoAguaPorAnoMDB QueueBatchGerarResumoFaturamentoPorAnoMDB = queue/BatchGerarResumoFaturamentoPorAnoMDB QueueBatchGerarResumoIndicadoresMicromedicaoPorAnoMDB = queue/BatchGerarResumoIndicadoresMicromedicaoPorAnoMDB QueueBatchGerarResumoArrecadacaoPorAnoMDB = queue/BatchGerarResumoArrecadacaoPorAnoMDB QueueBatchGerarResumoColetaEsgotoPorAnoMDB = queue/BatchGerarResumoColetaEsgotoPorAnoMDB QueueBatchGerarResumoRegistroAtendimentoPorAnoMDB = queue/BatchGerarResumoRegistroAtendimentoPorAnoMDB QueueBatchGerarResumoInstalacoesHidrometrosPorAnoMDB = queue/BatchGerarResumoInstalacoesHidrometrosPorAnoMDB QueueBatchGerarResumoParcelamentoPorAnoMDB = queue/BatchGerarResumoParcelamentoPorAnoMDB QueueBatchGerarTaxaPercentualTarifaMinimaCortadoMDB = queue/BatchGerarTaxaPercentualTarifaMinimaCortadoMDB QueueBatchGerarResumoReFaturamentoNovoMDB = queue/BatchGerarResumoReFaturamentoNovoMDB QueueBatchAlterarInscricaoImovelMDB = queue/BatchAlterarInscricaoImovelMDB QueueBatchGerarPrescreverDebitosDeImoveisMDB = queue/BatchGerarPrescreverDebitosDeImoveisMDB QueueBatchVerificarFaturamentoImoveisCortadosMDB = queue/BatchVerificarFaturamentoImoveisCortadosMDB QueueBatchGerarResumoHistogramaAguaEsgotoSemQuadraMDB = queue/BatchGerarResumoHistogramaAguaEsgotoSemQuadraMDB QueueBatchReligarImoveisCortadosComConsumoRealMDB = queue/BatchReligarImoveisCortadosComConsumoRealMDB QueueBatchPrescreverDebitosImoveisPublicosManualMDB = queue/BatchPrescreverDebitosImoveisPublicosManualMDB QueueBatchPrescreverDebitosImoveisPublicosAutomaticoMDB = queue/BatchPrescreverDebitosImoveisPublicosAutomaticoMDB QueueBatchProcessarEncerramentoOSAcaoCobrancaMDB = queue/BatchProcessarEncerramentoOSAcaoCobrancaMDB QueueBatchAutomatizarPerfisDeGrandesConsumidoresMDB = queue/BatchAutomatizarPerfisDeGrandesConsumidoresMDB QueueBatchGerarRAOSAnormalidadeConsumoMDB = queue/BatchGerarRAOSAnormalidadeConsumoMDB QueueBatchProcessarComandoGeradoMDB = queue/BatchProcessarComandoGeradoMDB QueueBatchGerarCartaTarifaSocialMDB = queue/BatchGerarCartaTarifaSocialMDB QueueBatchRetirarImovelTarifaSocialMDB = queue/BatchRetirarImovelTarifaSocialMDB QueueBatchGerarTxtImpressaoContasBrailleMDB = queue/BatchGerarTxtImpressaoContasBrailleMDB QueueBatchEncerrarComandosDeCobrancaPorEmpresaMDB = queue/BatchEncerrarComandosDeCobrancaPorEmpresaMDB QueueBatchGerarTxtOsInspecaoAnormalidadeMDB = queue/BatchGerarTxtOsInspecaoAnormalidadeMDB QueueBatchProcessarArquivoTxtEncerramentoOSCobrancaMDB = queue/BatchProcessarArquivoTxtEncerramentoOSCobrancaMDB QueueBatchGerarArquivoTextoOSContasPagasParceladasMDB = queue/BatchGerarArquivoTextoOSContasPagasParceladasMDB QueueBatchEncerrarComandoOSSeletivaInspecaoAnormalidadeMDB = queue/BatchEncerrarComandoOSSeletivaInspecaoAnormalidadeMDB QueueBatchProgramacaoAutoRoteiroAcompServicoMDB = queue/BatchProgramacaoAutoRoteiroAcompServicoMDB QueueBatchGerarDadosArquivoAcompanhamentoServicoMDB = queue/BatchGerarDadosArquivoAcompanhamentoServicoMDB QueueBatchProcessarEncerramentoOSFiscalizacaoDecursoPrazoMDB = queue/BatchProcessarEncerramentoOSFiscalizacaoDecursoPrazoMDB QueueBatchSuspenderLeituraParaImovelComHidrometroRetiradoMDB = queue/BatchSuspenderLeituraParaImovelComHidrometroRetiradoMDB QueueBatchSuspenderLeituraParaImovelComConsumoRealNaoSuperiorA10MDB = queue/BatchSuspenderLeituraParaImovelComConsumoRealNaoSuperiorA10MDB QueueBatchGerarDadosRelatorioBIGMDB = queue/BatchGerarDadosRelatorioBIGMDB QueueBatchProcessarPagamentosDiferencaDoisReaisMDB = queue/BatchProcessarPagamentosDiferencaDoisReaisMDB QueueBatchCancelarGuiasPagamentoNaoPagasMDB = queue/BatchCancelarGuiasPagamentoNaoPagas QueueBatchAtualizacaoCadastralMDB = queue/BatchAtualizacaoCadastralMDB QueueBatchGerarDadosReceitasAFaturarResumoMDB = queue/BatchGerarDadosReceitasAFaturarResumoMDB
4 4 \ No newline at end of file
... ...
src/gcom/util/ConstantesJNDI.java
... ... @@ -7,6 +7,9 @@ public class ConstantesJNDI {
7 7  
8 8 public final static String NOME_ARQUIVO_PROPRIEDADES = "constantes_jndi.properties";
9 9  
  10 + public static String CONTROLADOR_DEBITO_A_COBRAR = "";
  11 + public static String CONTROLADOR_ANALISE_GERACAO_CONTA = "";
  12 +
10 13 public static String FUNCOES_EJB = "";
11 14 public static String CONTROLADOR_TABELA_AUXILIAR_SEJB = "";
12 15 public static String CONTROLADOR_UTIL_SEJB = "";
... ... @@ -288,6 +291,9 @@ public class ConstantesJNDI {
288 291 }
289 292  
290 293 propriedades.load(stream);
  294 +
  295 + CONTROLADOR_DEBITO_A_COBRAR = propriedades.getProperty("ControladorDebitoACobrar");
  296 + CONTROLADOR_ANALISE_GERACAO_CONTA = propriedades.getProperty("ControladorAnaliseGeracaoConta");
291 297  
292 298 CONTROLADOR_USUARIO_SEJB = propriedades.getProperty("ControladorUsuario");
293 299 CONTROLADOR_GERENCIAL_CADASTRO_SEJB = propriedades.getProperty("ControladorGerencialCadastro");
... ...
src/gcom/util/ControladorComum.java 0 → 100644
... ... @@ -0,0 +1,412 @@
  1 +package gcom.util;
  2 +
  3 +import java.rmi.RemoteException;
  4 +
  5 +import javax.ejb.CreateException;
  6 +import javax.ejb.EJBException;
  7 +import javax.ejb.SessionBean;
  8 +import javax.ejb.SessionContext;
  9 +
  10 +import gcom.arrecadacao.ControladorArrecadacaoLocal;
  11 +import gcom.arrecadacao.ControladorArrecadacaoLocalHome;
  12 +import gcom.atendimentopublico.ControladorAtendimentoPublicoLocal;
  13 +import gcom.atendimentopublico.ControladorAtendimentoPublicoLocalHome;
  14 +import gcom.atendimentopublico.ligacaoagua.ControladorLigacaoAguaLocal;
  15 +import gcom.atendimentopublico.ligacaoagua.ControladorLigacaoAguaLocalHome;
  16 +import gcom.atendimentopublico.ligacaoesgoto.ControladorLigacaoEsgotoLocal;
  17 +import gcom.atendimentopublico.ligacaoesgoto.ControladorLigacaoEsgotoLocalHome;
  18 +import gcom.atendimentopublico.registroatendimento.ControladorRegistroAtendimentoLocal;
  19 +import gcom.atendimentopublico.registroatendimento.ControladorRegistroAtendimentoLocalHome;
  20 +import gcom.batch.ControladorBatchLocal;
  21 +import gcom.batch.ControladorBatchLocalHome;
  22 +import gcom.cadastro.ControladorCadastroLocal;
  23 +import gcom.cadastro.ControladorCadastroLocalHome;
  24 +import gcom.cadastro.cliente.ControladorClienteLocal;
  25 +import gcom.cadastro.cliente.ControladorClienteLocalHome;
  26 +import gcom.cadastro.endereco.ControladorEnderecoLocal;
  27 +import gcom.cadastro.endereco.ControladorEnderecoLocalHome;
  28 +import gcom.cadastro.geografico.ControladorGeograficoLocal;
  29 +import gcom.cadastro.geografico.ControladorGeograficoLocalHome;
  30 +import gcom.cadastro.localidade.ControladorLocalidadeLocal;
  31 +import gcom.cadastro.localidade.ControladorLocalidadeLocalHome;
  32 +import gcom.cobranca.ControladorCobrancaLocal;
  33 +import gcom.cobranca.ControladorCobrancaLocalHome;
  34 +import gcom.cobranca.contratoparcelamento.ControladorContratoParcelamentoLocal;
  35 +import gcom.cobranca.contratoparcelamento.ControladorContratoParcelamentoLocalHome;
  36 +import gcom.faturamento.controladores.ControladorAnaliseGeracaoContaLocal;
  37 +import gcom.faturamento.controladores.ControladorAnaliseGeracaoContaLocalHome;
  38 +import gcom.faturamento.controladores.ControladorDebitoACobrarLocal;
  39 +import gcom.faturamento.controladores.ControladorDebitoACobrarLocalHome;
  40 +import gcom.financeiro.ControladorFinanceiroLocal;
  41 +import gcom.financeiro.ControladorFinanceiroLocalHome;
  42 +import gcom.relatorio.faturamento.ControladorRelatorioFaturamentoLocal;
  43 +import gcom.relatorio.faturamento.ControladorRelatorioFaturamentoLocalHome;
  44 +import gcom.seguranca.ControladorPermissaoEspecialLocal;
  45 +import gcom.seguranca.ControladorPermissaoEspecialLocalHome;
  46 +import gcom.seguranca.acesso.ControladorAcessoLocal;
  47 +import gcom.seguranca.acesso.ControladorAcessoLocalHome;
  48 +import gcom.spcserasa.ControladorSpcSerasaLocal;
  49 +import gcom.spcserasa.ControladorSpcSerasaLocalHome;
  50 +
  51 +public abstract class ControladorComum implements SessionBean{
  52 + private static final long serialVersionUID = -1018845073095941124L;
  53 +
  54 + protected SessionContext sessionContext;
  55 +
  56 +
  57 + public void ejbActivate() throws EJBException, RemoteException {
  58 + }
  59 +
  60 + public void ejbPassivate() throws EJBException, RemoteException {
  61 + }
  62 +
  63 + public void ejbRemove() throws EJBException, RemoteException {
  64 + }
  65 +
  66 + public void setSessionContext(SessionContext sessionContext) throws EJBException, RemoteException {
  67 + this.sessionContext = sessionContext;
  68 + }
  69 +
  70 +
  71 + protected ControladorLocalidadeLocal getControladorLocalidade() {
  72 + try {
  73 + ServiceLocator locator = ServiceLocator.getInstancia();
  74 +
  75 + ControladorLocalidadeLocalHome localHome = (ControladorLocalidadeLocalHome) locator.getLocalHome(ConstantesJNDI.CONTROLADOR_LOCALIDADE_SEJB);
  76 +
  77 + ControladorLocalidadeLocal local = localHome.create();
  78 +
  79 + return local;
  80 + } catch (CreateException e) {
  81 + throw new SistemaException(e);
  82 + } catch (ServiceLocatorException e) {
  83 + throw new SistemaException(e);
  84 + }
  85 + }
  86 +
  87 + protected ControladorSpcSerasaLocal getControladorSpcSerasa() {
  88 + try {
  89 + ServiceLocator locator = ServiceLocator.getInstancia();
  90 +
  91 + ControladorSpcSerasaLocalHome localHome = (ControladorSpcSerasaLocalHome) locator.getLocalHome(ConstantesJNDI.CONTROLADOR_SPC_SERASA_SEJB);
  92 +
  93 + ControladorSpcSerasaLocal local = localHome.create();
  94 +
  95 + return local;
  96 + } catch (CreateException e) {
  97 + throw new SistemaException(e);
  98 + } catch (ServiceLocatorException e) {
  99 + throw new SistemaException(e);
  100 + }
  101 + }
  102 +
  103 + protected ControladorBatchLocal getControladorBatch() {
  104 + try {
  105 + ServiceLocator locator = ServiceLocator.getInstancia();
  106 +
  107 + ControladorBatchLocalHome localHome = (ControladorBatchLocalHome) locator.getLocalHome(ConstantesJNDI.CONTROLADOR_BATCH_SEJB);
  108 +
  109 + ControladorBatchLocal local = localHome.create();
  110 +
  111 + return local;
  112 + } catch (CreateException e) {
  113 + throw new SistemaException(e);
  114 + } catch (ServiceLocatorException e) {
  115 + throw new SistemaException(e);
  116 + }
  117 + }
  118 +
  119 + protected ControladorLigacaoAguaLocal getControladorLigacaoAgua() {
  120 + try {
  121 + ServiceLocator locator = ServiceLocator.getInstancia();
  122 +
  123 + ControladorLigacaoAguaLocalHome localHome = (ControladorLigacaoAguaLocalHome) locator.getLocalHome(ConstantesJNDI.CONTROLADOR_LIGACAO_AGUA_SEJB);
  124 +
  125 + ControladorLigacaoAguaLocal local = localHome.create();
  126 +
  127 + return local;
  128 + } catch (CreateException e) {
  129 + throw new SistemaException(e);
  130 + } catch (ServiceLocatorException e) {
  131 + throw new SistemaException(e);
  132 + }
  133 + }
  134 +
  135 + protected ControladorLigacaoEsgotoLocal getControladorLigacaoEsgoto() {
  136 + try {
  137 + ServiceLocator locator = ServiceLocator.getInstancia();
  138 +
  139 + ControladorLigacaoEsgotoLocalHome localHome = (ControladorLigacaoEsgotoLocalHome) locator.getLocalHome(ConstantesJNDI.CONTROLADOR_LIGACAO_ESGOTO_SEJB);
  140 +
  141 + ControladorLigacaoEsgotoLocal local = localHome.create();
  142 +
  143 + return local;
  144 + } catch (CreateException e) {
  145 + throw new SistemaException(e);
  146 + } catch (ServiceLocatorException e) {
  147 + throw new SistemaException(e);
  148 + }
  149 + }
  150 +
  151 + protected ControladorAtendimentoPublicoLocal getControladorAtendimentoPublico() {
  152 + try {
  153 + ServiceLocator locator = ServiceLocator.getInstancia();
  154 +
  155 + ControladorAtendimentoPublicoLocalHome localHome = (ControladorAtendimentoPublicoLocalHome) locator.getLocalHome(ConstantesJNDI.CONTROLADOR_ATENDIMENTO_PUBLICO_SEJB);
  156 +
  157 + ControladorAtendimentoPublicoLocal local = localHome.create();
  158 +
  159 + return local;
  160 + } catch (CreateException e) {
  161 + throw new SistemaException(e);
  162 + } catch (ServiceLocatorException e) {
  163 + throw new SistemaException(e);
  164 + }
  165 + }
  166 +
  167 + protected ControladorAcessoLocal getControladorAcesso() {
  168 + try {
  169 + ServiceLocator locator = ServiceLocator.getInstancia();
  170 +
  171 + ControladorAcessoLocalHome localHome = (ControladorAcessoLocalHome) locator.getLocalHome(ConstantesJNDI.CONTROLADOR_ACESSO_SEJB);
  172 +
  173 + ControladorAcessoLocal local = localHome.create();
  174 +
  175 + return local;
  176 + } catch (CreateException e) {
  177 + throw new SistemaException(e);
  178 + } catch (ServiceLocatorException e) {
  179 + throw new SistemaException(e);
  180 + }
  181 + }
  182 +
  183 + protected ControladorFinanceiroLocal getControladorFinanceiro() {
  184 + try {
  185 + ServiceLocator locator = ServiceLocator.getInstancia();
  186 +
  187 + ControladorFinanceiroLocalHome localHome = (ControladorFinanceiroLocalHome) locator.getLocalHomePorEmpresa(ConstantesJNDI.CONTROLADOR_FINANCEIRO_SEJB);
  188 +
  189 + ControladorFinanceiroLocal local = localHome.create();
  190 +
  191 + return local;
  192 + } catch (CreateException e) {
  193 + throw new SistemaException(e);
  194 + } catch (ServiceLocatorException e) {
  195 + throw new SistemaException(e);
  196 + }
  197 + }
  198 +
  199 + protected ControladorArrecadacaoLocal getControladorArrecadacao() {
  200 + try {
  201 + ServiceLocator locator = ServiceLocator.getInstancia();
  202 +
  203 + ControladorArrecadacaoLocalHome localHome = (ControladorArrecadacaoLocalHome) locator.getLocalHomePorEmpresa(ConstantesJNDI.CONTROLADOR_ARRECADACAO_SEJB);
  204 +
  205 + ControladorArrecadacaoLocal local = localHome.create();
  206 +
  207 + return local;
  208 + } catch (CreateException e) {
  209 + throw new SistemaException(e);
  210 + } catch (ServiceLocatorException e) {
  211 + throw new SistemaException(e);
  212 + }
  213 + }
  214 +
  215 + protected ControladorCobrancaLocal getControladorCobranca() {
  216 + try {
  217 + ServiceLocator locator = ServiceLocator.getInstancia();
  218 +
  219 + ControladorCobrancaLocalHome localHome = (ControladorCobrancaLocalHome) locator.getLocalHomePorEmpresa(ConstantesJNDI.CONTROLADOR_COBRANCA_SEJB);
  220 +
  221 + ControladorCobrancaLocal local = localHome.create();
  222 +
  223 + return local;
  224 + } catch (CreateException e) {
  225 + throw new SistemaException(e);
  226 + } catch (ServiceLocatorException e) {
  227 + throw new SistemaException(e);
  228 + }
  229 + }
  230 +
  231 + protected ControladorEnderecoLocal getControladorEndereco() {
  232 + try {
  233 + ServiceLocator locator = ServiceLocator.getInstancia();
  234 +
  235 + ControladorEnderecoLocalHome localHome = (ControladorEnderecoLocalHome) locator.getLocalHome(ConstantesJNDI.CONTROLADOR_ENDERECO_SEJB);
  236 +
  237 + ControladorEnderecoLocal local = localHome.create();
  238 +
  239 + return local;
  240 + } catch (CreateException e) {
  241 + throw new SistemaException(e);
  242 + } catch (ServiceLocatorException e) {
  243 + throw new SistemaException(e);
  244 + }
  245 +
  246 + }
  247 +
  248 + protected ControladorClienteLocal getControladorCliente() {
  249 + try {
  250 + ServiceLocator locator = ServiceLocator.getInstancia();
  251 +
  252 + ControladorClienteLocalHome localHome = (ControladorClienteLocalHome) locator.getLocalHome(ConstantesJNDI.CONTROLADOR_CLIENTE_SEJB);
  253 +
  254 + ControladorClienteLocal local = localHome.create();
  255 +
  256 + return local;
  257 + } catch (CreateException e) {
  258 + throw new SistemaException(e);
  259 + } catch (ServiceLocatorException e) {
  260 + throw new SistemaException(e);
  261 + }
  262 + }
  263 +
  264 + protected ControladorGeograficoLocal getControladorGeografico() {
  265 + try {
  266 + ServiceLocator locator = ServiceLocator.getInstancia();
  267 +
  268 + ControladorGeograficoLocalHome localHome = (ControladorGeograficoLocalHome) locator.getLocalHome(ConstantesJNDI.CONTROLADOR_GEOGRAFICO_SEJB);
  269 +
  270 + ControladorGeograficoLocal local = localHome.create();
  271 +
  272 + return local;
  273 + } catch (CreateException e) {
  274 + throw new SistemaException(e);
  275 + } catch (ServiceLocatorException e) {
  276 + throw new SistemaException(e);
  277 + }
  278 + }
  279 +
  280 + protected ControladorRegistroAtendimentoLocal getControladorRegistroAtendimento() {
  281 + try {
  282 + ServiceLocator locator = ServiceLocator.getInstancia();
  283 +
  284 + ControladorRegistroAtendimentoLocalHome localHome = (ControladorRegistroAtendimentoLocalHome) locator.getLocalHome(ConstantesJNDI.CONTROLADOR_REGISTRO_ATENDIMENTO_SEJB);
  285 +
  286 + ControladorRegistroAtendimentoLocal local = localHome.create();
  287 +
  288 + return local;
  289 + } catch (CreateException e) {
  290 + throw new SistemaException(e);
  291 + } catch (ServiceLocatorException e) {
  292 + throw new SistemaException(e);
  293 + }
  294 + }
  295 +
  296 + protected ControladorUtilLocal getControladorUtil() {
  297 + try {
  298 + ServiceLocator locator = ServiceLocator.getInstancia();
  299 +
  300 + ControladorUtilLocalHome localHome = (ControladorUtilLocalHome) locator.getLocalHome(ConstantesJNDI.CONTROLADOR_UTIL_SEJB);
  301 +
  302 + ControladorUtilLocal local = localHome.create();
  303 +
  304 + return local;
  305 + } catch (CreateException e) {
  306 + throw new SistemaException(e);
  307 + } catch (ServiceLocatorException e) {
  308 + throw new SistemaException(e);
  309 + }
  310 + }
  311 +
  312 + protected ControladorAnaliseGeracaoContaLocal getControladorAnaliseGeracaoConta() {
  313 + try {
  314 + ServiceLocator locator = ServiceLocator.getInstancia();
  315 +
  316 + ControladorAnaliseGeracaoContaLocalHome localHome = (ControladorAnaliseGeracaoContaLocalHome) locator.getLocalHome(ConstantesJNDI.CONTROLADOR_ANALISE_GERACAO_CONTA);
  317 +
  318 + ControladorAnaliseGeracaoContaLocal local = localHome.create();
  319 +
  320 + return local;
  321 + } catch (CreateException e) {
  322 + throw new SistemaException(e);
  323 + } catch (ServiceLocatorException e) {
  324 + throw new SistemaException(e);
  325 + }
  326 + }
  327 +
  328 + protected ControladorDebitoACobrarLocal getControladorDebitoACobrar() {
  329 + try {
  330 + ServiceLocator locator = ServiceLocator.getInstancia();
  331 +
  332 + ControladorDebitoACobrarLocalHome localHome = (ControladorDebitoACobrarLocalHome) locator.getLocalHome(ConstantesJNDI.CONTROLADOR_DEBITO_A_COBRAR);
  333 +
  334 + ControladorDebitoACobrarLocal local = localHome.create();
  335 +
  336 + return local;
  337 + } catch (CreateException e) {
  338 + throw new SistemaException(e);
  339 + } catch (ServiceLocatorException e) {
  340 + throw new SistemaException(e);
  341 + }
  342 + }
  343 +
  344 + protected ControladorCadastroLocal getControladorCadastro() {
  345 + ControladorCadastroLocalHome localHome = null;
  346 + ControladorCadastroLocal local = null;
  347 +
  348 + ServiceLocator locator = null;
  349 + try {
  350 + locator = ServiceLocator.getInstancia();
  351 + localHome = (ControladorCadastroLocalHome) locator
  352 + .getLocalHomePorEmpresa(ConstantesJNDI.CONTROLADOR_CADASTRO_SEJB);
  353 +
  354 + local = localHome.create();
  355 +
  356 + return local;
  357 + } catch (CreateException e) {
  358 + throw new SistemaException(e);
  359 + } catch (ServiceLocatorException e) {
  360 + throw new SistemaException(e);
  361 + }
  362 + }
  363 +
  364 + protected ControladorPermissaoEspecialLocal getControladorPermissaoEspecial() {
  365 + try {
  366 + ServiceLocator locator = ServiceLocator.getInstancia();
  367 +
  368 + ControladorPermissaoEspecialLocalHome localHome = (ControladorPermissaoEspecialLocalHome) locator.getLocalHome(ConstantesJNDI.CONTROLADOR_PERMISSAO_ESPECIAL_SEJB);
  369 +
  370 + ControladorPermissaoEspecialLocal local = localHome.create();
  371 +
  372 + return local;
  373 + } catch (CreateException e) {
  374 + throw new SistemaException(e);
  375 + } catch (ServiceLocatorException e) {
  376 + throw new SistemaException(e);
  377 + }
  378 +
  379 + }
  380 +
  381 + protected ControladorRelatorioFaturamentoLocal getControladorRelatorioFaturamento() {
  382 + try {
  383 + ServiceLocator locator = ServiceLocator.getInstancia();
  384 +
  385 + ControladorRelatorioFaturamentoLocalHome localHome = (ControladorRelatorioFaturamentoLocalHome) locator.getLocalHome(ConstantesJNDI.CONTROLADOR_RELATORIO_FATURAMENTO_SEJB);
  386 +
  387 + ControladorRelatorioFaturamentoLocal local = localHome.create();
  388 +
  389 + return local;
  390 + } catch (CreateException e) {
  391 + throw new SistemaException(e);
  392 + } catch (ServiceLocatorException e) {
  393 + throw new SistemaException(e);
  394 + }
  395 + }
  396 +
  397 + protected ControladorContratoParcelamentoLocal getControladorContratoParcelamento() {
  398 + try {
  399 + ServiceLocator locator = ServiceLocator.getInstancia();
  400 +
  401 + ControladorContratoParcelamentoLocalHome localHome = (ControladorContratoParcelamentoLocalHome) locator.getLocalHome(ConstantesJNDI.CONTROLADOR_CONTRATO_PARCELAMENTO_SEJB);
  402 +
  403 + ControladorContratoParcelamentoLocal local = localHome.create();
  404 +
  405 + return local;
  406 + } catch (CreateException e) {
  407 + throw new SistemaException(e);
  408 + } catch (ServiceLocatorException e) {
  409 + throw new SistemaException(e);
  410 + }
  411 + }
  412 +}
... ...
test/gcom/faturamento/controladores/ControladorAnaliseGeracaoContaTest.java 0 → 100644
... ... @@ -0,0 +1,325 @@
  1 +package gcom.faturamento.controladores;
  2 +
  3 +import static org.junit.Assert.assertFalse;
  4 +import static org.junit.Assert.assertTrue;
  5 +import static org.mockito.Mockito.when;
  6 +
  7 +import java.util.ArrayList;
  8 +import java.util.Collection;
  9 +import java.util.List;
  10 +
  11 +import javax.ejb.EJBException;
  12 +import javax.ejb.EJBLocalHome;
  13 +import javax.ejb.EJBLocalObject;
  14 +import javax.ejb.RemoveException;
  15 +
  16 +import org.junit.Before;
  17 +import org.junit.Test;
  18 +import org.mockito.InjectMocks;
  19 +import org.mockito.Mock;
  20 +import org.mockito.MockitoAnnotations;
  21 +
  22 +import gcom.arrecadacao.repositorio.RepositorioDevolucao;
  23 +import gcom.atendimentopublico.ligacaoagua.LigacaoAguaSituacao;
  24 +import gcom.atendimentopublico.ligacaoesgoto.LigacaoEsgotoSituacao;
  25 +import gcom.cadastro.imovel.Imovel;
  26 +import gcom.enums.Status;
  27 +import gcom.faturamento.FaturamentoSituacaoTipo;
  28 +import gcom.faturamento.credito.CreditoARealizar;
  29 +import gcom.faturamento.debito.DebitoACobrar;
  30 +import gcom.faturamento.debito.DebitoCreditoSituacao;
  31 +import gcom.faturamento.debito.DebitoTipo;
  32 +import gcom.faturamento.repositorio.RepositorioCreditoARealizar;
  33 +import gcom.util.ControladorException;
  34 +import gcom.util.ErroRepositorioException;
  35 +
  36 +public class ControladorAnaliseGeracaoContaTest {
  37 +
  38 + @InjectMocks
  39 + private ControladorAnaliseGeracaoConta analisadorGeracaoConta;
  40 +
  41 + private Imovel imovel;
  42 + private LigacaoAguaSituacao aguaLigada;
  43 + private LigacaoAguaSituacao aguaDesligada;
  44 + private LigacaoEsgotoSituacao esgotoLigado;
  45 + private LigacaoEsgotoSituacao esgotoDesligado;
  46 + private int anoMesFaturamento;
  47 +
  48 + @Mock
  49 + private RepositorioCreditoARealizar creditoRealizarRepositorio;
  50 +
  51 + @Mock
  52 + private RepositorioDevolucao repositorioDevolucao;
  53 +
  54 + private boolean aguaEsgotoZerados;
  55 +
  56 + private Collection<DebitoACobrar> debitos;
  57 +
  58 + @Before
  59 + public void setup(){
  60 + analisadorGeracaoConta = new ControladorAnaliseGeracaoConta(){
  61 + private static final long serialVersionUID = 6767710520463134199L;
  62 +
  63 + protected ControladorDebitoACobrarLocal getControladorDebitoACobrar(){
  64 + return new ControladorDebitoACobrarLocal() {
  65 +
  66 + public void remove() throws RemoveException, EJBException {
  67 +
  68 + }
  69 +
  70 + public boolean isIdentical(EJBLocalObject arg0) throws EJBException {
  71 + return false;
  72 + }
  73 +
  74 + public Object getPrimaryKey() throws EJBException {
  75 + return null;
  76 + }
  77 +
  78 + public EJBLocalHome getEJBLocalHome() throws EJBException {
  79 + return null;
  80 + }
  81 +
  82 + public Collection<DebitoACobrar> debitosCobrarVigentes(Integer idImovel) throws ControladorException {
  83 + return null;
  84 + }
  85 +
  86 + public Collection<DebitoACobrar> debitosCobrarSemPagamentos(Integer idImovel) throws ControladorException {
  87 + return getDebitos();
  88 + }
  89 +
  90 + public void atualizarDebitoCobrar(List<DebitoACobrar> debitosCobrar) throws ErroRepositorioException {
  91 + }
  92 + };
  93 + }
  94 + };
  95 +
  96 + anoMesFaturamento = 0;
  97 +
  98 + imovel = new Imovel();
  99 + aguaLigada = new LigacaoAguaSituacao();
  100 + aguaLigada.setId(LigacaoAguaSituacao.LIGADO);
  101 + imovel.setLigacaoAguaSituacao(aguaLigada);
  102 + aguaDesligada = new LigacaoAguaSituacao();
  103 + aguaDesligada.setId(LigacaoAguaSituacao.POTENCIAL);
  104 +
  105 + esgotoLigado = new LigacaoEsgotoSituacao();
  106 + esgotoLigado.setId(LigacaoEsgotoSituacao.LIGADO);
  107 + imovel.setLigacaoEsgotoSituacao(esgotoLigado);
  108 + esgotoDesligado = new LigacaoEsgotoSituacao();
  109 + esgotoDesligado.setId(LigacaoEsgotoSituacao.POTENCIAL);
  110 +
  111 + MockitoAnnotations.initMocks(this);
  112 + }
  113 +
  114 + @Test
  115 + public void naoGeraContaSemConsumo_AguaLigada_EsgotoLigado_NaoPertenceACondominio() throws Exception {
  116 + aguaEsgotoZerados = true;
  117 +
  118 + assertFalse(analisadorGeracaoConta.verificarSituacaoImovelParaGerarConta(aguaEsgotoZerados, imovel));
  119 + }
  120 +
  121 + @Test
  122 + public void naoGeraContaSemConsumo_AguaDesligada_EsgotoDesligado_NaoPertenceACondominio() throws Exception {
  123 + aguaEsgotoZerados = true;
  124 + imovel.setLigacaoAguaSituacao(aguaLigada);
  125 + imovel.setLigacaoEsgotoSituacao(esgotoDesligado);
  126 +
  127 + assertFalse(analisadorGeracaoConta.verificarSituacaoImovelParaGerarConta(aguaEsgotoZerados, imovel));
  128 + }
  129 +
  130 + @Test
  131 + public void geraContaComConsumoDeAguaEEsgoto_AguaLigada_sgotoDesligado_NaoPertenceACondominio() throws Exception {
  132 + aguaEsgotoZerados = false;
  133 + imovel.setLigacaoEsgotoSituacao(esgotoDesligado);
  134 +
  135 + assertTrue(analisadorGeracaoConta.verificarSituacaoImovelParaGerarConta(aguaEsgotoZerados, imovel));
  136 + }
  137 +
  138 + @Test
  139 + public void geraContaComConsumoDeAguaEEsgoto_AguaLigada() throws Exception {
  140 + aguaEsgotoZerados = false;
  141 +
  142 + assertTrue(analisadorGeracaoConta.verificarSituacaoImovelParaGerarConta(aguaEsgotoZerados, imovel));
  143 + }
  144 +
  145 + @Test
  146 + public void naoGeraContaComConsumoDeAguaEsgoto_AguaDesligada_EsgotoDesligado() throws Exception {
  147 + aguaEsgotoZerados = false;
  148 +
  149 + imovel.setLigacaoAguaSituacao(aguaDesligada);
  150 + imovel.setLigacaoEsgotoSituacao(esgotoDesligado);
  151 +
  152 + assertFalse(analisadorGeracaoConta.verificarSituacaoImovelParaGerarConta(aguaEsgotoZerados, imovel));
  153 + }
  154 +
  155 + @Test
  156 + public void naoGeraContaComConsumoDeAguaEsgoto_AguaEsgotoDesligados_ESemCondominio() throws Exception {
  157 + aguaEsgotoZerados = false;
  158 +
  159 + imovel.setLigacaoAguaSituacao(aguaDesligada);
  160 + imovel.setLigacaoEsgotoSituacao(esgotoDesligado);
  161 +
  162 + assertFalse(analisadorGeracaoConta.verificarSituacaoImovelParaGerarConta(aguaEsgotoZerados, imovel));
  163 + }
  164 +
  165 + @Test
  166 + public void geraContaSemConsumo_AguaDesligada_EsgotoDesligado_EPerterceACondominio() throws Exception {
  167 + aguaEsgotoZerados = true;
  168 +
  169 + imovel.setLigacaoAguaSituacao(aguaDesligada);
  170 + imovel.setLigacaoEsgotoSituacao(esgotoDesligado);
  171 +
  172 + imovel.setImovelCondominio(new Imovel());
  173 +
  174 + assertTrue(analisadorGeracaoConta.verificarSituacaoDeCondominio(aguaEsgotoZerados, imovel));
  175 + }
  176 +
  177 + @Test
  178 + public void geraContaComDebitoCobrar() throws Exception {
  179 + assertFalse(analisadorGeracaoConta.verificarDebitosECreditosParaGerarConta(anoMesFaturamento, imovel));
  180 + }
  181 +
  182 + @Test
  183 + public void geraContaComParalisacaoFaturamento() throws Exception {
  184 + this.debitos = buildCollectionDebitosCobrarVazio(false);
  185 +
  186 + adicionaFaturamentoSituacaoTipoParaImovel(Status.ATIVO);
  187 +
  188 + assertFalse(analisadorGeracaoConta.verificarDebitosECreditosParaGerarConta(anoMesFaturamento, imovel));
  189 + }
  190 +
  191 + @Test
  192 + public void geraContaQuandoHaDebitoSemPagamento() throws Exception {
  193 + this.debitos = buildCollectionDebitosCobrarVazio(false);
  194 +
  195 + adicionaFaturamentoSituacaoTipoParaImovel(Status.INATIVO);
  196 +
  197 + assertTrue(analisadorGeracaoConta.verificarDebitosECreditosParaGerarConta(anoMesFaturamento, imovel));
  198 + }
  199 +
  200 + @Test
  201 + public void naoGeraContaQuandoNaoHaDebitosCobrarAtivosENaoHaCreditosRealizar() throws Exception {
  202 +
  203 + this.debitos = buildCollectionDebitosCobrarComDebitoTipo(Status.INATIVO);
  204 +
  205 + mockPesquisarCreditoARealizar(null);
  206 +
  207 + adicionaFaturamentoSituacaoTipoParaImovel(Status.INATIVO);
  208 +
  209 + assertFalse(analisadorGeracaoConta.verificarDebitosECreditosParaGerarConta(anoMesFaturamento, imovel));
  210 + }
  211 +
  212 + @Test
  213 + public void geraContaQuandoHaDebitosCobrarAtivosENaoHaCreditosRealizar() throws Exception {
  214 + this.debitos = buildCollectionDebitosCobrarComDebitoTipo(Status.ATIVO);
  215 +
  216 + mockPesquisarCreditoARealizar(null);
  217 +
  218 + adicionaFaturamentoSituacaoTipoParaImovel(Status.INATIVO);
  219 +
  220 + assertTrue(analisadorGeracaoConta.verificarDebitosECreditosParaGerarConta(anoMesFaturamento, imovel));
  221 + }
  222 +
  223 + @Test
  224 + public void naoGeraContaQuandoNaoHaDebitosCobrarAtivosEHaCreditosRealizarComDevolucao() throws Exception {
  225 + this.debitos = buildCollectionDebitosCobrarComDebitoTipo(Status.INATIVO);
  226 +
  227 + Collection<CreditoARealizar> creditosRealizar = buildCollectionCreditosRealizar();
  228 + mockPesquisarCreditoARealizar(creditosRealizar);
  229 + mockExisteCreditoComDevolucao(creditosRealizar, true);
  230 +
  231 + adicionaFaturamentoSituacaoTipoParaImovel(Status.INATIVO);
  232 +
  233 + assertFalse(analisadorGeracaoConta.verificarDebitosECreditosParaGerarConta(anoMesFaturamento, imovel));
  234 + }
  235 +
  236 + @Test
  237 + public void geraContaQuandoHaDebitosCobrarAtivosEHaCreditosRealizarComDevolucao() throws Exception {
  238 + this.debitos = buildCollectionDebitosCobrarComDebitoTipo(Status.ATIVO);
  239 +
  240 + Collection<CreditoARealizar> creditosRealizar = buildCollectionCreditosRealizar();
  241 +
  242 + mockPesquisarCreditoARealizar(creditosRealizar);
  243 +
  244 + mockExisteCreditoComDevolucao(creditosRealizar, true);
  245 +
  246 + adicionaFaturamentoSituacaoTipoParaImovel(Status.INATIVO);
  247 +
  248 + assertTrue(analisadorGeracaoConta.verificarDebitosECreditosParaGerarConta(anoMesFaturamento, imovel));
  249 + }
  250 +
  251 + @Test
  252 + public void geraContaQuandoHaCreditosRealizarENaoHaCreditosComDevolucao() throws Exception {
  253 + this.debitos = buildCollectionDebitosCobrarVazio(false);
  254 +
  255 + Collection<CreditoARealizar> creditosRealizar = buildCollectionCreditosRealizar();
  256 +
  257 + mockPesquisarCreditoARealizar(creditosRealizar);
  258 + mockExisteCreditoComDevolucao(creditosRealizar, false);
  259 +
  260 + adicionaFaturamentoSituacaoTipoParaImovel(Status.INATIVO);
  261 +
  262 + assertTrue(analisadorGeracaoConta.verificarDebitosECreditosParaGerarConta(anoMesFaturamento, imovel));
  263 + }
  264 +
  265 + @Test
  266 + public void gerarContaParaImoveisCortadosPertencentesACondominio() throws Exception {
  267 + aguaEsgotoZerados = true;
  268 +
  269 + assertFalse(analisadorGeracaoConta.verificarSituacaoImovelParaGerarConta(aguaEsgotoZerados, imovel));
  270 + }
  271 +
  272 + private Collection<CreditoARealizar> buildCollectionCreditosRealizar() {
  273 + Collection<CreditoARealizar> creditosRealizar = new ArrayList<CreditoARealizar>();
  274 + CreditoARealizar creditoRealizar = new CreditoARealizar();
  275 + creditosRealizar.add(creditoRealizar);
  276 + return creditosRealizar;
  277 + }
  278 +
  279 + private void mockPesquisarCreditoARealizar(Collection<CreditoARealizar> retorno) throws ErroRepositorioException {
  280 + when(creditoRealizarRepositorio.buscarCreditoRealizarPorImovel(imovel.getId(), DebitoCreditoSituacao.NORMAL, anoMesFaturamento))
  281 + .thenReturn(retorno);
  282 + }
  283 +
  284 + private void mockExisteCreditoComDevolucao(Collection<CreditoARealizar> creditosRealizar, boolean retorno) throws ErroRepositorioException {
  285 + when(repositorioDevolucao.existeCreditoComDevolucao(creditosRealizar))
  286 + .thenReturn(retorno);
  287 + }
  288 +
  289 + private void adicionaFaturamentoSituacaoTipoParaImovel(Status status) {
  290 + FaturamentoSituacaoTipo faturamentoSituacaoTipo = new FaturamentoSituacaoTipo();
  291 + faturamentoSituacaoTipo.setIndicadorParalisacaoFaturamento(status.getId());
  292 + imovel.setFaturamentoSituacaoTipo(faturamentoSituacaoTipo);
  293 + }
  294 +
  295 + private Collection<DebitoACobrar> buildCollectionDebitosCobrarVazio(boolean vazio){
  296 + Collection<DebitoACobrar> debitosCobrar = new ArrayList<DebitoACobrar>();
  297 +
  298 + if(vazio == false){
  299 + DebitoACobrar debitoCobrar = new DebitoACobrar();
  300 + DebitoTipo debitoTipo = new DebitoTipo();
  301 + debitoTipo.setIndicadorGeracaoConta(Status.ATIVO.getId());
  302 + debitoCobrar.setDebitoTipo(debitoTipo);
  303 + debitosCobrar.add(debitoCobrar);
  304 + }
  305 +
  306 + return debitosCobrar;
  307 + }
  308 +
  309 + private Collection<DebitoACobrar> buildCollectionDebitosCobrarComDebitoTipo(Status status){
  310 + Collection<DebitoACobrar> debitosCobrar = new ArrayList<DebitoACobrar>();
  311 +
  312 + DebitoTipo debitoTipo = new DebitoTipo();
  313 + debitoTipo.setIndicadorGeracaoConta(status.getId());
  314 +
  315 + DebitoACobrar debitoCobrar = new DebitoACobrar();
  316 + debitoCobrar.setDebitoTipo(debitoTipo);
  317 + debitosCobrar.add(debitoCobrar);
  318 +
  319 + return debitosCobrar;
  320 + }
  321 +
  322 + private Collection<DebitoACobrar> getDebitos(){
  323 + return debitos;
  324 + }
  325 +}
0 326 \ No newline at end of file
... ...