Subversion Repositories SmartDukaan

Rev

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

Rev 33817 Rev 33820
Line 1048... Line 1048...
1048
    GstProService gstProService;
1048
    GstProService gstProService;
1049
 
1049
 
1050
    @Autowired
1050
    @Autowired
1051
    WarehouseProviderRepository warehouseProviderRepository;
1051
    WarehouseProviderRepository warehouseProviderRepository;
1052
    public void test() throws Exception {
1052
    public void test() throws Exception {
-
 
1053
        //this.checkfocusedModelInPartnerStock();
1053
        List<SDCreditRequirement> sdCreditRequirements = sdCreditRequirementRepository.selectAll();
1054
        List<SDCreditRequirement> sdCreditRequirements = sdCreditRequirementRepository.selectAll();
1054
        /*for (SDCreditRequirement sdCreditRequirement : sdCreditRequirements) {
1055
        /*for (SDCreditRequirement sdCreditRequirement : sdCreditRequirements) {
1055
            long utilizationAmount = sdCreditService.getUtilizationAmount(sdCreditRequirement.getFofoId());
1056
            long utilizationAmount = sdCreditService.getUtilizationAmount(sdCreditRequirement.getFofoId());
1056
            if (Math.abs(sdCreditRequirement.getUtilizedAmount().doubleValue() - utilizationAmount) > 5) {
1057
            if (Math.abs(sdCreditRequirement.getUtilizedAmount().doubleValue() - utilizationAmount) > 5) {
1057
                sdCreditRequirement.setUtilizedAmount(BigDecimal.valueOf(utilizationAmount));
1058
                sdCreditRequirement.setUtilizedAmount(BigDecimal.valueOf(utilizationAmount));
Line 1081... Line 1082...
1081
        //List<Loan> loans = loanRepository.selectAllLoan();
1082
        //List<Loan> loans = loanRepository.selectAllLoan();
1082
 
1083
 
1083
        /*System.out.println(ageingService.getAllAgeingForWarehouseBilling(8718, Arrays.asList(34354)));
1084
        /*System.out.println(ageingService.getAllAgeingForWarehouseBilling(8718, Arrays.asList(34354)));
1084
        System.out.println(ageingService.getAllAgeingForWarehouseBilling(8646, Arrays.asList(36323)));
1085
        System.out.println(ageingService.getAllAgeingForWarehouseBilling(8646, Arrays.asList(36323)));
1085
        System.out.println(ageingService.getAllAgeingForWarehouseBilling(8954, Arrays.asList(34358)));*/
1086
        System.out.println(ageingService.getAllAgeingForWarehouseBilling(8954, Arrays.asList(34358)));*/
1086
        System.out.println(ageingService.getAgeingForWarehouseBilling(8718, Arrays.asList(new ItemIdQuantity(34354,10))));
1087
        //System.out.println(ageingService.getAgeingForWarehouseBilling(8718, Arrays.asList(new ItemIdQuantity(34354,10))));
1087
    }
1088
    }
1088
 
1089
 
