| Line 215... |
Line 215... |
| 215 |
}
|
215 |
}
|
| 216 |
LOGGER.info("partners" + partners);
|
216 |
LOGGER.info("partners" + partners);
|
| 217 |
return responseSender.ok(partners);
|
217 |
return responseSender.ok(partners);
|
| 218 |
}
|
218 |
}
|
| 219 |
|
219 |
|
| - |
|
220 |
@RequestMapping(value = "/franchise-first-visit", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
| - |
|
221 |
@ApiImplicitParams({
|
| - |
|
222 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| - |
|
223 |
public ResponseEntity<?> FranchiseFirstVisit(HttpServletRequest request,
|
| - |
|
224 |
@RequestBody CreateFranchiseeRequest createFranchiseeRequest) throws Exception {
|
| - |
|
225 |
|
| - |
|
226 |
FranchiseeVisit franchiseeVisit = new FranchiseeVisit();
|
| - |
|
227 |
franchiseeVisit.setFofoId(createFranchiseeRequest.getFofoId());
|
| - |
|
228 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(createFranchiseeRequest.getFofoId());
|
| - |
|
229 |
|
| - |
|
230 |
franchiseeVisit.setPartnerName(customRetailer.getBusinessName());
|
| - |
|
231 |
franchiseeVisit.setAgenda(createFranchiseeRequest.getAgenda());
|
| - |
|
232 |
franchiseeVisit.setCreatedTimestamp(LocalDateTime.now());
|
| - |
|
233 |
franchiseeVisit.setUpdatedTimestamp(LocalDateTime.now());
|
| - |
|
234 |
franchiseeVisit.setStatus(FranchiseeVisitStatus.OPEN);
|
| - |
|
235 |
franchiseeVisit.setSchelduleTimestamp(createFranchiseeRequest.getFirstSchelduleTimestamp());
|
| - |
|
236 |
|
| - |
|
237 |
AuthUser authUser = authRepository.selectByGmailId(createFranchiseeRequest.getCreatedBy());
|
| - |
|
238 |
|
| - |
|
239 |
String authUserName = authUser.getFirstName() + " " + authUser.getLastName();
|
| - |
|
240 |
franchiseeVisit.setCreatedBy(authUserName);
|
| - |
|
241 |
franchiseeVisit.setAuthId(authUser.getId());
|
| - |
|
242 |
|
| - |
|
243 |
franchiseeVisitRepository.persist(franchiseeVisit);
|
| - |
|
244 |
|
| - |
|
245 |
return responseSender.ok(true);
|
| - |
|
246 |
}
|
| - |
|
247 |
|
| 220 |
@RequestMapping(value = "/franchise-visit", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
248 |
@RequestMapping(value = "/franchise-visit", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 221 |
@ApiImplicitParams({
|
249 |
@ApiImplicitParams({
|
| 222 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
250 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 223 |
public ResponseEntity<?> FranchiseVisit(HttpServletRequest request,
|
251 |
public ResponseEntity<?> FranchiseVisit(HttpServletRequest request,
|
| 224 |
@RequestBody CreateFranchiseeRequest createFranchiseeRequest) throws Exception {
|
252 |
@RequestBody CreateFranchiseeRequest createFranchiseeRequest) throws Exception {
|
| 225 |
|
253 |
|
| 226 |
FranchiseeVisit franchiseeVisit = new FranchiseeVisit();
|
254 |
FranchiseeVisit franchiseeVisit = franchiseeVisitRepository.selectById(createFranchiseeRequest.getId());
|
| 227 |
franchiseeVisit.setFofoId(createFranchiseeRequest.getFofoId());
|
255 |
franchiseeVisit.setFofoId(createFranchiseeRequest.getFofoId());
|
| 228 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(createFranchiseeRequest.getFofoId());
|
256 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(createFranchiseeRequest.getFofoId());
|
| 229 |
|
257 |
|
| 230 |
franchiseeVisit.setPartnerName(customRetailer.getBusinessName());
|
258 |
franchiseeVisit.setPartnerName(customRetailer.getBusinessName());
|
| 231 |
franchiseeVisit.setAgenda(createFranchiseeRequest.getAgenda());
|
259 |
franchiseeVisit.setAgenda(createFranchiseeRequest.getAgenda());
|
| Line 249... |
Line 277... |
| 249 |
} else {
|
277 |
} else {
|
| 250 |
franchiseeVisit.setStatus(FranchiseeVisitStatus.CLOSE);
|
278 |
franchiseeVisit.setStatus(FranchiseeVisitStatus.CLOSE);
|
| 251 |
}
|
279 |
}
|
| 252 |
|
280 |
|
| 253 |
AuthUser authUser = authRepository.selectByGmailId(createFranchiseeRequest.getCreatedBy());
|
281 |
AuthUser authUser = authRepository.selectByGmailId(createFranchiseeRequest.getCreatedBy());
|
| - |
|
282 |
// change
|
| - |
|
283 |
// AuthUser authUser =
|
| - |
|
284 |
// authRepository.selectByGmailId("adeelyazdani.pmps@gmail.com");
|
| 254 |
|
285 |
|
| 255 |
String authUserName = authUser.getFirstName() + " " + authUser.getLastName();
|
286 |
String authUserName = authUser.getFirstName() + " " + authUser.getLastName();
|
| 256 |
franchiseeVisit.setCreatedBy(authUserName);
|
287 |
franchiseeVisit.setCreatedBy(authUserName);
|
| 257 |
franchiseeVisit.setAuthId(authUser.getId());
|
288 |
franchiseeVisit.setAuthId(authUser.getId());
|
| 258 |
|
289 |
|
| Line 299... |
Line 330... |
| 299 |
List<FranchiseeActivity> franchiseeActivities = franchiseeActivityRepository.selectByFranchiseeVisitId(id);
|
330 |
List<FranchiseeActivity> franchiseeActivities = franchiseeActivityRepository.selectByFranchiseeVisitId(id);
|
| 300 |
return responseSender.ok(franchiseeActivities);
|
331 |
return responseSender.ok(franchiseeActivities);
|
| 301 |
|
332 |
|
| 302 |
}
|
333 |
}
|
| 303 |
|
334 |
|
| - |
|
335 |
@RequestMapping(value = "/getFranchiseeInfo", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
| - |
|
336 |
@ApiImplicitParams({
|
| - |
|
337 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| - |
|
338 |
public ResponseEntity<?> getFranchiseeInfo(HttpServletRequest request, @RequestParam(name = "id") int id)
|
| - |
|
339 |
throws ProfitMandiBusinessException {
|
| - |
|
340 |
FranchiseeVisit franchiseeVisit = franchiseeVisitRepository.selectById(id);
|
| - |
|
341 |
|
| - |
|
342 |
return responseSender.ok(franchiseeVisit);
|
| - |
|
343 |
|
| - |
|
344 |
}
|
| - |
|
345 |
|
| 304 |
@RequestMapping(value = "/franchise-visit-update", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
346 |
@RequestMapping(value = "/franchise-visit-update", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 305 |
@ApiImplicitParams({
|
347 |
@ApiImplicitParams({
|
| 306 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
348 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 307 |
public ResponseEntity<?> franchiseVisitUpdate(HttpServletRequest request, @RequestParam(name = "id") int id,
|
349 |
public ResponseEntity<?> franchiseVisitUpdate(HttpServletRequest request, @RequestParam(name = "id") int id,
|
| 308 |
@RequestParam(name = "action") FranchiseeActivityStatus action,
|
350 |
@RequestParam(name = "action") FranchiseeActivityStatus action,
|
| Line 332... |
Line 374... |
| 332 |
franchiseeActivity.setCreatedTimestamp(LocalDateTime.now());
|
374 |
franchiseeActivity.setCreatedTimestamp(LocalDateTime.now());
|
| 333 |
franchiseeActivityRepository.persist(franchiseeActivity);
|
375 |
franchiseeActivityRepository.persist(franchiseeActivity);
|
| 334 |
franchiseeVisit.setFranchiseActivityId(franchiseeActivity.getId());
|
376 |
franchiseeVisit.setFranchiseActivityId(franchiseeActivity.getId());
|
| 335 |
franchiseeVisit.setStatus(FranchiseeVisitStatus.CLOSE);
|
377 |
franchiseeVisit.setStatus(FranchiseeVisitStatus.CLOSE);
|
| 336 |
franchiseeVisit.setUpdatedTimestamp(LocalDateTime.now());
|
378 |
franchiseeVisit.setUpdatedTimestamp(LocalDateTime.now());
|
| 337 |
|
379 |
|
| 338 |
}
|
380 |
}
|
| 339 |
|
381 |
|
| 340 |
return responseSender.ok(true);
|
382 |
return responseSender.ok(true);
|
| 341 |
|
383 |
|
| 342 |
}
|
384 |
}
|