Commit 7221219c by Kim Jinsung

#39910 連続作業機能

全般的な機能実装
parent b9fc5fca
......@@ -28,6 +28,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.NewAppStoreLoginJSON;
import jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON;
import jp.agentec.abook.abv.bl.acms.client.json.OperationGroupMasterJSON;
import jp.agentec.abook.abv.bl.acms.client.json.OperationListJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ProcessDataJSON;
import jp.agentec.abook.abv.bl.acms.client.json.RequirePasswordChangeJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ResultJSON;
import jp.agentec.abook.abv.bl.acms.client.json.SceneEntryJSON;
......@@ -76,6 +77,7 @@ import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.GroupDto;
import jp.agentec.abook.abv.bl.dto.MemberInfoDto;
import jp.agentec.abook.abv.bl.dto.ServiceOptionDto;
import jp.agentec.abook.abv.bl.dto.TaskDto;
import jp.agentec.abook.abv.bl.dto.TaskReportDto;
import jp.agentec.adf.net.http.HttpDownloadState;
import jp.agentec.adf.net.http.HttpFileDownloader;
......@@ -534,7 +536,7 @@ public class AcmsClient implements AcmsClientResponseListener {
* @throws NetworkDisconnectedException
* @throws IOException
*/
public AcmsMessageJSON sendTaskData(String sid, Long operationId, TaskReportDto taskReportDto, File formFile, Date taskReportSendSaveDate, int reportType, boolean hotspotChangeFlg) throws ABVException, NetworkDisconnectedException, IOException {
public AcmsMessageJSON sendTaskData(String sid, Long operationId, TaskReportDto taskReportDto, File formFile, Date taskReportSendSaveDate, int reportType, boolean hotspotChangeFlg, TaskDto taskDto) throws ABVException, NetworkDisconnectedException, IOException {
if (networkAdapter != null && !networkAdapter.isNetworkConnected()) { // NWのチェック
throw new NetworkDisconnectedException();
}
......@@ -556,6 +558,9 @@ public class AcmsClient implements AcmsClientResponseListener {
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_ID, StringUtil.toString(taskReportDto.taskReportId)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO_ID, StringUtil.toString(taskReportDto.taskReportInfoId)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.REPORT_START_DATE, DateTimeUtil.toStringForCmsGMT(taskReportDto.reportStartDate)));
} else if (reportType == Constant.ReportType.ReportContinuous) { //連続作業
HttpMultipartList.add(new HttpMultipart(ABookKeys.PROCESS_KEY, taskDto.processKey));
HttpMultipartList.add(new HttpMultipart(ABookKeys.PHASE_NO, StringUtil.toString(taskDto.phaseNo)));
}
if (formFile != null) {
......@@ -613,6 +618,7 @@ public class AcmsClient implements AcmsClientResponseListener {
*/
public void getTaskFile(GetTaskFileParameters param, Long operationId, String outputFilePath) throws InterruptedException, ABVException {
String downloadUrl = AcmsApis.getApiUrl(env.acmsAddress, urlPath, AcmsApis.ApiGetTaskFile);
Logger.d(TAG, "[url : %s], [param : %s]", downloadUrl, param.toHttpParameterString());
HttpFileDownloader downloader = new HttpFileDownloader(downloadUrl, param, outputFilePath);
downloader.setRequireFileSizeFirst(false);
......@@ -731,6 +737,18 @@ public class AcmsClient implements AcmsClientResponseListener {
return json;
}
/**
* 連続作業の承認情報取得API
* @param param
* @return ProcessDataJSON 承認情報
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public ProcessDataJSON getProcessData(GetOperationDataParameters param) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApiGetProcessData, param);
ProcessDataJSON json = new ProcessDataJSON(response.httpResponseBody);
return json;
}
/**
* ACMSから、絞り検索マスタデータ情報を取得します。
......
......@@ -27,6 +27,9 @@ public class OperationDataJSON extends AcmsCommonJSON {
public static final String TaskStatus = "taskStatus";
public static final String TaskHotspotInfo = "taskHotspotInfo";
public static final String Task = "task";
public static final String ProcessKey = "processKey";
public static final String PhaseNo = "phaseNo";
public static final String TaskName = "taskName";
// 1.0.1で追加
public static final String TaskReportId = "taskReportId"; // 作業報告書ID ※定期点検のみ
......@@ -67,6 +70,20 @@ public class OperationDataJSON extends AcmsCommonJSON {
}
dto.taskHotSpotInfo = taskJson.getJSONObject(TaskHotspotInfo).toString();
if (taskJson.has(TaskStatus)) {
dto.taskStatus = taskJson.getInt(TaskStatus);
}
if (taskJson.has(ProcessKey)) {
dto.processKey = taskJson.getString(ProcessKey);
}
if (taskJson.has(PhaseNo)) {
dto.phaseNo = taskJson.getInt(PhaseNo);
}
if (taskJson.has(TaskName)) {
dto.taskName = taskJson.getString(TaskName);
}
// 作業報告詳細リスト
JSONArray taskReportList = taskJson.getJSONArray(TaskReportList);
......
package jp.agentec.abook.abv.bl.acms.client.json;
import org.json.adf.JSONArray;
import org.json.adf.JSONObject;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.dto.TaskDto;
import jp.agentec.abook.abv.bl.dto.TaskReportApprovalDto;
public class ProcessDataJSON extends AcmsCommonJSON {
private static final String ProcessList = "processList";
private static final String PhaseList = "phaseList";
private static final String ApprovalList = "approvalList";
private static final String ProcessKey = "processKey";
private static final String ProcessStatus = "processStatus";
private static final String PhaseNo = "phaseNo";
private static final String PhaseStatus = "phaseStatus";
private static final String ApprovalGroupId = "approvalGroupId";
private static final String ApprovalGroupName = "approvalGroupName";
private static final String ApprovalName = "approvalName";
private static final String ApprovalNo = "approvalNo";
private static final String Comment = "comment";
private static final String SendbackPhaseNo = "sendbackPhaseNo";
private static final String Signature = "signature";
private static final String Status = "status";
public List<TaskDto> taskDtoList;
public ProcessDataJSON(String jsonString) throws AcmsException {
super(jsonString);
}
@Override
protected void parse(JSONObject json) {
taskDtoList = new ArrayList<TaskDto>();
if (json.has(ProcessList)) {
JSONArray taskList = json.getJSONArray(ProcessList);
for (int i = 0; i < taskList.length(); i++) {
JSONObject taskJson = taskList.getJSONObject(i);
TaskDto taskDto = new TaskDto();
taskDto.processKey = taskJson.getString(ProcessKey);
taskDto.processStatus = taskJson.getInt(ProcessStatus);
if (!taskJson.has(PhaseList)) {
continue;
}
JSONArray phaseList = taskJson.getJSONArray(PhaseList);
taskDto.phaseList = new ArrayList<TaskDto>();
for (int j = 0; j < phaseList.length(); j++) {
JSONObject phaseJson = phaseList.getJSONObject(j);
TaskDto phaseTaskDto = new TaskDto();
phaseTaskDto.phaseNo = phaseJson.getInt(PhaseNo);
phaseTaskDto.phaseStatus = phaseJson.getInt(PhaseStatus);
if (!phaseJson.has(ApprovalList)) {
continue;
}
JSONArray approvalList = phaseJson.getJSONArray(ApprovalList);
phaseTaskDto.taskReportApprovalDtoList = new ArrayList<TaskReportApprovalDto>();
for (int k = 0; k < approvalList.length(); k++) {
JSONObject approvalJson = approvalList.getJSONObject(k);
TaskReportApprovalDto taskReportApprovalDto = new TaskReportApprovalDto();
taskReportApprovalDto.approvalGroupId = approvalJson.getInt(ApprovalGroupId);
taskReportApprovalDto.approvalGroupName = approvalJson.getString(ApprovalGroupName);
taskReportApprovalDto.approvalName = approvalJson.getString(ApprovalName);
taskReportApprovalDto.approvalNo = approvalJson.getInt(ApprovalNo);
taskReportApprovalDto.comment = approvalJson.getString(Comment);
taskReportApprovalDto.sendbackPhaseNo = approvalJson.getInt(SendbackPhaseNo);
taskReportApprovalDto.signature = approvalJson.getString(Signature);
taskReportApprovalDto.status = approvalJson.getInt(Status);
phaseTaskDto.taskReportApprovalDtoList.add(taskReportApprovalDto);
}
taskDto.phaseList.add(phaseTaskDto);
}
taskDtoList.add(taskDto);
}
}
}
}
......@@ -160,6 +160,8 @@ public class AcmsApis {
public static final String ApiQuickReportSearch = "quickReportSearch";
// 簡易帳票リビジョン一覧取得
public static final String ApiQuickReportRevision = "quickReportRevision";
// 連続作業の承認情報取得
public static final String ApiGetProcessData = "getProcessData";
// チャット
public static final String ChatApiUrlFormat = "%s/%s/chatapi/%s/";
......@@ -208,7 +210,8 @@ public class AcmsApis {
} else if (methodName.equals(ApiOperationList) || methodName.equals(ApiWorkingGroupList) || methodName.equals(ApiSendTaskData) || methodName.equals(ApiGetOperationData) ||
methodName.equals(ApiGetTaskFile) || methodName.equals(ApiSceneEntry) || methodName.equals(ApiTaskContentEntry) ||
methodName.equals(ApiSendPushMessage) || methodName.equals(ApiGetPushMessages) || methodName.equals(ApiSendRoutineTaskData) ||
methodName.equals(ApiOperationGroupMaster) || methodName.equals(ApiGetApertureMasterData) || methodName.equals(ApiQuickReportSearch) || methodName.equals(ApiQuickReportRevision)) {
methodName.equals(ApiOperationGroupMaster) || methodName.equals(ApiGetApertureMasterData) || methodName.equals(ApiQuickReportSearch) || methodName.equals(ApiQuickReportRevision)
|| methodName.equals(ApiGetProcessData)) {
apiValue = Constant.ApiValue.checkapi;
} else if (methodName.equals(ApiGetChatPushData)) { // pushActionはchatapiを指定
apiValue = Constant.ApiValue.chatapi;
......
......@@ -118,18 +118,23 @@ public class ABVEnvironment {
public static final String TaskPdfDirFormat = "%s/taskPdf";
public static final String TaskPdfFileFormat = "%s/taskPdf.zip";
public static final String TaskListDirFormat = "%s/taskList";
public static final String ProcessListDirFormat = "%s/processList";
public static final String TaskListFileFormat = "%s/taskList.zip";
public static final String ProcessListFileFormat = "%s/processList.zip";
public static final String OzdDirectoryFormat = "%s/ABook/contents/ozd/%d";
public static final String OperationDirectionOrReportDirFormat = OperationDirFormat + "/%s/%s";
public static final String OperationDirectionOrContinuousReportDirFormat = OperationDirectionOrReportDirFormat + "/%s/%s";
public static final String CacheTempFormat = "%s/temp";
public static final String TempTaskDirFormat = "%s/%d/temp";
public static final String TempTaskKeyDirFormat = TempTaskDirFormat + "/%s";
public static final String DefaultOzFileFormat = ContentCacheDirectoryFormat + "/%s";
public static final String ContinuousTaskDefaultOzFileFormat = ContentCacheDirectoryFormat + "/processList/phaseList/phase_%s/%s";
public static final String TempTaskFileFormat = TempTaskKeyDirFormat + "/%s";
public static final String AttachedMoviesDirFormat = "%s/%d/attachedMovie";
public static final String AttachedMoviesTaskTypeDir = AttachedMoviesDirFormat + "/%s/%s";
public static final String AttachedMoviesTaskTypeDirContinuousReport = AttachedMoviesTaskTypeDir + "/%s/%s";
public static final String AttachedMoviesRoutineTaskTypeDir = AttachedMoviesDirFormat + "/%s/%s/%d/%s";
public static final String CacheTempAttachedImageFormat = "%s/temp/attachedImage";
......@@ -139,9 +144,12 @@ public class ABVEnvironment {
public static final String TaskReportLevelDir = "/%s";
public static final String SavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir;
public static final String RoutineTaskSavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir + "/%s/%s";
public static final String ContinuousTaskSavedOzFileFormat = OperationDirectionOrContinuousReportDirFormat + TaskReportLevelDir;
public static final String OperationTaskKeyReportSendDirFormat = OperationTaskKeyDirFormat + "/reportSend/%d";
public static final String OperationTaskKeyContinuousReportSendDirFormat = OperationTaskKeyReportSendDirFormat + "/%s/%d";
public static final String OperationTaskKeyRoutineTaskReportDirFormat = OperationTaskKeyDirFormat + "/%d/%s/%s";
// #32926 作業報告画面改善 end
public static final String ContinuousTaskReportJsonDirFormat = ContentCacheDirectoryFormat + "/processList/phaseList/phase_%d";
/**
* コンテンツのファイルを暗号化するときに、暗号化するサイズをバイト単位で指定します。
......@@ -608,10 +616,28 @@ public class ABVEnvironment {
return String.format(TaskListDirFormat, contentDirectory);
}
/**
* リスト形式のIndex.htmlファイルパス(連続作業用)
* @param contentDirectory コンテンツリソースパス
* @return Index.htmlファイルパス
*/
public String getProcessListDirName(String contentDirectory) {
return String.format(ProcessListDirFormat, contentDirectory);
}
public String getTaskListName(String contentDirectory) {
return String.format(TaskListFileFormat, contentDirectory);
}
/**
* processList.zipファイルパスを返す
* @param contentDirectory
* @return processList.zipファイルパス
*/
public String getProcessListName(String contentDirectory) {
return String.format(ProcessListFileFormat, contentDirectory);
}
public String getOperationDirFile(long operationId) {
return String.format(OperationDirFormat, rootDirectory, operationId);
}
......@@ -628,6 +654,19 @@ public class ABVEnvironment {
public String getSavedOzFileTaskReportLevelPath(long operationId, String taskKey, String fileName, String taskReportLevel) {
return String.format(SavedOzFileFormat, rootDirectory, operationId, taskKey, taskReportLevel, fileName);
}
/**
* 保存されたOZファイルパス(連続作業用)
* @param operationId
* @param taskKey
* @param fileName
* @param taskReportLevel
* @return ファイルパス
*/
public String getSavedOzFileTaskReportLevelPath(long operationId, String taskKey, String fileName, String taskReportLevel, String processKey, Integer phaseNo) {
return String.format(ContinuousTaskSavedOzFileFormat, rootDirectory, operationId, taskKey, taskReportLevel, processKey, phaseNo, fileName);
}
// #32926 作業報告画面改善 end
/**
......@@ -655,6 +694,17 @@ public class ABVEnvironment {
return String.format(DefaultOzFileFormat, cacheDirectory, contentId, fileName);
}
/**
* テンプレートOZファイルパス(連続作業用)
* @param contentId
* @param phaseNo
* @param fileName
* @return ファイルパス
*/
public String getContinuousTaskDefaultOzFilePath(long contentId, Integer phaseNo, String fileName) {
return String.format(ContinuousTaskDefaultOzFileFormat, cacheDirectory, contentId, String.valueOf(phaseNo), fileName);
}
/**
* 臨時保存したファイルパス
* @param contentId
......@@ -712,6 +762,19 @@ public class ABVEnvironment {
return String.format(OperationTaskKeyReportSendDirFormat, rootDirectory, operationId, taskKey, taskReportSendId);
}
/**
* 報告送信ディレクトリパス(連続作業用)
* 例)root/files/ABook/operation/[operation_id]/[task_key]/reportSend/{taskReportSendId}/{processKey}/{phaseNo}
* @param operationId
* @param taskKey
* @param taskReportSendId
* @return
*/
// taskReportLevelの値によってディレクトリを構成
public String getOperationContinuousTaskReportSendDirFilePath(long operationId, String taskKey, int taskReportSendId, String processKey, Integer phaseNo) {
return String.format(OperationTaskKeyContinuousReportSendDirFormat, rootDirectory, operationId, taskKey, taskReportSendId, processKey, phaseNo);
}
/**
* 定期点検で添付ファイルのパス
......@@ -727,15 +790,17 @@ public class ABVEnvironment {
}
/**
* 添付ファイル管理パス
* 例)root/files/ABook/operation/[operation_id]/[task_key]/{task_report_level}
* @param operationId
* @param taskKey
* @param taskReportLevel
* @return
* 添付ファイル管理パス(連続作業用)
* 例)root/files/ABook/operation/[operation_id]/[task_key]/{task_report_level}/{processKey}/{phaseNo}
* @param operationId 作業ID
* @param taskKey タスクキー
* @param taskReportLevel 報告レベル
* @param processKey 工程キー
* @param phaseNo 工程NO
* @return 添付ファイル保存場所
*/
public String getOperationDirectionOrReportDirPath(long operationId, String taskKey, int taskReportLevel) {
return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel));
public String getOperationDirectionOrContinuousReportDirPath(long operationId, String taskKey, int taskReportLevel, String processKey, Integer phaseNo) {
return String.format(OperationDirectionOrContinuousReportDirFormat, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel), processKey, String.valueOf(phaseNo));
}
/**
......@@ -766,6 +831,20 @@ public class ABVEnvironment {
public String getAttachedDirectionOrReportDirPath(long contentId, String taskKey, int taskReportLevel) {
return String.format(AttachedMoviesTaskTypeDir, cacheDirectory, contentId, taskKey, String.valueOf(taskReportLevel));
}
/**
* 添付動画ファイルパス(連続作業用)
* @param contentId コンテンツID
* @param taskKey タスクキー
* @param taskReportLevel 報告レベル
* @param processKey 工程キー
* @param phaseNo 工程番号
* @return
*/
public String getAttachedDirectionOrReportDirPath(long contentId, String taskKey, int taskReportLevel, String processKey, Integer phaseNo) {
return String.format(AttachedMoviesTaskTypeDirContinuousReport, cacheDirectory, contentId, taskKey, String.valueOf(taskReportLevel), processKey, String.valueOf(phaseNo));
}
// #32926 作業報告画面改善 end
/**
......@@ -784,6 +863,15 @@ public class ABVEnvironment {
return String.format(CacheTempAttachedImageFormat, cacheDirectory);
}
/**
* 連続作業用taskReport.json保存場所
* @param contentId コンテンツID
* @param phaseNo 工程番号
* @return taskReport.json保存パス
*/
public String getContinuousReportDirectoryPath (long contentId, Integer phaseNo) {
return String.format(ContinuousTaskReportJsonDirFormat, cacheDirectory, contentId, phaseNo);
}
private String getReportDate(String reportDate) {
if (reportDate.length() > 12) {
return reportDate.substring(0, 12);
......
......@@ -23,6 +23,7 @@ public class ABookKeys {
public static final String CMD_INSERT_TASK_REPORT = "insertTaskReport";
public static final String CMD_UPDATE_TASK_REPORT = "updateTaskReport";
public static final String CMD_DELETE_TASK_REPORT = "deleteTaskReport";
public static final String CMD_DELETE_PROCESS = "deleteProcess";
public static final String CMD_CANCEL_TASK_REPORT = "cancelTaskReport";
public static final String CMD_SHOW_REPORT_OZD = "showReportOzd";
public static final String CMD_PREVIEW_REPORT_OZD = "previewReportOzd";
......@@ -40,6 +41,7 @@ public class ABookKeys {
public static final String STATUS_CODE = "statusCode";
public static final String TASK_KEY = "taskKey";
public static final String TASK_CODE = "taskCode";
public static final String TASK_NAME = "taskName";
public static final String REPORT_FILE_NAME = "fileName";
public static final String READ_ONLY_FLG = "readOnlyFlg";
public static final String DIRECTION_FLG = "directionFlg";
......@@ -136,4 +138,22 @@ public class ABookKeys {
public static final String THETA_THUMBNAIL = "THUMBNAIL";
public static final String THETA_OLD_VERSION_FLG = "thetaOldVersionFlg"; //true:API2.0利用、false:API2.1利用
public static final String THETA_LIST_ACTIVITY_FLG = "thetaListActivityFlg";
//連続作業
public static final String PROCESS_KEY = "processKey";
public static final String PROCESS_STATUS = "processStatus";
public static final String PHASE_NO = "phaseNo";
public static final String PHASE_STAUTS = "phaseStatus";
public static final String COMMENT = "comment";
public static final String SIGNATURE = "signature";
public static final String APPROVAL_NO = "approvalNo";
public static final String APPROVAL_NANME = "approvalName";
public static final String SEND_BACK_PHASE_NO = "sendbackPhaseNo";
public static final String APPROVAL_GROUP_NAME = "approvalGroupName";
public static final String APPROVAL_GROUP_ID = "approvalGroupId";
public static final String STATUS = "status";
public static final String APPROVAL_LIST = "approvalList";
public static final String PHASE_LIST = "phaseList";
public static final String PROCESS_LIST = "processList";
}
......@@ -39,6 +39,7 @@ import jp.agentec.abook.abv.bl.data.tables.TOperation;
import jp.agentec.abook.abv.bl.data.tables.TPushMessage;
import jp.agentec.abook.abv.bl.data.tables.TTask;
import jp.agentec.abook.abv.bl.data.tables.TTaskReport;
import jp.agentec.abook.abv.bl.data.tables.TTaskReportApproval;
import jp.agentec.abook.abv.bl.data.tables.TTaskReportItems;
import jp.agentec.abook.abv.bl.data.tables.TTaskReportSend;
import jp.agentec.adf.util.StringUtil;
......@@ -98,7 +99,7 @@ public class ABVDataOpenHelper {
iTableScripts.add(new TPushMessage());
iTableScripts.add(new MOperationGroupMaster());
iTableScripts.add(new ROperationGroupMasterOperation());
iTableScripts.add(new TTaskReportApproval());
return iTableScripts;
}
......
......@@ -19,7 +19,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
public class DBConnector {
private static volatile DBConnector dbConnector = null;
public static final String DatabaseName = "ABVJE";
public static final int DatabaseVersion = DatabaseVersions.Ver1_2_3;
public static final int DatabaseVersion = DatabaseVersions.Ver1_2_360;
protected SQLiteDatabase db = null;
......
......@@ -6,5 +6,7 @@ public class DatabaseVersions {
public static final int Ver1_1_0 = 11;
public static final int Ver1_2_0 = 21;
public static final int Ver1_2_3 = 22;
//連続作業機能追加
public static final int Ver1_2_360 = 23;
}
......@@ -52,6 +52,26 @@ public class TaskDao extends AbstractDao {
if (column != -1) {
dto.taskHasAuthority = toBool(cursor.getInt(column));
}
column = cursor.getColumnIndex("task_name");
if (column != -1) {
dto.taskName = cursor.getString(column);
}
column = cursor.getColumnIndex("phase_no");
if (column != -1) {
dto.phaseNo = cursor.getInt(column);
}
column = cursor.getColumnIndex("phase_status");
if (column != -1) {
dto.phaseStatus = cursor.getInt(column);
}
column = cursor.getColumnIndex("process_status");
if (column != -1) {
dto.processStatus = cursor.getInt(column);
}
column = cursor.getColumnIndex("process_key");
if (column != -1) {
dto.processKey = cursor.getString(column);
}
return dto;
}
......@@ -60,6 +80,15 @@ public class TaskDao extends AbstractDao {
return rawQueryGetDtoList("select * from t_task where operation_id = ? and del_flg = 0 ", new String[]{"" + operationId}, TaskDto.class);
}
public List<TaskDto> selectTaskGroupByProcessKeyByOperationId(Long operationId) {
return rawQueryGetDtoList("select *, min(phase_no) as min_phase_no from t_task where operation_id = ? and del_flg = 0 group by process_key order by rowid asc", new String[]{"" + operationId}, TaskDto.class);
}
public List<TaskDto> selectTaskByOperationIdOrderByPhaseNo(Long operationId) {
return rawQueryGetDtoList("select * from t_task where operation_id = ? and del_flg = 0 order by processKey asc, phaseNo asc", new String[]{"" + operationId}, TaskDto.class);
}
public List<TaskDto> selectAllTaskByOperationId(Long operationId) {
return rawQueryGetDtoList("select * from t_task where operation_id = ? ", new String[]{"" + operationId}, TaskDto.class);
}
......@@ -68,6 +97,14 @@ public class TaskDao extends AbstractDao {
return rawQueryGetDto("select * from t_task where task_key=?", new String[]{"" + taskKey}, TaskDto.class);
}
public List<TaskDto> getTaskByProcessKey(String processKey) {
return rawQueryGetDtoList("select * from t_task where process_key = ?", new String[]{processKey}, TaskDto.class);
}
public TaskDto getTaskByProcessKey(String processKey, Integer phaseNo) {
return rawQueryGetDto("select * from t_task where process_key = ? and phase_no = ?", new String[]{"" + processKey, "" + phaseNo}, TaskDto.class);
}
public void insert(TaskDto dto) {
insert("insert into t_task "
+ "(task_key, "
......@@ -75,9 +112,14 @@ public class TaskDao extends AbstractDao {
+ "operation_id, "
+ "task_code, "
+ "task_status, "
+ "task_hotspot_info) "
+ "task_hotspot_info, "
+ "task_name, "
+ "phase_no, "
+ "phase_status, "
+ "process_status, "
+ "process_key) "
+ "values "
+ "(?,?,?,?,?,?)",
+ "(?,?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues());
}
......@@ -89,12 +131,28 @@ public class TaskDao extends AbstractDao {
+ "task_code=?, "
+ "task_status=?, "
+ "task_hotspot_info=?, "
+ "del_flg=? "
+ "del_flg=?, "
+ "task_name=?, "
+ "phase_no=?, "
+ "phase_status=?, "
+ "process_status=?, "
+ "process_key=? "
+ "where task_key=?",
dto.getUpdateValues());
return count > 0;
}
public boolean updateStatus(String processKey, Integer phaseNo, Integer processStatus, Integer phaseStatus) {
long count = update("update t_task "
+ "set "
+ "process_status=?, "
+ "phase_status=? "
+ "where process_key=? "
+ "and phase_no=?",
new String[]{"" + processStatus, "" + phaseStatus, processKey, "" + phaseNo});
return count > 0;
}
/**
* 作業削除
* @param taskKey
......@@ -105,6 +163,7 @@ public class TaskDao extends AbstractDao {
delete("t_task_report", "task_key=?", keyValues);
delete("t_task_report_items", "task_key=?", keyValues);
delete("t_task_report_send", "task_key=?", keyValues);
delete("t_task_report_approval", "task_key=?", keyValues);
}
/**
......
package jp.agentec.abook.abv.bl.data.dao;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.dto.TaskReportApprovalDto;
public class TaskReportApprovalDao extends AbstractDao {
private static final String TAG = "TaskReportApprovalDao";
/*package*/ TaskReportApprovalDao() {
}
@Override
protected TaskReportApprovalDto convert(Cursor cursor) {
TaskReportApprovalDto dto = new TaskReportApprovalDto();
int column = cursor.getColumnIndex("process_key");
if (column != -1) {
dto.processKey = cursor.getString(column);
}
column = cursor.getColumnIndex("phase_no");
if (column != -1) {
dto.phaseNo = cursor.getInt(column);
}
column = cursor.getColumnIndex("approval_group_id");
if (column != -1) {
dto.approvalGroupId = cursor.getInt(column);
}
column = cursor.getColumnIndex("approval_group_name");
if (column != -1) {
dto.approvalGroupName = cursor.getString(column);
}
column = cursor.getColumnIndex("approval_name");
if (column != -1) {
dto.approvalName = cursor.getString(column);
}
column = cursor.getColumnIndex("approval_no");
if (column != -1) {
dto.approvalNo = cursor.getInt(column);
}
column = cursor.getColumnIndex("comment");
if (column != -1) {
dto.comment = cursor.getString(column);
}
column = cursor.getColumnIndex("sendback_phase_no");
if (column != -1) {
dto.sendbackPhaseNo = cursor.getInt(column);
}
column = cursor.getColumnIndex("signature");
if (column != -1) {
dto.signature = cursor.getString(column);
}
column = cursor.getColumnIndex("status");
if (column != -1) {
dto.status = cursor.getInt(column);
}
return dto;
}
public List<TaskReportApprovalDto> selectTaskReportApprovalByProcessKey(String processKey, Integer phaseNo) {
return rawQueryGetDtoList("select * from t_task_report_approval where process_key = ? and phase_no = ? order by approval_no asc", new String[]{processKey, "" + phaseNo}, TaskReportApprovalDto.class);
}
public TaskReportApprovalDto selectTaskReportApprovalByProcessKey(String processKey, Integer phaseNo, Integer approval_no) {
return rawQueryGetDto("select * from t_task_report_approval where process_key = ? and phase_no = ? and approval_no = ? ", new String[]{processKey, "" + phaseNo,"" + approval_no}, TaskReportApprovalDto.class);
}
public void insert(TaskReportApprovalDto dto) {
insert("insert into t_task_report_approval "
+ "(process_key, "
+ "phase_no, "
+ "approval_group_id, "
+ "approval_group_name, "
+ "approval_name, "
+ "approval_no, "
+ "comment, "
+ "sendback_phase_no, "
+ "signature, "
+ "status) "
+ "values "
+ "(?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues());
}
public boolean update(TaskReportApprovalDto dto) {
long count = update("update t_task_report_approval "
+ "set "
+ "approval_group_id=?, "
+ "approval_group_name=?, "
+ "approval_name=?, "
+ "approval_no=?, "
+ "comment=?, "
+ "sendback_phase_no=?, "
+ "signature=?, "
+ "status=? "
+ "where process_key=? "
+ "and phase_no=? ",
dto.getUpdateValues());
return count > 0;
}
}
......@@ -37,6 +37,10 @@ public class TaskReportItemsDao extends AbstractDao {
dto.inputValue = cursor.getString(column);
}
column = cursor.getColumnIndex("phase_no");
if (column != -1) {
dto.phaseNo = cursor.getInt(column);
}
return dto;
}
......@@ -61,7 +65,7 @@ public class TaskReportItemsDao extends AbstractDao {
public List<TaskReportItemsDto> getTaskReportItemByOperationId(Long operationId) {
StringBuilder sb = new StringBuilder();
sb.append(" select distinct ttri.* ");
sb.append(" select distinct ttri.* ,tt.phase_no");
sb.append(" from t_task_report_items ttri ");
sb.append(" inner join ");
sb.append(" t_task tt ");
......
......@@ -30,6 +30,11 @@ public class TTask extends SQLiteTableScript {
sql.append(" , task_hotspot_info TEXT ");
sql.append(" , del_flg BOOLEAN DEFAULT 0 ");
sql.append(" , hotspot_changed_flg BOOLEAN DEFAULT 0 ");
sql.append(" , phase_no SMALLINT DEFAULT 0 ");
sql.append(" , phase_status SMALLINT DEFAULT 1 ");
sql.append(" , process_key TEXT ");
sql.append(" , process_status SMALLINT DEFAULT 0 ");
sql.append(" , task_name TEXT ");
sql.append(" , PRIMARY KEY (task_key) ");
sql.append(" ) ");
ddl.add(sql.toString());
......@@ -40,7 +45,16 @@ public class TTask extends SQLiteTableScript {
@Override
public List<String> getUpgradeScript(int oldVersion, int newVersion) {
return null;
List<String> ddl = new ArrayList<String>();
if (oldVersion < DatabaseVersions.Ver1_2_360) {
ddl.add("ALTER TABLE t_task ADD COLUMN phase_no SMALLINT DEFAULT 0 ");
//ローカル保存時、次の作業を活性化するため、初回保存時には作業中(1)に設定
ddl.add("ALTER TABLE t_task ADD COLUMN phase_status SMALLINT DEFAULT 1 ");
ddl.add("ALTER TABLE t_task ADD COLUMN process_key TEXT ");
ddl.add("ALTER TABLE t_task ADD COLUMN process_status SMALLINT DEFAULT 0 ");
ddl.add("ALTER TABLE t_task ADD COLUMN task_name TEXT ");
}
return ddl;
}
@Override
......
package jp.agentec.abook.abv.bl.data.tables;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
/**
* 報告承認情報テーブル(連続作業のみ利用)
* @author jinsung kim
* @version 1.2.360
* @since 2020/10/05
*/
public class TTaskReportApproval extends SQLiteTableScript {
public TTaskReportApproval() {
super();
}
@Override
public List<String> getCreateScript(int version) {
List<String> ddl = new ArrayList<String>();
StringBuffer sql = new StringBuffer();
sql.append(" CREATE TABLE t_task_report_approval ( ");
sql.append(" process_key TEXT NOT NULL ");
sql.append(" , phase_no SMALLINT DEFAULT 0 ");
sql.append(" , approval_group_id INTEGER DEFAULT 0 ");
sql.append(" , approval_group_name TEXT ");
sql.append(" , approval_name TEXT ");
sql.append(" , approval_no INTEGER DEFAULT 0 ");
sql.append(" , comment TEXT ");
sql.append(" , sendback_phase_no SMALLINT DEFAULT 0 ");
sql.append(" , signature TEXT ");
sql.append(" , status SMALLINT DEFAULT 0 ");
sql.append(" ) ");
ddl.add(sql.toString());
return ddl;
}
@Override
public List<String> getUpgradeScript(int oldVersion, int newVersion) {
return null;
}
@Override
public List<String> getMigrationScript(SQLiteDatabase databaseConnection, int oldVersion, int newVersion, Object[] params) {
return null;
}
}
......@@ -165,7 +165,31 @@ public class ContentFileExtractor {
}
}
}
File processListFile = new File(ABVEnvironment.getInstance().getProcessListName(contentPath));
if (processListFile.exists()) {
// processList.zipを解凍して、中身のzipを確認する
String processListDirPath = ABVEnvironment.getInstance().getProcessListDirName(contentPath);
extractZipFile(contentId, processListFile.getPath(), processListDirPath);
String phaseListDirPath = processListDirPath + "/phaseList";
//processList/phaseList/phase_1/taskReport_0.zip
File phaseListFile = new File(phaseListDirPath);
File[] phaseListFiles = phaseListFile.listFiles();
if (phaseListFiles != null) {
for (File phaseFile : phaseListFiles) {
String reportFilePath = phaseFile.getPath();
File reportFile = new File(reportFilePath);
File[] reportZipFiles = reportFile.listFiles(fileFilter);
if (reportZipFiles != null) {
for (File reportZipFile : reportZipFiles) {
String taskRportPath = reportZipFile.getPath().replace(".zip", "");
extractZipFile(contentId, reportZipFile.getPath(), taskRportPath);
}
}
}
}
}
// それ以外のzip
ContentDto contentDto = contentDao.getContent(contentId);
......
......@@ -14,7 +14,14 @@ public class TaskDto extends AbstractDto {
public String taskCode;
public Integer taskStatus;
public String taskHotSpotInfo;
public String taskName;
public Integer phaseNo;
public Integer phaseStatus;
public Integer processStatus;
public String processKey;
public List<TaskReportDto> taskReportDtoList;
public List<TaskReportApprovalDto> taskReportApprovalDtoList;
public List<TaskDto> phaseList;
public boolean delFlg;
public int taskReportId;
......@@ -23,12 +30,12 @@ public class TaskDto extends AbstractDto {
@Override
public Object[] getInsertValues() {
return new Object[] { taskKey, taskId, operationId, taskCode, taskStatus, taskHotSpotInfo };
return new Object[] { taskKey, taskId, operationId, taskCode, taskStatus, taskHotSpotInfo, taskName, phaseNo, phaseStatus, processStatus, processKey};
}
@Override
public Object[] getUpdateValues() {
return new Object[] { taskId, operationId, taskCode, taskStatus, taskHotSpotInfo, delFlg, taskKey };
return new Object[] { taskId, operationId, taskCode, taskStatus, taskHotSpotInfo, delFlg, taskName, phaseNo, phaseStatus, processStatus, processKey, taskKey};
}
@Override
......
package jp.agentec.abook.abv.bl.dto;
import java.util.List;
public class TaskReportApprovalDto extends AbstractDto {
public String processKey;
public Integer phaseNo;
public Integer approvalGroupId;
public String approvalGroupName;
public String approvalName;
public Integer approvalNo;
public String comment;
public Integer sendbackPhaseNo;
public String signature;
public Integer status;
@Override
public Object[] getInsertValues() {
return new Object[] { processKey, phaseNo, approvalGroupId, approvalGroupName, approvalName, approvalNo, comment, sendbackPhaseNo, signature, status};
}
@Override
public Object[] getUpdateValues() {
return new Object[] { approvalGroupId, approvalGroupName, approvalName, approvalNo, comment, sendbackPhaseNo, signature, status, processKey, phaseNo};
}
@Override
public String[] getKeyValues() {
return new String[] { "" + processKey, "" + phaseNo };
}
}
......@@ -10,7 +10,7 @@ public class TaskReportItemsDto extends AbstractDto {
public int taskReportLevel;
public String itemKey;
public String inputValue;
public Integer phaseNo;
@Override
public String[] getKeyValues() {
return new String[] {""+taskKey};
......
......@@ -53,7 +53,15 @@ public class ApertureMasterDataLogic extends AbstractLogic {
createApertureMasterDataJson(masterDataJson.apertureData);
// updateApertureMasterDataJson(masterDataJson.apertureData);
}
} else {
//jsonファイルがないとjavascriptエラー発生するので、空のjsonファイルを作成
String masterDataJsonPath = ABVEnvironment.getInstance().getMasterFilePath() + File.separator + ABVEnvironment.getInstance().ApertureMasterDataFileName;
File file = new File(masterDataJsonPath);
if (!file.exists()) {
createApertureMasterDataJson(masterDataJson.apertureData);
}
}
} catch (Exception e) {
Logger.e(TAG, "apertureMasterDataSend error : ", e);
}
......
......@@ -655,7 +655,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
fl = (RelativeLayout) findViewById(R.id.frameTopbar);
}
fl.setBackgroundColor(getResources().getColor(R.color.operation_color));
operationHomeButton = (Button) findViewById(R.id.btn_operation_home);
operationHomeButton.setOnClickListener(new View.OnClickListener() {
@Override
......@@ -690,6 +689,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
String cacheDirPath = ABVEnvironment.getInstance().getContentCacheDirectoryPath(getContentId());
if (operationDto.operationType == OperationType.LIST) {
mContentPath = ABVEnvironment.getInstance().getTaskListDirName(cacheDirPath);
if (operationDto.reportType == Constant.ReportType.ReportContinuous) {
mContentPath = ABVEnvironment.getInstance().getProcessListDirName(cacheDirPath);
}
} else if (operationDto.operationType == OperationType.PDF) {
mContentPath = ABVEnvironment.getInstance().getTaskPdfDirName(cacheDirPath);
} else {
......@@ -900,6 +902,16 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
reportStartDate = abookCheckParam.get(ABookKeys.REPORT_START_DATE);
}
//連続作業用
String processKey = null;
Integer phaseNo = 0;
if (abookCheckParam.containsKey(ABookKeys.PROCESS_KEY)) {
processKey = abookCheckParam.get(ABookKeys.PROCESS_KEY);
}
if (abookCheckParam.containsKey(ABookKeys.PHASE_NO)) {
phaseNo = Integer.parseInt(abookCheckParam.get(ABookKeys.PHASE_NO));
}
if (StringUtil.equalsAny(mCmd, 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, ABookKeys.CMD_CHANGE_TASK_REPORT)) {
......@@ -1028,11 +1040,11 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (abookCheckParam.containsKey(ABookKeys.LOCAL_SAVE)) {
mLocalSave = Integer.parseInt(abookCheckParam.get(ABookKeys.LOCAL_SAVE)) > 0 ? true : false;
}
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, false, taskReportId, reportStartDate, mReportFileName, mLocalSave, mAddReport, taskReportLevel);
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, false, taskReportId, reportStartDate, mReportFileName, mLocalSave, mAddReport, taskReportLevel, processKey, phaseNo);
} else if (mCmd.equals(ABookKeys.CMD_PREVIEW_REPORT_OZD)) {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
// 作業報告画面改善
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, taskReportId, reportStartDate, mReportFileName, false, true, taskReportLevel);
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, taskReportId, reportStartDate, mReportFileName, false, true, taskReportLevel, processKey, phaseNo);
} else if (mCmd.equals(ABookKeys.CMD_CONTENT_EDIT_CLOSE)) {
showProgressPopup();
handler.postDelayed(new Runnable() {
......
......@@ -732,6 +732,9 @@ public class OperationListActivity extends ABVUIActivity {
String contentPath;
if (operationDto.operationType == OperationType.LIST) {
contentPath = ABVEnvironment.getInstance().getTaskListDirName(ContentFileExtractor.getInstance().getContentCacheDirWithExtract(operationDto.contentId));
if (operationDto.reportType == ReportType.ReportContinuous) {
contentPath = ABVEnvironment.getInstance().getProcessListDirName(ContentFileExtractor.getInstance().getContentCacheDirWithExtract(operationDto.contentId));
}
} else if (operationDto.operationType == OperationType.PDF) {
contentPath = ABVEnvironment.getInstance().getTaskPdfDirName(ContentFileExtractor.getInstance().getContentCacheDirWithExtract(operationDto.contentId));
} else {
......@@ -869,6 +872,13 @@ public class OperationListActivity extends ABVUIActivity {
progressDialogHorizontal.setProgress(60);
// 報告受信
mOperationLastEditDate = receptionTaskData(operationId, progressCallback, errorMsg);
//連続作業のみ承認データ取得
if (reportType == ReportType.ReportContinuous) {
mOperationLogic.getProcessData(operationId);
}
// mOperationLastEditDateがnullの場合、エラーと見做す
if (mOperationLastEditDate != null && reportType == ReportType.RoutineTask) {
if (buttonEventFlag) {
......@@ -914,9 +924,11 @@ public class OperationListActivity extends ABVUIActivity {
errorMsg.append(ErrorMessage.getErrorMessage(this, ErrorMessage.getErrorCode(e)));
break;
}
mOperationLastEditDate = null;
} catch (Exception e) {
Logger.e(TAG, e);
errorMsg.append(ErrorMessage.getErrorMessage(this, ABVExceptionCode.C_E_SYSTEM_0001));
mOperationLastEditDate = null;
} finally {
handler.post(new Runnable() {
@Override
......@@ -1074,7 +1086,7 @@ public class OperationListActivity extends ABVUIActivity {
JSONObject taskReportJson = null;
// 添付ファイルが存在する場合、取得して解凍する。
try {
refreshTaskFile(operationId, serverTaskReportDto.taskReportLevel, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, serverTaskReportDto.attachedFileName);
refreshTaskFile(operationId, serverTaskReportDto.taskReportLevel, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, serverTaskReportDto.attachedFileName, serverTaskDto.processKey, serverTaskDto.phaseNo);
} catch (Exception e) {
Logger.e(TAG, e);
// リソースパターンの適用
......@@ -1091,13 +1103,13 @@ public class OperationListActivity extends ABVUIActivity {
// 登録
mOperationLogic.insertTaskReport(serverTaskDto.taskKey, operationId, operationContentDto.contentId,
serverTaskReportDto.taskReportLevel, serverTaskReportDto.enableReport,
taskReportJson, attachedFileName, false, false, false);
taskReportJson, attachedFileName, false, false, false, serverTaskDto.processKey, serverTaskDto.phaseNo);
} else {
// 更新
// jsonDataが空で入る場合、taskReportJsonをnullで登録
mOperationLogic.updateTaskReport(serverTaskDto.taskKey, operationId, operationContentDto.contentId,
serverTaskReportDto.taskReportLevel, serverTaskReportDto.enableReport,
taskReportJson, attachedFileName, false, false, localTaskReportDto.localSavedFlg);
taskReportJson, attachedFileName, false, false, localTaskReportDto.localSavedFlg, serverTaskDto.processKey, serverTaskDto.phaseNo);
}
}
}
......@@ -1126,13 +1138,17 @@ public class OperationListActivity extends ABVUIActivity {
* @param taskId
* @param taskKey
* @param attachedFileName
* @param processKey 固定キー
* @param phaseNo 固定NO
* @throws ABVException
* @throws InterruptedException
* @throws ZipException
* @throws NoSuchAlgorithmException
* @throws IOException
*/
public void refreshTaskFile(final long operationId, final int taskReportLevel, long contentId, final long taskId, final String taskKey, final String attachedFileName) throws Exception {
public void refreshTaskFile(final long operationId, final int taskReportLevel, long contentId,
final long taskId, final String taskKey, final String attachedFileName,
final String processKey, final Integer phaseNo) throws Exception {
// 既存の添付ディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
......@@ -1140,10 +1156,14 @@ public class OperationListActivity extends ABVUIActivity {
if (attachedFileName != null && !attachedFileName.equals(reportLocalAttachedFileName)) {
Logger.i(TAG, "[Get Task Report Files] operationId=%s, taskKey=%s, taskId=%s, attachedFileName=%s", operationId, taskKey, taskId, attachedFileName);
// #32926 start
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel));
String saveAttacedFilePath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel);
if (processKey != null && phaseNo != 0) {
saveAttacedFilePath = ABVEnvironment.getInstance().getOperationDirectionOrContinuousReportDirPath(operationId, taskKey, taskReportLevel, processKey, phaseNo);
}
FileUtil.delete(saveAttacedFilePath);
// #32926 end
String outputFilePath = mOperationLogic.getTaskFile(operationId, taskKey, taskId, attachedFileName, taskReportLevel);
ContentFileExtractor.getInstance().extractZipFile(contentId, outputFilePath, ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel),null, true);
ContentFileExtractor.getInstance().extractZipFile(contentId, outputFilePath, saveAttacedFilePath,null, true);
}
}
......
......@@ -1756,8 +1756,13 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
* @param localSave
* @param addReport
* @param taskReportLevel
* @param processKey
* @param phaseNo
*/
public void startOZViewerActivity(Context context, long operationId, long contentId, String taskKey, boolean isReadOnly, int taskReportId, String reportStartDate, String reportFileName, boolean localSave, boolean addReport, int taskReportLevel) {
public void startOZViewerActivity(Context context, long operationId, long contentId, String taskKey,
boolean isReadOnly, int taskReportId, String reportStartDate,
String reportFileName, boolean localSave, boolean addReport,
int taskReportLevel, String processKey, Integer phaseNo) {
reportStartDate = reportStartDate.replace("T", " ");
String strReportStartDate = DateTimeUtil.toString(DateTimeUtil.toDate(reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen), DateTimeFormat.yyyyMMddHHmm_none);
......@@ -1776,7 +1781,13 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
// #32926 作業報告画面改善 start
intent.putExtra(ABookKeys.TASK_REPORT_LEVEL, taskReportLevel); // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答))
// #32926 作業報告画面改善 end
if (processKey != null) {
intent.putExtra(ABookKeys.PROCESS_KEY, processKey);
}
if (phaseNo != 0) {
intent.putExtra(ABookKeys.PHASE_NO, phaseNo);
}
context.startActivity(intent);
}
......
......@@ -93,7 +93,7 @@ public class OzdFileHelper {
return REPORT_OZD_FILE_NAME;
}
public static final String getOzFilePath(long operationId, long contentId, String taskKey, int taskReportId, String reportStartDate, String reportFileName, int taskReportLevel) {
public static final String getOzFilePath(long operationId, long contentId, String taskKey, int taskReportId, String reportStartDate, String reportFileName, int taskReportLevel, String processKey, Integer phaseNo) {
String ozdFileName = null;
String ozrFileName = null;
......@@ -113,19 +113,27 @@ public class OzdFileHelper {
if (taskReportId > 0 && !StringUtil.isNullOrEmpty(reportStartDate)) {
ozFilePath = ABVEnvironment.getInstance().getRoutineTaskSavedOzFilePath(operationId, taskKey, taskReportId, reportStartDate, ozdFileName.replace("ozr", "ozd"), String.valueOf(taskReportLevel));
} else {
// #32926 作業報告画面改善 start
ozFilePath = ABVEnvironment.getInstance().getSavedOzFileTaskReportLevelPath(operationId, taskKey, ozdFileName.replace("ozr", "ozd"), String.valueOf(taskReportLevel));
// #32926 作業報告画面改善 end
if (processKey != null && phaseNo != 0) {
ozFilePath = ABVEnvironment.getInstance().getSavedOzFileTaskReportLevelPath(operationId, taskKey, ozdFileName.replace("ozr", "ozd"), String.valueOf(taskReportLevel), processKey, phaseNo);
} else {
ozFilePath = ABVEnvironment.getInstance().getSavedOzFileTaskReportLevelPath(operationId, taskKey, ozdFileName.replace("ozr", "ozd"), String.valueOf(taskReportLevel));
}
}
if (FileUtil.exists(ozFilePath)) {
return ozFilePath;
}
ozFilePath = ABVEnvironment.getInstance().getDefaultOzFilePath(contentId, taskKey, ozdFileName);
if (processKey != null && phaseNo != 0) {
ozFilePath = ABVEnvironment.getInstance().getContinuousTaskDefaultOzFilePath(contentId, phaseNo, ozdFileName);
}
if (FileUtil.exists(ozFilePath)) {
return ozFilePath;
} else {
ozFilePath = ABVEnvironment.getInstance().getDefaultOzFilePath(contentId, taskKey, ozrFileName);
if (processKey != null && phaseNo != 0) {
ozFilePath = ABVEnvironment.getInstance().getContinuousTaskDefaultOzFilePath(contentId, phaseNo, ozrFileName);
}
if (FileUtil.exists(ozFilePath)) {
return ozFilePath;
}
......@@ -162,8 +170,19 @@ public class OzdFileHelper {
return FileUtil.move(tempOzdFilePath, ozdFilePath, true);
}
// 削除するOZDファイルがあるかを確認する
public static final boolean checkOzFilePath(long operationId, String taskKey, int taskReportId, String reportStartDate, String reportFileName, int taskReportLevel) {
/**
* 削除するOZDファイルがあるかを確認する
* @param operationId
* @param taskKey
* @param taskReportId
* @param reportStartDate
* @param reportFileName
* @param taskReportLevel
* @param processKey
* @param phaseNo
* @return
*/
public static final boolean checkOzFilePath(long operationId, String taskKey, int taskReportId, String reportStartDate, String reportFileName, int taskReportLevel, String processKey, Integer phaseNo) {
String ozdFileName = null;
if (reportFileName != null) {
......@@ -174,7 +193,12 @@ public class OzdFileHelper {
if (taskReportId > 0 && !StringUtil.isNullOrEmpty(reportStartDate)) {
ozFilePath = ABVEnvironment.getInstance().getRoutineTaskSavedOzFilePath(operationId, taskKey, taskReportId, reportStartDate, ozdFileName, String.valueOf(taskReportLevel));
} else {
ozFilePath = ABVEnvironment.getInstance().getSavedOzFileTaskReportLevelPath(operationId, taskKey, ozdFileName, String.valueOf(taskReportLevel));
if (processKey != null && phaseNo != 0) { //連続作業
ozFilePath = ABVEnvironment.getInstance().getSavedOzFileTaskReportLevelPath(operationId, taskKey, ozdFileName, String.valueOf(taskReportLevel), processKey, phaseNo);
} else {
ozFilePath = ABVEnvironment.getInstance().getSavedOzFileTaskReportLevelPath(operationId, taskKey, ozdFileName, String.valueOf(taskReportLevel));
}
}
if (FileUtil.exists(ozFilePath)) {
return true;
......
......@@ -81,7 +81,8 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
boolean mIsOzFilePath; // 削除処理のフラグ
boolean mLocalSave; // 一時保存フラグ
// #32926 作業報告画面改善 end
private String mProcessKey;
private Integer mPhaseNo;
@Override
public void onCreate(Bundle savedInstanceState) {
Logger.i(TAG, "onCreate");
......@@ -103,6 +104,10 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
mTaskReportLevel = intent.getIntExtra(ABookKeys.TASK_REPORT_LEVEL, 0); // 作業報告レベル
// #32926 作業報告画面改善 end
//連続作業
mProcessKey = intent.getStringExtra(ABookKeys.PROCESS_KEY);
mPhaseNo = intent.getIntExtra(ABookKeys.PHASE_NO, 0);
String frontTitle = "";
String rearTitle = "";
......@@ -153,7 +158,7 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
tempSaveButton.setVisibility(mLocalSave ? View.VISIBLE : View.GONE);
// 削除ボタン表示可否判断
mIsOzFilePath = OzdFileHelper.checkOzFilePath(mOperationId, mTaskKey, mTaskReportId, mReportStartDate, mReportFileName, mTaskReportLevel);
mIsOzFilePath = OzdFileHelper.checkOzFilePath(mOperationId, mTaskKey, mTaskReportId, mReportStartDate, mReportFileName, mTaskReportLevel, mProcessKey, mPhaseNo);
deleteButton.setVisibility(mIsOzFilePath ? View.VISIBLE : View.GONE);
}
// タイトルセット
......@@ -173,6 +178,9 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
public void onClick(View v) {
mButtonStatus = R.id.btn_close; // HTML側の分岐処理を行うため変数に値を渡す
doProcess(); // HTML側の処理を行う
if (mProcessKey != null && mPhaseNo != 0) { //連続作業用のOZView画面非表示
finishActivity();
}
}
});
......@@ -197,12 +205,19 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
public void onClick(View v) {
mButtonStatus = R.id.btn_save; // HTML側の分岐処理を行うため変数に値を渡す
// リソースパターンの適用
int messageResourceId = PatternStringUtil.patternToInt(getApplicationContext(),
R.string.save_info,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
if (mProcessKey != null && mPhaseNo != 0) {
messageResourceId = PatternStringUtil.patternToInt(getApplicationContext(),
R.string.temp_save_info,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
}
showSaveConfirmAlert(PatternStringUtil.patternToInt(getApplicationContext(),
R.string.save,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)),
PatternStringUtil.patternToInt(getApplicationContext(),
R.string.save_info,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)),messageResourceId
);
}
});
......@@ -221,7 +236,7 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
}
});
mOzFilePath = OzdFileHelper.getOzFilePath(mOperationId, contentId, mTaskKey, mTaskReportId, mReportStartDate, mReportFileName, mTaskReportLevel);
mOzFilePath = OzdFileHelper.getOzFilePath(mOperationId, contentId, mTaskKey, mTaskReportId, mReportStartDate, mReportFileName, mTaskReportLevel, mProcessKey, mPhaseNo);
Logger.i(TAG,"********mOzFilePath = %s" + mOzFilePath);
if (mOzFilePath == null) {
......@@ -628,6 +643,9 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
tempSaved(); // 臨時保存処理
}
doProcess(); // HTML側の処理を行う
if (mProcessKey != null && mPhaseNo != 0) { //連続作業用のOZView画面非表示
finishActivity();
}
}
});
logoutAkert.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), (DialogInterface.OnClickListener) null);
......
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