1089
    public void test4() throws Exception {
1090
    public void test4() throws Exception {
1090
        List<Integer> offerIds = Arrays.asList(2882, 2881, 2880, 2879, 2878, 2877, 2876, 2875, 2874, 2873, 2872, 2871, 2870, 2869, 2868, 2867, 2866, 2865, 2864, 2863, 2862, 2861, 2860, 2859, 2858, 2857, 2856, 2855, 2854, 2853, 2852, 2851, 2850, 2849, 2847, 2846, 2845, 2844, 2843, 2842, 2841, 2840, 2839, 2838, 2837, 2836, 2835, 2834, 2833, 2832, 2831, 2830, 2829, 2828, 2827, 2826, 2825, 2824, 2823, 2822, 2821, 2820, 2819, 2818, 2817, 2816, 2815, 2814, 2813, 2812, 2811, 2810, 2809, 2808, 2807, 2806, 2805, 2804, 2803, 2802, 2801, 2800, 2799, 2798, 2797, 2796, 2795, 2794, 2793, 2792, 2791, 2790, 2789, 2788, 2787, 2786, 2785, 2784, 2783, 2782, 2781, 2780, 2777, 2776, 2775, 2774, 2773, 2772, 2771, 2770, 2769, 2768, 2767, 2766, 2765, 2764, 2763, 2762, 2761, 2760, 2759, 2758, 2757, 2756, 2755, 2754, 2753, 2752, 2751, 2750, 2749, 2748, 2747, 2746, 2745, 2744, 2723, 2722, 2721, 2720, 2719, 2718, 2717, 2716, 2715, 2714, 2713, 2712, 2711, 2710, 2709, 2708, 2707, 2706, 2705, 2704, 2703, 2702, 2701, 2700, 2699, 2698, 2697, 2696, 2695, 2694, 2693, 2692, 2691, 2690, 2494, 2493, 2492, 2491, 2490, 2489, 2488, 2487, 2486, 2485, 2484, 2483, 2482, 2481, 2480, 2479, 2478, 2477, 2476, 2475, 2474, 2473, 2472, 2471, 2470, 2469, 2466, 2465, 2464, 2463, 2462, 2461, 2460, 2459, 2458, 2457, 2456, 2455, 2454, 2453, 2452, 2451, 2450, 2449, 2448, 2447, 2446, 2445, 2444, 2443, 2442, 2441, 2440, 2439, 2407, 2406, 2405, 2404, 2403, 2402, 2401, 2400, 2399, 2398, 2397, 2396, 2395, 2394, 2393, 2392, 2391, 2390, 2389, 2388, 2387, 2386, 2385, 2384, 2383, 2382, 2381, 2117, 2116, 2115, 2114, 2113, 2112, 2111, 2110, 2109, 2108, 2107, 2106, 2105, 2104, 2103, 2102, 2101, 2100, 2099, 2098, 2077);
1091
        List<Integer> offerIds = Arrays.asList(2882, 2881, 2880, 2879, 2878, 2877, 2876, 2875, 2874, 2873, 2872, 2871, 2870, 2869, 2868, 2867, 2866, 2865, 2864, 2863, 2862, 2861, 2860, 2859, 2858, 2857, 2856, 2855, 2854, 2853, 2852, 2851, 2850, 2849, 2847, 2846, 2845, 2844, 2843, 2842, 2841, 2840, 2839, 2838, 2837, 2836, 2835, 2834, 2833, 2832, 2831, 2830, 2829, 2828, 2827, 2826, 2825, 2824, 2823, 2822, 2821, 2820, 2819, 2818, 2817, 2816, 2815, 2814, 2813, 2812, 2811, 2810, 2809, 2808, 2807, 2806, 2805, 2804, 2803, 2802, 2801, 2800, 2799, 2798, 2797, 2796, 2795, 2794, 2793, 2792, 2791, 2790, 2789, 2788, 2787, 2786, 2785, 2784, 2783, 2782, 2781, 2780, 2777, 2776, 2775, 2774, 2773, 2772, 2771, 2770, 2769, 2768, 2767, 2766, 2765, 2764, 2763, 2762, 2761, 2760, 2759, 2758, 2757, 2756, 2755, 2754, 2753, 2752, 2751, 2750, 2749, 2748, 2747, 2746, 2745, 2744, 2723, 2722, 2721, 2720, 2719, 2718, 2717, 2716, 2715, 2714, 2713, 2712, 2711, 2710, 2709, 2708, 2707, 2706, 2705, 2704, 2703, 2702, 2701, 2700, 2699, 2698, 2697, 2696, 2695, 2694, 2693, 2692, 2691, 2690, 2494, 2493, 2492, 2491, 2490, 2489, 2488, 2487, 2486, 2485, 2484, 2483, 2482, 2481, 2480, 2479, 2478, 2477, 2476, 2475, 2474, 2473, 2472, 2471, 2470, 2469, 2466, 2465, 2464, 2463, 2462, 2461, 2460, 2459, 2458, 2457, 2456, 2455, 2454, 2453, 2452, 2451, 2450, 2449, 2448, 2447, 2446, 2445, 2444, 2443, 2442, 2441, 2440, 2439, 2407, 2406, 2405, 2404, 2403, 2402, 2401, 2400, 2399, 2398, 2397, 2396, 2395, 2394, 2393, 2392, 2391, 2390, 2389, 2388, 2387, 2386, 2385, 2384, 2383, 2382, 2381, 2117, 2116, 2115, 2114, 2113, 2112, 2111, 2110, 2109, 2108, 2107, 2106, 2105, 2104, 2103, 2102, 2101, 2100, 2099, 2098, 2077);
1091
        for (Integer offerId : offerIds) {
1092
        for (Integer offerId : offerIds) {
Line 1799... Line 1800...
1799
        }
1800
        }
1800
 
1801
 
1801
    }
1802
    }
