随机延时移至开票初始化之后
This commit is contained in:
+22
-13
@@ -204,7 +204,11 @@ async function processTrainBill(bill, billIndex, totalBills) {
|
||||
console.log(' --- 火车票 [' + billIndex + '/' + totalBills + '] ' + bill.statementName + ' ---');
|
||||
|
||||
const initResp = await initReceiveOrderPrice(settlementSeq, receiveBillId);
|
||||
console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp));
|
||||
console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp));
|
||||
|
||||
const waitSeconds = randomDelaySeconds();
|
||||
console.log(' [延时] 随机等待 ' + waitSeconds + 's 后继续开票...');
|
||||
await sleep(waitSeconds * 1000);
|
||||
|
||||
const confirmResp = await confirmInvoiceOrder(settlementSeq, receiveBillId);
|
||||
console.log(' -> confirmInvoiceOrder:', JSON.stringify(confirmResp));
|
||||
@@ -238,7 +242,11 @@ async function processHotelBill(bill, billIndex, totalBills) {
|
||||
}
|
||||
|
||||
const initResp = await initReceiveOrderPrice(settlementSeq, receiveBillId);
|
||||
console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp));
|
||||
console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp));
|
||||
|
||||
const waitSeconds = randomDelaySeconds();
|
||||
console.log(' [延时] 随机等待 ' + waitSeconds + 's 后继续开票...');
|
||||
await sleep(waitSeconds * 1000);
|
||||
|
||||
const confirmResp = await confirmInvoiceOrder(settlementSeq, receiveBillId);
|
||||
console.log(' -> confirmInvoiceOrder:', JSON.stringify(confirmResp));
|
||||
@@ -279,7 +287,11 @@ async function processFlightBill(bill, billIndex, totalBills) {
|
||||
}
|
||||
|
||||
const initResp = await initReceiveOrderPrice(settlementSeq, receiveBillId);
|
||||
console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp));
|
||||
console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp));
|
||||
|
||||
const waitSeconds = randomDelaySeconds();
|
||||
console.log(' [延时] 随机等待 ' + waitSeconds + 's 后继续开票...');
|
||||
await sleep(waitSeconds * 1000);
|
||||
|
||||
const confirmResp = await confirmInvoiceOrder(settlementSeq, receiveBillId);
|
||||
console.log(' -> confirmInvoiceOrder:', JSON.stringify(confirmResp));
|
||||
@@ -306,7 +318,11 @@ async function processInternationalFlightBill(bill, billIndex, totalBills) {
|
||||
console.log(' --- 国际机票 [' + billIndex + '/' + totalBills + '] ' + bill.statementName + ' ---');
|
||||
|
||||
const initResp = await initReceiveOrderPrice(settlementSeq, receiveBillId);
|
||||
console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp));
|
||||
console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp));
|
||||
|
||||
const waitSeconds = randomDelaySeconds();
|
||||
console.log(' [延时] 随机等待 ' + waitSeconds + 's 后继续开票...');
|
||||
await sleep(waitSeconds * 1000);
|
||||
|
||||
const confirmResp = await confirmInvoiceOrder(settlementSeq, receiveBillId);
|
||||
console.log(' -> confirmInvoiceOrder:', JSON.stringify(confirmResp));
|
||||
@@ -342,15 +358,8 @@ async function main() {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let i = 0; i < teamIds.length; i++) {
|
||||
const teamId = teamIds[i];
|
||||
|
||||
if (i > 0) {
|
||||
const waitSeconds = randomDelaySeconds();
|
||||
console.log(' [延时] 随机等待 ' + waitSeconds + 's 后处理下一个 TEAM...\n');
|
||||
await sleep(waitSeconds * 1000);
|
||||
}
|
||||
|
||||
for (let i = 0; i < teamIds.length; i++) {
|
||||
const teamId = teamIds[i];
|
||||
console.log('[' + (i + 1) + '/' + teamIds.length + '] 处理 ' + teamId + ' ...');
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user