| Line 187... |
Line 187... |
| 187 |
List<LoiFormModel> pendingFormList = loiFormService.pendingFormList(email);
|
187 |
List<LoiFormModel> pendingFormList = loiFormService.pendingFormList(email);
|
| 188 |
model.addAttribute("isDocApprover", isDocApprover);
|
188 |
model.addAttribute("isDocApprover", isDocApprover);
|
| 189 |
model.addAttribute("isAuthUser", isAuthUser);
|
189 |
model.addAttribute("isAuthUser", isAuthUser);
|
| 190 |
model.addAttribute("isAgreedBrandFeeChanger", isAgreedBrandFeeChanger);
|
190 |
model.addAttribute("isAgreedBrandFeeChanger", isAgreedBrandFeeChanger);
|
| 191 |
model.addAttribute("pendingFormList", pendingFormList);
|
191 |
model.addAttribute("pendingFormList", pendingFormList);
|
| - |
|
192 |
model.addAttribute("brandType", StoreType.valueList);
|
| 192 |
return "pendingForm";
|
193 |
return "pendingForm";
|
| 193 |
}
|
194 |
}
|
| 194 |
|
195 |
|
| - |
|
196 |
// @RequestMapping(value = "/pendingLoiFormList", method = RequestMethod.GET)
|
| - |
|
197 |
// public String pendingLoiForm1(HttpServletRequest request, @RequestParam int pageSize, @RequestParam int pageNumber, Model model) throws Exception {
|
| - |
|
198 |
// LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| - |
|
199 |
// String email = loginDetails.getEmailId();
|
| - |
|
200 |
// Map<String, Object> pendingFormMap = loiFormService.pendingFormList(email);
|
| - |
|
201 |
// model.addAttribute("pendingFormList", pendingFormMap.get("pendingFormModelList"));
|
| - |
|
202 |
// model.addAttribute("paginationInfo", this.getPaginationInfo(pageNumber,pageSize,(long)pendingFormMap.get("totalCount")));
|
| - |
|
203 |
// return "loiData";
|
| - |
|
204 |
// }
|
| - |
|
205 |
// public String getPaginationInfo(int currentPage, int pageSize, long totalEntries) {
|
| - |
|
206 |
// // Calculate the starting index
|
| - |
|
207 |
// int start = (currentPage - 1) * pageSize + 1; // Start from 1
|
| - |
|
208 |
// // Calculate the ending index
|
| - |
|
209 |
// int end = Math.min(start + pageSize - 1, (int) totalEntries); // Ensure it doesn't exceed totalEntries
|
| - |
|
210 |
//
|
| - |
|
211 |
// return "Showing " + start + " to " + end + " of " + totalEntries + " entries";
|
| - |
|
212 |
// }
|
| - |
|
213 |
|
| 195 |
// generate LOI for specific Form data
|
214 |
// generate LOI for specific Form data
|
| 196 |
@RequestMapping(value = "/generateLoi", method = RequestMethod.GET)
|
215 |
@RequestMapping(value = "/generateLoi", method = RequestMethod.GET)
|
| 197 |
public String generateLoi(HttpServletRequest request, @RequestParam int loiId, Model model) throws ProfitMandiBusinessException {
|
216 |
public String generateLoi(HttpServletRequest request, @RequestParam int loiId, Model model) throws ProfitMandiBusinessException {
|
| 198 |
LoiForm loiForm = loiFormRepository.selectById(loiId);
|
217 |
LoiForm loiForm = loiFormRepository.selectById(loiId);
|
| 199 |
String filledBy = authRepository.selectByEmailOrMobile(loiForm.getFilledBy()).getFullName();
|
218 |
String filledBy = authRepository.selectByEmailOrMobile(loiForm.getFilledBy()).getFullName();
|
| Line 416... |
Line 435... |
| 416 |
}
|
435 |
}
|
| 417 |
return "response";
|
436 |
return "response";
|
| 418 |
}
|
437 |
}
|
| 419 |
|
438 |
|
| 420 |
@RequestMapping(value = "/updateAgreedBrandFee", method = RequestMethod.PUT)
|
439 |
@RequestMapping(value = "/updateAgreedBrandFee", method = RequestMethod.PUT)
|
| 421 |
public String updateAgreedBrandFee(HttpServletRequest request, @RequestParam int loiId, @RequestParam double brandFee, Model model) throws Exception {
|
440 |
public String updateAgreedBrandFee(HttpServletRequest request, @RequestParam int loiId, @RequestParam double brandFee, @RequestParam StoreType storeType, Model model) throws Exception {
|
| 422 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
441 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 423 |
boolean isAgreedBrandFeeChanger = agreedBrandFeeChangerEmail.stream().anyMatch(x -> x.equals(loginDetails.getEmailId()));
|
442 |
boolean isAgreedBrandFeeChanger = agreedBrandFeeChangerEmail.stream().anyMatch(x -> x.equals(loginDetails.getEmailId()));
|
| 424 |
if (isAgreedBrandFeeChanger) {
|
443 |
if (isAgreedBrandFeeChanger) {
|
| 425 |
LoiForm loiForm = loiFormRepository.selectById(loiId);
|
444 |
LoiForm loiForm = loiFormRepository.selectById(loiId);
|
| 426 |
loiForm.setAgreedBrandFees(brandFee);
|
445 |
loiForm.setAgreedBrandFees(brandFee);
|
| - |
|
446 |
loiForm.setBrandType(storeType);
|
| 427 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
447 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| 428 |
return "response";
|
448 |
return "response";
|
| 429 |
} else {
|
449 |
} else {
|
| 430 |
throw new ProfitMandiBusinessException("failed in Authority check ", null, "Sorry " + authRepository.selectByEmailOrMobile(loginDetails.getEmailId()).getName() + " you have no authority to change agreed brand fee");
|
450 |
throw new ProfitMandiBusinessException("failed in Authority check ", null, "Sorry " + authRepository.selectByEmailOrMobile(loginDetails.getEmailId()).getName() + " you have no authority to change agreed brand fee");
|
| 431 |
}
|
451 |
}
|