Subversion Repositories SmartDukaan

Rev

Rev 36661 | Rev 36678 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36661 Rev 36677
Line 552... Line 552...
552
    public ResponseEntity<?> FranchiseVisit(HttpServletRequest request,
552
    public ResponseEntity<?> FranchiseVisit(HttpServletRequest request,
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
        FranchiseeVisit franchiseeVisit = franchiseeVisitRepository.selectById(createFranchiseeRequest.getId());
557
        List<FranchiseeVisit> franchiseeVisits = franchiseeVisitRepository.selectAllByFofoId(createFranchiseeRequest.getFofoId());
558
        if (franchiseeVisit == null) {
558
        if (franchiseeVisits.isEmpty()) {
559
            throw new ProfitMandiBusinessException("id", createFranchiseeRequest.getId(), "Franchisee visit not found for id: " + createFranchiseeRequest.getId());
559
            throw new ProfitMandiBusinessException("id", createFranchiseeRequest.getId(), "Franchisee visit not found for id: " + createFranchiseeRequest.getId());
560
        }
560
        }
-
 
561
        FranchiseeVisit franchiseeVisit = franchiseeVisits.get(0);
561
        franchiseeVisit.setFofoId(createFranchiseeRequest.getFofoId());
562
        franchiseeVisit.setFofoId(createFranchiseeRequest.getFofoId());
562
        CustomRetailer customRetailer = retailerService.getFofoRetailer(createFranchiseeRequest.getFofoId());
563
        CustomRetailer customRetailer = retailerService.getFofoRetailer(createFranchiseeRequest.getFofoId());
563
        LOGGER.info("rbmL1 {}", rbmL1);
564
        LOGGER.info("rbmL1 {}", rbmL1);
564
        franchiseeVisit.setPartnerName(customRetailer.getBusinessName());
565
        franchiseeVisit.setPartnerName(customRetailer.getBusinessName());
565
        franchiseeVisit.setAgenda(createFranchiseeRequest.getAgenda());
566
        franchiseeVisit.setAgenda(createFranchiseeRequest.getAgenda());