Subversion Repositories SmartDukaan

Rev

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

Rev 32990 Rev 33046
Line 1026... Line 1026...
1026
    @Autowired
1026
    @Autowired
1027
    InvoiceService invoiceService;
1027
    InvoiceService invoiceService;
1028
 
1028
 
1029
    public void test() throws Exception {
1029
    public void test() throws Exception {
1030
 
1030
 
1031
        invoiceService.createInvoices();
1031
        this.setInventoryItemIdToPriceDropImei();
1032
        //fofoSolr.populateTagItems();
1032
        //fofoSolr.populateTagItems();
1033
        //System.out.println(smartPingService.getAllAgentsByEmail());
1033
        //System.out.println(smartPingService.getAllAgentsByEmail());
1034
        //System.out.println(psiSmartService.getRegistrationEndPoint("9990381569"));
1034
        //System.out.println(psiSmartService.getRegistrationEndPoint("9990381569"));
1035
        //migrateValentine();
1035
        //migrateValentine();
1036
        //Map<Integer, List<Offer>> offerMap = offerRepository.selectAllPublishedMapByPartner(YearMonth.now());
1036
        //Map<Integer, List<Offer>> offerMap = offerRepository.selectAllPublishedMapByPartner(YearMonth.now());
Line 4180... Line 4180...
4180
 
4180
 
4181
        }
4181
        }
4182
 
4182
 
4183
    }
4183
    }
4184
 
4184
 
-
 
4185
    //
-
 
4186
    public void setInventoryItemIdToPriceDropImei() {
-
 
4187
        List<PriceDropIMEI> priceDropIMEIList = priceDropIMEIRepository.selectAllMissingInventoryItemIds();
-
 
4188
        LOGGER.info("Problems with - {} entries", priceDropIMEIList.size());
-
 
4189
        //priceDropIMEIList.stream().collect(C)
-
 
4190
        for (PriceDropIMEI priceDropIMEI : priceDropIMEIList) {
-
 
4191
            System.out.println(priceDropIMEI.getImei());
-
 
4192
            List<InventoryItem> inventoryItems = inventoryItemRepository.selectAllBySerialNumberFofoId(priceDropIMEI.getImei(), priceDropIMEI.getPartnerId());
-
 
4193
            if(inventoryItems.size() == 0) {
-
 
4194
                LOGGER.info("Could not find Grn - FofoID {} , Imei {} ", priceDropIMEI);
-
 
4195
            } else if(inventoryItems.size()>1) {
-
 
4196
                LOGGER.info("Found 2 such instance for - FofoID {} , Imei {} ", priceDropIMEI.getImei(), priceDropIMEI.getPartnerId());
-
 
4197
            } else {
-
 
4198
                priceDropIMEI.setInventoryItemId(inventoryItems.get(0).getId());
-
 
4199
            }
-
 
4200
 
-
 
4201
        }
-
 
4202
    }
-
 
4203
 
4185
    public void hygineAlertForInternalTeam() throws ProfitMandiBusinessException, MessagingException, IOException {
4204
    public void hygineAlertForInternalTeam() throws ProfitMandiBusinessException, MessagingException, IOException {
4186
 
4205
 
4187
        List<String> remarks = new ArrayList<>();
4206
        List<String> remarks = new ArrayList<>();
4188
        remarks.add("Out of Service");
4207
        remarks.add("Out of Service");
4189
        remarks.add("Duplicate number");
4208
        remarks.add("Duplicate number");