| Line 1720... |
Line 1720... |
| 1720 |
|
1720 |
|
| 1721 |
@RequestMapping(value = "/getWarehouseWiseBrandPartnerSale", method = RequestMethod.GET)
|
1721 |
@RequestMapping(value = "/getWarehouseWiseBrandPartnerSale", method = RequestMethod.GET)
|
| 1722 |
public String getWarehouseWiseBrandPartnerSale(HttpServletRequest request, Model model, @RequestParam String
|
1722 |
public String getWarehouseWiseBrandPartnerSale(HttpServletRequest request, Model model, @RequestParam String
|
| 1723 |
brand) throws Exception {
|
1723 |
brand) throws Exception {
|
| 1724 |
|
1724 |
|
| - |
|
1725 |
// Band-aid for URL '+' decode issue on brand names (e.g. "Ai+"):
|
| - |
|
1726 |
// if the incoming brand isn't found in catalog.brand but "<brand>+" is,
|
| - |
|
1727 |
// switch to the plus variant. Zero regression for the other brands.
|
| - |
|
1728 |
if (brand != null && !brand.trim().isEmpty()) {
|
| - |
|
1729 |
String probe = brand.replaceAll("\\s+$", "");
|
| - |
|
1730 |
try {
|
| - |
|
1731 |
if (brandsRepository.selectByBrand(brand) == null
|
| - |
|
1732 |
&& (probe.equals(brand) || brandsRepository.selectByBrand(probe) == null)) {
|
| - |
|
1733 |
String withPlus = probe + "+";
|
| - |
|
1734 |
if (brandsRepository.selectByBrand(withPlus) != null) {
|
| - |
|
1735 |
LOGGER.info("getWarehouseWiseBrandPartnerSale brand fallback: '{}' -> '{}'", brand, withPlus);
|
| - |
|
1736 |
brand = withPlus;
|
| - |
|
1737 |
}
|
| - |
|
1738 |
}
|
| - |
|
1739 |
} catch (Exception e) {
|
| - |
|
1740 |
LOGGER.warn("getWarehouseWiseBrandPartnerSale brand fallback failed for '{}': {}", brand, e.getMessage());
|
| - |
|
1741 |
}
|
| - |
|
1742 |
}
|
| - |
|
1743 |
|
| 1725 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
1744 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 1726 |
String email = loginDetails.getEmailId();
|
1745 |
String email = loginDetails.getEmailId();
|
| 1727 |
|
1746 |
|
| 1728 |
Set<Integer> authfofoIds = csService1.getAuthFofoIds(email, true);
|
1747 |
Set<Integer> authfofoIds = csService1.getAuthFofoIds(email, true);
|
| 1729 |
|
1748 |
|