-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f1ec74
commit 733379a
Showing
10 changed files
with
1,255 additions
and
217 deletions.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}' | ||
|