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);
}
......
......@@ -11,6 +11,7 @@ import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
......@@ -20,9 +21,11 @@ import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.ChatPushDataJSON;
import jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON;
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.SceneEntryJSON;
import jp.agentec.abook.abv.bl.acms.client.json.WorkerGroupJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetTaskFileParameters;
import jp.agentec.abook.abv.bl.acms.type.OperationSortingType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
......@@ -43,6 +46,7 @@ import jp.agentec.abook.abv.bl.data.dao.OperationDao;
import jp.agentec.abook.abv.bl.data.dao.OperationGroupMasterOperationDao;
import jp.agentec.abook.abv.bl.data.dao.PushMessageDao;
import jp.agentec.abook.abv.bl.data.dao.TaskDao;
import jp.agentec.abook.abv.bl.data.dao.TaskReportApprovalDao;
import jp.agentec.abook.abv.bl.data.dao.TaskReportDao;
import jp.agentec.abook.abv.bl.data.dao.TaskReportItemsDao;
import jp.agentec.abook.abv.bl.data.dao.TaskReportSendDao;
......@@ -55,6 +59,7 @@ import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterRelationDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.dto.TaskDto;
import jp.agentec.abook.abv.bl.dto.TaskReportApprovalDto;
import jp.agentec.abook.abv.bl.dto.TaskReportDto;
import jp.agentec.abook.abv.bl.dto.TaskReportItemsDto;
import jp.agentec.abook.abv.bl.dto.TaskReportSendDto;
......@@ -89,7 +94,7 @@ public class OperationLogic extends AbstractLogic {
private PushMessageDao mPushMessageDao = AbstractDao.getDao(PushMessageDao.class);
private TaskWorkerGroupDao mTaskWorkerGroupDao = AbstractDao.getDao(TaskWorkerGroupDao.class);
private TaskReportApprovalDao mTaskReportApprovalDao = AbstractDao.getDao(TaskReportApprovalDao.class);
/**
* 作業に関連する情報取得(API通信で取得して、DB保存処理)
* @throws AcmsException
......@@ -115,15 +120,19 @@ public class OperationLogic extends AbstractLogic {
List<OperationDto> serverOperations = json.operationList;
//サーバーからチャットプシュデータを取得
ChatPushDataJSON chatPushJson = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getChatPushList(param);
for ( PushMessageDto dto : chatPushJson.pushMessageList) {
PushMessageDto dtoTemp = mPushMessageDao.selectChat(dto.pushMessageId, dto.operationId, dto.pushSendDate);
if (dtoTemp == null) {
mPushMessageDao.insert(dto);
if (ABVDataCache.getInstance().serviceOption.isChat()) {
ChatPushDataJSON chatPushJson = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getChatPushList(param);
for ( PushMessageDto dto : chatPushJson.pushMessageList) {
PushMessageDto dtoTemp = mPushMessageDao.selectChat(dto.pushMessageId, dto.operationId, dto.pushSendDate);
if (dtoTemp == null) {
mPushMessageDao.insert(dto);
}
}
}
for (OperationDto serverOperationDto : serverOperations) {
// 登録フラグ
boolean insertFlg = true;
......@@ -306,9 +315,14 @@ public class OperationLogic extends AbstractLogic {
* @param attachedChangeFlag
* @param dataSendFlg
* @param localSavedFlg
* @param processKey 工程キー
* @param phaseNo 工程NO
* @throws IOException
*/
public void insertTaskReport(String taskKey, long operationId, long contentId, int reportLevel, int enableReport, JSONObject taskReportJson, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg, boolean localSavedFlg) throws IOException {
public void insertTaskReport(String taskKey, long operationId, long contentId,
int reportLevel, int enableReport, JSONObject taskReportJson,
String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg,
boolean localSavedFlg, String processKey, Integer phaseNo) throws IOException {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
if (taskDto == null) {
//TODO error
......@@ -350,8 +364,10 @@ public class OperationLogic extends AbstractLogic {
// コピー元のファイルで、添付ファイルとして使用しないファイル削除
deleteDifferentialFile(tempDirPath, attachedFileNames);
String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, reportLevel);
String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, reportLevel);
if (processKey != null && phaseNo != 0) { //連続作業の添付ファイル保存場所
operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationDirectionOrContinuousReportDirPath(operationId, taskKey, reportLevel, processKey, phaseNo);
}
// 添付ディレクトリの移動
boolean result = FileUtil.copy(tempDirPath, operationDrectionOrReportDirPath, true);
if (result) {
......@@ -362,19 +378,24 @@ public class OperationLogic extends AbstractLogic {
/**
* 作業報告を更新
* @param taskKey
* @param operationId
* @param contentId
* @param taskReportLevel
* @param enableReport
* @param taskReportJson
* @param localAttachedFileName
* @param attachedChangeFlag
* @param dataSendFlg
* @param localSavedFlg
* @param taskKey タスクキー
* @param operationId 作業ID
* @param contentId コンテンツID
* @param taskReportLevel 報告レベル(報告:0, 回答:1)
* @param enableReport 報告可能区分
* @param taskReportJson フォームデータ
* @param localAttachedFileName 添付ファイル名
* @param attachedChangeFlag 添付ファイル更新フラグ
* @param dataSendFlg データ送信フラグ
* @param localSavedFlg ローカル保存フラグ
* @param processKey 固定キー
* @param phaseNo 工程NO
* @throws IOException
*/
public void updateTaskReport(String taskKey, long operationId, long contentId, int taskReportLevel, int enableReport, JSONObject taskReportJson, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg, boolean localSavedFlg) throws IOException {
public void updateTaskReport(String taskKey, long operationId, long contentId, int taskReportLevel,
int enableReport, JSONObject taskReportJson, String localAttachedFileName,
boolean attachedChangeFlag, boolean dataSendFlg, boolean localSavedFlg,
String processKey, Integer phaseNo) throws IOException {
TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey, taskReportLevel);
if (taskReportDto == null) {
//TODO error?
......@@ -409,8 +430,12 @@ public class OperationLogic extends AbstractLogic {
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, taskReportLevel);
if (taskReportDto.attachedFileSendFlg) {
String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel);
if (processKey != null && phaseNo != 0) { //連続作業の添付ファイル保存場所
operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationDirectionOrContinuousReportDirPath(operationId, taskKey, taskReportLevel, processKey, phaseNo);
}
//添付ファイル変更の場合、以下の処理を行う
JSONObject attachedListJson = taskReportJson.getJSONObject("attached");
List<String> attachedFileNames = JSONObject.getValues(attachedListJson);
......@@ -789,14 +814,25 @@ public class OperationLogic extends AbstractLogic {
*/
public void createJsonForOperationContent(Long operationId, String contentPath, boolean routineTaskReportFlg) throws IOException {
try {
if (routineTaskReportFlg) {
// 定期点検
createRoutineTaskReportJson(operationId, contentPath);
OperationDto operationDto = mOperationDao.getOperation(operationId);
if (operationDto.reportType == Constant.ReportType.ReportContinuous) {
createContinuousTaskReportJson(operationId);
createContinuousTaskReportSuggestJson(operationId);
createProcessInfoJson(operationId, contentPath);
createPhaseStatusJson(operationId, contentPath);
} else {
createTaskReportJson(operationId, contentPath);
if (routineTaskReportFlg) {
// 定期点検
createRoutineTaskReportJson(operationId, contentPath);
} else {
createTaskReportJson(operationId, contentPath);
}
createTaskReportSuggestJson(operationId, contentPath);
}
createTaskReportSuggestJson(operationId, contentPath);
createHopSpotJson(operationId, contentPath);
} catch (IOException e) {
Logger.e(TAG, "createJsonForOperationContent error : ", e);
throw e;
......@@ -846,7 +882,14 @@ public class OperationLogic extends AbstractLogic {
jsonObject.put("workerCode", ABVDataCache.getInstance().getMemberInfo().workerCode);
// データディレクトリへの相対パス
jsonObject.put("attachedPath", "../../../../files/ABook/operation/" + operationId);
OperationDto operationDto = getOperation(operationId);
if (operationDto.reportType == Constant.ReportType.ReportContinuous) {
jsonObject.put("attachedPath", "../../../../../../files/ABook/operation/" + operationId);
} else {
jsonObject.put("attachedPath", "../../../../files/ABook/operation/" + operationId);
}
jsonObject.put("attachedMoviePath", ABVEnvironment.getInstance().getAttachedMoviesFilePath(contentId));
// 絞り検索マスタデータのパス
......@@ -918,6 +961,77 @@ public class OperationLogic extends AbstractLogic {
}
/**
* phaseStatus.jsonファイル作成(工程承認情報表示用)
* @param operationId 作業ID
* @param contentPath 保存パス
* @throws IOException
*/
private void createPhaseStatusJson(Long operationId, String contentPath) throws IOException {
List<TaskDto> taskDtoProcessKeyList = mTaskDao.selectTaskGroupByProcessKeyByOperationId(operationId);
List<JSONObject> processInfoList = new ArrayList<JSONObject>();
for (TaskDto taskDtoProcessKey : taskDtoProcessKeyList) {
JSONObject processJson = new JSONObject();
String processKey = taskDtoProcessKey.processKey;
Integer processStatus = taskDtoProcessKey.processStatus;
processJson.put(ABookKeys.PROCESS_KEY, processKey);
processJson.put(ABookKeys.PROCESS_STATUS, processStatus);
List<TaskDto> taskDtoList = mTaskDao.getTaskByProcessKey(processKey);
List<JSONObject> phaseInfoList = new ArrayList<JSONObject>();
for (TaskDto taskDto : taskDtoList) {
JSONObject phaseInfoJson = new JSONObject();
phaseInfoJson.put(ABookKeys.PHASE_NO, taskDto.phaseNo);
phaseInfoJson.put(ABookKeys.PHASE_STAUTS, taskDto.phaseStatus);
List<JSONObject> approvalList = new ArrayList<JSONObject>();
List<TaskReportApprovalDto> taskReportApprovalDtoList = mTaskReportApprovalDao.selectTaskReportApprovalByProcessKey(taskDto.processKey, taskDto.phaseNo);
for (TaskReportApprovalDto taskReportApprovalDto : taskReportApprovalDtoList) {
JSONObject approvalJson = new JSONObject();
approvalJson.put(ABookKeys.APPROVAL_GROUP_ID, taskReportApprovalDto.approvalGroupId);
approvalJson.put(ABookKeys.APPROVAL_GROUP_NAME, taskReportApprovalDto.approvalGroupName);
approvalJson.put(ABookKeys.APPROVAL_NANME, taskReportApprovalDto.approvalName);
approvalJson.put(ABookKeys.APPROVAL_NO, taskReportApprovalDto.approvalNo);
approvalJson.put(ABookKeys.COMMENT, taskReportApprovalDto.comment);
approvalJson.put(ABookKeys.SEND_BACK_PHASE_NO, taskReportApprovalDto.sendbackPhaseNo);
approvalJson.put(ABookKeys.SIGNATURE, taskReportApprovalDto.signature);
approvalJson.put(ABookKeys.STATUS, taskReportApprovalDto.status);
approvalList.add(approvalJson);
}
phaseInfoJson.put(ABookKeys.APPROVAL_LIST, approvalList);
phaseInfoList.add(phaseInfoJson);
}
processJson.put(ABookKeys.PHASE_LIST, phaseInfoList);
processInfoList.add(processJson);
}
JSONObject phaseStatusJson = new JSONObject();
phaseStatusJson.put(ABookKeys.PROCESS_LIST, processInfoList);
FileUtil.createFile(contentPath + "/phaseStatus.json", phaseStatusJson.toString());
}
/**
* processInfo.jsonファイル作成(報告一覧表示用)
*
* @param operationId
* @param contentPath
* @throws IOException
*/
public void createProcessInfoJson(Long operationId, String contentPath) throws IOException {
List<JSONObject> taskJsonList = new ArrayList<JSONObject>();
JSONObject processInfoJson = new JSONObject();
List<TaskDto> taskDtoList = mTaskDao.selectTaskGroupByProcessKeyByOperationId(operationId);
for (TaskDto dto : taskDtoList) {
JSONObject taskDtoJson = new JSONObject();
taskDtoJson.put(ABookKeys.TASK_NAME, dto.taskName);
taskDtoJson.put(ABookKeys.TASK_CODE, dto.taskCode);
taskDtoJson.put(ABookKeys.PROCESS_KEY, dto.processKey);
taskDtoJson.put(ABookKeys.PROCESS_STATUS, dto.processStatus);
taskJsonList.add(taskDtoJson);
}
processInfoJson.put("processList", taskJsonList);
Logger.d(TAG, "createProcessInfoJson : " + processInfoJson.toString());
FileUtil.createFile(contentPath + "/processInfo.json", processInfoJson.toString());
}
/**
* 作業報告用のjsonファイル
* 報告と報告(回答)のデータの区分が必要なので、「taskReport_0」と「taskReport_1」で形式で作成
* 報告(回答)の場合はtaskReport_1を作成
......@@ -1014,6 +1128,95 @@ public class OperationLogic extends AbstractLogic {
FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJsonRoot.toString());
}
/**
* 連続作業用の報告Suggestデータ作成(taskReportSuggest.json)
* @param operationId 作業ID
* @throws IOException I/O例外
*/
private void createContinuousTaskReportSuggestJson(Long operationId) throws IOException {
OperationDto operationDto = getOperation(operationId);
List<TaskReportItemsDto> taskReportItemsDtoList = mTaskReportItemsDao.getTaskReportItemByOperationId(operationId);
Map<Integer, JSONObject> taskReportItemMap = new HashMap<Integer, JSONObject>();
for (TaskReportItemsDto dto : taskReportItemsDtoList) {
JSONObject itemJson = taskReportItemMap.get(dto.phaseNo);
if (itemJson == null) {
itemJson = new JSONObject();
}
JSONArray jsonArray = new JSONArray();
if (itemJson.has(dto.itemKey)) {
boolean result = false;
jsonArray = itemJson.getJSONArray(dto.itemKey);
for (int i = 0; i < jsonArray.length(); i++) {
if (jsonArray.get(i).equals(dto.inputValue)) {
result = true;
break;
}
}
if (!result) {
jsonArray.put(dto.inputValue);
itemJson.put(dto.itemKey, jsonArray);
}
} else {
jsonArray.put(dto.inputValue);
itemJson.put(dto.itemKey, jsonArray);
}
taskReportItemMap.put(dto.phaseNo, itemJson);
}
for (Integer key : taskReportItemMap.keySet()) {
JSONObject savedTaskReportItemJson = taskReportItemMap.get(key);
JSONObject taskReportSuggestJson = new JSONObject();
taskReportSuggestJson.put(ABookKeys.TASK_REPORT_SUGGEST + "_0", savedTaskReportItemJson);
Logger.d(TAG, "createTaskReportSuggestJson : " + taskReportSuggestJson.toString());
String saveJsonPath = ABVEnvironment.getInstance().getContinuousReportDirectoryPath(operationDto.contentId, key);
FileUtil.createFile(saveJsonPath + "/" + ABookKeys.TASK_REPORT_SUGGEST + ".json", taskReportSuggestJson.toString());
}
}
/**
* 連続作業用の報告用データ作成(TaskReport.json作成)
* @param operationId 作業ID
* @throws IOException I/O例外
*/
private void createContinuousTaskReportJson(Long operationId) throws IOException {
List<JSONObject> taskReportJsonList = new ArrayList<JSONObject>();
OperationDto operationDto = getOperation(operationId);
List<TaskDto> taskDtoList = mTaskDao.selectTaskByOperationId(operationId);
Map<Integer, List<JSONObject>> reportJsonMap = new HashMap<Integer, List<JSONObject>>();
for (TaskDto taskDto : taskDtoList) {
if (taskDto.delFlg) {
continue;
}
List<TaskReportDto> taskReportDtoList = mTaskReportDao.getTaskReportListByTaskKey(taskDto.taskKey);
Integer phaseNo = taskDto.phaseNo;
for (TaskReportDto taskReportDto : taskReportDtoList) {
JSONObject taskReportJson = new JSONObject();
if(taskReportDto.jsonData != null && taskReportDto.jsonData.length() > 0) {
taskReportJson = new JSONObject(taskReportDto.jsonData);
}
taskReportJson.put(ABookKeys.PROCESS_KEY, taskDto.processKey);
taskReportJson.put(ABookKeys.HAS_AUTHORITY, taskReportDto.enableReport);
List<JSONObject> reportJsonList = reportJsonMap.get(phaseNo);
if (reportJsonList == null) {
reportJsonList = new ArrayList<JSONObject>();
}
reportJsonList.add(taskReportJson);
reportJsonMap.put(phaseNo, reportJsonList);
}
}
for (Integer key : reportJsonMap.keySet()) {
List<JSONObject> savedReportJsonList = reportJsonMap.get(key);
JSONObject taskReportJson = new JSONObject();
taskReportJson.put("taskReport_0", savedReportJsonList);
String saveJsonPath = ABVEnvironment.getInstance().getContinuousReportDirectoryPath(operationDto.contentId, key);
FileUtil.createFile(saveJsonPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJson.toString());
}
}
private void createTaskReportSuggestJson(Long operationId, String contentPath) throws IOException {
JSONObject itemJson = new JSONObject();
JSONObject taskReportSuggestJson = new JSONObject();
......@@ -1253,10 +1456,14 @@ public class OperationLogic extends AbstractLogic {
File zipFile = null;
String strReportStartDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(taskReportDto.reportStartDate);
//連続作業のprocessKeyとphaseNo情報取得
TaskDto taskDto = null;
if (operationDto.reportType == Constant.ReportType.ReportContinuous) {
taskDto = mTaskDao.getTaskByTaskKey(taskReportDto.taskKey);
}
if (taskReportDto.attachedFileSendFlg) {
String fileName = null;
zipFile = createAttachedFileForSend(operationId, taskReportDto.taskKey, taskReportSendDto.taskReportSendId, operationDto.reportType == Constant.ReportType.RoutineTask, taskReportDto.taskReportId, strReportStartDate, taskReportDto.taskReportLevel);
zipFile = createAttachedFileForSend(operationId, taskReportDto.taskKey, taskReportSendDto.taskReportSendId, operationDto.reportType == Constant.ReportType.RoutineTask, taskReportDto.taskReportId, strReportStartDate, taskReportDto.taskReportLevel, taskDto);
if (zipFile != null) {
fileName = FileUtil.getFilenameWithoutExt(zipFile.getName());
}
......@@ -1271,7 +1478,8 @@ public class OperationLogic extends AbstractLogic {
zipFile,
taskReportSendDto.saveDate,
operationDto.reportType,
taskReportSendDto.hotspotChangeFlg
taskReportSendDto.hotspotChangeFlg,
taskDto
);
progressCallback.callback(new Integer(progress));
removeTaskReportSendIds.add(taskReportSendDto.taskReportSendId);
......@@ -1434,41 +1642,41 @@ public class OperationLogic extends AbstractLogic {
* @throws NoSuchAlgorithmException
* @throws IOException
*/
private File createAttachedFile(Long operationId, String taskKey, boolean directionFlg, int taskReportLevel) throws ZipException, NoSuchAlgorithmException, IOException {
File zipFile;
// #32926 作業報告画面改善 start
String filePath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel);
// #32926 作業報告画面改善 end
File fileDir = new File(filePath);
if (!fileDir.exists()) {
return null;
}
String[] files = fileDir.list();
if (files == null || files.length == 0) {
return null;
}
ArrayList<String> fileList = new ArrayList<String>();
for (String dataFile : files) {
fileList.add(fileDir.getPath() + StringUtil.Slash + dataFile);
}
String fileName = UUID.randomUUID().toString();
zipFile = new File(filePath + StringUtil.Slash + fileName + ".zip");
if (zipFile.exists()) {
// zipファイルが存在する時は削除して、新たに作成
boolean result = zipFile.delete();
if (result) {
FileUtil.saveZip(zipFile.getPath(), null, fileList.toArray(new String[fileList.size()]));
} else {
// 削除失敗
Logger.e(TAG, "delete zip file failed");
return null;
}
} else {
FileUtil.saveZip(zipFile.getPath(), null, fileList.toArray(new String[fileList.size()]));
}
return zipFile;
}
// private File createAttachedFile(Long operationId, String taskKey, boolean directionFlg, int taskReportLevel) throws ZipException, NoSuchAlgorithmException, IOException {
// File zipFile;
// // #32926 作業報告画面改善 start
// String filePath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel);
// // #32926 作業報告画面改善 end
//
// File fileDir = new File(filePath);
// if (!fileDir.exists()) {
// return null;
// }
// String[] files = fileDir.list();
// if (files == null || files.length == 0) {
// return null;
// }
// ArrayList<String> fileList = new ArrayList<String>();
// for (String dataFile : files) {
// fileList.add(fileDir.getPath() + StringUtil.Slash + dataFile);
// }
// String fileName = UUID.randomUUID().toString();
// zipFile = new File(filePath + StringUtil.Slash + fileName + ".zip");
// if (zipFile.exists()) {
// // zipファイルが存在する時は削除して、新たに作成
// boolean result = zipFile.delete();
// if (result) {
// FileUtil.saveZip(zipFile.getPath(), null, fileList.toArray(new String[fileList.size()]));
// } else {
// // 削除失敗
// Logger.e(TAG, "delete zip file failed");
// return null;
// }
// } else {
// FileUtil.saveZip(zipFile.getPath(), null, fileList.toArray(new String[fileList.size()]));
// }
// return zipFile;
// }
/**
* 作業報告送信の添付ファイルのzip生成
......@@ -1483,9 +1691,14 @@ public class OperationLogic extends AbstractLogic {
* @throws NoSuchAlgorithmException
* @throws IOException
*/
private File createAttachedFileForSend(Long operationId, String taskKey, int taskReportSendId, boolean routineFlag, int reportId, String reportStartDate, int taskReportLevel) throws ZipException, NoSuchAlgorithmException, IOException {
private File createAttachedFileForSend(Long operationId, String taskKey, int taskReportSendId,
boolean routineFlag, int reportId, String reportStartDate,
int taskReportLevel, TaskDto taskDto) throws ZipException, NoSuchAlgorithmException, IOException {
File zipFile;
String filePath = ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskKey, taskReportSendId);
if (taskDto != null) {
filePath = ABVEnvironment.getInstance().getOperationContinuousTaskReportSendDirFilePath(operationId, taskKey, taskReportSendId, taskDto.processKey, taskDto.phaseNo);
}
File fileDir = new File(filePath);
if (!fileDir.exists()) {
......@@ -1607,10 +1820,11 @@ public class OperationLogic extends AbstractLogic {
* @param operationId
* @param hotSpotInfo
*/
public void registTaskData(String taskKey, Long operationId, String hotSpotInfo, JSONObject taskJson) {
public void registTaskData(String taskKey, Long operationId, String hotSpotInfo, JSONObject taskJson, String processKey, Integer phaseNo) {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
String taskCode = null;
Integer taskStatus = null;
String taskName = null;
if (taskJson != null) {
Iterator taskKeys = taskJson.keys();
......@@ -1620,6 +1834,12 @@ public class OperationLogic extends AbstractLogic {
if (itemKey.startsWith("q_1_")) {
taskCode = taskJson.getString(itemKey);
}
// 報告名
if (itemKey.startsWith("q_2_")) {
taskName = taskJson.getString(itemKey);
}
// 報告状況取得
if (itemKey.startsWith("q_3_")) {
taskStatus = taskJson.getInt(itemKey);
......@@ -1639,6 +1859,11 @@ public class OperationLogic extends AbstractLogic {
if (taskStatus != null) {
taskDto.taskStatus = taskStatus;
}
if (taskName != null) {
taskDto.taskName = taskName;
}
taskDto.processKey = processKey;
taskDto.phaseNo = phaseNo;
mTaskDao.update(taskDto);
} else {
// 登録
......@@ -1652,7 +1877,42 @@ public class OperationLogic extends AbstractLogic {
if (taskStatus != null) {
taskDto.taskStatus = taskStatus;
}
if (taskName != null) {
taskDto.taskName = taskName;
}
taskDto.processKey = processKey;
taskDto.phaseNo = phaseNo;
mTaskDao.insert(taskDto);
}
}
/**
* 連続作業の承認情報を取得
* @param operationId 作業ID
* @throws NetworkDisconnectedException
* @throws ABVException
* @throws IOException
*/
public void getProcessData(Long operationId) throws NetworkDisconnectedException, ABVException {
GetOperationDataParameters param = new GetOperationDataParameters(ABVDataCache.getInstance().getMemberInfo().sid, operationId);
ProcessDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getProcessData(param);
for (TaskDto taskDto : json.taskDtoList) {
for (TaskDto phaseTaskDto : taskDto.phaseList) {
//Taskデータ更新(phaseStatus, processStatus)
mTaskDao.updateStatus(taskDto.processKey, phaseTaskDto.phaseNo, taskDto.processStatus, phaseTaskDto.phaseStatus);
for (TaskReportApprovalDto taskReportApprovalDto : phaseTaskDto.taskReportApprovalDtoList) {
//TaskReportApprovalデータ追加・更新
if (mTaskReportApprovalDao.selectTaskReportApprovalByProcessKey(taskDto.processKey, phaseTaskDto.phaseNo, taskReportApprovalDto.approvalNo) != null) {
mTaskReportApprovalDao.update(taskReportApprovalDto);
} else {
taskReportApprovalDto.processKey = taskDto.processKey;
taskReportApprovalDto.phaseNo = phaseTaskDto.phaseNo;
mTaskReportApprovalDao.insert(taskReportApprovalDto);
}
}
}
}
}
}
......@@ -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);
}
}
......
......@@ -88,17 +88,27 @@ public class ABookCheckWebViewHelper extends ABookHelper {
if (ActivityHandlingHelper.getInstance().searchOzdActivityStack()) {
context = (ABVContentViewActivity) ActivityHandlingHelper.getInstance().selectedOzdAtivityContext();
}
String processKey = null;
Integer phaseNo = 0;
if (reportType == Constant.ReportType.ReportContinuous) { //連続作業対応
if (param.containsKey(ABookKeys.PROCESS_KEY)) {
processKey = param.get(ABookKeys.PROCESS_KEY);
}
if (param.containsKey(ABookKeys.PHASE_NO)) {
phaseNo = Integer.valueOf(param.get(ABookKeys.PHASE_NO));
}
}
switch (cmd) {
case ABookKeys.CMD_INSERT_TASK_REPORT:
case ABookKeys.CMD_UPDATE_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, reportType, taskReportLevel, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
sendTaskData(context, operationId, taskKey, taskReportLevel);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel, processKey, phaseNo);
sendTaskData(context, operationId, taskKey, taskReportLevel, reportType);
break;
case ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT: // 一時保存
insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, reportType, taskReportLevel, true);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel, processKey, phaseNo);
ABVToastUtil.showMakeText(context, R.string.msg_temp_save_result, Toast.LENGTH_SHORT);
mFinishCallback.callback(false);
break;
......@@ -116,7 +126,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
} else {
mOperationLogic.deleteTaskReport(operationId, contentId, taskKey, taskReportLevel);
mOperationLogic.createJsonForOperationContent(operationId, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel, processKey, phaseNo);
}
if (enableReportHistory == Constant.EnableReportHistory.Invalid) {
......@@ -127,7 +137,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, null, true, false);
}
sendTaskData(context, operationId, taskKey, taskReportLevel);
sendTaskData(context, operationId, taskKey, taskReportLevel, reportType);
break;
case ABookKeys.CMD_MOVE_HOT_SPOT:
......@@ -148,7 +158,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
* @param operationId プロジェクトID
* @param taskKey タスクキー
*/
private void sendTaskData(final ABVContentViewActivity context, final long operationId, final String taskKey, final int taskReportLevel) {
private void sendTaskData(final ABVContentViewActivity context, final long operationId, final String taskKey, final int taskReportLevel, final int reportType) {
// needSyncFlgをtrueに設定
mOperationLogic.updateSyncOperation(operationId, true);
......@@ -183,6 +193,11 @@ public class ABookCheckWebViewHelper extends ABookHelper {
try {
mOperationLogic.sendTaskReportSendData(operationId, taskKey, taskReportLevel, progressCallback);
//送信後、連続作業承認情報を取得
if (reportType == Constant.ReportType.ReportContinuous) {
//連続作業のみ承認データ取得
mOperationLogic.getProcessData(operationId);
}
} catch (AcmsException ex) {
//noinspection EnumSwitchStatementWhichMissesCases
switch (ex.getCode()) {
......@@ -313,6 +328,12 @@ public class ABookCheckWebViewHelper extends ABookHelper {
JSONObject taskReportJson = new JSONObject(taskReport);
int taskReportId = 0;
String reportStartDate = "";
int phaseNo = 0;
String processKey = null;
if (reportType == Constant.ReportType.ReportContinuous) {
phaseNo = Integer.valueOf(param.get(ABookKeys.PHASE_NO));
processKey = param.get(ABookKeys.PROCESS_KEY);
}
if (reportType == Constant.ReportType.RoutineTask) {
taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID));
......@@ -326,7 +347,6 @@ public class ABookCheckWebViewHelper extends ABookHelper {
mOperationLogic.createJsonForOperationContent(operationId, contentPath, true);
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate);
} else {
String hotSpotInfo = param.containsKey(ABookKeys.HOT_SPOT) ? param.get(ABookKeys.HOT_SPOT) : null;
// 報告情報のjson取得後、登録・更新時に使用
JSONObject taskJson = null;
......@@ -334,18 +354,18 @@ public class ABookCheckWebViewHelper extends ABookHelper {
taskJson = taskReportJson.getJSONObject("task");
}
// task登録・更新処理
mOperationLogic.registTaskData(taskKey, operationId, hotSpotInfo, taskJson);
mOperationLogic.registTaskData(taskKey, operationId, hotSpotInfo, taskJson, processKey, phaseNo);
TaskReportDto taskReportDto = mOperationLogic.getTaskReport(taskKey, taskReportLevel);
if (taskReportDto != null) {
// 更新
mOperationLogic.updateTaskReport(taskReportDto.taskKey, operationId, contentId, taskReportLevel, Constant.EnableEditReport.YES, taskReportJson, null, attachedChangeFlag, localSavedFlg ? false : true, localSavedFlg);
mOperationLogic.updateTaskReport(taskReportDto.taskKey, operationId, contentId, taskReportLevel, Constant.EnableEditReport.YES, taskReportJson, null, attachedChangeFlag, localSavedFlg ? false : true, localSavedFlg, processKey, phaseNo);
} else {
// 登録
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportLevel, Constant.EnableEditReport.YES, taskReportJson, null, attachedChangeFlag, localSavedFlg ? false : true, localSavedFlg);
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportLevel, Constant.EnableEditReport.YES, taskReportJson, null, attachedChangeFlag, localSavedFlg ? false : true, localSavedFlg, processKey, phaseNo);
}
mOperationLogic.createJsonForOperationContent(operationId, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel, processKey, phaseNo);
}
if (!localSavedFlg) {
......@@ -356,7 +376,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
taskReportSendId = mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false, false);
}
// #32926 作業報告画面改善 start
copyReportTaskSendFiles(operationId, taskKey, taskReportSendId, reportType == Constant.ReportType.RoutineTask, taskReportId, reportStartDate, taskReportLevel);
copyReportTaskSendFiles(operationId, taskKey, taskReportSendId, reportType == Constant.ReportType.RoutineTask, taskReportId, reportStartDate, taskReportLevel, processKey, phaseNo);
// #32926 作業報告画面改善 end
}
}
......@@ -371,10 +391,9 @@ public class ABookCheckWebViewHelper extends ABookHelper {
if (operationDto.reportType == Constant.ReportType.RoutineTask) {
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskReportDto.taskKey, taskReportDto.taskReportId, taskReportDto.reportStartDate);
} else {
copyTaskAttachedMovie(operationId, contentId, taskDto.taskKey, taskReportDto.taskReportLevel);
copyTaskAttachedMovie(operationId, contentId, taskDto.taskKey, taskReportDto.taskReportLevel, taskDto.processKey, taskDto.phaseNo);
}
}
}
} catch (IOException e) {
Logger.e(TAG, "fileCopyToCacheAttachedDir error. ", e);
......@@ -419,21 +438,32 @@ public class ABookCheckWebViewHelper extends ABookHelper {
}
/**
* 添付動画ファイルをCacheからfilesへコピー
*
* /.../files/ABook/operation/{operationId}/{taskKey}/{taskType}/{taskReportLevel}/*.(mov,mp4)を
* /.../cache/{contentId}/attachedMovie/{taskKey}/{taskType}/{taskReportLevel}/*.(mov,mp4)にコピー
*
* @param operationId
* @param contentId
* @param operationId 作業ID
* @param contentId コンテンツID
* @param taskKey タスクキー
* @param taskReportLevel 報告レベル
* @param processKey 固定キー
* @param phaseNo 工程番号
*/
public void copyTaskAttachedMovie(long operationId, long contentId, String taskKey, int taskReportLevel) throws IOException {
public void copyTaskAttachedMovie(long operationId, long contentId, String taskKey, int taskReportLevel, String processKey, Integer phaseNo) throws IOException {
// 作業指示書の添付ファイル(mp4,mov拡張子のみ)コピー
String taskKeyPath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel);
if (processKey != null && phaseNo != 0) {
taskKeyPath = ABVEnvironment.getInstance().getOperationDirectionOrContinuousReportDirPath(operationId, taskKey, taskReportLevel, processKey, phaseNo);
}
File taskKeyFile = new File(taskKeyPath);
if (taskKeyFile.exists()) {
String attachedMoviesFilePath = ABVEnvironment.getInstance().getAttachedDirectionOrReportDirPath(contentId, taskKey, taskReportLevel);
if (processKey != null && phaseNo != 0) {
attachedMoviesFilePath = ABVEnvironment.getInstance().getAttachedDirectionOrReportDirPath(contentId, taskKey, taskReportLevel, processKey, phaseNo);
}
// 存在しない場合は無視する
FileUtil.delete(attachedMoviesFilePath);
FileUtil.createNewDirectory(attachedMoviesFilePath);
for (String taskAttachedFile : taskKeyFile.list()) {
if (StringUtil.endsWithAny(taskAttachedFile.toLowerCase(), "mov", "mp4")) {
......@@ -451,9 +481,13 @@ public class ABookCheckWebViewHelper extends ABookHelper {
* @param routineTaskReportFlg
* @param taskReportId
* @param reportStartDate
* @param processKey 工程キー
* @param phaseNo 工程番号
* @throws IOException
*/
public void copyReportTaskSendFiles(final long operationId, final String taskKey, final int taskReportSendId, boolean routineTaskReportFlg, int taskReportId, String reportStartDate, int taskReportLevel) throws IOException {
public void copyReportTaskSendFiles(final long operationId, final String taskKey, final int taskReportSendId,
boolean routineTaskReportFlg, int taskReportId, String reportStartDate,
int taskReportLevel, String processKey, Integer phaseNo) throws IOException {
String taskAttachedPath;
Date dReportStartDate;
String sReportStartDate = "";
......@@ -465,13 +499,19 @@ public class ABookCheckWebViewHelper extends ABookHelper {
} else {
// #32926 作業報告画面改善 start
taskAttachedPath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel);
if (processKey != null && phaseNo != 0) {
taskAttachedPath = ABVEnvironment.getInstance().getOperationDirectionOrContinuousReportDirPath(operationId, taskKey, taskReportLevel, processKey, phaseNo);
}
// #32926 作業報告画面改善 end
}
File taskAttachedFiles = new File(taskAttachedPath);
if (taskAttachedFiles.exists()) {
String taskReportSendPath = ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskKey, taskReportSendId);
if (processKey != null && phaseNo != 0) {
taskReportSendPath = ABVEnvironment.getInstance().getOperationContinuousTaskReportSendDirFilePath(operationId, taskKey, taskReportSendId, processKey, phaseNo);
}
FileUtil.delete(taskReportSendPath);
FileUtil.createNewDirectory(taskReportSendPath);
......
......@@ -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