add operator to siminfo
This commit is contained in:
+4
-2
@@ -64,7 +64,8 @@ class ModemPool:
|
||||
contact.ccid.replace("F", "") == ccid.replace("F", "")]
|
||||
if len(contact) > 0:
|
||||
phone_number = contact[0].phone
|
||||
self._db_manager.save_sim_info(SimInfoPojo(phone=str(phone_number), ccid=ccid, position=position))
|
||||
self._db_manager.save_sim_info(
|
||||
SimInfoPojo(phone=str(phone_number), ccid=ccid, position=position, operator=operator.value))
|
||||
else:
|
||||
error_msg = "slot({}),sim({})".format(slot_position, sim_position)
|
||||
oracle_log_sender.send_contact_not_found(error_msg)
|
||||
@@ -89,7 +90,8 @@ class ModemPool:
|
||||
print("phone is " + phone_number)
|
||||
|
||||
if phone_number:
|
||||
self._db_manager.save_sim_info(SimInfoPojo(phone=phone_number, ccid=ccid, position=position))
|
||||
self._db_manager.save_sim_info(
|
||||
SimInfoPojo(phone=phone_number, ccid=ccid, position=position, operator=operator.value))
|
||||
self._log_sender.send_log(phone_number, source=self.TAG, subject=SUBJECT_SIM_INFO,
|
||||
type=LOG_APPOINTMENT_SUCCESS)
|
||||
# write the number to sim card's phonebook
|
||||
|
||||
+8
-3
@@ -1,4 +1,3 @@
|
||||
import datetime
|
||||
import time
|
||||
|
||||
|
||||
@@ -7,12 +6,14 @@ class SimInfoPojo:
|
||||
ccid: str
|
||||
update_at: int
|
||||
position: int
|
||||
operator: str
|
||||
|
||||
def __init__(self, phone: str, ccid: str, position, update_at: int = int(time.time())):
|
||||
def __init__(self, phone: str, ccid: str, position, operator: str, update_at: int = int(time.time())):
|
||||
self.phone = phone
|
||||
self.ccid = ccid
|
||||
self.update_at = update_at
|
||||
self.position = position
|
||||
self.operator = operator
|
||||
|
||||
@staticmethod
|
||||
def from_firestore_dict(source):
|
||||
@@ -24,7 +25,10 @@ class SimInfoPojo:
|
||||
position = None
|
||||
if 'position' in source:
|
||||
position = source['position']
|
||||
result = SimInfoPojo(phone=phone, ccid=ccid, update_at=update_at, position=position)
|
||||
result = SimInfoPojo(phone=phone, ccid=ccid, update_at=update_at, position=position, operator="")
|
||||
if 'operator' in source:
|
||||
operator = source['operator']
|
||||
result.operator = operator
|
||||
result.id = id
|
||||
return result
|
||||
|
||||
@@ -34,6 +38,7 @@ class SimInfoPojo:
|
||||
u'ccid': self.ccid,
|
||||
u'update_at': self.update_at,
|
||||
u'position': self.position,
|
||||
u'operator': self.operator,
|
||||
}
|
||||
|
||||
return dest
|
||||
|
||||
@@ -6,13 +6,12 @@ from modems.ModemPool import ModemPool
|
||||
from logs.AppLogging import init_logger
|
||||
from logs.LogSender import LOG_SUBJECT_EVENT, TYPE_EVENT_RESET_ALL_SIM_CARDS
|
||||
from main import card_pool, get_devices_ports
|
||||
from wait_for_sms import start_waiting_sms
|
||||
|
||||
|
||||
def read_all_the_phone_number():
|
||||
params.oracle_log_sender.send_log(msg="SIM卡自检开始", subject=LOG_SUBJECT_EVENT, type=TYPE_EVENT_RESET_ALL_SIM_CARDS)
|
||||
slot_number = 1
|
||||
slot_sum = 27
|
||||
slot_sum = 26
|
||||
params.firebase_store_manager.clear_all_sim_info()
|
||||
for i in range(slot_number, slot_sum + 1):
|
||||
card_pool.reset()
|
||||
|
||||
Reference in New Issue
Block a user