|
|
@@ -72,6 +72,7 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
|
|
|
private static final int GRAB_JOB_CONTENT = 0x05;
|
|
|
private static final int GET_MULTINODE_ASSIGNS = 0x06;
|
|
|
private static final int SELECT_APPROVERS = 0x07;
|
|
|
+ private static final int WORK_REPORT_LIST = 0x08;
|
|
|
|
|
|
private TextView mReportTimeTv;
|
|
|
private RadioGroup mReportTimeRg;
|
|
|
@@ -113,7 +114,7 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
|
|
|
private int mReportType = Constants.WORK_REPORT_DAY;
|
|
|
private int mkeyValue;
|
|
|
private HttpClient mHttpClient;
|
|
|
- private boolean isModify = false, isOptionEvent = false;
|
|
|
+ private boolean isPresentModify = false, isBeforeModify = false, isOptionEvent = false, isUpdateModify = false;
|
|
|
|
|
|
private String mTodayDate, mYesterdayDate, mTodayWeek, mYesterdayWeek;
|
|
|
private String mThisWeekStartDate, mThisWeekEndDate, mLastWeekStartDate, mLastWeekEndDate, mThisWeekSerial, mLastWeekSerial;
|
|
|
@@ -121,7 +122,7 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
|
|
|
private String mTodayTime = "", mYesterdayTime = "", mThisWeekTime = "", mLastWeekTime = "", mThisMonthTime = "", mLastMonthTime = "";
|
|
|
private String mDailyReportDate = "", mDailyReportWeek = "", mWeekReportStartDate = "", mWeekReportEndDate = "", mMonthReportStartDate = "", mMonthReportEndDate = "", mWeekReportSerial = "", mMonthReportSerial = "";
|
|
|
|
|
|
- private String mUpdateDate = "", mUpdateWeekdays = "", mUpdateSerial = "", mUpdateStartTime = "", mUpdateEndTime = "";
|
|
|
+ private String mUpdateDate = "", mUpdateWeekdays = "", mUpdateSerial = "", mUpdateStartTime = "", mUpdateEndTime = "", mUpdateSummary = "", mUpdateSchedule = "", mUpdateExperience = "";
|
|
|
private boolean isOnlyUpdate = false, isPresentExist = false, isBeforeExist = false;
|
|
|
private WorkReportBean mInitPresentWorkReportBean, mInitBeforeWorkReportBean;
|
|
|
private String mPresentPlan = "", mBeforePlan = "";
|
|
|
@@ -189,7 +190,7 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
|
|
|
if (isOptionEvent) {
|
|
|
intent1.putExtra("fromwhere", "nosubmitdaily");
|
|
|
}
|
|
|
- startActivity(intent1);
|
|
|
+ startActivityForResult(intent1, WORK_REPORT_LIST);
|
|
|
}
|
|
|
if (!isOptionEvent) {
|
|
|
finish();
|
|
|
@@ -325,17 +326,21 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
|
|
|
} else if ("resubmit".equals(resubmit)) {
|
|
|
mSubmitButton.setText(getString(R.string.common_resubmit_button));
|
|
|
}
|
|
|
- if (!TextUtils.isEmpty(intent.getStringExtra("rs_summary"))) {
|
|
|
- mSummaryContentEt.setText(intent.getStringExtra("rs_summary"));
|
|
|
+ mUpdateSummary = intent.getStringExtra("rs_summary");
|
|
|
+ if (!TextUtils.isEmpty(mUpdateSummary)) {
|
|
|
+ mSummaryContentEt.setText(mUpdateSummary);
|
|
|
+ } else {
|
|
|
+ mSummaryContentEt.setText("");
|
|
|
}
|
|
|
-
|
|
|
- if (!TextUtils.isEmpty(intent.getStringExtra("rs_plan"))) {
|
|
|
- mNewScheduleContentEt.setText(intent.getStringExtra("rs_plan"));
|
|
|
+ mUpdateSchedule = intent.getStringExtra("rs_plan");
|
|
|
+ if (!TextUtils.isEmpty(mUpdateSchedule)) {
|
|
|
+ mNewScheduleContentEt.setText(mUpdateSchedule);
|
|
|
} else {
|
|
|
mNewScheduleContentEt.setText("");
|
|
|
}
|
|
|
- if (!TextUtils.isEmpty(intent.getStringExtra("rs_experience"))) {
|
|
|
- mExperienceContentEt.setText(intent.getStringExtra("rs_experience"));
|
|
|
+ mUpdateExperience = intent.getStringExtra("rs_experience");
|
|
|
+ if (!TextUtils.isEmpty(mUpdateExperience)) {
|
|
|
+ mExperienceContentEt.setText(mUpdateExperience);
|
|
|
} else {
|
|
|
mExperienceContentEt.setText("");
|
|
|
}
|
|
|
@@ -425,8 +430,27 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
|
|
|
|
|
|
@Override
|
|
|
public void afterTextChanged(Editable s) {
|
|
|
- isModify = true;
|
|
|
mSummaryText = mSummaryContentEt.getText().toString();
|
|
|
+ if (isPresentExist && mReportTimePresentRb.isChecked()
|
|
|
+ && !mSummaryText.equals(mInitPresentWorkReportBean.getComment())) {
|
|
|
+ isPresentModify = true;
|
|
|
+ } else {
|
|
|
+ isPresentModify = false;
|
|
|
+ }
|
|
|
+ if (isBeforeExist && mReportTimeBeforeRb.isChecked()
|
|
|
+ && !mSummaryText.equals(mInitBeforeWorkReportBean.getComment())) {
|
|
|
+ isBeforeModify = true;
|
|
|
+ } else {
|
|
|
+ isBeforeModify = false;
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(resubmit)) {
|
|
|
+ if (!mSummaryText.equals(mUpdateSummary)) {
|
|
|
+ isUpdateModify = true;
|
|
|
+ } else {
|
|
|
+ isUpdateModify = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -446,8 +470,26 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
|
|
|
|
|
|
@Override
|
|
|
public void afterTextChanged(Editable s) {
|
|
|
- isModify = true;
|
|
|
mNewScheduleText = mNewScheduleContentEt.getText().toString();
|
|
|
+ if (isPresentExist && mReportTimePresentRb.isChecked()
|
|
|
+ && !mNewScheduleText.equals(mInitPresentWorkReportBean.getPlan())) {
|
|
|
+ isPresentModify = true;
|
|
|
+ } else {
|
|
|
+ isPresentModify = false;
|
|
|
+ }
|
|
|
+ if (isBeforeExist && mReportTimeBeforeRb.isChecked()
|
|
|
+ && !mNewScheduleText.equals(mInitBeforeWorkReportBean.getPlan())) {
|
|
|
+ isBeforeModify = true;
|
|
|
+ } else {
|
|
|
+ isBeforeModify = false;
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(resubmit)) {
|
|
|
+ if (!mNewScheduleText.equals(mUpdateSchedule)) {
|
|
|
+ isUpdateModify = true;
|
|
|
+ } else {
|
|
|
+ isUpdateModify = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -467,8 +509,26 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
|
|
|
|
|
|
@Override
|
|
|
public void afterTextChanged(Editable s) {
|
|
|
- isModify = true;
|
|
|
mExperienceText = mExperienceContentEt.getText().toString();
|
|
|
+ if (isPresentExist && mReportTimePresentRb.isChecked()
|
|
|
+ && !mExperienceText.equals(mInitPresentWorkReportBean.getExperience())) {
|
|
|
+ isPresentModify = true;
|
|
|
+ } else {
|
|
|
+ isPresentModify = false;
|
|
|
+ }
|
|
|
+ if (isBeforeExist && mReportTimeBeforeRb.isChecked()
|
|
|
+ && !mExperienceText.equals(mInitBeforeWorkReportBean.getExperience())) {
|
|
|
+ isBeforeModify = true;
|
|
|
+ } else {
|
|
|
+ isBeforeModify = false;
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(resubmit)) {
|
|
|
+ if (!mExperienceText.equals(mUpdateExperience)) {
|
|
|
+ isUpdateModify = true;
|
|
|
+ } else {
|
|
|
+ isUpdateModify = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -1323,128 +1383,135 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
|
|
|
final Intent intent = getIntent();
|
|
|
fromqzone = intent.getStringExtra("fromqzone");
|
|
|
final boolean isResubmit = !TextUtils.isEmpty(resubmit) && ("unsub_tosub".equals(resubmit) || "resubmit".equals(resubmit));
|
|
|
- if (isResubmit || (mReportTimePresentRb.isChecked() && isPresentExist)
|
|
|
- || (mReportTimeBeforeRb.isChecked() && isBeforeExist)) {
|
|
|
- if (isModify) {
|
|
|
- new AlertDialog
|
|
|
- .Builder(mContext)
|
|
|
- .setTitle(getString(R.string.common_notice))
|
|
|
- .setMessage("正在离开录入页面,是否更新汇报内容?")
|
|
|
- .setNegativeButton(R.string.give_up, new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- if (isResubmit || isOptionEvent) {
|
|
|
- Intent intent1 = new Intent(WorkReportAddActivity.this, WorkDailyShowActivity.class);
|
|
|
- intent1.putExtra("caller", mCaller);
|
|
|
- intent1.putExtra("report_type", mReportType);
|
|
|
- if (isOptionEvent) {
|
|
|
- intent1.putExtra("fromwhere", "nosubmitdaily");
|
|
|
- }
|
|
|
- startActivity(intent1);
|
|
|
+ if ((isResubmit && isUpdateModify) || (mReportTimePresentRb.isChecked() && isPresentExist && isPresentModify)
|
|
|
+ || (mReportTimeBeforeRb.isChecked() && isBeforeExist && isBeforeModify)) {
|
|
|
+ new AlertDialog
|
|
|
+ .Builder(mContext)
|
|
|
+ .setTitle(getString(R.string.common_notice))
|
|
|
+ .setMessage("正在离开录入页面,是否更新汇报内容?")
|
|
|
+ .setNegativeButton(R.string.give_up, new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
+ if (isResubmit || isOptionEvent) {
|
|
|
+ Intent intent1 = new Intent(WorkReportAddActivity.this, WorkDailyShowActivity.class);
|
|
|
+ intent1.putExtra("caller", mCaller);
|
|
|
+ intent1.putExtra("report_type", mReportType);
|
|
|
+ if (isOptionEvent) {
|
|
|
+ intent1.putExtra("fromwhere", "nosubmitdaily");
|
|
|
}
|
|
|
- if (!isOptionEvent) {
|
|
|
- finish();
|
|
|
+ startActivityForResult(intent1, WORK_REPORT_LIST);
|
|
|
+ }
|
|
|
+ if (!isOptionEvent) {
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .setPositiveButton(R.string.updata, new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
+ if (mSummaryContentEt.testValidity()) {
|
|
|
+ if (mNewScheduleContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER &&
|
|
|
+ mExperienceContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER) {
|
|
|
+ if (CommonUtil.isNetWorkConnected(WorkReportAddActivity.this)) {
|
|
|
+ isOnlyUpdate = true;
|
|
|
+ progressDialog.show();
|
|
|
+ updateWorkReport();
|
|
|
+ } else {
|
|
|
+ ToastUtil.showToast(WorkReportAddActivity.this, R.string.networks_out);
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ ToastUtil.showToast(WorkReportAddActivity.this, "字数已超限!");
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
- .setPositiveButton(R.string.updata, new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- if (mSummaryContentEt.testValidity()) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }).create().show();
|
|
|
+ } else {
|
|
|
+ if (((mReportTimePresentRb.isChecked() && !isPresentExist)
|
|
|
+ || (mReportTimeBeforeRb.isChecked() && !isBeforeExist)) && !isResubmit) {
|
|
|
+ if (mSummaryText.length() > 0 ||
|
|
|
+ mNewScheduleText.length() > 0 ||
|
|
|
+ mExperienceText.length() > 0) {
|
|
|
+ new AlertDialog
|
|
|
+ .Builder(mContext)
|
|
|
+ .setTitle(getString(R.string.common_notice))
|
|
|
+ .setMessage(getString(R.string.work_report_exit_notice))
|
|
|
+ .setNegativeButton(R.string.give_up, new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
+ boolean isResubmit = !TextUtils.isEmpty(resubmit) && ("unsub_tosub".equals(resubmit) || "resubmit".equals(resubmit));
|
|
|
+ if (isResubmit || isOptionEvent) {
|
|
|
+ Intent optionIntent = new Intent(WorkReportAddActivity.this, WorkDailyShowActivity.class);
|
|
|
+ optionIntent.putExtra("caller", mCaller);
|
|
|
+ optionIntent.putExtra("report_type", mReportType);
|
|
|
+ if (isOptionEvent) {
|
|
|
+ optionIntent.putExtra("fromwhere", "nosubmitdaily");
|
|
|
+ }
|
|
|
+ startActivityForResult(optionIntent, WORK_REPORT_LIST);
|
|
|
+ } else if (!TextUtils.isEmpty(fromqzone) && "fromqzone".equals(fromqzone)) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ Intent intent1 = new Intent(WorkReportAddActivity.this, WorkReportMenuActivity.class);
|
|
|
+ startActivity(intent1);
|
|
|
+ }
|
|
|
+ if (!isOptionEvent) {
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .setPositiveButton(R.string.save, new DialogInterface.OnClickListener() {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
if (mNewScheduleContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER &&
|
|
|
mExperienceContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER) {
|
|
|
if (CommonUtil.isNetWorkConnected(WorkReportAddActivity.this)) {
|
|
|
- isOnlyUpdate = true;
|
|
|
progressDialog.show();
|
|
|
- updateWorkReport();
|
|
|
+ saveWorkReport();
|
|
|
} else {
|
|
|
ToastUtil.showToast(WorkReportAddActivity.this, R.string.networks_out);
|
|
|
}
|
|
|
-
|
|
|
} else {
|
|
|
ToastUtil.showToast(WorkReportAddActivity.this, "字数已超限!");
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }).create().show();
|
|
|
- } else {
|
|
|
-
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (mSummaryText.length() > 0 ||
|
|
|
- mNewScheduleText.length() > 0 ||
|
|
|
- mExperienceText.length() > 0) {
|
|
|
- new AlertDialog
|
|
|
- .Builder(mContext)
|
|
|
- .setTitle(getString(R.string.common_notice))
|
|
|
- .setMessage(getString(R.string.work_report_exit_notice))
|
|
|
- .setNegativeButton(R.string.give_up, new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- boolean isResubmit = !TextUtils.isEmpty(resubmit) && ("unsub_tosub".equals(resubmit) || "resubmit".equals(resubmit));
|
|
|
- if (isResubmit || isOptionEvent) {
|
|
|
- Intent optionIntent = new Intent(WorkReportAddActivity.this, WorkDailyShowActivity.class);
|
|
|
- optionIntent.putExtra("caller", mCaller);
|
|
|
- optionIntent.putExtra("report_type", mReportType);
|
|
|
- if (isOptionEvent) {
|
|
|
- optionIntent.putExtra("fromwhere", "nosubmitdaily");
|
|
|
- }
|
|
|
- startActivity(optionIntent);
|
|
|
-
|
|
|
- } else if (!TextUtils.isEmpty(fromqzone) && "fromqzone".equals(fromqzone)) {
|
|
|
|
|
|
- } else {
|
|
|
- Intent intent1 = new Intent(WorkReportAddActivity.this, WorkReportMenuActivity.class);
|
|
|
- startActivity(intent1);
|
|
|
- }
|
|
|
- if (!isOptionEvent) {
|
|
|
- finish();
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
- .setPositiveButton(R.string.save, new DialogInterface.OnClickListener() {
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- if (mNewScheduleContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER &&
|
|
|
- mExperienceContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER) {
|
|
|
- if (CommonUtil.isNetWorkConnected(WorkReportAddActivity.this)) {
|
|
|
- progressDialog.show();
|
|
|
- saveWorkReport();
|
|
|
- } else {
|
|
|
- ToastUtil.showToast(WorkReportAddActivity.this, R.string.networks_out);
|
|
|
- }
|
|
|
- } else {
|
|
|
- ToastUtil.showToast(WorkReportAddActivity.this, "字数已超限!");
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }).show();
|
|
|
+ }).show();
|
|
|
+ } else if (!TextUtils.isEmpty(fromqzone) && "fromqzone".equals(fromqzone)) {
|
|
|
+ finish();
|
|
|
+ } else {
|
|
|
+ leaveIntent(isResubmit);
|
|
|
+ }
|
|
|
} else if (!TextUtils.isEmpty(fromqzone) && "fromqzone".equals(fromqzone)) {
|
|
|
finish();
|
|
|
} else {
|
|
|
- Intent intent1 = null;
|
|
|
- if (isResubmit || isOptionEvent) {
|
|
|
- intent1 = new Intent(WorkReportAddActivity.this, WorkDailyShowActivity.class);
|
|
|
- intent1.putExtra("caller", mCaller);
|
|
|
- intent1.putExtra("report_type", mReportType);
|
|
|
- if (isOptionEvent) {
|
|
|
- intent1.putExtra("fromwhere", "nosubmitdaily");
|
|
|
- }
|
|
|
- startActivity(intent1);
|
|
|
- } else {
|
|
|
- intent1 = new Intent(WorkReportAddActivity.this, WorkReportMenuActivity.class);
|
|
|
- startActivity(intent1);
|
|
|
- }
|
|
|
- if (!isOptionEvent) {
|
|
|
- finish();
|
|
|
- }
|
|
|
+ leaveIntent(isResubmit);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private void leaveIntent(boolean isResubmit) {
|
|
|
+ Intent intent1 = null;
|
|
|
+ if (isResubmit || isOptionEvent) {
|
|
|
+ intent1 = new Intent(WorkReportAddActivity.this, WorkDailyShowActivity.class);
|
|
|
+ intent1.putExtra("caller", mCaller);
|
|
|
+ intent1.putExtra("report_type", mReportType);
|
|
|
+ if (isOptionEvent) {
|
|
|
+ intent1.putExtra("fromwhere", "nosubmitdaily");
|
|
|
+ }
|
|
|
+ startActivityForResult(intent1, WORK_REPORT_LIST);
|
|
|
+ } else {
|
|
|
+ intent1 = new Intent(WorkReportAddActivity.this, WorkReportMenuActivity.class);
|
|
|
+ startActivity(intent1);
|
|
|
+ }
|
|
|
+ if (!isOptionEvent) {
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void saveWorkReport() {
|
|
|
String saveUrl = "oa/persontask/saveWorkDaily.action";
|
|
|
if (mReportType == Constants.WORK_REPORT_DAY) {
|
|
|
@@ -1476,7 +1543,7 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
|
|
|
if (isOptionEvent) {
|
|
|
optionIntent.putExtra("fromwhere", "nosubmitdaily");
|
|
|
}
|
|
|
- startActivity(optionIntent);
|
|
|
+ startActivityForResult(optionIntent, WORK_REPORT_LIST);
|
|
|
|
|
|
} else if (!TextUtils.isEmpty(fromqzone) && "fromqzone".equals(fromqzone)) {
|
|
|
|
|
|
@@ -1526,6 +1593,22 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
|
|
|
} else {
|
|
|
jumptododetail(mkeyValue);
|
|
|
}
|
|
|
+ } else if (requestCode == WORK_REPORT_LIST) {
|
|
|
+ mDateLinearLayout.setVisibility(View.GONE);
|
|
|
+ mReportTimeRg.setVisibility(View.VISIBLE);
|
|
|
+ mOldScheduleLl.setVisibility(View.VISIBLE);
|
|
|
+ mSummaryContentEt.setText("");
|
|
|
+ mNewScheduleContentEt.setText("");
|
|
|
+ mExperienceContentEt.setText("");
|
|
|
+ isPresentExist = false;
|
|
|
+ isBeforeExist = false;
|
|
|
+ mInitPresentWorkReportBean = new WorkReportBean();
|
|
|
+ mInitBeforeWorkReportBean = new WorkReportBean();
|
|
|
+ if (CommonUtil.isNetWorkConnected(this)) {
|
|
|
+ getWorkReportInit();
|
|
|
+ } else {
|
|
|
+ ToastUtil.showToast(this, R.string.networks_out);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1536,7 +1619,9 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
|
|
|
}
|
|
|
|
|
|
private void getEmnameByReturn(String text) {
|
|
|
- if (StringUtil.isEmpty(text)) return;
|
|
|
+ if (StringUtil.isEmpty(text)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
Pattern pattern = Pattern.compile("(?<=\\()(.+?)(?=\\))");
|
|
|
Matcher matcher = pattern.matcher(text);
|
|
|
if (matcher.find()) {
|