| Line 20... |
Line 20... |
| 20 |
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
|
20 |
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
|
| 21 |
import com.spice.profitmandi.dao.entity.fofo.*;
|
21 |
import com.spice.profitmandi.dao.entity.fofo.*;
|
| 22 |
import com.spice.profitmandi.dao.entity.transaction.LineItem;
|
22 |
import com.spice.profitmandi.dao.entity.transaction.LineItem;
|
| 23 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
23 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
| 24 |
import com.spice.profitmandi.dao.enumuration.catalog.UpgradeOfferStatus;
|
24 |
import com.spice.profitmandi.dao.enumuration.catalog.UpgradeOfferStatus;
|
| - |
|
25 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 25 |
import com.spice.profitmandi.dao.enumuration.fofo.Milestone;
|
26 |
import com.spice.profitmandi.dao.enumuration.fofo.Milestone;
|
| 26 |
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
|
27 |
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
|
| 27 |
import com.spice.profitmandi.dao.model.SamsungUpgradeOfferModel;
|
28 |
import com.spice.profitmandi.dao.model.SamsungUpgradeOfferModel;
|
| 28 |
import com.spice.profitmandi.dao.model.*;
|
29 |
import com.spice.profitmandi.dao.model.*;
|
| 29 |
import com.spice.profitmandi.dao.model.warehouse.LMSGraphRequest;
|
30 |
import com.spice.profitmandi.dao.model.warehouse.LMSGraphRequest;
|
| Line 1567... |
Line 1568... |
| 1567 |
@RequestMapping(value = "/getWarehouseWiseBrandStock", method = RequestMethod.GET)
|
1568 |
@RequestMapping(value = "/getWarehouseWiseBrandStock", method = RequestMethod.GET)
|
| 1568 |
public String getWarehouseWiseBrandStock(HttpServletRequest request, Model
|
1569 |
public String getWarehouseWiseBrandStock(HttpServletRequest request, Model
|
| 1569 |
model, @RequestParam List<Integer> warehouseId) throws Exception {
|
1570 |
model, @RequestParam List<Integer> warehouseId) throws Exception {
|
| 1570 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
1571 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 1571 |
String email = loginDetails.getEmailId();
|
1572 |
String email = loginDetails.getEmailId();
|
| - |
|
1573 |
AuthUser authUser = authRepository.selectByEmailOrMobile(email);
|
| - |
|
1574 |
List<Position> positions = positionRepository.selectAllByAuthUserId(authUser.getId());
|
| - |
|
1575 |
|
| - |
|
1576 |
boolean isRbmL3OrAbove = positions.stream().anyMatch(pos ->
|
| - |
|
1577 |
pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_RBM
|
| - |
|
1578 |
&& pos.getEscalationType() != null
|
| - |
|
1579 |
&& pos.getEscalationType() != EscalationType.L1
|
| - |
|
1580 |
&& pos.getEscalationType() != EscalationType.L2);
|
| - |
|
1581 |
|
| - |
|
1582 |
Set<Integer> fofoIds;
|
| - |
|
1583 |
if (isRbmL3OrAbove) {
|
| - |
|
1584 |
fofoIds = fofoStoreRepository.selectActiveStores().stream()
|
| - |
|
1585 |
.map(x -> x.getId()).collect(Collectors.toSet());
|
| - |
|
1586 |
} else {
|
| 1572 |
Set<Integer> authfofoIds = csService1.getAuthFofoIds(email, true);
|
1587 |
fofoIds = csService1.getAuthFofoIds(email, true);
|
| - |
|
1588 |
}
|
| - |
|
1589 |
|
| - |
|
1590 |
Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository
|
| 1573 |
Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository.selectActivePartnersByRetailerIds(new ArrayList<>(authfofoIds)).stream().collect(Collectors.groupingBy(
|
1591 |
.selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds)).stream()
|
| - |
|
1592 |
.collect(Collectors.groupingBy(FofoStore::getWarehouseId,
|
| 1574 |
FofoStore::getWarehouseId, Collectors.mapping(FofoStore::getId, Collectors.toList())));
|
1593 |
Collectors.mapping(FofoStore::getId, Collectors.toList())));
|
| 1575 |
|
1594 |
|
| 1576 |
if (!warehouseIdFofoIdMap.containsKey(7573)) {
|
1595 |
if (!warehouseIdFofoIdMap.containsKey(7573)) {
|
| 1577 |
warehouseIdFofoIdMap.put(7573, new ArrayList<>());
|
1596 |
warehouseIdFofoIdMap.put(7573, new ArrayList<>());
|
| 1578 |
}
|
1597 |
}
|
| 1579 |
if (!warehouseIdFofoIdMap.containsKey(7678)) {
|
1598 |
if (!warehouseIdFofoIdMap.containsKey(7678)) {
|