optimize check_results.py and add export contact
This commit is contained in:
+1
-1
@@ -116,7 +116,7 @@ if __name__ == '__main__':
|
|||||||
reserve_pojo = ReserveResultPojo.from_firestore_dict(appointment.to_dict())
|
reserve_pojo = ReserveResultPojo.from_firestore_dict(appointment.to_dict())
|
||||||
result_list.append(reserve_pojo)
|
result_list.append(reserve_pojo)
|
||||||
|
|
||||||
with ThreadPoolExecutor(max_workers=20) as executor:
|
with ThreadPoolExecutor(max_workers=10) as executor:
|
||||||
for reserve in result_list:
|
for reserve in result_list:
|
||||||
count = count + 1
|
count = count + 1
|
||||||
if reserve.accepted is None or ResultEnum.PENDING.value == reserve.accepted:
|
if reserve.accepted is None or ResultEnum.PENDING.value == reserve.accepted:
|
||||||
|
|||||||
@@ -85,9 +85,10 @@ def get_random_phone_numbers():
|
|||||||
|
|
||||||
|
|
||||||
def generate_email_from_name(first_name: str, last_name: str) -> str:
|
def generate_email_from_name(first_name: str, last_name: str) -> str:
|
||||||
length = 3 # number of characters in the string.
|
length = 4 # number of characters in the string.
|
||||||
ran = ''.join(random.choices(string.digits, k=length))
|
ran = ''.join(random.choices(string.digits, k=length))
|
||||||
email = "{}{}{}@163.com".format(last_name.lower(), first_name.lower(), ran)
|
separator = ['.', '_', '']
|
||||||
|
email = "{}{}{}{}@163.com".format(last_name.lower(), random.choice(separator), first_name.lower(), ran)
|
||||||
print(email)
|
print(email)
|
||||||
return email
|
return email
|
||||||
|
|
||||||
@@ -128,6 +129,6 @@ def write_new_contacts_to_excel(valid_contacts: list):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
excel_reader = ExcelHelper()
|
excel_reader = ExcelHelper()
|
||||||
contacts = excel_reader.read_names("new_profile_500.xlsx")
|
contacts = excel_reader.read_names("C:/Users/landd/Desktop/1000.xlsx")
|
||||||
print(contacts)
|
print(contacts)
|
||||||
# write_new_contacts_to_excel(valid_contacts=contacts)
|
write_new_contacts_to_excel(valid_contacts=contacts)
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ def get_random_id_number() -> str:
|
|||||||
|
|
||||||
|
|
||||||
def write_the_valid_profiles_to_excel():
|
def write_the_valid_profiles_to_excel():
|
||||||
day_list = ['2022-05-28']
|
day_list = ['2022-05-30']
|
||||||
|
|
||||||
collection = []
|
collection = []
|
||||||
for day in day_list:
|
for day in day_list:
|
||||||
|
|||||||
Reference in New Issue
Block a user