Skip to content

Commit

Permalink
Merge branch 'main' into staging/dump_geosislic
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jan 10, 2025
2 parents fe2e8b2 + 8362121 commit e329d3f
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/notifica--o-de-problema.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Notificação de problema
about: Notifique um problema que está ocorrendo para que possamos corrigí-lo.
title: "[BUG]"
labels: bug
assignees:
assignees:
---

**Descreva o problema**
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/requerimento-de-funcionalidade.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Requerimento de funcionalidade
about: Sugira novas funcionalidades que podem ser úteis a todos os desenvolvedores.
title: "[FEATURE]"
labels: enhancement
assignees:
assignees:
---

**Essa funcionalidade está relacionada a um problema?**
Expand Down
37 changes: 37 additions & 0 deletions pipelines/sislic/dump_db_sislic/schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@
"dump_mode": "overwrite",
"execute_query": """
SELECT
num_lic,
licenca,
num_proc,
cod_dlf,
Expand Down Expand Up @@ -559,9 +560,12 @@
ConcedeNumeracao,
NumConcedida,
OBS,
mat_func,
cancelado,
licgratis,
OrgaoCentral,
CODORGAO_ESPECIAL,
OrdemEmissao,
Licenca_Loteamento,
LicencaAvulsa,
LoteamentoNovoModelo,
Expand Down Expand Up @@ -971,6 +975,7 @@
Num_Hab
,Num_Proc
,Num_Lic
,Habite_se
,Cod_DLF
,Dt_Emissao
,Dt_Certidao
Expand Down Expand Up @@ -1049,12 +1054,14 @@
SELECT Num_Aceitacao
,Num_Proc
,Num_Lic
,Aceitacao
,Cod_DLF
,Dt_Emissao
,Dt_Certidao
,Matricula_RGI
,Nr_Oficio_RGI
,PAL
,DescricaoLote
,Mat_Tec_Resp
,Cancelado
,Obs
Expand Down Expand Up @@ -1082,6 +1089,36 @@
""",
"biglake_table": True,
},
"licenca_transferida": {
"materialize_after_dump": True,
"materialization_mode": "prod",
"dump_mode": "overwrite",
"execute_query": """
SELECT
num_lic_Origem,
num_lic_Destino,
DtTransferencia,
CODORGAOSIGMA_ORIGEM,
CODORGAOSIGMA_DESTINO
FROM SMU_PRD.dbo.tbLIC_LicencasTransferidasCLU_CRU
""",
"biglake_table": True,
},
"registro_cancelamento_produto": {
"materialize_after_dump": True,
"materialization_mode": "prod",
"dump_mode": "overwrite",
"execute_query": """
SELECT
cod_dlf,
tipo,
Nr_documento,
FROM SMU_PRD.dbo.tbLIC_DocCancelados
""",
"biglake_table": True,
},
}

