Commit 3817e566 by Lee Munkyeong

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

parent 3e9b57d2
......@@ -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;
......
......@@ -117,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);
}
......@@ -370,7 +370,6 @@ public class OperationLogic extends AbstractLogic {
insertFlg = false;
break;
}
mCallBack.callback(1);
}
// 更新されたら以下の処理は行わない
......@@ -398,7 +397,6 @@ public class OperationLogic extends AbstractLogic {
for (OperationGroupMasterRelationDto operationGroupMasterRelationDto : serverOperationDto.operationGroupMasterRelationDtoList) {
mOperationGroupMasterOperationDao.insertOperationGroupMasterOperation(operationGroupMasterRelationDto);
}
mCallBack.callback(2);
}
// 作業担当グループ登録
......
......@@ -348,7 +348,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
public boolean mMoveTaskFlg = false;
private long currentRemoteObjectId = 0;
private static final int FINISHED_STATUS = 999;
/**
* スクロールステータス
......@@ -5363,6 +5363,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
mMainLayout.addView(operationTaskLayout);
List<OperationTaskDto> tasks = mTaskHotspotJSON.getPageTasks(pageNumber);
operationTaskLayout.addAllOperationTaskIcon(rootLayout, tasks);
//画面回転の時
......@@ -5416,64 +5417,49 @@ public class ContentViewActivity extends ABVContentViewActivity {
hotspot = new JSONObject(checkParam.get(ABookKeys.HOT_SPOT));
taskCode = hotspot.getString(ABookKeys.TASK_CODE);
}
OperationDto operation = mOperationDao.getOperation(mOperationId);
String jsonPath = "";
if ((operation.operationType == PANO || operation.operationType == DRAWING || operation.operationType == PDF) && operation.reportType == Constant.ReportType.ReportContinuous) {
jsonPath = mContentPath.replaceAll("panoImage","processList").replaceAll("taskPdf","processList");
JSONObject processInfoJson = null;
JSONObject hotspotInfoJson = null;
String processKey = checkParam.get(ABookKeys.PROCESS_KEY) != null? checkParam.get(ABookKeys.PROCESS_KEY) : "";
try {
try {
processInfoJson = new JSONObject(mOperationLogic.getProcessDataAndCreateJson(mOperationId, jsonPath, false));
} catch (NetworkDisconnectedException e) {
e.printStackTrace();
} catch (ABVException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
hotspotInfoJson = new JSONObject(FileUtil.readTextFile(jsonPath + "/taskHotspot.json"));
} catch (IOException e) {
e.printStackTrace();
}
if (processInfoJson != null && processInfoJson.has("processList")) {
JSONArray processList = processInfoJson.getJSONArray("processList");
for (int listCount = 0; listCount < processList.length(); listCount++) {
if (processList.getJSONObject(listCount).length() == 0) {
break;
}
String compareProcessKey = processList.getJSONObject(listCount).getString(ABookKeys.PROCESS_KEY);
int compareProcessStatus = processList.getJSONObject(listCount).getInt(ABookKeys.PROCESS_STATUS);
if (processKey.equals(compareProcessKey)) {
if (compareProcessStatus == 999 && hotspotInfoJson != null) {
JSONArray hotspotList = hotspotInfoJson.getJSONArray("hotspot");
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;
operationTaskLayout.currentTaskDto.isFinished = true;
operationTaskLayout.addOperationTaskIcon(operationTaskLayout.currentLayout, operationTaskLayout.currentTaskDto);
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 {
if (checkParam.get("phaseNo") != null && !Objects.equals(checkParam.get("phaseNo"), "1")) {
return;
} else {
operationTaskLayout.setIconStatus(taskKey, true);
operationTaskLayout.currentTaskDto.taskKey = taskKey;
operationTaskLayout.currentTaskDto.taskCode = taskCode;
operationTaskLayout.currentTaskDto.isFinished = false;
operationTaskLayout.addOperationTaskIcon(operationTaskLayout.currentLayout, operationTaskLayout.currentTaskDto);
}
}
operationTaskLayout.currentTaskDto.processKey = task.processKey;
operationTaskLayout.currentTaskDto.processStatus = task.processStatus;
operationTaskLayout.addOperationTaskIcon(operationTaskLayout.currentLayout, operationTaskLayout.currentTaskDto);
}
int processStatus = processList.getJSONObject(listCount).getInt(ABookKeys.PROCESS_STATUS);
}
} else {
operationTaskLayout.setIconStatus(taskKey, true);
......
......@@ -285,7 +285,16 @@ public class OperationTaskLayout extends RelativeLayout {
public void addAllOperationTaskIcon(final ZoomRelativeLayout rootLayout, final List<OperationTaskDto> dto) {
for (OperationTaskDto task : dto) {
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);
}
}
......
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