Subversion Repositories SmartDukaan

Rev

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

Rev 25434 Rev 25445
Line 736... Line 736...
736
		InputStreamSource isr = reporticoService.getReportInputStreamSource(ReporticoProject.WAREHOUSENEW,
736
		InputStreamSource isr = reporticoService.getReportInputStreamSource(ReporticoProject.WAREHOUSENEW,
737
				"itemstockageing.xml");
737
				"itemstockageing.xml");
738
		InputStreamSource isr1 = reporticoService.getReportInputStreamSource(ReporticoProject.FOCO,
738
		InputStreamSource isr1 = reporticoService.getReportInputStreamSource(ReporticoProject.FOCO,
739
				"ItemwiseOverallPendingIndent.xml");
739
				"ItemwiseOverallPendingIndent.xml");
740
		Attachment attachment = new Attachment(
740
		Attachment attachment = new Attachment(
741
				"aeging-report-" + FormattingUtils.formatDate(LocalDateTime.now().minusDays(1)) + ".csv", isr);
741
				"ageing-report-" + FormattingUtils.formatDate(LocalDateTime.now().minusDays(1)) + ".csv", isr);
742
		Attachment attachment1 = new Attachment(
742
		Attachment attachment1 = new Attachment(
743
				"aeging-report-" + FormattingUtils.formatDate(LocalDateTime.now().minusDays(1)) + ".csv", isr1);
743
				"pending-indent-" + FormattingUtils.formatDate(LocalDateTime.now().minusDays(1)) + ".csv", isr1);
744
		Utils.sendMailWithAttachments(googleMailSender, sendTo, null, "Stock Aeging Report", "PFA", attachment,
744
		Utils.sendMailWithAttachments(googleMailSender, sendTo, null, "Stock Aeging Report", "PFA", attachment,
745
				attachment1);
745
				attachment1);
746
 
746
 
747
		//Reports to be sent to mapped partners
747
		//Reports to be sent to mapped partners
748
		Map<String, Set<String>> storeGuysMap = getStoreGuyMap();
748
		Map<String, Set<String>> storeGuysMap = getStoreGuyMap();
Line 756... Line 756...
756
		Utils.sendMailWithAttachments(googleMailSender, sendToArray, null, "Stock Aeging Report", "PFA", attachment);
756
		Utils.sendMailWithAttachments(googleMailSender, sendToArray, null, "Stock Aeging Report", "PFA", attachment);
757
		
757
		
758
		
758
		
759
		for(Map.Entry<String, Set<String>> storeGuyEntry: storeGuysMap.entrySet()) {
759
		for(Map.Entry<String, Set<String>> storeGuyEntry: storeGuysMap.entrySet()) {
760
			Map<String, String> params = new HashMap<>();
760
			Map<String, String> params = new HashMap<>();
-
 
761
			if(storeGuyEntry.getValue().size() == 0) continue;
761
			params.put("MANUAL_email", String.join(",", storeGuyEntry.getValue()));
762
			params.put("MANUAL_email", String.join(",", storeGuyEntry.getValue()));
762
			InputStreamSource isr3 = reporticoService.getReportInputStreamSource(ReporticoProject.FOCO,
763
			InputStreamSource isr3 = reporticoService.getReportInputStreamSource(ReporticoProject.FOCO,
763
					"focostockreport.xml", params);
764
					"focostockreport.xml", params);
764
			Attachment attache = new Attachment(
765
			Attachment attache = new Attachment(
765
					"aeging-report-" + FormattingUtils.formatDate(LocalDateTime.now()) + ".csv", isr3);
766
					"partner-stock-report" + FormattingUtils.formatDate(LocalDateTime.now()) + ".csv", isr3);
766
			Utils.sendMailWithAttachments(googleMailSender, new String[] {}, null, "Partner Stock Report", "PFA", attache);
767
			Utils.sendMailWithAttachments(googleMailSender, storeGuyEntry.getValue().toArray(new String[] {}), null, "Partner Stock Report", "PFA", attache);
767
		}
768
		}
768
		
769
		
769
	}
770
	}
770
 
771
 
771
	public void sendAgeingReport() throws Exception {
772
	public void sendAgeingReport() throws Exception {
Line 1374... Line 1375...
1374
				}
1375
				}
1375
			}
1376
			}
1376
		}
1377
		}
1377
	}
1378
	}
1378
 
1379
 
1379
	public static final Map<String, String> nameEmail = new HashMap<>();
-
 
1380
 
1380
 
1381
	public static final Map<String, List<String>> storeManagerMap = new HashMap<>();
1381
	public static final Map<String, List<String>> storeManagerMap = new HashMap<>();
1382
 
1382
 
-
 
1383
	public static final Map<String, String> nameEmail = new HashMap<>();
1383
	static {
1384
	static {
1384
		nameEmail.put("Amod", "amod.sen@smartdukaan.com");
1385
		nameEmail.put("Amod", "amod.sen@smartdukaan.com");
1385
		nameEmail.put("Parmod", "parmod.kumar@smartdukaan.com");
1386
		nameEmail.put("Parmod", "parmod.kumar@smartdukaan.com");
1386
		nameEmail.put("Anis", "md.anis@smartdukaan.com");
1387
		nameEmail.put("Anis", "md.anis@smartdukaan.com");
1387
		nameEmail.put("Manoj", "manoj.singh@smartdukaan.com");
1388
		nameEmail.put("Manoj", "manoj.singh@smartdukaan.com");