|
|
@@ -105,12 +105,14 @@ public class DataInquiryListActivity extends BaseActivity implements View.OnClic
|
|
|
private int mOldPosition = -1;
|
|
|
private DataInquiryTotalAdapter mDataInquiryTotalAdapter;
|
|
|
private List<DataInquiryTotalBean> mDataInquiryTotalBeans;
|
|
|
+ private boolean isConditionSuccess = false;
|
|
|
|
|
|
private Handler mHandler = new Handler() {
|
|
|
@Override
|
|
|
public void handleMessage(Message msg) {
|
|
|
switch (msg.what) {
|
|
|
case GET_QUERY_CRITERIA:
|
|
|
+ isConditionSuccess = true;
|
|
|
if (mDataListView.isRefreshing())
|
|
|
mDataListView.onRefreshComplete();
|
|
|
String result = msg.getData().getString("result");
|
|
|
@@ -177,16 +179,7 @@ public class DataInquiryListActivity extends BaseActivity implements View.OnClic
|
|
|
mEmptyLayout.setErrorMessage(getString(R.string.networks_out));
|
|
|
mEmptyLayout.showError();
|
|
|
} else {
|
|
|
- if (mQueryScheme != null) {
|
|
|
- progressDialog.show();
|
|
|
- String url = CommonUtil.getAppBaseUrl(this) + "mobile/qry/schemeCondition.action";
|
|
|
- Map<String, Object> params = new HashMap<>();
|
|
|
- params.put("caller", mQueryScheme.getCaller());
|
|
|
- params.put("id", mQueryScheme.getSchemeId());
|
|
|
- LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
- headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
- ViewUtil.httpSendRequest(this, url, params, mHandler, headers, GET_QUERY_CRITERIA, null, null, "post");
|
|
|
- }
|
|
|
+ getQueryCriteria();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -292,8 +285,17 @@ public class DataInquiryListActivity extends BaseActivity implements View.OnClic
|
|
|
public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
|
|
|
if (CommonUtil.isNetWorkConnected(DataInquiryListActivity.this)) {
|
|
|
mPageIndex = 1;
|
|
|
- getSchemeData();
|
|
|
+ if (isConditionSuccess)
|
|
|
+ getSchemeData();
|
|
|
+ else
|
|
|
+ getQueryCriteria();
|
|
|
} else {
|
|
|
+ mDataListView.postDelayed(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ mDataListView.onRefreshComplete();
|
|
|
+ }
|
|
|
+ },500);
|
|
|
mEmptyLayout.setErrorMessage(getString(R.string.networks_out));
|
|
|
mEmptyLayout.showError();
|
|
|
}
|
|
|
@@ -302,11 +304,23 @@ public class DataInquiryListActivity extends BaseActivity implements View.OnClic
|
|
|
@Override
|
|
|
public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
|
|
|
if (!CommonUtil.isNetWorkConnected(DataInquiryListActivity.this)) {
|
|
|
+ mDataListView.postDelayed(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ mDataListView.onRefreshComplete();
|
|
|
+ }
|
|
|
+ },500);
|
|
|
mEmptyLayout.setErrorMessage(getString(R.string.networks_out));
|
|
|
mEmptyLayout.showError();
|
|
|
} else {
|
|
|
- mPageIndex++;
|
|
|
- getSchemeData();
|
|
|
+ if (isConditionSuccess) {
|
|
|
+ mPageIndex++;
|
|
|
+ getSchemeData();
|
|
|
+ } else {
|
|
|
+ mPageIndex = 1;
|
|
|
+ getQueryCriteria();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -427,6 +441,9 @@ public class DataInquiryListActivity extends BaseActivity implements View.OnClic
|
|
|
JSONArray listArray = resultObject.optJSONArray("listdata");
|
|
|
JSONObject totalObject = resultObject.optJSONObject("summaryField");
|
|
|
|
|
|
+ if ((listArray == null || listArray.length() < mPagesize) && mPageIndex > 1) {
|
|
|
+ ToastMessage("已加载全部数据");
|
|
|
+ }
|
|
|
if (totalObject != null) {
|
|
|
for (int j = 0; j < mAllSchemeConditions.size(); j++) {
|
|
|
String field = mAllSchemeConditions.get(j).getField();
|
|
|
@@ -945,6 +962,19 @@ public class DataInquiryListActivity extends BaseActivity implements View.OnClic
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void getQueryCriteria() {
|
|
|
+ if (mQueryScheme != null) {
|
|
|
+ progressDialog.show();
|
|
|
+ String url = CommonUtil.getAppBaseUrl(this) + "mobile/qry/schemeCondition.action";
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("caller", mQueryScheme.getCaller());
|
|
|
+ params.put("id", mQueryScheme.getSchemeId());
|
|
|
+ LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
+ headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
+ ViewUtil.httpSendRequest(this, url, params, mHandler, headers, GET_QUERY_CRITERIA, null, null, "post");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void getSchemeData() {
|
|
|
String url = CommonUtil.getAppBaseUrl(this) + "mobile/qry/schemeResult.action";
|
|
|
Map<String, Object> params = new HashMap<>();
|