| Line 288... |
Line 288... |
| 288 |
String authEmail = loginDetails.getEmailId();
|
288 |
String authEmail = loginDetails.getEmailId();
|
| 289 |
BrandFeeCollection brandFeeCollection = brandFeeCollectionRepository.selectById(bfcId);
|
289 |
BrandFeeCollection brandFeeCollection = brandFeeCollectionRepository.selectById(bfcId);
|
| 290 |
brandFeeCollection.setApproverEmail(authEmail);
|
290 |
brandFeeCollection.setApproverEmail(authEmail);
|
| 291 |
brandFeeCollection.setPaymentStatus(feePaymentStatus);
|
291 |
brandFeeCollection.setPaymentStatus(feePaymentStatus);
|
| 292 |
brandFeeCollection.setDescription(description);
|
292 |
brandFeeCollection.setDescription(description);
|
| - |
|
293 |
if (feePaymentStatus.equals(FeePaymentStatus.CONFIRM)) {
|
| - |
|
294 |
loiFormService.checkLoiDetailsCompletion(loiFormRepository.selectById(brandFeeCollection.getLoiFormId()));
|
| - |
|
295 |
}
|
| 293 |
loiFormService.sendPaymentStatusMailToLoiFormFilledBy(brandFeeCollection);
|
296 |
loiFormService.sendPaymentStatusMailToLoiFormFilledBy(brandFeeCollection);
|
| 294 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
297 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| 295 |
return "response";
|
298 |
return "response";
|
| 296 |
|
299 |
|
| 297 |
}
|
300 |
}
|
| Line 382... |
Line 385... |
| 382 |
LOGGER.info("loi_docId-" + loiDocId);
|
385 |
LOGGER.info("loi_docId-" + loiDocId);
|
| 383 |
LoiForm loiForm = loiFormRepository.selectById(loiId);
|
386 |
LoiForm loiForm = loiFormRepository.selectById(loiId);
|
| 384 |
if (loiDocId > 0) {
|
387 |
if (loiDocId > 0) {
|
| 385 |
loiForm.setLoiDoc(loiDocId);
|
388 |
loiForm.setLoiDoc(loiDocId);
|
| 386 |
loiFormService.sendSignedLoiPdfToPartner(loiForm);
|
389 |
loiFormService.sendSignedLoiPdfToPartner(loiForm);
|
| - |
|
390 |
loiFormService.checkLoiDetailsCompletion(loiForm);
|
| 387 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
391 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| 388 |
} else {
|
392 |
} else {
|
| 389 |
loiForm.setLoiSignOtp("");
|
393 |
loiForm.setLoiSignOtp("");
|
| 390 |
loiForm.setLoiGeneratedOn(null);
|
394 |
loiForm.setLoiGeneratedOn(null);
|
| 391 |
loiForm.setLoiSignedOn(null);
|
395 |
loiForm.setLoiSignedOn(null);
|
| Line 433... |
Line 437... |
| 433 |
} else {
|
437 |
} else {
|
| 434 |
throw new ProfitMandiBusinessException("failed in Authority check ", null, "Sorry " + authRepository.selectByEmailOrMobile(loginDetails.getEmailId()).getName() + " you have no authority to change agreed brand fee");
|
438 |
throw new ProfitMandiBusinessException("failed in Authority check ", null, "Sorry " + authRepository.selectByEmailOrMobile(loginDetails.getEmailId()).getName() + " you have no authority to change agreed brand fee");
|
| 435 |
}
|
439 |
}
|
| 436 |
}
|
440 |
}
|
| 437 |
|
441 |
|
| 438 |
// @RequestMapping(value = "/cancelLoi", method = RequestMethod.PUT)
|
- |
|
| 439 |
// public String loiCancellation(@RequestParam int loiId, Model model) throws Exception {
|
- |
|
| 440 |
// LoiForm loiForm = loiFormRepository.selectById(loiId);
|
- |
|
| 441 |
// loiForm.setStatus(LoiStatus.LOI_REJECT);
|
- |
|
| 442 |
// loiForm.setLoiApproved(false);
|
- |
|
| 443 |
// model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
- |
|
| 444 |
// return "response";
|
- |
|
| 445 |
// }
|
- |
|
| 446 |
|
442 |
|
| 447 |
@RequestMapping(value = "/approve-reject-Loi", method = RequestMethod.PUT)
|
443 |
@RequestMapping(value = "/approve-reject-Loi", method = RequestMethod.PUT)
|
| 448 |
public String approveDetails(HttpServletRequest request, @RequestParam int loiId, @RequestParam boolean flag, Model model) throws Exception {
|
444 |
public String approveDetails(HttpServletRequest request, @RequestParam int loiId, @RequestParam boolean flag, Model model) throws Exception {
|
| 449 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
445 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 450 |
String email = loginDetails.getEmailId();
|
446 |
String email = loginDetails.getEmailId();
|
| Line 465... |
Line 461... |
| 465 |
boolean isAuthUser = authEmail.stream().anyMatch(x -> x.equals(email));
|
461 |
boolean isAuthUser = authEmail.stream().anyMatch(x -> x.equals(email));
|
| 466 |
if (flag) {
|
462 |
if (flag) {
|
| 467 |
if (isApprover || isAuthUser) {
|
463 |
if (isApprover || isAuthUser) {
|
| 468 |
loiForm.setLoiApprover(email);
|
464 |
loiForm.setLoiApprover(email);
|
| 469 |
loiForm.setLoiApproved(flag);
|
465 |
loiForm.setLoiApproved(flag);
|
| 470 |
loiFormService.checkLoiDetailsCompletion(loiForm);
|
- |
|
| 471 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
466 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| 472 |
} else {
|
467 |
} else {
|
| 473 |
throw new ProfitMandiBusinessException("Failed in Authority check ", "Read", "Sorry " + authRepository.selectByEmailOrMobile(loginDetails.getEmailId()).getName() + " you have no authority to Approve this Loi Form ,Only reporting manager and upper can Approve");
|
468 |
throw new ProfitMandiBusinessException("Failed in Authority check ", "Read", "Sorry " + authRepository.selectByEmailOrMobile(loginDetails.getEmailId()).getName() + " you have no authority to Approve this Loi Form ,Only reporting manager and upper can Approve");
|
| 474 |
}
|
469 |
}
|
| 475 |
} else {
|
470 |
} else {
|