sortdisplaySever.py 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. import datetime
  2. from PyQt6 import QtCore
  3. from PyQt6.QtCore import QObject
  4. from .LogerinTxt import app_logger
  5. from Functions.apiFunction import api_fc
  6. class sortdisplaySever(QObject):
  7. sortupdate = QtCore.pyqtSignal(str, dict, list, str, str)
  8. def __init__(self, name, ip, selectedtime, text, displayMode, selectedbc, displayselect, thread):
  9. super().__init__()
  10. self.funcName = name
  11. self.ipinfo = ip
  12. self.selectedtime = selectedtime
  13. self.text = text
  14. self.displayMode = displayMode
  15. self.selectedbc = selectedbc
  16. self.displayselect_mode = displayselect
  17. self.thread = thread
  18. nowDay = datetime.datetime.now().strftime("%Y%m%d")
  19. tomorr =(datetime.date.today() + datetime.timedelta(days=1)).strftime("%Y%m%d")
  20. yester =(datetime.date.today() - datetime.timedelta(days=1)).strftime("%Y%m%d")
  21. if self.selectedtime == nowDay:
  22. self.date = "2"
  23. elif self.selectedtime == tomorr:
  24. self.date = "3"
  25. elif self.selectedtime == yester:
  26. self.date = "1"
  27. else:
  28. self.date = "4"
  29. def run(self):
  30. try:
  31. list = []
  32. if self.funcName == "sortTableWidgetDispaly":
  33. #print("1")
  34. self.sortTableWidgetDispaly()
  35. self.sortupdate.emit("sortTableWidgetDispaly", self.sorttableWidgetDispalydata, list, self.seversts,self.displayMode)
  36. self.sortupdate.emit("sortTableWidgetDispalyALL", self.DispalydataAll, list, self.seversts,self.displayMode)
  37. if self.funcName == "sortTableWidgetDispalyALL":
  38. #print("2")
  39. self.sortTableWidgetDispalyALL()
  40. self.sortupdate.emit("sortTableWidgetDispalyALL", self.sorttableWidgetDispalydata, list, self.seversts,self.displayMode)
  41. elif self.funcName == "SearchsortTableWidgetDispaly":
  42. #print("3")
  43. self.SearchsortTableWidgetDispaly()
  44. self.sortupdate.emit("SearchsortTableWidgetDispaly", self.sorttableWidgetDispalydata, list,self.seversts,self.displayMode)
  45. elif self.funcName == "sorttableWidgetDisplayChange":
  46. #print("4")
  47. self.sorttableWidgetDisplayChange()
  48. self.sortupdate.emit("sorttableWidgetDisplayChange", self.sortlogchange, list, self.seversts,self.displayMode)
  49. elif self.funcName == "sorttableWidgetPeopleDisplay":
  50. self.sorttableWidgetPeopleDisplay()
  51. self.sortupdate.emit("sorttableWidgetPeopleDisplay", self.sortdiplaylist, self.peopleOnJob,self.seversts, self.displayMode)
  52. elif self.funcName == "sorttableWidgetLOGDispaly":
  53. self.sorttableWidgetLOGDispaly()
  54. self.sortupdate.emit("sorttableWidgetLOGDispaly", self.sortlog, list, self.seversts, self.displayMode)
  55. elif self.funcName == "sorttableWidgetPHONEDispaly":
  56. self.sorttableWidgetPHONEDispaly()
  57. self.sortupdate.emit("sorttableWidgetPHONEDispaly", self.sorttableWidgetPHONEDispalydata, list,self.seversts, "")
  58. self.thread.quit()
  59. except Exception as e:
  60. app_logger.log_error(e)
  61. self.thread.quit()
  62. def severpost_nomeassge(self, postname, **kwargs):
  63. try:
  64. # ip = "http://" + str(self.ipinfo) + "/static/" + str(postname) + str(postdata) + str(postdata2) + str(postdata3)
  65. try:
  66. # res = requests.get(url=ip, timeout=30).json()
  67. res = api_fc.request_post('/static/{}'.format(postname), **kwargs)
  68. self.seversts = "1"
  69. return res
  70. except Exception as e:
  71. app_logger.log_error(e)
  72. app_logger.log_error("重大bug")
  73. app_logger.log_error('/static/{} '.format(postname), **kwargs)
  74. self.seversts = "0"
  75. return {}
  76. except Exception as e:
  77. app_logger.log_error(e)
  78. def severget_nomeassge(self, postname, **kwargs):
  79. try:
  80. # ip = "http://" + str(self.ipinfo) + "/static/" + str(postname) + str(postdata) + str(postdata2) + str(postdata3)
  81. try:
  82. # res = requests.get(url=ip, timeout=30).json()
  83. res = api_fc.request_get('/static/{}'.format(postname))
  84. self.seversts = "1"
  85. return res
  86. except Exception as e:
  87. app_logger.log_error(e)
  88. app_logger.log_error("重大bug")
  89. app_logger.log_error('/static/{} '.format(postname), **kwargs)
  90. self.seversts = "0"
  91. return []
  92. except Exception as e:
  93. app_logger.log_error(e)
  94. def sorttableWidgetPHONEDispaly(self):
  95. try:
  96. # sorttableWidgetPHONEDispalydataall = self.severpost_nomeassge("getphonelist", "", "", "")
  97. sorttableWidgetPHONEDispalydataall = self.severget_nomeassge('getphonelist')['data']
  98. self.sorttableWidgetPHONEDispalydata = {}
  99. num = 0
  100. if sorttableWidgetPHONEDispalydataall != None:
  101. if self.text != "":
  102. for i in sorttableWidgetPHONEDispalydataall.keys():
  103. if str.lower(str(self.text)) in str(sorttableWidgetPHONEDispalydataall[i]):
  104. self.sorttableWidgetPHONEDispalydata[str(num)] = sorttableWidgetPHONEDispalydataall[i]
  105. num += 1
  106. else:
  107. self.sorttableWidgetPHONEDispalydata = sorttableWidgetPHONEDispalydataall
  108. except Exception as e:
  109. app_logger.log_error(e)
  110. def checkall(self, datas, text):
  111. res = {}
  112. try:
  113. num = 0
  114. for i in datas.keys():
  115. if datas[i]["109"] != text:
  116. res[str(num)] = datas[i]
  117. num += 1
  118. except Exception as e:
  119. app_logger.log_error(e)
  120. return res
  121. def checkStrsingle(self,datas, text, text2): #单一条件筛选
  122. res = {}
  123. try:
  124. num = 0
  125. for i in datas.keys():
  126. if str(text) in str(datas[i]) and datas[i]["109"] != text2:
  127. res[str(num)] = datas[i]
  128. num += 1
  129. except Exception as e:
  130. app_logger.log_error(e)
  131. return res
  132. def checkStrTerminalAll(self,datas, text1,text2,text3,text4): #筛选航站且显示全部
  133. res = {}
  134. try:
  135. num = 0
  136. for i in datas.keys():
  137. if str(datas[i]["8"]) != "" and datas[i]["109"] != text1:
  138. if str(datas[i]["8"])[0] == text2 and str(datas[i]["8"])[0] == text3:
  139. res[str(num)] = datas[i]
  140. num += 1
  141. elif str(datas[i]["8"]) == "" and str(datas[i]["109"]) == text4:
  142. res[str(num)] = datas[i]
  143. num += 1
  144. except Exception as e:
  145. app_logger.log_error(e)
  146. return res
  147. def checkStrTerminalAll2(self,datas, text1,text2,text3,text4): #筛选航站且显示全部
  148. res = {}
  149. try:
  150. num = 0
  151. for i in datas.keys():
  152. if str(datas[i]["8"]) != "" and datas[i]["109"] != text1:
  153. if str(datas[i]["8"])[0] != text2 and str(datas[i]["8"])[0] != text3:
  154. res[str(num)] = datas[i]
  155. num += 1
  156. elif str(datas[i]["8"]) == "" and str(datas[i]["109"]) == text4:
  157. res[str(num)] = datas[i]
  158. num += 1
  159. except Exception as e:
  160. app_logger.log_error(e)
  161. return res
  162. def checkStrTerminalAll3(self,datas, text1,text2,text3,text4): #筛选航站且显示全部
  163. res = {}
  164. try:
  165. num = 0
  166. for i in datas.keys():
  167. if str(datas[i]["8"]) != "" and datas[i]["109"] == text1:
  168. if str(datas[i]["8"])[0] == text2 and str(datas[i]["8"])[0] == text3:
  169. res[str(num)] = datas[i]
  170. num += 1
  171. elif str(datas[i]["8"]) == "" and str(datas[i]["109"]) == text4:
  172. res[str(num)] = datas[i]
  173. num += 1
  174. except Exception as e:
  175. app_logger.log_error(e)
  176. return res
  177. def checkStrTerminalAll4(self,datas, text1,text2,text3,text4): #筛选航站且显示全部
  178. res = {}
  179. try:
  180. num = 0
  181. for i in datas.keys():
  182. if str(datas[i]["8"]) != "" and datas[i]["109"] == text1:
  183. if str(datas[i]["8"])[0] != text2 and str(datas[i]["8"])[0] != text3:
  184. res[str(num)] = datas[i]
  185. num += 1
  186. elif str(datas[i]["8"]) == "" and str(datas[i]["109"]) == text4:
  187. res[str(num)] = datas[i]
  188. num += 1
  189. except Exception as e:
  190. app_logger.log_error(e)
  191. return res
  192. def sortTableWidgetDispaly(self):
  193. try:
  194. text = self.text
  195. Partdisplay = self.displayselect_mode # 不显示起飞航班
  196. # print(Partdisplay)
  197. tableWidgetDispalydataAll = {}
  198. if self.displayMode == "A" and (self.selectedbc == "0" or self.date=="4"):
  199. tableWidgetDispalydataAll = self.severpost_nomeassge("tableWidgetDispaly",selectedtime="%s" % self.selectedtime,date="%s"%self.date)['data']
  200. elif self.displayMode == "B"and (self.selectedbc == "0" or self.date=="4"):
  201. tableWidgetDispalydataAll = self.severpost_nomeassge("tableWidgetDispaly2",selectedtime="%s" % self.selectedtime,date="%s"%self.date)['data']
  202. elif self.displayMode == "A" and self.selectedbc == "1":
  203. tableWidgetDispalydataAll = self.severpost_nomeassge("tableWidgetDispalyRead",date="%s"%self.date)['data']
  204. elif self.displayMode == "B"and self.selectedbc == "1":
  205. tableWidgetDispalydataAll = self.severpost_nomeassge("tableWidgetDispalyRead2", date="%s"%self.date)['data']
  206. #print("tableWidgetDispalydataAll")
  207. self.DispalydataAll=tableWidgetDispalydataAll
  208. self.sorttableWidgetDispalydata = {}
  209. num = 0
  210. if tableWidgetDispalydataAll != None:
  211. if text != "" and text != "T1" and text != "T2" and text != "T6" and text != "T2T6" and text != "T1T6" and Partdisplay == "0":
  212. self.sorttableWidgetDispalydata=self.checkStrsingle(tableWidgetDispalydataAll, text, "")
  213. elif text == "T1" and Partdisplay == "0":
  214. self.sorttableWidgetDispalydata = self.checkStrTerminalAll(tableWidgetDispalydataAll, "", "1", "1", "1")
  215. elif text == "T2" and Partdisplay == "0":
  216. self.sorttableWidgetDispalydata = self.checkStrTerminalAll(tableWidgetDispalydataAll, "", "2", "2", "2")
  217. elif text == "T2T6" and Partdisplay == "0":
  218. self.sorttableWidgetDispalydata = self.checkStrTerminalAll2(tableWidgetDispalydataAll, "", "1", "1", "1")
  219. elif text == "T1T6" and Partdisplay == "0":
  220. self.sorttableWidgetDispalydata = self.checkStrTerminalAll2(tableWidgetDispalydataAll, "", "2", "2", "1")
  221. elif text == "T6" and Partdisplay == "0":
  222. self.sorttableWidgetDispalydata = self.checkStrTerminalAll2(tableWidgetDispalydataAll, "", "1", "2", "1")
  223. elif text != "" and text != "T1" and text != "T2" and text != "T6" and text != "T2T6" and text != "T1T6" and Partdisplay == "1":
  224. self.sorttableWidgetDispalydata = self.checkStrsingle(tableWidgetDispalydataAll, text, "4")
  225. elif text == "T1" and Partdisplay == "1":
  226. self.sorttableWidgetDispalydata = self.checkStrTerminalAll(tableWidgetDispalydataAll, "4", "1", "1", "1")
  227. elif text == "T2" and Partdisplay == "1":
  228. self.sorttableWidgetDispalydata = self.checkStrTerminalAll(tableWidgetDispalydataAll, "4", "2", "2", "1")
  229. elif text == "T2T6" and Partdisplay == "1":
  230. self.sorttableWidgetDispalydata = self.checkStrTerminalAll2(tableWidgetDispalydataAll, "4", "1", "1", "1")
  231. elif text == "T1T6" and Partdisplay == "1":
  232. self.sorttableWidgetDispalydata = self.checkStrTerminalAll2(tableWidgetDispalydataAll, "4", "2", "2", "1")
  233. elif text == "T6" and Partdisplay == "1":
  234. self.sorttableWidgetDispalydata = self.checkStrTerminalAll2(tableWidgetDispalydataAll, "4", "1", "2", "1")
  235. elif text == "" and Partdisplay == "1":
  236. self.sorttableWidgetDispalydata = self.checkall(tableWidgetDispalydataAll, "4")
  237. elif text != "" and text != "T1" and text != "T2" and text != "T6" and text != "T2T6" and text != "T1T6" and Partdisplay == "3":
  238. self.sorttableWidgetDispalydata = self.checkStrsingle(tableWidgetDispalydataAll, text, "1")
  239. elif text == "T1" and Partdisplay == "3":
  240. self.sorttableWidgetDispalydata = self.checkStrTerminalAll3(tableWidgetDispalydataAll, "1", "1", "1", "1")
  241. elif text == "T2" and Partdisplay == "3":
  242. self.sorttableWidgetDispalydata = self.checkStrTerminalAll3(tableWidgetDispalydataAll, "1", "2", "2", "1")
  243. elif text == "T2T6" and Partdisplay == "3":
  244. self.sorttableWidgetDispalydata = self.checkStrTerminalAll4(tableWidgetDispalydataAll, "1", "1", "1", "1")
  245. elif text == "T1T6" and Partdisplay == "3":
  246. self.sorttableWidgetDispalydata = self.checkStrTerminalAll4(tableWidgetDispalydataAll, "1", "2", "2", "1")
  247. elif text == "T6" and Partdisplay == "3":
  248. self.sorttableWidgetDispalydata = self.checkStrTerminalAll4(tableWidgetDispalydataAll, "1", "1", "2", "1")
  249. elif text == "" and Partdisplay == "3":
  250. for i in tableWidgetDispalydataAll.keys():
  251. if tableWidgetDispalydataAll[i]["109"] == '1':
  252. self.sorttableWidgetDispalydata[str(num)] = tableWidgetDispalydataAll[i]
  253. num += 1
  254. else:
  255. self.sorttableWidgetDispalydata = tableWidgetDispalydataAll
  256. except Exception as e:
  257. app_logger.log_error(e)
  258. def sortTableWidgetDispalyALL(self):
  259. try:
  260. if self.displayMode == "A" and (self.selectedbc == "0" or self.date=="4"):
  261. self.sorttableWidgetDispalydata = self.severpost_nomeassge("tableWidgetDispaly",selectedtime="%s" % self.selectedtime,date="%s"%self.date)['data']
  262. elif self.displayMode == "B"and (self.selectedbc == "0" or self.date=="4"):
  263. self.sorttableWidgetDispalydata = self.severpost_nomeassge("tableWidgetDispaly2",selectedtime="%s" % self.selectedtime,date="%s"%self.date)['data']
  264. elif self.displayMode == "A" and self.selectedbc == "1":
  265. self.sorttableWidgetDispalydata = self.severpost_nomeassge("tableWidgetDispalyRead",date="%s"%self.date)['data']
  266. elif self.displayMode == "B"and self.selectedbc == "1":
  267. self.sorttableWidgetDispalydata = self.severpost_nomeassge("tableWidgetDispalyRead2",date="%s"%self.date)['data']
  268. except Exception as e:
  269. app_logger.log_error(e)
  270. def SearchsortTableWidgetDispaly(self):
  271. try:
  272. text = self.text
  273. self.seversts = "1"
  274. Partdisplay = self.displayselect_mode # 不显示起飞航班
  275. # print(Partdisplay)
  276. tableWidgetDispalydataAll = self.selectedbc
  277. self.sorttableWidgetDispalydata = {}
  278. num = 0
  279. if tableWidgetDispalydataAll != None:
  280. if text != "" and text != "T1" and text != "T2" and text != "T6" and text != "T2T6" and text != "T1T6"and Partdisplay == "0":
  281. self.sorttableWidgetDispalydata = self.checkStrsingle(tableWidgetDispalydataAll, text, "")
  282. elif text == "T1" and Partdisplay == "0":
  283. self.sorttableWidgetDispalydata = self.checkStrTerminalAll(tableWidgetDispalydataAll, "", "1", "1", "1")
  284. elif text == "T2" and Partdisplay == "0":
  285. self.sorttableWidgetDispalydata = self.checkStrTerminalAll(tableWidgetDispalydataAll, "", "2", "2", "1")
  286. elif text == "T2T6" and Partdisplay == "0":
  287. self.sorttableWidgetDispalydata = self.checkStrTerminalAll2(tableWidgetDispalydataAll, "", "1", "1", "1")
  288. elif text == "T1T6" and Partdisplay == "0":
  289. self.sorttableWidgetDispalydata = self.checkStrTerminalAll2(tableWidgetDispalydataAll, "", "2", "2", "1")
  290. elif text == "T6" and Partdisplay == "0":
  291. self.sorttableWidgetDispalydata = self.checkStrTerminalAll2(tableWidgetDispalydataAll, "", "1", "2", "1")
  292. elif text != "" and text != "T1" and text != "T2" and text != "T6" and text != "T2T6" and text != "T1T6" and Partdisplay == "1":
  293. self.sorttableWidgetDispalydata = self.checkStrsingle(tableWidgetDispalydataAll, text, "4")
  294. elif text == "T1" and Partdisplay == "1":
  295. self.sorttableWidgetDispalydata = self.checkStrTerminalAll(tableWidgetDispalydataAll, "4", "1", "1", "1")
  296. elif text == "T2" and Partdisplay == "1":
  297. self.sorttableWidgetDispalydata = self.checkStrTerminalAll(tableWidgetDispalydataAll, "4", "2", "2", "1")
  298. elif text == "T2T6" and Partdisplay == "1":
  299. self.sorttableWidgetDispalydata = self.checkStrTerminalAll2(tableWidgetDispalydataAll, "4", "1", "1", "1")
  300. elif text == "T1T6" and Partdisplay == "1":
  301. self.sorttableWidgetDispalydata = self.checkStrTerminalAll2(tableWidgetDispalydataAll, "4", "2", "2", "1")
  302. elif text == "T6" and Partdisplay == "1":
  303. self.sorttableWidgetDispalydata = self.checkStrTerminalAll2(tableWidgetDispalydataAll, "4", "1", "2", "1")
  304. elif text == "" and Partdisplay == "1":
  305. self.sorttableWidgetDispalydata = self.checkall(tableWidgetDispalydataAll, "4")
  306. elif text != "" and text != "T1" and text != "T2" and text != "T6" and text != "T2T6" and text != "T1T6" and Partdisplay == "3":
  307. for i in tableWidgetDispalydataAll.keys():
  308. if str(text) in str(tableWidgetDispalydataAll[i]) and tableWidgetDispalydataAll[i]["109"] == '1':
  309. self.sorttableWidgetDispalydata[str(num)] = tableWidgetDispalydataAll[i]
  310. num += 1
  311. elif text == "T1" and Partdisplay == "3":
  312. self.sorttableWidgetDispalydata = self.checkStrTerminalAll3(tableWidgetDispalydataAll, "1", "1", "1", "1")
  313. elif text == "T2" and Partdisplay == "3":
  314. self.sorttableWidgetDispalydata = self.checkStrTerminalAll3(tableWidgetDispalydataAll, "1", "2", "2", "1")
  315. elif text == "T2T6" and Partdisplay == "3":
  316. self.sorttableWidgetDispalydata = self.checkStrTerminalAll4(tableWidgetDispalydataAll, "1", "1", "1", "1")
  317. elif text == "T1T6" and Partdisplay == "3":
  318. self.sorttableWidgetDispalydata = self.checkStrTerminalAll4(tableWidgetDispalydataAll, "1", "2", "2", "1")
  319. elif text == "T6" and Partdisplay == "3":
  320. self.sorttableWidgetDispalydata = self.checkStrTerminalAll4(tableWidgetDispalydataAll, "1", "1", "2", "1")
  321. elif text == "" and Partdisplay == "3":
  322. for i in tableWidgetDispalydataAll.keys():
  323. if tableWidgetDispalydataAll[i]["109"] == '1':
  324. self.sorttableWidgetDispalydata[str(num)] = tableWidgetDispalydataAll[i]
  325. num += 1
  326. else:
  327. self.sorttableWidgetDispalydata = tableWidgetDispalydataAll
  328. except Exception as e:
  329. app_logger.log_error(e)
  330. def sorttableWidgetDisplayChange(self):
  331. try:
  332. text = self.text
  333. logall = self.severpost_nomeassge("tableWidgetDisplayChange",
  334. selectedtime="%s" % self.selectedtime)['data']
  335. self.sortlogchange = {}
  336. num = 0
  337. if text != "":
  338. for i in logall.keys():
  339. if str(text) in str(logall[i]):
  340. self.sortlogchange[str(num)] = logall[i]
  341. num += 1
  342. else:
  343. self.sortlogchange = logall
  344. except Exception as e:
  345. app_logger.log_error(e)
  346. def sorttableWidgetPeopleDisplay(self):
  347. try:
  348. if self.displayselect_mode == "" or self.displayselect_mode == []:
  349. text = self.text
  350. self.peopleOnJob = [""]
  351. bc = self.selectedbc
  352. nowDaystr = self.selectedtime # 选择的日期
  353. diplaylistall = self.severpost_nomeassge("qtPeopleLoad",
  354. selectedtime="%s" % nowDaystr,
  355. bc="%s" % bc)['data']
  356. self.sortdiplaylist = {}
  357. num = 0
  358. if text != "":
  359. for i in diplaylistall.keys():
  360. if str(text) in str(diplaylistall[i]):
  361. self.sortdiplaylist[str(num)] = diplaylistall[i]
  362. num += 1
  363. else:
  364. self.sortdiplaylist = diplaylistall
  365. for i in self.sortdiplaylist.keys():
  366. self.peopleOnJob.append(self.sortdiplaylist[i]["姓名"])
  367. else:
  368. names = self.displayselect_mode
  369. text = self.text
  370. self.peopleOnJob = [""]
  371. bc = self.selectedbc
  372. nowDaystr = self.selectedtime # 选择的日期
  373. diplaylistall = self.severpost_nomeassge("qtPeopleLoad",
  374. selectedtime="%s" % nowDaystr,
  375. bc="%s" % bc)['data']
  376. self.sortdiplaylist = {}
  377. num = 0
  378. if text != "":
  379. for i in diplaylistall.keys():
  380. if str(text) in str(diplaylistall[i]):
  381. for name in names:
  382. if str(name) in str(diplaylistall[i]):
  383. self.sortdiplaylist[str(num)] = diplaylistall[i]
  384. num += 1
  385. else:
  386. for i in diplaylistall.keys():
  387. for name in names:
  388. if str(name) in str(diplaylistall[i]):
  389. self.sortdiplaylist[str(num)] = diplaylistall[i]
  390. num += 1
  391. for i in self.sortdiplaylist.keys():
  392. self.peopleOnJob.append(self.sortdiplaylist[i]["姓名"])
  393. except Exception as e:
  394. app_logger.log_error(e)
  395. def sorttableWidgetLOGDispaly(self):
  396. try:
  397. text = self.text
  398. logall = self.severpost_nomeassge("tableWidgetLOGDispaly",
  399. selectedtime="%s" % self.selectedtime)['data']
  400. self.sortlog = {}
  401. num = 0
  402. if text != "":
  403. for i in logall.keys():
  404. if str(text) in str(logall[i]):
  405. self.sortlog[str(num)] = logall[i]
  406. num += 1
  407. else:
  408. self.sortlog = logall
  409. except Exception as e:
  410. app_logger.log_error(e)