Subversion Repositories SmartDukaan

Rev

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

Rev 24134 Rev 24135
Line 62... Line 62...
62
import com.spice.profitmandi.service.transaction.TransactionService;
62
import com.spice.profitmandi.service.transaction.TransactionService;
63
import com.spice.profitmandi.service.user.RetailerService;
63
import com.spice.profitmandi.service.user.RetailerService;
64
import com.spice.profitmandi.service.wallet.WalletService;
64
import com.spice.profitmandi.service.wallet.WalletService;
65
 
65
 
66
import in.shop2020.model.v1.order.WalletReferenceType;
66
import in.shop2020.model.v1.order.WalletReferenceType;
-
 
67
import com.spice.profitmandi.dao.entity.fofo.SalesHead;;
67
 
68
 
68
@Component
69
@Component
69
@Transactional(rollbackFor = Throwable.class)
70
@Transactional(rollbackFor = Throwable.class)
70
public class ScheduledTasks {
71
public class ScheduledTasks {
71
 
72
 
Line 369... Line 370...
369
				new String[] { "amandeep.singh@smartdukaan.com", "tarun.verma@smartdukaan.com",
370
				new String[] { "amandeep.singh@smartdukaan.com", "tarun.verma@smartdukaan.com",
370
						"kamini.sharma@smartdukaan.com", "dhruv.kathpal@smartdukaan.com" },
371
						"kamini.sharma@smartdukaan.com", "dhruv.kathpal@smartdukaan.com" },
371
				"Partner Investment Summary", "PFA", fileName, new ByteArrayResource(baos.toByteArray()));
372
				"Partner Investment Summary", "PFA", fileName, new ByteArrayResource(baos.toByteArray()));
372
	}
373
	}
373
	
374
	
-
 
375
	public  void sendMailWithAttachmentsForSalesHead(String[] email,String subject,String body,String saleHead) throws MessagingException, ProfitMandiBusinessException, IOException
-
 
376
	{
-
 
377
		MimeMessage message = mailSender.createMimeMessage();
-
 
378
    	MimeMessageHelper helper = new MimeMessageHelper(message,true,CharEncoding.UTF_8);
-
 
379
    	InputStream is=targetService.getDailySaleReportVsTargetForSaleHead(saleHead);
-
 
380
    	helper.setSubject(subject);
-
 
381
    	helper.setText(body);
-
 
382
    	//String ccEmails[]= {"Tarun.verma@smartdukaan.com","Kamini.sharma@smartdukaan.com","chaitnaya.vats@smartdukaan.com"};
-
 
383
    	//helper.setCc(ccEmails);
-
 
384
    	helper.addAttachment("saleReport"+LocalDate.now()+".xlsx",new ByteArrayResource(IOUtils.toByteArray(is)));
-
 
385
    	helper.setTo(email);
-
 
386
    	InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "ProfitMandi Admin");
-
 
387
    	helper.setFrom(senderAddress);
-
 
388
    	mailSender.send(message);
-
 
389
	}
-
 
390
	
374
	public void sendMailWithAttachments(String[] email,String subject,String body) throws MessagingException, ProfitMandiBusinessException, IOException
391
	public  void sendMailWithAttachments(String[] email,String subject,String body) throws MessagingException, ProfitMandiBusinessException, IOException
375
	{
392
	{
376
		MimeMessage message = mailSender.createMimeMessage();
393
		MimeMessage message = mailSender.createMimeMessage();
377
    	MimeMessageHelper helper = new MimeMessageHelper(message,true,CharEncoding.UTF_8);
394
    	MimeMessageHelper helper = new MimeMessageHelper(message,true,CharEncoding.UTF_8);
378
    	InputStream is=targetService.getDailySaleReportVsTarget();
395
    	InputStream is=targetService.getDailySaleReportVsTarget();
379
    	helper.setSubject(subject);
396
    	helper.setSubject(subject);