1802
 
1803
 
1803
    public void sendAgeingReport() throws Exception {
1804
    public void sendAgeingReport() throws Exception {
1804
        sendAgeingReport("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com", "niranjan.kala@smartdukaan.com", "manish.gupta@smartdukaan.com", "kuldeep.kumar@smartdukaan.com");
1805
        sendAgeingReport("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com", "niranjan.kala@smartdukaan.com", "kuldeep.kumar@smartdukaan.com");
1805
    }
1806
    }
1806
 
1807
 
1807
    public void moveImeisToPriceDropImeis() throws Exception {
1808
    public void moveImeisToPriceDropImeis() throws Exception {
1808
        List<PriceDrop> priceDrops = priceDropRepository.selectAll();
1809
        List<PriceDrop> priceDrops = priceDropRepository.selectAll();
1809
        for (PriceDrop priceDrop : priceDrops) {
1810
        for (PriceDrop priceDrop : priceDrops) {
Line 2807... Line 2808...
2807
                    if (poItemAvailability != null) {
2808
                    if (poItemAvailability != null) {
2808
                        allColorPoAvailability += poItemAvailability.stream().collect(Collectors.summingInt(SaholicPOItem::getUnfulfilledQty));
2809
                        allColorPoAvailability += poItemAvailability.stream().collect(Collectors.summingInt(SaholicPOItem::getUnfulfilledQty));
2809
                    }
2810
                    }
2810
 
2811
 
2811
                }
2812
                }
2812
 
-
 
-
 
2813
                LOGGER.info("partnerIdSalesHeadersMap {}",partnerIdSalesHeadersMap);
2813
                FocusedModelShortageModel fm = new FocusedModelShortageModel();
2814
                FocusedModelShortageModel fm = new FocusedModelShortageModel();
2814
                fm.setFofoId(fofoId);
2815
                fm.setFofoId(fofoId);
2815
                fm.setStoreCode(fofoStore.getCode());
2816
                fm.setStoreCode(fofoStore.getCode());
2816
                fm.setStoreName(customRetailer.getBusinessName());
2817
                fm.setStoreName(customRetailer.getBusinessName());
2817
                fm.setBrandName(items.get(0).getBrand());
2818
                fm.setBrandName(items.get(0).getBrand());
Line 2821... Line 2822...
2821
                fm.setPendingIndentQty(processingQty);
2822
                fm.setPendingIndentQty(processingQty);
2822
                fm.setShortageQty(shortageQty);
2823
                fm.setShortageQty(shortageQty);
2823
                fm.setPoAvailability(allColorPoAvailability);
2824
                fm.setPoAvailability(allColorPoAvailability);
2824
                fm.setDp(tagListing.getSellingPrice());
2825
                fm.setDp(tagListing.getSellingPrice());
2825
                fm.setWarehouseName(warehouseMap.get(customRetailer.getWarehouseId()));
2826
                fm.setWarehouseName(warehouseMap.get(customRetailer.getWarehouseId()));
-
 
2827
                if(partnerIdSalesHeadersMap.get(fofoId) != null){
2826
                fm.setStateManager(partnerIdSalesHeadersMap.get(fofoId).getRegionalManager());
2828
                    fm.setStateManager(partnerIdSalesHeadersMap.get(fofoId).getRegionalManager());
2827
                fm.setTerritoryManager(partnerIdSalesHeadersMap.get(fofoId).getTerritoryManager());
2829
                    fm.setTerritoryManager(partnerIdSalesHeadersMap.get(fofoId).getTerritoryManager());
-
 
2830
                }else {
-
 
2831
                    LOGGER.info("fofoId - {}",fofoId);
-
 
2832
                    fm.setStateManager("");
-
 
2833
                    fm.setTerritoryManager("");
-
 
2834
                }
-
 
2835
 
2828
                fm.setItemName(items.get(0).getBrand() + items.get(0).getModelNumber() + items.get(0).getModelName());
2836
                fm.setItemName(items.get(0).getBrand() + items.get(0).getModelNumber() + items.get(0).getModelName());
2829
                fm.setAvailability(allColorNetAvailability);
2837
                fm.setAvailability(allColorNetAvailability);
2830
 
2838
 
2831
                focusedModelShortageList.add(fm);
2839
                focusedModelShortageList.add(fm);
2832
            }
2840
            }
