| Line 4... |
Line 4... |
| 4 |
import com.jcraft.jsch.*;
|
4 |
import com.jcraft.jsch.*;
|
| 5 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
5 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 6 |
import com.spice.profitmandi.common.solr.SolrService;
|
6 |
import com.spice.profitmandi.common.solr.SolrService;
|
| 7 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
7 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 8 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
8 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| - |
|
9 |
import com.spice.profitmandi.dao.entity.catalog.MonitorType;
|
| 9 |
import com.spice.profitmandi.dao.entity.cs.Bulletin;
|
10 |
import com.spice.profitmandi.dao.entity.cs.Bulletin;
|
| 10 |
import com.spice.profitmandi.dao.entity.cs.PartnerRegion;
|
11 |
import com.spice.profitmandi.dao.entity.cs.PartnerRegion;
|
| 11 |
import com.spice.profitmandi.dao.entity.cs.Region;
|
12 |
import com.spice.profitmandi.dao.entity.cs.Region;
|
| 12 |
import com.spice.profitmandi.dao.entity.dtr.DocumentUrl;
|
13 |
import com.spice.profitmandi.dao.entity.dtr.DocumentUrl;
|
| 13 |
import com.spice.profitmandi.dao.entity.fofo.PrintResource;
|
14 |
import com.spice.profitmandi.dao.entity.fofo.PrintResource;
|
| 14 |
import com.spice.profitmandi.dao.entity.fofo.PrintResourceRegion;
|
15 |
import com.spice.profitmandi.dao.entity.fofo.PrintResourceRegion;
|
| 15 |
import com.spice.profitmandi.dao.entity.user.User;
|
16 |
import com.spice.profitmandi.dao.entity.user.User;
|
| 16 |
import com.spice.profitmandi.dao.enumuration.inventory.CatalogMovingEnum;
|
17 |
import com.spice.profitmandi.dao.enumuration.inventory.CatalogMovingEnum;
|
| 17 |
import com.spice.profitmandi.dao.model.*;
|
18 |
import com.spice.profitmandi.dao.model.*;
|
| 18 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
19 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| - |
|
20 |
import com.spice.profitmandi.dao.repository.catalog.CatalogMonitorTypeRepository;
|
| 19 |
import com.spice.profitmandi.dao.repository.catalog.CatalogRepository;
|
21 |
import com.spice.profitmandi.dao.repository.catalog.CatalogRepository;
|
| 20 |
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
|
22 |
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
|
| 21 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
23 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| 22 |
import com.spice.profitmandi.dao.repository.catalog.SuperCatalogRepository;
|
24 |
import com.spice.profitmandi.dao.repository.catalog.SuperCatalogRepository;
|
| 23 |
import com.spice.profitmandi.dao.repository.cs.BulletinRepository;
|
25 |
import com.spice.profitmandi.dao.repository.cs.BulletinRepository;
|
| Line 93... |
Line 95... |
| 93 |
@Autowired
|
95 |
@Autowired
|
| 94 |
SuperCatalogRepository superCatalogRepository;
|
96 |
SuperCatalogRepository superCatalogRepository;
|
| 95 |
@Autowired
|
97 |
@Autowired
|
| 96 |
CatalogRepository catalogRepository;
|
98 |
CatalogRepository catalogRepository;
|
| 97 |
@Autowired
|
99 |
@Autowired
|
| - |
|
100 |
CatalogMonitorTypeRepository catalogMonitorTypeRepository;
|
| - |
|
101 |
@Autowired
|
| 98 |
BulletinRepository bulletinRepository;
|
102 |
BulletinRepository bulletinRepository;
|
| 99 |
private Gson gson = new Gson();
|
103 |
private Gson gson = new Gson();
|
| 100 |
|
104 |
|
| 101 |
public static final int Entity_Id = 0;
|
105 |
public static final int Entity_Id = 0;
|
| 102 |
public static final int Title = 1;
|
106 |
public static final int Title = 1;
|
| Line 401... |
Line 405... |
| 401 |
List<Integer> catalogIds = catalogRepository.selectAllStatusAndBrandWise(brands, catalogMovingEnums);
|
405 |
List<Integer> catalogIds = catalogRepository.selectAllStatusAndBrandWise(brands, catalogMovingEnums);
|
| 402 |
|
406 |
|
| 403 |
JSONArray docA = solrService.getContentDocs(query, categoryId > 0 ? Arrays.asList(categoryId) : null, brands,
|
407 |
JSONArray docA = solrService.getContentDocs(query, categoryId > 0 ? Arrays.asList(categoryId) : null, brands,
|
| 404 |
limit, activeOnly);
|
408 |
limit, activeOnly);
|
| 405 |
|
409 |
|
| - |
|
410 |
Map<Integer, MonitorType> monitorTypeByCatalogId = catalogMonitorTypeRepository.selectAllAsMap();
|
| - |
|
411 |
|
| 406 |
Iterator<Object> jsonIterator = docA.iterator();
|
412 |
Iterator<Object> jsonIterator = docA.iterator();
|
| 407 |
while (jsonIterator.hasNext()) {
|
413 |
while (jsonIterator.hasNext()) {
|
| 408 |
JSONObject i = (JSONObject) jsonIterator.next();
|
414 |
JSONObject i = (JSONObject) jsonIterator.next();
|
| 409 |
|
415 |
|
| - |
|
416 |
Object cidObj = i.get("catalogId_i");
|
| 410 |
if (!catalogIds.contains(i.get("catalogId_i"))) {
|
417 |
if (!catalogIds.contains(cidObj)) {
|
| 411 |
jsonIterator.remove();
|
418 |
jsonIterator.remove();
|
| - |
|
419 |
continue;
|
| 412 |
}
|
420 |
}
|
| 413 |
|
421 |
|
| - |
|
422 |
if (cidObj instanceof Number) {
|
| - |
|
423 |
MonitorType mt = monitorTypeByCatalogId.get(((Number) cidObj).intValue());
|
| - |
|
424 |
if (mt != null) i.put("monitor_type", mt.dbValue());
|
| - |
|
425 |
}
|
| 414 |
}
|
426 |
}
|
| 415 |
|
427 |
|
| 416 |
model.addAttribute("response1", docA.toString());
|
428 |
model.addAttribute("response1", docA.toString());
|
| 417 |
|
429 |
|
| 418 |
return "response";
|
430 |
return "response";
|