sislic_clocks = generate_dump_db_schedules(
Expand Down
5 changes: 5 additions & 0 deletions queries/models/adm_licenca_urbanismo/alvara_obra_privada.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
SELECT
CAST(CAST(num_lic AS FLOAT64) AS int64) AS id_licenciamento,
licenca AS numero_alvara_licenca,
num_proc AS numero_processo,
cod_dlf AS id_orgao_sislic,
CAST(dt_emissao AS DATETIME) AS data_emissao,
CAST(dt_inicio_validade AS DATETIME) AS data_inicio_validade,
CAST(dt_venc AS DATETIME) AS data_vencimento,
CAST(CAST(prazo AS FLOAT64) AS int64) AS prazo,
CAST(CAST(Dt_alvara AS DATETIME) AS int64) AS data_passe_alvara,
num_darm_pg AS numero_darm_pago,
CAST(vl_lic AS float64) AS valor_darm,
requerente AS requerente,
Expand Down Expand Up @@ -59,9 +61,12 @@ edif_pav AS descricao_edificacao_concatenada,
CAST(concedenumeracao AS bool) AS concede_numeracao,
numconcedida AS numeracao_concedida,
obs AS observacao,
CAST(CAST(mat_func AS FLOAT64) AS INT64) AS matricula_tecnico,
CAST(cancelado AS BOOL) AS cancelado,
CAST(lic_gratis AS BOOL) AS licenca_gratis,
CAST(orgaocentral AS BOOL) AS licenca_orgao_central,
codorgao_especial AS cod_orgao_especial,
OrdemEmissao AS ordem_emissao,
CAST(licenca_loteamento AS BOOL) AS licenca_loteamento,
CAST(licencaavulsa AS BOOL) AS licenca_avulsa,
CAST(loteamentonovomodelo AS BOOL) AS loteamento_novo_modelo,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
SELECT
ID_AREA_PROTECAO_CULTURAL AS id_area_protecao_cultural,
REGEXP_REPLACE(
NORMALIZE(UPPER(DS_AREA_PROTECAO_CULTURAL), NFD),
r'\p{M}',
NORMALIZE(UPPER(DS_AREA_PROTECAO_CULTURAL), NFD),
r'\p{M}',
''
) AS nome_area_protecao_ambiental
FROM `rj-smdue.adm_licenca_urbanismo_staging.area_protecao_cultural`
2 changes: 2 additions & 0 deletions queries/models/adm_licenca_urbanismo/certidao_aceitacao.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ SELECT
Num_Aceitacao AS id_aceitacao,
Num_Proc AS numero_processo,
Num_Lic AS id_licenciamento,
Aceitacao AS numero_certidao,
Cod_DLF AS id_orgao_sislic,
CAST(Dt_Emissao AS DATETIME) AS data_emissao,
CAST(Dt_Certidao AS DATETIME) AS data_certidao,
Matricula_RGI AS matricula_rgi,
Nr_Oficio_RGI AS numero_oficio_rgi,
PAL AS numero_pal,
DescricaoLote AS descricao_lote,
Mat_Tec_Resp AS matricula_tecnico_responsavel,
CAST(Cancelado AS BOOL) AS cancelado,
Obs AS observacao
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ SELECT
Num_Hab AS id_habite_se,
Num_Proc AS numero_processo,
Num_Lic AS id_licenciamento,
Habite_se AS numero_certidao,
Cod_DLF AS id_orgao_sislic,
CAST(Dt_Emissao AS DATETIME) AS data_emissao,
CAST(Dt_Certidao AS DATETIME) AS data_certidao,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ cod_Lic AS cod_Lic,
cod_Compl_Lic AS id_complemento_tipo_licenca ,
compl_Livre AS comentario_licenca,
CAST(Valor AS FLOAT64) AS valor ,
Formula AS formula
Formula AS formula
FROM `rj-smdue.adm_licenca_urbanismo_staging.darm_licenca_alvara`
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ CAST(Id_Lote AS string) AS id_lote ,
CAST(num_lic AS string) AS id_licenciamento,
CAST(CAST(Quantidade AS FLOAT64) AS int64) AS quantidade_lotes,
CAST(CAST(Categoria AS FLOAT64) AS int64) AS categoria_lote,
CAST(CAST(TpLote AS FLOAT64) AS int64) AS lote_aprovado
CAST(CAST(TpLote AS FLOAT64) AS int64) AS lote_aprovado
FROM `rj-smdue.adm_licenca_urbanismo_staging.licenca_loteamento`
7 changes: 7 additions & 0 deletions queries/models/adm_licenca_urbanismo/licenca_transferida.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SELECT
CAST(CAST(num_lic_Origem AS FLOAT64) AS int64) AS id_licenciamento_origem,
CAST(CAST(num_lic_Destino AS FLOAT64) AS int64) AS id_licenciamento_destino,
CAST(DtTransferencia AS DATETIME) AS data_transferencia,
CODORGAOSIGMA_ORIGEM AS id_orgao_SISLIC_origem,
CODORGAOSIGMA_DESTINO AS id_orgao_SISLIC_destino
FROM `rj-smdue.adm_licenca_urbanismo_staging.licenca_transferida`
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SELECT
cod_dlf AS id_orgao_SISLIC,
tipo AS tipo,
Nr_documento AS numero_documento,
CAST(dt_cancelamento AS DATETIME) AS data_cancelamento
FROM `rj-smdue.adm_licenca_urbanismo_staging.registro_cancelamento_produto`

0 comments on commit e329d3f

Please sign in to comment.