Commit 72a491b6 by Lee Jaebin

#35097 報告回答の保存時に添付画像の設問に設定した画像が欠落する問題対応

parent 30ad4bb2
...@@ -879,7 +879,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -879,7 +879,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
abookCheckParam.put(key, uri.getQueryParameter(key)); abookCheckParam.put(key, uri.getQueryParameter(key));
} }
mCmd = abookCheckParam.get(ABookKeys.CMD); mCmd = abookCheckParam.get(ABookKeys.CMD);
if (abookCheckParam.containsKey(ABookKeys.TASK_KEY)) {
mTaskKey = abookCheckParam.get(ABookKeys.TASK_KEY); mTaskKey = abookCheckParam.get(ABookKeys.TASK_KEY);
}
int taskReportLevel = 0; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答)) int taskReportLevel = 0; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答))
if (abookCheckParam.containsKey(ABookKeys.TASK_REPORT_LEVEL)) { if (abookCheckParam.containsKey(ABookKeys.TASK_REPORT_LEVEL)) {
...@@ -1016,8 +1018,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1016,8 +1018,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
mAttachedFileName = abookCheckParam.get(ABookKeys.FILE_NAME); mAttachedFileName = abookCheckParam.get(ABookKeys.FILE_NAME);
//編集可否を判別 //編集可否を判別
mEnablePhotoEdit = abookCheckParam.get(ABookKeys.EDITABLE) == null ? "0" : abookCheckParam.get(ABookKeys.EDITABLE); //添付したファイルの編集可否のパラメタ mEnablePhotoEdit = abookCheckParam.get(ABookKeys.EDITABLE) == null ? "0" : abookCheckParam.get(ABookKeys.EDITABLE); //添付したファイルの編集可否のパラメタ
getAttachedDataUrl(); getAttachedDataUrl(abookCheckParam.get(ABookKeys.TASK_KEY));
} else if (mCmd.equals(ABookKeys.CMD_EDIT_ATTACHED)){ } else if (mCmd.equals(ABookKeys.CMD_EDIT_ATTACHED)) {
//編集パラメタ( //編集パラメタ(
mAttachedFileName = abookCheckParam.get(ABookKeys.FILE_NAME); //再編集するファイルの名 mAttachedFileName = abookCheckParam.get(ABookKeys.FILE_NAME); //再編集するファイルの名
mEditFilePath = abookCheckParam.get(ABookKeys.FILE_PATH); //再編集するファイルのパス mEditFilePath = abookCheckParam.get(ABookKeys.FILE_PATH); //再編集するファイルのパス
...@@ -1094,11 +1096,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1094,11 +1096,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
} }
public void commonAttachedDataUrl (String data) {
public void commonAttachedDataUrl (String taskKey, String data) {
boolean isError = false; boolean isError = false;
if (data != null) { if (data != null) {
try { try {
String imagePath = ABVEnvironment.getInstance().getTempFilePath(getContentId(), mTaskKey, mAttachedFileName); String imagePath = ABVEnvironment.getInstance().getTempFilePath(getContentId(), taskKey, mAttachedFileName);
ABookCheckWebViewHelper.getInstance().decodeToImage(data, imagePath); ABookCheckWebViewHelper.getInstance().decodeToImage(data, imagePath);
//アプリ内のファイルのみ削除(Galleryファイルは削除しない) //アプリ内のファイルのみ削除(Galleryファイルは削除しない)
if (mLocalFile != null && mLocalFile.getPath().contains(getPackageName())) { if (mLocalFile != null && mLocalFile.getPath().contains(getPackageName())) {
...@@ -1114,7 +1117,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1114,7 +1117,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
Logger.e(TAG, e); Logger.e(TAG, e);
} }
} }
afterABookCheckApi(mCmd, mTaskKey, isError ? 1 : 0, "", null); afterABookCheckApi(mCmd, taskKey, isError ? 1 : 0, "", null);
} }
protected Uri attachmentImageProcessing(Uri uri) throws Exception { protected Uri attachmentImageProcessing(Uri uri) throws Exception {
...@@ -1167,11 +1170,11 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1167,11 +1170,11 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
/** /**
* 添付ファイルのBase64文字列取得 * 添付ファイルのBase64文字列取得
*/ */
public void getAttachedDataUrl() { public void getAttachedDataUrl(final String taskKey) {
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
webViewLoadUrl("javascript:android.getAttachedDataUrl(CHK.getAttachedDataUrl())"); webViewLoadUrl("javascript:android.getAttachedDataUrl('" + taskKey + "', CHK.getAttachedDataUrl())");
} }
}); });
} }
......
...@@ -450,8 +450,8 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -450,8 +450,8 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
} }
@JavascriptInterface @JavascriptInterface
public void getAttachedDataUrl(String data) { public void getAttachedDataUrl(String taskKey, String data) {
commonAttachedDataUrl(data); commonAttachedDataUrl(taskKey, data);
} }
@JavascriptInterface @JavascriptInterface
......
...@@ -517,8 +517,8 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity { ...@@ -517,8 +517,8 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
} }
@org.xwalk.core.JavascriptInterface @org.xwalk.core.JavascriptInterface
public void getAttachedDataUrl(String data) { public void getAttachedDataUrl(String taskKey, String data) {
commonAttachedDataUrl(data); commonAttachedDataUrl(taskKey, data);
} }
@org.xwalk.core.JavascriptInterface @org.xwalk.core.JavascriptInterface
......
...@@ -107,30 +107,6 @@ public class ParentWebViewActivity extends ABVContentViewActivity { ...@@ -107,30 +107,6 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
} }
@Override @Override
public void commonAttachedDataUrl (String data) {
boolean isError = false;
if (data != null) {
try {
final String imagePath = ABVEnvironment.getInstance().getTempFilePath(getContentId(), mTaskKey, mAttachedFileName);
ABookCheckWebViewHelper.getInstance().decodeToImage(data, imagePath);
//アプリ内のファイルのみ削除(Galleryファイルは削除しない)
if (mLocalFile != null && mLocalFile.getPath().contains(getPackageName())) {
FileUtil.delete(mLocalFile);
}
mLocalFile = null;
//編集可能可否をチェックする。
if (mEnablePhotoEdit.equals("1")) { //編集の場合、編集画面を開ける。
commonOpenEditPage();
}
} catch (Exception e) {
isError = true;
Logger.e(TAG, e);
}
}
afterABookCheckApi(mCmd, mTaskKey, isError ? 1 : 0, "", null);
}
@Override
protected void commonConfigureHeader() { protected void commonConfigureHeader() {
if (mStatusCode == Constant.XWalkWebViewDisplayStatus.InitView) { //フォームが非表示時のみヘルプボタン表示 if (mStatusCode == Constant.XWalkWebViewDisplayStatus.InitView) { //フォームが非表示時のみヘルプボタン表示
helpButton.setVisibility(View.VISIBLE); helpButton.setVisibility(View.VISIBLE);
......
...@@ -537,8 +537,8 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -537,8 +537,8 @@ public class OperationTaskLayout extends RelativeLayout {
private class JsInf { private class JsInf {
@JavascriptInterface @JavascriptInterface
public void getAttachedDataUrl(String data) { public void getAttachedDataUrl(String taskKey, String data) {
((ABVContentViewActivity) OperationTaskLayout.this.mContext).commonAttachedDataUrl(data); ((ABVContentViewActivity) OperationTaskLayout.this.mContext).commonAttachedDataUrl(taskKey, data);
} }
@JavascriptInterface @JavascriptInterface
......
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