| Line 476... |
Line 476... |
| 476 |
|| priceDropHoldIMEI.getStatus().equals(status)) {
|
476 |
|| priceDropHoldIMEI.getStatus().equals(status)) {
|
| 477 |
continue;
|
477 |
continue;
|
| 478 |
}
|
478 |
}
|
| 479 |
priceDropIMEIsToHolds.add(priceDropHoldIMEI);
|
479 |
priceDropIMEIsToHolds.add(priceDropHoldIMEI);
|
| 480 |
priceDropHoldIMEI.setStatus(PriceDropImeiStatus.PENDING);
|
480 |
priceDropHoldIMEI.setStatus(PriceDropImeiStatus.PENDING);
|
| 481 |
priceDropHoldIMEI.setUpdateTimestamp(LocalDateTime.now());
|
481 |
//priceDropHoldIMEI.setUpdateTimestamp(LocalDateTime.now());
|
| 482 |
} else {
|
482 |
} else {
|
| 483 |
throw new ProfitMandiBusinessException("INVALID STATUS", "PENDING",
|
483 |
throw new ProfitMandiBusinessException("INVALID STATUS", "PENDING",
|
| 484 |
"Pending Status is allowed only for Hold IMIEs");
|
484 |
"Pending Status is allowed only for Hold IMIEs");
|
| 485 |
}
|
485 |
}
|
| 486 |
}
|
486 |
}
|
| Line 494... |
Line 494... |
| 494 |
|
494 |
|
| 495 |
List<PriceDropIMEI> priceDropIMEIsToProcess = priceDropIMEIs.stream()
|
495 |
List<PriceDropIMEI> priceDropIMEIsToProcess = priceDropIMEIs.stream()
|
| 496 |
.filter(x -> priceDropImeisModel.getUpdatedImeis().contains(x.getImei()))
|
496 |
.filter(x -> priceDropImeisModel.getUpdatedImeis().contains(x.getImei()))
|
| 497 |
.filter(x -> !x.getStatus().equals(finalStatus)).collect(Collectors.toList());
|
497 |
.filter(x -> !x.getStatus().equals(finalStatus)).collect(Collectors.toList());
|
| 498 |
|
498 |
|
| 499 |
for (PriceDropIMEI priceDropIMEI : priceDropIMEIsToProcess) {
|
499 |
/*for (PriceDropIMEI priceDropIMEI : priceDropIMEIsToProcess) {
|
| 500 |
priceDropIMEI.setUpdateTimestamp(LocalDateTime.now());
|
500 |
priceDropIMEI.setUpdateTimestamp(LocalDateTime.now());
|
| 501 |
}
|
501 |
}*/
|
| 502 |
|
502 |
|
| 503 |
if (status.equals(PriceDropImeiStatus.APPROVED)) {
|
503 |
if (status.equals(PriceDropImeiStatus.APPROVED)) {
|
| 504 |
priceDropService.processPriceDrop(priceDropImeisModel.getPriceDropId(),
|
504 |
priceDropService.processPriceDrop(priceDropImeisModel.getPriceDropId(),
|
| 505 |
priceDropImeisModel.getUpdatedImeis());
|
505 |
priceDropImeisModel.getUpdatedImeis());
|
| 506 |
}
|
506 |
}
|
| 507 |
for (PriceDropIMEI priceDropImei : priceDropIMEIsToProcess) {
|
507 |
for (PriceDropIMEI priceDropImei : priceDropIMEIsToProcess) {
|
| 508 |
if (status.equals(PriceDropImeiStatus.REJECTED)
|
508 |
if (status.equals(PriceDropImeiStatus.REJECTED)
|
| 509 |
&& priceDropImei.getStatus().equals(PriceDropImeiStatus.PENDING)) {
|
509 |
&& priceDropImei.getStatus().equals(PriceDropImeiStatus.PENDING)) {
|
| 510 |
priceDropImei.setStatus(PriceDropImeiStatus.REJECTED);
|
510 |
priceDropImei.setStatus(PriceDropImeiStatus.REJECTED);
|
| 511 |
priceDropImei.setRejectionReason(priceDropImeisModel.getRejectionReason());
|
511 |
priceDropImei.setRejectionReason(priceDropImeisModel.getRejectionReason());
|
| - |
|
512 |
priceDropImei.setRejectTimestamp(LocalDateTime.now());
|
| 512 |
} else if (status.equals(PriceDropImeiStatus.HOLD)) {
|
513 |
} else if (status.equals(PriceDropImeiStatus.HOLD)) {
|
| 513 |
if (priceDropImei.getStatus().equals(PriceDropImeiStatus.PENDING)) {
|
514 |
if (priceDropImei.getStatus().equals(PriceDropImeiStatus.PENDING)) {
|
| 514 |
priceDropImei.setStatus(PriceDropImeiStatus.HOLD);
|
515 |
priceDropImei.setStatus(PriceDropImeiStatus.HOLD);
|
| 515 |
} else {
|
516 |
} else {
|
| 516 |
throw new ProfitMandiBusinessException("INVALID STATUS", status, "only allowed For PENDING IMEIs");
|
517 |
throw new ProfitMandiBusinessException("INVALID STATUS", status, "only allowed For PENDING IMEIs");
|