| Line 22... |
Line 22... |
| 22 |
import com.spice.profitmandi.dao.repository.fofo.PincodePartnerRepository;
|
22 |
import com.spice.profitmandi.dao.repository.fofo.PincodePartnerRepository;
|
| 23 |
import com.spice.profitmandi.dao.repository.user.LocationRepository;
|
23 |
import com.spice.profitmandi.dao.repository.user.LocationRepository;
|
| 24 |
import com.spice.profitmandi.dao.repository.user.PromoterRepository;
|
24 |
import com.spice.profitmandi.dao.repository.user.PromoterRepository;
|
| 25 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
25 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
| 26 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
26 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
| - |
|
27 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
| 27 |
import com.spice.profitmandi.service.catalog.BrandsService;
|
28 |
import com.spice.profitmandi.service.catalog.BrandsService;
|
| 28 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
29 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
| 29 |
import com.spice.profitmandi.service.user.RetailerService;
|
30 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 30 |
import com.spice.profitmandi.service.user.StoreTimelineTatService;
|
31 |
import com.spice.profitmandi.service.user.StoreTimelineTatService;
|
| 31 |
import com.spice.profitmandi.web.model.LoginDetails;
|
32 |
import com.spice.profitmandi.web.model.LoginDetails;
|
| Line 135... |
Line 136... |
| 135 |
PartnerOnBoardingPanelRepository partnerOnBoardingPanelRepository;
|
136 |
PartnerOnBoardingPanelRepository partnerOnBoardingPanelRepository;
|
| 136 |
|
137 |
|
| 137 |
@Autowired
|
138 |
@Autowired
|
| 138 |
private StoreTimelineTatService storeTimelineTatService;
|
139 |
private StoreTimelineTatService storeTimelineTatService;
|
| 139 |
|
140 |
|
| - |
|
141 |
@Autowired
|
| - |
|
142 |
private RoleManager roleManager;
|
| - |
|
143 |
|
| - |
|
144 |
@Autowired
|
| - |
|
145 |
private RetailerContactRepository retailerContactRepository;
|
| - |
|
146 |
|
| 140 |
@RequestMapping(value = "/retailerDetails", method = RequestMethod.GET)
|
147 |
@RequestMapping(value = "/retailerDetails", method = RequestMethod.GET)
|
| 141 |
public String retailerInfoByEmailIdOrMobileNumber(HttpServletRequest request,
|
148 |
public String retailerInfoByEmailIdOrMobileNumber(HttpServletRequest request,
|
| 142 |
@RequestParam(name = ProfitMandiConstants.EMAIL_ID_OR_MOBILE_NUMBER) String emailIdOrMobileNumber,
|
149 |
@RequestParam(name = ProfitMandiConstants.EMAIL_ID_OR_MOBILE_NUMBER) String emailIdOrMobileNumber,
|
| 143 |
Model model) throws ProfitMandiBusinessException {
|
150 |
Model model) throws ProfitMandiBusinessException {
|
| 144 |
LOGGER.info("Request Received at url {} with emailIdOrMobileNumber {}", request.getRequestURI(),
|
151 |
LOGGER.info("Request Received at url {} with emailIdOrMobileNumber {}", request.getRequestURI(),
|
| Line 1275... |
Line 1282... |
| 1275 |
@RequestMapping(value = "/getAllPartnerPincode", method = RequestMethod.GET)
|
1282 |
@RequestMapping(value = "/getAllPartnerPincode", method = RequestMethod.GET)
|
| 1276 |
public String getAllPartnerPincode(HttpServletRequest request, Model model) throws Exception {
|
1283 |
public String getAllPartnerPincode(HttpServletRequest request, Model model) throws Exception {
|
| 1277 |
return "add-partner-pincode";
|
1284 |
return "add-partner-pincode";
|
| 1278 |
}
|
1285 |
}
|
| 1279 |
|
1286 |
|
| - |
|
1287 |
@RequestMapping(value = "/alternateRetailerContacts", method = RequestMethod.GET)
|
| - |
|
1288 |
public String alternateRetailerContacts(HttpServletRequest request, Model model) throws Exception {
|
| - |
|
1289 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| - |
|
1290 |
boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
|
| - |
|
1291 |
|
| - |
|
1292 |
model.addAttribute("isAdmin", isAdmin);
|
| - |
|
1293 |
return "retailer-contacts";
|
| - |
|
1294 |
}
|
| - |
|
1295 |
|
| - |
|
1296 |
@RequestMapping(value = "/retailer-contact-list", method = RequestMethod.GET)
|
| - |
|
1297 |
public String getRetailerContactList(HttpServletRequest request, Model model, @RequestParam(defaultValue = "0") int fofoId)
|
| - |
|
1298 |
throws Exception {
|
| - |
|
1299 |
|
| - |
|
1300 |
List<RetailerContact> retailerContacts = retailerContactRepository.selectAllByRetailerId(fofoId);
|
| - |
|
1301 |
|
| - |
|
1302 |
model.addAttribute("retailerContacts", retailerContacts);
|
| - |
|
1303 |
|
| - |
|
1304 |
return "retailer-contact-list";
|
| - |
|
1305 |
|
| - |
|
1306 |
}
|
| - |
|
1307 |
|
| - |
|
1308 |
@RequestMapping(value = "/add-retailer-contact-list", method = RequestMethod.GET)
|
| - |
|
1309 |
public String updateRetailerContactList(HttpServletRequest request, Model model, @RequestParam(defaultValue = "0") int fofoId, @RequestParam String contactName, @RequestParam String contactNumber)
|
| - |
|
1310 |
throws Exception {
|
| - |
|
1311 |
|
| - |
|
1312 |
RetailerContact retailerContact = new RetailerContact();
|
| - |
|
1313 |
retailerContact.setFofoId(fofoId);
|
| - |
|
1314 |
retailerContact.setName(contactName);
|
| - |
|
1315 |
retailerContact.setMobile(contactNumber);
|
| - |
|
1316 |
retailerContact.setActive(true);
|
| - |
|
1317 |
retailerContact.setCreatedAt(LocalDateTime.now());
|
| - |
|
1318 |
retailerContactRepository.persist(retailerContact);
|
| - |
|
1319 |
|
| - |
|
1320 |
List<RetailerContact> retailerContacts = retailerContactRepository.selectAllByRetailerId(fofoId);
|
| - |
|
1321 |
|
| - |
|
1322 |
model.addAttribute("retailerContacts", retailerContacts);
|
| - |
|
1323 |
|
| - |
|
1324 |
return "retailer-contact-list";
|
| - |
|
1325 |
|
| - |
|
1326 |
}
|
| - |
|
1327 |
|
| - |
|
1328 |
@RequestMapping(value = "/update-contact-status", method = RequestMethod.GET)
|
| - |
|
1329 |
public String updateRetailerContactStatus(HttpServletRequest request, Model model, @RequestParam(defaultValue = "0") int fofoId, @RequestParam(defaultValue = "0") int contactId, @RequestParam boolean active)
|
| - |
|
1330 |
throws Exception {
|
| - |
|
1331 |
|
| - |
|
1332 |
RetailerContact retailerContact = retailerContactRepository.selectById(contactId);
|
| - |
|
1333 |
retailerContact.setActive(active);
|
| - |
|
1334 |
|
| - |
|
1335 |
List<RetailerContact> retailerContacts = retailerContactRepository.selectAllByRetailerId(fofoId);
|
| - |
|
1336 |
|
| - |
|
1337 |
model.addAttribute("retailerContacts", retailerContacts);
|
| - |
|
1338 |
|
| - |
|
1339 |
return "retailer-contact-list";
|
| - |
|
1340 |
|
| - |
|
1341 |
}
|
| - |
|
1342 |
|
| 1280 |
|
1343 |
|
| 1281 |
}
|
1344 |
}
|
| 1282 |
|
1345 |
|