|
|
- }
|
|
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;
|
|
|
|
@@ -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
|
}
|