|
|
@@ -157,7 +157,7 @@ public class TaskB2BActivity extends BaseActivity implements RecognizerDialogLis
|
|
|
JSONObject dataroot = JSON.parseObject(isendresult);
|
|
|
JSONArray data = dataroot.getJSONArray("listdata");
|
|
|
LogUtil.prinlnLongMsg("isendresult", isendresult);
|
|
|
- if (data != null) {
|
|
|
+ if (!ListUtils.isEmpty(data)) {
|
|
|
for (int i = 0; i < data.size(); i++) {
|
|
|
// "detail":"测试",
|
|
|
// "doman":"移动测试",
|
|
|
@@ -190,22 +190,31 @@ public class TaskB2BActivity extends BaseActivity implements RecognizerDialogLis
|
|
|
process.setAttachs(item.getString("attachs"));
|
|
|
process.setEndTime(item.getString("enddate"));
|
|
|
isendList.add(process);
|
|
|
- adapter = new NewSchedultAdapter(TaskB2BActivity.this, isendList);
|
|
|
- listview_main.onRefreshComplete();
|
|
|
- listview_main.setAdapter(adapter);
|
|
|
- if (adapter.getCount() != 0) {
|
|
|
- sendHomeBroadcast(adapter.getCount());
|
|
|
- } else {
|
|
|
- mEmptyLayout.showEmpty();
|
|
|
+
|
|
|
+ if (i == data.size() - 1){
|
|
|
+ adapter = new NewSchedultAdapter(TaskB2BActivity.this, isendList);
|
|
|
+ listview_main.setAdapter(adapter);
|
|
|
+ if (adapter.getCount() != 0) {
|
|
|
+ sendHomeBroadcast(adapter.getCount());
|
|
|
+ } else {
|
|
|
+ mEmptyLayout.showEmpty();
|
|
|
+ }
|
|
|
+ listview_main.onRefreshComplete();
|
|
|
+ real_List = isendList;
|
|
|
}
|
|
|
- listview_main.onRefreshComplete();
|
|
|
- real_List = isendList;
|
|
|
}
|
|
|
- } else {
|
|
|
- mEmptyLayout.showEmpty();
|
|
|
+ }else {
|
|
|
+ adapter = new NewSchedultAdapter(TaskB2BActivity.this, isendList);
|
|
|
+ if (adapter == null) return;
|
|
|
+ listview_main.setAdapter(adapter);
|
|
|
+ if (adapter.getCount() != 0) {
|
|
|
+ sendHomeBroadcast(adapter.getCount());
|
|
|
+ } else {
|
|
|
+ mEmptyLayout.showEmpty();
|
|
|
+ }
|
|
|
listview_main.onRefreshComplete();
|
|
|
+ real_List = isendList;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
if (msg.what == Constants.APP_SOCKETIMEOUTEXCEPTION) {
|
|
|
String exception = msg.getData().getString("result");
|
|
|
@@ -387,55 +396,50 @@ public class TaskB2BActivity extends BaseActivity implements RecognizerDialogLis
|
|
|
private void initSearchEvent() {
|
|
|
edt_search.addTextChangedListener(new TextWatcher() {
|
|
|
@Override
|
|
|
- public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
|
|
|
@Override
|
|
|
- public void onTextChanged(CharSequence s, int start, int before, int count) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
+ public void onTextChanged(CharSequence s, int start, int before, int count) {}
|
|
|
@Override
|
|
|
public void afterTextChanged(Editable editable) {
|
|
|
LogUtil.prinlnLongMsg("real_List", real_List + "");
|
|
|
String strChche = editable.toString().replace(" ", "");//去除空格
|
|
|
+ if (ListUtils.isEmpty(real_List)) {mEmptyLayout.showEmpty(); return;}
|
|
|
+
|
|
|
+ if (StringUtils.isEmpty(strChche)){
|
|
|
+ adapter = new NewSchedultAdapter(TaskB2BActivity.this, real_List);
|
|
|
+ listview_main.setAdapter(adapter);
|
|
|
+ if (adapter.getCount() != 0) {
|
|
|
+ sendHomeBroadcast(adapter.getCount());
|
|
|
+ } else {
|
|
|
+ mEmptyLayout.showEmpty();
|
|
|
+ }
|
|
|
+ listview_main.onRefreshComplete();
|
|
|
+ }
|
|
|
strChche = strChche.replace(" ", " ");//去除空格
|
|
|
List<AllProcess> chche = new ArrayList<>();
|
|
|
if (StringUtils.isEmpty(strChche)) return;
|
|
|
|
|
|
- if (ListUtils.isEmpty(real_List)) {
|
|
|
- mEmptyLayout.showEmpty();
|
|
|
- return;
|
|
|
- } else {
|
|
|
- for (int i = 0; i < real_List.size(); i++) {
|
|
|
- boolean b = getResult(real_List.get(i).getRecorder() + real_List.get(i).getDealpersoncode()
|
|
|
- + real_List.get(i).getStatus() + real_List.get(i).getTaskname()
|
|
|
- + real_List.get(i).getEndTime() + real_List.get(i).getDatetime(), strChche.trim());
|
|
|
+ for (int i = 0; i < real_List.size(); i++) {
|
|
|
+ boolean b = getResult(real_List.get(i).getRecorder() + real_List.get(i).getDealpersoncode()
|
|
|
+ + real_List.get(i).getStatus() + real_List.get(i).getTaskname()
|
|
|
+ + real_List.get(i).getEndTime() + real_List.get(i).getDatetime(), strChche.trim());
|
|
|
|
|
|
- if (b){
|
|
|
- chche.add(real_List.get(i));
|
|
|
- }
|
|
|
- if (i == real_List.size() - 1){
|
|
|
- adapter = new NewSchedultAdapter(TaskB2BActivity.this, chche);
|
|
|
- listview_main.setAdapter(adapter);
|
|
|
- if (adapter.getCount() != 0) {
|
|
|
- sendHomeBroadcast(adapter.getCount());
|
|
|
- } else {
|
|
|
- mEmptyLayout.showEmpty();
|
|
|
+ if (b){
|
|
|
+ chche.add(real_List.get(i));
|
|
|
+ }
|
|
|
+ if (i == real_List.size() - 1){
|
|
|
+ adapter = new NewSchedultAdapter(TaskB2BActivity.this, chche);
|
|
|
+ listview_main.setAdapter(adapter);
|
|
|
+ if (adapter.getCount() != 0) {
|
|
|
+ sendHomeBroadcast(adapter.getCount());
|
|
|
+ } else {
|
|
|
+ mEmptyLayout.showEmpty();
|
|
|
+ }
|
|
|
+ listview_main.onRefreshComplete();
|
|
|
}
|
|
|
- listview_main.onRefreshComplete();
|
|
|
}
|
|
|
+ Log.v("chche",JSON.toJSONString(chche));
|
|
|
}
|
|
|
- Log.v("chche",chche+"");
|
|
|
- }
|
|
|
-
|
|
|
- if (!StringUtils.isEmpty(strChche)){
|
|
|
- listview_main.getRefreshableView().setAdapter(adapter);
|
|
|
- }else {
|
|
|
- adapter.notifyDataSetInvalidated();
|
|
|
- }
|
|
|
- }
|
|
|
});
|
|
|
}
|
|
|
//正则
|