| Line 38... |
Line 38... |
| 38 |
import org.apache.logging.log4j.Logger;
|
38 |
import org.apache.logging.log4j.Logger;
|
| 39 |
import org.springframework.beans.factory.annotation.Autowired;
|
39 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 40 |
import org.springframework.mail.javamail.JavaMailSender;
|
40 |
import org.springframework.mail.javamail.JavaMailSender;
|
| 41 |
import org.springframework.stereotype.Controller;
|
41 |
import org.springframework.stereotype.Controller;
|
| 42 |
import org.springframework.ui.Model;
|
42 |
import org.springframework.ui.Model;
|
| 43 |
import org.springframework.web.bind.annotation.RequestBody;
|
43 |
import org.springframework.web.bind.annotation.*;
|
| 44 |
import org.springframework.web.bind.annotation.RequestMapping;
|
- |
|
| 45 |
import org.springframework.web.bind.annotation.RequestMethod;
|
- |
|
| 46 |
import org.springframework.web.bind.annotation.RequestParam;
|
- |
|
| 47 |
|
44 |
|
| 48 |
import javax.servlet.http.HttpServletRequest;
|
45 |
import javax.servlet.http.HttpServletRequest;
|
| 49 |
import javax.transaction.Transactional;
|
46 |
import javax.transaction.Transactional;
|
| 50 |
import java.math.BigDecimal;
|
47 |
import java.math.BigDecimal;
|
| 51 |
import java.math.RoundingMode;
|
48 |
import java.math.RoundingMode;
|
| Line 634... |
Line 631... |
| 634 |
}
|
631 |
}
|
| 635 |
|
632 |
|
| 636 |
|
633 |
|
| 637 |
// adjusting loan for specific loan if loan is not adjusting and other loan is adjusting
|
634 |
// adjusting loan for specific loan if loan is not adjusting and other loan is adjusting
|
| 638 |
|
635 |
|
| 639 |
@RequestMapping(value = "/settle-loan", method = RequestMethod.GET)
|
636 |
@RequestMapping(value = "/settle-loan/{fofoId}/{loanId}", method = RequestMethod.GET)
|
| 640 |
public String settleAndCreateLoanById(HttpServletRequest request, @RequestParam int loanId, @RequestParam int fofoId, Model model) throws Exception {
|
637 |
public String settleAndCreateLoanById(HttpServletRequest request, @PathVariable int loanId, @PathVariable int fofoId, Model model) throws Exception {
|
| 641 |
Loan loan = loanRepository.selectByLoanId(loanId);
|
638 |
Loan loan = loanRepository.selectByLoanId(loanId);
|
| 642 |
double loanAmount = loan.getPendingAmount().doubleValue();
|
639 |
double loanAmount = loan.getPendingAmount().doubleValue();
|
| 643 |
|
640 |
|
| 644 |
if (loanAmount > 0) {
|
641 |
if (loanAmount > 0) {
|
| 645 |
sdCreditService.createLoan(fofoId, loanAmount, 0, "Amount added for loan adjustment");
|
642 |
sdCreditService.createLoan(fofoId, loanAmount, 0, "Amount added for loan adjustment");
|