worker-automate-hub 0.5.763__py3-none-any.whl → 0.5.764__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.
- worker_automate_hub/tasks/jobs/extracao_saldo_estoque.py +104 -50
- worker_automate_hub/tasks/jobs/extracao_saldo_estoque_fiscal.py +76 -29
- {worker_automate_hub-0.5.763.dist-info → worker_automate_hub-0.5.764.dist-info}/METADATA +1 -1
- {worker_automate_hub-0.5.763.dist-info → worker_automate_hub-0.5.764.dist-info}/RECORD +6 -6
- {worker_automate_hub-0.5.763.dist-info → worker_automate_hub-0.5.764.dist-info}/WHEEL +0 -0
- {worker_automate_hub-0.5.763.dist-info → worker_automate_hub-0.5.764.dist-info}/entry_points.txt +0 -0
@@ -1,9 +1,10 @@
|
|
1
1
|
import asyncio
|
2
2
|
import os
|
3
3
|
from datetime import datetime
|
4
|
-
from pywinauto import Application, timings, findwindows
|
4
|
+
from pywinauto import Application, timings, findwindows, Desktop
|
5
5
|
import sys
|
6
6
|
import io
|
7
|
+
import win32gui
|
7
8
|
# sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..')))
|
8
9
|
|
9
10
|
from worker_automate_hub.models.dto.rpa_historico_request_dto import (
|
@@ -114,10 +115,13 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
|
|
114
115
|
tentativa = 1
|
115
116
|
sucesso = False
|
116
117
|
|
118
|
+
# defina caminho_arquivo ANTES para não ficar indefinido
|
119
|
+
caminho_arquivo = rf"C:\Users\automatehub\Downloads\saldo_estoque_{periodo_format}_{filial}.xlsx"
|
120
|
+
|
117
121
|
while tentativa <= max_tentativas and not sucesso:
|
118
122
|
console.print(f"Tentativa {tentativa} de {max_tentativas}", style="bold cyan")
|
119
123
|
|
120
|
-
# 1) Abrir o picker
|
124
|
+
# 1) Abrir o picker pelo botão (imagem)
|
121
125
|
console.print("Procurando botão de salvar (imagem)...", style="bold cyan")
|
122
126
|
caminho_img = r'assets\\extracao_relatorios\\btn_salvar.png'
|
123
127
|
if os.path.isfile(caminho_img):
|
@@ -132,40 +136,92 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
|
|
132
136
|
|
133
137
|
await worker_sleep(8)
|
134
138
|
|
135
|
-
# 2) Selecionar formato
|
139
|
+
# 2) Selecionar formato Excel (desambiguando múltiplas TFrmRelatorioFormato)
|
136
140
|
console.print("Selecionando formato Excel...", style="bold cyan")
|
137
141
|
try:
|
138
|
-
|
139
|
-
|
140
|
-
|
142
|
+
desktop = Desktop(backend="win32")
|
143
|
+
|
144
|
+
# Liste todas as visíveis
|
145
|
+
wins_visiveis = desktop.windows(class_name="TFrmRelatorioFormato", visible_only=True)
|
146
|
+
if not wins_visiveis:
|
147
|
+
raise RuntimeError("Janela de formato não apareceu.")
|
148
|
+
|
149
|
+
# 2.1) Tente a janela em foco (foreground)
|
150
|
+
h_fore = win32gui.GetForegroundWindow()
|
151
|
+
alvo = None
|
152
|
+
for w in wins_visiveis:
|
153
|
+
if w.handle == h_fore:
|
154
|
+
alvo = w
|
155
|
+
break
|
156
|
+
|
157
|
+
# 2.2) Se não estiver em foco, pegue a que contém um TComboBox (a 'Configuração para Salvar arq...')
|
158
|
+
if alvo is None:
|
159
|
+
candidatos = []
|
160
|
+
for w in wins_visiveis:
|
161
|
+
try:
|
162
|
+
if w.child_window(class_name="TComboBox").exists(timeout=0.8):
|
163
|
+
candidatos.append(w)
|
164
|
+
except Exception:
|
165
|
+
pass
|
166
|
+
if candidatos:
|
167
|
+
alvo = candidatos[-1] # a mais recente
|
168
|
+
else:
|
169
|
+
alvo = wins_visiveis[-1] # fallback
|
170
|
+
|
171
|
+
# Trabalhe via WindowSpecification
|
172
|
+
spec_fmt = desktop.window(handle=alvo.handle)
|
173
|
+
spec_fmt.wait("visible", timeout=10)
|
174
|
+
win_fmt = spec_fmt.wrapper_object()
|
175
|
+
win_fmt.set_focus()
|
176
|
+
|
177
|
+
# Acessar o ComboBox
|
178
|
+
try:
|
179
|
+
combo_spec = spec_fmt.child_window(class_name="TComboBox")
|
180
|
+
except Exception:
|
181
|
+
combo_spec = spec_fmt.child_window(control_type="ComboBox")
|
182
|
+
combo_spec.wait("exists enabled", timeout=10)
|
183
|
+
combo = combo_spec.wrapper_object()
|
141
184
|
|
142
|
-
combo = win_fmt.ComboBox
|
143
185
|
textos = combo.texts()
|
144
186
|
console.print(f"Itens do ComboBox: {textos}", style="bold yellow")
|
145
187
|
|
146
|
-
#
|
188
|
+
# Seleção por índice conhecido; fallback por texto
|
147
189
|
try:
|
148
190
|
combo.select(8)
|
149
191
|
except Exception:
|
150
|
-
|
192
|
+
alvo_idx = None
|
151
193
|
for i, t in enumerate(textos):
|
152
194
|
if "EXCEL" in str(t).upper() or "XLSX" in str(t).upper():
|
153
|
-
|
195
|
+
alvo_idx = i
|
154
196
|
break
|
155
|
-
if
|
156
|
-
combo.select(alvo)
|
157
|
-
else:
|
197
|
+
if alvo_idx is None:
|
158
198
|
console.print("Não foi possível localizar a opção de Excel no ComboBox.", style="bold red")
|
159
199
|
tentativa += 1
|
160
200
|
await worker_sleep(2)
|
161
201
|
continue
|
202
|
+
combo.select(alvo_idx)
|
162
203
|
|
163
204
|
await worker_sleep(1)
|
164
205
|
|
165
|
-
#
|
166
|
-
|
167
|
-
|
168
|
-
|
206
|
+
# Clique em OK
|
207
|
+
btn_ok_spec = spec_fmt.child_window(class_name="TBitBtn", found_index=1)
|
208
|
+
btn_ok_spec.wait("enabled", timeout=5)
|
209
|
+
btn_ok_spec.click_input()
|
210
|
+
|
211
|
+
# Aguarde a janela de formato desaparecer
|
212
|
+
try:
|
213
|
+
spec_fmt.wait_not("visible", timeout=10)
|
214
|
+
except Exception:
|
215
|
+
pass
|
216
|
+
|
217
|
+
# Feche possíveis duplicatas remanescentes (defensivo)
|
218
|
+
for w in desktop.windows(class_name="TFrmRelatorioFormato", visible_only=True):
|
219
|
+
if w.handle != alvo.handle:
|
220
|
+
try:
|
221
|
+
w.close()
|
222
|
+
except Exception:
|
223
|
+
pass
|
224
|
+
|
169
225
|
except Exception as e:
|
170
226
|
console.print(f"Falha ao selecionar formato: {e}", style="bold red")
|
171
227
|
tentativa += 1
|
@@ -177,19 +233,17 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
|
|
177
233
|
# 3) Janela "Salvar para arquivo"
|
178
234
|
console.print("Abrindo janela de salvar arquivo...", style="bold cyan")
|
179
235
|
try:
|
180
|
-
app_save = Application().connect(title_re="Salvar para arquivo", timeout=30)
|
181
|
-
|
182
|
-
|
236
|
+
app_save = Application(backend="win32").connect(title_re="Salvar para arquivo|Salvar como|Save As", timeout=30)
|
237
|
+
spec_save = app_save.window(title_re="Salvar para arquivo|Salvar como|Save As")
|
238
|
+
spec_save.wait("visible", timeout=30)
|
239
|
+
win_save = spec_save.wrapper_object()
|
183
240
|
except Exception as e:
|
184
241
|
console.print(f"Não achou a janela 'Salvar para arquivo': {e}", style="bold red")
|
185
242
|
tentativa += 1
|
186
243
|
await worker_sleep(3)
|
187
244
|
continue
|
188
245
|
|
189
|
-
#
|
190
|
-
caminho_arquivo = rf"C:\Users\automatehub\Downloads\saldo_estoque_{periodo_format}_{filial}.xlsx"
|
191
|
-
|
192
|
-
# Se já existe, removemos para evitar pop-up de confirmação
|
246
|
+
# 3.1) Remover arquivo pré-existente
|
193
247
|
if os.path.exists(caminho_arquivo):
|
194
248
|
try:
|
195
249
|
os.remove(caminho_arquivo)
|
@@ -197,27 +251,32 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
|
|
197
251
|
except Exception as e:
|
198
252
|
console.print(f"Não foi possível remover o arquivo existente: {e}", style="bold red")
|
199
253
|
|
254
|
+
# 3.2) Preencher nome e salvar
|
200
255
|
try:
|
201
|
-
|
202
|
-
|
256
|
+
campo_spec = spec_save.child_window(class_name="Edit", control_id=1148)
|
257
|
+
campo_spec.wait("exists enabled visible", timeout=10)
|
258
|
+
campo_nome = campo_spec.wrapper_object()
|
203
259
|
campo_nome.set_focus()
|
204
|
-
# limpa conteúdo
|
205
260
|
try:
|
206
261
|
campo_nome.set_edit_text("")
|
207
262
|
except Exception:
|
208
|
-
# fallback limpando com Ctrl+A + Delete
|
209
263
|
campo_nome.type_keys("^a{DELETE}", pause=0.02)
|
210
264
|
|
211
|
-
# digita caminho
|
212
265
|
campo_nome.type_keys(caminho_arquivo, with_spaces=True, pause=0.01)
|
213
266
|
console.print(f"Arquivo configurado para: {caminho_arquivo}", style="bold green")
|
214
267
|
|
215
268
|
await worker_sleep(1)
|
216
269
|
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
270
|
+
btn_salvar_spec = spec_save.child_window(class_name="Button", found_index=0)
|
271
|
+
btn_salvar_spec.wait("enabled", timeout=10)
|
272
|
+
btn_salvar_spec.click_input()
|
273
|
+
|
274
|
+
# Esperar a janela sumir
|
275
|
+
try:
|
276
|
+
spec_save.wait_not("visible", timeout=15)
|
277
|
+
except Exception:
|
278
|
+
pass
|
279
|
+
|
221
280
|
except Exception as e:
|
222
281
|
console.print(f"Erro ao confirmar salvar: {e}", style="bold red")
|
223
282
|
tentativa += 1
|
@@ -226,32 +285,27 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
|
|
226
285
|
|
227
286
|
await worker_sleep(2)
|
228
287
|
|
229
|
-
# 3.
|
288
|
+
# 3.3) Confirmar sobrescrita (se houver)
|
230
289
|
try:
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
# Tente o primeiro botão (Yes/Sim)
|
239
|
-
win_conf.child_window(class_name="Button", found_index=0).click_input()
|
240
|
-
console.print("Confirmação de sobrescrita respondida.", style="bold yellow")
|
241
|
-
except Exception:
|
242
|
-
pass
|
290
|
+
app_conf = Application(backend="win32").connect(
|
291
|
+
title_re="Confirm(ar)?( )?Salvar( )?Como|Confirm Save As", timeout=3
|
292
|
+
)
|
293
|
+
spec_conf = app_conf.window(title_re="Confirm(ar)?( )?Salvar( )?Como|Confirm Save As")
|
294
|
+
spec_conf.wait("visible", timeout=3)
|
295
|
+
spec_conf.child_window(class_name="Button", found_index=0).click_input()
|
296
|
+
console.print("Confirmação de sobrescrita respondida.", style="bold yellow")
|
243
297
|
except Exception:
|
244
298
|
pass
|
245
299
|
|
246
300
|
await worker_sleep(2)
|
247
301
|
|
248
|
-
# 4) Aguardar
|
302
|
+
# 4) Aguardar 'Printing' (se existir)
|
249
303
|
console.print("Aguardando finalização do processo de impressão/salvamento...", style="bold cyan")
|
250
304
|
try:
|
251
|
-
app_print = Application().connect(title_re="Printing", timeout=5)
|
252
|
-
|
305
|
+
app_print = Application(backend="win32").connect(title_re="Printing", timeout=5)
|
306
|
+
spec_print = app_print.window(title_re="Printing")
|
253
307
|
try:
|
254
|
-
|
308
|
+
spec_print.wait_not("visible", timeout=60)
|
255
309
|
console.print("Janela 'Printing' fechada.", style="bold green")
|
256
310
|
except Exception:
|
257
311
|
console.print("Janela 'Printing' não fechou no tempo esperado. Seguindo.", style="bold yellow")
|
@@ -5,6 +5,7 @@ from pywinauto import Application, timings, findwindows, keyboard, Desktop
|
|
5
5
|
import sys
|
6
6
|
import io
|
7
7
|
import win32gui
|
8
|
+
|
8
9
|
# sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..')))
|
9
10
|
|
10
11
|
from worker_automate_hub.models.dto.rpa_historico_request_dto import (
|
@@ -59,9 +60,7 @@ async def extracao_saldo_estoque_fiscal(
|
|
59
60
|
# Fecha a instancia do emsys - caso esteja aberta
|
60
61
|
await kill_all_emsys()
|
61
62
|
|
62
|
-
app = Application(backend="win32").start(
|
63
|
-
"C:\\Rezende\\EMSys3\\EMSysFiscal_39.exe"
|
64
|
-
)
|
63
|
+
app = Application(backend="win32").start("C:\\Rezende\\EMSys3\\EMSysFiscal.exe")
|
65
64
|
warnings.filterwarnings(
|
66
65
|
"ignore",
|
67
66
|
category=UserWarning,
|
@@ -282,7 +281,6 @@ async def extracao_saldo_estoque_fiscal(
|
|
282
281
|
|
283
282
|
await worker_sleep(2)
|
284
283
|
|
285
|
-
|
286
284
|
max_tentativas = 5
|
287
285
|
tentativa = 1
|
288
286
|
sucesso = False
|
@@ -291,18 +289,25 @@ async def extracao_saldo_estoque_fiscal(
|
|
291
289
|
caminho_arquivo = rf"C:\Users\automatehub\Downloads\saldo_estoque_fiscal_{periodo_format}_{filial}.xlsx"
|
292
290
|
|
293
291
|
while tentativa <= max_tentativas and not sucesso:
|
294
|
-
console.print(
|
292
|
+
console.print(
|
293
|
+
f"Tentativa {tentativa} de {max_tentativas}", style="bold cyan"
|
294
|
+
)
|
295
295
|
|
296
296
|
# 1) Abrir o picker pelo botão (imagem)
|
297
297
|
console.print("Procurando botão de salvar (imagem)...", style="bold cyan")
|
298
|
-
caminho_img = r
|
298
|
+
caminho_img = r"assets\\extracao_relatorios\\btn_salvar.png"
|
299
299
|
if os.path.isfile(caminho_img):
|
300
300
|
pos = pyautogui.locateCenterOnScreen(caminho_img, confidence=0.9)
|
301
301
|
if pos:
|
302
302
|
pyautogui.click(pos)
|
303
|
-
console.print(
|
303
|
+
console.print(
|
304
|
+
"Clique realizado no botão salvar", style="bold green"
|
305
|
+
)
|
304
306
|
else:
|
305
|
-
console.print(
|
307
|
+
console.print(
|
308
|
+
"Imagem encontrada mas não está visível na tela",
|
309
|
+
style="bold yellow",
|
310
|
+
)
|
306
311
|
else:
|
307
312
|
console.print("Imagem do botão salvar NÃO existe", style="bold red")
|
308
313
|
|
@@ -314,7 +319,9 @@ async def extracao_saldo_estoque_fiscal(
|
|
314
319
|
desktop = Desktop(backend="win32")
|
315
320
|
|
316
321
|
# Liste todas as visíveis
|
317
|
-
wins_visiveis = desktop.windows(
|
322
|
+
wins_visiveis = desktop.windows(
|
323
|
+
class_name="TFrmRelatorioFormato", visible_only=True
|
324
|
+
)
|
318
325
|
if not wins_visiveis:
|
319
326
|
raise RuntimeError("Janela de formato não apareceu.")
|
320
327
|
|
@@ -331,12 +338,14 @@ async def extracao_saldo_estoque_fiscal(
|
|
331
338
|
candidatos = []
|
332
339
|
for w in wins_visiveis:
|
333
340
|
try:
|
334
|
-
if w.child_window(class_name="TComboBox").exists(
|
341
|
+
if w.child_window(class_name="TComboBox").exists(
|
342
|
+
timeout=0.8
|
343
|
+
):
|
335
344
|
candidatos.append(w)
|
336
345
|
except Exception:
|
337
346
|
pass
|
338
347
|
if candidatos:
|
339
|
-
alvo = candidatos[-1]
|
348
|
+
alvo = candidatos[-1] # a mais recente
|
340
349
|
else:
|
341
350
|
alvo = wins_visiveis[-1] # fallback
|
342
351
|
|
@@ -367,7 +376,10 @@ async def extracao_saldo_estoque_fiscal(
|
|
367
376
|
alvo_idx = i
|
368
377
|
break
|
369
378
|
if alvo_idx is None:
|
370
|
-
console.print(
|
379
|
+
console.print(
|
380
|
+
"Não foi possível localizar a opção de Excel no ComboBox.",
|
381
|
+
style="bold red",
|
382
|
+
)
|
371
383
|
tentativa += 1
|
372
384
|
await worker_sleep(2)
|
373
385
|
continue
|
@@ -387,7 +399,9 @@ async def extracao_saldo_estoque_fiscal(
|
|
387
399
|
pass
|
388
400
|
|
389
401
|
# Feche possíveis duplicatas remanescentes (defensivo)
|
390
|
-
for w in desktop.windows(
|
402
|
+
for w in desktop.windows(
|
403
|
+
class_name="TFrmRelatorioFormato", visible_only=True
|
404
|
+
):
|
391
405
|
if w.handle != alvo.handle:
|
392
406
|
try:
|
393
407
|
w.close()
|
@@ -405,12 +419,18 @@ async def extracao_saldo_estoque_fiscal(
|
|
405
419
|
# 3) Janela "Salvar para arquivo"
|
406
420
|
console.print("Abrindo janela de salvar arquivo...", style="bold cyan")
|
407
421
|
try:
|
408
|
-
app_save = Application(backend="win32").connect(
|
409
|
-
|
422
|
+
app_save = Application(backend="win32").connect(
|
423
|
+
title_re="Salvar para arquivo|Salvar como|Save As", timeout=30
|
424
|
+
)
|
425
|
+
spec_save = app_save.window(
|
426
|
+
title_re="Salvar para arquivo|Salvar como|Save As"
|
427
|
+
)
|
410
428
|
spec_save.wait("visible", timeout=30)
|
411
429
|
win_save = spec_save.wrapper_object()
|
412
430
|
except Exception as e:
|
413
|
-
console.print(
|
431
|
+
console.print(
|
432
|
+
f"Não achou a janela 'Salvar para arquivo': {e}", style="bold red"
|
433
|
+
)
|
414
434
|
tentativa += 1
|
415
435
|
await worker_sleep(3)
|
416
436
|
continue
|
@@ -419,9 +439,15 @@ async def extracao_saldo_estoque_fiscal(
|
|
419
439
|
if os.path.exists(caminho_arquivo):
|
420
440
|
try:
|
421
441
|
os.remove(caminho_arquivo)
|
422
|
-
console.print(
|
442
|
+
console.print(
|
443
|
+
"Arquivo existente removido para evitar prompt de sobrescrita.",
|
444
|
+
style="bold yellow",
|
445
|
+
)
|
423
446
|
except Exception as e:
|
424
|
-
console.print(
|
447
|
+
console.print(
|
448
|
+
f"Não foi possível remover o arquivo existente: {e}",
|
449
|
+
style="bold red",
|
450
|
+
)
|
425
451
|
|
426
452
|
# 3.2) Preencher nome e salvar
|
427
453
|
try:
|
@@ -435,11 +461,15 @@ async def extracao_saldo_estoque_fiscal(
|
|
435
461
|
campo_nome.type_keys("^a{DELETE}", pause=0.02)
|
436
462
|
|
437
463
|
campo_nome.type_keys(caminho_arquivo, with_spaces=True, pause=0.01)
|
438
|
-
console.print(
|
464
|
+
console.print(
|
465
|
+
f"Arquivo configurado para: {caminho_arquivo}", style="bold green"
|
466
|
+
)
|
439
467
|
|
440
468
|
await worker_sleep(1)
|
441
469
|
|
442
|
-
btn_salvar_spec = spec_save.child_window(
|
470
|
+
btn_salvar_spec = spec_save.child_window(
|
471
|
+
class_name="Button", found_index=0
|
472
|
+
)
|
443
473
|
btn_salvar_spec.wait("enabled", timeout=10)
|
444
474
|
btn_salvar_spec.click_input()
|
445
475
|
|
@@ -462,25 +492,37 @@ async def extracao_saldo_estoque_fiscal(
|
|
462
492
|
app_conf = Application(backend="win32").connect(
|
463
493
|
title_re="Confirm(ar)?( )?Salvar( )?Como|Confirm Save As", timeout=3
|
464
494
|
)
|
465
|
-
spec_conf = app_conf.window(
|
495
|
+
spec_conf = app_conf.window(
|
496
|
+
title_re="Confirm(ar)?( )?Salvar( )?Como|Confirm Save As"
|
497
|
+
)
|
466
498
|
spec_conf.wait("visible", timeout=3)
|
467
499
|
spec_conf.child_window(class_name="Button", found_index=0).click_input()
|
468
|
-
console.print(
|
500
|
+
console.print(
|
501
|
+
"Confirmação de sobrescrita respondida.", style="bold yellow"
|
502
|
+
)
|
469
503
|
except Exception:
|
470
504
|
pass
|
471
505
|
|
472
506
|
await worker_sleep(2)
|
473
507
|
|
474
508
|
# 4) Aguardar 'Printing' (se existir)
|
475
|
-
console.print(
|
509
|
+
console.print(
|
510
|
+
"Aguardando finalização do processo de impressão/salvamento...",
|
511
|
+
style="bold cyan",
|
512
|
+
)
|
476
513
|
try:
|
477
|
-
app_print = Application(backend="win32").connect(
|
514
|
+
app_print = Application(backend="win32").connect(
|
515
|
+
title_re="Printing", timeout=5
|
516
|
+
)
|
478
517
|
spec_print = app_print.window(title_re="Printing")
|
479
518
|
try:
|
480
519
|
spec_print.wait_not("visible", timeout=60)
|
481
520
|
console.print("Janela 'Printing' fechada.", style="bold green")
|
482
521
|
except Exception:
|
483
|
-
console.print(
|
522
|
+
console.print(
|
523
|
+
"Janela 'Printing' não fechou no tempo esperado. Seguindo.",
|
524
|
+
style="bold yellow",
|
525
|
+
)
|
484
526
|
except findwindows.ElementNotFoundError:
|
485
527
|
console.print("Janela 'Printing' não apareceu.", style="bold yellow")
|
486
528
|
except Exception as e:
|
@@ -488,17 +530,23 @@ async def extracao_saldo_estoque_fiscal(
|
|
488
530
|
|
489
531
|
# 5) Validar arquivo salvo
|
490
532
|
if os.path.exists(caminho_arquivo):
|
491
|
-
console.print(
|
533
|
+
console.print(
|
534
|
+
f"Arquivo encontrado: {caminho_arquivo}", style="bold green"
|
535
|
+
)
|
492
536
|
with open(caminho_arquivo, "rb") as f:
|
493
537
|
file_bytes = io.BytesIO(f.read())
|
494
538
|
sucesso = True
|
495
539
|
else:
|
496
|
-
console.print(
|
540
|
+
console.print(
|
541
|
+
"Arquivo não encontrado, tentando novamente...", style="bold red"
|
542
|
+
)
|
497
543
|
tentativa += 1
|
498
544
|
await worker_sleep(3)
|
499
545
|
|
500
546
|
if not sucesso:
|
501
|
-
console.print(
|
547
|
+
console.print(
|
548
|
+
"Falha após 5 tentativas. Arquivo não foi gerado.", style="bold red"
|
549
|
+
)
|
502
550
|
|
503
551
|
nome_com_extensao = f"saldo_estoque_fiscal_{periodo_format}_{filial}.xlsx"
|
504
552
|
# lê o arquivo
|
@@ -542,4 +590,3 @@ async def extracao_saldo_estoque_fiscal(
|
|
542
590
|
status=RpaHistoricoStatusEnum.Falha,
|
543
591
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
544
592
|
)
|
545
|
-
|
@@ -70,8 +70,8 @@ worker_automate_hub/tasks/jobs/entrada_de_notas_9000.py,sha256=0mOmS28tQKF5m7vMz
|
|
70
70
|
worker_automate_hub/tasks/jobs/exemplo_processo.py,sha256=nV0iLoip2FH2-FhLmhX3nPqsfl_MPufZ3E5Q5krJvdc,3544
|
71
71
|
worker_automate_hub/tasks/jobs/extracao_fechamento_contabil.py,sha256=6Kr5DKjKLqtFvGzyiXtt7xrQsuU898l8pQXDq9C6AX8,19567
|
72
72
|
worker_automate_hub/tasks/jobs/extracao_fechamento_emsys.py,sha256=-T2nZUDiFrUGm_KLxJd_4qcrageDxVpWW3KAAniLFC4,21448
|
73
|
-
worker_automate_hub/tasks/jobs/extracao_saldo_estoque.py,sha256=
|
74
|
-
worker_automate_hub/tasks/jobs/extracao_saldo_estoque_fiscal.py,sha256=
|
73
|
+
worker_automate_hub/tasks/jobs/extracao_saldo_estoque.py,sha256=Pviu3Tt5VTx6LzM1Xl8YOXOMwPH2uIbsRlch7aZVN8g,15747
|
74
|
+
worker_automate_hub/tasks/jobs/extracao_saldo_estoque_fiscal.py,sha256=cSKEPsMMETxEfxEb0poSHJBznj8zjD3L3o1a5RQHmf4,23168
|
75
75
|
worker_automate_hub/tasks/jobs/fechar_conexao_rdp.py,sha256=UWAKCS2dbfgDlSQOBdjmVJXfD1MMuUrOi3weDgB0CAc,5718
|
76
76
|
worker_automate_hub/tasks/jobs/fidc_exportacao_docs_portal_b2b.py,sha256=tWUmYy3Zhi3JEt8AoqTsWpU-wbf5-OxhCrTOooh1WH4,15616
|
77
77
|
worker_automate_hub/tasks/jobs/fidc_gerar_nosso_numero.py,sha256=FAmcCqKVjedf7wIped8XRLIZ9S3oWc6fakF-r1Zm0kg,12637
|
@@ -101,7 +101,7 @@ worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbV
|
|
101
101
|
worker_automate_hub/utils/util.py,sha256=V2WtWoETdTrAtGA8UgeqAAVphUj9KkGSZFzYsHJFATA,210055
|
102
102
|
worker_automate_hub/utils/utils_nfe_entrada.py,sha256=TOXKSHOPxy8N3-ROpTGjNIHstX0i2b8qekcj1tRvjG8,38174
|
103
103
|
worker_automate_hub/worker.py,sha256=uhZ3f-iaQ1i8cANbljp50vkYl-Xm0_sHtjwwF_2y72o,7191
|
104
|
-
worker_automate_hub-0.5.
|
105
|
-
worker_automate_hub-0.5.
|
106
|
-
worker_automate_hub-0.5.
|
107
|
-
worker_automate_hub-0.5.
|
104
|
+
worker_automate_hub-0.5.764.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
|
105
|
+
worker_automate_hub-0.5.764.dist-info/METADATA,sha256=EzoBywaY4Qp_AK22cG8Wbu4U4we21kcgoYsGOmn9qAo,3049
|
106
|
+
worker_automate_hub-0.5.764.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
107
|
+
worker_automate_hub-0.5.764.dist-info/RECORD,,
|
File without changes
|
{worker_automate_hub-0.5.763.dist-info → worker_automate_hub-0.5.764.dist-info}/entry_points.txt
RENAMED
File without changes
|