| Line 553... |
Line 553... |
| 553 |
@RequestBody CreateFranchiseeRequest createFranchiseeRequest) throws Exception {
|
553 |
@RequestBody CreateFranchiseeRequest createFranchiseeRequest) throws Exception {
|
| 554 |
|
554 |
|
| 555 |
int rbmL1 = csService.getAuthUserId(ProfitMandiConstants.TICKET_CATEGORY_RBM, EscalationType.L1, createFranchiseeRequest.getFofoId());
|
555 |
int rbmL1 = csService.getAuthUserId(ProfitMandiConstants.TICKET_CATEGORY_RBM, EscalationType.L1, createFranchiseeRequest.getFofoId());
|
| 556 |
|
556 |
|
| 557 |
List<FranchiseeVisit> franchiseeVisits = franchiseeVisitRepository.selectAllByFofoId(createFranchiseeRequest.getFofoId());
|
557 |
List<FranchiseeVisit> franchiseeVisits = franchiseeVisitRepository.selectAllByFofoId(createFranchiseeRequest.getFofoId());
|
| 558 |
if (franchiseeVisits.isEmpty()) {
|
- |
|
| 559 |
throw new ProfitMandiBusinessException("id", createFranchiseeRequest.getId(), "Franchisee visit not found for id: " + createFranchiseeRequest.getId());
|
- |
|
| 560 |
}
|
- |
|
| 561 |
FranchiseeVisit franchiseeVisit = franchiseeVisits.get(0);
|
558 |
FranchiseeVisit franchiseeVisit = franchiseeVisits.isEmpty() ? new FranchiseeVisit() : franchiseeVisits.get(0);
|
| 562 |
franchiseeVisit.setFofoId(createFranchiseeRequest.getFofoId());
|
559 |
franchiseeVisit.setFofoId(createFranchiseeRequest.getFofoId());
|
| 563 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(createFranchiseeRequest.getFofoId());
|
560 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(createFranchiseeRequest.getFofoId());
|
| 564 |
LOGGER.info("rbmL1 {}", rbmL1);
|
561 |
LOGGER.info("rbmL1 {}", rbmL1);
|
| 565 |
franchiseeVisit.setPartnerName(customRetailer.getBusinessName());
|
562 |
franchiseeVisit.setPartnerName(customRetailer.getBusinessName());
|
| 566 |
franchiseeVisit.setAgenda(createFranchiseeRequest.getAgenda());
|
563 |
franchiseeVisit.setAgenda(createFranchiseeRequest.getAgenda());
|