Commit ee17a18f by Lee Munkyeong

Merge branch 'features/1.4.100_develop_mk' into 'features/1.4.202'

図面ホットスポット色及びトップ画面更新ProgressBar修正

See merge request !251
parents 16ca9515 71c14dc7
......@@ -193,6 +193,11 @@ public class ABookKeys {
public static final String THETA_LIST_ACTIVITY_FLG = "thetaListActivityFlg";
//連続作業
public static final String PANO_IMAGE = "panoImage";
public static final String TASK_PDF = "taskPdf";
public static final String PHASE_INFO_JSON = "phaseInfo.json";
public static final String TIME_LINE_LIST = "timeLineList";
public static final String PROCESS_KEY = "processKey";
public static final String PROCESS_STATUS = "processStatus";
public static final String PHASE_NO = "phaseNo";
......
......@@ -204,29 +204,32 @@ public class ContentRefresher {
}
groupLogic.initializeGroups(); // グループ設定(グループ変更の場合、FetchDateをクリアする)
if (mProgressCallback != null) {
mProgressCallback.callback(5);
mProgressCallback.callback(10);
}
categoryLogic.initializeCategories(); // カテゴリ設定
// 絞り検索マスタデータの最新更新された時のFetchDateを一時に保存する。
if (mProgressCallback != null) {
mProgressCallback.callback(5);
mProgressCallback.callback(10);
}
// CMSでメンテナンスされる絞り検索マスタデータをアプリから取得できるようにJSONファイルを生成する。
apertureMasterDataLogic.initializeApertureMasterData();
if (mProgressCallback != null) {
mProgressCallback.callback(5);
mProgressCallback.callback(10);
}
// 作業種別情報を取得
operationGroupMasterLogic.setOperationGroupMaster();
if (mProgressCallback != null) {
mProgressCallback.callback(5);
mProgressCallback.callback(10);
}
if (interrupt) { // この時点で停止要求が来た場合先には進まない。(ServiceOption/Group/Categoryの更新は1セットで行う(トランザクションはそれぞれ別))
Logger.d(TAG, "stop refresh worker before content update.");
setFail();
updateRefreshContentListState(-1L, null, mProgressCallback);
if (mProgressCallback != null) {
mProgressCallback.callback(10);
}
return;
}
isFinishedContentCheck = retrieveServerContent(localContents, mProgressCallback); // ContentVersionAPIを呼出し新規と更新の場合ContentInfoをDLする
......@@ -236,13 +239,12 @@ public class ContentRefresher {
initializingRefreshing = false;
if (!isRefreshing()) {
updateRefreshContentListState(-1L, null, mProgressCallback);
updateRefreshContentListState(-1L, null);
}
mProgressCallback.callback(100);
} catch (Exception e) {
Logger.e("refreshContent failed.", e);
mProgressCallback.callback(100);
updateRefreshContentListState(-1L, e);
mProgressCallback.callback(100);
}
contentDownloader.kickTask();
Logger.i(TAG, "refresh main thread end.-----------------------------------------------");
......@@ -342,11 +344,6 @@ public class ContentRefresher {
List<ContentDto> serverContents = json.contentVersions;
// DTO Info:contentId, metaVersion, resourceVersion, contentNameKana, readerShareFlg
int progressPercent = 0;
if (CollectionUtil.isNotEmpty(serverContents) && serverContents.size() != 0) {
progressPercent = 50 / serverContents.size() < 1 ? 1 : 50 / serverContents.size();
}
int totalProgress = 0;
for (ContentDto serverContentDto : serverContents) {
while (isBusyRefreshingContent()) {
......@@ -386,9 +383,9 @@ public class ContentRefresher {
}
}
}
if (mProgressCallback != null && totalProgress < 50) {
mProgressCallback.callback(progressPercent);
totalProgress = totalProgress + progressPercent;
if (mProgressCallback != null && totalProgress < 20) {
mProgressCallback.callback(1);
totalProgress = totalProgress + 1;
}
}
......
......@@ -14,6 +14,8 @@ public class OperationTaskDto extends AbstractDto {
public int seqId;
public Date insertDate;
public Date updateDate;
public String processKey;
public int processStatus;
public float pdfX;
public float pdfY;
public boolean isFinished;
......
......@@ -2,6 +2,7 @@ package jp.agentec.abook.abv.bl.logic;
import static jp.agentec.abook.abv.bl.acms.type.OperationType.DRAWING;
import static jp.agentec.abook.abv.bl.acms.type.OperationType.PANO;
import static jp.agentec.abook.abv.bl.acms.type.OperationType.PDF;
import net.lingala.zip4j.exception.ZipException;
......@@ -116,7 +117,7 @@ public class OperationLogic extends AbstractLogic {
public void initializeOperations(Callback mCallBack) throws AcmsException, NetworkDisconnectedException {
// 作業グループリスト取得
setWorkingGroupList();
mCallBack.callback(5);
mCallBack.callback(2);
// 作業一覧取得し、登録・更新・削除する
retrieveServerOperation(mCallBack);
}
......@@ -369,7 +370,6 @@ public class OperationLogic extends AbstractLogic {
insertFlg = false;
break;
}
mCallBack.callback(1);
}
// 更新されたら以下の処理は行わない
......@@ -397,7 +397,6 @@ public class OperationLogic extends AbstractLogic {
for (OperationGroupMasterRelationDto operationGroupMasterRelationDto : serverOperationDto.operationGroupMasterRelationDtoList) {
mOperationGroupMasterOperationDao.insertOperationGroupMasterOperation(operationGroupMasterRelationDto);
}
mCallBack.callback(2);
}
// 作業担当グループ登録
......@@ -1222,7 +1221,7 @@ public class OperationLogic extends AbstractLogic {
JSONObject phaseStatusJson = new JSONObject();
phaseStatusJson.put(ABookKeys.PROCESS_LIST, processInfoList);
OperationDto operation = mOperationDao.getOperation(operationId);
if (operation.operationType == PANO || operation.operationType == DRAWING) {
if (operation.operationType == PANO || operation.operationType == DRAWING || operation.operationType == PDF) {
contentPath = contentPath.replaceAll("panoImage","processList");
contentPath = contentPath.replaceAll("taskPdf","processList");
}
......@@ -1249,7 +1248,7 @@ public class OperationLogic extends AbstractLogic {
}
processInfoJson.put("processList", taskJsonList);
OperationDto operation = mOperationDao.getOperation(operationId);
if (operation.operationType == PANO || operation.operationType == DRAWING) {
if (operation.operationType == PANO || operation.operationType == DRAWING || operation.operationType == PDF) {
contentPath = contentPath.replaceAll("panoImage","processList");
contentPath = contentPath.replaceAll("taskPdf","processList");
}
......@@ -1257,6 +1256,29 @@ public class OperationLogic extends AbstractLogic {
FileUtil.createFile(contentPath + "/processInfo.json", processInfoJson.toString());
}
private String getProcessInfoJson(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);
OperationDto operation = mOperationDao.getOperation(operationId);
if (operation.operationType == PANO || operation.operationType == DRAWING || operation.operationType == PDF) {
contentPath = contentPath.replaceAll("panoImage","processList");
contentPath = contentPath.replaceAll("taskPdf","processList");
}
Logger.d(TAG, "createProcessInfoJson : " + processInfoJson.toString());
FileUtil.createFile(contentPath + "/processInfo.json", processInfoJson.toString());
return processInfoJson.toString();
}
/**
* 作業報告用のjsonファイル
* 報告と報告(回答)のデータの区分が必要なので、「taskReport_0」と「taskReport_1」で形式で作成
......@@ -2147,6 +2169,29 @@ public class OperationLogic extends AbstractLogic {
}
}
public String getProcessDataAndCreateJson(Long operationId, String contentPath, boolean routineTaskReportFlg) throws NetworkDisconnectedException, ABVException, IOException {
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) {
taskReportApprovalDto.processKey = taskDto.processKey;
taskReportApprovalDto.phaseNo = phaseTaskDto.phaseNo;
//TaskReportApprovalデータ追加・更新
if (mTaskReportApprovalDao.selectTaskReportApprovalByProcessKey(taskDto.processKey, phaseTaskDto.phaseNo, taskReportApprovalDto.approvalNo) != null) {
mTaskReportApprovalDao.update(taskReportApprovalDto);
} else {
mTaskReportApprovalDao.insert(taskReportApprovalDto);
}
}
}
}
return getProcessInfoJson(operationId, contentPath);
}
/**
* 工程情報を全部削除する。(全削除ボタンタップ時)
* @param operationId 作業ID
......
Subproject commit 4313eb5084533edc7b622189bb928a4724c5bf29
Subproject commit 76fa1d1741dafcf7915a0c5e8eb051b059eeede3
......@@ -4,6 +4,10 @@ package jp.agentec.abook.abv.ui.viewer.activity;
* @author jang
*/
import static jp.agentec.abook.abv.bl.acms.type.OperationType.DRAWING;
import static jp.agentec.abook.abv.bl.acms.type.OperationType.PANO;
import static jp.agentec.abook.abv.bl.acms.type.OperationType.PDF;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
......@@ -79,6 +83,7 @@ import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import jp.agentec.abook.abv.bl.acms.client.json.AcmsJSONParser;
import jp.agentec.abook.abv.bl.acms.client.json.DownloadedContentInfoJSON;
import jp.agentec.abook.abv.bl.acms.client.json.MarkingJson;
import jp.agentec.abook.abv.bl.acms.client.json.content.ActionInfoJSON;
......@@ -96,7 +101,9 @@ import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.exception.ExceptionHandler;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.common.util.ContentFileUtil;
import jp.agentec.abook.abv.bl.common.util.JsonUtil;
......@@ -105,9 +112,13 @@ import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao;
import jp.agentec.abook.abv.bl.data.dao.ContentPageDao;
import jp.agentec.abook.abv.bl.download.ContentFileExtractor;
import jp.agentec.abook.abv.bl.dto.ChatMessageDto;
import jp.agentec.abook.abv.bl.dto.ChatRoomDto;
import jp.agentec.abook.abv.bl.dto.ContentBookmarkDto;
import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.OperationTaskDto;
import jp.agentec.abook.abv.bl.dto.TaskDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.ContentReadingLogLogic;
import jp.agentec.abook.abv.bl.logic.ContractLogic;
......@@ -173,6 +184,7 @@ import jp.agentec.abook.abv.ui.viewer.view.action.TapMediaPlayer;
import jp.agentec.abook.abv.ui.viewer.view.action.VideoMountAction;
import jp.agentec.adf.net.http.HttpDownloadSimpleNotification;
import jp.agentec.adf.net.http.HttpDownloadState;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil;
import jp.agentec.adf.util.StringUtil;
......@@ -336,7 +348,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
public boolean mMoveTaskFlg = false;
private long currentRemoteObjectId = 0;
private static final int FINISHED_STATUS = 999;
/**
* スクロールステータス
......@@ -5351,6 +5363,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
mMainLayout.addView(operationTaskLayout);
List<OperationTaskDto> tasks = mTaskHotspotJSON.getPageTasks(pageNumber);
operationTaskLayout.addAllOperationTaskIcon(rootLayout, tasks);
//画面回転の時
......@@ -5404,14 +5417,66 @@ public class ContentViewActivity extends ABVContentViewActivity {
hotspot = new JSONObject(checkParam.get(ABookKeys.HOT_SPOT));
taskCode = hotspot.getString(ABookKeys.TASK_CODE);
}
if (checkParam.get("phaseNo") != null && !Objects.equals(checkParam.get("phaseNo"), "1")) {
break;
OperationDto operation = mOperationDao.getOperation(mOperationId);
String jsonPath = "";
if ((operation.operationType == PANO || operation.operationType == DRAWING || operation.operationType == PDF) && operation.reportType == Constant.ReportType.ReportContinuous) {
String processKey = checkParam.get(ABookKeys.PROCESS_KEY) != null ? checkParam.get(ABookKeys.PROCESS_KEY) : "";
List<TaskDto> taskList = mTaskDao.getTaskByProcessKey(processKey);
if (taskList != null && taskList.size() > 0) {
for (TaskDto task : taskList) {
if (task.phaseNo == 1) {
operationTaskLayout.setIconStatus(taskKey, true);
operationTaskLayout.currentTaskDto.taskKey = task.taskKey;
operationTaskLayout.currentTaskDto.taskCode = task.taskCode;
jsonPath = mContentPath.replaceAll(ABookKeys.PANO_IMAGE,ABookKeys.PROCESS_LIST).replaceAll(ABookKeys.TASK_PDF, ABookKeys.PROCESS_LIST) + "/" + ABookKeys.PHASE_INFO_JSON;
JSONObject phaseInfo = null;
int lastPhase = 0;
try {
phaseInfo = new JSONObject(FileUtil.readTextFile(jsonPath));
JSONArray timeLineListJSONArray = phaseInfo.getJSONArray(ABookKeys.TIME_LINE_LIST);
for (int listCount = 0; listCount < timeLineListJSONArray.length(); listCount++) {
if (timeLineListJSONArray.getJSONObject(listCount).length() == 0) {
break;
}
JSONObject timeLineJSONObject = timeLineListJSONArray.getJSONObject(listCount);
JSONArray phaseListJSONArray = timeLineJSONObject.getJSONArray(ABookKeys.PHASE_LIST);
lastPhase = lastPhase + phaseListJSONArray.length();
}
} catch (IOException e) {
e.printStackTrace();
}
TaskDto lastTask = null;
for (TaskDto compareTask : taskList) {
if (compareTask.phaseNo == lastPhase) {
lastTask = compareTask;
}
}
if (lastTask != null) {
operationTaskLayout.currentTaskDto.isFinished = (lastTask.taskStatus == FINISHED_STATUS);
} else {
operationTaskLayout.currentTaskDto.isFinished = false;
}
operationTaskLayout.currentTaskDto.processKey = task.processKey;
operationTaskLayout.currentTaskDto.processStatus = task.processStatus;
operationTaskLayout.addOperationTaskIcon(operationTaskLayout.currentLayout, operationTaskLayout.currentTaskDto);
}
}
} else {
operationTaskLayout.setIconStatus(taskKey, true);
operationTaskLayout.currentTaskDto.taskKey = taskKey;
operationTaskLayout.currentTaskDto.taskCode = taskCode;
operationTaskLayout.currentTaskDto.isFinished = operationTaskLayout.isTaskFinished(taskKey);
operationTaskLayout.addOperationTaskIcon(operationTaskLayout.currentLayout, operationTaskLayout.currentTaskDto);
}
} else {
operationTaskLayout.setIconStatus(taskKey, true);
operationTaskLayout.currentTaskDto.taskKey = taskKey;
operationTaskLayout.currentTaskDto.taskCode = taskCode;
operationTaskLayout.currentTaskDto.isFinished = operationTaskLayout.isTaskFinished(taskKey);
operationTaskLayout.addOperationTaskIcon(operationTaskLayout.currentLayout, operationTaskLayout.currentTaskDto);
}
operationTaskLayout.setIconStatus(taskKey, true);
operationTaskLayout.currentTaskDto.taskKey = taskKey;
operationTaskLayout.currentTaskDto.taskCode = taskCode;
operationTaskLayout.currentTaskDto.isFinished = operationTaskLayout.isTaskFinished(taskKey);
operationTaskLayout.addOperationTaskIcon(operationTaskLayout.currentLayout, operationTaskLayout.currentTaskDto);
//hideOperationTaskLayout();
} else {
operationTaskLayout.setIconStatus(taskKey, false);
......
......@@ -285,7 +285,16 @@ public class OperationTaskLayout extends RelativeLayout {
public void addAllOperationTaskIcon(final ZoomRelativeLayout rootLayout, final List<OperationTaskDto> dto) {
for (OperationTaskDto task : dto) {
task.isFinished = isTaskFinished(task.taskKey);
TaskDto taskDto = mTaskDao.getTaskByTaskKey(task.taskKey);
task.processKey = taskDto.processKey;
task.processStatus = taskDto.processStatus;
if (StringUtil.isNullOrEmpty(task.processKey)) {
task.isFinished = isTaskFinished(task.taskKey);
} else if (task.processStatus == FINISHED_STATUS) {
task.isFinished = true;
} else {
task.isFinished = false;
}
addOperationTaskIcon(rootLayout, task);
}
}
......@@ -302,6 +311,13 @@ public class OperationTaskLayout extends RelativeLayout {
return mTaskDao.getTaskByTaskKey(taskKey).taskStatus == FINISHED_STATUS;
}
public boolean isProcessFinished(String taskKey) {
if (mTaskDao.getTaskByTaskKey(taskKey) == null) {
return false;
}
return mTaskDao.getTaskByTaskKey(taskKey).taskStatus == FINISHED_STATUS;
}
public void showTaskList(int pageNum, boolean isNormalSize) {
final String script = String.format(SCRIPT_SHOW_TASK_LIST, pageNum + 1);
......
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