| Line 52... |
Line 52... |
| 52 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
52 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| 53 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
53 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| 54 |
import com.spice.profitmandi.dao.entity.fofo.SuggestedPo;
|
54 |
import com.spice.profitmandi.dao.entity.fofo.SuggestedPo;
|
| 55 |
import com.spice.profitmandi.dao.entity.fofo.SuggestedPoDetail;
|
55 |
import com.spice.profitmandi.dao.entity.fofo.SuggestedPoDetail;
|
| 56 |
import com.spice.profitmandi.dao.entity.inventory.SaholicCIS;
|
56 |
import com.spice.profitmandi.dao.entity.inventory.SaholicCIS;
|
| - |
|
57 |
import com.spice.profitmandi.dao.entity.inventory.SaholicPOItem;
|
| 57 |
import com.spice.profitmandi.dao.model.UserCart;
|
58 |
import com.spice.profitmandi.dao.model.UserCart;
|
| 58 |
import com.spice.profitmandi.dao.repository.catalog.CategoryRepository;
|
59 |
import com.spice.profitmandi.dao.repository.catalog.CategoryRepository;
|
| 59 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
60 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| 60 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
61 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
| 61 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
62 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| Line 617... |
Line 618... |
| 617 |
}
|
618 |
}
|
| 618 |
}
|
619 |
}
|
| 619 |
//get warehouse Id
|
620 |
//get warehouse Id
|
| 620 |
int warehouseId = fofoStoreRepository.selectByRetailerId(fofoId).getWarehouseId();
|
621 |
int warehouseId = fofoStoreRepository.selectByRetailerId(fofoId).getWarehouseId();
|
| 621 |
Map<Integer, SaholicCIS> itemAvailabilityMap = saholicInventoryService.getSaholicStock().get(warehouseId);
|
622 |
Map<Integer, SaholicCIS> itemAvailabilityMap = saholicInventoryService.getSaholicStock().get(warehouseId);
|
| - |
|
623 |
Map<Integer, SaholicPOItem> poItemAvailabilityMap = saholicInventoryService.getSaholicPOItems().get(warehouseId);
|
| 622 |
|
624 |
|
| 623 |
for (int i = 0; i < docs.length(); i++) {
|
625 |
for (int i = 0; i < docs.length(); i++) {
|
| 624 |
Map<Integer, FofoAvailabilityInfo> fofoAvailabilityInfoMap = new HashMap<>();
|
626 |
Map<Integer, FofoAvailabilityInfo> fofoAvailabilityInfoMap = new HashMap<>();
|
| 625 |
JSONObject doc = docs.getJSONObject(i);
|
627 |
JSONObject doc = docs.getJSONObject(i);
|
| 626 |
FofoCatalogResponse ffdr = new FofoCatalogResponse();
|
628 |
FofoCatalogResponse ffdr = new FofoCatalogResponse();
|
| Line 645... |
Line 647... |
| 645 |
fofoAvailabilityInfoMap.get(itemId).setMop((float) childItem.getDouble("mop_f"));
|
647 |
fofoAvailabilityInfoMap.get(itemId).setMop((float) childItem.getDouble("mop_f"));
|
| 646 |
}
|
648 |
}
|
| 647 |
} else {
|
649 |
} else {
|
| 648 |
FofoAvailabilityInfo fdi = new FofoAvailabilityInfo();
|
650 |
FofoAvailabilityInfo fdi = new FofoAvailabilityInfo();
|
| 649 |
SaholicCIS currentAvailability = itemAvailabilityMap.get(itemId);
|
651 |
SaholicCIS currentAvailability = itemAvailabilityMap.get(itemId);
|
| - |
|
652 |
SaholicPOItem poItemAvailability = poItemAvailabilityMap.get(itemId);
|
| - |
|
653 |
String poColor = "grey";
|
| 650 |
boolean active =false;
|
654 |
boolean active = false;
|
| 651 |
if(currentAvailability != null && currentAvailability.getNetavailability() > 0) {
|
655 |
if(currentAvailability != null && currentAvailability.getNetavailability() > 0) {
|
| 652 |
active = true;
|
656 |
poColor = "green";
|
| - |
|
657 |
} else if (poItemAvailability != null && poItemAvailability.getUnfulfilledQty() > 0) {
|
| - |
|
658 |
if(currentAvailability != null
|
| - |
|
659 |
&& poItemAvailability.getUnfulfilledQty() + currentAvailability.getNetavailability() <= 0) {
|
| - |
|
660 |
poColor = "red";
|
| - |
|
661 |
} else {
|
| - |
|
662 |
poColor = "orange";
|
| - |
|
663 |
}
|
| 653 |
}
|
664 |
}
|
| - |
|
665 |
fdi.setColorClass(poColor);
|
| 654 |
fdi.setSellingPrice(sellingPrice);
|
666 |
fdi.setSellingPrice(sellingPrice);
|
| 655 |
fdi.setActive(active);
|
667 |
fdi.setActive(active);
|
| 656 |
fdi.setMrp(childItem.getDouble("mrp_f"));
|
668 |
fdi.setMrp(childItem.getDouble("mrp_f"));
|
| 657 |
fdi.setMop((float) childItem.getDouble("mop_f"));
|
669 |
fdi.setMop((float) childItem.getDouble("mop_f"));
|
| 658 |
fdi.setColor(childItem.has("color_s") ? childItem.getString("color_s") : "");
|
670 |
fdi.setColor(childItem.has("color_s") ? childItem.getString("color_s") : "");
|