| Line 37... |
Line 37... |
| 37 |
import com.google.gson.Gson;
|
37 |
import com.google.gson.Gson;
|
| 38 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
38 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 39 |
import com.spice.profitmandi.common.model.CartFofo;
|
39 |
import com.spice.profitmandi.common.model.CartFofo;
|
| 40 |
import com.spice.profitmandi.common.model.CustomCurrentInventorySnapshot;
|
40 |
import com.spice.profitmandi.common.model.CustomCurrentInventorySnapshot;
|
| 41 |
import com.spice.profitmandi.common.model.InventoryItemAgingModel;
|
41 |
import com.spice.profitmandi.common.model.InventoryItemAgingModel;
|
| - |
|
42 |
import com.spice.profitmandi.common.model.MopPriceModel;
|
| 42 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
43 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 43 |
import com.spice.profitmandi.common.util.ExcelUtils;
|
44 |
import com.spice.profitmandi.common.util.ExcelUtils;
|
| 44 |
import com.spice.profitmandi.common.util.StringUtils;
|
45 |
import com.spice.profitmandi.common.util.StringUtils;
|
| 45 |
import com.spice.profitmandi.common.util.Utils;
|
46 |
import com.spice.profitmandi.common.util.Utils;
|
| 46 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
47 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| Line 172... |
Line 173... |
| 172 |
long countItems = currentInventorySnapshotRepository.getCurrentInventorySnapshotCount(fofoDetails.getFofoId(), searchTerm);
|
173 |
long countItems = currentInventorySnapshotRepository.getCurrentInventorySnapshotCount(fofoDetails.getFofoId(), searchTerm);
|
| 173 |
Set<Integer> itemIds = new HashSet<>();
|
174 |
Set<Integer> itemIds = new HashSet<>();
|
| 174 |
for(CurrentInventorySnapshot currentInventorySnapshot : currentInventorySnapshots ){
|
175 |
for(CurrentInventorySnapshot currentInventorySnapshot : currentInventorySnapshots ){
|
| 175 |
itemIds.add(currentInventorySnapshot.getId().getItemId());
|
176 |
itemIds.add(currentInventorySnapshot.getId().getItemId());
|
| 176 |
}
|
177 |
}
|
| 177 |
Map<Integer, Float> mopPriceMap = pricingService.getPurchasePriceMopPriceNotFound(itemIds, fofoDetails.getFofoId());
|
178 |
Map<Integer, MopPriceModel> mopPriceMap = pricingService.getPurchasePriceMopPriceNotFound(itemIds, fofoDetails.getFofoId());
|
| 178 |
List<InventoryItem> inventoryItems = inventoryItemRepository.selectByFofoIdItemIds(fofoDetails.getFofoId(), itemIds);
|
179 |
List<InventoryItem> inventoryItems = inventoryItemRepository.selectByFofoIdItemIds(fofoDetails.getFofoId(), itemIds);
|
| 179 |
Map<Integer, Set<String>> itemIdSerialNumbers = new HashMap<>();
|
180 |
Map<Integer, Set<String>> itemIdSerialNumbers = new HashMap<>();
|
| 180 |
for(InventoryItem inventoryItem : inventoryItems){
|
181 |
for(InventoryItem inventoryItem : inventoryItems){
|
| 181 |
if(inventoryItem.getSerialNumber() != null && !inventoryItem.getSerialNumber().isEmpty()){
|
182 |
if(inventoryItem.getSerialNumber() != null && !inventoryItem.getSerialNumber().isEmpty()){
|
| 182 |
if(!itemIdSerialNumbers.containsKey(inventoryItem.getItemId())){
|
183 |
if(!itemIdSerialNumbers.containsKey(inventoryItem.getItemId())){
|
| Line 217... |
Line 218... |
| 217 |
List<CurrentInventorySnapshot> currentInventorySnapshots = currentInventorySnapshotRepository.getCurrentInventorySnapshot(fofoDetails.getFofoId(), offset, limit, searchTerm);
|
218 |
List<CurrentInventorySnapshot> currentInventorySnapshots = currentInventorySnapshotRepository.getCurrentInventorySnapshot(fofoDetails.getFofoId(), offset, limit, searchTerm);
|
| 218 |
Set<Integer> itemIds = new HashSet<>();
|
219 |
Set<Integer> itemIds = new HashSet<>();
|
| 219 |
for(CurrentInventorySnapshot currentInventorySnapshot : currentInventorySnapshots ){
|
220 |
for(CurrentInventorySnapshot currentInventorySnapshot : currentInventorySnapshots ){
|
| 220 |
itemIds.add(currentInventorySnapshot.getId().getItemId());
|
221 |
itemIds.add(currentInventorySnapshot.getId().getItemId());
|
| 221 |
}
|
222 |
}
|
| 222 |
Map<Integer, Float> mopPriceMap = pricingService.getPurchasePriceMopPriceNotFound(itemIds, fofoDetails.getFofoId());
|
223 |
Map<Integer, MopPriceModel> mopPriceMap = pricingService.getPurchasePriceMopPriceNotFound(itemIds, fofoDetails.getFofoId());
|
| 223 |
model.addAttribute("currentInventorySnapshot",currentInventorySnapshots);
|
224 |
model.addAttribute("currentInventorySnapshot",currentInventorySnapshots);
|
| 224 |
model.addAttribute("mopPriceMap", mopPriceMap);
|
225 |
model.addAttribute("mopPriceMap", mopPriceMap);
|
| 225 |
return "catalog-paginated";
|
226 |
return "catalog-paginated";
|
| 226 |
}
|
227 |
}
|
| 227 |
|
228 |
|