|
|
@@ -22,6 +22,7 @@ import java.util.TimerTask;
|
22
|
22
|
import ai.pai.lensman.BuildConfig;
|
23
|
23
|
import ai.pai.lensman.bean.PhotoBean;
|
24
|
24
|
import ai.pai.lensman.bean.SessionBean;
|
|
25
|
+import ai.pai.lensman.db.DBService;
|
25
|
26
|
import ai.pai.lensman.utils.BoxUrlContainer;
|
26
|
27
|
import ai.pai.lensman.utils.Constants;
|
27
|
28
|
import ai.pai.lensman.utils.HttpPostTask;
|
|
|
@@ -34,6 +35,7 @@ public class SessionInteractor {
|
34
|
35
|
private HttpPostTask sessionStartTask;
|
35
|
36
|
private HttpPostTask sessionEndTask;
|
36
|
37
|
private String randomSessionId;
|
|
38
|
+ private long maxId = 0;
|
37
|
39
|
private boolean isWorking;
|
38
|
40
|
|
39
|
41
|
private static final String TAG = "SessionInteractor";
|
|
|
@@ -60,6 +62,14 @@ public class SessionInteractor {
|
60
|
62
|
return;
|
61
|
63
|
}
|
62
|
64
|
cancelTask(sessionStartTask);
|
|
65
|
+ ArrayList<PhotoBean> photoList = DBService.getInstance().getPhotoListBySessionId(sessionBean.sessionId);
|
|
66
|
+ if(photoList!=null && photoList.size()>0){
|
|
67
|
+ for(PhotoBean photoBean : photoList){
|
|
68
|
+ if(photoBean.photoId>maxId){
|
|
69
|
+ maxId = photoBean.photoId;
|
|
70
|
+ }
|
|
71
|
+ }
|
|
72
|
+ }
|
63
|
73
|
HashMap<String,String> params = new HashMap<>();
|
64
|
74
|
params.put("lensman",sessionBean.lensmanId);
|
65
|
75
|
randomSessionId = sessionBean.sessionId+"_"+(new Random().nextInt(9999)+10000);
|
|
|
@@ -148,6 +158,7 @@ public class SessionInteractor {
|
148
|
158
|
HashMap<String,String> params = new HashMap<>();
|
149
|
159
|
params.put("lensman",sessionBean.lensmanId);
|
150
|
160
|
params.put("session",randomSessionId);
|
|
161
|
+ params.put("maxid",String.valueOf(maxId));
|
151
|
162
|
HttpPostTask fetchThumbnailTask = new HttpPostTask(params){
|
152
|
163
|
ArrayList<PhotoBean> photoList = new ArrayList<>();
|
153
|
164
|
@Override
|
|
|
@@ -173,6 +184,9 @@ public class SessionInteractor {
|
173
|
184
|
bean.lensmanId = sessionBean.lensmanId;
|
174
|
185
|
bean.sessionSeq = sessionBean.sessionSeq;
|
175
|
186
|
bean.sessionDate = sessionBean.sessionDate;
|
|
187
|
+ if(bean.photoId>maxId){
|
|
188
|
+ maxId = bean.photoId;
|
|
189
|
+ }
|
176
|
190
|
photoList.add(bean);
|
177
|
191
|
}
|
178
|
192
|
}
|