same-code nl-7 ol-7"> 12 9
 public class UploadContract {
13 10
 
14 11
     interface View extends BaseView {
15 12
 
16
-        void addNewSessionView(SessionBean bean);
17 13
         void showBoxDisconnectedView();
18 14
         void showBoxConnectedView();
19 15
         void showEmptyView();
@@ -24,6 +20,7 @@ public class UploadContract {
24 20
 
25 21
     interface Presenter extends BasePresenter{
26 22
         SessionBean createNewSession();
23
+
27 24
     }
28 25
 
29 26
 }

+ 11 - 2
app/src/main/java/ai/pai/lensman/upload/UploadPresenter.java

@@ -1,8 +1,11 @@
1 1
 package ai.pai.lensman.upload;
2 2
 
3
+import java.text.SimpleDateFormat;
3 4
 import java.util.ArrayList;
5
+import java.util.Date;
4 6
 
5 7
 import ai.pai.lensman.bean.SessionBean;
8
+import ai.pai.lensman.db.DBService;
6 9
 
7 10
 public class UploadPresenter implements UploadContract.Presenter {
8 11
 
@@ -14,12 +17,12 @@ public class UploadPresenter implements UploadContract.Presenter {
14 17
     public UploadPresenter(UploadContract.View view,String lensmanId){
15 18
         this.uploadView = view;
16 19
         this.lensmanId = lensmanId;
17
-        sessionList = new ArrayList<>();
18 20
     }
19 21
 
20 22
 
21 23
     @Override
22 24
     public void start() {
25
+        sessionList = DBService.getInstance().getSessionBeanListByDay(getSessionDateInLongFormat());
23 26
         if(sessionList.size()==0){
24 27
             uploadView.showEmptyView();
25 28
         }else{
@@ -38,10 +41,16 @@ public class UploadPresenter implements UploadContract.Presenter {
38 41
     public SessionBean createNewSession() {
39 42
         SessionBean sessionBean = new SessionBean();
40 43
         sessionBean.lensmanId = lensmanId;
41
-        sessionBean.sessionDate=20160813;
44
+        sessionBean.sessionDate=getSessionDateInLongFormat();
42 45
         sessionBean.sessionSeq = sessionSeq+1;
43 46
         sessionBean.sessionId ="chengzhenyu_test"+sessionBean.sessionSeq;
44 47
         sessionList.add(sessionBean);
45 48
         return sessionBean;
46 49
     }
50
+
51
+    private long getSessionDateInLongFormat(){
52
+        SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
53
+        String dateStr = format.format(new Date());
54
+        return Long.parseLong(dateStr);
55
+    }
47 56
 }

adminSystem - Gogs: Go Git Service

Aucune description

.npmignore 28B

    /node_modules /?.js /*.pac