| 30308 |
amit.gupta |
1 |
package com.smartdukaan.cron.scheduled;
|
|
|
2 |
|
|
|
3 |
import com.spice.profitmandi.dao.model.ImeiActivationTimestampModel;
|
|
|
4 |
import com.spice.profitmandi.dao.repository.fofo.ActivatedImeiRepository;
|
|
|
5 |
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
6 |
import org.springframework.stereotype.Component;
|
|
|
7 |
import org.springframework.transaction.annotation.Transactional;
|
|
|
8 |
|
|
|
9 |
import java.util.List;
|
|
|
10 |
import java.util.stream.Collectors;
|
|
|
11 |
|
|
|
12 |
@Component
|
| 30352 |
amit.gupta |
13 |
@Transactional(rollbackFor = Throwable.class)
|
| 30308 |
amit.gupta |
14 |
public class StandAlone {
|
|
|
15 |
|
|
|
16 |
@Autowired
|
| 30352 |
amit.gupta |
17 |
private OppoImeiActivationService oppoImeiActivationService;
|
| 30308 |
amit.gupta |
18 |
|
|
|
19 |
@Autowired
|
| 30352 |
amit.gupta |
20 |
private ActivatedImeiRepository activatedImeiRepository;
|
| 30308 |
amit.gupta |
21 |
|
|
|
22 |
public void checkOppoImeiStatus() throws Exception {
|
| 30352 |
amit.gupta |
23 |
//Bring just 25 imeis in 1 go
|
| 30308 |
amit.gupta |
24 |
List<ImeiActivationTimestampModel> imeiActivationTimestampModels = activatedImeiRepository.selectImeiActivationByBrand("Oppo");
|
|
|
25 |
List<String> imeis = imeiActivationTimestampModels.stream().map(x -> x.getSerialNumber()).collect(Collectors.toList());
|
| 30352 |
amit.gupta |
26 |
oppoImeiActivationService.updateActivationDate(imeis);
|
| 30308 |
amit.gupta |
27 |
}
|
|
|
28 |
}
|