Merge branch 'feature/automatic' of bitbucket.org:panleicim/appointment_tool into feature/automatic

This commit is contained in:
2022-06-08 10:08:26 +02:00
2 changed files with 5 additions and 4 deletions
+4 -3
View File
@@ -7,8 +7,9 @@ import xlsxwriter
from definitions import CONTACT_LIST_FILE
from pojo.contact_pojo import ContactPojo
from utils.generate_random_passport_id import get_random_passport_id_number
phone_number_prefix = ['6', '7']
phone_number_prefix = ['6']
class ExcelHelper:
@@ -116,7 +117,7 @@ def write_new_contacts_to_excel(valid_contacts: list):
row = row + 1
for info in valid_contacts:
info.phone = get_random_phone_numbers()
info.passport = get_random_id_number()
info.passport = get_random_passport_id_number()
info.mail = generate_email_from_name(info.first_name, info.last_name)
# Iterate over the data and write it out row by row.
worksheet.write(row, col, "{} {}".format(info.last_name, info.first_name))
@@ -129,6 +130,6 @@ def write_new_contacts_to_excel(valid_contacts: list):
if __name__ == '__main__':
excel_reader = ExcelHelper()
contacts = excel_reader.read_names("C:/Users/landd/Desktop/1000.xlsx")
contacts = excel_reader.read_names("C:/Users/landd/Desktop/rdv/08-06/500_08_06.xlsx")
print(contacts)
write_new_contacts_to_excel(valid_contacts=contacts)
+1 -1
View File
@@ -11,7 +11,7 @@ def get_random_id_number() -> str:
id_number = str(ran)
return id_number
# 产生中国护照号
def get_random_passport_id_number() -> str:
S = 7 # number of characters in the string.
ran = ''.join(random.choices(string.digits, k=S))