Skip to content

Commit

Permalink
v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
qianxiao996 committed Feb 26, 2023
1 parent 2f1ec74 commit 733379a
Show file tree
Hide file tree
Showing 10 changed files with 1,255 additions and 217 deletions.
Binary file modified Gui/__pycache__/main.cpython-37.pyc
Binary file not shown.
358 changes: 299 additions & 59 deletions Gui/main.py

Large diffs are not rendered by default.

733 changes: 583 additions & 150 deletions Gui/main.ui

Large diffs are not rendered by default.

Binary file added __pycache__/frozen_dir.cpython-37.pyc
Binary file not shown.
Binary file modified conf/DB.db
Binary file not shown.
277 changes: 269 additions & 8 deletions main.py

Large diffs are not rendered by default.

Binary file added module/__pycache__/phone.cpython-37.pyc
Binary file not shown.
Binary file added module/__pycache__/sfzh.cpython-37.pyc
Binary file not shown.
47 changes: 47 additions & 0 deletions module/phone.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
from PyQt5.QtCore import QThread, pyqtSignal
import frozen_dir
import random
SETUP_DIR = frozen_dir.app_path()


class Phone(QThread):
"""该线程用于计算耗时的累加操作"""
_data = pyqtSignal(str) # 信号类型 str

def __init__(self,all_haoduan,count,start_num,end_num,is_phone,parent=None):
super(Phone, self).__init__(parent)
self.all_haoduan = all_haoduan
self.start_num = start_num
self.end_num = end_num
self.is_phone =is_phone
self.count =count
def run(self):
while self.count:
a = random.choice(self.all_haoduan)
for i in range(self.start_num,self.end_num):
if self.count==0:
break
else:
self.count -= 1
aaa = a[0]+str(i).rjust(4,'0')
if self.is_phone:
text =aaa
else:
text =aaa+" "+a[1]+a[2]+" "+a[3]
self._data.emit(text)
self._data.emit("end")

def is_id_card(self,id):
sum = 0
for index, item in enumerate(id[:-1]):
sum += 2 ** (17 - index) % 11 * int(item)
num = (12 - sum % 11) % 11
if num < 10:
return id[:17]+str(num)
else:
return id[:17]+"X"

# return '校验通过' if id[-1] == str(num) else f'校验失败,正确尾号应为:{num}'
# else:
# return '校验通过' if id[-1] == 'X' else f'校验失败,正确尾号应为:{num}'

57 changes: 57 additions & 0 deletions module/sfzh.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
from PyQt5.QtCore import QThread, pyqtSignal
import frozen_dir
import random
SETUP_DIR = frozen_dir.app_path()


class SFZH(QThread):
"""该线程用于计算耗时的累加操作"""
_data = pyqtSignal(str) # 信号类型 str

def __init__(self,province_city_area_list,sexstring,year_list,month_day_list,is_sfzh,count,parent=None):
super(SFZH, self).__init__(parent)
self.province_city_area_list = province_city_area_list
self.sexstring = sexstring
self.year_list = year_list
self.month_day_list = month_day_list
self.is_sfzh =is_sfzh
self.count =count
def run(self):
paichusuo_daima = []
for i in range(100):
paichusuo_daima.append(str(i).rjust(2,'0'))
while self.count:
self.count -=1
a = random.choice(self.province_city_area_list)
b = random.choice(self.year_list)
c = random.choice(self.month_day_list)

d = random.choice(paichusuo_daima)
e = random.choice(list(self.sexstring))
if int(e)%2==0:
sex_c = "女"
else:
sex_c="男"
sfzh = str(a[0])+str(b)+str(c)+str(d)+str(e)+'1'
sfzh = self.is_id_card(sfzh)
if self.is_sfzh:
text =sfzh
else:
text =sfzh+" "+a[1]+" "+b+"年"+c[:2]+"月"+c[2:]+"日 性别:"+sex_c
self._data.emit(text)
self._data.emit("end")

def is_id_card(self,id):
sum = 0
for index, item in enumerate(id[:-1]):
sum += 2 ** (17 - index) % 11 * int(item)
num = (12 - sum % 11) % 11
if num < 10:
return id[:17]+str(num)
else:
return id[:17]+"X"

# return '校验通过' if id[-1] == str(num) else f'校验失败,正确尾号应为:{num}'
# else:
# return '校验通过' if id[-1] == 'X' else f'校验失败,正确尾号应为:{num}'

0 comments on commit 733379a

Please sign in to comment.