|
|
@@ -88,6 +88,7 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
|
|
|
private int tag = 1;
|
|
|
private ArrayList<OABean> meBeans = null;
|
|
|
private ArrayList<OABean> otherBeans = null;
|
|
|
+ private List<OABean> showBeans = new ArrayList<>();
|
|
|
private MyListViewAdapter adapter;
|
|
|
private EmptyLayout mEmptyLayout;
|
|
|
|
|
|
@@ -102,7 +103,6 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
|
|
|
if (jsonObject.isEmpty())
|
|
|
return;
|
|
|
loadSuccess(jsonObject);
|
|
|
- setTop();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -139,7 +139,7 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
|
|
|
String time = b.getStartdate() == null ? b.getEnddate() : b.getStartdate();
|
|
|
if (time == null) continue;
|
|
|
c.setTimeInMillis(TimeUtils.f_str_2_long(time));
|
|
|
- if (c.get(Calendar.DAY_OF_MONTH) == CalendarUtils.getCurrentDate()) {//当前天的任务
|
|
|
+ if (c.get(Calendar.DAY_OF_MONTH) == CalendarUtils.getCurrentDate()) {//当前 天的任务
|
|
|
chche.add(b);
|
|
|
}
|
|
|
}
|
|
|
@@ -149,13 +149,16 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
|
|
|
} else {
|
|
|
adapter.setBeans(chche);
|
|
|
}
|
|
|
- setTaskDay(tag == 1 ? meBeans : otherBeans);
|
|
|
}
|
|
|
|
|
|
- private void setTaskDay(List<OABean> beans) {
|
|
|
+ private void setTaskDay() {
|
|
|
+ if (ListUtils.isEmpty(showBeans)) {
|
|
|
+ picker.setTaskDay(new int[]{0});
|
|
|
+ return;
|
|
|
+ }
|
|
|
Calendar c = Calendar.getInstance();
|
|
|
ArrayList<Integer> tasks = new ArrayList<>();
|
|
|
- for (OABean b : beans) {
|
|
|
+ for (OABean b : showBeans) {
|
|
|
String time = b.getStartdate() == null ? b.getEnddate() : b.getStartdate();
|
|
|
if (time == null) continue;
|
|
|
if (getIntent() == null || getIntent().getIntExtra("type", 0) != 1) {//非crm
|
|
|
@@ -240,7 +243,8 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
|
|
|
return;
|
|
|
}
|
|
|
List<OABean> chche = new ArrayList<>();
|
|
|
- String name = entity.getName().trim();
|
|
|
+ String name = "," + entity.getName().trim() + ",";
|
|
|
+
|
|
|
if (name == null) return;
|
|
|
String nameStr;
|
|
|
for (OABean e : otherBeans) {
|
|
|
@@ -258,7 +262,6 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- setTaskDay(chche);
|
|
|
adapter.setBeans(chche);
|
|
|
}
|
|
|
if (requestCode == 0x20 && 0x20 == resultCode) {
|
|
|
@@ -378,12 +381,20 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
|
|
|
Intent intent = null;
|
|
|
switch (position) {
|
|
|
case 0:
|
|
|
- intent = new Intent(ct, TaskAddActivity.class);
|
|
|
- intent.putExtra("type", 0);
|
|
|
+ if (!(getIntent() == null || getIntent().getIntExtra("type", 0) != 1)) {
|
|
|
+ intent = new Intent(ct, VisitReportPlanActivity.class);
|
|
|
+ } else {
|
|
|
+ intent = new Intent(ct, TaskAddActivity.class);
|
|
|
+ intent.putExtra("type", 0);
|
|
|
+ }
|
|
|
break;
|
|
|
case 1:
|
|
|
- intent = new Intent(ct, TaskAddActivity.class);
|
|
|
- intent.putExtra("type", 1);
|
|
|
+ if (!(getIntent() == null || getIntent().getIntExtra("type", 0) != 1)) {
|
|
|
+ intent = new Intent(ct, VisitReportAddActivity.class);
|
|
|
+ } else {
|
|
|
+ intent = new Intent(ct, TaskAddActivity.class);
|
|
|
+ intent.putExtra("type", 1);
|
|
|
+ }
|
|
|
break;
|
|
|
case 2:
|
|
|
intent = new Intent(ct, VisitReportPlanActivity.class);
|
|
|
@@ -455,45 +466,21 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
|
|
|
String chche = TimeUtils.long2str(System.currentTimeMillis(), "yyyy-MM") + "-" + (downDate < 10 ? "0" : "") + downDate;
|
|
|
date_tv.setText(chche + " " + TimeUtils.getWeek(chche));
|
|
|
Calendar c = Calendar.getInstance();
|
|
|
- int ok = 0;
|
|
|
- int noOk = 0;
|
|
|
List<OABean> beans = new ArrayList<>();
|
|
|
- try {// meBeans : otherBeans 可能为空
|
|
|
-// for (OABean e : (tag == 1 ? meBeans : otherBeans)) {
|
|
|
- List<OABean> b;
|
|
|
- if (tag == 1) {
|
|
|
- b = meBeans == null ? new ArrayList<OABean>() : meBeans;
|
|
|
- } else {
|
|
|
- b = otherBeans == null ? new ArrayList<OABean>() : otherBeans;
|
|
|
+ if (ListUtils.isEmpty(showBeans)) return;
|
|
|
+ for (OABean e : showBeans) {
|
|
|
+ if (e.getStartdate() == null) continue;
|
|
|
+ c.setTimeInMillis(TimeUtils.f_str_2_long(e.getStartdate()));
|
|
|
+ int day = c.get(Calendar.DAY_OF_MONTH);
|
|
|
+ if (day == downDate) {//选择那天的任务
|
|
|
+ beans.add(e);
|
|
|
}
|
|
|
- for (OABean e : b) {
|
|
|
- if (e.getStartdate() == null) continue;
|
|
|
- c.setTimeInMillis(TimeUtils.f_str_2_long(e.getStartdate()));
|
|
|
- int day = c.get(Calendar.DAY_OF_MONTH);
|
|
|
- if (day == downDate) {//选择那天的任务
|
|
|
- beans.add(e);
|
|
|
- if ("已完成".equals(e.getStatus()) || "已拜访".equals(e.getStatus())) {
|
|
|
- ok += 1;
|
|
|
- } else {
|
|
|
- noOk += 1;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- } catch (NullPointerException e) {
|
|
|
- e.printStackTrace();
|
|
|
- } finally {
|
|
|
- adapter.setBeans(beans);
|
|
|
- setTop();
|
|
|
}
|
|
|
+ adapter.setBeans(beans);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- private void setTop() {
|
|
|
-// rootScrollView.smoothScrollTo(0, 20);
|
|
|
-// rootScrollView.scrollTo(0, 0);
|
|
|
- }
|
|
|
-
|
|
|
private void setPoithNum(List<OABean> beans) {
|
|
|
int ok = 0, noOk = 0;
|
|
|
if (!ListUtils.isEmpty(beans)) {
|
|
|
@@ -528,7 +515,6 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
|
|
|
my_client_log_tag.setBackgroundDrawable(null);
|
|
|
if (adapter != null && meBeans != null) {
|
|
|
adapter.setBeans(meBeans);
|
|
|
- setTaskDay(meBeans);
|
|
|
}
|
|
|
} else {
|
|
|
tag = 2;
|
|
|
@@ -537,16 +523,13 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
|
|
|
my_log_tag.setBackgroundDrawable(null);
|
|
|
if (adapter != null && otherBeans != null) {
|
|
|
adapter.setBeans(otherBeans);
|
|
|
- setTaskDay(otherBeans);
|
|
|
}
|
|
|
}
|
|
|
- setTop();
|
|
|
}
|
|
|
|
|
|
//列表适配器
|
|
|
class MyListViewAdapter extends BaseAdapter {
|
|
|
private List<OABean> beans;//适配器使用
|
|
|
-
|
|
|
public MyListViewAdapter() {
|
|
|
}
|
|
|
|
|
|
@@ -568,6 +551,8 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
|
|
|
}
|
|
|
}
|
|
|
setPoithNum(chche);
|
|
|
+ showBeans = chche;
|
|
|
+ setTaskDay();
|
|
|
return chche;
|
|
|
}
|
|
|
|