Line 2862... Line 2870...
2862
                } catch (Exception e2) {
2870
                } catch (Exception e2) {
2863
                    e2.printStackTrace();
2871
                    e2.printStackTrace();
2864
                }
2872
                }
2865
                String[] sendToArray = new String[]{
2873
                String[] sendToArray = new String[]{
2866
 
2874
 
2867
                        entry.getKey(), "apurve.shrivastava@smartdukaan.com", "puneet.bisht@smartdukaan.com"
2875
                        entry.getKey(), "apurve.shrivastava@smartdukaan.com", "puneet.bisht@smartdukaan.com","ranu.rajput@smartdukaan.com"
2868
 
2876
 
2869
                };
2877
                };
2870
 
2878
 
2871
 
2879
 
2872
                try {
2880
                try {
Line 3602... Line 3610...
3602
                    String messageText = this.getMessageForUnauthorizedBuying(unAuthorizedfilteredRows);
3610
                    String messageText = this.getMessageForUnauthorizedBuying(unAuthorizedfilteredRows);
3603
 
3611
 
3604
                    MimeMessage message = mailSender.createMimeMessage();
3612
                    MimeMessage message = mailSender.createMimeMessage();
3605
                    MimeMessageHelper helper = new MimeMessageHelper(message, true);
3613
                    MimeMessageHelper helper = new MimeMessageHelper(message, true);
3606
                    String[] email = new String[]{storeGuyEntry.getKey()};
3614
                    String[] email = new String[]{storeGuyEntry.getKey()};
3607
                    // String[] email = {"ranu.rajput@smartdukaan.com"};
-
 
3608
 
3615
 
3609
                    helper.setSubject(subject);
3616
                    helper.setSubject(subject);
3610
                    helper.setText(messageText, true);
3617
                    helper.setText(messageText, true);
3611
                    helper.setTo(email);
3618
                    helper.setTo(email);
3612
                    InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "Smartdukaan Alerts");
3619
                    InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "Smartdukaan Alerts");
Line 4847... Line 4854...
4847
                for (Loan defaultLoan : filteredRows) {
4854
                for (Loan defaultLoan : filteredRows) {
4848
                    List<LoanStatement> loanStatements = loanStatementRepository.selectByLoanId(defaultLoan.getId());
4855
                    List<LoanStatement> loanStatements = loanStatementRepository.selectByLoanId(defaultLoan.getId());
4849
                    double amount = loanStatements.stream().map(LoanStatement::getAmount).collect(Collectors.summingDouble(BigDecimal::doubleValue));
4856
                    double amount = loanStatements.stream().map(LoanStatement::getAmount).collect(Collectors.summingDouble(BigDecimal::doubleValue));
4850
                    String messageText = getMessageForDueDateExtend(defaultLoan,amount);
4857
                    String messageText = getMessageForDueDateExtend(defaultLoan,amount);
4851
                   // String[] email = new String[]{storeGuyEntry.getKey()};
4858
                   // String[] email = new String[]{storeGuyEntry.getKey()};
4852
                    String[] email = {"ranu.rajput@smartdukaan.com"};
-
 
-
 
4859
 
4853
                    sendMailOfHtmlFormat(mailSender, email, messageText, null, subject);
4860
                    sendMailOfHtmlFormat(mailSender, email, messageText, null, subject);
4854
 
4861
 
4855
                }
4862
                }
4856
            }
4863
            }
4857
        }*/
4864
        }*/