| Line 446... |
Line 446... |
| 446 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
446 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 447 |
boolean isAgreedBrandFeeChanger = agreedBrandFeeChangerEmail.stream().anyMatch(x -> x.equals(loginDetails.getEmailId()));
|
447 |
boolean isAgreedBrandFeeChanger = agreedBrandFeeChangerEmail.stream().anyMatch(x -> x.equals(loginDetails.getEmailId()));
|
| 448 |
if (isAgreedBrandFeeChanger) {
|
448 |
if (isAgreedBrandFeeChanger) {
|
| 449 |
LoiForm loiForm = loiFormRepository.selectById(loiId);
|
449 |
LoiForm loiForm = loiFormRepository.selectById(loiId);
|
| 450 |
loiForm.setAgreedBrandFees(brandFee);
|
450 |
loiForm.setAgreedBrandFees(brandFee);
|
| - |
|
451 |
double totalCollectedPayment = brandFeeCollectionRepository.selectAllConfirmPaymetByLoiId(loiId).stream().mapToDouble(x -> x.getCollectedAmount()).sum();
|
| - |
|
452 |
double agreedBrandFee = loiForm.getAgreedBrandFees();
|
| - |
|
453 |
if (agreedBrandFee == totalCollectedPayment && loiForm.getLoiSignOtp() != null) {
|
| - |
|
454 |
loiForm.setStatus(LoiStatus.PRE_ONBOARDING_DONE);
|
| - |
|
455 |
loiFormService.createPartnerOnboardingPanel(loiId);
|
| - |
|
456 |
}
|
| 451 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
457 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| 452 |
return "response";
|
458 |
return "response";
|
| 453 |
} else {
|
459 |
} else {
|
| 454 |
throw new ProfitMandiBusinessException("failed in Authority check ", null, "Sorry " + authRepository.selectByEmailOrMobile(loginDetails.getEmailId()).getName() + " you have no authority to change agreed brand fee");
|
460 |
throw new ProfitMandiBusinessException("failed in Authority check ", null, "Sorry " + authRepository.selectByEmailOrMobile(loginDetails.getEmailId()).getName() + " you have no authority to change agreed brand fee");
|
| 455 |
}
|
461 |
}
|