| Line 4... |
Line 4... |
| 4 |
import java.io.FileInputStream;
|
4 |
import java.io.FileInputStream;
|
| 5 |
import java.io.FileNotFoundException;
|
5 |
import java.io.FileNotFoundException;
|
| 6 |
import java.time.LocalDate;
|
6 |
import java.time.LocalDate;
|
| 7 |
import java.time.LocalDateTime;
|
7 |
import java.time.LocalDateTime;
|
| 8 |
import java.time.LocalTime;
|
8 |
import java.time.LocalTime;
|
| - |
|
9 |
import java.time.YearMonth;
|
| 9 |
import java.time.ZoneOffset;
|
10 |
import java.time.ZoneOffset;
|
| 10 |
import java.time.format.DateTimeFormatter;
|
11 |
import java.time.format.DateTimeFormatter;
|
| 11 |
import java.util.ArrayList;
|
12 |
import java.util.ArrayList;
|
| 12 |
import java.util.Arrays;
|
13 |
import java.util.Arrays;
|
| 13 |
import java.util.Comparator;
|
- |
|
| 14 |
import java.util.HashMap;
|
14 |
import java.util.HashMap;
|
| 15 |
import java.util.HashSet;
|
15 |
import java.util.HashSet;
|
| 16 |
import java.util.LinkedHashMap;
|
16 |
import java.util.LinkedHashMap;
|
| 17 |
import java.util.List;
|
17 |
import java.util.List;
|
| 18 |
import java.util.Map;
|
18 |
import java.util.Map;
|
| Line 52... |
Line 52... |
| 52 |
import com.spice.profitmandi.common.model.DatasetModel;
|
52 |
import com.spice.profitmandi.common.model.DatasetModel;
|
| 53 |
import com.spice.profitmandi.common.model.LegendModel;
|
53 |
import com.spice.profitmandi.common.model.LegendModel;
|
| 54 |
import com.spice.profitmandi.common.model.Notification;
|
54 |
import com.spice.profitmandi.common.model.Notification;
|
| 55 |
import com.spice.profitmandi.common.model.OptionsModel;
|
55 |
import com.spice.profitmandi.common.model.OptionsModel;
|
| 56 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
56 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 57 |
import com.spice.profitmandi.common.model.SaholicInventoryCIsModel;
|
- |
|
| 58 |
import com.spice.profitmandi.common.model.TitleModel;
|
57 |
import com.spice.profitmandi.common.model.TitleModel;
|
| 59 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
58 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 60 |
import com.spice.profitmandi.dao.Interface.Campaign;
|
59 |
import com.spice.profitmandi.dao.Interface.Campaign;
|
| 61 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
60 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 62 |
import com.spice.profitmandi.dao.entity.auth.Menu;
|
61 |
import com.spice.profitmandi.dao.entity.auth.Menu;
|
| Line 69... |
Line 68... |
| 69 |
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
|
68 |
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
|
| 70 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
69 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 71 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
70 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
| 72 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
|
71 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
|
| 73 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
72 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
| 74 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTypeChange;
|
- |
|
| 75 |
import com.spice.profitmandi.dao.entity.inventory.ReporticoCacheTable;
|
73 |
import com.spice.profitmandi.dao.entity.inventory.ReporticoCacheTable;
|
| 76 |
import com.spice.profitmandi.dao.entity.inventory.SaholicInventoryCIS;
|
- |
|
| 77 |
import com.spice.profitmandi.dao.entity.user.Lead;
|
74 |
import com.spice.profitmandi.dao.entity.user.Lead;
|
| 78 |
import com.spice.profitmandi.dao.enumuration.catalog.ItemCriteriaType;
|
75 |
import com.spice.profitmandi.dao.enumuration.catalog.ItemCriteriaType;
|
| 79 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
76 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 80 |
import com.spice.profitmandi.dao.enumuration.dtr.LeadStatus;
|
77 |
import com.spice.profitmandi.dao.enumuration.dtr.LeadStatus;
|
| 81 |
import com.spice.profitmandi.dao.model.CreateOfferRequest;
|
78 |
import com.spice.profitmandi.dao.model.CreateOfferRequest;
|
| Line 407... |
Line 404... |
| 407 |
Map<Integer, MonthSaleModel> monthSaleMap = new HashMap<>();
|
404 |
Map<Integer, MonthSaleModel> monthSaleMap = new HashMap<>();
|
| 408 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
405 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
| 409 |
int dayOfMonth = curDate.getDayOfMonth();
|
406 |
int dayOfMonth = curDate.getDayOfMonth();
|
| 410 |
for (int i = 1; i <= 6; i++) {
|
407 |
for (int i = 1; i <= 6; i++) {
|
| 411 |
LocalDateTime startOfMonth = curDate.withDayOfMonth(1).minusMonths(i);
|
408 |
LocalDateTime startOfMonth = curDate.withDayOfMonth(1).minusMonths(i);
|
| - |
|
409 |
int lengthOfMonth = YearMonth.from(startOfMonth).lengthOfMonth();
|
| 412 |
double monthSales = fofoOrderItemRepository.selectSumMopGroupByRetailer(startOfMonth,
|
410 |
double monthSales = fofoOrderItemRepository.selectSumMopGroupByRetailer(startOfMonth,
|
| 413 |
startOfMonth.plusMonths(1), loginDetails.getFofoId(), false).get(fofoId);
|
411 |
startOfMonth.plusMonths(1), loginDetails.getFofoId(), false).get(fofoId);
|
| 414 |
|
412 |
|
| 415 |
double mtdSales = fofoOrderItemRepository.selectSumMopGroupByRetailer(startOfMonth,
|
413 |
double mtdSales = fofoOrderItemRepository.selectSumMopGroupByRetailer(startOfMonth,
|
| 416 |
startOfMonth.plusDays(dayOfMonth), loginDetails.getFofoId(), false).get(fofoId);
|
414 |
startOfMonth.plusDays(Math.min(dayOfMonth, lengthOfMonth)), loginDetails.getFofoId(), false).get(fofoId);
|
| 417 |
|
415 |
|
| 418 |
PartnerType partnerType = partnerTypeChangeService.getTypeOnDate(fofoId, startOfMonth.toLocalDate());
|
416 |
PartnerType partnerType = partnerTypeChangeService.getTypeOnDate(fofoId, startOfMonth.toLocalDate());
|
| 419 |
|
417 |
|
| 420 |
MonthSaleModel ms = new MonthSaleModel();
|
418 |
MonthSaleModel ms = new MonthSaleModel();
|
| 421 |
ms.setMtdSales(this.format((long) mtdSales));
|
419 |
ms.setMtdSales(this.format((long) mtdSales));
|