|
|
@@ -43,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)
|
|
|
@@ -61,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);
|
|
|
@@ -153,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);
|
|
|
@@ -171,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;
|
|
|
@@ -188,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;
|
|
|
@@ -199,10 +198,10 @@ 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) {
|
|
|
@@ -223,11 +222,11 @@ public class ProcessMsgActivity extends BaseActivity implements View.OnClickList
|
|
|
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
|
|
|
@@ -237,9 +236,9 @@ public class ProcessMsgActivity extends BaseActivity implements View.OnClickList
|
|
|
|
|
|
@Override
|
|
|
public void afterTextChanged(Editable s) {
|
|
|
- if(mAdapter==null){
|
|
|
+ if (mAdapter == null) {
|
|
|
Toast.makeText(getApplication(), "系统内部错误", Toast.LENGTH_SHORT).show();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
if (!StringUtils.isEmpty(mEditText.getText().toString())) {
|
|
|
mAdapter.getFilter().filter(mEditText.getText().toString());
|
|
|
} else {
|
|
|
@@ -249,78 +248,77 @@ public class ProcessMsgActivity extends BaseActivity implements View.OnClickList
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
|
|
|
@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;
|
|
|
+ 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;
|
|
|
+ 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;
|
|
|
+ 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","1000");
|
|
|
- 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","1000");
|
|
|
- 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","1000");
|
|
|
- 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");
|
|
|
@@ -328,21 +326,21 @@ public class ProcessMsgActivity extends BaseActivity implements View.OnClickList
|
|
|
}
|
|
|
|
|
|
|
|
|
- public class ProcessAdapter extends BaseAdapter implements Filterable {
|
|
|
-
|
|
|
+ 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
|
|
|
@@ -357,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");//JP_LAUNCHTIME
|
|
|
- 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
|
|
|
@@ -410,26 +408,25 @@ 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;
|
|
|
}
|
|
|
|
|
|
@@ -439,57 +436,57 @@ public class ProcessMsgActivity extends BaseActivity implements View.OnClickList
|
|
|
@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);
|
|
|
+ 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){
|
|
|
+ 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");
|
|
|
+ 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");
|
|
|
+ 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");
|
|
|
-
|
|
|
+ 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)){
|
|
|
+ || 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();
|
|
|
+ searchResults.values = newArry;
|
|
|
+ searchResults.count = newArry.size();
|
|
|
}
|
|
|
return searchResults;
|
|
|
}
|
|
|
@@ -497,17 +494,17 @@ public class ProcessMsgActivity extends BaseActivity implements View.OnClickList
|
|
|
@Override
|
|
|
protected void publishResults(CharSequence constraint, FilterResults results) {
|
|
|
//装配数据
|
|
|
- jsonArray= (JSONArray) results.values;
|
|
|
+ jsonArray = (JSONArray) results.values;
|
|
|
if (mAdapter.getCount() == 0) {
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
notifyDataSetChanged();
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
|
|
|
- class ViewModel{
|
|
|
+ class ViewModel {
|
|
|
TextView name;
|
|
|
TextView date;
|
|
|
TextView status;
|