| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.service;
|
1 |
package com.spice.profitmandi.service;
|
| 2 |
|
2 |
|
| 3 |
import java.time.LocalDate;
|
- |
|
| 4 |
import java.time.LocalDateTime;
|
- |
|
| 5 |
import java.time.LocalTime;
|
- |
|
| 6 |
import java.util.*;
|
- |
|
| 7 |
import java.util.stream.Collectors;
|
3 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 8 |
|
- |
|
| 9 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
4 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 10 |
import com.spice.profitmandi.common.util.Utils;
|
5 |
import com.spice.profitmandi.common.util.Utils;
|
| 11 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
- |
|
| 12 |
import org.apache.logging.log4j.LogManager;
|
- |
|
| 13 |
import org.apache.logging.log4j.Logger;
|
- |
|
| 14 |
import org.springframework.beans.factory.annotation.Autowired;
|
- |
|
| 15 |
import org.springframework.stereotype.Component;
|
- |
|
| 16 |
|
- |
|
| 17 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
- |
|
| 18 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
6 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 19 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
7 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 20 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
8 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
| 21 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
9 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
| 22 |
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
|
10 |
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
|
| 23 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
11 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 24 |
import com.spice.profitmandi.dao.model.PartnerDetailModel;
|
12 |
import com.spice.profitmandi.dao.model.PartnerDetailModel;
|
| - |
|
13 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 25 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
14 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| 26 |
import com.spice.profitmandi.dao.repository.cs.TicketRepository;
|
15 |
import com.spice.profitmandi.dao.repository.cs.TicketRepository;
|
| 27 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
16 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 28 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
|
17 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
|
| 29 |
import com.spice.profitmandi.dao.repository.fofo.HygieneDataRepository;
|
18 |
import com.spice.profitmandi.dao.repository.fofo.HygieneDataRepository;
|
| 30 |
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
|
19 |
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
|
| 31 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
20 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
| 32 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
21 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
| 33 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
|
22 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
|
| 34 |
import com.spice.profitmandi.service.user.RetailerService;
|
23 |
import com.spice.profitmandi.service.user.RetailerService;
|
| - |
|
24 |
import org.apache.logging.log4j.LogManager;
|
| - |
|
25 |
import org.apache.logging.log4j.Logger;
|
| - |
|
26 |
import org.springframework.beans.factory.annotation.Autowired;
|
| - |
|
27 |
import org.springframework.stereotype.Component;
|
| - |
|
28 |
|
| - |
|
29 |
import java.time.LocalDate;
|
| - |
|
30 |
import java.time.LocalDateTime;
|
| - |
|
31 |
import java.time.LocalTime;
|
| - |
|
32 |
import java.util.*;
|
| - |
|
33 |
import java.util.stream.Collectors;
|
| 35 |
|
34 |
|
| 36 |
@Component
|
35 |
@Component
|
| 37 |
public class PartnerStatsServiceImpl implements PartnerStatsService {
|
36 |
public class PartnerStatsServiceImpl implements PartnerStatsService {
|
| 38 |
|
37 |
|
| 39 |
private static final Logger LOGGER = LogManager.getLogger(PartnerStatsServiceImpl.class);
|
38 |
private static final Logger LOGGER = LogManager.getLogger(PartnerStatsServiceImpl.class);
|
| Line 174... |
Line 173... |
| 174 |
}
|
173 |
}
|
| 175 |
pm.setTotalHygiene(totalHygieneCount);
|
174 |
pm.setTotalHygiene(totalHygieneCount);
|
| 176 |
|
175 |
|
| 177 |
pm.setTicket(ticketMap.get(fofoId) == null ? 0 : ticketMap.get(fofoId).intValue());
|
176 |
pm.setTicket(ticketMap.get(fofoId) == null ? 0 : ticketMap.get(fofoId).intValue());
|
| 178 |
Set<Integer> rbmUserIds = storeGuyMap.get(fofoId);
|
177 |
Set<Integer> rbmUserIds = storeGuyMap.get(fofoId);
|
| 179 |
if(rbmUserIds != null) {
|
178 |
if (rbmUserIds == null) {
|
| 180 |
pm.setRbms("-");
|
179 |
pm.setRbms("-");
|
| 181 |
} else {
|
180 |
} else {
|
| 182 |
String commaSeperatedRbms = rbmUserIds.stream().map(x->authUserMap.get(x).getFullName()).collect(Collectors.joining(","));
|
181 |
String commaSeperatedRbms = rbmUserIds.stream().map(x->authUserMap.get(x).getFullName()).collect(Collectors.joining(","));
|
| 183 |
pm.setRbms(commaSeperatedRbms);
|
182 |
pm.setRbms(commaSeperatedRbms);
|
| 184 |
}
|
183 |
}
|