update contact list
This commit is contained in:
+20
-2
@@ -1,7 +1,9 @@
|
||||
import datetime
|
||||
import firebase_admin
|
||||
import xlsxwriter as xlsxwriter
|
||||
from firebase_admin import credentials, firestore
|
||||
|
||||
import params
|
||||
from pojo.ReserveResultPojo import ReserveResultPojo, PublishType
|
||||
from pojo.SimInfoPojo import SimInfoPojo
|
||||
from pojo.contact_pojo import ContactPojo
|
||||
@@ -20,6 +22,10 @@ class DataManager:
|
||||
def get_all_error_items(self):
|
||||
pass
|
||||
|
||||
def get_all_sim_infos(self):
|
||||
sim_info_collection = self._db.collection(SIM_INFOS)
|
||||
return sim_info_collection
|
||||
|
||||
def get_all_successful_items(self):
|
||||
doc_ref = self._db.collection(str(datetime.date.today()))
|
||||
return doc_ref
|
||||
@@ -46,5 +52,17 @@ class DataManager:
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
manager = DataManager()
|
||||
manager.save()
|
||||
# Create a workbook and add a worksheet.
|
||||
workbook = xlsxwriter.Workbook('sim_infos.xlsx')
|
||||
worksheet = workbook.add_worksheet()
|
||||
# Start from the first cell. Rows and columns are zero indexed.
|
||||
row = 0
|
||||
col = 0
|
||||
for sim in params.firebase_store_manager.get_all_sim_infos().stream():
|
||||
print(sim)
|
||||
sim_pojo = SimInfoPojo.from_firestore_dict(sim.to_dict())
|
||||
# Iterate over the data and write it out row by row.
|
||||
worksheet.write(row, col, sim_pojo.phone[2:len(sim_pojo.phone)])
|
||||
worksheet.write(row, col + 1, sim_pojo.ccid)
|
||||
row += 1
|
||||
workbook.close()
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user