|
|
@@ -5,17 +5,24 @@ import android.os.Bundle;
|
|
|
import android.os.Handler;
|
|
|
import android.os.Message;
|
|
|
import android.support.v7.app.ActionBar;
|
|
|
+import android.text.Editable;
|
|
|
+import android.text.TextWatcher;
|
|
|
+import android.util.Log;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
import android.widget.AdapterView;
|
|
|
import android.widget.BaseAdapter;
|
|
|
+import android.widget.Filter;
|
|
|
+import android.widget.Filterable;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.ListView;
|
|
|
import android.widget.TextView;
|
|
|
+import android.widget.Toast;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.handmark.pulltorefresh.library.PullToRefreshBase;
|
|
|
import com.handmark.pulltorefresh.library.PullToRefreshListView;
|
|
|
import com.lidroid.xutils.ViewUtils;
|
|
|
@@ -36,9 +43,9 @@ import java.util.LinkedHashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
- * @desc:
|
|
|
- * @author:Arison on 2016/11/1
|
|
|
- */
|
|
|
+ * @desc:
|
|
|
+ * @author:Arison on 2016/11/1
|
|
|
+ */
|
|
|
public class ProcessMsgActivity extends BaseActivity implements View.OnClickListener {
|
|
|
|
|
|
@ViewInject(R.id.edt_search)
|
|
|
@@ -54,79 +61,78 @@ public class ProcessMsgActivity extends BaseActivity implements View.OnClickList
|
|
|
private TextView tv_process_already;
|
|
|
@ViewInject(R.id.tv_process_un)
|
|
|
private TextView tv_process_un;
|
|
|
-
|
|
|
+
|
|
|
@ViewInject(R.id.back)
|
|
|
private ImageView iv_back;
|
|
|
|
|
|
private ProcessAdapter mAdapter;
|
|
|
- private JSONArray array=new JSONArray();
|
|
|
-
|
|
|
- private int tab_type=1;
|
|
|
- private int page=1;
|
|
|
- private final int SUSSCESS_un=1;
|
|
|
- private final int SUSSCESS_already=2;
|
|
|
- private final int SUSSCESS_me=3;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- private Handler mHandler=new Handler(){
|
|
|
+ private JSONArray array = new JSONArray();
|
|
|
+
|
|
|
+ private int tab_type = 1;
|
|
|
+ private int page = 1;
|
|
|
+ private final int SUSSCESS_un = 1;
|
|
|
+ private final int SUSSCESS_already = 2;
|
|
|
+ private final int SUSSCESS_me = 3;
|
|
|
+
|
|
|
+
|
|
|
+ private Handler mHandler = new Handler() {
|
|
|
@Override
|
|
|
public void handleMessage(Message msg) {
|
|
|
- String result=msg.getData().getString("result");
|
|
|
+ String result = msg.getData().getString("result");
|
|
|
progressDialog.dismiss();
|
|
|
mList.onRefreshComplete();
|
|
|
-
|
|
|
- switch (msg.what){
|
|
|
- case SUSSCESS_un:
|
|
|
- JSONArray itemArray= JSON.parseObject(result).getJSONArray("data");
|
|
|
- if(page==1)array.clear();
|
|
|
+
|
|
|
+ switch (msg.what) {
|
|
|
+ case SUSSCESS_un:
|
|
|
+ JSONArray itemArray = JSON.parseObject(result).getJSONArray("data");
|
|
|
+ if (page == 1) array.clear();
|
|
|
array.addAll(itemArray);
|
|
|
- if (mAdapter==null){
|
|
|
- mAdapter=new ProcessAdapter(ct,array);
|
|
|
+ if (mAdapter == null) {
|
|
|
+ mAdapter = new ProcessAdapter(ct, array);
|
|
|
mList.setAdapter(mAdapter);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
mAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
- if (array.size()==0){
|
|
|
- mEmptyLayout.showEmpty();
|
|
|
- }
|
|
|
- break;
|
|
|
- case SUSSCESS_already:
|
|
|
- itemArray= JSON.parseObject(result).getJSONArray("data");
|
|
|
- if(page==1)array.clear();
|
|
|
- array.addAll(itemArray);
|
|
|
- if (mAdapter==null){
|
|
|
- mAdapter=new ProcessAdapter(ct,array);
|
|
|
- mList.setAdapter(mAdapter);
|
|
|
- }else {
|
|
|
- mAdapter.notifyDataSetChanged();
|
|
|
- }
|
|
|
- if (array.size()==0){
|
|
|
-
|
|
|
- mEmptyLayout.showEmpty();
|
|
|
- }
|
|
|
- break;
|
|
|
- case SUSSCESS_me:
|
|
|
- itemArray= JSON.parseObject(result).getJSONArray("data");
|
|
|
- if(page==1)array.clear();
|
|
|
- array.addAll(itemArray);
|
|
|
- if (mAdapter==null){
|
|
|
- mAdapter=new ProcessAdapter(ct,array);
|
|
|
- mList.setAdapter(mAdapter);
|
|
|
- }else {
|
|
|
- mAdapter.notifyDataSetChanged();
|
|
|
- }
|
|
|
- if (array.size()==0){
|
|
|
- mEmptyLayout.showEmpty();
|
|
|
- }
|
|
|
- break;
|
|
|
- case Constants.APP_SOCKETIMEOUTEXCEPTION:
|
|
|
- ToastMessage(result);
|
|
|
- break;
|
|
|
- }
|
|
|
+ if (array.size() == 0) {
|
|
|
+ mEmptyLayout.showEmpty();
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case SUSSCESS_already:
|
|
|
+ itemArray = JSON.parseObject(result).getJSONArray("data");
|
|
|
+ if (page == 1) array.clear();
|
|
|
+ array.addAll(itemArray);
|
|
|
+ if (mAdapter == null) {
|
|
|
+ mAdapter = new ProcessAdapter(ct, array);
|
|
|
+ mList.setAdapter(mAdapter);
|
|
|
+ } else {
|
|
|
+ mAdapter.notifyDataSetChanged();
|
|
|
+ }
|
|
|
+ if (array.size() == 0) {
|
|
|
+
|
|
|
+ mEmptyLayout.showEmpty();
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case SUSSCESS_me:
|
|
|
+ itemArray = JSON.parseObject(result).getJSONArray("data");
|
|
|
+ if (page == 1) array.clear();
|
|
|
+ array.addAll(itemArray);
|
|
|
+ if (mAdapter == null) {
|
|
|
+ mAdapter = new ProcessAdapter(ct, array);
|
|
|
+ mList.setAdapter(mAdapter);
|
|
|
+ } else {
|
|
|
+ mAdapter.notifyDataSetChanged();
|
|
|
+ }
|
|
|
+ if (array.size() == 0) {
|
|
|
+ mEmptyLayout.showEmpty();
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case Constants.APP_SOCKETIMEOUTEXCEPTION:
|
|
|
+ ToastMessage(result);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
@@ -146,14 +152,14 @@ public class ProcessMsgActivity extends BaseActivity implements View.OnClickList
|
|
|
mEmptyLayout.setShowErrorButton(false);
|
|
|
mEmptyLayout.setShowLoadingButton(false);
|
|
|
mEmptyLayout.showLoading();
|
|
|
-
|
|
|
+
|
|
|
View view = LayoutInflater.from(ct).inflate(R.layout.process_header, null);
|
|
|
ActionBar bar = this.getSupportActionBar();
|
|
|
bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
|
|
|
- tv_process_already= (TextView) view.findViewById(R.id.tv_process_already);
|
|
|
- tv_process_un= (TextView) view.findViewById(R.id.tv_process_un);
|
|
|
- tv_process_me= (TextView) view.findViewById(R.id.tv_process_me);
|
|
|
- iv_back= (ImageView) view.findViewById(R.id.back);
|
|
|
+ tv_process_already = (TextView) view.findViewById(R.id.tv_process_already);
|
|
|
+ tv_process_un = (TextView) view.findViewById(R.id.tv_process_un);
|
|
|
+ tv_process_me = (TextView) view.findViewById(R.id.tv_process_me);
|
|
|
+ iv_back = (ImageView) view.findViewById(R.id.back);
|
|
|
bar.setCustomView(view);
|
|
|
tv_process_already.setOnClickListener(this);
|
|
|
tv_process_me.setOnClickListener(this);
|
|
|
@@ -164,8 +170,8 @@ public class ProcessMsgActivity extends BaseActivity implements View.OnClickList
|
|
|
mList.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>() {
|
|
|
@Override
|
|
|
public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
|
|
|
- page=1;
|
|
|
- switch (tab_type){
|
|
|
+ page = 1;
|
|
|
+ switch (tab_type) {
|
|
|
case 1:
|
|
|
loadProcessToDo(page);
|
|
|
break;
|
|
|
@@ -181,7 +187,7 @@ public class ProcessMsgActivity extends BaseActivity implements View.OnClickList
|
|
|
@Override
|
|
|
public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
|
|
|
page++;
|
|
|
- switch (tab_type){
|
|
|
+ switch (tab_type) {
|
|
|
case 1:
|
|
|
loadProcessToDo(page);
|
|
|
break;
|
|
|
@@ -192,100 +198,127 @@ public class ProcessMsgActivity extends BaseActivity implements View.OnClickList
|
|
|
loadProcessAlreadyLaunch(page);
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
mList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
|
@Override
|
|
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
|
|
- ProcessAdapter.ViewModel model= (ProcessAdapter.ViewModel) view.getTag();
|
|
|
- String title="";
|
|
|
- switch (tab_type){
|
|
|
+ ProcessAdapter.ViewModel model = (ProcessAdapter.ViewModel) view.getTag();
|
|
|
+ String title = "";
|
|
|
+ switch (tab_type) {
|
|
|
case 1:
|
|
|
- title="待审批";
|
|
|
+ title = "待审批";
|
|
|
break;
|
|
|
case 2:
|
|
|
- title="已审批";
|
|
|
+ title = "已审批";
|
|
|
break;
|
|
|
case 3:
|
|
|
- title="我发起的";
|
|
|
+ title = "我发起的";
|
|
|
break;
|
|
|
}
|
|
|
- String url="jsps/mobile/jprocand.jsp?nodeId="+model.JP_NODEID;
|
|
|
- CommonUtil.loadWebView(ct,url,title,CommonUtil.getSharedPreferences(ct,"erp_master"),null,null);
|
|
|
+ String url = "jsps/mobile/jprocand.jsp?nodeId=" + model.JP_NODEID;
|
|
|
+ CommonUtil.loadWebView(ct, url, title, CommonUtil.getSharedPreferences(ct, "erp_master"), null, null);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ mEditText.addTextChangedListener(new TextWatcher() {
|
|
|
+ @Override
|
|
|
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void afterTextChanged(Editable s) {
|
|
|
+ if (mAdapter == null) {
|
|
|
+ Toast.makeText(getApplication(), "系统内部错误", Toast.LENGTH_SHORT).show();
|
|
|
+ } else {
|
|
|
+ if (!StringUtils.isEmpty(mEditText.getText().toString())) {
|
|
|
+ mAdapter.getFilter().filter(mEditText.getText().toString());
|
|
|
+ } else {
|
|
|
+ mAdapter.getFilter().filter("");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
- switch (v.getId()){
|
|
|
+ switch (v.getId()) {
|
|
|
case R.id.tv_process_un:
|
|
|
- page=1;
|
|
|
- tab_type=1;
|
|
|
+ page = 1;
|
|
|
+ tab_type = 1;
|
|
|
tv_process_un.setSelected(true);
|
|
|
tv_process_already.setSelected(false);
|
|
|
tv_process_me.setSelected(false);
|
|
|
loadProcessToDo(page);
|
|
|
+ mAdapter = null;
|
|
|
break;
|
|
|
case R.id.tv_process_already:
|
|
|
- page=1;
|
|
|
- tab_type=2;
|
|
|
+ page = 1;
|
|
|
+ tab_type = 2;
|
|
|
tv_process_un.setSelected(false);
|
|
|
tv_process_already.setSelected(true);
|
|
|
tv_process_me.setSelected(false);
|
|
|
loadProcesstoAlreadyDo(page);
|
|
|
+ mAdapter = null;
|
|
|
break;
|
|
|
case R.id.tv_process_me:
|
|
|
- page=1;
|
|
|
- tab_type=3;
|
|
|
+ page = 1;
|
|
|
+ tab_type = 3;
|
|
|
tv_process_un.setSelected(false);
|
|
|
tv_process_already.setSelected(false);
|
|
|
tv_process_me.setSelected(true);
|
|
|
loadProcessAlreadyLaunch(page);
|
|
|
+ mAdapter = null;
|
|
|
break;
|
|
|
case R.id.back:
|
|
|
onBackPressed();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- private void loadProcessToDo(int page){
|
|
|
+
|
|
|
+
|
|
|
+ private void loadProcessToDo(int page) {
|
|
|
progressDialog.show();
|
|
|
String url = Constants.getAppBaseUrl(ct) + "common/desktop/process/toDo.action";
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
- // count=10&page=1&limit=25
|
|
|
- params.put("count","10");
|
|
|
- params.put("page",page);
|
|
|
+ // count=10&page=1&limit=25
|
|
|
+ params.put("count", "1000");
|
|
|
+ params.put("page", page);
|
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
- ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, SUSSCESS_un, null, null, "get");
|
|
|
-
|
|
|
+ ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, SUSSCESS_un, null, null, "get");
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
|
|
|
- private void loadProcesstoAlreadyDo(int page){
|
|
|
+
|
|
|
+ private void loadProcesstoAlreadyDo(int page) {
|
|
|
progressDialog.show();
|
|
|
String url = Constants.getAppBaseUrl(ct) + "common/desktop/process/alreadyDo.action";
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
- params.put("count","10");
|
|
|
- params.put("page",page);
|
|
|
+ params.put("count", "1000");
|
|
|
+ params.put("page", page);
|
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, SUSSCESS_already, null, null, "get");
|
|
|
|
|
|
}
|
|
|
|
|
|
- private void loadProcessAlreadyLaunch(int page){
|
|
|
+ private void loadProcessAlreadyLaunch(int page) {
|
|
|
progressDialog.show();
|
|
|
String url = Constants.getAppBaseUrl(ct) + "common/desktop/process/alreadyLaunch.action";
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
- params.put("count","10");
|
|
|
- params.put("page",page);
|
|
|
+ params.put("count", "1000");
|
|
|
+ params.put("page", page);
|
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, SUSSCESS_me, null, null, "get");
|
|
|
@@ -293,21 +326,21 @@ public class ProcessMsgActivity extends BaseActivity implements View.OnClickList
|
|
|
}
|
|
|
|
|
|
|
|
|
- public class ProcessAdapter extends BaseAdapter{
|
|
|
-
|
|
|
+ public class ProcessAdapter extends BaseAdapter implements Filterable {
|
|
|
+
|
|
|
private Context ct;
|
|
|
private LayoutInflater inflater;
|
|
|
private JSONArray jsonArray;
|
|
|
-
|
|
|
- ProcessAdapter(Context ct,JSONArray array){
|
|
|
- this.ct=ct;
|
|
|
- this.jsonArray=array;
|
|
|
- this.inflater=LayoutInflater.from(ct);
|
|
|
+
|
|
|
+ ProcessAdapter(Context ct, JSONArray array) {
|
|
|
+ this.ct = ct;
|
|
|
+ this.jsonArray = array;
|
|
|
+ this.inflater = LayoutInflater.from(ct);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int getCount() {
|
|
|
- return jsonArray==null?0:jsonArray.size();
|
|
|
+ return jsonArray == null ? 0 : jsonArray.size();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -322,52 +355,52 @@ public class ProcessMsgActivity extends BaseActivity implements View.OnClickList
|
|
|
|
|
|
@Override
|
|
|
public View getView(int position, View convertView, ViewGroup parent) {
|
|
|
- ViewModel model=null;
|
|
|
- if(convertView==null){
|
|
|
- convertView= inflater.inflate(R.layout.item_process_state,parent,false);
|
|
|
- model=new ViewModel();
|
|
|
- model.name= (TextView) convertView.findViewById(R.id.tv_name);
|
|
|
- model.date= (TextView) convertView.findViewById(R.id.tv_date);
|
|
|
- model.status= (TextView) convertView.findViewById(R.id.tv_status);
|
|
|
+ ViewModel model = null;
|
|
|
+ if (convertView == null) {
|
|
|
+ convertView = inflater.inflate(R.layout.item_process_state, parent, false);
|
|
|
+ model = new ViewModel();
|
|
|
+ model.name = (TextView) convertView.findViewById(R.id.tv_name);
|
|
|
+ model.date = (TextView) convertView.findViewById(R.id.tv_date);
|
|
|
+ model.status = (TextView) convertView.findViewById(R.id.tv_status);
|
|
|
convertView.setTag(model);
|
|
|
- }else{
|
|
|
- model= (ViewModel) convertView.getTag();
|
|
|
+ } else {
|
|
|
+ model = (ViewModel) convertView.getTag();
|
|
|
}
|
|
|
-
|
|
|
- switch (tab_type){
|
|
|
+
|
|
|
+ switch (tab_type) {
|
|
|
case 1:
|
|
|
//JP_LAUNCHERNAME
|
|
|
//JP_NAME
|
|
|
//JP_STATUS
|
|
|
//JP_LAUNCHTIME
|
|
|
- String jp_launchername=jsonArray.getJSONObject(position).getString("JP_LAUNCHERNAME");
|
|
|
- String jp_name=jsonArray.getJSONObject(position).getString("JP_NAME");
|
|
|
- String JP_NODEID=jsonArray.getJSONObject(position).getString("JP_NODEID");
|
|
|
- if (!StringUtils.isEmpty(jp_name))jp_name=jp_name.replace("流程","");
|
|
|
- long jp_launchtime=jsonArray.getJSONObject(position).getLong("JP_LAUNCHTIME");
|
|
|
- String jp_status=jsonArray.getJSONObject(position).getString("JP_STATUS");
|
|
|
-
|
|
|
- model.name.setText(jp_launchername+"的"+jp_name);
|
|
|
- model.date.setText(DateFormatUtil.getStrDate4Date(new Date(jp_launchtime),"yyyy-MM-dd HH:mm"));
|
|
|
+ String jp_launchername = jsonArray.getJSONObject(position).getString("JP_LAUNCHERNAME");
|
|
|
+ String jp_name = jsonArray.getJSONObject(position).getString("JP_NAME");
|
|
|
+ String JP_NODEID = jsonArray.getJSONObject(position).getString("JP_NODEID");
|
|
|
+ if (!StringUtils.isEmpty(jp_name)) jp_name = jp_name.replace("流程", "");
|
|
|
+ long jp_launchtime = jsonArray.getJSONObject(position).getLong("JP_LAUNCHTIME");
|
|
|
+ String jp_status = jsonArray.getJSONObject(position).getString("JP_STATUS");
|
|
|
+
|
|
|
+ model.name.setText(jp_launchername + "的" + jp_name);
|
|
|
+ model.date.setText(DateFormatUtil.getStrDate4Date(new Date(jp_launchtime), "yyyy-MM-dd HH:mm"));
|
|
|
model.status.setText(jp_status);
|
|
|
- model.JP_NODEID=JP_NODEID;
|
|
|
+ model.JP_NODEID = JP_NODEID;
|
|
|
break;
|
|
|
case 2:
|
|
|
//JN_DEALMANNAME
|
|
|
//JP_NAME
|
|
|
//JN_DEALTIME
|
|
|
//JN_DEALRESULT
|
|
|
- String jn_dealmanname=jsonArray.getJSONObject(position).getString("JN_DEALMANNAME");
|
|
|
- jp_name=jsonArray.getJSONObject(position).getString("JP_NAME");
|
|
|
- JP_NODEID=jsonArray.getJSONObject(position).getString("JP_NODEID");
|
|
|
- if (!StringUtils.isEmpty(jp_name))jp_name=jp_name.replace("流程","");
|
|
|
- String jn_dealtime=jsonArray.getJSONObject(position).getString("JN_DEALTIME");
|
|
|
- String jn_dealresult=jsonArray.getJSONObject(position).getString("JN_DEALRESULT");
|
|
|
-
|
|
|
- model.name.setText(jn_dealmanname+"的"+jp_name);
|
|
|
+ String jn_dealmanname = jsonArray.getJSONObject(position).getString("JN_DEALMANNAME");
|
|
|
+ jp_name = jsonArray.getJSONObject(position).getString("JP_NAME");
|
|
|
+ JP_NODEID = jsonArray.getJSONObject(position).getString("JP_NODEID");
|
|
|
+ if (!StringUtils.isEmpty(jp_name)) jp_name = jp_name.replace("流程", "");
|
|
|
+ String jn_dealtime = jsonArray.getJSONObject(position).getString("JN_DEALTIME");//JP_LAUNCHTIME
|
|
|
+ String jn_dealresult = jsonArray.getJSONObject(position).getString("JN_DEALRESULT");
|
|
|
+
|
|
|
+ model.name.setText(jn_dealmanname + "的" + jp_name);
|
|
|
model.date.setText(jn_dealtime);
|
|
|
model.status.setText(jn_dealresult);
|
|
|
- model.JP_NODEID=JP_NODEID;
|
|
|
+ model.JP_NODEID = JP_NODEID;
|
|
|
break;
|
|
|
case 3:
|
|
|
//JP_CODEVALUE
|
|
|
@@ -375,30 +408,103 @@ public class ProcessMsgActivity extends BaseActivity implements View.OnClickList
|
|
|
//JP_STATUS
|
|
|
//JP_LAUNCHTIME
|
|
|
//JP_NODEDEALMANNAME
|
|
|
- long time=jsonArray.getJSONObject(position).getLong("JP_LAUNCHTIME");
|
|
|
- String name=jsonArray.getJSONObject(position).getString("JP_NAME");
|
|
|
- String code=jsonArray.getJSONObject(position).getString("JP_CODEVALUE");
|
|
|
- String status=jsonArray.getJSONObject(position).getString("JP_STATUS");
|
|
|
- String nodename=jsonArray.getJSONObject(position).getString("JP_NODEDEALMANNAME");
|
|
|
- JP_NODEID=jsonArray.getJSONObject(position).getString("JP_NODEID");
|
|
|
- if (!StringUtils.isEmpty(status))
|
|
|
- {
|
|
|
- if (status.equals("待审批")){
|
|
|
- status="等待"+nodename+"审批";
|
|
|
+ long time = jsonArray.getJSONObject(position).getLong("JP_LAUNCHTIME");
|
|
|
+ String name = jsonArray.getJSONObject(position).getString("JP_NAME");
|
|
|
+ String code = jsonArray.getJSONObject(position).getString("JP_CODEVALUE");
|
|
|
+ String status = jsonArray.getJSONObject(position).getString("JP_STATUS");
|
|
|
+ String nodename = jsonArray.getJSONObject(position).getString("JP_NODEDEALMANNAME");
|
|
|
+ JP_NODEID = jsonArray.getJSONObject(position).getString("JP_NODEID");
|
|
|
+ if (!StringUtils.isEmpty(status)) {
|
|
|
+ if (status.equals("待审批")) {
|
|
|
+ status = "等待" + nodename + "审批";
|
|
|
}
|
|
|
}
|
|
|
- if (!StringUtils.isEmpty(name))name=name.substring(0,name.length()-2);
|
|
|
- model.name.setText(name+"-"+code);
|
|
|
- model.date.setText(DateFormatUtil.getStrDate4Date(new Date(time),"yyyy-MM-dd HH:mm"));
|
|
|
+ if (!StringUtils.isEmpty(name)) name = name.substring(0, name.length() - 2);
|
|
|
+ model.name.setText(name + "-" + code);
|
|
|
+ model.date.setText(DateFormatUtil.getStrDate4Date(new Date(time), "yyyy-MM-dd HH:mm"));
|
|
|
model.status.setText(status);
|
|
|
- model.JP_NODEID=JP_NODEID;
|
|
|
+ model.JP_NODEID = JP_NODEID;
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return convertView;
|
|
|
}
|
|
|
-
|
|
|
- class ViewModel{
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Filter getFilter() {
|
|
|
+ return new Filter() {
|
|
|
+ @Override
|
|
|
+ protected FilterResults performFiltering(CharSequence constraint) {
|
|
|
+ FilterResults searchResults = new FilterResults();
|
|
|
+ if (constraint == null || constraint.length() == 0) {
|
|
|
+ searchResults.values = array;
|
|
|
+ searchResults.count = array.size();
|
|
|
+ } else {
|
|
|
+ JSONArray newArry = new JSONArray();
|
|
|
+ for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
+ JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
|
+ Log.i("Arison", "performFiltering:" + jsonObject.toString());
|
|
|
+ String cu_name = "";
|
|
|
+ String time = "";
|
|
|
+ String status = "";
|
|
|
+ String nodename = "";
|
|
|
+ String jn_dealresult = "";
|
|
|
+ String jp_launchername = "";
|
|
|
+ String code = "";
|
|
|
+ switch (tab_type) {
|
|
|
+ case 1:
|
|
|
+ cu_name = jsonObject.getString("JP_NAME") == null ? "" : jsonObject.getString("JP_NAME");
|
|
|
+ long temp_long = jsonObject.getLong("JP_LAUNCHTIME") == null ? 0 : jsonObject.getLong("JP_LAUNCHTIME");
|
|
|
+ time = DateFormatUtil.getStrDate4Date(new Date(temp_long), "yyyy-MM-dd HH:mm");
|
|
|
+ status = jsonObject.getString("JP_STATUS") == null ? "" : jsonObject.getString("JP_STATUS");
|
|
|
+ jp_launchername = jsonObject.getString("JP_LAUNCHERNAME") == null ? "" : jsonObject.getString("JP_LAUNCHERNAME");
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ cu_name = jsonObject.getString("JP_NAME") == null ? "" : jsonObject.getString("JP_NAME");
|
|
|
+ time = jsonObject.getString("JN_DEALTIME") == null ? "" : jsonObject.getString("JN_DEALTIME");
|
|
|
+ jn_dealresult = jsonObject.getString("JN_DEALRESULT") == null ? "" : jsonObject.getString("JN_DEALRESULT");
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ cu_name = jsonObject.getString("JP_NAME") == null ? "" : jsonObject.getString("JP_NAME");
|
|
|
+ temp_long = jsonObject.getLong("JP_LAUNCHTIME") == null ? 0 : jsonObject.getLong("JP_LAUNCHTIME");
|
|
|
+ time = DateFormatUtil.getStrDate4Date(new Date(temp_long), "yyyy-MM-dd HH:mm");
|
|
|
+ status = jsonObject.getString("JP_STATUS") == null ? "" : jsonObject.getString("JP_STATUS");
|
|
|
+ nodename = jsonObject.getString("JP_NODEDEALMANNAME") == null ? "" : jsonObject.getString("JP_NODEDEALMANNAME");
|
|
|
+ code = jsonObject.getString("JP_CODEVALUE") == null ? "" : jsonObject.getString("JP_CODEVALUE");
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (cu_name.contains(constraint)
|
|
|
+ || time.contains(constraint)
|
|
|
+ || status.contains(constraint)
|
|
|
+ || jn_dealresult.contains(constraint)
|
|
|
+ || jp_launchername.contains(constraint)
|
|
|
+ || nodename.contains(constraint)
|
|
|
+ || code.contains(constraint)) {
|
|
|
+ newArry.add(jsonObject);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ searchResults.values = newArry;
|
|
|
+ searchResults.count = newArry.size();
|
|
|
+ }
|
|
|
+ return searchResults;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void publishResults(CharSequence constraint, FilterResults results) {
|
|
|
+ //装配数据
|
|
|
+ jsonArray = (JSONArray) results.values;
|
|
|
+ if (mAdapter.getCount() == 0) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ notifyDataSetChanged();
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ class ViewModel {
|
|
|
TextView name;
|
|
|
TextView date;
|
|
|
TextView status;
|