Commit 93ba0dfc by Jeong Gilmo

#32861_作業情報追加(Android)

parent d7d33ed0
......@@ -42,6 +42,10 @@ public class ABookKeys {
public static final String CMD_SHOW_RELATED_CONTENT = "showRelatedContent";
public static final String CMD_PAGE_NUM = "pageNum";
// #32861 作業情報追加 start
public static final String CMD_LOCAL_SAVE_TASK_REPORT = "localSaveTaskReport"; // 一時保存
// #32861 作業情報追加 end
public static final String GPS_TYPE = "gpsType";
public static final String STATUS_CODE = "statusCode";
public static final String TASK_KEY = "taskKey";
......@@ -116,4 +120,9 @@ public class ABookKeys {
public static final String URI = "uri";
public static final String OK = "OK";
// #32861 作業情報追加 start
public static final String REPORT_DRAFT = "reportDraft"; // 一時保存情報
public static final String ADD_REPORT = "addReport"; // 作業追加区分
// #32861 作業情報追加 end
}
......@@ -350,6 +350,13 @@
<string name="content_share_text3">\n上記のURLからダウンロードして下さい。\n</string>
<string name="content_share_password_hint">半角英数字16文字以下</string>
<!-- #32861 作業情報追加 start -->
<string name="temp_save">一時保存</string>
<string name="temp_save_info">一時保存しますか?</string>
<string name="save_info">保存してサーバへ送信しますか?</string>
<string name="msg_temp_save_result">保存されました。</string>
<!-- #32861 作業情報追加 end -->
<!-- Error Message -->
<string name="E000">事業者IDを入力してください。</string>
<string name="E001">ログインIDを入力してください。</string>
......
......@@ -350,6 +350,13 @@
<string name="content_share_text3">\n상기URL에서 다운로드해 주십시오.\n</string>
<string name="content_share_password_hint">영숫자16자 이하</string>
<!-- #32861 作業情報追加 start -->
<string name="temp_save">임시저장</string>
<string name="temp_save_info">임시저장 하시겠습니까?</string>
<string name="save_info">저장하시고 서버로 송신하시겠습니까?</string>
<string name="msg_temp_save_result">저장되었습니다.</string>
<!-- #32861 作業情報追加 end -->
<!-- Error Message -->
<string name="E000">어카운트패스 입력해 주십시오.</string>
<string name="E001">로그인ID를 입력해 주십시오.</string>
......
......@@ -350,6 +350,13 @@
<string name="content_share_text3">\nDownload a content from the URL above.\n</string>
<string name="content_share_password_hint">Alpha digit with one byte not exceed 16 characters</string>
<!-- #32861 作業情報追加 start -->
<string name="temp_save">Temporarily saved</string>
<string name="temp_save_info">Do you want to temporarily save it?</string>
<string name="save_info">Save it and send it to the server?</string>
<string name="msg_temp_save_result">It has been saved.</string>
<!-- #32861 作業情報追加 end -->
<!-- Error Message -->
<string name="E000">Please enter company ID.</string>
<string name="E001">Please enter your login ID.</string>
......
......@@ -11,6 +11,35 @@
style="@style/OperationSearchToolBar"
android:minHeight="50dp">
<!-- #32861 作業情報追加 start -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true">
<Button
android:id="@+id/btn_close"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:background="@drawable/ic_operation_close" />
<Button
android:id="@+id/btn_operation_home"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:background="@drawable/ic_operation_home" />
</LinearLayout>
<!-- #32861 作業情報追加 end -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -35,14 +64,25 @@
android:layout_alignParentRight="true"
android:layout_centerVertical="true">
<!-- #32861 作業情報追加 start -->
<Button
android:id="@+id/btn_close"
android:id="@+id/btn_temp_save"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:background="@drawable/ic_operation_close" />
android:background="@drawable/ic_download_off" />
<Button
android:id="@+id/btn_save"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:background="@drawable/ic_download_on" />
<!-- #32861 作業情報追加 end -->
</LinearLayout>
</RelativeLayout>
<FrameLayout
......
......@@ -72,6 +72,7 @@ import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow;
import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.viewer.activity.CheckOZDViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.HTMLXWalkWebViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.NoPdfViewActivity;
import jp.agentec.abook.abv.ui.viewer.foxitPdf.FoxitPdfCore;
......@@ -130,6 +131,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public boolean isLinkedContent;
public int pageNo;
// #32861 作業情報追加 start
public int mButtonStatus; // 保存ボタンチェック
protected boolean mLocalSaveTaskReport; // 一時保存情報
protected boolean mInsertTaskReport; // 作業追加区分
// #32861 作業情報追加 end
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
......@@ -427,7 +434,23 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public void finish() {
// ホームをリロードさせる
ActivityHandlingHelper.getInstance().setRequireHomeReload(true);
super.finish();
// #32861 作業情報追加 start
if (this instanceof CheckOZDViewActivity) {
if (mButtonStatus == R.id.btn_close) {
ozdCancelProcess(); // 閉じる
super.finish();
} else if (mButtonStatus == R.id.btn_temp_save) {
ozdLocalSaveProcess(); // 一時保存
} else if (mButtonStatus == R.id.btn_save){
ozdSaveProcess(); // 保存
super.finish();
} else {
super.finish(); // 作業一覧画面に遷移
}
} else {
super.finish();
}
// #32861 作業情報追加 end
Logger.d(TAG, "finish");
}
......@@ -936,7 +959,15 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, false, taskReportId, reportStartDate, mReportFileName);
} else if (mCmd.equals(ABookKeys.CMD_PREVIEW_REPORT_OZD)) {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, taskReportId, reportStartDate, mReportFileName);
// #32861 作業情報追加 start
if (abookCheckParam.containsKey(ABookKeys.REPORT_DRAFT)) {
mLocalSaveTaskReport = Integer.parseInt(abookCheckParam.get(ABookKeys.REPORT_DRAFT)) > 0 ? true : false;
}
if (abookCheckParam.containsKey(ABookKeys.ADD_REPORT)) {
mInsertTaskReport = Integer.parseInt(abookCheckParam.get(ABookKeys.ADD_REPORT)) > 0 ? true : false;
}
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, false, taskReportId, reportStartDate, mReportFileName, mLocalSaveTaskReport, mInsertTaskReport);
// #32861 作業情報追加 end
} else if (mCmd.equals(ABookKeys.CMD_CONTENT_EDIT_CLOSE)) {
showProgressPopup();
handler.postDelayed(new Runnable() {
......@@ -1058,7 +1089,15 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
Logger.i(TAG, String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')", finalParent, cmd, taskKey, result, message));
webViewLoadUrl(String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')", finalParent, cmd, taskKey, result, message));
}
}
// #32861 作業情報追加 start
// 作業追加区分ありの場合
if (mInsertTaskReport) {
webViewLoadUrl("javascript:CHK.cancelOzReport()");
} else {
ActivityHandlingHelper.getInstance().finishAllContentViewActivity();
}
// #32861 作業情報追加 end
}
});
}
......@@ -1156,4 +1195,42 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
return new FoxitPdfCore(this, filepath);
}
// #32861 作業情報追加 start
// 保存処理
public void ozdSaveProcess() {
runOnUiThread(new Runnable() {
@Override
public void run () {
// 実行Javascript - 閉じる
webViewLoadUrl("javascript:CHK.saeOzReport()");
Logger.d(TAG, "ozdSaveProcess");
}
});
}
// 一時保存処理
public void ozdLocalSaveProcess() {
runOnUiThread(new Runnable() {
@Override
public void run () {
// 実行Javascript - 閉じる
webViewLoadUrl("javascript:CHK.localSaveOzReport()");
Logger.d(TAG, "ozdLocalSaveProcess");
}
});
}
// 閉じる処理
public void ozdCancelProcess() {
runOnUiThread(new Runnable() {
@Override
public void run () {
// 実行Javascript - 閉じる
webViewLoadUrl("javascript:CHK.cancelOzReport()");
Logger.d(TAG, "ozdCancelProcess");
}
});
}
// #32861 作業情報追加 end
}
......@@ -191,6 +191,13 @@ public class ABookCheckWebViewHelper extends ABookHelper {
insertOrUpdateTaskReport(taskKey, reportUpdateType, operationId, contentId, param, contentPath, false, routineTaskReportFlg);
sendTaskReportData(context, operationId, taskKey, reportUpdateType);
break;
// #32861 作業情報追加 start
// 一時保存処理
case ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, reportUpdateType, operationId, contentId, param, contentPath, false, routineTaskReportFlg);
context.handleErrorMessageToast(R.string.msg_temp_save_result);
break;
// #32861 作業情報追加 end
case ABookKeys.CMD_DELETE_TASK_REPORT:
int taskReportId = 0;
String reportStartDate = "";
......
......@@ -1561,6 +1561,41 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
context.startActivity(intent);
}
// #32861 作業情報追加 start
/**
* OZD, OZRコンテンツを開く(レポートあり)
* @param context
* @param operationId
* @param contentId
* @param taskKey
* @param isReadOnly
* @param taskReportId
* @param reportStartDate
* @param reportFileName
* @param reportDraft
* @param addReport
*/
public void startOZViewerActivity(Context context, long operationId, long contentId, String taskKey, boolean isReadOnly, int taskReportId, String reportStartDate, String reportFileName, boolean reportDraft, boolean addReport) {
reportStartDate = reportStartDate.replace("T", " ");
String strReportStartDate = DateTimeUtil.toString(DateTimeUtil.toDate(reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen), DateTimeFormat.yyyyMMddHHmm_none);
Intent intent = new Intent();
intent.setClass(context, CheckOZDViewActivity.class);
intent.putExtra(ABookKeys.OPERATION_ID, operationId);
intent.putExtra(ABookKeys.CONTENT_ID, contentId);
intent.putExtra(ABookKeys.TASK_KEY, taskKey);
intent.putExtra(ABookKeys.READ_ONLY_FLG, isReadOnly);
intent.putExtra(ABookKeys.DIRECTION_FLG, false);
intent.putExtra(ABookKeys.TASK_REPORT_ID, taskReportId);
intent.putExtra(ABookKeys.REPORT_START_DATE, strReportStartDate);
intent.putExtra(ABookKeys.REPORT_FILE_NAME, reportFileName);
intent.putExtra(ABookKeys.REPORT_DRAFT, reportDraft); // 一時保存情報
intent.putExtra(ABookKeys.ADD_REPORT, addReport); // 作業追加区分
context.startActivity(intent);
}
// #32861 作業情報追加 end
public boolean isMeetingConnected() {
return meetingManager.isConnected();
}
......
......@@ -23,6 +23,7 @@ import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.home.helper.OzdFileHelper;
import jp.agentec.abook.abv.launcher.android.PDFFileProvider;
import jp.agentec.abook.abv.launcher.android.R;
......@@ -73,6 +74,11 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
private String mSaveOzdTempFileName;
private String mSaveOzdFileName;
// #32861 作業情報追加 start
private boolean mReportDraft; // 一時保存情報
private boolean mAadReport; // 作業追加区分
// #32861 作業情報追加 end
@Override
public void onCreate(Bundle savedInstanceState) {
Logger.i(TAG, "onCreate");
......@@ -109,21 +115,58 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
TextView tvTitle = (TextView) findViewById(R.id.tv_title);
tvTitle.setText(frontTitle + rearTitle);
// #32861 作業情報追加 start
// OZ閲覧画面に表示するボタン表示の可否設定
// 一時保存情報についてボタン表示:「0:false、一時保存ボタン非表示」「1:ture、一時保存ボタン表示」
mReportDraft = intent.getBooleanExtra(ABookKeys.REPORT_DRAFT, false);
// 作業追加区分についてボタンを表示:「0:false、作業追加区分なし、作業一覧へボタン」「1:ture、作業追加区分あり、閉じるボタン」
mAadReport = intent.getBooleanExtra(ABookKeys.ADD_REPORT, false);
final Button homeButton = (Button) findViewById(R.id.btn_operation_home);
final Button closeButton = (Button) findViewById(R.id.btn_close);
final Button tempSaveButton = (Button) findViewById(R.id.btn_temp_save);
final Button saveButton = (Button) findViewById(R.id.btn_save);
// 一時ボタン表示可否判断
homeButton.setVisibility(mAadReport ? View.GONE : View.VISIBLE);
closeButton.setVisibility(mAadReport ? View.VISIBLE : View.GONE);
tempSaveButton.setVisibility(mReportDraft ? View.VISIBLE : View.GONE);
homeButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mButtonStatus = R.id.btn_operation_home;
goToMain();
}
});
// 閉じるボタン
closeButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (!mReadOnlyFlg) {
//OZD臨時保存処理
if (!saveTempOzdFile()) {
ABVToastUtil.showMakeText(mContext, R.string.msg_ozd_save_fail, Toast.LENGTH_LONG);
return;
}
}
mButtonStatus = R.id.btn_close;
finishActivity();
}
});
// 一時保存
tempSaveButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mButtonStatus = R.id.btn_temp_save;
showSaveConfirmAlert(R.string.temp_save, R.string.temp_save_info);
}
});
saveButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mButtonStatus = R.id.btn_save;
showSaveConfirmAlert(R.string.save, R.string.save_info);
}
});
// #32861 作業情報追加 end
mOzFilePath = OzdFileHelper.getOzFilePath(mOperationId, contentId, mTaskKey, mDirectionFlg, mTaskReportId, mReportStartDate, mReportFileName);
Logger.i(TAG,"********mOzFilePath = %s" + mOzFilePath);
......@@ -142,6 +185,42 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
}
}
// #32861 作業情報追加 start
// アラート表示処理
private void showSaveConfirmAlert(final int dialogTitle, int dialogMessage) {
ABookAlertDialog logoutAkert = AlertDialogUtil.createAlertDialog(this, dialogTitle);
logoutAkert.setMessage(dialogMessage);
logoutAkert.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.confirm), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// 一時保存処理
// if (dialogTitle == R.string.temp_save) {
// tempSaved();
// } else if (dialogTitle == R.string.save) {
// tempSaved();
// }
tempSaved();
}
});
logoutAkert.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), (DialogInterface.OnClickListener) null);
showAlertDialog(logoutAkert);
}
// #32861 作業情報追加 end
// #32861 作業情報追加 start
// 臨時保存の処理
private void tempSaved() {
if (!mReadOnlyFlg) {
//OZD臨時保存処理
if (!saveTempOzdFile()) {
ABVToastUtil.showMakeText(mContext, R.string.msg_ozd_save_fail, Toast.LENGTH_LONG);
return;
}
}
finishActivity();
}
// #32861 作業情報追加 end
private boolean loadOzdDocument(File file) {
if (mOzReportViewer != null) {
mOzReportViewer.dispose();
......@@ -252,8 +331,13 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
finishActivity();
// #32861 作業情報追加 start
if (!mAadReport) {
goToMain(); // 一覧画面に遷移
} else {
finishActivity(); // Ozd作業画面を閉じる
}
// #32861 作業情報追加 end
} else {
return super.onKeyUp(keyCode, event);
}
......@@ -498,4 +582,10 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
}
return true;
}
// #32861 作業情報追加 start
private void goToMain() {
ActivityHandlingHelper.getInstance().finishAllContentViewActivity(); // 一覧画面に遷移
}
// #32861 作業情報追加 end
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment