Commit 37d20501 by Lee Jaebin

#33570 一時保存処理修正

parent 90584ea6
...@@ -162,4 +162,10 @@ public class Constant { ...@@ -162,4 +162,10 @@ public class Constant {
int NO = 0; int NO = 0;
int YES = 1; int YES = 1;
} }
// 点検後修正可
public interface EnableReportUpdate {
int NO = 0;
int YES = 1;
}
} }
...@@ -120,4 +120,7 @@ public class ABookKeys { ...@@ -120,4 +120,7 @@ public class ABookKeys {
public static final String HAS_AUTHORITY = "hasAuthority"; public static final String HAS_AUTHORITY = "hasAuthority";
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
public static final String CLOSE_TASK_REPORT = "closeTaskReport"; public static final String CLOSE_TASK_REPORT = "closeTaskReport";
// taskReport.Jsonに一時保存フラグを保持するためのキー
public static final String LOCAL_SAVE_FLG = "localSaveFlg";
} }
...@@ -890,7 +890,10 @@ public class OperationLogic extends AbstractLogic { ...@@ -890,7 +890,10 @@ public class OperationLogic extends AbstractLogic {
if(dto.jsonData != null && dto.jsonData.length() > 0) { if(dto.jsonData != null && dto.jsonData.length() > 0) {
if (operationDto.reportType == Constant.ReportType.ReportReply) { if (operationDto.reportType == Constant.ReportType.ReportReply) {
taskReportJsonList.add(new JSONObject(dto.jsonData).put(ABookKeys.HAS_AUTHORITY, dto.enableReport)); JSONObject editJson = new JSONObject(dto.jsonData);
editJson.put(ABookKeys.HAS_AUTHORITY, dto.enableReport);
editJson.put(ABookKeys.LOCAL_SAVE_FLG, dto.localSavedFlg);
taskReportJsonList.add(editJson);
} else { } else {
taskReportJsonList.add(new JSONObject(dto.jsonData)); taskReportJsonList.add(new JSONObject(dto.jsonData));
} }
...@@ -899,6 +902,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -899,6 +902,7 @@ public class OperationLogic extends AbstractLogic {
emptyTaskReportJson.put(ABookKeys.TASK_KEY, dto.taskKey); emptyTaskReportJson.put(ABookKeys.TASK_KEY, dto.taskKey);
if (operationDto.reportType == Constant.ReportType.ReportReply) { if (operationDto.reportType == Constant.ReportType.ReportReply) {
emptyTaskReportJson.put(ABookKeys.HAS_AUTHORITY, dto.enableReport); emptyTaskReportJson.put(ABookKeys.HAS_AUTHORITY, dto.enableReport);
emptyTaskReportJson.put(ABookKeys.LOCAL_SAVE_FLG, dto.localSavedFlg);
} }
taskReportJsonList.add(emptyTaskReportJson); taskReportJsonList.add(emptyTaskReportJson);
} }
...@@ -937,7 +941,8 @@ public class OperationLogic extends AbstractLogic { ...@@ -937,7 +941,8 @@ public class OperationLogic extends AbstractLogic {
taskReportJsonRow.put(ABookKeys.TASK_REPORT_INFO_ID, dto.taskReportInfoId); 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_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.REPORT_END_DATE, DateTimeUtil.toStringInTimeZone(dto.reportEndDate, DateTimeFormat.yyyyMMddHHmmss_hyphen, DateTimeUtil.getLocalTimeZone()));
// 一時保存フラグ設定
taskReportJsonRow.put(ABookKeys.LOCAL_SAVE_FLG, dto.localSavedFlg);
List<JSONObject> taskReportInfoList = new ArrayList<JSONObject>(); List<JSONObject> taskReportInfoList = new ArrayList<JSONObject>();
if (!StringUtil.isNullOrEmpty(dto.jsonData)) { if (!StringUtil.isNullOrEmpty(dto.jsonData)) {
taskReportInfoList.add(new JSONObject(dto.jsonData)); taskReportInfoList.add(new JSONObject(dto.jsonData));
......
...@@ -917,12 +917,19 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -917,12 +917,19 @@ public class OperationListActivity extends ABVUIActivity {
localTaskReportDto = mTaskReportDao.selectByTaskKey(serverTaskReportDto.taskKey, serverTaskReportDto.taskReportLevel); localTaskReportDto = mTaskReportDao.selectByTaskKey(serverTaskReportDto.taskKey, serverTaskReportDto.taskReportLevel);
} }
if (localTaskReportDto != null && localTaskReportDto.localSavedFlg) { if (localTaskReportDto != null && localTaskReportDto.localSavedFlg) {
// 一時保存フラグがtureだと何もしない // 一時保存フラグがtrueで定期点検且つ点検後修正不可の場合、添付ファイル(作業報告のディレクトリ)を削除して、localSavedFlgをfalseに変更
continue; if (operationDto.reportType == ReportType.RoutineTask && operationDto.enableReportUpdate == Constant.EnableReportUpdate.NO) {
// 作業報告のディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(operationContentDto.contentId, localTaskReportDto.taskKey));
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, localTaskReportDto.taskKey, localTaskReportDto.taskReportId, DateTimeUtil.toString_yyyyMMddHHmmss_none(localTaskReportDto.reportStartDate)));
localTaskReportDto.localSavedFlg = false;
} else {
// 一時保存フラグがtureだと何もしない
continue;
}
} }
if (operationDto.reportType == ReportType.RoutineTask) { if (operationDto.reportType == ReportType.RoutineTask) {
serverTaskReportDto.taskKey = serverTaskDto.taskKey; serverTaskReportDto.taskKey = serverTaskDto.taskKey;
// 添付ファイルが存在する場合、取得して解凍する。 // 添付ファイルが存在する場合、取得して解凍する。
......
...@@ -321,7 +321,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -321,7 +321,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
TaskReportDto taskReportDto = mOperationLogic.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate); TaskReportDto taskReportDto = mOperationLogic.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate);
taskReportDto.jsonData = taskReport; taskReportDto.jsonData = taskReport;
mOperationLogic.updateRoutineTaskReport(operationId, contentId, taskReportDto, attachedChangeFlag, true, localSavedFlg); mOperationLogic.updateRoutineTaskReport(operationId, contentId, taskReportDto, attachedChangeFlag, localSavedFlg ? false : true, localSavedFlg);
mOperationLogic.createJsonForOperationContent(operationId, contentPath, true); mOperationLogic.createJsonForOperationContent(operationId, contentPath, true);
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate); copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate);
......
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