Subversion Repositories SmartDukaan

Rev

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

Rev 2027 Rev 2066
Line 161... Line 161...
161
                thriftItem.getUpdatedOn(),
161
                thriftItem.getUpdatedOn(),
162
                thriftItem.getItemStatus().name(),
162
                thriftItem.getItemStatus().name(),
163
                thriftItem.getOtherInfo(),
163
                thriftItem.getOtherInfo(),
164
                thriftItem.getBestDealText(),
164
                thriftItem.getBestDealText(),
165
                thriftItem.getBestDealValue(),
165
                thriftItem.getBestDealValue(),
-
 
166
                thriftItem.getBestSellingRank(),
-
 
167
                thriftItem.isDefaultForEntity(),
166
                (thriftItem.getItemInventory() != null ? thriftItem.getItemInventory().getAvailability() : null),
168
                (thriftItem.getItemInventory() != null ? thriftItem.getItemInventory().getAvailability() : null),
167
                vendorPricings
169
                vendorPricings
168
                );
170
                );
169
        return item;
171
        return item;
170
    }
172
    }
Line 193... Line 195...
193
            tItem.setDealerPrice(item.getDealerPrice());
195
            tItem.setDealerPrice(item.getDealerPrice());
194
            tItem.setTransferPrice(item.getTransferPrice());
196
            tItem.setTransferPrice(item.getTransferPrice());
195
 
197
 
196
            tItem.setBestDealText(item.getBestDealsText());
198
            tItem.setBestDealText(item.getBestDealsText());
197
            tItem.setBestDealValue(item.getBestDealsValue());
199
            tItem.setBestDealValue(item.getBestDealsValue());
-
 
200
            tItem.setBestSellingRank(item.getBestSellingRank());
-
 
201
            tItem.setDefaultForEntity(item.isDefaultForEntity());
198
            
202
            
199
//          tItem.setAddedOn(item.getAddedOn());
203
//          tItem.setAddedOn(item.getAddedOn());
200
            
204
            
201
//          tItem.setCatalogItemId(item.getCatalogItemId());
205
//          tItem.setCatalogItemId(item.getCatalogItemId());
202
//          tItem.setCategory(item.getCategory());
206
//          tItem.setCategory(item.getCategory());
203
            
-
 
204
            
-
 
205
             
207
             
206
//          tItem.setFeatureId(item.getFeatureId());
208
//          tItem.setFeatureId(item.getFeatureId());
207
//          tItem.setFeatureDescription(item.getFeatureDescription());
209
//          tItem.setFeatureDescription(item.getFeatureDescription());
208
            
210
            
-
 
211
            /*List<VendorItemPricing> tVendorPrices = tItem.getVendorPrices();
-
 
212
            if(tVendorPrices == null) {
-
 
213
                tVendorPrices = new ArrayList<VendorItemPricing>();
-
 
214
            }
-
 
215
            for(Entry<Long, double[]> vendorItemPricing : item.getVendorPricings().entrySet()) {
-
 
216
                VendorItemPricing vip = null;
-
 
217
                for(VendorItemPricing v : tVendorPrices) {
-
 
218
                    if(v.getVendorId() == vendorItemPricing.getKey()) {
-
 
219
                        vip = v;
-
 
220
                        break;
-
 
221
                    }
-
 
222
                }
-
 
223
                if(vip == null) {
-
 
224
                    vip = new VendorItemPricing();
-
 
225
                    tVendorPrices.add(vip);
-
 
226
                }
-
 
227
                vip.setItemId(item.getId());
-
 
228
                vip.setVendorId(vendorItemPricing.getKey());
-
 
229
                vip.setMop(vendorItemPricing.getValue()[Item.INDEX_MOP]);
-
 
230
                vip.setDealerPrice(vendorItemPricing.getValue()[Item.INDEX_DP]);
-
 
231
                vip.setTransferPrice(vendorItemPricing.getValue()[Item.INDEX_TP]);
-
 
232
                //catalogClient.updateVendorItemPricing(vip);
-
 
233
            }*/
-
 
234
            
209
            VendorItemPricing vip = new VendorItemPricing();
235
            VendorItemPricing vip = new VendorItemPricing();
210
            for(Entry<Long, double[]> vendorItemPricing : item.getVendorPricings().entrySet()) {
236
            for(Entry<Long, double[]> vendorItemPricing : item.getVendorPricings().entrySet()) {
211
                vip.setItemId(item.getId());
237
                vip.setItemId(item.getId());
212
                vip.setVendorId(vendorItemPricing.getKey());
238
                vip.setVendorId(vendorItemPricing.getKey());
213
                vip.setMop(vendorItemPricing.getValue()[Item.INDEX_MOP]);
239
                vip.setMop(vendorItemPricing.getValue()[Item.INDEX_MOP]);
Line 222... Line 248...
222
        }catch(Exception e){
248
        }catch(Exception e){
223
            e.printStackTrace();
249
            e.printStackTrace();
224
        }
250
        }
225
        return false;
251
        return false;
226
    }
252
    }
-
 
253
    
-
 
254
    
-
 
255
    @Override
-
 
256
    public Map<Long, String> getAllVendors() {
-
 
257
        Map<Long, String> vendorMap = new HashMap<Long, String>();
-
 
258
        try {
-
 
259
            CatalogServiceClient catalogServiceClient = new CatalogServiceClient();
-
 
260
            InventoryService.Client catalogClient = catalogServiceClient.getClient();
-
 
261
            
-
 
262
            List<in.shop2020.model.v1.catalog.Vendor> vendors = catalogClient.getAllVendors();
-
 
263
            
-
 
264
            for(in.shop2020.model.v1.catalog.Vendor v : vendors) {
-
 
265
                vendorMap.put(v.getId(), v.getName());
-
 
266
            }
-
 
267
        } catch (Exception e) {
-
 
268
            e.printStackTrace();
-
 
269
        }
-
 
270
        return vendorMap;
-
 
271
    }
-
 
272
 
-
 
273
    @Override
-
 
274
    public Map<Long, String> getAllWarehouses() {
-
 
275
        Map<Long, String> warehouseMap = new HashMap<Long, String>();
-
 
276
        try {
-
 
277
            CatalogServiceClient catalogServiceClient = new CatalogServiceClient();
-
 
278
            InventoryService.Client catalogClient = catalogServiceClient.getClient();
-
 
279
            
-
 
280
            List<in.shop2020.model.v1.catalog.Warehouse> warehouses = catalogClient.getAllWarehouses(true);
-
 
281
            
-
 
282
            for(in.shop2020.model.v1.catalog.Warehouse w : warehouses) {
-
 
283
                warehouseMap.put(w.getId(), w.getDisplayName());
-
 
284
            }
-
 
285
        } catch (Exception e) {
-
 
286
            e.printStackTrace();
-
 
287
        }
-
 
288
        return warehouseMap;
-
 
289
    }
227
}
290
}