| Line 271... |
Line 271... |
| 271 |
private SchemeService schemeService;
|
271 |
private SchemeService schemeService;
|
| 272 |
|
272 |
|
| 273 |
private static final String[] STOCK_AGEING_MAIL_LIST = new String[] { "uday.singh@smartudkaan.com",
|
273 |
private static final String[] STOCK_AGEING_MAIL_LIST = new String[] { "uday.singh@smartudkaan.com",
|
| 274 |
"adeel.yazdani@smartdukaan.com", "kamini.sharma@smartdukaan.com", "mohinder.mutreja@smartdukaan.com",
|
274 |
"adeel.yazdani@smartdukaan.com", "kamini.sharma@smartdukaan.com", "mohinder.mutreja@smartdukaan.com",
|
| 275 |
"ankit.bhatia@smartdukaan.com", "tarun.verma@smartdukaan.com", "hemant.kaura@smartdukaan.com",
|
275 |
"ankit.bhatia@smartdukaan.com", "tarun.verma@smartdukaan.com", "hemant.kaura@smartdukaan.com",
|
| 276 |
"rajat.gupta@smartdukaan.com", "kuldeep.kumar@smartdukaan.com", "amit.babu@smartdukaan.com",
|
276 |
"rajat.gupta@smartdukaan.com", "kuldeep.kumar@smartdukaan.com", "amit.babu@smartdukaan.com",
|
| 277 |
"manish.gupta@smartdukaan.com"};
|
277 |
"manish.gupta@smartdukaan.com" };
|
| 278 |
|
278 |
|
| 279 |
private static final String[] ITEMWISE_PENDING_INDENT_MAIL_LIST = new String[] { "kamini.sharma@smartdukaan.com",
|
279 |
private static final String[] ITEMWISE_PENDING_INDENT_MAIL_LIST = new String[] { "kamini.sharma@smartdukaan.com",
|
| 280 |
"amit.babu@smartdukaan.com", "tarun.verma@smartdukaan.com", "uday.singh@smartdukaan.com",
|
280 |
"amit.babu@smartdukaan.com", "tarun.verma@smartdukaan.com", "uday.singh@smartdukaan.com",
|
| 281 |
"kuldeep.kumar@smartdukaan.com", "niranjan.kala@smartdukaan.com" };
|
281 |
"kuldeep.kumar@smartdukaan.com", "niranjan.kala@smartdukaan.com" };
|
| 282 |
|
282 |
|
| Line 899... |
Line 899... |
| 899 |
ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, filteredRows);
|
899 |
ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, filteredRows);
|
| 900 |
String[] sendToArray = new String[] { storeGuyEntry.getKey() };
|
900 |
String[] sendToArray = new String[] { storeGuyEntry.getKey() };
|
| 901 |
Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Franchise Investment Summary", "PFA",
|
901 |
Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Franchise Investment Summary", "PFA",
|
| 902 |
fileName, new ByteArrayResource(baos.toByteArray()));
|
902 |
fileName, new ByteArrayResource(baos.toByteArray()));
|
| 903 |
}
|
903 |
}
|
| 904 |
sendTo = Arrays.asList("tarun.verma@smartdukaan.com", "kamini.sharma@smartdukaan.com", "hemant.kaura@smartdukaan.com",
|
904 |
sendTo = Arrays.asList("tarun.verma@smartdukaan.com", "kamini.sharma@smartdukaan.com",
|
| - |
|
905 |
"hemant.kaura@smartdukaan.com", "amit.babu@smartdukaan.com", "amit.gupta@shop2020.in",
|
| 905 |
"amit.babu@smartdukaan.com", "amit.gupta@shop2020.in", "manish.gupta@smartdukaan.com", "niranjan.kala@smartdukaan.com");
|
906 |
"manish.gupta@smartdukaan.com", "niranjan.kala@smartdukaan.com");
|
| 906 |
}
|
907 |
}
|
| 907 |
|
908 |
|
| 908 |
ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, rows);
|
909 |
ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, rows);
|
| 909 |
String[] sendToArray = sendTo.toArray(new String[sendTo.size()]);
|
910 |
String[] sendToArray = sendTo.toArray(new String[sendTo.size()]);
|
| 910 |
Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Franchise Investment Summary", "PFA",
|
911 |
Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Franchise Investment Summary", "PFA",
|
| Line 986... |
Line 987... |
| 986 |
|
987 |
|
| 987 |
public void sendTargetVsSalesReport(List<String> sendTo) throws Exception {
|
988 |
public void sendTargetVsSalesReport(List<String> sendTo) throws Exception {
|
| 988 |
|
989 |
|
| 989 |
if (sendTo == null) {
|
990 |
if (sendTo == null) {
|
| 990 |
sendTo = Arrays.asList("tarun.verma@smartdukaan.com", "kamini.sharma@smartdukaan.com",
|
991 |
sendTo = Arrays.asList("tarun.verma@smartdukaan.com", "kamini.sharma@smartdukaan.com",
|
| 991 |
"amit.gupta@shop2020.in", "hemant.kaura@smartdukaan.com", "amit.babu@smartdukaan.com", "manish.gupta@smartdukaan.com");
|
992 |
"amit.gupta@shop2020.in", "hemant.kaura@smartdukaan.com", "amit.babu@smartdukaan.com",
|
| - |
|
993 |
"manish.gupta@smartdukaan.com");
|
| 992 |
}
|
994 |
}
|
| 993 |
Map<Integer, List<Serializable>> partnerSalesTargetRowsMap = targetService.getDailySaleReportVsTarget();
|
995 |
Map<Integer, List<Serializable>> partnerSalesTargetRowsMap = targetService.getDailySaleReportVsTarget();
|
| 994 |
|
996 |
|
| 995 |
Map<Integer, FofoReportingModel> partnerIdSalesHeadersMap = this.getPartnerIdSalesHeaders();
|
997 |
Map<Integer, FofoReportingModel> partnerIdSalesHeadersMap = this.getPartnerIdSalesHeaders();
|
| 996 |
|
998 |
|
| Line 1067... |
Line 1069... |
| 1067 |
}
|
1069 |
}
|
| 1068 |
|
1070 |
|
| 1069 |
}
|
1071 |
}
|
| 1070 |
|
1072 |
|
| 1071 |
public void sendAgeingReport() throws Exception {
|
1073 |
public void sendAgeingReport() throws Exception {
|
| 1072 |
sendAgeingReport("kamini.sharma@smartdukaan.com", "amit.babu@smartdukaan.com", "tarun.verma@smartdukaan.com",
|
1074 |
sendAgeingReport("kamini.sharma@smartdukaan.com", "amit.babu@smartdukaan.com", "tarun.verma@smartdukaan.com",
|
| 1073 |
"niranjan.kala@smartdukaan.com", "manish.gupta@smartdukaan.com", "kuldeep.kumar@smartdukaan.com",
|
1075 |
"niranjan.kala@smartdukaan.com", "manish.gupta@smartdukaan.com", "kuldeep.kumar@smartdukaan.com",
|
| 1074 |
"hemant.kaura@smartdukaan.com");
|
1076 |
"hemant.kaura@smartdukaan.com");
|
| 1075 |
}
|
1077 |
}
|
| 1076 |
|
1078 |
|
| 1077 |
public void moveImeisToPriceDropImeis() throws Exception {
|
1079 |
public void moveImeisToPriceDropImeis() throws Exception {
|
| Line 2077... |
Line 2079... |
| 2077 |
List<Item> item = itemRepository.selectAllByCatalogItemId(entry.getKey());
|
2079 |
List<Item> item = itemRepository.selectAllByCatalogItemId(entry.getKey());
|
| 2078 |
|
2080 |
|
| 2079 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
2081 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| 2080 |
|
2082 |
|
| 2081 |
Map<Integer, List<SaholicCIS>> itemAvailabilityMap = saholicInventoryService.getSaholicStock()
|
2083 |
Map<Integer, List<SaholicCIS>> itemAvailabilityMap = saholicInventoryService.getSaholicStock()
|
| 2082 |
.get(warehouseMap.get(customRetailer.getWarehouseId()));
|
2084 |
.get(customRetailer.getWarehouseId());
|
| 2083 |
|
2085 |
|
| 2084 |
Map<Integer, List<SaholicPOItem>> poItemAvailabilityMap = saholicInventoryService
|
2086 |
Map<Integer, List<SaholicPOItem>> poItemAvailabilityMap = saholicInventoryService
|
| 2085 |
.getSaholicPOItems().get(warehouseMap.get(customRetailer.getWarehouseId()));
|
2087 |
.getSaholicPOItems().get(customRetailer.getWarehouseId());
|
| 2086 |
for (Item it : item) {
|
2088 |
for (Item it : item) {
|
| 2087 |
List<SaholicCIS> currentAvailability = itemAvailabilityMap.get(it.getId());
|
2089 |
List<SaholicCIS> currentAvailability = itemAvailabilityMap.get(it.getId());
|
| 2088 |
List<SaholicPOItem> poItemAvailability = poItemAvailabilityMap.get(it.getId());
|
2090 |
List<SaholicPOItem> poItemAvailability = poItemAvailabilityMap.get(it.getId());
|
| 2089 |
if (currentAvailability != null) {
|
2091 |
if (currentAvailability != null) {
|
| 2090 |
allColorNetAvailability += currentAvailability.stream()
|
2092 |
allColorNetAvailability += currentAvailability.stream()
|
| Line 2149... |
Line 2151... |
| 2149 |
if (!emailRowsMap.containsKey(y.getKey())) {
|
2151 |
if (!emailRowsMap.containsKey(y.getKey())) {
|
| 2150 |
emailRowsMap.put(y.getKey(), new ArrayList<>());
|
2152 |
emailRowsMap.put(y.getKey(), new ArrayList<>());
|
| 2151 |
}
|
2153 |
}
|
| 2152 |
List<List<? extends Serializable>> fms = x.getValue().stream()
|
2154 |
List<List<? extends Serializable>> fms = x.getValue().stream()
|
| 2153 |
.map(r -> Arrays.asList(r.getStoreCode(), r.getStoreName(), r.getBrandName(),
|
2155 |
.map(r -> Arrays.asList(r.getStoreCode(), r.getStoreName(), r.getBrandName(),
|
| 2154 |
r.getModelName(), r.getModelNumber(), r.getShortageQty()))
|
2156 |
r.getModelName(), r.getModelNumber(), r.getShortageQty(), r.getAvailabitiy()))
|
| 2155 |
.collect(Collectors.toList());
|
2157 |
.collect(Collectors.toList());
|
| 2156 |
emailRowsMap.get(y.getKey()).addAll(fms);
|
2158 |
emailRowsMap.get(y.getKey()).addAll(fms);
|
| 2157 |
|
2159 |
|
| 2158 |
}
|
2160 |
}
|
| 2159 |
|
2161 |
|
| 2160 |
});
|
2162 |
});
|
| 2161 |
|
2163 |
|
| 2162 |
});
|
2164 |
});
|
| 2163 |
|
2165 |
|
| 2164 |
List<String> headers = Arrays.asList("Partner Code", "Partner Name", "Brand", "Model Name", "Model Number",
|
2166 |
List<String> headers = Arrays.asList("Partner Code", "Partner Name", "Brand", "Model Name", "Model Number",
|
| 2165 |
"Shortage Qty");
|
2167 |
"Shortage Qty", "Availability");
|
| 2166 |
emailRowsMap.entrySet().forEach(entry -> {
|
2168 |
emailRowsMap.entrySet().forEach(entry -> {
|
| 2167 |
|
2169 |
|
| 2168 |
ByteArrayOutputStream baos = null;
|
2170 |
ByteArrayOutputStream baos = null;
|
| 2169 |
try {
|
2171 |
try {
|
| 2170 |
baos = FileUtil.getCSVByteStream(headers, entry.getValue());
|
2172 |
baos = FileUtil.getCSVByteStream(headers, entry.getValue());
|