="lines-num lines-num-new"> 27
     }
34 28
 
35
-    private synchronized void startUpload(){
36
-        if(currentPhoto!=null){
37
-            LogHelper.d("czy","当前有图片正在上传"+currentPhoto);
38
-            return;
39
-        }
40
-         currentPhoto = DBService.getInstance().getNextUploadPhoto();
41
-        if(currentPhoto==null){
42
-            LogHelper.d("czy","本地图片已全部上传");
43
-            return;
44
-        }
45
-        LogHelper.d("czy","即将上传的照片是"+currentPhoto);
46
-        new UploadTask(currentPhoto,this).executeOnExecutor(ThreadExecutor.getInstance().getExecutor());
47
-    }
29
+    private void startQuery(){
30
+        HashMap<String,String> params = new HashMap<>();
31
+        params.put("user_id", Preferences.getInstance().getLensManId());
32
+        new HttpPostTask(params){
33
+            OrderBean orderBean;
34
+            @Override
35
+            protected boolean parseResponse(String response) {
36
+                orderBean = new OrderBean();
48 37
 
49
-    @Override
50
-    public void onPhotoUploadSucceed(PhotoBean bean) {
51
-        if(bean.equals(currentPhoto)){
52
-            currentPhoto.uploadStatus =  PhotoBean.UploadStatus.STATUS_SUCCESS;
53
-            DBService.getInstance().updatePhotoBean(currentPhoto);
54
-            if(listener!=null){
55
-                listener.onPhotoUploaded(currentPhoto);
38
+                return super.parseResponse(response);
56 39
             }
57
-            currentPhoto = null;
58
-        }
59
-        startUpload();
60
-    }
61 40
 
62
-    @Override
63
-    public void onPhotoUploadFail(PhotoBean bean) {
64
-        if(bean.equals(currentPhoto)){
65
-            currentPhoto.uploadStatus =  PhotoBean.UploadStatus.STATUS_ERROR;
66
-            DBService.getInstance().updatePhotoBean(currentPhoto);
67
-            if(listener!=null){
68
-                listener.onPhotoUploadError(currentPhoto);
41
+            @Override
42
+            protected void onPostSuccess() {
43
+                super.onPostSuccess();
44
+                onNewOrderArrived(orderBean);
69 45
             }
70
-            currentPhoto = null;
71
-        }
72
-        startUpload();
73
-    }
74 46
 
75
-    public void setPhotoUploadListener(PhotoUploadListener listener){
76
-        this.listener = listener;
47
+            @Override
48
+            protected void onPostFail() {
49
+                super.onPostFail();
50
+            }
51
+        }.executeOnExecutor(ThreadExecutor.getInstance().getExecutor());
52
+
77 53
     }
78 54
 
79
-    public interface PhotoUploadListener{
80
-        void onPhotoUploaded(PhotoBean bean);
81
-        void onPhotoUploadError(PhotoBean bean);
55
+    private void onNewOrderArrived(OrderBean bean){
56
+
82 57
     }
83 58
 
84
-    public class MyBinder extends Binder {
59
+    public class OrderServiceBinder extends Binder {
85 60
 
86 61
         public OrderDealService getService(){
87 62
             return OrderDealService.this;

+ 1 - 0
app/src/main/java/ai/pai/lensman/utils/UrlContainer.java

@@ -37,6 +37,7 @@ public class UrlContainer {
37 37
 
38 38
     public static final String BRIEFS_URL = HOST_URL+"l/brief";
39 39
 
40
+    public static final String QUERY_ORDER_URL = HOST_URL+"l/query";
40 41
 
41 42
 
42 43
 }

kodo - Gogs: Go Git Service

Няма описание

Brightcells: 44044c9cd8 Fix Bug: could not convert string to float: undefined преди 7 години
..
migrations 4defb80fdc gogs first init преди 10 години
__init__.py 4defb80fdc gogs first init преди 10 години
admin.py fabef63211 set line_length=200 for isort преди 10 години
clerk_views.py e7306d6105 Change to use clerk's distributor_id преди 7 години
distributor_views.py cbc12e6b47 'count': count, преди 8 години
encrypt_views.py 6e7c94e744 MchInfoDecryptLogInfo преди 7 години
mch_views.py 44044c9cd8 Fix Bug: could not convert string to float: undefined преди 7 години
model_views.py 38ef14de91 jancode преди 7 години
models.py fabef63211 set line_length=200 for isort преди 10 години
operator_views.py cbc12e6b47 'count': count, преди 8 години
tests.py fabef63211 set line_length=200 for isort преди 10 години
urls.py ed22684a98 consumer_snlist_api преди 7 години
views.py 953ffaab3c Change to use django-uniapi преди 9 години