| Line 1... |
Line 1... |
| 1 |
package com.smartdukaan.cron;
|
1 |
package com.smartdukaan.cron;
|
| 2 |
|
2 |
|
| 3 |
import com.smartdukaan.cron.migrations.RunOnceTasks;
|
3 |
import com.smartdukaan.cron.migrations.RunOnceTasks;
|
| 4 |
import com.smartdukaan.cron.migrations.InternalGrnTask;
|
4 |
import com.smartdukaan.cron.migrations.InternalGrnTask;
|
| 5 |
import com.smartdukaan.cron.migrations.MovementBillingTask;
|
5 |
import com.smartdukaan.cron.migrations.MovementBillingTask;
|
| - |
|
6 |
import com.smartdukaan.cron.migrations.MovementPoTask;
|
| 6 |
import com.smartdukaan.cron.scheduled.*;
|
7 |
import com.smartdukaan.cron.scheduled.*;
|
| 7 |
import com.smartdukaan.cron.scheduled.b2b.Listing;
|
8 |
import com.smartdukaan.cron.scheduled.b2b.Listing;
|
| 8 |
import com.smartdukaan.cron.scheduled.beatmiss.BeatMissDetectorRunner;
|
9 |
import com.smartdukaan.cron.scheduled.beatmiss.BeatMissDetectorRunner;
|
| 9 |
import com.smartdukaan.cron.scheduled.leadsync.LeadSyncRunner;
|
10 |
import com.smartdukaan.cron.scheduled.leadsync.LeadSyncRunner;
|
| 10 |
import com.smartdukaan.cron.scheduled.ordertracking.OrderTrackingService;
|
11 |
import com.smartdukaan.cron.scheduled.ordertracking.OrderTrackingService;
|
| Line 261... |
Line 262... |
| 261 |
|
262 |
|
| 262 |
@Autowired
|
263 |
@Autowired
|
| 263 |
private MovementBillingTask movementBillingTask;
|
264 |
private MovementBillingTask movementBillingTask;
|
| 264 |
|
265 |
|
| 265 |
@Autowired
|
266 |
@Autowired
|
| - |
|
267 |
private MovementPoTask movementPoTask;
|
| - |
|
268 |
|
| - |
|
269 |
@Autowired
|
| 266 |
private ScheduledTasks scheduledTasks;
|
270 |
private ScheduledTasks scheduledTasks;
|
| 267 |
|
271 |
|
| 268 |
@Autowired
|
272 |
@Autowired
|
| 269 |
private ScheduledTasksTest scheduledTasksTest;
|
273 |
private ScheduledTasksTest scheduledTasksTest;
|
| 270 |
|
274 |
|
| Line 429... |
Line 433... |
| 429 |
}
|
433 |
}
|
| 430 |
movementBillingTask.billMovements(poNumbers, args.getOptionValues("email").get(0),
|
434 |
movementBillingTask.billMovements(poNumbers, args.getOptionValues("email").get(0),
|
| 431 |
Integer.parseInt(args.getOptionValues("provider").get(0)), args.containsOption("live"));
|
435 |
Integer.parseInt(args.getOptionValues("provider").get(0)), args.containsOption("live"));
|
| 432 |
System.exit(0);
|
436 |
System.exit(0);
|
| 433 |
}
|
437 |
}
|
| - |
|
438 |
if (args.containsOption("autoCreateMovementPO")) {
|
| - |
|
439 |
if (!args.containsOption("file") || !args.containsOption("warehouse") || !args.containsOption("supplier")
|
| - |
|
440 |
|| !args.containsOption("email")) {
|
| - |
|
441 |
LOGGER.error("autoCreateMovementPO needs --file=<xlsx>, --warehouse=<destination>, --supplier=<internal"
|
| - |
|
442 |
+ " supplier> and --email=<operator>; add --live to raise (default is a dry run), --bill"
|
| - |
|
443 |
+ " --provider=<logistics provider id> to dry-run billing of the raised POs");
|
| - |
|
444 |
System.exit(1);
|
| - |
|
445 |
}
|
| - |
|
446 |
boolean bill = args.containsOption("bill");
|
| - |
|
447 |
if (bill && !args.containsOption("provider")) {
|
| - |
|
448 |
LOGGER.error("autoCreateMovementPO --bill needs --provider=<logistics provider id>");
|
| - |
|
449 |
System.exit(1);
|
| - |
|
450 |
}
|
| - |
|
451 |
try {
|
| - |
|
452 |
movementPoTask.createMovementPo(args.getOptionValues("file").get(0),
|
| - |
|
453 |
Integer.parseInt(args.getOptionValues("warehouse").get(0)),
|
| - |
|
454 |
Integer.parseInt(args.getOptionValues("supplier").get(0)), args.getOptionValues("email").get(0),
|
| - |
|
455 |
args.containsOption("live"), bill,
|
| - |
|
456 |
bill ? Integer.parseInt(args.getOptionValues("provider").get(0)) : 0);
|
| - |
|
457 |
} catch (Exception e) {
|
| - |
|
458 |
LOGGER.error("autoCreateMovementPO FAILED - nothing raised: {}", e.getMessage(), e);
|
| - |
|
459 |
System.exit(1);
|
| - |
|
460 |
}
|
| - |
|
461 |
System.exit(0);
|
| - |
|
462 |
}
|
| 434 |
if (args.containsOption("autoGrnInternal")) {
|
463 |
if (args.containsOption("autoGrnInternal")) {
|
| 435 |
if (!args.containsOption("invoices") || !args.containsOption("email")) {
|
464 |
if (!args.containsOption("invoices") || !args.containsOption("email")) {
|
| 436 |
LOGGER.error("autoGrnInternal needs --invoices=A,B and --email=<operator>");
|
465 |
LOGGER.error("autoGrnInternal needs --invoices=A,B and --email=<operator>");
|
| 437 |
System.exit(1);
|
466 |
System.exit(1);
|
| 438 |
}
|
467 |
}
|