Subversion Repositories SmartDukaan

Rev

Rev 34186 | Rev 34191 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 34186 Rev 34187
Line 786... Line 786...
786
    @Autowired
786
    @Autowired
787
    private SaholicCISTableRepository saholicCISTableRepository;
787
    private SaholicCISTableRepository saholicCISTableRepository;
788
 
788
 
789
    private List<FofoCatalogResponse> getCatalogResponse(JSONArray docs, boolean hotDeal, int fofoId) throws
789
    private List<FofoCatalogResponse> getCatalogResponse(JSONArray docs, boolean hotDeal, int fofoId) throws
790
            Exception {
790
            Exception {
-
 
791
        logger.info("getCatalogResponse docs start: {}",docs);
791
        List<FofoCatalogResponse> dealResponse = new ArrayList<>();
792
        List<FofoCatalogResponse> dealResponse = new ArrayList<>();
792
        List<Integer> tagIds = Arrays.asList(4);
793
        List<Integer> tagIds = Arrays.asList(4);
793
        List<Integer> itemIds = new ArrayList<>();
794
        List<Integer> itemIds = new ArrayList<>();
794
        if (docs.length() > 0) {
795
        if (docs.length() > 0) {
795
            for (int i = 0; i < docs.length(); i++) {
796
            for (int i = 0; i < docs.length(); i++) {
796
                JSONObject doc = docs.getJSONObject(i);
797
                JSONObject doc = docs.getJSONObject(i);
-
 
798
                logger.info("getCatalogResponse doc 1: {}",doc);
797
                if (doc.has("_childDocuments_")) {
799
                if (doc.has("_childDocuments_")) {
798
                    for (int j = 0; j < doc.getJSONArray("_childDocuments_").length(); j++) {
800
                    for (int j = 0; j < doc.getJSONArray("_childDocuments_").length(); j++) {
799
                        JSONObject childItem = doc.getJSONArray("_childDocuments_").getJSONObject(j);
801
                        JSONObject childItem = doc.getJSONArray("_childDocuments_").getJSONObject(j);
-
 
802
                        logger.info("childItem doc 1: {}",childItem);
800
                        int itemId = childItem.getInt("itemId_i");
803
                        int itemId = childItem.getInt("itemId_i");
801
                        itemIds.add(itemId);
804
                        itemIds.add(itemId);
802
                    }
805
                    }
803
                }
806
                }
804
            }
807
            }
805
            if (itemIds.size() == 0) {
808
            if (itemIds.size() == 0) {
-
 
809
                logger.info("itemIds.size doc: {}",itemIds.size());
806
                return dealResponse;
810
                return dealResponse;
807
            }
811
            }
808
        }
812
        }
809
        // get warehouse Id
813
        // get warehouse Id
810
        int warehouseId = fofoStoreRepository.selectByRetailerId(fofoId).getWarehouseId();
814
        int warehouseId = fofoStoreRepository.selectByRetailerId(fofoId).getWarehouseId();