|
|
@@ -71,7 +71,7 @@ public class TaskB2BActivity extends BaseActivity implements RecognizerDialogLis
|
|
|
private EmptyLayout mEmptyLayout;
|
|
|
private Context context;
|
|
|
private PullToRefreshListView listview_main;
|
|
|
-// private SchedultAdapter adapter;
|
|
|
+ // private SchedultAdapter adapter;
|
|
|
private NewSchedultAdapter adapter;
|
|
|
private List<AllProcess> allList = new ArrayList<AllProcess>();
|
|
|
private List<AllProcess> waitList = new ArrayList<>();
|
|
|
@@ -101,7 +101,7 @@ public class TaskB2BActivity extends BaseActivity implements RecognizerDialogLis
|
|
|
String result = msg.getData().getString("result");
|
|
|
JSONObject dataroot = JSON.parseObject(result);
|
|
|
JSONArray data = dataroot.getJSONArray("listdata");
|
|
|
- allList.clear();
|
|
|
+ if (!ListUtils.isEmpty(allList)) allList.clear();
|
|
|
if (data != null) {
|
|
|
for (int i = 0; i < data.size(); i++) {
|
|
|
// "detail":"测试",
|
|
|
@@ -124,7 +124,7 @@ public class TaskB2BActivity extends BaseActivity implements RecognizerDialogLis
|
|
|
process.setMainname(item.getString("status"));//状态
|
|
|
process.setTaskname(item.getString("taskname"));//名称
|
|
|
process.setDatetime(item.getDate("startdate"));//发起时间
|
|
|
- // process.setLink(task_url + item.get("ra_id"));
|
|
|
+ // process.setLink(task_url + item.get("ra_id"));
|
|
|
process.setTypecode("task");
|
|
|
process.setDescribe(item.getString("detail"));
|
|
|
process.setDuration(item.getString("duration"));
|
|
|
@@ -147,45 +147,100 @@ public class TaskB2BActivity extends BaseActivity implements RecognizerDialogLis
|
|
|
listview_main.onRefreshComplete();*/
|
|
|
} else {
|
|
|
mEmptyLayout.showEmpty();
|
|
|
- adapter = new NewSchedultAdapter(context, allList);
|
|
|
- listview_main.setAdapter(adapter);
|
|
|
listview_main.onRefreshComplete();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (msg.what == 3){
|
|
|
+ progressDialog.dismiss();
|
|
|
+ String isendresult = msg.getData().getString("result");
|
|
|
+ JSONObject dataroot = JSON.parseObject(isendresult);
|
|
|
+ JSONArray data = dataroot.getJSONArray("listdata");
|
|
|
+ LogUtil.prinlnLongMsg("isendresult", isendresult);
|
|
|
+ if (data != null) {
|
|
|
+ for (int i = 0; i < data.size(); i++) {
|
|
|
+// "detail":"测试",
|
|
|
+// "doman":"移动测试",
|
|
|
+// "domancode":1000009169,
|
|
|
+// "enddate":1489983120000,
|
|
|
+// "id":44,
|
|
|
+// "recorddate":1490057817693,
|
|
|
+// "recorder":"移动测试",
|
|
|
+// "recordercode":1000009169,
|
|
|
+// "startdate":1489972320000,
|
|
|
+// "status":"进行中",
|
|
|
+// "statuscode":"start",
|
|
|
+// "uu":10030994
|
|
|
+ AllProcess process = new AllProcess();
|
|
|
+ JSONObject item = data.getJSONObject(i);
|
|
|
+ process.setTaskid(String.valueOf(item.get("id")));//id
|
|
|
+ process.setRecorder(item.getString("recorder"));//发起人
|
|
|
+ process.setStatus(item.getString("status"));//状态
|
|
|
+ process.setMainname(item.getString("status"));//状态
|
|
|
+ process.setTaskname(item.getString("taskname"));//名称
|
|
|
+ process.setDatetime(item.getDate("startdate"));//发起时间
|
|
|
+ // process.setLink(task_url + item.get("ra_id"));
|
|
|
+ process.setTypecode("task");
|
|
|
+ process.setDescribe(item.getString("detail"));
|
|
|
+ process.setDuration(item.getString("duration"));
|
|
|
+ process.setRa_taskid(String.valueOf(item.get("id")));
|
|
|
+ process.setDealpersoncode(item.getString("doman"));
|
|
|
+ process.setRa_resourcecode(item.getString("domancode"));
|
|
|
+ process.setTaskcode(item.getString("taskcode"));
|
|
|
+ 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();
|
|
|
+ }
|
|
|
+ listview_main.onRefreshComplete();
|
|
|
+ real_List = isendList;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ mEmptyLayout.showEmpty();
|
|
|
+ listview_main.onRefreshComplete();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
if (msg.what == Constants.APP_SOCKETIMEOUTEXCEPTION) {
|
|
|
String exception = msg.getData().getString("result");
|
|
|
mEmptyLayout.setErrorMessage(exception + ",请刷新重试!");
|
|
|
mEmptyLayout.showError();
|
|
|
listview_main.onRefreshComplete();
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
private void doClassifyAllList(List<AllProcess> allList) {
|
|
|
- if (ListUtils.isEmpty(allList)) return;;
|
|
|
+ LogUtil.prinlnLongMsg("login_Name,allList",login_Name + JSON.toJSONString(allList));
|
|
|
+ if (ListUtils.isEmpty(allList)) return;
|
|
|
if (!ListUtils.isEmpty(waitList)) waitList.clear();
|
|
|
if (!ListUtils.isEmpty(doneList)) doneList.clear();
|
|
|
if (!ListUtils.isEmpty(isendList)) isendList.clear();
|
|
|
for (int i = 0; i < allList.size(); i++) {
|
|
|
// 待处理
|
|
|
- if ((!login_Name.equals(allList.get(i).getRecorder()) &&
|
|
|
- "进行中".equals(allList.get(i).getStatus()) )||
|
|
|
- (login_Name.equals(allList.get(i).getRecorder()) &&
|
|
|
- "待确认".equals(allList.get(i).getStatus()))){
|
|
|
-
|
|
|
+ if ((login_Name.equals(allList.get(i).getDealpersoncode()) &&
|
|
|
+ "进行中".equals(allList.get(i).getStatus()))
|
|
|
+ || (login_Name.equals(allList.get(i).getRecorder()) &&
|
|
|
+ "待确认".equals(allList.get(i).getStatus()))){
|
|
|
waitList.add(allList.get(i));
|
|
|
}
|
|
|
|
|
|
//已处理
|
|
|
- if ((!login_Name.equals(allList.get(i).getRecorder()) &&
|
|
|
- "已完成".equals(allList.get(i).getStatus()) )||
|
|
|
- (!login_Name.equals(allList.get(i).getRecorder()) &&
|
|
|
- "待确认".equals(allList.get(i).getStatus()))){
|
|
|
+ if ((login_Name.equals(allList.get(i).getDealpersoncode()) &&
|
|
|
+ "已完成".equals(allList.get(i).getStatus()))
|
|
|
+ || (login_Name.equals(allList.get(i).getDealpersoncode()) &&
|
|
|
+ "待确认".equals(allList.get(i).getStatus()))){
|
|
|
doneList.add(allList.get(i));
|
|
|
}
|
|
|
|
|
|
@@ -196,7 +251,11 @@ public class TaskB2BActivity extends BaseActivity implements RecognizerDialogLis
|
|
|
"已完成".equals(allList.get(i).getStatus()))){
|
|
|
isendList.add(allList.get(i));
|
|
|
}
|
|
|
+
|
|
|
if (i == allList.size() -1){
|
|
|
+ LogUtil.prinlnLongMsg("waitList",waitList.toString());
|
|
|
+ LogUtil.prinlnLongMsg("doneList",doneList.toString());
|
|
|
+ LogUtil.prinlnLongMsg("isendList",isendList.toString());
|
|
|
if (tab_type == 1){
|
|
|
adapter = new NewSchedultAdapter(TaskB2BActivity.this, waitList);
|
|
|
real_List = waitList;
|
|
|
@@ -208,8 +267,10 @@ public class TaskB2BActivity extends BaseActivity implements RecognizerDialogLis
|
|
|
}
|
|
|
|
|
|
if (tab_type == 3){
|
|
|
- adapter = new NewSchedultAdapter(TaskB2BActivity.this, isendList);
|
|
|
- real_List = isendList;
|
|
|
+// adapter = new NewSchedultAdapter(TaskB2BActivity.this, isendList);
|
|
|
+// real_List = isendList;
|
|
|
+ sendServiceForISend();
|
|
|
+ return;
|
|
|
}
|
|
|
listview_main.setAdapter(adapter);
|
|
|
if (adapter.getCount() != 0) {
|
|
|
@@ -220,6 +281,7 @@ public class TaskB2BActivity extends BaseActivity implements RecognizerDialogLis
|
|
|
listview_main.onRefreshComplete();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -230,16 +292,17 @@ public class TaskB2BActivity extends BaseActivity implements RecognizerDialogLis
|
|
|
ViewUtils.inject(this);
|
|
|
getSupportActionBar().setTitle("待办工作");
|
|
|
String mLoginUserId = MyApplication.getInstance().mLoginUser.getUserId();
|
|
|
-
|
|
|
+
|
|
|
FriendDao.getInstance().markUserMessageRead(mLoginUserId, Friend.ID_ERP_TASK);
|
|
|
- listview_main = (PullToRefreshListView) findViewById(R.id.listview_schedult);
|
|
|
-
|
|
|
+ listview_main = (PullToRefreshListView) findViewById(R.id.listview_schedult);
|
|
|
+
|
|
|
mEmptyLayout = new EmptyLayout(this, listview_main.getRefreshableView());
|
|
|
mEmptyLayout.setShowEmptyButton(false);
|
|
|
mEmptyLayout.setShowErrorButton(false);
|
|
|
mEmptyLayout.setShowLoadingButton(false);
|
|
|
+ mEmptyLayout.showEmpty();
|
|
|
// mEmptyLayout.showLoading();
|
|
|
-
|
|
|
+
|
|
|
// sendResquestForServer("进行中", 2);
|
|
|
sendResquestForServer("", 2); // update TODO :出息进来请求所有任务数据
|
|
|
initHeaderView();// 头布局显示
|
|
|
@@ -310,7 +373,13 @@ public class TaskB2BActivity extends BaseActivity implements RecognizerDialogLis
|
|
|
listview_main.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener<ListView>() {
|
|
|
@Override
|
|
|
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
|
|
|
- refreshing();
|
|
|
+// refreshing();
|
|
|
+ listview_main.getLoadingLayoutProxy().setPullLabel("下拉刷新");
|
|
|
+// if (tab_type == 3){
|
|
|
+// sendServiceForISend();
|
|
|
+// }else {
|
|
|
+ sendResquestForServer("", 2);
|
|
|
+// }
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -417,9 +486,9 @@ public class TaskB2BActivity extends BaseActivity implements RecognizerDialogLis
|
|
|
if (state_unconfirmed.isSelected()) {
|
|
|
sendResquestForServer("UNCONFIRMED", 2);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
public void sendHomeBroadcast(int count) {
|
|
|
Intent intent_update = new Intent("com.activity.update.data");
|
|
|
@@ -560,19 +629,19 @@ public class TaskB2BActivity extends BaseActivity implements RecognizerDialogLis
|
|
|
progressDialog.show();
|
|
|
String url = ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().task_list;
|
|
|
Map<String, Object> params = new HashMap<String, Object>();
|
|
|
- String statu="进行中";
|
|
|
- params=new HashMap<>();
|
|
|
- params.put("emuu", CommonUtil.getSharedPreferences(MyApplication.getInstance(),"b2b_uu"));
|
|
|
+ String statu = "进行中";
|
|
|
+ params = new HashMap<>();
|
|
|
+ params.put("emuu", CommonUtil.getSharedPreferences(MyApplication.getInstance(), "b2b_uu"));
|
|
|
params.put("enuu", ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().getEnuu());
|
|
|
params.put("pageNumber", "1");
|
|
|
params.put("pageSize", "100");
|
|
|
params.put("status", status);
|
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
- headers.put("Cookie", ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().getCookie());
|
|
|
+ headers.put("Cookie", ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().getCookie());
|
|
|
ViewUtil.httpSendRequest(context, url, params, handler, headers, handlerWhat, null, null, "get");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public boolean onCreateOptionsMenu(Menu menu) {
|
|
|
@@ -624,8 +693,10 @@ public class TaskB2BActivity extends BaseActivity implements RecognizerDialogLis
|
|
|
wait_tv.setSelected(false);
|
|
|
done_tv.setSelected(false);
|
|
|
isend_tv.setSelected(true);
|
|
|
- adapter = new NewSchedultAdapter(TaskB2BActivity.this, isendList);
|
|
|
- real_List = isendList;
|
|
|
+// adapter = new NewSchedultAdapter(TaskB2BActivity.this, isendList);
|
|
|
+// real_List = isendList;
|
|
|
+
|
|
|
+ sendServiceForISend();
|
|
|
break;
|
|
|
case R.id.voice_search_iv:
|
|
|
final VoiceToWord voice = new VoiceToWord(TaskB2BActivity.this,"534e3fe2");
|
|
|
@@ -636,7 +707,7 @@ public class TaskB2BActivity extends BaseActivity implements RecognizerDialogLis
|
|
|
onBackPressed();
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
+ if (adapter == null) return;
|
|
|
listview_main.setAdapter(adapter);
|
|
|
if (adapter.getCount() != 0) {
|
|
|
sendHomeBroadcast(adapter.getCount());
|
|
|
@@ -646,6 +717,21 @@ public class TaskB2BActivity extends BaseActivity implements RecognizerDialogLis
|
|
|
listview_main.onRefreshComplete();
|
|
|
}
|
|
|
|
|
|
+ private void sendServiceForISend() {
|
|
|
+ String url = ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().plat_isend_task;
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
+ String status="我发起的";
|
|
|
+ params=new HashMap<>();
|
|
|
+ params.put("emuu", CommonUtil.getSharedPreferences(MyApplication.getInstance(),"b2b_uu"));
|
|
|
+ params.put("enuu", ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().getEnuu());
|
|
|
+ params.put("pageNumber", "1");
|
|
|
+ params.put("pageSize", "100");
|
|
|
+ params.put("status", status);
|
|
|
+ LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
+ headers.put("Cookie", ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().getCookie());
|
|
|
+ ViewUtil.httpSendRequest(context, url, params, handler, headers, 3, null, null, "get");
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void onResult(RecognizerResult recognizerResult, boolean b) {
|
|
|
String text = JsonParser.parseIatResult(recognizerResult.getResultString());
|