| Line 201... |
Line 201... |
| 201 |
|
201 |
|
| 202 |
@RequestMapping(value = "/extendAllSchemes", method = RequestMethod.POST)
|
202 |
@RequestMapping(value = "/extendAllSchemes", method = RequestMethod.POST)
|
| 203 |
public String extendAllScheme(HttpServletRequest request, @RequestBody LocalDateTime extendDatetime, Model model)
|
203 |
public String extendAllScheme(HttpServletRequest request, @RequestBody LocalDateTime extendDatetime, Model model)
|
| 204 |
throws Exception {
|
204 |
throws Exception {
|
| 205 |
|
205 |
|
| 206 |
LOGGER.info("ExtendDatetime" + extendDatetime);
|
- |
|
| 207 |
List<Scheme> schemes = schemeRepository.selectActiveAll();
|
206 |
List<Scheme> schemes = schemeRepository.selectActiveAll();
|
| 208 |
if (schemes.size() > 0) {
|
207 |
if (schemes.size() > 0) {
|
| 209 |
for (Scheme scheme : schemes) {
|
208 |
for (Scheme scheme : schemes) {
|
| 210 |
if (scheme.getEndDateTime().isBefore(extendDatetime) && scheme.getExpireTimestamp() == null
|
209 |
if (scheme.getEndDateTime().isBefore(extendDatetime) && scheme.getExpireTimestamp() == null
|
| 211 |
&& (!(scheme.getActiveTimestamp() == null))) {
|
210 |
&& (!(scheme.getActiveTimestamp() == null))) {
|
| Line 373... |
Line 372... |
| 373 |
}
|
372 |
}
|
| 374 |
|
373 |
|
| 375 |
@RequestMapping(value = "/expireSchemeById", method = RequestMethod.PUT)
|
374 |
@RequestMapping(value = "/expireSchemeById", method = RequestMethod.PUT)
|
| 376 |
public String expireSchemeById(HttpServletRequest request,
|
375 |
public String expireSchemeById(HttpServletRequest request,
|
| 377 |
@RequestParam(name = ProfitMandiConstants.SCHEME_ID) int schemeId,
|
376 |
@RequestParam(name = ProfitMandiConstants.SCHEME_ID) int schemeId,
|
| - |
|
377 |
@RequestParam(name = ProfitMandiConstants.EXPIRE_TIMESTAMP) LocalDateTime expiryTimestamp,
|
| 378 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
378 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
| 379 |
@RequestParam(name = "limit", defaultValue = "10") int limit, Model model)
|
379 |
@RequestParam(name = "limit", defaultValue = "10") int limit, Model model)
|
| 380 |
throws ProfitMandiBusinessException {
|
380 |
throws ProfitMandiBusinessException {
|
| 381 |
schemeService.expireSchemeById(schemeId);
|
381 |
schemeService.expireSchemeById(schemeId, expiryTimestamp);
|
| 382 |
List<Scheme> schemes = schemeRepository.selectAll(offset, limit);
|
382 |
List<Scheme> schemes = schemeRepository.selectAll(offset, limit);
|
| 383 |
model.addAttribute("schemes", schemes);
|
383 |
model.addAttribute("schemes", schemes);
|
| 384 |
return "schemes-paginated";
|
384 |
return "schemes-paginated";
|
| 385 |
}
|
385 |
}
|
| 386 |
|
386 |
|