Subversion Repositories SmartDukaan

Rev

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

Rev 35169 Rev 35754
Line 231... Line 231...
231
    @RequestMapping(value = "/generateLoi", method = RequestMethod.GET)
231
    @RequestMapping(value = "/generateLoi", method = RequestMethod.GET)
232
    public String generateLoi(HttpServletRequest request, @RequestParam int loiId, Model model) throws ProfitMandiBusinessException {
232
    public String generateLoi(HttpServletRequest request, @RequestParam int loiId, Model model) throws ProfitMandiBusinessException {
233
        LoiForm loiForm = loiFormRepository.selectById(loiId);
233
        LoiForm loiForm = loiFormRepository.selectById(loiId);
234
        String filledBy = authRepository.selectByEmailOrMobile(loiForm.getFilledBy()).getFullName();
234
        String filledBy = authRepository.selectByEmailOrMobile(loiForm.getFilledBy()).getFullName();
235
        loiForm.setLoiGeneratedOn(LocalDateTime.now());
235
        loiForm.setLoiGeneratedOn(LocalDateTime.now());
236
        BrandFee brandFee = brandFeeRepository.selectById(1);
236
        BrandFee brandFee = brandFeeRepository.selectById(1L);
237
        BillingAddress address = billingAddressRepository.selectByLoiFormId(loiId);
237
        BillingAddress address = billingAddressRepository.selectByLoiFormId(loiId);
238
        List<LoiBrandCommitment> loiBrandCommitments = brandCommitmentRepository.selectByLoiId(loiId).stream().filter(x -> x.getAmount() > 0).collect(Collectors.toList());
238
        List<LoiBrandCommitment> loiBrandCommitments = brandCommitmentRepository.selectByLoiId(loiId).stream().filter(x -> x.getAmount() > 0).collect(Collectors.toList());
239
        double totalCommitment = loiBrandCommitments.stream().mapToDouble(x -> x.getAmount()).sum();
239
        double totalCommitment = loiBrandCommitments.stream().mapToDouble(x -> x.getAmount()).sum();
240
        List<BrandFeeCollection> brandFeeCollections = brandFeeCollectionRepository.selectAllConfirmPaymetByLoiId(loiId);
240
        List<BrandFeeCollection> brandFeeCollections = brandFeeCollectionRepository.selectAllConfirmPaymetByLoiId(loiId);
241
        double brandFeeAmount = brandFeeCollections.stream().mapToDouble(x -> x.getCollectedAmount()).sum();
241
        double brandFeeAmount = brandFeeCollections.stream().mapToDouble(x -> x.getCollectedAmount()).sum();