worker-automate-hub 0.5.91__py3-none-any.whl → 0.5.93__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.
@@ -1080,27 +1080,87 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
1080
1080
  )
1081
1081
 
1082
1082
 
1083
- console.print("Clicando sobre a lupa para inserir o almoxarifado...\n")
1084
- app = Application().connect(class_name="TFrmIncluiItemPreVenda", timeout=60)
1085
- main_window = app["TFrmIncluiItemPreVenda"]
1086
- main_window.set_focus()
1087
- panel_TGroup_Box= main_window.child_window(class_name="TPanel", found_index=2)
1088
- lupa_almoxarifaco = panel_TPage.child_window(class_name="TDBIBitBtn", found_index=1)
1089
- lupa_almoxarifaco.click()
1090
- console.print("Lupa clicado com sucesso inserindo a descrição do almoxarifado...\n")
1091
- await worker_sleep(2)
1083
+ i = 0
1084
+ while i < 3:
1085
+ try:
1086
+ console.print("Clicando sobre a lupa para inserir o almoxarifado...\n")
1087
+ app = Application().connect(class_name="TFrmIncluiItemPreVenda", timeout=60)
1088
+ main_window = app["TFrmIncluiItemPreVenda"]
1089
+ main_window.set_focus()
1090
+ panel_TGroup_Box= main_window.child_window(class_name="TPanel", found_index=2)
1091
+ lupa_almoxarifaco = panel_TGroup_Box.child_window(class_name="TDBIBitBtn", found_index=1)
1092
+ lupa_almoxarifaco.click()
1093
+ console.print("Lupa clicado com sucesso inserindo a descrição do almoxarifado...\n")
1094
+ await worker_sleep(2)
1095
+
1096
+ dialog_buscar = is_window_open_by_class("TfrmDialogBuscaGeral", "TfrmDialogBuscaGeral")
1097
+ if dialog_buscar["IsOpened"] == True:
1098
+ break
1099
+ else:
1100
+ console.print("Não foi possivel abrir a janela de Busca Geral")
1101
+ i = i+1
1102
+ except Exception as e:
1103
+ console.print(f"Erro ao abrir a janela de Busca Geral: {e}")
1104
+ i = i+1
1105
+
1106
+
1107
+ if i == 3:
1108
+ retorno = f"Não foi possivel abrir a tela para buscar pelo item do produto na seleção do almoxarifado - \nEtapas Executadas:\n{steps}"
1109
+ return RpaRetornoProcessoDTO(
1110
+ sucesso=False,
1111
+ retorno=retorno,
1112
+ status=RpaHistoricoStatusEnum.Falha,
1113
+ tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
1114
+ )
1092
1115
 
1093
1116
  app = Application().connect(class_name="TfrmDialogBuscaGeral", timeout=60)
1094
1117
  main_window = app["TfrmDialogBuscaGeral"]
1095
1118
  main_window.set_focus()
1096
1119
 
1097
- field_descricao_almoxarifado = main_window.child_window(class_name="TEdit", found_index=0)
1098
- field_descricao_almoxarifado.set_edit_text(descricao)
1099
- await worker_sleep(2)
1120
+ console.print("Buscando a mercadoria baseado na descrição...\n")
1121
+ rect = main_window.rectangle()
1122
+ center_x = (rect.left + rect.right) // 2
1123
+ center_y = (rect.top + rect.bottom) // 2
1100
1124
 
1101
- btn_lupa_pesquisar = main_window.child_window(class_name="TBitBtn", found_index=0)
1102
- btn_lupa_pesquisar.click()
1103
- await worker_sleep(2)
1125
+ pyautogui.moveTo(center_x, center_y)
1126
+ pyautogui.click(coords=(center_x, center_y))
1127
+ await worker_sleep(1)
1128
+ send_keys("^({HOME})")
1129
+
1130
+ last_line = ''
1131
+ while True:
1132
+ with pyautogui.hold('ctrl'):
1133
+ pyautogui.press('c')
1134
+ await worker_sleep(1)
1135
+ with pyautogui.hold('ctrl'):
1136
+ pyautogui.press('c')
1137
+
1138
+ win32clipboard.OpenClipboard()
1139
+ descricao_item = win32clipboard.GetClipboardData().strip()
1140
+ win32clipboard.CloseClipboard()
1141
+
1142
+ if last_line == descricao_item:
1143
+ retorno = f"Todos os itens percorridos e não foi possivel encontrar a descrição condizente a {descricao} \nEtapas Executadas:\n{steps}"
1144
+ return RpaRetornoProcessoDTO(
1145
+ sucesso=False,
1146
+ retorno=retorno,
1147
+ status=RpaHistoricoStatusEnum.Falha,
1148
+ tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
1149
+ )
1150
+ else:
1151
+ if descricao.lower() in descricao_item.lower():
1152
+ break
1153
+ else:
1154
+ last_line = descricao_item
1155
+ pyautogui.press('down')
1156
+
1157
+ # field_descricao_almoxarifado = main_window.child_window(class_name="TEdit", found_index=0)
1158
+ # field_descricao_almoxarifado.set_edit_text(descricao)
1159
+ # await worker_sleep(2)
1160
+
1161
+ # btn_lupa_pesquisar = main_window.child_window(class_name="TBitBtn", found_index=0)
1162
+ # btn_lupa_pesquisar.click()
1163
+ # await worker_sleep(2)
1104
1164
 
