worker-automate-hub 0.5.751__tar.gz → 0.5.753__tar.gz
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-0.5.751 → worker_automate_hub-0.5.753}/PKG-INFO +1 -1
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/pyproject.toml +1 -1
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/utils/util.py +178 -175
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/README.md +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/__init__.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/api/__init__.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/api/ahead_service.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/api/client.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/api/datalake_service.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/api/helpers/__init__.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/api/helpers/api_helpers.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/api/rdp_service.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/api/rpa_fila_service.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/api/rpa_historico_service.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/api/webhook_service.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/cli.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/config/__init__.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/config/settings.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/config.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/core/so_manipulation.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/decorators/__init__.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/decorators/deprecation.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/decorators/rate_limit.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/decorators/repeat.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/decorators/retry.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/decorators/singleton.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/decorators/timeit.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/models/__init__.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/models/dao/__init__.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/models/dao/rpa_configuracao.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/models/dao/rpa_fila.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/models/dao/rpa_historico.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/models/dao/rpa_processo.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/models/dao/rpa_robo.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/models/dto/__init__.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/models/dto/rpa_historico_request_dto.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/models/dto/rpa_processo_entrada_dto.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/models/dto/rpa_processo_rdp_dto.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/models/dto/rpa_sap_dto.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/models/dto/rpa_sistema_dto.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/__init__.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/__init__.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/abertura_livros_fiscais.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/coleta_dje_process.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/conexao_rdp.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/cte_manual.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/cte_xml.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/descartes.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/devolucao_ctf.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/devolucao_ctf_35.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/devolucao_prazo_a_faturar.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/ecac_estadual_go.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/ecac_estadual_main.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/ecac_estadual_mt.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/ecac_estadual_sc.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/ecac_estadual_sp.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/ecac_federal.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/entrada_cte_1353.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/entrada_cte_333.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/entrada_de_notas_15.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/entrada_de_notas_16.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/entrada_de_notas_207.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/entrada_de_notas_32.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/entrada_de_notas_33.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/entrada_de_notas_34.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/entrada_de_notas_36.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/entrada_de_notas_39.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/entrada_de_notas_500.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/entrada_de_notas_503.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/entrada_de_notas_505.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/entrada_de_notas_7139.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/entrada_de_notas_9.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/entrada_de_notas_9000.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/exemplo_processo.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/extracao_fechamento_contabil.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/extracao_fechamento_emsys.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/extracao_saldo_estoque.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/fechar_conexao_rdp.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/fidc_exportacao_docs_portal_b2b.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/fidc_gerar_nosso_numero.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/fidc_remessa_cobranca_cnab240.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/fidc_retorno_cobranca.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/geracao_aprovacao_pedidos.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/geracao_aprovacao_pedidos_novo.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/integracao_contabil.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/integracao_contabil_generica.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/lancamento_pis_cofins.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/lancamento_rateio.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/login_emsys.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/login_emsys_versao_especifica.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/notas_faturamento_sap.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/opex_capex.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/playground.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/sped_fiscal.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/jobs/transferencias.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/task_definitions.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/task_executor.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/utils/__init__.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/utils/env.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/utils/get_creds_gworkspace.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/utils/logger.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/utils/toast.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/utils/updater.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/utils/utils_nfe_entrada.py +0 -0
- {worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/worker.py +0 -0
{worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/utils/util.py
RENAMED
@@ -2754,7 +2754,183 @@ async def itens_not_found_supplier(xml: str) -> RpaRetornoProcessoDTO:
|
|
2754
2754
|
else:
|
2755
2755
|
break
|
2756
2756
|
|
2757
|
-
await worker_sleep(
|
2757
|
+
await worker_sleep(7)
|
2758
|
+
|
2759
|
+
window_title = main_window.window_text()
|
2760
|
+
|
2761
|
+
if "Confirm" in window_title or "Seleciona Itens Fornecedor" in window_title:
|
2762
|
+
console.print("Itens nao localizados para o fornecedor...\n")
|
2763
|
+
if main_window.exists():
|
2764
|
+
main_window.type_keys("%n")
|
2765
|
+
await worker_sleep(10)
|
2766
|
+
|
2767
|
+
console.print(
|
2768
|
+
"Verificando a existencia de tela de selecionar Itens...\n"
|
2769
|
+
)
|
2770
|
+
itens_fornecedor = await is_window_open_by_class(
|
2771
|
+
"TFrmSelecionaItensFornecedor", "TFrmSelecionaItensFornecedor"
|
2772
|
+
)
|
2773
|
+
|
2774
|
+
if itens_fornecedor["IsOpened"] == True:
|
2775
|
+
return RpaRetornoProcessoDTO(
|
2776
|
+
sucesso=True,
|
2777
|
+
retorno="Tela de Itens fornecedor - Multiplas referencias",
|
2778
|
+
status=RpaHistoricoStatusEnum.Sucesso,
|
2779
|
+
)
|
2780
|
+
else:
|
2781
|
+
console.print(
|
2782
|
+
"Não possui a existencia de tela de selecionar Itens Fornecedor...\n"
|
2783
|
+
)
|
2784
|
+
|
2785
|
+
await worker_sleep(10)
|
2786
|
+
console.print("Verificando a existe da tela dos itens com erro...\n")
|
2787
|
+
|
2788
|
+
max_attempts = 60
|
2789
|
+
i = 0
|
2790
|
+
while i < max_attempts:
|
2791
|
+
logs_erro = await is_window_open_by_class(
|
2792
|
+
"TFrmExibeLogErroImportacaoNfe", "TFrmExibeLogErroImportacaoNfe"
|
2793
|
+
)
|
2794
|
+
if logs_erro["IsOpened"] == True:
|
2795
|
+
break
|
2796
|
+
else:
|
2797
|
+
console.print(
|
2798
|
+
"Aguardando confirmação de tela de erro importação NFe...\n"
|
2799
|
+
)
|
2800
|
+
try:
|
2801
|
+
app = Application().connect(class_name="TFrmAguarde")
|
2802
|
+
main_window = app["TMessageForm"]
|
2803
|
+
console.print("Janela 'Information' encontrada!")
|
2804
|
+
window_title = main_window.window_text()
|
2805
|
+
if "Information" in window_title:
|
2806
|
+
main_window.type_keys("%n")
|
2807
|
+
else:
|
2808
|
+
console.print(
|
2809
|
+
"Não possui a existencia de 'Information'...\n"
|
2810
|
+
)
|
2811
|
+
except:
|
2812
|
+
console.print(
|
2813
|
+
"Não possui a existencia de tela de Information...\n"
|
2814
|
+
)
|
2815
|
+
await worker_sleep(5)
|
2816
|
+
i += 1
|
2817
|
+
|
2818
|
+
await worker_sleep(5)
|
2819
|
+
logs_erro = await is_window_open_by_class(
|
2820
|
+
"TFrmExibeLogErroImportacaoNfe", "TFrmExibeLogErroImportacaoNfe"
|
2821
|
+
)
|
2822
|
+
if logs_erro["IsOpened"] == True:
|
2823
|
+
app = Application().connect(
|
2824
|
+
class_name="TFrmExibeLogErroImportacaoNfe"
|
2825
|
+
)
|
2826
|
+
main_window = app["TFrmExibeLogErroImportacaoNfe"]
|
2827
|
+
console.print(
|
2828
|
+
"Tela com itens com erro existe, salvando os itens...\n"
|
2829
|
+
)
|
2830
|
+
|
2831
|
+
btn_save = main_window.child_window(
|
2832
|
+
title="Salvar", class_name="TBitBtn"
|
2833
|
+
)
|
2834
|
+
|
2835
|
+
if btn_save.exists():
|
2836
|
+
max_attempts = 3
|
2837
|
+
i = 0
|
2838
|
+
while i < max_attempts:
|
2839
|
+
console.print("Clicando no botão de salvar...\n")
|
2840
|
+
try:
|
2841
|
+
btn_save.click()
|
2842
|
+
except:
|
2843
|
+
console.print(
|
2844
|
+
"Não foi possivel clicar no Botão OK... \n"
|
2845
|
+
)
|
2846
|
+
await worker_sleep(3)
|
2847
|
+
|
2848
|
+
console.print(
|
2849
|
+
"Verificando a existencia da tela 'Salvar'...\n"
|
2850
|
+
)
|
2851
|
+
try:
|
2852
|
+
app = Application().connect(title="Salvar")
|
2853
|
+
main_window = app["Salvar"]
|
2854
|
+
console.print("Tela 'Salvar' encontrada!")
|
2855
|
+
break
|
2856
|
+
except Exception as e:
|
2857
|
+
console.print(
|
2858
|
+
f"Tela 'Salvar' não encontrada. Tentativa {i + 1}/{max_attempts}."
|
2859
|
+
)
|
2860
|
+
i += 1
|
2861
|
+
|
2862
|
+
if i == max_attempts:
|
2863
|
+
return RpaRetornoProcessoDTO(
|
2864
|
+
sucesso=False,
|
2865
|
+
retorno="Número máximo de tentativas ao tentar conectar à tela 'Salvar'.",
|
2866
|
+
status=RpaHistoricoStatusEnum.Falha,
|
2867
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
2868
|
+
)
|
2869
|
+
|
2870
|
+
await worker_sleep(4)
|
2871
|
+
console.print("Interagindo com a tela 'Salvar'...\n")
|
2872
|
+
path_to_txt = (
|
2873
|
+
f"C:\\Users\\{username}\\Downloads\\erro_itens{xml}.txt"
|
2874
|
+
)
|
2875
|
+
|
2876
|
+
main_window.type_keys("%n")
|
2877
|
+
pyautogui.write(path_to_txt)
|
2878
|
+
await worker_sleep(1)
|
2879
|
+
main_window.type_keys("%l")
|
2880
|
+
console.print("Arquivo salvo com sucesso...\n")
|
2881
|
+
|
2882
|
+
await worker_sleep(3)
|
2883
|
+
with open(
|
2884
|
+
path_to_txt, "r", encoding="latin1", errors="replace"
|
2885
|
+
) as arquivo:
|
2886
|
+
conteudo = arquivo.read()
|
2887
|
+
console.print(
|
2888
|
+
f"Arquivo salvo com sucesso, itens com erro {conteudo}...\n"
|
2889
|
+
)
|
2890
|
+
|
2891
|
+
os.remove(path_to_txt)
|
2892
|
+
console.print("Removendo o arquivo...\n")
|
2893
|
+
|
2894
|
+
return RpaRetornoProcessoDTO(
|
2895
|
+
sucesso=False,
|
2896
|
+
retorno=f"Itens nao localizados p/ fornecedor. Mensagem: {conteudo}",
|
2897
|
+
status=RpaHistoricoStatusEnum.Falha,
|
2898
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)],
|
2899
|
+
)
|
2900
|
+
else:
|
2901
|
+
return RpaRetornoProcessoDTO(
|
2902
|
+
sucesso=False,
|
2903
|
+
retorno="Botao Salvar - Não foi encontrado",
|
2904
|
+
status=RpaHistoricoStatusEnum.Falha,
|
2905
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
2906
|
+
)
|
2907
|
+
|
2908
|
+
else:
|
2909
|
+
return RpaRetornoProcessoDTO(
|
2910
|
+
sucesso=False,
|
2911
|
+
retorno="Tela 'TFrmExibeLogErroImportacaoNfe' não encontrada, tentar novamente...",
|
2912
|
+
status=RpaHistoricoStatusEnum.Falha,
|
2913
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
2914
|
+
)
|
2915
|
+
else:
|
2916
|
+
return RpaRetornoProcessoDTO(
|
2917
|
+
sucesso=False,
|
2918
|
+
retorno="Erro não mapeado, pop-up Confirm não encontrado...",
|
2919
|
+
status=RpaHistoricoStatusEnum.Falha,
|
2920
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
2921
|
+
)
|
2922
|
+
|
2923
|
+
elif "Information" in window_title:
|
2924
|
+
console.print("Tela de NCM para o fornecedor...\n")
|
2925
|
+
if main_window.exists():
|
2926
|
+
console.print("Tela de NCM, clicando em NO para prosseguir...\n")
|
2927
|
+
main_window.type_keys("%n")
|
2928
|
+
return RpaRetornoProcessoDTO(
|
2929
|
+
sucesso=True,
|
2930
|
+
retorno="Tela de NCM - clicado em NO para andamento do processo",
|
2931
|
+
status=RpaHistoricoStatusEnum.Sucesso,
|
2932
|
+
)
|
2933
|
+
|
2758
2934
|
except Exception as e:
|
2759
2935
|
console.print(f"Erro ao tentar acessar TMessageForm: {e}")
|
2760
2936
|
janela_aguarde = await is_window_open_by_class(
|
@@ -2780,180 +2956,7 @@ async def itens_not_found_supplier(xml: str) -> RpaRetornoProcessoDTO:
|
|
2780
2956
|
await worker_sleep(3)
|
2781
2957
|
i += 1
|
2782
2958
|
|
2783
|
-
|
2784
|
-
|
2785
|
-
if "Confirm" in window_title or "Seleciona Itens Fornecedor" in window_title:
|
2786
|
-
console.print("Itens nao localizados para o fornecedor...\n")
|
2787
|
-
if main_window.exists():
|
2788
|
-
main_window.type_keys("%n")
|
2789
|
-
await worker_sleep(10)
|
2790
|
-
|
2791
|
-
console.print(
|
2792
|
-
"Verificando a existencia de tela de selecionar Itens...\n"
|
2793
|
-
)
|
2794
|
-
itens_fornecedor = await is_window_open_by_class(
|
2795
|
-
"TFrmSelecionaItensFornecedor", "TFrmSelecionaItensFornecedor"
|
2796
|
-
)
|
2797
|
-
|
2798
|
-
if itens_fornecedor["IsOpened"] == True:
|
2799
|
-
return RpaRetornoProcessoDTO(
|
2800
|
-
sucesso=True,
|
2801
|
-
retorno="Tela de Itens fornecedor - Multiplas referencias",
|
2802
|
-
status=RpaHistoricoStatusEnum.Sucesso,
|
2803
|
-
)
|
2804
|
-
else:
|
2805
|
-
console.print(
|
2806
|
-
"Não possui a existencia de tela de selecionar Itens Fornecedor...\n"
|
2807
|
-
)
|
2808
|
-
|
2809
|
-
await worker_sleep(10)
|
2810
|
-
console.print("Verificando a existe da tela dos itens com erro...\n")
|
2811
|
-
|
2812
|
-
max_attempts = 60
|
2813
|
-
i = 0
|
2814
|
-
while i < max_attempts:
|
2815
|
-
logs_erro = await is_window_open_by_class(
|
2816
|
-
"TFrmExibeLogErroImportacaoNfe", "TFrmExibeLogErroImportacaoNfe"
|
2817
|
-
)
|
2818
|
-
if logs_erro["IsOpened"] == True:
|
2819
|
-
break
|
2820
|
-
else:
|
2821
|
-
console.print(
|
2822
|
-
"Aguardando confirmação de tela de erro importação NFe...\n"
|
2823
|
-
)
|
2824
|
-
try:
|
2825
|
-
app = Application().connect(class_name="TFrmAguarde")
|
2826
|
-
main_window = app["TMessageForm"]
|
2827
|
-
console.print("Janela 'Information' encontrada!")
|
2828
|
-
window_title = main_window.window_text()
|
2829
|
-
if "Information" in window_title:
|
2830
|
-
main_window.type_keys("%n")
|
2831
|
-
else:
|
2832
|
-
console.print(
|
2833
|
-
"Não possui a existencia de 'Information'...\n"
|
2834
|
-
)
|
2835
|
-
except:
|
2836
|
-
console.print(
|
2837
|
-
"Não possui a existencia de tela de Information...\n"
|
2838
|
-
)
|
2839
|
-
await worker_sleep(5)
|
2840
|
-
i += 1
|
2841
|
-
|
2842
|
-
await worker_sleep(5)
|
2843
|
-
logs_erro = await is_window_open_by_class(
|
2844
|
-
"TFrmExibeLogErroImportacaoNfe", "TFrmExibeLogErroImportacaoNfe"
|
2845
|
-
)
|
2846
|
-
if logs_erro["IsOpened"] == True:
|
2847
|
-
app = Application().connect(
|
2848
|
-
class_name="TFrmExibeLogErroImportacaoNfe"
|
2849
|
-
)
|
2850
|
-
main_window = app["TFrmExibeLogErroImportacaoNfe"]
|
2851
|
-
console.print(
|
2852
|
-
"Tela com itens com erro existe, salvando os itens...\n"
|
2853
|
-
)
|
2854
|
-
|
2855
|
-
btn_save = main_window.child_window(
|
2856
|
-
title="Salvar", class_name="TBitBtn"
|
2857
|
-
)
|
2858
|
-
|
2859
|
-
if btn_save.exists():
|
2860
|
-
max_attempts = 3
|
2861
|
-
i = 0
|
2862
|
-
while i < max_attempts:
|
2863
|
-
console.print("Clicando no botão de salvar...\n")
|
2864
|
-
try:
|
2865
|
-
btn_save.click()
|
2866
|
-
except:
|
2867
|
-
console.print(
|
2868
|
-
"Não foi possivel clicar no Botão OK... \n"
|
2869
|
-
)
|
2870
|
-
await worker_sleep(3)
|
2871
|
-
|
2872
|
-
console.print(
|
2873
|
-
"Verificando a existencia da tela 'Salvar'...\n"
|
2874
|
-
)
|
2875
|
-
try:
|
2876
|
-
app = Application().connect(title="Salvar")
|
2877
|
-
main_window = app["Salvar"]
|
2878
|
-
console.print("Tela 'Salvar' encontrada!")
|
2879
|
-
break
|
2880
|
-
except Exception as e:
|
2881
|
-
console.print(
|
2882
|
-
f"Tela 'Salvar' não encontrada. Tentativa {i + 1}/{max_attempts}."
|
2883
|
-
)
|
2884
|
-
i += 1
|
2885
|
-
|
2886
|
-
if i == max_attempts:
|
2887
|
-
return RpaRetornoProcessoDTO(
|
2888
|
-
sucesso=False,
|
2889
|
-
retorno="Número máximo de tentativas ao tentar conectar à tela 'Salvar'.",
|
2890
|
-
status=RpaHistoricoStatusEnum.Falha,
|
2891
|
-
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
2892
|
-
)
|
2893
|
-
|
2894
|
-
await worker_sleep(4)
|
2895
|
-
console.print("Interagindo com a tela 'Salvar'...\n")
|
2896
|
-
path_to_txt = (
|
2897
|
-
f"C:\\Users\\{username}\\Downloads\\erro_itens{xml}.txt"
|
2898
|
-
)
|
2899
|
-
|
2900
|
-
main_window.type_keys("%n")
|
2901
|
-
pyautogui.write(path_to_txt)
|
2902
|
-
await worker_sleep(1)
|
2903
|
-
main_window.type_keys("%l")
|
2904
|
-
console.print("Arquivo salvo com sucesso...\n")
|
2905
|
-
|
2906
|
-
await worker_sleep(3)
|
2907
|
-
with open(
|
2908
|
-
path_to_txt, "r", encoding="latin1", errors="replace"
|
2909
|
-
) as arquivo:
|
2910
|
-
conteudo = arquivo.read()
|
2911
|
-
console.print(
|
2912
|
-
f"Arquivo salvo com sucesso, itens com erro {conteudo}...\n"
|
2913
|
-
)
|
2914
|
-
|
2915
|
-
os.remove(path_to_txt)
|
2916
|
-
console.print("Removendo o arquivo...\n")
|
2917
|
-
|
2918
|
-
return RpaRetornoProcessoDTO(
|
2919
|
-
sucesso=False,
|
2920
|
-
retorno=f"Itens nao localizados p/ fornecedor. Mensagem: {conteudo}",
|
2921
|
-
status=RpaHistoricoStatusEnum.Falha,
|
2922
|
-
tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)],
|
2923
|
-
)
|
2924
|
-
else:
|
2925
|
-
return RpaRetornoProcessoDTO(
|
2926
|
-
sucesso=False,
|
2927
|
-
retorno="Botao Salvar - Não foi encontrado",
|
2928
|
-
status=RpaHistoricoStatusEnum.Falha,
|
2929
|
-
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
2930
|
-
)
|
2931
|
-
|
2932
|
-
else:
|
2933
|
-
return RpaRetornoProcessoDTO(
|
2934
|
-
sucesso=False,
|
2935
|
-
retorno="Tela 'TFrmExibeLogErroImportacaoNfe' não encontrada, tentar novamente...",
|
2936
|
-
status=RpaHistoricoStatusEnum.Falha,
|
2937
|
-
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
2938
|
-
)
|
2939
|
-
else:
|
2940
|
-
return RpaRetornoProcessoDTO(
|
2941
|
-
sucesso=False,
|
2942
|
-
retorno="Erro não mapeado, pop-up Confirm não encontrado...",
|
2943
|
-
status=RpaHistoricoStatusEnum.Falha,
|
2944
|
-
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
2945
|
-
)
|
2946
|
-
|
2947
|
-
elif "Information" in window_title:
|
2948
|
-
console.print("Tela de NCM para o fornecedor...\n")
|
2949
|
-
if main_window.exists():
|
2950
|
-
console.print("Tela de NCM, clicando em NO para prosseguir...\n")
|
2951
|
-
main_window.type_keys("%n")
|
2952
|
-
return RpaRetornoProcessoDTO(
|
2953
|
-
sucesso=True,
|
2954
|
-
retorno="Tela de NCM - clicado em NO para andamento do processo",
|
2955
|
-
status=RpaHistoricoStatusEnum.Sucesso,
|
2956
|
-
)
|
2959
|
+
|
2957
2960
|
|
2958
2961
|
return RpaRetornoProcessoDTO(
|
2959
2962
|
sucesso=True,
|
File without changes
|
File without changes
|
{worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/api/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/api/ahead_service.py
RENAMED
File without changes
|
{worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/api/client.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/api/rdp_service.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/config/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/config/settings.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/decorators/repeat.py
RENAMED
File without changes
|
{worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/decorators/retry.py
RENAMED
File without changes
|
File without changes
|
{worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/decorators/timeit.py
RENAMED
File without changes
|
{worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/models/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/tasks/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/utils/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/utils/env.py
RENAMED
File without changes
|
File without changes
|
{worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/utils/logger.py
RENAMED
File without changes
|
{worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/utils/toast.py
RENAMED
File without changes
|
{worker_automate_hub-0.5.751 → worker_automate_hub-0.5.753}/worker_automate_hub/utils/updater.py
RENAMED
File without changes
|
File without changes
|
File without changes
|