| Line 822... |
Line 822... |
| 822 |
positionIdsToUpdate.addAll(positionIdsToAddMap.keySet());
|
822 |
positionIdsToUpdate.addAll(positionIdsToAddMap.keySet());
|
| 823 |
positionIdsToUpdate.addAll(positionIdsToRemoveMap.keySet());
|
823 |
positionIdsToUpdate.addAll(positionIdsToRemoveMap.keySet());
|
| 824 |
|
824 |
|
| 825 |
Map<Integer, Position> positionsToUpdateMap = positionRepository.selectAll(positionIdsToUpdate).stream().collect(Collectors.toMap(x->x.getId(), x->x));
|
825 |
Map<Integer, Position> positionsToUpdateMap = positionRepository.selectAll(positionIdsToUpdate).stream().collect(Collectors.toMap(x->x.getId(), x->x));
|
| 826 |
List<Integer> invalidPositionIds = positionsToUpdateMap.values().stream().filter(x-> x.getCategoryId()!= ProfitMandiConstants.TICKET_CATEGORY_RBM
|
826 |
List<Integer> invalidPositionIds = positionsToUpdateMap.values().stream().filter(x-> x.getCategoryId()!= ProfitMandiConstants.TICKET_CATEGORY_RBM
|
| 827 |
&& x.getCategoryId()!= ProfitMandiConstants.TICKET_CATEGORY_SALES).map(x->x.getId()).collect(Collectors.toList());
|
827 |
&& x.getCategoryId() != ProfitMandiConstants.TICKET_CATEGORY_SALES && x.getCategoryId() != ProfitMandiConstants.TICKET_CATEGORY_ABM).map(x -> x.getId()).collect(Collectors.toList());
|
| 828 |
if(invalidPositionIds.size() > 0) {
|
828 |
if(invalidPositionIds.size() > 0) {
|
| 829 |
String message = "Non RBM/Sales are not allowed - " + invalidPositionIds;
|
829 |
String message = "Non RBM/Sales/ABM are not allowed - " + invalidPositionIds;
|
| 830 |
throw new ProfitMandiBusinessException(message, message, message);
|
830 |
throw new ProfitMandiBusinessException(message, message, message);
|
| 831 |
}
|
831 |
}
|
| 832 |
|
832 |
|
| 833 |
for (Map.Entry<Integer, List<String>> positionIdStoreMapEntry : positionIdsToAddMap.entrySet()) {
|
833 |
for (Map.Entry<Integer, List<String>> positionIdStoreMapEntry : positionIdsToAddMap.entrySet()) {
|
| 834 |
int positionId = positionIdStoreMapEntry.getKey();
|
834 |
int positionId = positionIdStoreMapEntry.getKey();
|