Subversion Repositories SmartDukaan

Rev

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

Rev 23929 Rev 24121
Line 1... Line 1...
1
package com.smartdukaan.cron.scheduled;
1
package com.smartdukaan.cron.scheduled;
2
 
2
 
-
 
3
import java.io.IOException;
-
 
4
import java.text.MessageFormat;
-
 
5
import java.time.LocalDate;
-
 
6
 
-
 
7
import javax.mail.MessagingException;
-
 
8
 
3
import org.apache.logging.log4j.LogManager;
9
import org.apache.logging.log4j.LogManager;
4
import org.apache.logging.log4j.Logger;
10
import org.apache.logging.log4j.Logger;
5
import org.springframework.beans.factory.annotation.Autowired;
11
import org.springframework.beans.factory.annotation.Autowired;
6
import org.springframework.scheduling.annotation.Scheduled;
12
import org.springframework.scheduling.annotation.Scheduled;
7
import org.springframework.stereotype.Component;
13
import org.springframework.stereotype.Component;
8
 
14
 
9
import com.smartdukaan.cron.monitored.NagiosMonitorTasks;
15
import com.smartdukaan.cron.monitored.NagiosMonitorTasks;
-
 
16
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
10
 
17
 
11
@Component
18
@Component
12
public class ScheduledSkeleton {
19
public class ScheduledSkeleton {
13
 
20
 
14
	private static final Logger log = LogManager.getLogger(ScheduledSkeleton.class);
21
	private static final Logger log = LogManager.getLogger(ScheduledSkeleton.class);
Line 37... Line 44...
37
	@Scheduled(cron = "0 0 9 * * *")
44
	@Scheduled(cron = "0 0 9 * * *")
38
	public void migrateLineItems() throws Throwable {
45
	public void migrateLineItems() throws Throwable {
39
		log.info("Started run Once");
46
		log.info("Started run Once");
40
		scheduledTasks.sendPartnerInvestmentDetails();
47
		scheduledTasks.sendPartnerInvestmentDetails();
41
	}
48
	}
-
 
49
	
-
 
50
	@Scheduled(cron="0 0 23 * * ?")
-
 
51
	public void sendMail() throws MessagingException, ProfitMandiBusinessException, IOException
-
 
52
	{
-
 
53
		log.info("sending mail");
-
 
54
		String message=MessageFormat.format("Sale Target summary for {1}", LocalDate.now());
-
 
55
		scheduledTasks.sendMailWithAttachments("adeel.yazdani@smartdukaan.com", "Daily Sale Report", message);
-
 
56
	}
42
}
57
}