|
|
@@ -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> showOtherBeans = null;
|
|
|
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;
|
|
|
}
|
|
|
}
|
|
|
@@ -240,7 +240,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() + ",";
|
|
|
+ Log.i("gongpengming", name);
|
|
|
if (name == null) return;
|
|
|
String nameStr;
|
|
|
for (OABean e : otherBeans) {
|
|
|
@@ -253,12 +254,15 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
|
|
|
} else if (e.getRecordman() != null) {//拜访
|
|
|
if (e.getRecordman() == null || e.getRecordman().length() <= 0) continue;
|
|
|
nameStr = "," + e.getRecordman().trim() + ",";
|
|
|
+ Log.i("gongpengming", nameStr);
|
|
|
if (getResult(nameStr, name)) {//是该下属任务日程
|
|
|
+ Log.i("gongpengming", "是的");
|
|
|
chche.add(e);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
setTaskDay(chche);
|
|
|
+ showOtherBeans = chche;
|
|
|
adapter.setBeans(chche);
|
|
|
}
|
|
|
if (requestCode == 0x20 && 0x20 == resultCode) {
|
|
|
@@ -378,12 +382,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,16 +467,13 @@ 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)) {
|
|
|
+ try {
|
|
|
List<OABean> b;
|
|
|
if (tag == 1) {
|
|
|
b = meBeans == null ? new ArrayList<OABean>() : meBeans;
|
|
|
} else {
|
|
|
- b = otherBeans == null ? new ArrayList<OABean>() : otherBeans;
|
|
|
+ b = showOtherBeans == null ? (otherBeans == null ? new ArrayList<OABean>() : otherBeans) : showOtherBeans;
|
|
|
}
|
|
|
for (OABean e : b) {
|
|
|
if (e.getStartdate() == null) continue;
|
|
|
@@ -472,28 +481,17 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
|
|
|
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();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- 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)) {
|
|
|
@@ -519,7 +517,8 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
|
|
|
*/
|
|
|
private void chaneTAG(boolean isMy) {
|
|
|
if (isMy) {
|
|
|
- if (!my_client_log.getText().toString().trim().equals("下属工作日志")) {
|
|
|
+ showOtherBeans = null;
|
|
|
+ if (!my_client_log.getText().toString().trim().equals("下属工作日历")) {
|
|
|
my_client_log.setText("下属工作日历");
|
|
|
}
|
|
|
tag = 1;
|
|
|
@@ -540,7 +539,6 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
|
|
|
setTaskDay(otherBeans);
|
|
|
}
|
|
|
}
|
|
|
- setTop();
|
|
|
}
|
|
|
|
|
|
//列表适配器
|
|
|
@@ -560,6 +558,7 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
|
|
|
if (beans == null) return null;
|
|
|
if (getIntent() == null || getIntent().getIntExtra("type", 0) != 1) {
|
|
|
chche = beans;
|
|
|
+
|
|
|
} else {//crm
|
|
|
//只显示拜访
|
|
|
for (OABean e : beans)
|