|
|
@@ -11,15 +11,15 @@ const SEVEN_DAYS_IN_S = 3600 * 24 * 7;
|
|
|
|
const NINETY_DAYS_IN_S = 30 * 3;
|
|
|
|
const NINETY_DAYS_IN_S = 30 * 3;
|
|
|
|
let excelUtil = new ExcelUtil();
|
|
|
|
let excelUtil = new ExcelUtil();
|
|
|
|
let collectionName = formatDate(new Date())
|
|
|
|
let collectionName = formatDate(new Date())
|
|
|
|
// let includeMode = DeviceExcludeMode.ZERO
|
|
|
|
let includeMode = DeviceExcludeMode.ZERO
|
|
|
|
let includeMode = DeviceExcludeMode.APPOINTMENT
|
|
|
|
// let includeMode = DeviceExcludeMode.APPOINTMENT
|
|
|
|
|
|
|
|
|
|
|
|
let three_to_include = []
|
|
|
|
let three_to_include = []
|
|
|
|
let four_to_include = ["bec11752", "4e8ca027", "hi7ljr5xduyt9pfi", "EPHUT20825001518"]
|
|
|
|
let four_to_include = ["bec11752", "4e8ca027", "hi7ljr5xduyt9pfi", "EPHUT20825001518"]
|
|
|
|
let seven_to_excludes = ["4e8ca027", "hi7ljr5xduyt9pfi", "EPHUT20825001518", "bec11752", "fuljaueqguugf6pn", "EPHUT20825001518"]
|
|
|
|
let seven_to_excludes = ["4e8ca027", "hi7ljr5xduyt9pfi", "EPHUT20825001518", "bec11752", "fuljaueqguugf6pn", "EPHUT20825001518"]
|
|
|
|
let appointment_to_include = ["bec11752", "07fbd156", "71a0371d", "J4AXB761H2322WJ", "W8GMFELRHIKZS84T", "ZY32GLBN5P", "ZY32GVW4NC", "becb6e99", "b41c1b72"]
|
|
|
|
// let appointment_to_include = ["ai9xv8hy599hvkee", "07fbd156", "71a0371d", "J4AXB761H2322WJ", "W8GMFELRHIKZS84T", "fy65eqs4wkvcpf9h", "p7d6nbw8cu7duous", "fuljaueqguugf6pn", "fmiz5pa6rsx4u4ts"]
|
|
|
|
|
|
|
|
let appointment_to_include = ["ai9xv8hy599hvkee", "07fbd156", "71a0371d", "J4AXB761H2322WJ", "W8GMFELRHIKZS84T", "fy65eqs4wkvcpf9h", "p7d6nbw8cu7duous", "fmiz5pa6rsx4u4ts"]
|
|
|
|
let nine_to_include = ["bec11752", "4e8ca027", "hi7ljr5xduyt9pfi", "47e7e36b", "p7d6nbw8cu7duous", "njzxojhim7gedyvw", "fmiz5pa6rsx4u4ts", "fuljaueqguugf6pn", "EPHUT20825001518"]
|
|
|
|
let nine_to_include = ["bec11752", "4e8ca027", "hi7ljr5xduyt9pfi", "47e7e36b", "p7d6nbw8cu7duous", "njzxojhim7gedyvw", "fmiz5pa6rsx4u4ts", "fuljaueqguugf6pn", "EPHUT20825001518"]
|
|
|
|
let for_scrpay = ["07fbd156", "47e7e36b", "4f55c3d4", "5ac879a2", "69db59f0", "71a0371d", "774687ff", "7b71fb20", "8f76f9e7", "99cyfiaebqcy6poj", "EPHUT20825001518", "J4AXB761H2322WJ", "W8GMFELRHIKZS84T", "ai9xv8hy599hvkee", "b41c1b72", "bec11752", "becb6e99", "c3ba032e", "d54e946", "fmiz5pa6rsx4u4ts", "fuljaueqguugf6pn", "fy65eqs4wkvcpf9h", "hi7ljr5xduyt9pfi", "njzxojhim7gedyvw", "p7d6nbw8cu7duous"]
|
|
|
|
|
|
|
|
attributedPorts = []
|
|
|
|
attributedPorts = []
|
|
|
|
const device_port_info = new Map();
|
|
|
|
const device_port_info = new Map();
|
|
|
|
startPort = 9000
|
|
|
|
startPort = 9000
|
|
|
@@ -129,8 +129,6 @@ function getContactListForDevice(device, allContactList) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function startBookWithNumbers(startNumber, endNumber, selectedStore, pathToExcelFile = '/Users/lpan/Desktop/contact_all.xlsx', audioAnalyse = true, alertBeep = false) {
|
|
|
|
async function startBookWithNumbers(startNumber, endNumber, selectedStore, pathToExcelFile = '/Users/lpan/Desktop/contact_all.xlsx', audioAnalyse = true, alertBeep = false) {
|
|
|
|
console.log("startBookWithNumbers() called, with alertBeep:" + alertBeep)
|
|
|
|
|
|
|
|
console.log("startBookWithNumbers() called, with audioAnalyse:" + audioAnalyse)
|
|
|
|
|
|
|
|
let allContactList = excelUtil.readContacts(pathToExcelFile);
|
|
|
|
let allContactList = excelUtil.readContacts(pathToExcelFile);
|
|
|
|
let contactList;
|
|
|
|
let contactList;
|
|
|
|
if (endNumber <= allContactList.length) {
|
|
|
|
if (endNumber <= allContactList.length) {
|
|
|
@@ -194,7 +192,12 @@ async function startBookWithNumbers(startNumber, endNumber, selectedStore, pathT
|
|
|
|
} else if (includeMode === DeviceExcludeMode.ZERO) {
|
|
|
|
} else if (includeMode === DeviceExcludeMode.ZERO) {
|
|
|
|
device_to_excludes = []
|
|
|
|
device_to_excludes = []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
let filteredDeviceList;
|
|
|
|
|
|
|
|
if (includeMode === DeviceExcludeMode.ZERO) {
|
|
|
|
|
|
|
|
filteredDeviceList = devices
|
|
|
|
|
|
|
|
} else {
|
|
|
|
filteredDeviceList = devices.filter(device => device_to_excludes.includes(device.serial))
|
|
|
|
filteredDeviceList = devices.filter(device => device_to_excludes.includes(device.serial))
|
|
|
|
|
|
|
|
}
|
|
|
|
let segmentNumber = listWithoutBlackContact.length / filteredDeviceList.length;
|
|
|
|
let segmentNumber = listWithoutBlackContact.length / filteredDeviceList.length;
|
|
|
|
console.log("connected device number:" + filteredDeviceList.length)
|
|
|
|
console.log("connected device number:" + filteredDeviceList.length)
|
|
|
|
console.log("segmentNumber:" + segmentNumber)
|
|
|
|
console.log("segmentNumber:" + segmentNumber)
|
|
|
|