| Line 1330... |
Line 1330... |
| 1330 |
model.setInsuranceSale(partnerPolicyAmountMap.containsKey(fofoId) ? partnerPolicyAmountMap.get(fofoId) : 0);
|
1330 |
model.setInsuranceSale(partnerPolicyAmountMap.containsKey(fofoId) ? partnerPolicyAmountMap.get(fofoId) : 0);
|
| 1331 |
model.setInsruanceQty(partnerPolicyQtyMap.containsKey(fofoId) ? partnerPolicyQtyMap.get(fofoId) : 0);
|
1331 |
model.setInsruanceQty(partnerPolicyQtyMap.containsKey(fofoId) ? partnerPolicyQtyMap.get(fofoId) : 0);
|
| 1332 |
model.setSmartphoneSale(partnerOrderAmountMap.containsKey(fofoId) ? partnerOrderAmountMap.get(fofoId) : 0);
|
1332 |
model.setSmartphoneSale(partnerOrderAmountMap.containsKey(fofoId) ? partnerOrderAmountMap.get(fofoId) : 0);
|
| 1333 |
model.setSmartphoneQty(partnerOrderQtyMap.containsKey(fofoId) ? partnerOrderQtyMap.get(fofoId) : 0);
|
1333 |
model.setSmartphoneQty(partnerOrderQtyMap.containsKey(fofoId) ? partnerOrderQtyMap.get(fofoId) : 0);
|
| 1334 |
model.setTotalSale(salesByFofoIdMap.containsKey(fofoId) ? salesByFofoIdMap.get(fofoId) : 0);
|
1334 |
model.setTotalSale(salesByFofoIdMap.containsKey(fofoId) ? salesByFofoIdMap.get(fofoId) : 0);
|
| - |
|
1335 |
model.setFofoId(fofoId);
|
| 1335 |
saleTargetReportModelMap.put(fofoId, model);
|
1336 |
saleTargetReportModelMap.put(fofoId, model);
|
| 1336 |
}
|
1337 |
}
|
| 1337 |
|
1338 |
|
| 1338 |
Map<Integer, List<Serializable>> partnerSalesHeadersMap = this.getPartnerIdSalesHeaders();
|
1339 |
Map<Integer, List<Serializable>> partnerSalesHeadersMap = this.getPartnerIdSalesHeaders();
|
| 1339 |
for (Integer fofoId : fofoIds) {
|
1340 |
for (Integer fofoId : fofoIds) {
|
| 1340 |
SaleTargetReportModel model = saleTargetReportModelMap.get(fofoId);
|
1341 |
SaleTargetReportModel model = saleTargetReportModelMap.get(fofoId);
|
| 1341 |
SendNotificationModel sendNotificationModel = new SendNotificationModel();
|
1342 |
SendNotificationModel sendNotificationModel = new SendNotificationModel();
|
| 1342 |
sendNotificationModel.setCampaignName("Sales update alert");
|
1343 |
sendNotificationModel.setCampaignName("Sales update alert");
|
| Line 1360... |
Line 1361... |
| 1360 |
this.sendMailOfHtmlFomat("amit.gupta@shop2020.in", saleReport, cc, subject);
|
1361 |
this.sendMailOfHtmlFomat("amit.gupta@shop2020.in", saleReport, cc, subject);
|
| 1361 |
}
|
1362 |
}
|
| 1362 |
|
1363 |
|
| 1363 |
public static class SaleTargetReportModel {
|
1364 |
public static class SaleTargetReportModel {
|
| 1364 |
private double totalSale;
|
1365 |
private double totalSale;
|
| - |
|
1366 |
private int fofoId;
|
| - |
|
1367 |
|
| - |
|
1368 |
public int getFofoId() {
|
| - |
|
1369 |
return fofoId;
|
| - |
|
1370 |
}
|
| - |
|
1371 |
|
| - |
|
1372 |
public void setFofoId(int fofoId) {
|
| - |
|
1373 |
this.fofoId = fofoId;
|
| - |
|
1374 |
}
|
| - |
|
1375 |
|
| 1365 |
private double smartphoneSale;
|
1376 |
private double smartphoneSale;
|
| 1366 |
private long smartphoneQty;
|
1377 |
private long smartphoneQty;
|
| 1367 |
private double insuranceSale;
|
1378 |
private double insuranceSale;
|
| 1368 |
private long insruanceQty;
|
1379 |
private long insruanceQty;
|
| 1369 |
|
1380 |
|
| 1370 |
@Override
|
1381 |
@Override
|
| 1371 |
public int hashCode() {
|
1382 |
public int hashCode() {
|
| 1372 |
final int prime = 31;
|
1383 |
final int prime = 31;
|
| 1373 |
int result = 1;
|
1384 |
int result = 1;
|
| - |
|
1385 |
result = prime * result + fofoId;
|
| 1374 |
result = prime * result + (int) (insruanceQty ^ (insruanceQty >>> 32));
|
1386 |
result = prime * result + (int) (insruanceQty ^ (insruanceQty >>> 32));
|
| 1375 |
long temp;
|
1387 |
long temp;
|
| 1376 |
temp = Double.doubleToLongBits(insuranceSale);
|
1388 |
temp = Double.doubleToLongBits(insuranceSale);
|
| 1377 |
result = prime * result + (int) (temp ^ (temp >>> 32));
|
1389 |
result = prime * result + (int) (temp ^ (temp >>> 32));
|
| 1378 |
result = prime * result + (int) (smartphoneQty ^ (smartphoneQty >>> 32));
|
1390 |
result = prime * result + (int) (smartphoneQty ^ (smartphoneQty >>> 32));
|
| Line 1390... |
Line 1402... |
| 1390 |
if (obj == null)
|
1402 |
if (obj == null)
|
| 1391 |
return false;
|
1403 |
return false;
|
| 1392 |
if (getClass() != obj.getClass())
|
1404 |
if (getClass() != obj.getClass())
|
| 1393 |
return false;
|
1405 |
return false;
|
| 1394 |
SaleTargetReportModel other = (SaleTargetReportModel) obj;
|
1406 |
SaleTargetReportModel other = (SaleTargetReportModel) obj;
|
| - |
|
1407 |
if (fofoId != other.fofoId)
|
| - |
|
1408 |
return false;
|
| 1395 |
if (insruanceQty != other.insruanceQty)
|
1409 |
if (insruanceQty != other.insruanceQty)
|
| 1396 |
return false;
|
1410 |
return false;
|
| 1397 |
if (Double.doubleToLongBits(insuranceSale) != Double.doubleToLongBits(other.insuranceSale))
|
1411 |
if (Double.doubleToLongBits(insuranceSale) != Double.doubleToLongBits(other.insuranceSale))
|
| 1398 |
return false;
|
1412 |
return false;
|
| 1399 |
if (smartphoneQty != other.smartphoneQty)
|
1413 |
if (smartphoneQty != other.smartphoneQty)
|
| Line 1445... |
Line 1459... |
| 1445 |
this.insruanceQty = insruanceQty;
|
1459 |
this.insruanceQty = insruanceQty;
|
| 1446 |
}
|
1460 |
}
|
| 1447 |
|
1461 |
|
| 1448 |
@Override
|
1462 |
@Override
|
| 1449 |
public String toString() {
|
1463 |
public String toString() {
|
| 1450 |
return "SaleTargetReportModel [totalSale=" + totalSale + ", smartphoneSale=" + smartphoneSale
|
1464 |
return "SaleTargetReportModel [totalSale=" + totalSale + ", fofoId=" + fofoId + ", smartphoneSale="
|
| 1451 |
+ ", smartphoneQty=" + smartphoneQty + ", insuranceSale=" + insuranceSale + ", insruanceQty="
|
1465 |
+ smartphoneSale + ", smartphoneQty=" + smartphoneQty + ", insuranceSale=" + insuranceSale
|
| 1452 |
+ insruanceQty + "]";
|
1466 |
+ ", insruanceQty=" + insruanceQty + "]";
|
| 1453 |
}
|
1467 |
}
|
| 1454 |
|
1468 |
|
| 1455 |
}
|
1469 |
}
|
| 1456 |
|
1470 |
|
| 1457 |
private String getDailySalesReportHtml(Map<Integer, List<Serializable>> partnerSalesHeadersMap,
|
1471 |
private String getDailySalesReportHtml(Map<Integer, List<Serializable>> partnerSalesHeadersMap,
|
| Line 1469... |
Line 1483... |
| 1469 |
+ " <th style='border:1px solid black;padding: 5px'>Smartphone Sale</th>\n"
|
1483 |
+ " <th style='border:1px solid black;padding: 5px'>Smartphone Sale</th>\n"
|
| 1470 |
+ " <th style='border:1px solid black;padding: 5px'>SmartPhone Qty</th>\n"
|
1484 |
+ " <th style='border:1px solid black;padding: 5px'>SmartPhone Qty</th>\n"
|
| 1471 |
+ " <th style='border:1px solid black;padding: 5px'>Insurance Sale</th>\n"
|
1485 |
+ " <th style='border:1px solid black;padding: 5px'>Insurance Sale</th>\n"
|
| 1472 |
+ " <th style='border:1px solid black;padding: 5px'>Insurance Qty</th>\n"
|
1486 |
+ " <th style='border:1px solid black;padding: 5px'>Insurance Qty</th>\n"
|
| 1473 |
+ " </tr>");
|
1487 |
+ " </tr>");
|
| - |
|
1488 |
List<Integer> sortedPartnerSalesHeaders = partnerSalesHeadersMap.entrySet().stream()
|
| - |
|
1489 |
.sorted((x, y) -> ((String) (x.getValue().get(3))).compareTo((String) (y.getValue().get(3))))
|
| - |
|
1490 |
.map(x->x.getKey()).collect(Collectors.toList());
|
| 1474 |
for (Integer fofoId : saleReportTargetMap.keySet()) {
|
1491 |
for (Integer fofoId : sortedPartnerSalesHeaders)
|
| - |
|
1492 |
{
|
| 1475 |
sb.append("<tr>");
|
1493 |
sb.append("<tr>");
|
| 1476 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + partnerSalesHeadersMap.get(fofoId).get(0) + "</td>");
|
1494 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + partnerSalesHeadersMap.get(fofoId).get(0)
|
| - |
|
1495 |
+ "</td>");
|
| 1477 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + partnerSalesHeadersMap.get(fofoId).get(1) + "</td>");
|
1496 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + partnerSalesHeadersMap.get(fofoId).get(1)
|
| - |
|
1497 |
+ "</td>");
|
| 1478 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + partnerSalesHeadersMap.get(fofoId).get(2) + "</td>");
|
1498 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + partnerSalesHeadersMap.get(fofoId).get(2)
|
| - |
|
1499 |
+ "</td>");
|
| 1479 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + partnerSalesHeadersMap.get(fofoId).get(3) + "</td>");
|
1500 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + partnerSalesHeadersMap.get(fofoId).get(3)
|
| - |
|
1501 |
+ "</td>");
|
| 1480 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + partnerSalesHeadersMap.get(fofoId).get(4) + "</td>");
|
1502 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + partnerSalesHeadersMap.get(fofoId).get(4)
|
| - |
|
1503 |
+ "</td>");
|
| - |
|
1504 |
sb.append("<td style='border:1px solid black;padding: 5px'>"
|
| 1481 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + saleReportTargetMap.get(fofoId).getTotalSale() + "</td>");
|
1505 |
+ saleReportTargetMap.get(fofoId).getTotalSale() + "</td>");
|
| - |
|
1506 |
sb.append("<td style='border:1px solid black;padding: 5px'>"
|
| 1482 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + saleReportTargetMap.get(fofoId).getSmartphoneSale() + "</td>");
|
1507 |
+ saleReportTargetMap.get(fofoId).getSmartphoneSale() + "</td>");
|
| - |
|
1508 |
sb.append("<td style='border:1px solid black;padding: 5px'>"
|
| 1483 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + saleReportTargetMap.get(fofoId).getSmartphoneQty() + "</td>");
|
1509 |
+ saleReportTargetMap.get(fofoId).getSmartphoneQty() + "</td>");
|
| - |
|
1510 |
sb.append("<td style='border:1px solid black;padding: 5px'>"
|
| 1484 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + saleReportTargetMap.get(fofoId).getInsuranceSale() + "</td>");
|
1511 |
+ saleReportTargetMap.get(fofoId).getInsuranceSale() + "</td>");
|
| - |
|
1512 |
sb.append("<td style='border:1px solid black;padding: 5px'>"
|
| 1485 |
sb.append("<td style='border:1px solid black;padding: 5px'>" + saleReportTargetMap.get(fofoId).getInsruanceQty() + "</td>");
|
1513 |
+ saleReportTargetMap.get(fofoId).getInsruanceQty() + "</td>");
|
| 1486 |
sb.append("</tr>");
|
1514 |
sb.append("</tr>");
|
| 1487 |
|
1515 |
|
| 1488 |
}
|
1516 |
}
|
| 1489 |
|
1517 |
|
| 1490 |
sb.append("</tbody></table></body></html>");
|
1518 |
sb.append("</tbody></table></body></html>");
|