Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Sat.Dtec.Job
- {
- class ComAuto_GEDRecebimentoProtocolos : ComunicacoesAutomaticas
- {
- private List<DtoProtocolosDoDia> destinatariosAvisoRecebimento;
- public ComAuto_GEDRecebimentoProtocolos()
- : base(
- "GED.RECEBIMENTO.PROTOCOLOS",
- FcDtec.AreaComunicacao.GED,
- FcDtec.AssuntoComunicacao.GED_RECEBIMENTO_PROTOCOLOS,
- FcDtec.TipoComunicacao.AVISO,
- "Aviso de recebimento de documentos no GED na data de " + DateTime.Now.AddDays(-1).ToShortDateString(),
- null,
- new PadraoDeRepeticao(PadraoDeRepeticao.tipoRepeticaoComParametroAdicional.ApenasEmDiasEspecificos,
- new List<DateTime> { DateTime.ParseExact("15/02/2019", "dd/MM/yyyy", CultureInfo.InvariantCulture)}
- ))
- { }
- protected override List<IdentificationNumber> ListarDestinatariosComunicacao()
- {
- List<IdentificationNumber> retorno = new List<IdentificationNumber>();
- destinatariosAvisoRecebimento = FcGed.ListarProtocolosDoDia();
- if (destinatariosAvisoRecebimento != null && destinatariosAvisoRecebimento.Count > 0)
- {
- foreach (DtoProtocolosDoDia destinatarioAviso in destinatariosAvisoRecebimento)
- {
- if(!jaConstaLevandoEmContaIEeCNPJ(retorno, destinatarioAviso.Requerente))
- {
- retorno.Add(destinatarioAviso.Requerente);
- }
- }
- }
- else
- {
- return null;
- }
- return retorno;
- }
- protected override string getTextoComunicacaoEletronica()
- {
- String br = "\n";
- return
- //SvcCadastro.getNomeCPFCNPJIE(IdInteressado) + ", " +
- //SvcEmail.formataIdentificacao(IdInteressado.ToString(false)) + "," + br +
- "["+FcDtec.DTEC_COLUNA_RESERVADA_DESTINATARIO +"]" +
- br +
- "Os documentos abaixo listados foram registrados no Gestor Eletrônico de " +
- "Documentos do SAT -- Sistema de Administração Tributária:" +
- br + cPROTOCOLO1 + ": " + cDOCS_PROTOCOLO1 +
- br +
- br +
- br + cPROTOCOLO2 + ": " + cDOCS_PROTOCOLO2 +
- br +
- cENTRE_OUTROS + br +
- br +
- "Por gentileza, confira se as informações relacionados aos documentos " +
- "estão corretas e se os documentos em formato eletrônico correspondem aos originais." +
- br +
- br +
- "Módulo GED -- Gestor Eletrônico de Documentos" + br +
- "SAT - Sistema de Administração Tributária" + br +
- "Secretaria de Estado da Fazenda";
- }
- protected string cPROTOCOLO1 = "[" + "PROTOCOLO1" + "]";
- protected string cDOCS_PROTOCOLO1 = "[" + "DOCS_PROTOCOLO1" + "]";
- protected string cPROTOCOLO2 = "[" + "PROTOCOLO2" + "]";
- protected string cDOCS_PROTOCOLO2 = "[" + "DOCS_PROTOCOLO2" + "]";
- protected string cENTRE_OUTROS = "[" + "ENTRE_OUTROS" + "]";
- protected override DataTable criaESalvaArquivoCSV(List<IdentificationNumber> confirmadosParaReceber)
- {
- // colunas com nomes reservados:
- // FcDtec.DTEC_COLUNA_RESERVADA_ID_ORIGEM
- // FcDtec.DTEC_COLUNA_RESERVADA_ANEXO_1
- List<string> listaNomesColunas = new List<string>
- {
- cPROTOCOLO1,
- cDOCS_PROTOCOLO1,
- cPROTOCOLO2,
- cDOCS_PROTOCOLO2,
- cENTRE_OUTROS,
- FcDtec.DTEC_COLUNA_RESERVADA_ID_ORIGEM
- //,FcDtec.DTEC_COLUNA_RESERVADA_ANEXO_1 <-- Se tivesse roteiro padrão
- };
- // remove os caracteres "[" e "]"
- listaNomesColunas = listaNomesColunas.Select(s => s.Replace("[", String.Empty).Replace("]", String.Empty)).ToList();
- DataTable listaBaseCSV = this.criaNovaTabelaParaCSV(listaNomesColunas);
- foreach(IdentificationNumber confirmado in confirmadosParaReceber)
- {
- ComAuto_GEDRecebimentoProtocolos_LinhaArquivoCSV novaLinha =
- new ComAuto_GEDRecebimentoProtocolos_LinhaArquivoCSV(
- confirmado,
- "prot1",
- "docsprot1",
- "prot2",
- "docsprot2",
- "entre outros",
- montaIdentificadorOrigem(confirmado, DateTime.Now)
- );
- novaLinha.adicionaNaTabelaBaseCSV(listaBaseCSV);
- }
- return listaBaseCSV;
- // e roteiro padrão?
- //if (getIdentificadorRoteiro() != RoteirosJobs.SEM_ROTEIRO)
- //{
- // comunicacao.listaAnexos = new List<DtoAnexoDTEC>();
- // comunicacao.listaAnexos.Add(getRoteiroUltimaVersao());
- //}
- }
- protected override bool naoEnviarParaEvitarRepeticao(IdentificationNumber IdInteressado)
- {
- // vamos usar a lógica de evitar reenvio com base na data
- return this.jaRecebeuEssaComunicacaoPorData(IdInteressado, DateTime.Now);
- }
- }// fim classe
- public class ComAuto_GEDRecebimentoProtocolos_LinhaArquivoCSV
- {
- private IdentificationNumber DESTINATARIO;
- private string PROTOCOLO1;
- private string DOCS_PROTOCOLO1;
- private string PROTOCOLO2;
- private string DOCS_PROTOCOLO2;
- private string ENTRE_OUTROS;
- private string ID_ORIGEM;
- public ComAuto_GEDRecebimentoProtocolos_LinhaArquivoCSV(
- IdentificationNumber pDESTINATARIO,
- string pPROTOCOLO1,
- string pDOCS_PROTOCOLO1,
- string pPROTOCOLO2,
- string pDOCS_PROTOCOLO2,
- string pENTRE_OUTROS,
- string pID_ORIGEM)
- {
- DESTINATARIO = pDESTINATARIO;
- PROTOCOLO1 = pPROTOCOLO1;
- DOCS_PROTOCOLO1 = pDOCS_PROTOCOLO1;
- PROTOCOLO2 = pPROTOCOLO2;
- DOCS_PROTOCOLO2 = pDOCS_PROTOCOLO2;
- ENTRE_OUTROS = pENTRE_OUTROS;
- ID_ORIGEM = pID_ORIGEM;
- }
- public void adicionaNaTabelaBaseCSV(DataTable tabelaBase)
- {
- tabelaBase.Rows.Add(
- ComunicacoesAutomaticas.verificaPontoVirgula(DESTINATARIO.ToString(false)),
- ComunicacoesAutomaticas.verificaPontoVirgula(PROTOCOLO1),
- ComunicacoesAutomaticas.verificaPontoVirgula(DOCS_PROTOCOLO1),
- ComunicacoesAutomaticas.verificaPontoVirgula(PROTOCOLO2),
- ComunicacoesAutomaticas.verificaPontoVirgula(DOCS_PROTOCOLO2),
- ComunicacoesAutomaticas.verificaPontoVirgula(ENTRE_OUTROS),
- ComunicacoesAutomaticas.verificaPontoVirgula(ID_ORIGEM));
- }
- } // fim ComAuto_GEDRecebimentoProtocolos_LinhaArquivoCSV
- }// fim namespace
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement