| Line 5... |
Line 5... |
| 5 |
import java.time.LocalDate;
|
5 |
import java.time.LocalDate;
|
| 6 |
import java.time.LocalDateTime;
|
6 |
import java.time.LocalDateTime;
|
| 7 |
import java.time.format.DateTimeFormatter;
|
7 |
import java.time.format.DateTimeFormatter;
|
| 8 |
import java.util.ArrayList;
|
8 |
import java.util.ArrayList;
|
| 9 |
import java.util.Arrays;
|
9 |
import java.util.Arrays;
|
| - |
|
10 |
import java.util.Comparator;
|
| 10 |
import java.util.HashMap;
|
11 |
import java.util.HashMap;
|
| 11 |
import java.util.HashSet;
|
12 |
import java.util.HashSet;
|
| 12 |
import java.util.List;
|
13 |
import java.util.List;
|
| 13 |
import java.util.Map;
|
14 |
import java.util.Map;
|
| - |
|
15 |
import java.util.Map.Entry;
|
| - |
|
16 |
import java.util.Optional;
|
| 14 |
import java.util.Set;
|
17 |
import java.util.Set;
|
| 15 |
import java.util.TreeMap;
|
18 |
import java.util.TreeMap;
|
| 16 |
import java.util.stream.Collectors;
|
19 |
import java.util.stream.Collectors;
|
| 17 |
|
20 |
|
| 18 |
import javax.servlet.http.HttpServletRequest;
|
21 |
import javax.servlet.http.HttpServletRequest;
|
| Line 24... |
Line 27... |
| 24 |
import org.apache.logging.log4j.Logger;
|
27 |
import org.apache.logging.log4j.Logger;
|
| 25 |
import org.springframework.beans.factory.annotation.Autowired;
|
28 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 26 |
import org.springframework.core.io.InputStreamResource;
|
29 |
import org.springframework.core.io.InputStreamResource;
|
| 27 |
import org.springframework.http.HttpHeaders;
|
30 |
import org.springframework.http.HttpHeaders;
|
| 28 |
import org.springframework.http.HttpStatus;
|
31 |
import org.springframework.http.HttpStatus;
|
| - |
|
32 |
import org.springframework.http.MediaType;
|
| 29 |
import org.springframework.http.ResponseEntity;
|
33 |
import org.springframework.http.ResponseEntity;
|
| 30 |
import org.springframework.stereotype.Controller;
|
34 |
import org.springframework.stereotype.Controller;
|
| 31 |
import org.springframework.ui.Model;
|
35 |
import org.springframework.ui.Model;
|
| 32 |
import org.springframework.util.StringUtils;
|
36 |
import org.springframework.util.StringUtils;
|
| 33 |
import org.springframework.web.bind.annotation.RequestBody;
|
37 |
import org.springframework.web.bind.annotation.RequestBody;
|
| Line 36... |
Line 40... |
| 36 |
import org.springframework.web.bind.annotation.RequestParam;
|
40 |
import org.springframework.web.bind.annotation.RequestParam;
|
| 37 |
import org.springframework.web.bind.annotation.RequestPart;
|
41 |
import org.springframework.web.bind.annotation.RequestPart;
|
| 38 |
import org.springframework.web.multipart.MultipartFile;
|
42 |
import org.springframework.web.multipart.MultipartFile;
|
| 39 |
|
43 |
|
| 40 |
import com.google.gson.Gson;
|
44 |
import com.google.gson.Gson;
|
| - |
|
45 |
import com.mongodb.DBObject;
|
| 41 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
46 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 42 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
47 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
| 43 |
import com.spice.profitmandi.common.model.Legend;
|
48 |
import com.spice.profitmandi.common.model.Legend;
|
| 44 |
import com.spice.profitmandi.common.model.OptionModel;
|
49 |
import com.spice.profitmandi.common.model.OptionModel;
|
| 45 |
import com.spice.profitmandi.common.model.PieLables;
|
50 |
import com.spice.profitmandi.common.model.PieLables;
|
| 46 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
51 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 47 |
import com.spice.profitmandi.common.util.FileUtil;
|
52 |
import com.spice.profitmandi.common.util.FileUtil;
|
| - |
|
53 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 48 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
54 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 49 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
55 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
| 50 |
import com.spice.profitmandi.dao.entity.user.FranchiseeActivity;
|
56 |
import com.spice.profitmandi.dao.entity.user.FranchiseeActivity;
|
| 51 |
import com.spice.profitmandi.dao.entity.user.FranchiseeVisit;
|
57 |
import com.spice.profitmandi.dao.entity.user.FranchiseeVisit;
|
| 52 |
import com.spice.profitmandi.dao.entity.user.Lead;
|
58 |
import com.spice.profitmandi.dao.entity.user.Lead;
|
| 53 |
import com.spice.profitmandi.dao.entity.user.LeadActivity;
|
59 |
import com.spice.profitmandi.dao.entity.user.LeadActivity;
|
| - |
|
60 |
import com.spice.profitmandi.dao.entity.user.LeadBrand;
|
| - |
|
61 |
import com.spice.profitmandi.dao.entity.user.LeadDetail;
|
| 54 |
import com.spice.profitmandi.dao.entity.user.VisitRequest;
|
62 |
import com.spice.profitmandi.dao.entity.user.VisitRequest;
|
| 55 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
63 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 56 |
import com.spice.profitmandi.dao.enumuration.dtr.CommunicationType;
|
64 |
import com.spice.profitmandi.dao.enumuration.dtr.CommunicationType;
|
| 57 |
import com.spice.profitmandi.dao.enumuration.dtr.LeadSource;
|
65 |
import com.spice.profitmandi.dao.enumuration.dtr.LeadSource;
|
| 58 |
import com.spice.profitmandi.dao.enumuration.dtr.LeadStatus;
|
66 |
import com.spice.profitmandi.dao.enumuration.dtr.LeadStatus;
|
| 59 |
import com.spice.profitmandi.dao.model.ChartLeadModel;
|
67 |
import com.spice.profitmandi.dao.model.ChartLeadModel;
|
| 60 |
import com.spice.profitmandi.dao.model.CreateLeacdActivityRequest;
|
68 |
import com.spice.profitmandi.dao.model.CreateLeacdActivityRequest;
|
| 61 |
import com.spice.profitmandi.dao.model.CreateRefferalRequest;
|
69 |
import com.spice.profitmandi.dao.model.CreateRefferalRequest;
|
| 62 |
import com.spice.profitmandi.dao.model.DataLeadModel;
|
70 |
import com.spice.profitmandi.dao.model.DataLeadModel;
|
| 63 |
import com.spice.profitmandi.dao.model.DateRangeModel;
|
71 |
import com.spice.profitmandi.dao.model.DateRangeModel;
|
| - |
|
72 |
import com.spice.profitmandi.dao.model.LeadBrandModel;
|
| - |
|
73 |
import com.spice.profitmandi.dao.model.LeadDetailModel;
|
| 64 |
import com.spice.profitmandi.dao.model.LeadStatusData;
|
74 |
import com.spice.profitmandi.dao.model.LeadStatusData;
|
| 65 |
import com.spice.profitmandi.dao.model.PartnerCollectionPlanModel;
|
75 |
import com.spice.profitmandi.dao.model.PartnerCollectionPlanModel;
|
| 66 |
import com.spice.profitmandi.dao.model.RBMPerformanceSummaryModel;
|
76 |
import com.spice.profitmandi.dao.model.RBMPerformanceSummaryModel;
|
| 67 |
import com.spice.profitmandi.dao.model.TeamCommitmentModel;
|
77 |
import com.spice.profitmandi.dao.model.TeamCommitmentModel;
|
| 68 |
import com.spice.profitmandi.dao.model.TotalTargetColectionModel;
|
78 |
import com.spice.profitmandi.dao.model.TotalTargetColectionModel;
|
| Line 71... |
Line 81... |
| 71 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
81 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 72 |
import com.spice.profitmandi.dao.repository.auth.PartnerCollectionPlanRepository;
|
82 |
import com.spice.profitmandi.dao.repository.auth.PartnerCollectionPlanRepository;
|
| 73 |
import com.spice.profitmandi.dao.repository.auth.PartnerCollectionRemarkRepository;
|
83 |
import com.spice.profitmandi.dao.repository.auth.PartnerCollectionRemarkRepository;
|
| 74 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
84 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| 75 |
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
|
85 |
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
|
| - |
|
86 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| - |
|
87 |
import com.spice.profitmandi.dao.repository.dtr.FranchiseeActivityRepository;
|
| - |
|
88 |
import com.spice.profitmandi.dao.repository.dtr.FranchiseeVisitRepository;
|
| - |
|
89 |
import com.spice.profitmandi.dao.repository.dtr.LeadActivityRepository;
|
| - |
|
90 |
import com.spice.profitmandi.dao.repository.dtr.LeadBrandRepository;
|
| - |
|
91 |
import com.spice.profitmandi.dao.repository.dtr.LeadDetailRepository;
|
| - |
|
92 |
import com.spice.profitmandi.dao.repository.dtr.LeadRepository;
|
| 76 |
import com.spice.profitmandi.dao.repository.dtr.*;
|
93 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
| - |
|
94 |
import com.spice.profitmandi.dao.repository.dtr.VisitRequestRepository;
|
| 77 |
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
|
95 |
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
|
| 78 |
import com.spice.profitmandi.dao.repository.inventory.StateRepository;
|
96 |
import com.spice.profitmandi.dao.repository.inventory.StateRepository;
|
| 79 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
|
97 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
|
| 80 |
import com.spice.profitmandi.service.AuthService;
|
98 |
import com.spice.profitmandi.service.AuthService;
|
| 81 |
import com.spice.profitmandi.service.PartnerCollectionService;
|
99 |
import com.spice.profitmandi.service.PartnerCollectionService;
|
| Line 147... |
Line 165... |
| 147 |
private FranchiseeActivityRepository franchiseeActivityRepository;
|
165 |
private FranchiseeActivityRepository franchiseeActivityRepository;
|
| 148 |
|
166 |
|
| 149 |
@Autowired
|
167 |
@Autowired
|
| 150 |
private VisitRequestRepository visitRequestRepository;
|
168 |
private VisitRequestRepository visitRequestRepository;
|
| 151 |
|
169 |
|
| - |
|
170 |
@Autowired
|
| - |
|
171 |
private LeadBrandRepository leadBrandRepository;
|
| - |
|
172 |
|
| - |
|
173 |
@Autowired
|
| - |
|
174 |
private LeadDetailRepository leadDetailRepository;
|
| - |
|
175 |
|
| - |
|
176 |
@Autowired
|
| - |
|
177 |
private Mongo mongoClient;
|
| - |
|
178 |
|
| - |
|
179 |
@Autowired
|
| - |
|
180 |
private ResponseSender<?> responseSender;
|
| - |
|
181 |
|
| 152 |
List<LeadStatus> status = Arrays.asList(LeadStatus.notInterested, LeadStatus.finalized);
|
182 |
List<LeadStatus> status = Arrays.asList(LeadStatus.notInterested, LeadStatus.finalized);
|
| 153 |
|
183 |
|
| 154 |
@RequestMapping(value = "/getOpenLead", method = RequestMethod.GET)
|
184 |
@RequestMapping(value = "/getOpenLead", method = RequestMethod.GET)
|
| 155 |
public String getOpenLead(HttpServletRequest request,
|
185 |
public String getOpenLead(HttpServletRequest request,
|
| 156 |
@RequestParam(name = "leadStatus", required = false, defaultValue = "All") List<LeadStatus> leadStatus,
|
186 |
@RequestParam(name = "leadStatus", required = false, defaultValue = "All") List<LeadStatus> leadStatus,
|
| Line 382... |
Line 412... |
| 382 |
model.addAttribute("leadSeconds", leadSeconds);
|
412 |
model.addAttribute("leadSeconds", leadSeconds);
|
| 383 |
model.addAttribute("leadFirsts", leadFirsts);
|
413 |
model.addAttribute("leadFirsts", leadFirsts);
|
| 384 |
model.addAttribute("lwDays", lwDays);
|
414 |
model.addAttribute("lwDays", lwDays);
|
| 385 |
|
415 |
|
| 386 |
model.addAttribute("selectedLeadStatus", leadStatus.get(0));
|
416 |
model.addAttribute("selectedLeadStatus", leadStatus.get(0));
|
| - |
|
417 |
|
| - |
|
418 |
List<DBObject> mobileBrands = mongoClient.getAllBrandsToDisplay(3);
|
| - |
|
419 |
|
| - |
|
420 |
List<String> brands = mobileBrands.stream().map(x -> (String) x.get("name")).collect(Collectors.toList());
|
| - |
|
421 |
|
| - |
|
422 |
model.addAttribute("brands", brands);
|
| - |
|
423 |
|
| 387 |
return "lead";
|
424 |
return "lead";
|
| 388 |
|
425 |
|
| 389 |
}
|
426 |
}
|
| 390 |
|
427 |
|
| 391 |
public ChartLeadModel getLeadChart(List<Lead> leads) throws ProfitMandiBusinessException {
|
428 |
public ChartLeadModel getLeadChart(List<Lead> leads) throws ProfitMandiBusinessException {
|
| Line 649... |
Line 686... |
| 649 |
authRepository.selectAllActiveUser().stream().collect(Collectors.toMap(x -> x.getId(), x -> x)));
|
686 |
authRepository.selectAllActiveUser().stream().collect(Collectors.toMap(x -> x.getId(), x -> x)));
|
| 650 |
|
687 |
|
| 651 |
return "lead_activity_modal";
|
688 |
return "lead_activity_modal";
|
| 652 |
}
|
689 |
}
|
| 653 |
|
690 |
|
| - |
|
691 |
@RequestMapping(value = "/getLead", method = RequestMethod.GET)
|
| - |
|
692 |
public ResponseEntity<?> getLead(HttpServletRequest request, @RequestParam int leadId) throws Exception {
|
| - |
|
693 |
Lead lead = leadRepository.selectById(leadId);
|
| - |
|
694 |
|
| - |
|
695 |
LeadDetail leadDetail = leadDetailRepository.selectByLeadId(lead.getId());
|
| - |
|
696 |
if (leadDetail != null) {
|
| - |
|
697 |
lead.setOutLetName(leadDetail.getOutletName());
|
| - |
|
698 |
}
|
| - |
|
699 |
|
| - |
|
700 |
return responseSender.ok(lead);
|
| - |
|
701 |
|
| - |
|
702 |
}
|
| - |
|
703 |
|
| 654 |
@RequestMapping(value = "/createLead", method = RequestMethod.POST)
|
704 |
@RequestMapping(value = "/createLead", method = RequestMethod.POST)
|
| 655 |
public String CreateLead(HttpServletRequest request, @RequestBody CreateRefferalRequest createRefferalRequest,
|
705 |
public String CreateLead(HttpServletRequest request, @RequestBody CreateRefferalRequest createRefferalRequest,
|
| 656 |
Model model) throws Exception {
|
706 |
Model model) throws Exception {
|
| 657 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
707 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 658 |
|
708 |
|
| Line 707... |
Line 757... |
| 707 |
@RequestBody CreateLeacdActivityRequest createLeadActivityRequest, Model model) throws Exception {
|
757 |
@RequestBody CreateLeacdActivityRequest createLeadActivityRequest, Model model) throws Exception {
|
| 708 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
758 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 709 |
|
759 |
|
| 710 |
AuthUser authUser = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
|
760 |
AuthUser authUser = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
|
| 711 |
|
761 |
|
| - |
|
762 |
LeadDetail leadDetail = leadDetailRepository.selectByLeadId(createLeadActivityRequest.getId());
|
| - |
|
763 |
|
| - |
|
764 |
if (leadDetail == null) {
|
| - |
|
765 |
|
| - |
|
766 |
throw new ProfitMandiBusinessException("LeadDetail", "", "Please fill lead detail");
|
| - |
|
767 |
}
|
| - |
|
768 |
|
| 712 |
LeadActivity leadActivity = new LeadActivity();
|
769 |
LeadActivity leadActivity = new LeadActivity();
|
| 713 |
leadActivity.setLeadId(createLeadActivityRequest.getId());
|
770 |
leadActivity.setLeadId(createLeadActivityRequest.getId());
|
| 714 |
leadActivity.setRemark(createLeadActivityRequest.getRemark());
|
771 |
leadActivity.setRemark(createLeadActivityRequest.getRemark());
|
| 715 |
|
772 |
|
| 716 |
LOGGER.info("createRefferalRequest" + createLeadActivityRequest);
|
773 |
LOGGER.info("createRefferalRequest" + createLeadActivityRequest);
|
| Line 868... |
Line 925... |
| 868 |
|
925 |
|
| 869 |
return "team-commitment";
|
926 |
return "team-commitment";
|
| 870 |
|
927 |
|
| 871 |
}
|
928 |
}
|
| 872 |
|
929 |
|
| - |
|
930 |
@RequestMapping(value = "/leadDetail", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
|
| - |
|
931 |
public String leadDetail(HttpServletRequest request, @RequestBody LeadDetailModel leadDetailModel, Model model)
|
| - |
|
932 |
throws Exception {
|
| - |
|
933 |
|
| - |
|
934 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| - |
|
935 |
AuthUser authUser = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
|
| - |
|
936 |
LeadDetail leadDetail = leadDetailRepository.selectByLeadId(leadDetailModel.getLeadId());
|
| - |
|
937 |
if (leadDetail == null) {
|
| - |
|
938 |
leadDetail = new LeadDetail();
|
| - |
|
939 |
leadDetail.setLeadId(leadDetailModel.getLeadId());
|
| - |
|
940 |
leadDetail.setOutletName(leadDetailModel.getOutletName());
|
| - |
|
941 |
leadDetail.setCounterSize(leadDetailModel.getCounterSize());
|
| - |
|
942 |
leadDetail.setCreatedBy(authUser.getId());
|
| - |
|
943 |
|
| - |
|
944 |
leadDetail.setFrontp(leadDetailModel.getFrontp());
|
| - |
|
945 |
leadDetail.setFrontWithMarket(leadDetailModel.getFrontWithMarket());
|
| - |
|
946 |
leadDetail.setInternalLongShot(leadDetailModel.getInternalLongShot());
|
| - |
|
947 |
leadDetail.setInternalLeftWall(leadDetailModel.getInternalLeftWall());
|
| - |
|
948 |
leadDetail.setInternalRightWall(leadDetailModel.getInternalRightWall());
|
| - |
|
949 |
|
| - |
|
950 |
leadDetail.setCreatedTimestamp(LocalDateTime.now());
|
| - |
|
951 |
|
| - |
|
952 |
leadDetailRepository.persist(leadDetail);
|
| - |
|
953 |
for (LeadBrandModel leadBrandModel : leadDetailModel.getLeadBrands()) {
|
| - |
|
954 |
|
| - |
|
955 |
LeadBrand leadBrand = new LeadBrand();
|
| - |
|
956 |
leadBrand.setBrand(leadBrandModel.getBrand());
|
| - |
|
957 |
leadBrand.setValue(leadBrand.getValue());
|
| - |
|
958 |
leadBrand.setLeadDetailId(leadDetail.getId());
|
| - |
|
959 |
leadBrand.setLeadId(leadDetail.getLeadId());
|
| - |
|
960 |
leadBrand.setCreatedTimestamp(LocalDateTime.now());
|
| - |
|
961 |
leadBrandRepository.persist(leadBrand);
|
| - |
|
962 |
|
| - |
|
963 |
}
|
| - |
|
964 |
} else {
|
| - |
|
965 |
throw new ProfitMandiBusinessException("LeadDetail", "", "Lead Detail Already Created");
|
| - |
|
966 |
}
|
| - |
|
967 |
|
| - |
|
968 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| - |
|
969 |
|
| - |
|
970 |
return "response";
|
| - |
|
971 |
|
| - |
|
972 |
}
|
| - |
|
973 |
|
| - |
|
974 |
@RequestMapping(value = "/getLeadDetail", method = RequestMethod.GET)
|
| - |
|
975 |
public String getLeadDetail(HttpServletRequest request, Model model) throws Exception {
|
| - |
|
976 |
|
| - |
|
977 |
List<LeadDetail> leadDetails = leadDetailRepository.selectAll();
|
| - |
|
978 |
|
| - |
|
979 |
List<DBObject> mobileBrands = mongoClient.getAllBrandsToDisplay(3);
|
| - |
|
980 |
|
| - |
|
981 |
List<String> brands = mobileBrands.stream().map(x -> (String) x.get("name")).collect(Collectors.toList());
|
| - |
|
982 |
|
| - |
|
983 |
model.addAttribute("brands", brands);
|
| - |
|
984 |
if (!leadDetails.isEmpty()) {
|
| - |
|
985 |
|
| - |
|
986 |
List<Integer> detailsIds = leadDetails.stream().map(x -> x.getId()).collect(Collectors.toList());
|
| - |
|
987 |
|
| - |
|
988 |
List<Integer> leadIds = leadDetails.stream().map(x -> x.getLeadId()).collect(Collectors.toList());
|
| - |
|
989 |
|
| - |
|
990 |
Map<Integer, Lead> leadMap = leadRepository.selectAllByIds(leadIds).stream()
|
| - |
|
991 |
.collect(Collectors.toMap(x -> x.getId(), x -> x));
|
| - |
|
992 |
|
| - |
|
993 |
Map<Integer, Optional<LeadActivity>> leadActivityMap = leadActivityRepository.selectAllByleadIds(leadIds)
|
| - |
|
994 |
.stream().collect(Collectors.groupingBy(x -> x.getLeadId(),
|
| - |
|
995 |
Collectors.maxBy(Comparator.comparing(LeadActivity::getId).reversed())));
|
| - |
|
996 |
|
| - |
|
997 |
model.addAttribute("leadActivityMap", leadActivityMap);
|
| - |
|
998 |
|
| - |
|
999 |
List<LeadBrand> leadBrands = leadBrandRepository.selectByLeadDetailId(detailsIds);
|
| - |
|
1000 |
|
| - |
|
1001 |
LOGGER.info("leadBrands {}" + leadBrands);
|
| - |
|
1002 |
|
| - |
|
1003 |
Map<Integer, Map<String, Integer>> leadDetailBrandValue = new HashMap<>();
|
| - |
|
1004 |
|
| - |
|
1005 |
Map<Integer, List<LeadBrand>> leadDetail = leadBrands.stream()
|
| - |
|
1006 |
.collect(Collectors.groupingBy(x -> x.getLeadDetailId(), Collectors.toList()));
|
| - |
|
1007 |
|
| - |
|
1008 |
for (Entry<Integer, List<LeadBrand>> leadDetailEntry : leadDetail.entrySet()) {
|
| - |
|
1009 |
|
| - |
|
1010 |
Map<String, Integer> brandValue = new HashMap<>();
|
| - |
|
1011 |
|
| - |
|
1012 |
for (LeadBrand leadBrand : leadDetailEntry.getValue()) {
|
| - |
|
1013 |
brandValue.put(leadBrand.getBrand(), leadBrand.getValue());
|
| - |
|
1014 |
|
| - |
|
1015 |
}
|
| - |
|
1016 |
leadDetailBrandValue.put(leadDetailEntry.getKey(), brandValue);
|
| - |
|
1017 |
}
|
| - |
|
1018 |
|
| - |
|
1019 |
LOGGER.info("leadDetailBrandValue {}" + leadDetailBrandValue);
|
| - |
|
1020 |
|
| - |
|
1021 |
model.addAttribute("leadDetailBrandValue", leadDetailBrandValue);
|
| - |
|
1022 |
|
| - |
|
1023 |
model.addAttribute("leadMap", leadMap);
|
| - |
|
1024 |
}
|
| - |
|
1025 |
|
| - |
|
1026 |
model.addAttribute("leadDetails", leadDetails);
|
| - |
|
1027 |
|
| - |
|
1028 |
Map<Integer, AuthUser> authIdAndAuthUserMap = authRepository.selectAllActiveUser().stream()
|
| - |
|
1029 |
.collect(Collectors.toMap(x -> x.getId(), x -> x));
|
| - |
|
1030 |
model.addAttribute("authIdAndAuthUserMap", authIdAndAuthUserMap);
|
| - |
|
1031 |
|
| - |
|
1032 |
return "lead-detail";
|
| - |
|
1033 |
|
| - |
|
1034 |
}
|
| - |
|
1035 |
|
| - |
|
1036 |
@RequestMapping(value = "/getLeadDetailByLeadId", method = RequestMethod.GET)
|
| - |
|
1037 |
public ResponseEntity<?> getLeadDetailByLeadId(HttpServletRequest request, @RequestParam int leadId, Model model)
|
| - |
|
1038 |
throws Exception {
|
| - |
|
1039 |
|
| - |
|
1040 |
LeadDetail leadDetail = leadDetailRepository.selectByLeadId(leadId);
|
| - |
|
1041 |
return responseSender.ok(leadDetail);
|
| - |
|
1042 |
|
| - |
|
1043 |
}
|
| - |
|
1044 |
|
| 873 |
@RequestMapping(value = "/getTeamCommitment", method = RequestMethod.GET)
|
1045 |
@RequestMapping(value = "/getTeamCommitment", method = RequestMethod.GET)
|
| 874 |
public String getTeamCommitments(HttpServletRequest request, @RequestParam LocalDateTime date, Model model)
|
1046 |
public String getTeamCommitments(HttpServletRequest request, @RequestParam LocalDateTime date, Model model)
|
| 875 |
throws Exception {
|
1047 |
throws Exception {
|
| 876 |
|
1048 |
|
| 877 |
List<TeamCommitmentModel> commitments = partnerCollectionPlanRepository
|
1049 |
List<TeamCommitmentModel> commitments = partnerCollectionPlanRepository
|