csc-cia-stne 0.0.75__py3-none-any.whl → 0.0.77__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- csc_cia_stne/bc_sta.py +54 -4
- {csc_cia_stne-0.0.75.dist-info → csc_cia_stne-0.0.77.dist-info}/METADATA +1 -1
- {csc_cia_stne-0.0.75.dist-info → csc_cia_stne-0.0.77.dist-info}/RECORD +6 -6
- {csc_cia_stne-0.0.75.dist-info → csc_cia_stne-0.0.77.dist-info}/LICENCE +0 -0
- {csc_cia_stne-0.0.75.dist-info → csc_cia_stne-0.0.77.dist-info}/WHEEL +0 -0
- {csc_cia_stne-0.0.75.dist-info → csc_cia_stne-0.0.77.dist-info}/top_level.txt +0 -0
csc_cia_stne/bc_sta.py
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
|
1
|
+
import logging
|
2
|
+
import hashlib
|
2
3
|
import requests
|
4
|
+
from requests.auth import HTTPBasicAuth
|
3
5
|
import xml.etree.ElementTree as ET
|
4
|
-
import
|
6
|
+
from xml.dom.minidom import parseString
|
5
7
|
from pydantic import BaseModel, ValidationError, field_validator, Field, HttpUrl
|
6
8
|
from typing import Literal, Dict, Union, Optional, List
|
7
|
-
import
|
8
|
-
import logging
|
9
|
+
from datetime import datetime
|
9
10
|
|
10
11
|
log = logging.getLogger('__main__')
|
11
12
|
|
@@ -631,3 +632,52 @@ class BC_STA:
|
|
631
632
|
return {"success": False, "status_code": int(response.status_code), "content": response.text}
|
632
633
|
|
633
634
|
|
635
|
+
def qs_gerar_xml_string_responder_nao_cliente(self,protocolo_inicial_ordem:str,numctrlccs:str,cnpj_cpf:str,numctrlenvio:str,numprocjud:str,identdemissor:str,identddestinatario:str,domsist:str,nuop:str,dtmovto:datetime,cnpjbaseentrespons:str):
|
636
|
+
|
637
|
+
"""Gera a string do arquivo XML de resposta para nao-cliente para ser enviado ao STA
|
638
|
+
Args:
|
639
|
+
protocolo_inicial_ordem (str): protocolo inicial da ordem de quebra de sigilo, do arquivo AMES102
|
640
|
+
numctrlccs (str): numero de controle ccs
|
641
|
+
cnpj_cpf (str): documento do solicitado
|
642
|
+
numctrlenvio (str): numero de controle de envio
|
643
|
+
numprocjud (str): numero do processo judicial
|
644
|
+
identdemissor (str): identificacao do emissor
|
645
|
+
identddestinatario (str): identificacao do destinatario
|
646
|
+
domsist (str): domsist
|
647
|
+
nuop (str): numero da operacao
|
648
|
+
dtmovto (datetime): data da movimentacao
|
649
|
+
cnpjbaseentrespons (str): cnpjbaseentrespons
|
650
|
+
Returns:
|
651
|
+
str: string formatada para gerar um arquivo xml de resposta
|
652
|
+
"""
|
653
|
+
try:
|
654
|
+
|
655
|
+
ns = "http://www.bcb.gov.br/MES/CCS0012.xsd"
|
656
|
+
|
657
|
+
doc = ET.Element("DOC", xmlns=ns)
|
658
|
+
|
659
|
+
bcmsg = ET.SubElement(doc, "BCMSG")
|
660
|
+
ET.SubElement(bcmsg, "IdentdEmissor").text = identdemissor
|
661
|
+
ET.SubElement(bcmsg, "IdentdDestinatario").text = identddestinatario
|
662
|
+
ET.SubElement(bcmsg, "DomSist").text = domsist
|
663
|
+
ET.SubElement(bcmsg, "NUOp").text = nuop
|
664
|
+
|
665
|
+
sismsg = ET.SubElement(doc, "SISMSG")
|
666
|
+
ccs0012 = ET.SubElement(sismsg, "CCS0012")
|
667
|
+
ET.SubElement(ccs0012, "CodMsg").text = "CCS0012"
|
668
|
+
ET.SubElement(ccs0012, "CNPJBaseEntRespons").text = cnpjbaseentrespons
|
669
|
+
ET.SubElement(ccs0012, "NumCtrlCCSOr").text = numctrlccs
|
670
|
+
ET.SubElement(ccs0012, "SitAtedmntReq").text = "03"
|
671
|
+
ET.SubElement(ccs0012, "DtMovto").text = dtmovto.strftime("%Y-%m-%d")
|
672
|
+
|
673
|
+
#return ET.tostring(doc, encoding="utf-8", xml_declaration=True).decode("utf-8")
|
674
|
+
xml_str = ET.tostring(doc, encoding="utf-8", xml_declaration=True).decode("utf-8")
|
675
|
+
|
676
|
+
# Formatando XML com indentação para melhor visualização
|
677
|
+
xml_formatado = parseString(xml_str).toprettyxml(indent=" ")
|
678
|
+
return xml_formatado
|
679
|
+
|
680
|
+
except Exception as e:
|
681
|
+
|
682
|
+
raise Exception(f"Falha ao gerar XML de resposta de Quebra de Sigilo:\n{e}")
|
683
|
+
|
@@ -1,6 +1,6 @@
|
|
1
1
|
csc_cia_stne/__init__.py,sha256=Io-gKis1evws5cHUqyOrcsZKNCQRviYj3zbp__5lgKU,2512
|
2
2
|
csc_cia_stne/bc_correios.py,sha256=pQAnRrcXEMrx3N1MWydZVIhEQLerh3x8-0B045zZIzk,24174
|
3
|
-
csc_cia_stne/bc_sta.py,sha256=
|
3
|
+
csc_cia_stne/bc_sta.py,sha256=xP664rwfq65VcQvzdWYVCNk7_Vevy3Es4AKf7z-8xiI,28914
|
4
4
|
csc_cia_stne/email.py,sha256=RK_TzWBVnUfpP-s5NvjTJJjzhICy8e2fME9EuaiySMY,8162
|
5
5
|
csc_cia_stne/gcp_bigquery.py,sha256=jYxvqrWDOPkxc05U4aef7V5lL8ptqsE93lfn0dLFyvc,7385
|
6
6
|
csc_cia_stne/google_drive.py,sha256=k6GnM8bxQUPbXhaK6Sa4JpWrCcJ0vzYgXP8Uexy7YR0,16073
|
@@ -26,8 +26,8 @@ csc_cia_stne/utilitarios/validations/GoogleDriveValidator.py,sha256=Q1oZTae4hDJ2
|
|
26
26
|
csc_cia_stne/utilitarios/validations/ServiceNowValidator.py,sha256=yleKUIo1ZfyloP9fDPNjv3JJXdLcocT81WIgRSYmqEA,14423
|
27
27
|
csc_cia_stne/utilitarios/validations/__init__.py,sha256=O_qyEU2ji3u6LHUXZCXvUFsMpoMWL625qqHTXyXivTA,106
|
28
28
|
csc_cia_stne/utilitarios/validations/web_validator.py,sha256=HYKYSpDv1RvRjZIuwTPt-AbEz-9392MxM_O329iYuSA,5722
|
29
|
-
csc_cia_stne-0.0.
|
30
|
-
csc_cia_stne-0.0.
|
31
|
-
csc_cia_stne-0.0.
|
32
|
-
csc_cia_stne-0.0.
|
33
|
-
csc_cia_stne-0.0.
|
29
|
+
csc_cia_stne-0.0.77.dist-info/LICENCE,sha256=LPGMtgKki2C3KEZP7hDhA1HBrlq5JCHkIeStUCLEMx4,1073
|
30
|
+
csc_cia_stne-0.0.77.dist-info/METADATA,sha256=ELHxOjlCLXjPi9F8uBFlph3qWwhRxCSLHvutQteMSR0,1340
|
31
|
+
csc_cia_stne-0.0.77.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
32
|
+
csc_cia_stne-0.0.77.dist-info/top_level.txt,sha256=ldo7GVv3tQx5KJvwBzdZzzQmjPys2NDVVn1rv0BOF2Q,13
|
33
|
+
csc_cia_stne-0.0.77.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|