Subversion Repositories SmartDukaan

Rev

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

Rev 24692 Rev 24697
Line 676... Line 676...
676
	public void sendMailToPartnerAboutTargetAndSales() throws ProfitMandiBusinessException, MessagingException,
676
	public void sendMailToPartnerAboutTargetAndSales() throws ProfitMandiBusinessException, MessagingException,
677
			IOException, EncryptedDocumentException, InvalidFormatException {
677
			IOException, EncryptedDocumentException, InvalidFormatException {
678
		List<Integer> fofoIds = targetService.getfofoIdsFromfofoStore();
678
		List<Integer> fofoIds = targetService.getfofoIdsFromfofoStore();
679
		Map<Integer, CustomRetailer> fofoIdsAndCustomRetailer = retailerService
679
		Map<Integer, CustomRetailer> fofoIdsAndCustomRetailer = retailerService
680
				.getFofoRetailers(new ArrayList<>(fofoIds));
680
				.getFofoRetailers(new ArrayList<>(fofoIds));
681
		List<InputStream> input = new ArrayList<>();
-
 
682
		List<PartnerTargetDetails> partnerTargetDetails = partnerTargetRepository
681
		List<PartnerTargetDetails> partnerTargetDetails = partnerTargetRepository
683
				.selectAllGeEqAndLeEqStartDateAndEndDate(LocalDateTime.now());
682
				.selectAllGeEqAndLeEqStartDateAndEndDate(LocalDateTime.now());
684
		for (Integer fofoId : fofoIds) {
683
		for (Integer fofoId : fofoIds) {
685
			InputStream is = targetService.getDailySaleReportVsTargetForPartner(fofoId, partnerTargetDetails);
684
			InputStream is = targetService.getDailySaleReportVsTargetForPartner(fofoId, partnerTargetDetails);
686
			LOGGER.info("is" + is);
685
			LOGGER.info("is" + is);
Line 697... Line 696...
697
					is);
696
					is);
698
 
697
 
699
		}
698
		}
700
	}
699
	}
701
 
700
 
702
	public void sendAgeingReport() throws Exception {
701
	public void sendAgeingReport(String... sendTo) throws Exception {
703
 
702
 
704
		InputStreamSource isr = reporticoService.getReportInputStreamSource(ReporticoProject.WAREHOUSENEW,
703
		InputStreamSource isr = reporticoService.getReportInputStreamSource(ReporticoProject.WAREHOUSENEW,
705
				"itemstockageing.xml");
704
				"itemstockageing.xml");
706
		String[] to = { "amod.sen@smartdukaan.com", "adeel.yazdani@smartdukaan.com", "kamini.sharma@smartdukaan.com",
-
 
707
				"tarun.verma@smartdukaan.com", "chaitnaya.vats@smartdukaan.com", "mohinder.mutreja@smartdukaan.com" };
-
 
708
		Attachment attachment = new Attachment(
705
		Attachment attachment = new Attachment(
709
				"aeging-report-" + FormattingUtils.formatDate(LocalDateTime.now().minusDays(1)) + ".csv", isr);
706
				"aeging-report-" + FormattingUtils.formatDate(LocalDateTime.now().minusDays(1)) + ".csv", isr);
710
		Utils.sendMailWithAttachments(googleMailSender, to, null, "Stock Aeging Report", "PFA", attachment);
707
		Utils.sendMailWithAttachments(googleMailSender, sendTo, null, "Stock Aeging Report", "PFA", attachment);
-
 
708
	}
-
 
709
 
-
 
710
	public void sendAgeingReport() throws Exception {
-
 
711
		sendAgeingReport("amod.sen@smartdukaan.com", "adeel.yazdani@smartdukaan.com", "kamini.sharma@smartdukaan.com",
-
 
712
				"tarun.verma@smartdukaan.com", "chaitnaya.vats@smartdukaan.com", "mohinder.mutreja@smartdukaan.com");
711
	}
713
	}
712
 
714
 
713
	public void moveImeisToPriceDropImeis() throws Exception {
715
	public void moveImeisToPriceDropImeis() throws Exception {
714
		List<PriceDrop> priceDrops = priceDropRepository.selectAll();
716
		List<PriceDrop> priceDrops = priceDropRepository.selectAll();
715
		for (PriceDrop priceDrop : priceDrops) {
717
		for (PriceDrop priceDrop : priceDrops) {
Line 1361... Line 1363...
1361
			LOGGER.info(sale);
1363
			LOGGER.info(sale);
1362
		}
1364
		}
1363
		String saleReport = this.getDailySalesReportByPartnerId(salesByFofoIdMap, dailyTarget);
1365
		String saleReport = this.getDailySalesReportByPartnerId(salesByFofoIdMap, dailyTarget);
1364
		LOGGER.info(saleReport);
1366
		LOGGER.info(saleReport);
1365
		String cc[] = { "Tarun.verma@smartdukaan.com", "Kamini.sharma@smartdukaan.com",
1367
		String cc[] = { "Tarun.verma@smartdukaan.com", "Kamini.sharma@smartdukaan.com",
1366
				"chaitnaya.vats@smartdukaan.com","govind.kumar@shop2020.in", "adeel.yazdani@smartdukaan.com", "mohinder.mutreja@smartdukaan.com" };
1368
				"chaitnaya.vats@smartdukaan.com", "adeel.yazdani@smartdukaan.com", "mohinder.mutreja@smartdukaan.com" };
1367
		String subject = "sale report till" + " " + now.format(timeFormatter);
1369
		String subject = "sale report till" + " " + now.format(timeFormatter);
1368
		this.sendMailOfHtmlFomat("amod.sen@smartdukaan.com", saleReport, cc, subject);
1370
		this.sendMailOfHtmlFomat("amod.sen@smartdukaan.com", saleReport, cc, subject);
1369
	}
1371
	}
1370
 
1372
 
1371
	public String getDailySalesReportByPartnerId(Map<Integer, Double> salesByFofoIdMap, Map<Integer, Float> dailyTarget)
1373
	public String getDailySalesReportByPartnerId(Map<Integer, Double> salesByFofoIdMap, Map<Integer, Float> dailyTarget)