Subversion Repositories SmartDukaan

Rev

Rev 37640 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37640 Rev 37845
Line 1... Line 1...
1
package com.spice.profitmandi.dao.service.solr;
1
package com.spice.profitmandi.dao.service.solr;
2
 
2
 
-
 
3
import com.spice.profitmandi.service.warehouse.BillingWarehouseService;
-
 
4
 
3
import com.fasterxml.jackson.core.JsonProcessingException;
5
import com.fasterxml.jackson.core.JsonProcessingException;
4
import com.fasterxml.jackson.databind.ObjectMapper;
6
import com.fasterxml.jackson.databind.ObjectMapper;
5
import com.google.gson.Gson;
7
import com.google.gson.Gson;
6
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
8
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
7
import com.spice.profitmandi.common.model.ProfitMandiConstants;
9
import com.spice.profitmandi.common.model.ProfitMandiConstants;
Line 47... Line 49...
47
 
49
 
48
@Component
50
@Component
49
public class FofoSolr {
51
public class FofoSolr {
50
 
52
 
51
    @Autowired
53
    @Autowired
-
 
54
    private BillingWarehouseService billingWarehouseService;
-
 
55
 
-
 
56
 
-
 
57
    @Autowired
52
    private Gson gson;
58
    private Gson gson;
53
 
59
 
54
    @Autowired
60
    @Autowired
55
    private TagListingRepository tagListingRepository;
61
    private TagListingRepository tagListingRepository;
56
 
62
 
Line 550... Line 556...
550
                    catalogSolrObj.setField("show_default_b", false);
556
                    catalogSolrObj.setField("show_default_b", false);
551
                }
557
                }
552
            }
558
            }
553
            Map<Integer, Integer> avColorMap = (Map<Integer, Integer>) catalogValMap.get("avColor");
559
            Map<Integer, Integer> avColorMap = (Map<Integer, Integer>) catalogValMap.get("avColor");
554
 
560
 
555
            for (Integer warehouseId : ProfitMandiConstants.WAREHOUSE_MAP.keySet()) {
561
            for (Integer warehouseId : billingWarehouseService.getOperationalWarehouses().keySet()) {
556
                catalogSolrObj.setField("w" + warehouseId + "_i", 0);
562
                catalogSolrObj.setField("w" + warehouseId + "_i", 0);
557
            }
563
            }
558
            for (Entry<Integer, Integer> avColorEntry : avColorMap.entrySet()) {
564
            for (Entry<Integer, Integer> avColorEntry : avColorMap.entrySet()) {
559
                int whId = avColorEntry.getKey();
565
                int whId = avColorEntry.getKey();
560
                int color = avColorEntry.getValue();
566
                int color = avColorEntry.getValue();
Line 818... Line 824...
818
                catalogSolrObj.setField("show_default_b", false);
824
                catalogSolrObj.setField("show_default_b", false);
819
            }
825
            }
820
        }
826
        }
821
 
827
 
822
        // Warehouse availability
828
        // Warehouse availability
823
        for (Integer warehouseId : ProfitMandiConstants.WAREHOUSE_MAP.keySet()) {
829
        for (Integer warehouseId : billingWarehouseService.getOperationalWarehouses().keySet()) {
824
            catalogSolrObj.setField("w" + warehouseId + "_i", 0);
830
            catalogSolrObj.setField("w" + warehouseId + "_i", 0);
825
        }
831
        }
826
        for (Entry<Integer, Integer> avColorEntry : avColorMap.entrySet()) {
832
        for (Entry<Integer, Integer> avColorEntry : avColorMap.entrySet()) {
827
            int whId = avColorEntry.getKey();
833
            int whId = avColorEntry.getKey();
828
            int color = avColorEntry.getValue();
834
            int color = avColorEntry.getValue();