Commit e99ccc62 by Jeong Gilmo

#32861 作業情報追加(Android)

- CMSとの連携部分の修正
parent 970ee001
......@@ -132,7 +132,7 @@ public class ABVEnvironment {
// #32926 作業報告画面改善 start
// 作業報告レベル(taskReportLevel)によってディレクトリを追加する
public static final String TaskReportLevelDir = "/%s";
public static final String SavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir + "/%s";
public static final String SavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir;
public static final String RoutineTaskSavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir + "/%d/%s/%s";
public static final String OperationTaskKeyReportSendDirFormat = OperationTaskKeyDirFormat + TaskReportLevelDir + "/reportSend/%d";
public static final String OperationTaskKeyRoutineTaskReportSendDirFormat = OperationTaskKeyDirFormat + "/reportSend/%d/%s/%d";
......@@ -600,7 +600,7 @@ public class ABVEnvironment {
* @return ファイルパス
*/
public String getSavedOzFileTaskReportLevelPath(long operationId, String taskKey, String fileName, String taskReportLevel) {
return String.format(SavedOzFileFormat, rootDirectory, operationId, taskKey, taskReportLevel, "report", fileName);
return String.format(SavedOzFileFormat, rootDirectory, operationId, taskKey, taskReportLevel, fileName);
}
// #32926 作業報告画面改善 end
......
......@@ -863,6 +863,13 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
int taskReportId = 0;
String reportStartDate = "";
// #32861 作業情報追加 start
mAddReport = true;
if (abookCheckParam.containsKey(ABookKeys.ADD_REPORT)) {
mAddReport = Integer.parseInt(abookCheckParam.get(ABookKeys.ADD_REPORT)) > 0 ? true : false;
}
// #32861 作業情報追加 end
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK && abookCheckParam.get(ABookKeys.TASK_REPORT_ID) != null && abookCheckParam.get(ABookKeys.REPORT_START_DATE) != null) {
taskReportId = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = abookCheckParam.get(ABookKeys.REPORT_START_DATE);
......@@ -917,7 +924,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
final boolean isError = (boolean)ret;
closeProgressPopup();
// #32861 作業情報追加 start
afterABookCheckApi(mCmd, mTaskKey, isNetWorkError(isError), "", null, isOperationPdf());
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT,
ABookKeys.CMD_DELETE_TASK_REPORT, ABookKeys.CMD_CANCEL_TASK_REPORT) && !mAddReport) {
finish();
}else {
afterABookCheckApi(mCmd, mTaskKey, 0, "", null, isOperationPdf());
}
// #32861 作業情報追加 end
return null;
}
......@@ -951,17 +963,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, true, mReportFileName);
} else if (mCmd.equals(ABookKeys.CMD_SHOW_REPORT_OZD)) {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
// #32861 作業情報追加 start
// #32926 作業報告画面改善 start
if (abookCheckParam.containsKey(ABookKeys.LOCAL_SAVE)) {
mLocalSave = Integer.parseInt(abookCheckParam.get(ABookKeys.LOCAL_SAVE)) > 0 ? true : false;
}
if (abookCheckParam.containsKey(ABookKeys.ADD_REPORT)) {
mAddReport = Integer.parseInt(abookCheckParam.get(ABookKeys.ADD_REPORT)) > 0 ? true : false;
}
// #32926 作業報告画面改善 start
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, false, taskReportId, reportStartDate, mReportFileName, mLocalSave, mAddReport, taskReportLevel);
// #32926 作業報告画面改善 end
// #32861 作業情報追加 end
} else if (mCmd.equals(ABookKeys.CMD_PREVIEW_REPORT_OZD)) {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
// #32926 作業報告画面改善 start
......@@ -1090,9 +1097,6 @@ 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
doneProcess(result); // HTML側の処理が終わった後の処理を行う
// #32861 作業情報追加 end
}
});
}
......@@ -1212,8 +1216,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override
public void run () {
// 実行Javascript - 保存
webViewLoadUrl("javascript:CHK.saveOzReport()");
ActivityHandlingHelper.getInstance().callOzdHtmlScript("javascript:CHK.saveOzReport()");
Logger.d(TAG, "ozdSaveProcess");
doneProcess();
}
});
}
......@@ -1224,7 +1229,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override
public void run () {
// 実行Javascript - 一時保存
webViewLoadUrl("javascript:CHK.localSaveOzReport()");
ActivityHandlingHelper.getInstance().callOzdHtmlScript("javascript:CHK.localSaveOzReport()");
Logger.d(TAG, "ozdLocalSaveProcess");
}
});
......@@ -1236,7 +1241,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override
public void run () {
// 実行Javascript - 閉じる
webViewLoadUrl("javascript:CHK.cancelOzReport()");
ActivityHandlingHelper.getInstance().callOzdHtmlScript("javascript:CHK.cancelOzReport()");
Logger.d(TAG, "ozdCancelProcess");
}
});
......@@ -1248,8 +1253,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override
public void run () {
// 実行Javascript - 閉じる
webViewLoadUrl("javascript:CHK.deleteOzReport()");
ActivityHandlingHelper.getInstance().callOzdHtmlScript("javascript:CHK.deleteOzReport()");
Logger.d(TAG, "ozdDeleteProcess");
doneProcess();
}
});
}
......@@ -1260,7 +1266,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
public void doProcess() {
// #32861 作業情報追加 start
// 押したボタンによってHTML側の処理を行う
if (this instanceof CheckOZDViewActivity) {
if (mButtonStatus == R.id.btn_close) {
......@@ -1270,35 +1275,24 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
ozdLocalSaveProcess(); // 一時保存
} else if (mButtonStatus == R.id.btn_save) {
ozdSaveProcess(); // 保存
doneProcess(1);
} else if (mButtonStatus == R.id.btn_delete) {
ozdDeleteProcess(); // 削除
}
}
// #32861 作業情報追加 end
}
public void doneProcess(int isError) {
public void doneProcess() {
// 押したボタンによってHTML側の処理が終わった後の処理を行う
if (this instanceof CheckOZDViewActivity) {
if (mButtonStatus == R.id.btn_save || mButtonStatus == R.id.btn_close){
if (mButtonStatus == R.id.btn_save || mButtonStatus == R.id.btn_close || mButtonStatus == R.id.btn_delete){
// 作業追加区分ありの場合
if (mAddReport) {
super.finish();
if (isError == 0) ozdCancelProcess(); // 通信成功の場合だけHTML側の処理を行う
} else {
goToMain(); // 一覧画面に遷移
}
}
}
}
// ネットワークの非接続の場合の処理(OZ作業報告だけ)
protected int isNetWorkError(boolean isError) {
if (this instanceof CheckOZDViewActivity) {
return isError ? 0 : 1;
}
return 0;
}
// #32861 作業情報追加 end
}
......@@ -1594,4 +1594,19 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
@Override
public void onAuthenticationFailed() {
} // ignore : not come here
// #32861 start
// 上位のClassからHTML側のコールを行うための処理
public void callOzdHtmlScript(String url) {
if (!currentActivityStack.isEmpty()) {
for (final ABVAuthenticatedActivity activity : currentActivityStack) {
final ABVAuthenticatedActivity a = activity;
final String scriptUrl = url;
if (activity instanceof HTMLWebViewActivity) {
((HTMLWebViewActivity) activity).callViewLoadUrl(scriptUrl);
}
}
}
}
// #32861 end
}
......@@ -552,7 +552,7 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
param.append("export.mode=silent#");
param.append("export.filename=" + FileUtil.getFilenameWithoutExt(mSaveOzdTempFileName) + "#");
// #32926 作業報告画面改善 start
param.append("export.path=" + OzdFileHelper.getTempTaskDirPath(contentId, mTaskKey) + "/" + mTaskReportLevel + "#");
param.append("export.path=" + OzdFileHelper.getTempTaskDirPath(contentId, mTaskKey) + "#"); //OzdFileHelper.getTempTaskDirPath(contentId, mTaskKey) + "/" + mTaskReportLevel + "#");
// #32926 作業報告画面改善 end
param.append("export.confirmsave=false#");
param.append("export.format=ozd");
......
......@@ -63,7 +63,9 @@ import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
public class HTMLWebViewActivity extends ParentWebViewActivity {
private static final String TAG = "HTMLWebViewActivity";
/** Called when the activity is first created. */
/**
* Called when the activity is first created.
*/
boolean forwardCheckFlg = false;
boolean backCheckFlg = false;
......@@ -74,6 +76,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
private WebView webView;
private JsInf jsInf = new JsInf();
private ValueCallback<Uri[]> mUploadMessage;
@Override
public void onCreate(Bundle savedInstanceState) {
Logger.i(TAG, "onCreate");
......@@ -164,11 +167,11 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
switch (position) {
case 0 :
case 0:
// お気に入り
contentLogic.setFavoriteContent(getContentId(), !isExist);
break;
default :
default:
break;
}
mShowedPopupWindow.dismiss();
......@@ -278,7 +281,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
}
@Override
public void onReceivedError (WebView view, int errorCode, String description, String failingUrl) {
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
Logger.e(TAG, "onReceivedError errorCode=%s, description=%s, failingUrl=%s", errorCode, description, failingUrl);
}
......@@ -342,8 +345,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
Logger.d(TAG, "ReloadUrl");
if (latitude != null && longitude != null) {
webView.loadUrl(url + "&reload=true&latitude=" + latitude + "&longitude=" + longitude);
}
else {
} else {
webView.loadUrl(url + "&reload=true");
}
}
......@@ -359,7 +361,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
ContentDownloader.getInstance().download(contentId);
ABVToastUtil.showMakeText(getApplicationContext(), R.string.download_start, Toast.LENGTH_SHORT);
} catch (Exception e) {
Logger.e(TAG, "Download failed." ,e);
Logger.e(TAG, "Download failed.", e);
downloadButton.setEnabled(true);
handleErrorMessageToast(e);
}
......@@ -369,8 +371,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
downloadButton.setVisibility(View.VISIBLE);
if (isUpdate) {
downloadButton.setBackgroundResource(R.drawable.btn_update);
}
else {
} else {
downloadButton.setBackgroundResource(R.drawable.btn_download);
}
}
......@@ -411,7 +412,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
historyListBtn.setVisibility(View.GONE);
if(isLinkedContent) {
if (isLinkedContent) {
ContentDto contentDto = AbstractDao.getDao(ContentDao.class).getContent(contentId);
if (ContentJSON.KEY_MOVIE_TYPE.equals(contentDto.contentType) || ContentJSON.KEY_MUSIC_TYPE.equals(contentDto.contentType)
|| ContentJSON.KEY_PANO_IMAGE_TYPE.equals(contentDto.contentType) || ContentJSON.KEY_PANO_MOVIE_TYPE.equals(contentDto.contentType)
......@@ -453,8 +454,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
Logger.d(TAG, "existSetLocation=%s", ret);
if (ret != null && ret.equals("true")) { // setLocationメソッドが存在する場合、ページ読み込み完了とみなす
isPageFinished = true;
}
else { // 存在しない場合、ページ読み込み未完了とみなし1秒後に再度呼出しを繰り返す
} else { // 存在しない場合、ページ読み込み未完了とみなし1秒後に再度呼出しを繰り返す
handler.postDelayed(new Runnable() {
@Override
public void run() {
......@@ -478,11 +478,11 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
}
}
});
}
else {
} else {
finishActivity();
}
}
@JavascriptInterface
public void getAttachedDataUrl(String data) {
commonAttachedDataUrl(data);
......@@ -671,7 +671,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
}
@Override
protected void webViewLoadUrl(String url){
protected void webViewLoadUrl(String url) {
if (webView != null) {
webView.loadUrl(url);
}
......@@ -722,4 +722,11 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
}
mUploadMessage = null;
}
// #32861 start
// 上位のClassからHTML側のコールを行うための処理
public void callViewLoadUrl(String url) {
webViewLoadUrl(url);
}
// #32861 end
}
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