|
|
@@ -72,12 +72,12 @@ import java.util.regex.Pattern;
|
|
|
*/
|
|
|
|
|
|
@SuppressWarnings({"unused", "deprecation"})
|
|
|
-public class TaskActivity extends BaseActivity implements OnClickListener, RecognizerDialogListener {
|
|
|
+public class TaskActivity extends BaseActivity implements OnClickListener,RecognizerDialogListener{
|
|
|
|
|
|
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 TaskActivity extends BaseActivity implements OnClickListener, Recog
|
|
|
@ViewInject(R.id.voice_search_iv)
|
|
|
private ImageView voice_search_iv;
|
|
|
private int mCurrentPage = 1;
|
|
|
- private int mPosition;
|
|
|
+ private int mPosition = -1;
|
|
|
private Handler handler = new Handler() {
|
|
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
|
|
public void handleMessage(Message msg) {
|
|
|
@@ -195,7 +195,7 @@ public class TaskActivity extends BaseActivity implements OnClickListener, Recog
|
|
|
|
|
|
private void doClassifyAllList(List<AllProcess> allList) {
|
|
|
if (mCurrentPage == 1) {
|
|
|
- allList.clear();
|
|
|
+ if (!ListUtils.isEmpty(real_List)) real_List.clear();
|
|
|
ToastMessage("刷新成功");
|
|
|
} else {
|
|
|
ToastMessage("加载完毕");
|
|
|
@@ -207,7 +207,7 @@ public class TaskActivity extends BaseActivity implements OnClickListener, Recog
|
|
|
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()))) {
|
|
|
+ "待确认".equals(allList.get(i).getStatus()))){
|
|
|
waitList.add(allList.get(i));
|
|
|
}
|
|
|
|
|
|
@@ -215,33 +215,33 @@ public class TaskActivity extends BaseActivity implements OnClickListener, Recog
|
|
|
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()))) {
|
|
|
+ "待确认".equals(allList.get(i).getStatus()))){
|
|
|
doneList.add(allList.get(i));
|
|
|
}
|
|
|
|
|
|
//我发起的
|
|
|
if ((login_Name.equals(allList.get(i).getRecorder()) &&
|
|
|
- "进行中".equals(allList.get(i).getStatus())) ||
|
|
|
+ "进行中".equals(allList.get(i).getStatus()) )||
|
|
|
(login_Name.equals(allList.get(i).getRecorder()) &&
|
|
|
- "已完成".equals(allList.get(i).getStatus()))) {
|
|
|
+ "已完成".equals(allList.get(i).getStatus()))){
|
|
|
isendList.add(allList.get(i));
|
|
|
}
|
|
|
- if (i == allList.size() - 1) {
|
|
|
- if (tab_type == 1) {
|
|
|
+ if (i == allList.size() -1){
|
|
|
+ if (tab_type == 1){
|
|
|
if (ListUtils.isEmpty(waitList)) {
|
|
|
mEmptyLayout.showEmpty();
|
|
|
return;
|
|
|
- } else {
|
|
|
+ }else {
|
|
|
adapter = new NewSchedultAdapter(TaskActivity.this, waitList);
|
|
|
real_List = waitList;
|
|
|
}
|
|
|
}
|
|
|
- if (tab_type == 2) {
|
|
|
+ if (tab_type == 2){
|
|
|
adapter = new NewSchedultAdapter(TaskActivity.this, doneList);
|
|
|
real_List = doneList;
|
|
|
}
|
|
|
|
|
|
- if (tab_type == 3) {
|
|
|
+ if (tab_type == 3){
|
|
|
adapter = new NewSchedultAdapter(TaskActivity.this, isendList);
|
|
|
real_List = isendList;
|
|
|
}
|
|
|
@@ -276,7 +276,7 @@ public class TaskActivity extends BaseActivity implements OnClickListener, Recog
|
|
|
new Thread(new getallprocess_run()).start();
|
|
|
// sendResquestForServer("START", 2);
|
|
|
initHeaderView();// 头布局显示
|
|
|
- sendResquestForServerAll(2, mCurrentPage); // update TODO :出息进来请求所有任务数据
|
|
|
+ sendResquestForServerAll(2,mCurrentPage); // update TODO :出息进来请求所有任务数据
|
|
|
initSearchEvent();
|
|
|
/**注释:监听 */
|
|
|
listview_main.setOnItemClickListener(new OnItemClickListener() {
|
|
|
@@ -365,8 +365,8 @@ public class TaskActivity extends BaseActivity implements OnClickListener, Recog
|
|
|
|
|
|
@Override
|
|
|
public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
|
|
|
- mCurrentPage++;
|
|
|
- sendResquestForServerAll(2, mCurrentPage);
|
|
|
+ mCurrentPage ++;
|
|
|
+ sendResquestForServerAll(2,mCurrentPage);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -374,23 +374,16 @@ public class TaskActivity extends BaseActivity implements OnClickListener, Recog
|
|
|
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 (ListUtils.isEmpty(real_List)) {mEmptyLayout.showEmpty(); return;}
|
|
|
|
|
|
- if (StringUtils.isEmpty(strChche)) {
|
|
|
+ if (StringUtils.isEmpty(strChche)){
|
|
|
adapter = new NewSchedultAdapter(TaskActivity.this, real_List);
|
|
|
listview_main.setAdapter(adapter);
|
|
|
if (adapter.getCount() != 0) {
|
|
|
@@ -401,7 +394,7 @@ public class TaskActivity extends BaseActivity implements OnClickListener, Recog
|
|
|
listview_main.onRefreshComplete();
|
|
|
}
|
|
|
strChche = strChche.replace(" ", " ");//去除空格
|
|
|
- List<AllProcess> chche = new ArrayList<>();
|
|
|
+ List<AllProcess> chche = new ArrayList<>();
|
|
|
if (StringUtils.isEmpty(strChche)) return;
|
|
|
|
|
|
for (int i = 0; i < real_List.size(); i++) {
|
|
|
@@ -409,10 +402,10 @@ public class TaskActivity extends BaseActivity implements OnClickListener, Recog
|
|
|
+ real_List.get(i).getStatus() + real_List.get(i).getTaskname()
|
|
|
+ real_List.get(i).getEndTime() + real_List.get(i).getDatetime(), strChche.trim());
|
|
|
|
|
|
- if (b) {
|
|
|
+ if (b){
|
|
|
chche.add(real_List.get(i));
|
|
|
}
|
|
|
- if (i == real_List.size() - 1) {
|
|
|
+ if (i == real_List.size() - 1){
|
|
|
adapter = new NewSchedultAdapter(TaskActivity.this, chche);
|
|
|
listview_main.setAdapter(adapter);
|
|
|
if (adapter.getCount() != 0) {
|
|
|
@@ -423,18 +416,16 @@ public class TaskActivity extends BaseActivity implements OnClickListener, Recog
|
|
|
listview_main.onRefreshComplete();
|
|
|
}
|
|
|
}
|
|
|
- Log.v("chche", JSON.toJSONString(chche));
|
|
|
+ Log.v("chche",JSON.toJSONString(chche));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
//正则
|
|
|
private static boolean getResult(String text, String str) {
|
|
|
Pattern p = Pattern.compile(str);
|
|
|
Matcher m = p.matcher(text);
|
|
|
return m.find();
|
|
|
}
|
|
|
-
|
|
|
private void initHeaderView() {
|
|
|
View view = LayoutInflater.from(ct).inflate(R.layout.task_header, null);
|
|
|
ActionBar bar = this.getSupportActionBar();
|
|
|
@@ -452,10 +443,9 @@ public class TaskActivity extends BaseActivity implements OnClickListener, Recog
|
|
|
voice_search_iv.setOnClickListener(this);
|
|
|
tab_type = 1;
|
|
|
}
|
|
|
-
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
- switch (v.getId()) {
|
|
|
+ switch (v.getId()){
|
|
|
case R.id.wait_tv:
|
|
|
tab_type = 1;
|
|
|
wait_tv.setSelected(true);
|
|
|
@@ -481,7 +471,7 @@ public class TaskActivity extends BaseActivity implements OnClickListener, Recog
|
|
|
real_List = isendList;
|
|
|
break;
|
|
|
case R.id.voice_search_iv:
|
|
|
- final VoiceToWord voice = new VoiceToWord(TaskActivity.this, "534e3fe2");
|
|
|
+ final VoiceToWord voice = new VoiceToWord(TaskActivity.this,"534e3fe2");
|
|
|
voice.setRecognizerDialogListener(this); //自己调用自己
|
|
|
voice.GetWordFromVoice();
|
|
|
break;
|
|
|
@@ -499,7 +489,6 @@ public class TaskActivity extends BaseActivity implements OnClickListener, Recog
|
|
|
}
|
|
|
listview_main.onRefreshComplete();
|
|
|
}
|
|
|
-
|
|
|
@Override
|
|
|
protected void onResume() {
|
|
|
super.onResume();
|
|
|
@@ -660,7 +649,7 @@ public class TaskActivity extends BaseActivity implements OnClickListener, Recog
|
|
|
String d = null;
|
|
|
String t = null;
|
|
|
if (password != null) {
|
|
|
- d = new Date().getTime() + "";
|
|
|
+ d = new Date().getTime() + "";
|
|
|
Blowfish blowfish = new Blowfish("00" + d);
|
|
|
t = blowfish.encryptString(password);
|
|
|
}
|
|
|
@@ -785,7 +774,7 @@ public class TaskActivity extends BaseActivity implements OnClickListener, Recog
|
|
|
state_finish.setSelected(false);
|
|
|
state_unconfirmed.setSelected(false);
|
|
|
state_all.setSelected(true);
|
|
|
- sendResquestForServerAll(2, mCurrentPage);
|
|
|
+ sendResquestForServerAll(2,mCurrentPage);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -819,7 +808,7 @@ public class TaskActivity extends BaseActivity implements OnClickListener, Recog
|
|
|
/**
|
|
|
* @注释: 带条件的调转
|
|
|
*/
|
|
|
- public void sendResquestForServerAll(int handlerWhat, int mCurrentPage) {
|
|
|
+ public void sendResquestForServerAll(int handlerWhat,int mCurrentPage) {
|
|
|
progressDialog.show();
|
|
|
String url = Constants.getAppBaseUrl(context) + "common/datalist/data.action";
|
|
|
Map<String, Object> mparams = new HashMap<String, Object>();
|
|
|
@@ -894,10 +883,21 @@ public class TaskActivity extends BaseActivity implements OnClickListener, Recog
|
|
|
|
|
|
@Override
|
|
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
|
- if (requestCode == 0x17 || (requestCode == 0x20 && resultCode == 0x20)) {
|
|
|
+ if (requestCode == 0x17) {
|
|
|
// refreshing();
|
|
|
- real_List.remove(mPosition);
|
|
|
- adapter.notifyDataSetChanged();
|
|
|
+ // 录入一张单据后刷新所有界面
|
|
|
+ if (!ListUtils.isEmpty(waitList)) waitList.clear();
|
|
|
+ if (!ListUtils.isEmpty(doneList)) doneList.clear();
|
|
|
+ if (!ListUtils.isEmpty(isendList)) isendList.clear();
|
|
|
+ mCurrentPage = 1;
|
|
|
+ sendResquestForServerAll(2, mCurrentPage);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (requestCode == 0x20 && resultCode == 0x20){
|
|
|
+ if (mPosition != -1 && !ListUtils.isEmpty(real_List)){
|
|
|
+ real_List.remove(mPosition);
|
|
|
+ adapter.notifyDataSetChanged();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|