1105
1165
  main_window.set_focus()
1106
1166
  send_keys("%o")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: worker-automate-hub
3
- Version: 0.5.91
3
+ Version: 0.5.93
4
4
  Summary: Worker Automate HUB é uma aplicação para automatizar rotinas de RPA nos ambientes Argenta.
5
5
  Author: Joel Paim
6
6
  Requires-Python: >=3.12,<4.0
@@ -38,7 +38,7 @@ worker_automate_hub/tasks/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
38
38
  worker_automate_hub/tasks/jobs/coleta_dje_process.py,sha256=UkLWTC5Ub2qBb0yY-8IZ0DLLOVJOfNTq_z9krx_t25Q,29476
39
39
  worker_automate_hub/tasks/jobs/conexao_rdp.py,sha256=S6QC4xhuo0pB5FjaUJZNMm1LIgEjpjifReCTBDqxH-U,11719
40
40
  worker_automate_hub/tasks/jobs/descartes.py,sha256=0bMCJ0xIcK8TLSgjF6taAbGFLMU-sGDVFIhUYSRtrbg,41092
41
- worker_automate_hub/tasks/jobs/devolucao_prazo_a_faturar.py,sha256=f0dA_EIXKzzoKG1qCbcpjtRMDwdEPhASFxFaZFwF9I0,87598
41
+ worker_automate_hub/tasks/jobs/devolucao_prazo_a_faturar.py,sha256=evV1YLcQlu2EhAnkdH_Mwuwe6fe7AUKJ4VfSmwkJJK4,90966
42
42
  worker_automate_hub/tasks/jobs/ecac_estadual_go.py,sha256=dKkf22nH5gp3RErq5u0UzRsKyJ81fc6ZZ4vLtUuMwHA,21002
43
43
  worker_automate_hub/tasks/jobs/ecac_estadual_main.py,sha256=8WmKe4-MRtzHobXz2S4YBDNN8alfawkC-BBlRY-mn1g,1726
44
44
  worker_automate_hub/tasks/jobs/ecac_estadual_mt.py,sha256=C26zmpGQGUq6sP9lU9nanM3Fje-rkyx5tjwmRy4lyL8,25300
@@ -77,7 +77,7 @@ worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbV
77
77
  worker_automate_hub/utils/util.py,sha256=HMUXpF3bf0v2ntbols6d8xr-okDcRsnV54WAwLAPpJ0,162317
78
78
  worker_automate_hub/utils/utils_nfe_entrada.py,sha256=iYpOs7fb7C3bY61QHySr00xlDNzrrCP0zaexOpBPuaQ,31930
79
79
  worker_automate_hub/worker.py,sha256=CT-poyP1ZYvubArYsnnNd9oJ53SPaDwgr6p6keS3nI4,6248
80
- worker_automate_hub-0.5.91.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
81
- worker_automate_hub-0.5.91.dist-info/METADATA,sha256=jAFJQsNWegbCX_sJNOUk5CswCJmZK16MApgwefs8lAE,2894
82
- worker_automate_hub-0.5.91.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
83
- worker_automate_hub-0.5.91.dist-info/RECORD,,
80
+ worker_automate_hub-0.5.93.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
81
+ worker_automate_hub-0.5.93.dist-info/METADATA,sha256=L9a7isojXFikPLMWDVT6GLvOILnWuYcbIJMjcb1nDEQ,2894
82
+ worker_automate_hub-0.5.93.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
83
+ worker_automate_hub-0.5.93.dist-info/RECORD,,