| Line 9... |
Line 9... |
| 9 |
import com.spice.profitmandi.dao.entity.cs.Region;
|
9 |
import com.spice.profitmandi.dao.entity.cs.Region;
|
| 10 |
import com.spice.profitmandi.dao.entity.dtr.DocumentUrl;
|
10 |
import com.spice.profitmandi.dao.entity.dtr.DocumentUrl;
|
| 11 |
import com.spice.profitmandi.dao.entity.fofo.PrintResource;
|
11 |
import com.spice.profitmandi.dao.entity.fofo.PrintResource;
|
| 12 |
import com.spice.profitmandi.dao.entity.fofo.PrintResourceRegion;
|
12 |
import com.spice.profitmandi.dao.entity.fofo.PrintResourceRegion;
|
| 13 |
import com.spice.profitmandi.dao.entity.user.User;
|
13 |
import com.spice.profitmandi.dao.entity.user.User;
|
| - |
|
14 |
import com.spice.profitmandi.dao.enumuration.inventory.CatalogMovingEnum;
|
| 14 |
import com.spice.profitmandi.dao.model.*;
|
15 |
import com.spice.profitmandi.dao.model.*;
|
| 15 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
16 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| - |
|
17 |
import com.spice.profitmandi.dao.repository.catalog.CatalogRepository;
|
| 16 |
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
|
18 |
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
|
| 17 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
19 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| 18 |
import com.spice.profitmandi.dao.repository.catalog.SuperCatalogRepository;
|
20 |
import com.spice.profitmandi.dao.repository.catalog.SuperCatalogRepository;
|
| 19 |
import com.spice.profitmandi.dao.repository.cs.PartnerRegionRepository;
|
21 |
import com.spice.profitmandi.dao.repository.cs.PartnerRegionRepository;
|
| 20 |
import com.spice.profitmandi.dao.repository.cs.RegionRepository;
|
22 |
import com.spice.profitmandi.dao.repository.cs.RegionRepository;
|
| Line 37... |
Line 39... |
| 37 |
import org.json.JSONArray;
|
39 |
import org.json.JSONArray;
|
| 38 |
import org.json.JSONObject;
|
40 |
import org.json.JSONObject;
|
| 39 |
import org.springframework.beans.factory.annotation.Autowired;
|
41 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 40 |
import org.springframework.http.ResponseEntity;
|
42 |
import org.springframework.http.ResponseEntity;
|
| 41 |
import org.springframework.stereotype.Controller;
|
43 |
import org.springframework.stereotype.Controller;
|
| - |
|
44 |
import org.springframework.transaction.annotation.Transactional;
|
| 42 |
import org.springframework.ui.Model;
|
45 |
import org.springframework.ui.Model;
|
| 43 |
import org.springframework.web.bind.annotation.*;
|
46 |
import org.springframework.web.bind.annotation.*;
|
| 44 |
import org.springframework.web.multipart.MultipartFile;
|
47 |
import org.springframework.web.multipart.MultipartFile;
|
| 45 |
|
48 |
|
| 46 |
import javax.servlet.http.HttpServletRequest;
|
49 |
import javax.servlet.http.HttpServletRequest;
|
| 47 |
import org.springframework.transaction.annotation.Transactional;
|
- |
|
| 48 |
import javax.xml.bind.DatatypeConverter;
|
50 |
import javax.xml.bind.DatatypeConverter;
|
| 49 |
import java.io.*;
|
51 |
import java.io.*;
|
| 50 |
import java.sql.Timestamp;
|
52 |
import java.sql.Timestamp;
|
| 51 |
import java.time.LocalDate;
|
53 |
import java.time.LocalDate;
|
| 52 |
import java.time.LocalDateTime;
|
54 |
import java.time.LocalDateTime;
|
| Line 85... |
Line 87... |
| 85 |
PrintResourceRegionRepository printResourceRegionRepository;
|
87 |
PrintResourceRegionRepository printResourceRegionRepository;
|
| 86 |
@Autowired
|
88 |
@Autowired
|
| 87 |
PartnerRegionRepository partnerRegionRepository;
|
89 |
PartnerRegionRepository partnerRegionRepository;
|
| 88 |
@Autowired
|
90 |
@Autowired
|
| 89 |
SuperCatalogRepository superCatalogRepository;
|
91 |
SuperCatalogRepository superCatalogRepository;
|
| - |
|
92 |
@Autowired
|
| - |
|
93 |
CatalogRepository catalogRepository;
|
| 90 |
|
94 |
|
| 91 |
private Gson gson = new Gson();
|
95 |
private Gson gson = new Gson();
|
| 92 |
|
96 |
|
| 93 |
public static final int Entity_Id = 0;
|
97 |
public static final int Entity_Id = 0;
|
| 94 |
public static final int Title = 1;
|
98 |
public static final int Title = 1;
|
| Line 364... |
Line 368... |
| 364 |
JSONArray docA = solrService.getContentDocs(query, categoryId > 0 ? Arrays.asList(categoryId) : null, brands,
|
368 |
JSONArray docA = solrService.getContentDocs(query, categoryId > 0 ? Arrays.asList(categoryId) : null, brands,
|
| 365 |
limit, activeOnly);
|
369 |
limit, activeOnly);
|
| 366 |
|
370 |
|
| 367 |
Iterator<Object> jsonIterator = docA.iterator();
|
371 |
Iterator<Object> jsonIterator = docA.iterator();
|
| 368 |
while (jsonIterator.hasNext()) {
|
372 |
while (jsonIterator.hasNext()) {
|
| - |
|
373 |
JSONObject i = (JSONObject) jsonIterator.next();
|
| - |
|
374 |
|
| - |
|
375 |
if (!catalogIds.contains(i.get("catalogId_i"))) {
|
| - |
|
376 |
jsonIterator.remove();
|
| - |
|
377 |
}
|
| - |
|
378 |
|
| - |
|
379 |
}
|
| - |
|
380 |
|
| - |
|
381 |
model.addAttribute("response1", docA.toString());
|
| - |
|
382 |
|
| - |
|
383 |
return "response";
|
| - |
|
384 |
}
|
| - |
|
385 |
|
| - |
|
386 |
@GetMapping(value = "/statusWiseCatalogs")
|
| - |
|
387 |
public String statusWiseCatalogs(HttpServletRequest request, @RequestParam(defaultValue = "null") String query,
|
| - |
|
388 |
@RequestParam(defaultValue = "0") int categoryId, @RequestParam(defaultValue = "") List<String> brands,
|
| - |
|
389 |
@RequestParam(defaultValue = "30") int limit, @RequestParam(defaultValue = "true") boolean activeOnly,
|
| - |
|
390 |
Model model) throws Exception {
|
| - |
|
391 |
|
| - |
|
392 |
List<CatalogMovingEnum> catalogMovingEnums = Arrays.asList(CatalogMovingEnum.HID, CatalogMovingEnum.FASTMOVING, CatalogMovingEnum.RUNNING);
|
| - |
|
393 |
|
| - |
|
394 |
List<Integer> catalogIds = catalogRepository.selectAllStatusAndBrandWise(brands, catalogMovingEnums);
|
| - |
|
395 |
|
| - |
|
396 |
JSONArray docA = solrService.getContentDocs(query, categoryId > 0 ? Arrays.asList(categoryId) : null, brands,
|
| - |
|
397 |
limit, activeOnly);
|
| - |
|
398 |
|
| - |
|
399 |
Iterator<Object> jsonIterator = docA.iterator();
|
| - |
|
400 |
while (jsonIterator.hasNext()) {
|
| 369 |
JSONObject i = (JSONObject) jsonIterator.next();
|
401 |
JSONObject i = (JSONObject) jsonIterator.next();
|
| 370 |
|
402 |
|
| 371 |
if (!catalogIds.contains(i.get("catalogId_i"))) {
|
403 |
if (!catalogIds.contains(i.get("catalogId_i"))) {
|
| 372 |
jsonIterator.remove();
|
404 |
jsonIterator.remove();
|
| 373 |
}
|
405 |
}
|