Subversion Repositories SmartDukaan

Rev

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

Rev 27279 Rev 27392
Line 39... Line 39...
39
@ComponentScan("com.smartdukaan.cron.*, com.spice.profitmandi.common.*")
39
@ComponentScan("com.smartdukaan.cron.*, com.spice.profitmandi.common.*")
40
public class Application implements ApplicationRunner {
40
public class Application implements ApplicationRunner {
41
 
41
 
42
	private static final Logger LOGGER = LogManager.getLogger(Application.class);
42
	private static final Logger LOGGER = LogManager.getLogger(Application.class);
43
 
43
 
44
 
-
 
45
	@Autowired
44
	@Autowired
46
	LeadSyncRunner leadSyncRunner;
45
	LeadSyncRunner leadSyncRunner;
47
	
46
 
48
	@Autowired
47
	@Autowired
49
	private ScheduledSkeleton scheduledSkeleton;
48
	private ScheduledSkeleton scheduledSkeleton;
50
	
-
 
51
	
49
 
52
	@Autowired
50
	@Autowired
53
	private TicketRelatedScheduledTask ticketRelatedScheduledTask;
51
	private TicketRelatedScheduledTask ticketRelatedScheduledTask;
54
	
52
 
55
	@Autowired
53
	@Autowired
56
	private CsService csService;
54
	private CsService csService;
57
 
55
 
58
	public static void main(String[] args) throws Throwable {
56
	public static void main(String[] args) throws Throwable {
59
		new SpringApplicationBuilder(Application.class).web(WebApplicationType.NONE).run(args);
57
		new SpringApplicationBuilder(Application.class).web(WebApplicationType.NONE).run(args);
Line 126... Line 124...
126
	private InsurancePolicyRepository insurancePolicyRepository;
124
	private InsurancePolicyRepository insurancePolicyRepository;
127
 
125
 
128
	@Override
126
	@Override
129
	public void run(ApplicationArguments args) throws Exception {
127
	public void run(ApplicationArguments args) throws Exception {
130
		LOGGER.info("Called run method");
128
		LOGGER.info("Called run method");
131
 
-
 
132
		if (args.containsOption("tc")) {
129
		if (args.containsOption("tc")) {
133
			System.out.println("Toffee service called");
130
			System.out.println("Toffee service called");
134
			scheduledTasks.testToffee();
131
			scheduledTasks.testToffee();
135
			System.exit(0);
132
			System.exit(0);
136
		}
133
		}
Line 143... Line 140...
143
			System.out.println("Toffee service called");
140
			System.out.println("Toffee service called");
144
			ticketRelatedScheduledTask.alertforTicket();
141
			ticketRelatedScheduledTask.alertforTicket();
145
			System.exit(0);
142
			System.exit(0);
146
		}
143
		}
147
		if (args.containsOption("et")) {
144
		if (args.containsOption("et")) {
148
			ticketRelatedScheduledTask.escalateTicket();;
145
			ticketRelatedScheduledTask.escalateTicket();
-
 
146
			;
149
			System.exit(0);
147
			System.exit(0);
150
		}
148
		}
151
		if (args.containsOption("sr")) {
149
		if (args.containsOption("sr")) {
152
			List<String> schemeIds = args.getOptionValues("schemeId");
150
			List<String> schemeIds = args.getOptionValues("schemeId");
153
			System.out.println(schemeIds);
151
			System.out.println(schemeIds);
Line 316... Line 314...
316
			if (args.containsOption("processPd")) {
314
			if (args.containsOption("processPd")) {
317
				int priceDropId = Integer.parseInt(args.getOptionValues("processPd").get(0));
315
				int priceDropId = Integer.parseInt(args.getOptionValues("processPd").get(0));
318
				runOnceTasks.processPd(priceDropId);
316
				runOnceTasks.processPd(priceDropId);
319
			}
317
			}
320
			if (args.containsOption("samsung")) {
318
			if (args.containsOption("samsung")) {
321
				if(args.containsOption("ym")) {
319
				if (args.containsOption("ym")) {
322
					int ym = Integer.parseInt(args.getOptionValues("ym").get(0));
320
					int ym = Integer.parseInt(args.getOptionValues("ym").get(0));
323
					runOnceTasks.fetchImeiActivation(ym);
321
					runOnceTasks.fetchImeiActivation(ym);
324
				}
322
				}
325
				runOnceTasks.fetchImeiActivation(0);
323
				runOnceTasks.fetchImeiActivation(0);
326
			}
324
			}
327
			if (args.containsOption("fixdupimeigrn")) {
325
			if (args.containsOption("fixdupimeigrn")) {
328
				runOnceTasks.fixDupGrns();
326
				runOnceTasks.fixDupGrns();
329
			}
327
			}
330
			if(args.containsOption("cancel")) {
328
			if (args.containsOption("cancel")) {
331
				runOnceTasks.cancelDn(args.getOptionValues("dn").get(0));
329
				runOnceTasks.cancelDn(args.getOptionValues("dn").get(0));
332
			}
330
			}
333
			if(args.containsOption("fixScheme")) {
331
			if (args.containsOption("fixScheme")) {
334
				runOnceTasks.fixScheme();
332
				runOnceTasks.fixScheme();
335
			}
333
			}
336
			if(args.containsOption("syncLeads")) {
334
			if (args.containsOption("syncLeads")) {
337
				leadSyncRunner.syncLeads();
335
				leadSyncRunner.syncLeads();
338
			}
336
			}
339
			if(args.containsOption("testCs")) {
337
			if (args.containsOption("testCs")) {
340
				int category = Integer.parseInt(args.getOptionValues("category").get(0));
338
				int category = Integer.parseInt(args.getOptionValues("category").get(0));
341
				EscalationType escalationType = EscalationType.valueOf(args.getOptionValues("escalation").get(0));
339
				EscalationType escalationType = EscalationType.valueOf(args.getOptionValues("escalation").get(0));
342
				int fofoId = Integer.parseInt(args.getOptionValues("fofoid").get(0));
340
				int fofoId = Integer.parseInt(args.getOptionValues("fofoid").get(0));
343
				csService.getAuthUserId(category, escalationType, fofoId);
341
				csService.getAuthUserId(category, escalationType, fofoId);
344
			}
342
			}
345
			if(args.containsOption("duporder")) {
343
			if (args.containsOption("duporder")) {
346
				runOnceTasks.removeDuplicateOrders();
344
				runOnceTasks.removeDuplicateOrders();
347
			}
345
			}
348
			
346
 
349
			System.exit(0);
347
			System.exit(0);
350
		}
348
		}
351
	}
349
	}
352
 
350
 
353
}
351
}
354
352