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() {
......
......@@ -274,6 +274,14 @@ public class OperationLogic extends AbstractLogic {
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
// #32926 start
// TODO 一時的理療する削除対象
// test start
int taskReportLevel = 0;
// test end
// tempDirPath = String.format(tempDirPath + "/%s", String.valueOf(taskReportLevel));
// #32926 end
//添付ファイル変更の場合、以下の処理を行う
JSONObject attachedListJson = taskDirectionsJson.getJSONObject("attached");
List<String> attachedFileNames = JSONObject.getValues(attachedListJson);
......@@ -354,6 +362,13 @@ public class OperationLogic extends AbstractLogic {
mTaskDirectionsDao.update(taskDirectionsDto);
mTaskDao.update(taskDto);
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
// #32926 start
// TODO 一時的理療する削除対象
// test start
int taskReportLevel = 0;
// test end
// tempDirPath = String.format(tempDirPath + "/%s", String.valueOf(taskReportLevel));
// #32926 end
String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, true);
if (taskDirectionsDto.attachedFileSendFlg) {
//添付ファイル変更の場合、以下の処理を行う
......@@ -513,7 +528,10 @@ public class OperationLogic extends AbstractLogic {
}
}
*/
public void insertTaskReport(String taskKey, long operationId, long contentId, JSONObject taskReportJson, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException {
// #32926 start
// TODO parameter 追加 taskReportLevel
public void insertTaskReport(String taskKey, long operationId, long contentId, JSONObject taskReportJson, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg, int taskReportLevel) throws IOException {
// #32926 end
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
if (taskDto == null) {
//TODO error
......@@ -555,6 +573,12 @@ public class OperationLogic extends AbstractLogic {
//添付ファイル変更の場合、以下の処理を行う
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
// #32926 start
// test start
taskReportLevel = 0;
// test end
// tempDirPath = String.format(tempDirPath + "/%s", String.valueOf(taskReportLevel));
// #32926 end
String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, false);
JSONObject attachedListJson = taskReportJson.getJSONObject("attached");
......@@ -606,6 +630,13 @@ public class OperationLogic extends AbstractLogic {
//添付ファイル変更の場合、以下の処理を行う
String strReportStartDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(routineTaskReportDto.reportStartDate);
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, routineTaskReportDto.taskKey);
// #32926 start
// TODO 一時的理療する削除対象
// test start
int taskReportLevel = 0;
// test end
// tempDirPath = String.format(tempDirPath + "/%s", String.valueOf(taskReportLevel));
// #32926 end
String routineTaskReportDirPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, routineTaskReportDto.taskKey, routineTaskReportDto.taskReportId, strReportStartDate);
if (!StringUtil.isNullOrEmpty(routineTaskReportDto.jsonData)) {
......@@ -725,11 +756,17 @@ public class OperationLogic extends AbstractLogic {
}
}
*/
public void updateTaskReport(String taskKey, long operationId, long contentId, JSONObject taskReport, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException {
// #32926 start
// TODO parameter taskReportLevel 追加
public void updateTaskReport(String taskKey, long operationId, long contentId, JSONObject taskReport, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg, int taskReportLevel) throws IOException {
// #32926 end
TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey);
if (taskReportDto == null) {
Logger.w(TAG, "taskReportDto is null");
insertTaskReport(taskKey, operationId, contentId, taskReport, localAttachedFileName, attachedChangeFlag, dataSendFlg);
// #32926 start
// TODO parameter taskReportLevel 追加
insertTaskReport(taskKey, operationId, contentId, taskReport, localAttachedFileName, attachedChangeFlag, dataSendFlg, taskReportLevel);
// #32926 end
return;
}
JSONObject taskJson = taskReport.getJSONObject("task");
......@@ -762,6 +799,13 @@ public class OperationLogic extends AbstractLogic {
mTaskReportDao.update(taskReportDto);
mTaskDao.update(taskDto);
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
// #32926 start
// test start
taskReportLevel = 0;
// test end
// tempDirPath = String.format(tempDirPath + "/%d", taskReportLevel);
// #32926 end
String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, false);
if (taskReportDto.attachedFileSendFlg) {
//添付ファイル変更の場合、以下の処理を行う
......@@ -836,6 +880,13 @@ public class OperationLogic extends AbstractLogic {
String strReportStartDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(routineTaskReportDto.reportStartDate);
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, routineTaskReportDto.taskKey);
// #32926 start
// TODO 一時的理療する削除対象
// test start
int taskReportLevel = 0;
// test end
// tempDirPath = String.format(tempDirPath + "/%s", String.valueOf(taskReportLevel));
// #32926 end
String routineTaskReportDirPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, routineTaskReportDto.taskKey, routineTaskReportDto.taskReportId, strReportStartDate);
if (insertFlg) {
......@@ -1010,7 +1061,15 @@ public class OperationLogic extends AbstractLogic {
}
// 作業報告のディレクトリ削除
// #32926 start
// TODO 一時的理療する削除対象
// test start
int taskReportLevel = 0;
// test end
// String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
// tempDirPath = String.format(tempDirPath + "/%s", String.valueOf(taskReportLevel));
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
// #32926 end
FileUtil.delete(ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, false));
}
// #32782 指示者テーブル関連削除 end
......@@ -1030,7 +1089,15 @@ public class OperationLogic extends AbstractLogic {
reportStartDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(dto.reportStartDate);
// 作業報告のディレクトリ削除
// #32926 start
// TODO 一時的理療する削除対象
// test start
int taskReportLevel = 0;
// test end
// String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, dto.taskKey);
// tempDirPath = String.format(tempDirPath + "/%s", String.valueOf(taskReportLevel));
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, dto.taskKey));
// #32926 end
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, dto.taskKey, dto.taskReportId, reportStartDate));
// 作業報告送信のディレクトリ削除
......@@ -1061,7 +1128,16 @@ public class OperationLogic extends AbstractLogic {
}
// 作業報告のディレクトリ削除
// 作業報告のディレクトリ削除
// #32926 start
// TODO 一時的理療する削除対象
// test start
int taskReportLevel = 0;
// test end
// String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
// tempDirPath = String.format(tempDirPath + "/%s", String.valueOf(taskReportLevel));
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
// #32926 end
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDate));
}
......@@ -1214,13 +1290,15 @@ public class OperationLogic extends AbstractLogic {
public void createJsonForOperationContent(Long operationId, int reportUpdateType, String contentPath, boolean directionsFlg, boolean routineTaskReportFlg) throws IOException {
try {
// #32782 指示者テーブル関連削除 start
createTaskReportJson(operationId, contentPath);
createTaskReportSuggestJson(operationId, contentPath);
if (!directionsFlg) {
// 作業タイプは
// 0:報告、1: 定期点検、2:報告&報告(回答)
// 報告と報告&報告(回答)、定期点検のjson作成の処理を分ける
if (routineTaskReportFlg) {
createRoutineTaskReportJson(operationId, contentPath);
} else {
createTaskReportJson(operationId, contentPath);
}
}
createTaskReportSuggestJson(operationId, contentPath);
// #32782 指示者テーブル関連削除 end
createHopSpotJson(operationId, contentPath);
......@@ -1326,19 +1404,14 @@ public class OperationLogic extends AbstractLogic {
}
// #32926 start
// 作業タイプを確認してJSONファイルを作成する
int operationType = mOperationDao.getOperation(operationId).operationReportType;
// 作業タイプは報告と報告(Type3)の場合
if (operationType == Constant.OperationReportType.REPORT_TYPE) {
taskGroupJson.put("taskGroup_0", workerGroupJsonList);
taskGroupJson.put("taskGroup_1", workerGroupJsonList);
// 作業タイプは報告(Type1)の場合
} else if (operationType == Constant.OperationReportType.DEFAULT) {
taskGroupJson.put("taskGroup_1", workerGroupJsonList);
// その以外の作業タイプの場合
} else {
// TODO taskGroup -> taskGroup_%s に変更
// 報告と報告(回答)のデータの区分が必要なので、「taskGroup_0」と「taskGroup_1」で形式で作成
// if (taskReportLevel > 0) {
// taskGroupJson.append(String.format("taskGroup_%s", String.valueOf(taskReportLevel)), workerGroupJsonList);
// } else {
// taskGroupJson.put(String.format("taskGroup_%s", taskReportLevel), workerGroupJsonList);
// }
taskGroupJson.put("taskGroup", workerGroupJsonList);
}
Logger.d(TAG, "createWorkerGroupJson : " + taskGroupJson.toString());
// #32926 end
FileUtil.createFile(contentPath + "/workerGroup.json", taskGroupJson.toString());
......@@ -1430,30 +1503,40 @@ public class OperationLogic extends AbstractLogic {
}
/**
* 作業指示、作業報告用のjsonファイル
* 報告と報告(回答)のデータの区分が必要なので、「taskReport_0」と「taskReport_1」で形式で作成
* 報告(回答)の場合はtaskReport_1を作成
*
* @param operationId
* @param contentPath
* @throws IOException
*/
public void createTaskReportJson(Long operationId, String contentPath) throws IOException {
List<JSONObject> taskReportJsonList = new ArrayList<JSONObject>();
JSONObject taskReportJson = new JSONObject();
List<TaskReportDto> taskReportDtoList = mTaskReportDao.getTaskReportByOperationId(operationId);
// #32926 start
for (TaskReportDto dto : taskReportDtoList) {
taskReportJson.put(ABookKeys.TASK_KEY, dto.taskKey);
if(dto.jsonData != null && dto.jsonData.length() > 0) {
taskReportJsonList.add(new JSONObject(dto.jsonData));
}
}
// #32926 start
int operationType = mOperationDao.getOperation(operationId).operationReportType;
// 現在の作業タイプは報告と報告(Type3)の場合
if (operationType == Constant.OperationReportType.REPORT_TYPE) {
taskReportJson.put("taskReport_0", taskReportJsonList);
taskReportJson.put("taskReport_1", taskReportJsonList);
} else if (operationType == Constant.OperationReportType.ROUTINE_TASK) {
// TODO append taskHasAuthority が必要
// TaskDto taskDto = mTaskDao.getTaskByTaskKey(dto.taskKey);
// taskReportJson.put(ABookKeys.TASK_HAS_AUTHORITY, taskDto.taskHasAuthority);
// taskReportJsonList.add(taskReportJson);
}
// TODO taskReport -> taskReport_%s に変更
// if (taskReportLevel > 0) {
// taskReportJson.append(String.format("taskReport_%s", String.valueOf(taskReportLevel)), taskReportJsonList);
// } else {
// taskReportJson.put(String.format("taskReport_%s", taskReportLevel), taskReportJsonList);
// }
taskReportJson.put("taskReport", taskReportJsonList);
} else {
taskReportJson.put("taskReport_1", taskReportJsonList);
}
// #32926 end
Logger.d(TAG, "createTaskReportJson : " + taskReportJson.toString());
// #32926 end
FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJson.toString());
}
......@@ -1462,29 +1545,28 @@ public class OperationLogic extends AbstractLogic {
JSONObject taskReportJsonRoot = new JSONObject();
JSONObject taskReportJsonRow;
List<RoutineTaskReportDto> routineTaskReportDtoList = mRoutineTaskReportDao.getRoutineTaskReportByOperationId(operationId);
// #32926 start
// 現在の作業タイプは定期点検の場合
for (RoutineTaskReportDto dto : routineTaskReportDtoList) {
taskReportJsonRow = new JSONObject();
taskReportJsonRow.put(ABookKeys.TASK_REPORT_ID, dto.taskReportId);
taskReportJsonRow.put(ABookKeys.TASK_REPORT_INFO_ID, dto.taskReportInfoId);
taskReportJsonRow.put(ABookKeys.REPORT_START_DATE, DateTimeUtil.toStringInTimeZone(dto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen, DateTimeUtil.getLocalTimeZone()));
taskReportJsonRow.put(ABookKeys.REPORT_END_DATE, DateTimeUtil.toStringInTimeZone(dto.reportEndDate, DateTimeFormat.yyyyMMddHHmmss_hyphen, DateTimeUtil.getLocalTimeZone()));
taskReportJsonRow.put(ABookKeys.REPORTED, dto.reportedFlag ? 1 : 0);
List<JSONObject> taskReportInfoList = new ArrayList<JSONObject>();
if (!StringUtil.isNullOrEmpty(dto.jsonData)){
taskReportInfoList.add(new JSONObject(dto.jsonData));
}
taskReportJsonRow.put(ABookKeys.TASK_REPORT_INFO, taskReportInfoList);
taskReportJsonRow.put(ABookKeys.REPORTED, dto.reportedFlag ? 1 : 0);
taskReportJsonList.add(taskReportJsonRow);
}
// #32926 start
// 現在の作業タイプは報告と報告(Type3)の場合
if (mOperationDao.getOperation(operationId).operationReportType == Constant.OperationReportType.REPORT_TYPE) {
taskReportJsonRoot.put("taskReport", taskReportJsonList);
} else {
taskReportJsonRoot.put("taskReport", taskReportJsonList);
}
// TODO taskReport -> taskReport_0 に変更
// taskReportJsonRoot.put("taskReport_0", taskReportJsonList);
taskReportJsonRoot.put(ABookKeys.ENABLE_REPORT_UPDATE, mOperationDao.getOperation(operationId).enableReportUpdate);
// taskReportJsonRoot.put("taskReport_%s", taskReportLevel, taskReportJsonList);
Logger.d(TAG, "createRoutineTaskReportJson : " + taskReportJsonRoot.toString());
// #32926 end
FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJsonRoot.toString());
}
......
......@@ -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 {
// #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