| Line 531... |
Line 531... |
| 531 |
@ApiImplicitParams({
|
531 |
@ApiImplicitParams({
|
| 532 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
|
532 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
|
| 533 |
public ResponseEntity<?> FranchiseVisit(HttpServletRequest request,
|
533 |
public ResponseEntity<?> FranchiseVisit(HttpServletRequest request,
|
| 534 |
@RequestBody CreateFranchiseeRequest createFranchiseeRequest) throws Exception {
|
534 |
@RequestBody CreateFranchiseeRequest createFranchiseeRequest) throws Exception {
|
| 535 |
|
535 |
|
| - |
|
536 |
int rbmL1 = csService.getAuthUserId(ProfitMandiConstants.TICKET_CATEGORY_RBM,EscalationType.L1,createFranchiseeRequest.getFofoId());
|
| - |
|
537 |
|
| 536 |
FranchiseeVisit franchiseeVisit = franchiseeVisitRepository.selectById(createFranchiseeRequest.getId());
|
538 |
FranchiseeVisit franchiseeVisit = franchiseeVisitRepository.selectById(createFranchiseeRequest.getId());
|
| 537 |
franchiseeVisit.setFofoId(createFranchiseeRequest.getFofoId());
|
539 |
franchiseeVisit.setFofoId(createFranchiseeRequest.getFofoId());
|
| 538 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(createFranchiseeRequest.getFofoId());
|
540 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(createFranchiseeRequest.getFofoId());
|
| 539 |
|
- |
|
| - |
|
541 |
LOGGER.info("rbmL1 {}",rbmL1);
|
| 540 |
franchiseeVisit.setPartnerName(customRetailer.getBusinessName());
|
542 |
franchiseeVisit.setPartnerName(customRetailer.getBusinessName());
|
| 541 |
franchiseeVisit.setAgenda(createFranchiseeRequest.getAgenda());
|
543 |
franchiseeVisit.setAgenda(createFranchiseeRequest.getAgenda());
|
| 542 |
franchiseeVisit.setPartnerRemark(createFranchiseeRequest.getPartnerRemark());
|
544 |
franchiseeVisit.setPartnerRemark(createFranchiseeRequest.getPartnerRemark());
|
| 543 |
franchiseeVisit.setOutsideVisibity(createFranchiseeRequest.getOutsideVisibity());
|
545 |
franchiseeVisit.setOutsideVisibity(createFranchiseeRequest.getOutsideVisibity());
|
| 544 |
franchiseeVisit.setInstoreVisibility(createFranchiseeRequest.getInstoreVisibility());
|
546 |
franchiseeVisit.setInstoreVisibility(createFranchiseeRequest.getInstoreVisibility());
|
| Line 554... |
Line 556... |
| 554 |
franchiseeVisit.setHygiene(createFranchiseeRequest.getHygiene());
|
556 |
franchiseeVisit.setHygiene(createFranchiseeRequest.getHygiene());
|
| 555 |
franchiseeVisit.setCreatedTimestamp(LocalDateTime.now());
|
557 |
franchiseeVisit.setCreatedTimestamp(LocalDateTime.now());
|
| 556 |
franchiseeVisit.setUpdatedTimestamp(LocalDateTime.now());
|
558 |
franchiseeVisit.setUpdatedTimestamp(LocalDateTime.now());
|
| 557 |
franchiseeVisit.setInformedAboutOnline(createFranchiseeRequest.getOnline());
|
559 |
franchiseeVisit.setInformedAboutOnline(createFranchiseeRequest.getOnline());
|
| 558 |
franchiseeVisit.setPendingBilling(createFranchiseeRequest.getPendingBilling());
|
560 |
franchiseeVisit.setPendingBilling(createFranchiseeRequest.getPendingBilling());
|
| - |
|
561 |
franchiseeVisit.setRbmId(rbmL1);
|
| - |
|
562 |
franchiseeVisit.setRbmRating(createFranchiseeRequest.getRbmRating());
|
| 559 |
if (createFranchiseeRequest.getAction().equals(FranchiseeActivityStatus.FOLLOWUP)) {
|
563 |
if (createFranchiseeRequest.getAction().equals(FranchiseeActivityStatus.FOLLOWUP)) {
|
| 560 |
franchiseeVisit.setStatus(FranchiseeVisitStatus.OPEN);
|
564 |
franchiseeVisit.setStatus(FranchiseeVisitStatus.OPEN);
|
| 561 |
} else {
|
565 |
} else {
|
| 562 |
franchiseeVisit.setStatus(FranchiseeVisitStatus.CLOSE);
|
566 |
franchiseeVisit.setStatus(FranchiseeVisitStatus.CLOSE);
|
| 563 |
}
|
567 |
}
|
| Line 587... |
Line 591... |
| 587 |
}
|
591 |
}
|
| 588 |
franchiseeActivity.setCreatedTimestamp(LocalDateTime.now());
|
592 |
franchiseeActivity.setCreatedTimestamp(LocalDateTime.now());
|
| 589 |
franchiseeActivityRepository.persist(franchiseeActivity);
|
593 |
franchiseeActivityRepository.persist(franchiseeActivity);
|
| 590 |
|
594 |
|
| 591 |
franchiseeVisit.setFranchiseActivityId(franchiseeActivity.getId());
|
595 |
franchiseeVisit.setFranchiseActivityId(franchiseeActivity.getId());
|
| - |
|
596 |
|
| - |
|
597 |
if(!createFranchiseeRequest.getOutsideVisibityReason().isEmpty()){
|
| - |
|
598 |
csService.createTicket(createFranchiseeRequest.getFofoId(), ProfitMandiConstants.TICKET_CATEGORY_DESIGN, ProfitMandiConstants.TICKET_CATEGORY_DESIGNING_BRANDING_ANY_OTHER, createFranchiseeRequest.getOutsideVisibityReason(), authUser.getId());
|
| - |
|
599 |
}
|
| - |
|
600 |
|
| - |
|
601 |
if(!createFranchiseeRequest.getInstoreVisibilityReason().isEmpty()){
|
| - |
|
602 |
csService.createTicket(createFranchiseeRequest.getFofoId(), ProfitMandiConstants.TICKET_CATEGORY_DESIGN, ProfitMandiConstants.TICKET_CATEGORY_DESIGNING_BRANDING_ANY_OTHER, createFranchiseeRequest.getInstoreVisibilityReason(), authUser.getId());
|
| - |
|
603 |
}
|
| - |
|
604 |
|
| - |
|
605 |
if(!createFranchiseeRequest.getOutsideStockReason().isEmpty()){
|
| - |
|
606 |
csService.createTicket(createFranchiseeRequest.getFofoId(), ProfitMandiConstants.TICKET_CATEGORY_SALES, ProfitMandiConstants.TICKET_CATEGORY_SALES_ANY_OTHER, createFranchiseeRequest.getOutsideStockReason(), authUser.getId());
|
| - |
|
607 |
}
|
| - |
|
608 |
|
| - |
|
609 |
if(!createFranchiseeRequest.getSystemKnowledgeReason().isEmpty()){
|
| - |
|
610 |
csService.createTicket(createFranchiseeRequest.getFofoId(), ProfitMandiConstants.TICKET_CATEGORY_TRAINING, ProfitMandiConstants.TICKET_CATEGORY_TRAINING_ANY_OTHER, createFranchiseeRequest.getSystemKnowledgeReason(), authUser.getId());
|
| - |
|
611 |
}
|
| - |
|
612 |
|
| - |
|
613 |
if(!createFranchiseeRequest.getLatestDummiesReason().isEmpty()){
|
| - |
|
614 |
csService.createTicket(createFranchiseeRequest.getFofoId(), ProfitMandiConstants.TICKET_CATEGORY_MARKETING, ProfitMandiConstants.TICKET_CATEGORY_MARKETING_ANY_OTHER, createFranchiseeRequest.getLatestDummiesReason(), authUser.getId());
|
| - |
|
615 |
}
|
| - |
|
616 |
|
| - |
|
617 |
if(!createFranchiseeRequest.getInvestmentReason().isEmpty()){
|
| - |
|
618 |
csService.createTicket(createFranchiseeRequest.getFofoId(), ProfitMandiConstants.TICKET_CATEGORY_SALES, ProfitMandiConstants.TICKET_CATEGORY_SALES_ANY_OTHER, createFranchiseeRequest.getInvestmentReason(), authUser.getId());
|
| - |
|
619 |
}
|
| - |
|
620 |
|
| - |
|
621 |
|
| - |
|
622 |
|
| 592 |
return responseSender.ok(true);
|
623 |
return responseSender.ok(true);
|
| - |
|
624 |
|
| 593 |
}
|
625 |
}
|
| 594 |
|
626 |
|
| 595 |
@RequestMapping(value = "/getFranchiseVisit", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
627 |
@RequestMapping(value = "/getFranchiseVisit", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 596 |
@ApiImplicitParams({
|
628 |
@ApiImplicitParams({
|
| 597 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
|
629 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
|