|
@@ -54,9 +54,11 @@ import java.util.HashMap;
|
|
|
import java.util.LinkedHashMap;
|
|
import java.util.LinkedHashMap;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
-public class ProcessB2BActivity extends BaseActivity implements View.OnClickListener ,RecognizerDialogListener {
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * 不确定问题的出现与否,没有删除所有分页写法,只是屏蔽了上拉事件
|
|
|
|
|
+ * update Bitliker by 17/4/10
|
|
|
|
|
+ */
|
|
|
|
|
+public class ProcessB2BActivity extends BaseActivity implements View.OnClickListener, RecognizerDialogListener {
|
|
|
@ViewInject(R.id.edt_search)
|
|
@ViewInject(R.id.edt_search)
|
|
|
ClearEditText mEditText;
|
|
ClearEditText mEditText;
|
|
|
@ViewInject(R.id.voice_search_iv)
|
|
@ViewInject(R.id.voice_search_iv)
|
|
@@ -77,18 +79,42 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
private ImageView iv_back;
|
|
private ImageView iv_back;
|
|
|
|
|
|
|
|
private ProcessAdapter mAdapter;
|
|
private ProcessAdapter mAdapter;
|
|
|
- private JSONArray array = new JSONArray();
|
|
|
|
|
|
|
+ private JSONArray arrayUn = new JSONArray();
|
|
|
|
|
+ private JSONArray arrayRe = new JSONArray();
|
|
|
|
|
+ private JSONArray arrayMe = new JSONArray();
|
|
|
|
|
|
|
|
private int tab_type = 1;
|
|
private int tab_type = 1;
|
|
|
private int page = 1;
|
|
private int page = 1;
|
|
|
|
|
+ private int pageDone = 1;
|
|
|
private final int SUSSCESS_un = 1;
|
|
private final int SUSSCESS_un = 1;
|
|
|
private final int SUSSCESS_already = 2;
|
|
private final int SUSSCESS_already = 2;
|
|
|
private final int SUSSCESS_me = 3;
|
|
private final int SUSSCESS_me = 3;
|
|
|
- private int exceptionCount=0;//
|
|
|
|
|
|
|
+ private int exceptionCount = 0;//
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
|
super.onActivityResult(requestCode, resultCode, data);
|
|
super.onActivityResult(requestCode, resultCode, data);
|
|
|
|
|
+ if (data == null) return;
|
|
|
|
|
+ String delete_succeed = data.getStringExtra("delete_succeed");
|
|
|
|
|
+ if (!StringUtils.isEmpty(delete_succeed) && delete_succeed.equals("delete_succeed")) {
|
|
|
|
|
+
|
|
|
|
|
+ if (requestCode == 0x322 && resultCode == PlatWDdetailyActivity.DELETE_SUCCEED) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ arrayUn.remove(mPosition);
|
|
|
|
|
+ mAdapter.notifyDataSetChanged();
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ loadProcessToDo(page);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (requestCode == 0x321 && resultCode == 0x328) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ arrayRe.remove(mPosition);
|
|
|
|
|
+ mAdapter.notifyDataSetChanged();
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ loadProcesstoAlreadyDo(pageDone);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private Handler mHandler = new Handler() {
|
|
private Handler mHandler = new Handler() {
|
|
@@ -99,22 +125,21 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
mList.onRefreshComplete();
|
|
mList.onRefreshComplete();
|
|
|
switch (msg.what) {
|
|
switch (msg.what) {
|
|
|
case SUSSCESS_un:
|
|
case SUSSCESS_un:
|
|
|
-
|
|
|
|
|
itemArray = JSON.parseObject(result).getJSONArray("data");
|
|
itemArray = JSON.parseObject(result).getJSONArray("data");
|
|
|
- if (page == 1) array.clear();
|
|
|
|
|
- array.addAll(itemArray);
|
|
|
|
|
- //array = CommonUtil.sortJsonArray(array);//排序
|
|
|
|
|
|
|
+ if (page == 1) arrayUn.clear();
|
|
|
|
|
+ arrayUn.addAll(itemArray);
|
|
|
|
|
+// array = CommonUtil.sortJsonArray(array);//排序
|
|
|
|
|
|
|
|
if (mAdapter == null) {
|
|
if (mAdapter == null) {
|
|
|
- mAdapter = new ProcessAdapter(ct, array);
|
|
|
|
|
|
|
+ mAdapter = new ProcessAdapter(ct, arrayUn);
|
|
|
mList.setAdapter(mAdapter);
|
|
mList.setAdapter(mAdapter);
|
|
|
} else {
|
|
} else {
|
|
|
mAdapter.notifyDataSetChanged();
|
|
mAdapter.notifyDataSetChanged();
|
|
|
}
|
|
}
|
|
|
- if (array.size() == 0) {
|
|
|
|
|
|
|
+ if (arrayUn.size() == 0) {
|
|
|
mEmptyLayout.showEmpty();
|
|
mEmptyLayout.showEmpty();
|
|
|
}
|
|
}
|
|
|
- if (currentId!=0){
|
|
|
|
|
|
|
+ if (currentId != 0) {
|
|
|
mList.getRefreshableView().setSelection(currentId);
|
|
mList.getRefreshableView().setSelection(currentId);
|
|
|
}
|
|
}
|
|
|
ToastMessage("数据刷新完毕");
|
|
ToastMessage("数据刷新完毕");
|
|
@@ -123,19 +148,18 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
case SUSSCESS_already:
|
|
case SUSSCESS_already:
|
|
|
itemArray = JSON.parseObject(result).getJSONArray("data");
|
|
itemArray = JSON.parseObject(result).getJSONArray("data");
|
|
|
if (page == 1)
|
|
if (page == 1)
|
|
|
- array.clear();
|
|
|
|
|
- array.addAll(itemArray);
|
|
|
|
|
|
|
+ arrayRe.clear();
|
|
|
|
|
+ arrayRe.addAll(itemArray);
|
|
|
if (mAdapter == null) {
|
|
if (mAdapter == null) {
|
|
|
- mAdapter = new ProcessAdapter(ct, array);
|
|
|
|
|
|
|
+ mAdapter = new ProcessAdapter(ct, arrayRe);
|
|
|
mList.setAdapter(mAdapter);
|
|
mList.setAdapter(mAdapter);
|
|
|
} else {
|
|
} else {
|
|
|
mAdapter.notifyDataSetChanged();
|
|
mAdapter.notifyDataSetChanged();
|
|
|
}
|
|
}
|
|
|
- if (array.size() == 0) {
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if (arrayRe.size() == 0) {
|
|
|
mEmptyLayout.showEmpty();
|
|
mEmptyLayout.showEmpty();
|
|
|
}
|
|
}
|
|
|
- if (currentId!=0){
|
|
|
|
|
|
|
+ if (currentId != 0) {
|
|
|
mList.getRefreshableView().setSelection(currentId);
|
|
mList.getRefreshableView().setSelection(currentId);
|
|
|
}
|
|
}
|
|
|
ToastMessage("数据刷新完毕");
|
|
ToastMessage("数据刷新完毕");
|
|
@@ -144,19 +168,19 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
case SUSSCESS_me:
|
|
case SUSSCESS_me:
|
|
|
itemArray = JSON.parseObject(result).getJSONArray("data");
|
|
itemArray = JSON.parseObject(result).getJSONArray("data");
|
|
|
// if (page == 1)
|
|
// if (page == 1)
|
|
|
- array.clear();
|
|
|
|
|
- array.addAll(itemArray);
|
|
|
|
|
|
|
+ arrayMe.clear();
|
|
|
|
|
+ arrayMe.addAll(itemArray);
|
|
|
if (mAdapter == null) {
|
|
if (mAdapter == null) {
|
|
|
- mAdapter = new ProcessAdapter(ct, array);
|
|
|
|
|
|
|
+ mAdapter = new ProcessAdapter(ct, arrayMe);
|
|
|
mList.setAdapter(mAdapter);
|
|
mList.setAdapter(mAdapter);
|
|
|
} else {
|
|
} else {
|
|
|
mAdapter.notifyDataSetChanged();
|
|
mAdapter.notifyDataSetChanged();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (array.size() == 0) {
|
|
|
|
|
|
|
+ if (arrayMe.size() == 0) {
|
|
|
mEmptyLayout.showEmpty();
|
|
mEmptyLayout.showEmpty();
|
|
|
}
|
|
}
|
|
|
- if (currentId!=0){
|
|
|
|
|
|
|
+ if (currentId != 0) {
|
|
|
mList.getRefreshableView().setSelection(currentId);
|
|
mList.getRefreshableView().setSelection(currentId);
|
|
|
}
|
|
}
|
|
|
ToastMessage("数据加载完成");
|
|
ToastMessage("数据加载完成");
|
|
@@ -166,7 +190,7 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
LogUtil.d(TAG, result);
|
|
LogUtil.d(TAG, result);
|
|
|
exceptionCount++;
|
|
exceptionCount++;
|
|
|
try {
|
|
try {
|
|
|
- if (exceptionCount<=3){
|
|
|
|
|
|
|
+ if (exceptionCount <= 3) {
|
|
|
ToastMessage(result);
|
|
ToastMessage(result);
|
|
|
ViewUtil.ct = ct;
|
|
ViewUtil.ct = ct;
|
|
|
ViewUtil.LoginERPTask(ct, mHandler, 0x16);
|
|
ViewUtil.LoginERPTask(ct, mHandler, 0x16);
|
|
@@ -201,13 +225,13 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
ViewUtils.inject(this);
|
|
ViewUtils.inject(this);
|
|
|
initView();
|
|
initView();
|
|
|
initData();
|
|
initData();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void initData() {
|
|
private void initData() {
|
|
|
- if (CommonUtil.isNetWorkConnected(mContext)){
|
|
|
|
|
|
|
+ if (CommonUtil.isNetWorkConnected(mContext)) {
|
|
|
loadProcessToDo(page);
|
|
loadProcessToDo(page);
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
mEmptyLayout.setErrorMessage("网络未连接!");
|
|
mEmptyLayout.setErrorMessage("网络未连接!");
|
|
|
mEmptyLayout.showError();
|
|
mEmptyLayout.showError();
|
|
|
}
|
|
}
|
|
@@ -234,16 +258,18 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
tv_process_un.setOnClickListener(this);
|
|
tv_process_un.setOnClickListener(this);
|
|
|
tv_process_un.setSelected(true);
|
|
tv_process_un.setSelected(true);
|
|
|
iv_back.setOnClickListener(this);
|
|
iv_back.setOnClickListener(this);
|
|
|
- mList.setMode(PullToRefreshBase.Mode.BOTH);
|
|
|
|
|
|
|
+ mList.setMode(PullToRefreshBase.Mode.PULL_FROM_START);
|
|
|
mList.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>() {
|
|
mList.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
|
|
public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
|
|
|
switch (tab_type) {
|
|
switch (tab_type) {
|
|
|
case 1:
|
|
case 1:
|
|
|
|
|
+ page = 1;
|
|
|
loadProcessToDo(page);
|
|
loadProcessToDo(page);
|
|
|
break;
|
|
break;
|
|
|
case 2:
|
|
case 2:
|
|
|
- loadProcesstoAlreadyDo(page);
|
|
|
|
|
|
|
+ pageDone = 1;
|
|
|
|
|
+ loadProcesstoAlreadyDo(pageDone);
|
|
|
break;
|
|
break;
|
|
|
case 3:
|
|
case 3:
|
|
|
loadProcessAlreadyLaunch(page);
|
|
loadProcessAlreadyLaunch(page);
|
|
@@ -253,13 +279,14 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
|
|
public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
|
|
|
- page++;
|
|
|
|
|
switch (tab_type) {
|
|
switch (tab_type) {
|
|
|
case 1:
|
|
case 1:
|
|
|
|
|
+ page++;
|
|
|
loadProcessToDo(page);
|
|
loadProcessToDo(page);
|
|
|
break;
|
|
break;
|
|
|
case 2:
|
|
case 2:
|
|
|
- loadProcesstoAlreadyDo(page);
|
|
|
|
|
|
|
+ pageDone++;
|
|
|
|
|
+ loadProcesstoAlreadyDo(pageDone);
|
|
|
break;
|
|
break;
|
|
|
case 3:
|
|
case 3:
|
|
|
loadProcessAlreadyLaunch(page);
|
|
loadProcessAlreadyLaunch(page);
|
|
@@ -274,8 +301,9 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
|
|
ProcessAdapter.ViewModel model = (ProcessAdapter.ViewModel) view.getTag();
|
|
ProcessAdapter.ViewModel model = (ProcessAdapter.ViewModel) view.getTag();
|
|
|
mPosition = (int) parent.getItemIdAtPosition(position);
|
|
mPosition = (int) parent.getItemIdAtPosition(position);
|
|
|
- currentId=position;
|
|
|
|
|
- LogUtil.d(TAG,position+"");
|
|
|
|
|
|
|
+ currentId = position;
|
|
|
|
|
+ LogUtil.d(TAG, position + "");
|
|
|
|
|
+ LogUtil.d(TAG, mPosition + "");
|
|
|
String title = "";
|
|
String title = "";
|
|
|
String url = "";
|
|
String url = "";
|
|
|
String doc_type = "";
|
|
String doc_type = "";
|
|
@@ -284,7 +312,7 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
switch (tab_type) {
|
|
switch (tab_type) {
|
|
|
case 1:
|
|
case 1:
|
|
|
title = "待审批";
|
|
title = "待审批";
|
|
|
- String codeValue=model.codeValue;
|
|
|
|
|
|
|
+ String codeValue = model.codeValue;
|
|
|
// if ("transferprocess".equals(model.typecode)||"process".equals(model.typecode) || "".equals(model.typecode)) {
|
|
// if ("transferprocess".equals(model.typecode)||"process".equals(model.typecode) || "".equals(model.typecode)) {
|
|
|
// url = "jsps/mobile/process.jsp?nodeId=" + model.JP_NODEID;
|
|
// url = "jsps/mobile/process.jsp?nodeId=" + model.JP_NODEID;
|
|
|
// } else if ("procand".equals(model.typecode)) {
|
|
// } else if ("procand".equals(model.typecode)) {
|
|
@@ -292,50 +320,51 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
// } else if ("unprocess".equals(model.typecode)) {
|
|
// } else if ("unprocess".equals(model.typecode)) {
|
|
|
// url = "jsps/mobile/process.jsp?nodeId=" + model.JP_NODEID + "%26_do=1";
|
|
// url = "jsps/mobile/process.jsp?nodeId=" + model.JP_NODEID + "%26_do=1";
|
|
|
// }
|
|
// }
|
|
|
- if (ListUtils.isEmpty(array)) return;
|
|
|
|
|
- doc_type = array.getJSONObject(mPosition).getString("jp_name");
|
|
|
|
|
- detail_id = array.getJSONObject(mPosition).getInteger("jp_codevalue");
|
|
|
|
|
- deal_id = array.getJSONObject(mPosition).getInteger("jp_id");
|
|
|
|
|
- if (!StringUtils.isEmpty(doc_type) && "工作日报".equals(doc_type)){
|
|
|
|
|
|
|
+ if (ListUtils.isEmpty(arrayUn)) return;
|
|
|
|
|
+ doc_type = arrayUn.getJSONObject(mPosition).getString("jp_name");
|
|
|
|
|
+ detail_id = arrayUn.getJSONObject(mPosition).getInteger("jp_codevalue");
|
|
|
|
|
+ deal_id = arrayUn.getJSONObject(mPosition).getInteger("jp_id");
|
|
|
|
|
+ if (!StringUtils.isEmpty(doc_type) && "工作日报".equals(doc_type)) {
|
|
|
startActivityForResult(new Intent(ProcessB2BActivity.this, PlatWDdetailyActivity.class)
|
|
startActivityForResult(new Intent(ProcessB2BActivity.this, PlatWDdetailyActivity.class)
|
|
|
- .putExtra("fromwhere", "examine_and_approve")
|
|
|
|
|
- .putExtra("doc_type", doc_type)
|
|
|
|
|
- .putExtra("deal_id", deal_id)
|
|
|
|
|
- .putExtra("detail_id",detail_id)
|
|
|
|
|
- .putExtra("deal_type", 1)
|
|
|
|
|
- ,0x322); //TODO 你根据这个0x322 我的详情界面审批操作返回后这里改变列表数据状态,或者remove该条单据,resultcode == 0x41701
|
|
|
|
|
- }else {
|
|
|
|
|
|
|
+ .putExtra("fromwhere", "examine_and_approve")
|
|
|
|
|
+ .putExtra("doc_type", doc_type)
|
|
|
|
|
+ .putExtra("deal_id", deal_id)
|
|
|
|
|
+ .putExtra("detail_id", detail_id)
|
|
|
|
|
+ .putExtra("deal_type", 1)
|
|
|
|
|
+ , 0x322); //TODO 你根据这个0x322 我的详情界面审批操作返回后这里改变列表数据状态,或者remove该条单据,resultcode == 0x41701
|
|
|
|
|
+ } else {
|
|
|
startActivityForResult(new Intent(ProcessB2BActivity.this, FormDetailActivity.class)
|
|
startActivityForResult(new Intent(ProcessB2BActivity.this, FormDetailActivity.class)
|
|
|
- .putExtra("fromwhere", "examine_and_approve")
|
|
|
|
|
- .putExtra("doc_type", doc_type)
|
|
|
|
|
- .putExtra("deal_id", deal_id)
|
|
|
|
|
- .putExtra("detail_id",detail_id)
|
|
|
|
|
- .putExtra("deal_type",1)
|
|
|
|
|
- ,0x321); // TODO 你根据这个0x321 我的详情界面审批操作返回后这里改变列表数据状态,或者remove该条单据
|
|
|
|
|
|
|
+ .putExtra("fromwhere", "examine_and_approve")
|
|
|
|
|
+ .putExtra("doc_type", doc_type)
|
|
|
|
|
+ .putExtra("deal_id", deal_id)
|
|
|
|
|
+ .putExtra("detail_id", detail_id)
|
|
|
|
|
+ .putExtra("deal_type", 1)
|
|
|
|
|
+ , 0x321); // TODO 你根据这个0x321 我的详情界面审批操作返回后这里改变列表数据状态,或者remove该条单据
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
break;
|
|
break;
|
|
|
case 2:
|
|
case 2:
|
|
|
- doc_type = itemArray.getJSONObject(mPosition).getString("jn_name");
|
|
|
|
|
- detail_id = itemArray.getJSONObject(mPosition).getInteger("jp_nodeid");
|
|
|
|
|
- deal_id = itemArray.getJSONObject(mPosition).getInteger("jp_keyvalue");
|
|
|
|
|
- if (!StringUtils.isEmpty(doc_type) && "工作日报".equals(doc_type)){
|
|
|
|
|
|
|
+ if (ListUtils.isEmpty(arrayRe)) return;
|
|
|
|
|
+ doc_type = arrayRe.getJSONObject(mPosition).getString("jn_name");
|
|
|
|
|
+ detail_id = arrayRe.getJSONObject(mPosition).getInteger("jp_nodeid");
|
|
|
|
|
+ deal_id = arrayRe.getJSONObject(mPosition).getInteger("jp_keyvalue");
|
|
|
|
|
+ if (!StringUtils.isEmpty(doc_type) && "工作日报".equals(doc_type)) {
|
|
|
startActivityForResult(new Intent(ProcessB2BActivity.this, PlatWDdetailyActivity.class)
|
|
startActivityForResult(new Intent(ProcessB2BActivity.this, PlatWDdetailyActivity.class)
|
|
|
- .putExtra("fromwhere", "examine_and_approve")
|
|
|
|
|
- .putExtra("doc_type", doc_type)
|
|
|
|
|
- .putExtra("deal_id", deal_id)
|
|
|
|
|
- .putExtra("detail_id",detail_id)
|
|
|
|
|
- .putExtra("deal_type", 2)
|
|
|
|
|
- ,0x322); // TODO 你根据这个0x322 我的详情界面审批操作返回后这里改变列表数据状态,或者remove该条单据
|
|
|
|
|
- }else {
|
|
|
|
|
|
|
+ .putExtra("fromwhere", "examine_and_approve")
|
|
|
|
|
+ .putExtra("doc_type", doc_type)
|
|
|
|
|
+ .putExtra("deal_id", deal_id)
|
|
|
|
|
+ .putExtra("detail_id", detail_id)
|
|
|
|
|
+ .putExtra("deal_type", 2)
|
|
|
|
|
+ , 0x322); // TODO 你根据这个0x322 我的详情界面审批操作返回后这里改变列表数据状态,或者remove该条单据
|
|
|
|
|
+ } else {
|
|
|
startActivityForResult(new Intent(ProcessB2BActivity.this, FormDetailActivity.class)
|
|
startActivityForResult(new Intent(ProcessB2BActivity.this, FormDetailActivity.class)
|
|
|
- .putExtra("fromwhere", "examine_and_approve")
|
|
|
|
|
- .putExtra("doc_type", doc_type)
|
|
|
|
|
- .putExtra("deal_id", deal_id)
|
|
|
|
|
- .putExtra("detail_id",detail_id)
|
|
|
|
|
- .putExtra("deal_type", 2)
|
|
|
|
|
- ,0x321); // TODO 你根据这个0x321 我的详情界面审批操作返回后这里改变列表数据状态,或者remove该条单据
|
|
|
|
|
|
|
+ .putExtra("fromwhere", "examine_and_approve")
|
|
|
|
|
+ .putExtra("doc_type", doc_type)
|
|
|
|
|
+ .putExtra("deal_id", deal_id)
|
|
|
|
|
+ .putExtra("detail_id", detail_id)
|
|
|
|
|
+ .putExtra("deal_type", 2)
|
|
|
|
|
+ , 0x321); // TODO 你根据这个0x321 我的详情界面审批操作返回后这里改变列表数据状态,或者remove该条单据
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
case 3:
|
|
case 3:
|
|
@@ -352,7 +381,6 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
mEditText.addTextChangedListener(new TextWatcher() {
|
|
mEditText.addTextChangedListener(new TextWatcher() {
|
|
|
@Override
|
|
@Override
|
|
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -375,7 +403,7 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- final VoiceToWord voice = new VoiceToWord(ProcessB2BActivity.this,"534e3fe2");
|
|
|
|
|
|
|
+ final VoiceToWord voice = new VoiceToWord(ProcessB2BActivity.this, "534e3fe2");
|
|
|
voice.setRecognizerDialogListener(this); //自己调用自己
|
|
voice.setRecognizerDialogListener(this); //自己调用自己
|
|
|
voice_search.setOnClickListener(new View.OnClickListener() {
|
|
voice_search.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
@@ -408,7 +436,7 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
tv_process_un.setSelected(false);
|
|
tv_process_un.setSelected(false);
|
|
|
tv_process_already.setSelected(true);
|
|
tv_process_already.setSelected(true);
|
|
|
tv_process_me.setSelected(false);
|
|
tv_process_me.setSelected(false);
|
|
|
- loadProcesstoAlreadyDo(page);
|
|
|
|
|
|
|
+ loadProcesstoAlreadyDo(pageDone);
|
|
|
|
|
|
|
|
break;
|
|
break;
|
|
|
case R.id.tv_process_me:
|
|
case R.id.tv_process_me:
|
|
@@ -432,12 +460,12 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
private void loadProcessToDo(int page) {
|
|
private void loadProcessToDo(int page) {
|
|
|
String url = ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().getAuditTodo;
|
|
String url = ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().getAuditTodo;
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
- params.put("emuu", CommonUtil.getSharedPreferences(MyApplication.getInstance(),"b2b_uu"));
|
|
|
|
|
- params.put("enuu", CommonUtil.getSharedPreferences(MyApplication.getInstance(),"companyEnUu"));
|
|
|
|
|
- params.put("count", "10");
|
|
|
|
|
|
|
+ params.put("emuu", CommonUtil.getSharedPreferences(MyApplication.getInstance(), "b2b_uu"));
|
|
|
|
|
+ params.put("enuu", CommonUtil.getSharedPreferences(MyApplication.getInstance(), "companyEnUu"));
|
|
|
|
|
+ params.put("count", "1000");
|
|
|
params.put("page", page);
|
|
params.put("page", page);
|
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
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(ct, url, params, mHandler, headers, SUSSCESS_un, null, null, "get");
|
|
ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, SUSSCESS_un, null, null, "get");
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -446,12 +474,12 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
private void loadProcesstoAlreadyDo(int page) {
|
|
private void loadProcesstoAlreadyDo(int page) {
|
|
|
String url = ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().getAuditDone;
|
|
String url = ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().getAuditDone;
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
- params.put("emuu", CommonUtil.getSharedPreferences(MyApplication.getInstance(),"b2b_uu"));
|
|
|
|
|
- params.put("enuu", CommonUtil.getSharedPreferences(MyApplication.getInstance(),"companyEnUu"));
|
|
|
|
|
- params.put("count", "10");
|
|
|
|
|
|
|
+ params.put("emuu", CommonUtil.getSharedPreferences(MyApplication.getInstance(), "b2b_uu"));
|
|
|
|
|
+ params.put("enuu", CommonUtil.getSharedPreferences(MyApplication.getInstance(), "companyEnUu"));
|
|
|
|
|
+ params.put("count", "1000");
|
|
|
params.put("page", page);
|
|
params.put("page", page);
|
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
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(ct, url, params, mHandler, headers, SUSSCESS_already, null, null, "get");
|
|
ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, SUSSCESS_already, null, null, "get");
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -459,9 +487,9 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
private void loadProcessAlreadyLaunch(int page) {
|
|
private void loadProcessAlreadyLaunch(int page) {
|
|
|
String url = Constants.getAppBaseUrl(ct) + "common/desktop/process/alreadyLaunch.action";
|
|
String url = Constants.getAppBaseUrl(ct) + "common/desktop/process/alreadyLaunch.action";
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
- params.put("count", String.valueOf(page*30));
|
|
|
|
|
|
|
+ params.put("count", String.valueOf(page * 30));
|
|
|
params.put("page", 1);
|
|
params.put("page", 1);
|
|
|
- params.put("isMobile","1");
|
|
|
|
|
|
|
+ params.put("isMobile", "1");
|
|
|
params.put("_do", "1");
|
|
params.put("_do", "1");
|
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
@@ -556,8 +584,8 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
Long jp_launchtime = jsonArray.getJSONObject(position).getLong("jp_launchtime");
|
|
Long jp_launchtime = jsonArray.getJSONObject(position).getLong("jp_launchtime");
|
|
|
String jp_status = "待审批";
|
|
String jp_status = "待审批";
|
|
|
String jp_typecode = jsonArray.getJSONObject(position).getString("typecode");
|
|
String jp_typecode = jsonArray.getJSONObject(position).getString("typecode");
|
|
|
- String jp_master=jsonArray.getJSONObject(position).getString("CURRENTMASTER");
|
|
|
|
|
- String codevalue=jsonArray.getJSONObject(position).getString("jp_codevalue");
|
|
|
|
|
|
|
+ String jp_master = jsonArray.getJSONObject(position).getString("CURRENTMASTER");
|
|
|
|
|
+ String codevalue = jsonArray.getJSONObject(position).getString("jp_codevalue");
|
|
|
|
|
|
|
|
model.name.setText(jp_launchername + "的" + jp_name);
|
|
model.name.setText(jp_launchername + "的" + jp_name);
|
|
|
if (jp_launchtime != null) {
|
|
if (jp_launchtime != null) {
|
|
@@ -569,8 +597,8 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
model.status.setText(jp_status);
|
|
model.status.setText(jp_status);
|
|
|
model.JP_NODEID = JP_NODEID;
|
|
model.JP_NODEID = JP_NODEID;
|
|
|
model.typecode = jp_typecode;
|
|
model.typecode = jp_typecode;
|
|
|
- model.master=jp_master;
|
|
|
|
|
- model.codeValue=codevalue;
|
|
|
|
|
|
|
+ model.master = jp_master;
|
|
|
|
|
+ model.codeValue = codevalue;
|
|
|
break;
|
|
break;
|
|
|
case 2:
|
|
case 2:
|
|
|
// {
|
|
// {
|
|
@@ -592,10 +620,10 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
String jn_dealtime = jsonArray.getJSONObject(position).getString("jn_dealtime");//JP_LAUNCHTIME
|
|
String jn_dealtime = jsonArray.getJSONObject(position).getString("jn_dealtime");//JP_LAUNCHTIME
|
|
|
String jn_dealresult = jsonArray.getJSONObject(position).getString("jn_dealresult");
|
|
String jn_dealresult = jsonArray.getJSONObject(position).getString("jn_dealresult");
|
|
|
String doc_name = jsonArray.getJSONObject(position).getString("jp_launchername");
|
|
String doc_name = jsonArray.getJSONObject(position).getString("jp_launchername");
|
|
|
- model.codeValue=jsonArray.getJSONObject(position).getString("jp_keyvalue");
|
|
|
|
|
|
|
+ model.codeValue = jsonArray.getJSONObject(position).getString("jp_keyvalue");
|
|
|
model.name.setText(doc_name + "的" + jp_name);
|
|
model.name.setText(doc_name + "的" + jp_name);
|
|
|
- if (jn_dealmanname!=null)
|
|
|
|
|
- model.date.setText(DateFormatUtil.getFormatDate(Long.valueOf(jn_dealtime)));
|
|
|
|
|
|
|
+ if (jn_dealmanname != null)
|
|
|
|
|
+ model.date.setText(DateFormatUtil.getFormatDate(Long.valueOf(jn_dealtime)));
|
|
|
if (!StringUtils.isEmpty(jn_dealresult)) {
|
|
if (!StringUtils.isEmpty(jn_dealresult)) {
|
|
|
if ("不同意".equals(jn_dealresult)) {
|
|
if ("不同意".equals(jn_dealresult)) {
|
|
|
CommonUtil.textSpanForStyle(model.status, "已审批(" + jn_dealresult + ")",
|
|
CommonUtil.textSpanForStyle(model.status, "已审批(" + jn_dealresult + ")",
|
|
@@ -621,15 +649,16 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
String status = jsonArray.getJSONObject(position).getString("JP_STATUS");
|
|
String status = jsonArray.getJSONObject(position).getString("JP_STATUS");
|
|
|
String nodename = jsonArray.getJSONObject(position).getString("JP_NODEDEALMANNAME");
|
|
String nodename = jsonArray.getJSONObject(position).getString("JP_NODEDEALMANNAME");
|
|
|
JP_NODEID = jsonArray.getJSONObject(position).getString("JP_NODEID");
|
|
JP_NODEID = jsonArray.getJSONObject(position).getString("JP_NODEID");
|
|
|
- String codename= jsonArray.getJSONObject(position).getString("JP_NODENAME");
|
|
|
|
|
|
|
+ String codename = jsonArray.getJSONObject(position).getString("JP_NODENAME");
|
|
|
if (!StringUtils.isEmpty(status)) {
|
|
if (!StringUtils.isEmpty(status)) {
|
|
|
if (status.equals("待审批")) {
|
|
if (status.equals("待审批")) {
|
|
|
- status = "等待" + nodename +"("+codename+ ")审批";
|
|
|
|
|
- }if (status.equals("未通过")){
|
|
|
|
|
- status="未通过" + nodename + "("+codename+")审批";
|
|
|
|
|
|
|
+ status = "等待" + nodename + "(" + codename + ")审批";
|
|
|
|
|
+ }
|
|
|
|
|
+ if (status.equals("未通过")) {
|
|
|
|
|
+ status = "未通过" + nodename + "(" + codename + ")审批";
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
- status=" ";
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ status = " ";
|
|
|
}
|
|
}
|
|
|
if (!StringUtils.isEmpty(name)) name = name.substring(0, name.length() - 2);
|
|
if (!StringUtils.isEmpty(name)) name = name.substring(0, name.length() - 2);
|
|
|
model.name.setText(name + "-" + code);
|
|
model.name.setText(name + "-" + code);
|
|
@@ -644,7 +673,7 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
model.status.setTextColor(mContext.getResources().getColor(R.color.red));
|
|
model.status.setTextColor(mContext.getResources().getColor(R.color.red));
|
|
|
model.status.setText(status);
|
|
model.status.setText(status);
|
|
|
|
|
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
model.status.setTextColor(mContext.getResources().getColor(R.color.light_gray));
|
|
model.status.setTextColor(mContext.getResources().getColor(R.color.light_gray));
|
|
|
model.status.setText(status);
|
|
model.status.setText(status);
|
|
|
}
|
|
}
|
|
@@ -664,8 +693,8 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
protected FilterResults performFiltering(CharSequence constraint) {
|
|
protected FilterResults performFiltering(CharSequence constraint) {
|
|
|
FilterResults searchResults = new FilterResults();
|
|
FilterResults searchResults = new FilterResults();
|
|
|
if (constraint == null || constraint.length() == 0) {
|
|
if (constraint == null || constraint.length() == 0) {
|
|
|
- searchResults.values = array;
|
|
|
|
|
- searchResults.count = array.size();
|
|
|
|
|
|
|
+ searchResults.values = tab_type == 1 ? arrayUn : arrayRe;
|
|
|
|
|
+ searchResults.count = (tab_type == 1 ? arrayUn : arrayRe).size();
|
|
|
} else {
|
|
} else {
|
|
|
JSONArray newArry = new JSONArray();
|
|
JSONArray newArry = new JSONArray();
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
@@ -697,17 +726,17 @@ public class ProcessB2BActivity extends BaseActivity implements View.OnClickList
|
|
|
break;
|
|
break;
|
|
|
case 2:
|
|
case 2:
|
|
|
// {
|
|
// {
|
|
|
- // "jn_dealmanid":1000002802,
|
|
|
|
|
- // "jn_dealmanname":"移动测试员",
|
|
|
|
|
- // "jn_dealresult":"不同意",
|
|
|
|
|
- // "jn_dealtime":1490249444130,
|
|
|
|
|
- // "jn_name":"加班单",
|
|
|
|
|
- // "jn_operateddescription":"注意工作,别老加班",
|
|
|
|
|
- // "jp_keyvalue":809,
|
|
|
|
|
- // "jp_launcherid":1000009169,
|
|
|
|
|
- // "jp_launchername":"移动测试",
|
|
|
|
|
- // "jp_nodeid":281
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ // "jn_dealmanid":1000002802,
|
|
|
|
|
+ // "jn_dealmanname":"移动测试员",
|
|
|
|
|
+ // "jn_dealresult":"不同意",
|
|
|
|
|
+ // "jn_dealtime":1490249444130,
|
|
|
|
|
+ // "jn_name":"加班单",
|
|
|
|
|
+ // "jn_operateddescription":"注意工作,别老加班",
|
|
|
|
|
+ // "jp_keyvalue":809,
|
|
|
|
|
+ // "jp_launcherid":1000009169,
|
|
|
|
|
+ // "jp_launchername":"移动测试",
|
|
|
|
|
+ // "jp_nodeid":281
|
|
|
|
|
+ // }
|
|
|
cu_name = jsonObject.getString("jn_name") == null ? "" : jsonObject.getString("jn_name");
|
|
cu_name = jsonObject.getString("jn_name") == null ? "" : jsonObject.getString("jn_name");
|
|
|
time = jsonObject.getString("jn_dealtime") == null ? "" : jsonObject.getString("jn_dealtime");
|
|
time = jsonObject.getString("jn_dealtime") == null ? "" : jsonObject.getString("jn_dealtime");
|
|
|
jn_dealresult = jsonObject.getString("jn_dealresult") == null ? "" : jsonObject.getString("jn_dealresult");
|
|
jn_dealresult = jsonObject.getString("jn_dealresult") == null ? "" : jsonObject.getString("jn_dealresult");
|