Commit 94802da9 by Jeong Gilmo

#32926 作業報告画面改善(Android)

parent a64f797a
......@@ -45,6 +45,10 @@ public class OperationDataJSON extends AcmsCommonJSON {
public List<TaskDto> taskDtoList;
public Date lastEditDate;
// #32926 start
public static final String TaskReportLevel = "taskReportLevel";
// #32926 end
public OperationDataJSON(String jsonString) throws AcmsException {
super(jsonString);
}
......@@ -90,6 +94,11 @@ public class OperationDataJSON extends AcmsCommonJSON {
if (taskJson.has(TaskReportKey)) {
dto.taskReportDto.attachedFileName = taskJson.getString(TaskReportKey);
}
// #32926 start
// dto.taskReportLevel = taskJson.getInt(TaskReportLevel);
// #32926 end
taskDtoList.add(dto);
}
}
......
......@@ -68,8 +68,12 @@ public class ABVEnvironment {
public static final String LoginPasswordAESKey = "ABook+!\"#$+kooBA"; // 桁数を変更しないこと(16桁)
public static final String MacAddressAESKey = "aAg+b2o#n0T}ke3c"; // 桁数を変更しないこと(16桁)
public static final String APK_FILE_NAME = "abook_plus.apk";
public static final String DIRECTION = "direction"; // 作業指示のディレクトリ名
public static final String REPORT = "report"; // 作業報告のディレクトリ名
// #32926 start
// public static final String DIRECTION = "direction"; // 作業指示のディレクトリ名
// public static final String REPORT = "report"; // 作業報告のディレクトリ名
public static final String DIRECTION = "0"; // 作業指示のディレクトリ名
public static final String REPORT = "1"; // 作業報告のディレクトリ名
// #32926 end
public static final String REPORT_SEND = "reportSend"; // 作業報告のディレクトリ名
public static final int AppId = 3;
......@@ -125,7 +129,11 @@ public class ABVEnvironment {
public static final String OperationDirectionOrReportDirFormat = OperationDirFormat + "/%s/%s";
public static final String CacheTempFormat = "%s/temp";
public static final String TempTaskDirFormat = "%s/%d/temp";
// #32926 start
// 作業報告レベル(taskReportLevel)によってディレクトリを追加する
public static final String TempTaskKeyDirFormat = TempTaskDirFormat + "/%s";
// public static final String TempTaskKeyDirFormat = TempTaskDirFormat + "/%s/%s";
// #32926 end
public static final String SavedOzFileFormat = OperationDirectionOrReportDirFormat + "/%s";
public static final String RoutineTaskSavedOzFileFormat = OperationDirectionOrReportDirFormat + "/%d/%s/%s";
......@@ -636,6 +644,19 @@ public class ABVEnvironment {
return String.format(TempTaskFileFormat, cacheDirectory, contentId, taskKey, fileName);
}
// #32926 start
/**
* 臨時保存したファイルパス
* @param contentId
* @param taskKey
* @param fileName
* @return ファイルパス
*/
// public String getTempFilePath(long contentId, String taskKey, String taskReportLevel, String fileName) {
// return String.format(TempTaskFileFormat + "/%s", cacheDirectory, contentId, taskKey, taskReportLevel, fileName);
// }
// #32926 end
/**
* * 臨時保存したタスクキーのディレクトリファイルパス
* 例)../caches/[contentId]/temp/[task_key]
......@@ -696,6 +717,7 @@ public class ABVEnvironment {
}
public String getAttachedMoviesFilePath(long contentId) {
Logger.d(TAG, "cacheDirectory : " + cacheDirectory);
return String.format(AttachedMoviesDirFormat, cacheDirectory, contentId);
}
......
......@@ -122,4 +122,8 @@ public class ABookKeys {
public static final String ADD_REPORT = "addReport"; // 作業追加区分
public static final String CMD_LOCAL_SAVE_TASK_REPORT = "localSaveTaskReport"; // 一時保存
// #32861 作業情報追加 end
// #32926 start
public static final String TASK_REPORT_LEVEL = "taskReportLevel"; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答))
public static final String TASK_HAS_AUTHORITY = "taskHasAuthority";
// #32926 end
}
......@@ -48,6 +48,12 @@ public class TaskDao extends AbstractDao {
if (column != -1) {
dto.delFlg = toBool(cursor.getInt(column));
}
// #32926 start
column = cursor.getColumnIndex("task_has_Authority");
if (column != -1) {
dto.taskHasAuthority = toBool(cursor.getInt(column));
}
// #32926 end
return dto;
}
......
......@@ -26,6 +26,10 @@ public class TaskDto extends AbstractDto {
public int taskReportId;
public List<RoutineTaskReportDto> RoutineTaskReportList;
// #32926 start
public boolean taskHasAuthority; // タスク別の権限
public int taskReportLevel; // 作業報告階層
// #32926 end
@Override
public Object[] getInsertValues() {
......
......@@ -136,6 +136,10 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected boolean mLocalSave; // 一時保存情報
protected boolean mAddReport; // 作業追加区分
// #32861 作業情報追加 end
// #32926 start
// protected String mAttachedChageFlag; // 0:変更なし 1:変更あり
protected int mTaskReportLevel; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答))
// #32926 end
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -855,6 +859,15 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
mCmd = abookCheckParam.get(ABookKeys.CMD);
mTaskKey = abookCheckParam.get(ABookKeys.TASK_KEY);
// #32926 start
// mAttachedChageFlag = abookCheckParam.get(ABookKeys.ATTACHED_CHANGE_FLAG); // 0:変更なし 1:変更あり
if (abookCheckParam.containsKey(ABookKeys.TASK_REPORT_LEVEL)) {
mTaskReportLevel = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_LEVEL)); // 作業報告レベル
} else {
mTaskReportLevel = 0;
}
// #32926 end
int taskReportId = 0;
String reportStartDate = "";
......@@ -864,7 +877,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_INSERT_TASK_DIRECTIONS, ABookKeys.CMD_UPDATE_TASK_DIRECTIONS, ABookKeys.CMD_DELETE_TASK_DIRECTIONS, ABookKeys.CMD_CANCEL_TASK_DIRECTIONS,
ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT, ABookKeys.CMD_DELETE_TASK_REPORT, ABookKeys.CMD_CANCEL_TASK_REPORT)) {
ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT, ABookKeys.CMD_DELETE_TASK_REPORT, ABookKeys.CMD_CANCEL_TASK_REPORT,
ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) {
boolean isError = false;
try {
......@@ -877,9 +891,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
ABookKeys.CMD_UPDATE_TASK_DIRECTIONS,
ABookKeys.CMD_INSERT_TASK_REPORT,
ABookKeys.CMD_UPDATE_TASK_REPORT,
ABookKeys.CMD_MOVE_HOT_SPOT)) {
ABookKeys.CMD_MOVE_HOT_SPOT,
ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) {
String taskCode = "";
// #32781 start
// TODO TASK_DIRECTIONSの削除され、TASK_REPORTに変更する
if (abookCheckParam.get(ABookKeys.TASK_DIRECTIONS) != null) {
JSONObject direction = new JSONObject(abookCheckParam.get(ABookKeys.TASK_DIRECTIONS));
JSONObject taskJson = direction.getJSONObject(ABookKeys.TASK);
......@@ -891,6 +908,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
}
}
// #32781 end
if (abookCheckParam.get(ABookKeys.HOT_SPOT) != null) {
JSONObject hotSpot = new JSONObject(abookCheckParam.get(ABookKeys.HOT_SPOT));
......@@ -918,7 +936,13 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
return null;
}
};
ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this, mCmd, mTaskKey, reportUpdateType, abookCheckParam, mOperationId, mContentPath, getContentId(), operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK, finishCallback);
// #32926 start
// ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this, mCmd, mTaskKey, reportUpdateType, abookCheckParam, mOperationId, mContentPath, getContentId(), operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK, finishCallback);
ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this,
mCmd, mTaskKey, reportUpdateType, abookCheckParam, mOperationId, mContentPath, getContentId(),
operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK, finishCallback,
mTaskReportLevel);
// #32926 end
} catch(Exception e) {
Logger.e(TAG, "doABookCheckParam error", e);
}
......@@ -1016,7 +1040,10 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
boolean isError = false;
if (data != null) {
try {
String imagePath = ABVEnvironment.getInstance().getTempFilePath(getContentId(), mTaskKey, mAttachedFileName);
// #32926 start
String imagePath = ABVEnvironment.getInstance().getTempFilePath(getContentId(), mTaskKey, mAttachedFileName);
// String imagePath = ABVEnvironment.getInstance().getTempFilePath(getContentId(), mTaskKey, String.valueOf(mTaskReportLevel), mAttachedFileName);
// #32926 end
ABookCheckWebViewHelper.getInstance().decodeToImage(data, imagePath);
//アプリ内のファイルのみ削除(Galleryファイルは削除しない)
if (mLocalFile != null && mLocalFile.getPath().contains(getPackageName())) {
......
......@@ -617,6 +617,10 @@ public class OperationListActivity extends ABVUIActivity {
}
}
// #32926 start
// TODO taskReportLevel の値が確認できたら利用可能
// contentPath = String.format("%s/%s", contentPath, String.valueOf(taskReportLevel));
// #32926 end
// プロジェクトの指示/報告表示時、必要なJSONファイル作成
mOperationLogic.createJsonForOpenABookCheckPano(operationDto.operationId, operationDto.contentId, contentPath);
mOperationLogic.createJsonForOperationContent(operationDto.operationId, 0, contentPath, mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR ? true : false, operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK);
......@@ -995,6 +999,10 @@ public class OperationListActivity extends ABVUIActivity {
taskDirectionJson = new JSONObject(taskDto.taskDirectionsDto.jsonData);
taskDirectionJson.put(ABookKeys.TASK_STATUS, taskDto.taskStatus);
// #32926 start
int taskReportLevel = taskDto.taskReportLevel;
// #32926 end
int localTaskIndex = localTaskList.indexOf(taskDto);
if (localTaskIndex >= 0) {
......@@ -1011,7 +1019,7 @@ public class OperationListActivity extends ABVUIActivity {
// 報告データが存在すると作業報告を更新する
if (taskDto.taskReportDto.jsonData != null) {
mOperationLogic.updateTaskReport(taskDto.taskKey, taskDto.operationId, operationContentDto.contentId,
new JSONObject(taskDto.taskReportDto.jsonData), reportAttachedFileName, false, false);
new JSONObject(taskDto.taskReportDto.jsonData), reportAttachedFileName, false, false, taskReportLevel);
}
} else {
// 添付ファイルが存在する場合、取得して解凍する。
......@@ -1025,7 +1033,7 @@ public class OperationListActivity extends ABVUIActivity {
taskDirectionJson, taskDto.taskHotSpotInfo, directionsAttachedFileName, false, false);
if (taskDto.taskReportDto.jsonData != null) {
mOperationLogic.insertTaskReport(taskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId,
new JSONObject(taskDto.taskReportDto.jsonData), reportAttachedFileName, false, false);
new JSONObject(taskDto.taskReportDto.jsonData), reportAttachedFileName, false, false, taskReportLevel);
}
}
progressCallback.callback(new Integer(progress));
......
......@@ -59,7 +59,21 @@ public class ABookCheckWebViewHelper extends ABookHelper {
return panoCheckViewHelper;
}
public void doABookCheckParam(ABVContentViewActivity context, String cmd, String taskKey, int reportUpdateType, Map<String, String> param, long operationId, String contentPath, long contentId, boolean routineTaskReportFlg, Callback finishCallback) throws IOException {
/**
* parameterによって処理を分ける
*
* @param context ABVContentViewActivity
* @param cmd
* @param taskKey タスクキー
* @param reportUpdateType
* @param param
* @param operationId プロジェクトID
* @param contentPath
* @param routineTaskReportFlg
* @param finishCallback
* @param taskReportLevel
*/
public void doABookCheckParam(ABVContentViewActivity context, String cmd, String taskKey, int reportUpdateType, Map<String, String> param, long operationId, String contentPath, long contentId, boolean routineTaskReportFlg, Callback finishCallback, int taskReportLevel) throws IOException {
int taskReportSendId = 0;
mFinishCallback = finishCallback;
......@@ -242,7 +256,12 @@ public class ABookCheckWebViewHelper extends ABookHelper {
break;
case ABookKeys.CMD_CANCEL_TASK_DIRECTIONS:
case ABookKeys.CMD_CANCEL_TASK_REPORT:
// #32926 start
// TODO 一時的理療する削除対象
// String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
// tempDirPath = String.format(tempDirPath + "/%d", taskReportLevel);
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
// #32926 end
mFinishCallback.callback(false);
break;
}
......@@ -558,6 +577,13 @@ public class ABookCheckWebViewHelper extends ABookHelper {
int taskReportId = 0;
String reportStartDate = "";
// #32926 start
int taskReportLevel = 0;
if (param.containsKey(ABookKeys.TASK_REPORT_LEVEL)) {
taskReportLevel = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_LEVEL));
}
// #32926 end
if (routineTaskReportFlg) {
taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = param.get(ABookKeys.REPORT_START_DATE);
......@@ -570,9 +596,12 @@ public class ABookCheckWebViewHelper extends ABookHelper {
mOperationLogic.updateRoutineTaskReport(operationId, contentId, routineTaskTaskReportDto, attachedChangeFlag, true, insertFlg, true);
} else {
if (insertFlg) {
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true);
// #32926 start
// mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true);
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true, taskReportLevel);
// #32926 end
} else {
mOperationLogic.updateTaskReport(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true);
mOperationLogic.updateTaskReport(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true, taskReportLevel);
}
}
......@@ -605,7 +634,12 @@ public class ABookCheckWebViewHelper extends ABookHelper {
if (reportUpdateType == Constant.OperationUpdateType.HISTORY_ADD) {
// 作業報告のディレクトリ削除
// #32926 start
// TODO 一時的理療する削除対象
// String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
// tempDirPath = String.format(tempDirPath + "/%d", taskReportLevel);
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
// #32926 start
FileUtil.delete(ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, false));
}
}
......
......@@ -526,7 +526,10 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
StringBuilder param = new StringBuilder();
param.append("export.mode=silent#");
param.append("export.filename=" + FileUtil.getFilenameWithoutExt(mSaveOzdTempFileName) + "#");
param.append("export.path=" + OzdFileHelper.getTempTaskDirPath(contentId, mTaskKey) + "#");
// #32926 start
// param.append("export.path=" + OzdFileHelper.getTempTaskDirPath(contentId, mTaskKey) + "#");
param.append("export.path=" + OzdFileHelper.getTempTaskDirPath(contentId, mTaskKey) + "/" + mTaskReportLevel + "#");
// #32926 end
param.append("export.confirmsave=false#");
param.append("export.format=ozd");
int result = mOzReportViewer.ScriptEx("save", param.toString(), "#");
......
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