Subversion Repositories SmartDukaan

Rev

Rev 37602 | Rev 37617 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37602 Rev 37613
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.scheduled.*;
5
import com.smartdukaan.cron.scheduled.*;
5
import com.smartdukaan.cron.scheduled.b2b.Listing;
6
import com.smartdukaan.cron.scheduled.b2b.Listing;
6
import com.smartdukaan.cron.scheduled.beatmiss.BeatMissDetectorRunner;
7
import com.smartdukaan.cron.scheduled.beatmiss.BeatMissDetectorRunner;
7
import com.smartdukaan.cron.scheduled.leadsync.LeadSyncRunner;
8
import com.smartdukaan.cron.scheduled.leadsync.LeadSyncRunner;
8
import com.smartdukaan.cron.scheduled.ordertracking.OrderTrackingService;
9
import com.smartdukaan.cron.scheduled.ordertracking.OrderTrackingService;
Line 248... Line 249...
248
 
249
 
249
    @Autowired
250
    @Autowired
250
    private RunOnceTasks runOnceTasks;
251
    private RunOnceTasks runOnceTasks;
251
 
252
 
252
    @Autowired
253
    @Autowired
-
 
254
    private InternalGrnTask internalGrnTask;
-
 
255
 
-
 
256
    @Autowired
253
    private ScheduledTasks scheduledTasks;
257
    private ScheduledTasks scheduledTasks;
254
 
258
 
255
    @Autowired
259
    @Autowired
256
    private ScheduledTasksTest scheduledTasksTest;
260
    private ScheduledTasksTest scheduledTasksTest;
257
 
261
 
Line 388... Line 392...
388
            LOGGER.info("Starting migration for warehouse.inventoryItem.originalInventoryItemId with batchSize={}", batchSize);
392
            LOGGER.info("Starting migration for warehouse.inventoryItem.originalInventoryItemId with batchSize={}", batchSize);
389
            migrations.migrateWarehouseOriginalInventoryItemId(batchSize);
393
            migrations.migrateWarehouseOriginalInventoryItemId(batchSize);
390
            LOGGER.info("Migration completed.");
394
            LOGGER.info("Migration completed.");
391
            System.exit(0);
395
            System.exit(0);
392
        }
396
        }
-
 
397
        if (args.containsOption("autoGrnInternal")) {
-
 
398
            if (!args.containsOption("invoices") || !args.containsOption("email")) {
-
 
399
                LOGGER.error("autoGrnInternal needs --invoices=A,B and --email=<operator>");
-
 
400
                System.exit(1);
-
 
401
            }
-
 
402
            List<String> invoiceNumbers = new ArrayList<>();
-
 
403
            for (String value : args.getOptionValues("invoices")) {
-
 
404
                for (String invoiceNumber : value.split(",")) {
-
 
405
                    if (!invoiceNumber.trim().isEmpty()) {
-
 
406
                        invoiceNumbers.add(invoiceNumber.trim());
-
 
407
                    }
-
 
408
                }
-
 
409
            }
-
 
410
            String operatorEmail = args.getOptionValues("email").get(0);
-
 
411
            boolean dryRun = args.containsOption("dryRun");
-
 
412
            internalGrnTask.grnInternalInvoices(invoiceNumbers, operatorEmail, dryRun);
-
 
413
            System.exit(0);
-
 
414
        }
393
        if (args.containsOption("processSchemeOut")) {
415
        if (args.containsOption("processSchemeOut")) {
394
            System.out.println("Process schemeOut");
416
            System.out.println("Process schemeOut");
395
            int orderId = Integer.parseInt(args.getOptionValues("orderid").get(0));
417
            int orderId = Integer.parseInt(args.getOptionValues("orderid").get(0));
396
            int fofoId = Integer.parseInt(args.getOptionValues("fofoid").get(0));
418
            int fofoId = Integer.parseInt(args.getOptionValues("fofoid").get(0));
397
            runOnceTasks.processSchemeOut(fofoId, orderId);
419
            runOnceTasks.processSchemeOut(fofoId, orderId);