@@ -21,8 +21,8 @@ android {
|
||
| 21 | 21 |
applicationId "ai.pai.lensman" |
| 22 | 22 |
minSdkVersion 14 |
| 23 | 23 |
targetSdkVersion 24 |
| 24 |
- versionCode 1 |
|
| 25 |
- versionName "1.0" |
|
| 24 |
+ versionCode 1000 |
|
| 25 |
+ versionName "1.0.00" |
|
| 26 | 26 |
buildConfigField "boolean", "isTestMode", "true" |
| 27 | 27 |
} |
| 28 | 28 |
signingConfigs {
|
@@ -50,8 +50,8 @@ public class BriefsInteractor implements BaseInteractor {
|
||
| 50 | 50 |
if(status == 200){
|
| 51 | 51 |
JSONObject data = json.getJSONObject("data");
|
| 52 | 52 |
bean = new BriefsBean(); |
| 53 |
- bean.weekIncome =(float)data.getDouble("week_income");
|
|
| 54 |
- bean.todayIncome = (float)data.getDouble("today_income");
|
|
| 53 |
+ bean.weekIncome =(float)data.getDouble("origin_week_income");
|
|
| 54 |
+ bean.todayIncome = (float)data.getDouble("nomark_today_income");
|
|
| 55 | 55 |
bean.todayUpload = data.getInt("today_upload");
|
| 56 | 56 |
bean.weekSold = data.getInt("week_sold");
|
| 57 | 57 |
JSONObject msgObj = data.getJSONObject("messages");
|
@@ -4,7 +4,9 @@ import android.app.Service; |
||
| 4 | 4 |
import android.content.Intent; |
| 5 | 5 |
import android.os.AsyncTask; |
| 6 | 6 |
import android.os.Binder; |
| 7 |
+import android.os.Handler; |
|
| 7 | 8 |
import android.os.IBinder; |
| 9 |
+import android.os.Message; |
|
| 8 | 10 |
|
| 9 | 11 |
import com.android.common.executors.ThreadExecutor; |
| 10 | 12 |
import com.android.common.utils.LogHelper; |
@@ -29,13 +31,21 @@ import ai.pai.lensman.utils.Constants; |
||
| 29 | 31 |
import ai.pai.lensman.utils.HttpPostTask; |
| 30 | 32 |
import ai.pai.lensman.utils.UrlContainer; |
| 31 | 33 |
|
| 32 |
-public class OrderDealService extends Service {
|
|
| 34 |
+public class OrderDealService extends Service implements Handler.Callback{
|
|
| 33 | 35 |
|
| 34 | 36 |
private ArrayList<OrderBean> orderList; |
| 37 |
+ private Handler handler; |
|
| 38 |
+ private static final int MSG_QUERY_ORDER = 2001; |
|
| 35 | 39 |
|
| 36 | 40 |
private static final String TAG = "czy"; |
| 37 | 41 |
|
| 38 | 42 |
@Override |
| 43 |
+ public void onCreate() {
|
|
| 44 |
+ super.onCreate(); |
|
| 45 |
+ handler = new Handler(this); |
|
| 46 |
+ } |
|
| 47 |
+ |
|
| 48 |
+ @Override |
|
| 39 | 49 |
public IBinder onBind(Intent intent) {
|
| 40 | 50 |
return new OrderServiceBinder(); |
| 41 | 51 |
} |
@@ -89,14 +99,8 @@ public class OrderDealService extends Service {
|
||
| 89 | 99 |
@Override |
| 90 | 100 |
protected void onPostFail() {
|
| 91 | 101 |
super.onPostFail(); |
| 92 |
- new Timer().schedule( |
|
| 93 |
- new TimerTask() {
|
|
| 94 |
- @Override |
|
| 95 |
- public void run() {
|
|
| 96 |
- startQuery(); |
|
| 97 |
- } |
|
| 98 |
- }, 15000 |
|
| 99 |
- ); |
|
| 102 |
+ handler.removeMessages(MSG_QUERY_ORDER); |
|
| 103 |
+ handler.sendEmptyMessageDelayed(MSG_QUERY_ORDER,10000); |
|
| 100 | 104 |
} |
| 101 | 105 |
}.executeOnExecutor(ThreadExecutor.getInstance().getExecutor(), UrlContainer.QUERY_ORIGIN_ORDER_URL); |
| 102 | 106 |
|
@@ -107,7 +111,8 @@ public class OrderDealService extends Service {
|
||
| 107 | 111 |
OrderBean orderBean = orderList.get(0); |
| 108 | 112 |
fetchOriginFromBox(orderBean); |
| 109 | 113 |
} else {
|
| 110 |
- startQuery(); |
|
| 114 |
+ handler.removeMessages(MSG_QUERY_ORDER); |
|
| 115 |
+ handler.sendEmptyMessageDelayed(MSG_QUERY_ORDER,10000); |
|
| 111 | 116 |
} |
| 112 | 117 |
} |
| 113 | 118 |
|
@@ -160,6 +165,15 @@ public class OrderDealService extends Service {
|
||
| 160 | 165 |
return (orderList == null || orderList.size() == 0); |
| 161 | 166 |
} |
| 162 | 167 |
|
| 168 |
+ @Override |
|
| 169 |
+ public boolean handleMessage(Message message) {
|
|
| 170 |
+ |
|
| 171 |
+ if(message.what == MSG_QUERY_ORDER){
|
|
| 172 |
+ startQuery(); |
|
| 173 |
+ } |
|
| 174 |
+ return true; |
|
| 175 |
+ } |
|
| 176 |
+ |
|
| 163 | 177 |
public class OrderServiceBinder extends Binder {
|
| 164 | 178 |
|
| 165 | 179 |
public OrderDealService getService() {
|
@@ -20,6 +20,7 @@ import java.io.FileOutputStream; |
||
| 20 | 20 |
import java.io.InputStream; |
| 21 | 21 |
import java.net.HttpURLConnection; |
| 22 | 22 |
import java.net.URL; |
| 23 |
+import java.util.HashMap; |
|
| 23 | 24 |
|
| 24 | 25 |
import ai.pai.lensman.R; |
| 25 | 26 |
import ai.pai.lensman.utils.UrlContainer; |
@@ -39,7 +40,9 @@ public class UpgradeService extends IntentService {
|
||
| 39 | 40 |
protected void onHandleIntent(Intent intent) {
|
| 40 | 41 |
boolean isMuteUpdate = intent.getBooleanExtra("isMuteUpdate",true);
|
| 41 | 42 |
try{
|
| 42 |
- String result = HttpUtils.doHttpPost(UrlContainer.CHECK_UPDATE_URL,null); |
|
| 43 |
+ HashMap<String,String> params = new HashMap<>(); |
|
| 44 |
+ params.put("src",String.valueOf(1));
|
|
| 45 |
+ String result = HttpUtils.doHttpPost(UrlContainer.CHECK_UPDATE_URL,params); |
|
| 43 | 46 |
LogHelper.d(TAG,"检查更新结果"+result); |
| 44 | 47 |
JSONObject json = new JSONObject(result); |
| 45 | 48 |
int status = json.getInt("status");
|
@@ -61,7 +61,7 @@ public class SessionInteractor {
|
||
| 61 | 61 |
cancelTask(sessionStartTask); |
| 62 | 62 |
HashMap<String,String> params = new HashMap<>(); |
| 63 | 63 |
params.put("lensman",sessionBean.lensmanId);
|
| 64 |
- randomSessionId = sessionBean.sessionId+"_"+new Random().nextInt(123456); |
|
| 64 |
+ randomSessionId = sessionBean.sessionId+"_"+(new Random().nextInt(9999)+10000); |
|
| 65 | 65 |
params.put("session",randomSessionId);
|
| 66 | 66 |
sessionStartTask = new HttpPostTask(params){
|
| 67 | 67 |
@Override |