Skip to content

Commit

Permalink
P0 gas coses extra
Browse files Browse the repository at this point in the history
  • Loading branch information
eberloso committed Sep 26, 2023
1 parent 22e24c2 commit 264184c
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 4 deletions.
20 changes: 17 additions & 3 deletions gestionatr/input/messages/message_gas.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@
'A25': 'A2543.xsd',
'A26': 'A2643.xsd',
},
'29': {
'A5': 'A529.xsd',
'A6': 'A629.xsd',
}
})

MAIN_MESSAGE_XSD.update({
Expand Down Expand Up @@ -204,6 +208,9 @@
'A443': 'a443',
'A2543': 'a2543',
'A2643': 'a2643',
# 29
'A529': 'a529',
'A629': 'a629',
})


Expand Down Expand Up @@ -242,9 +249,16 @@ def set_tipus(self):
self.pas = self.head.codproceso.text
self.codproceso = self.pas
except:
msg = u'No se puede identificar el código de proceso ' \
u'o código de paso'
raise except_f1('Error', msg)
try:
# If per el "P0" (aka A529)
self.tipus = self.head.codproceso.text
self.processcode = self.tipus
self.pas = self.head.tipomensaje.text
self.messagetype = self.pas
except:
msg = u'No se puede identificar el código de proceso ' \
u'o código de paso'
raise except_f1('Error', msg)


# Funcions relacionades amb la capçalera del XML
Expand Down
31 changes: 30 additions & 1 deletion gestionatr/output/messages/sw_a5_29.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,25 @@ def __init__(self):
"""

GAS_ENVELOPE_TEMPLATE_CHATGPT = """
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsrps="http://localhost/sctd/wsrps" xmlns:a529="http://localhost/sctd/A529">
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsrps="http://localhost/sctd/wsrps"
xmlns:a529="http://localhost/sctd/A529">
<soapenv:Header/>
<soapenv:Body>
<wsrps:consultaCups>
<wsrps:consultaCups>
{xml_str}
</wsrps:consultaCups>
</wsrps:consultaCups>
</soapenv:Body>
</soapenv:Envelope>
"""

GAS_ENVELOPE_TEMPLATE_CHATGPT_v2 = """
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsrps="http://localhost/sctd/wsrps">
<soapenv:Header/>
<soapenv:Body>
<wsrps:consultaCups>
Expand Down Expand Up @@ -116,4 +134,15 @@ def __init__(self):
'extra_headers': {
},
},
'reintent4': {
'template': GAS_ENVELOPE_TEMPLATE_CHATGPT_v2,
'extra_headers': {
"soapAction": ""
},
},
'reintent5': {
'template': GAS_ENVELOPE_TEMPLATE_CHATGPT_v2,
'extra_headers': {
},
},
}

0 comments on commit 264184c

Please sign in to comment.