Commit 3817e566 by Lee Munkyeong

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

parent 3e9b57d2
...@@ -193,6 +193,11 @@ public class ABookKeys { ...@@ -193,6 +193,11 @@ public class ABookKeys {
public static final String THETA_LIST_ACTIVITY_FLG = "thetaListActivityFlg"; 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_KEY = "processKey";
public static final String PROCESS_STATUS = "processStatus"; public static final String PROCESS_STATUS = "processStatus";
public static final String PHASE_NO = "phaseNo"; public static final String PHASE_NO = "phaseNo";
......
...@@ -204,29 +204,32 @@ public class ContentRefresher { ...@@ -204,29 +204,32 @@ public class ContentRefresher {
} }
groupLogic.initializeGroups(); // グループ設定(グループ変更の場合、FetchDateをクリアする) groupLogic.initializeGroups(); // グループ設定(グループ変更の場合、FetchDateをクリアする)
if (mProgressCallback != null) { if (mProgressCallback != null) {
mProgressCallback.callback(5); mProgressCallback.callback(10);
} }
categoryLogic.initializeCategories(); // カテゴリ設定 categoryLogic.initializeCategories(); // カテゴリ設定
// 絞り検索マスタデータの最新更新された時のFetchDateを一時に保存する。 // 絞り検索マスタデータの最新更新された時のFetchDateを一時に保存する。
if (mProgressCallback != null) { if (mProgressCallback != null) {
mProgressCallback.callback(5); mProgressCallback.callback(10);
} }
// CMSでメンテナンスされる絞り検索マスタデータをアプリから取得できるようにJSONファイルを生成する。 // CMSでメンテナンスされる絞り検索マスタデータをアプリから取得できるようにJSONファイルを生成する。
apertureMasterDataLogic.initializeApertureMasterData(); apertureMasterDataLogic.initializeApertureMasterData();
if (mProgressCallback != null) { if (mProgressCallback != null) {
mProgressCallback.callback(5); mProgressCallback.callback(10);
} }
// 作業種別情報を取得 // 作業種別情報を取得
operationGroupMasterLogic.setOperationGroupMaster(); operationGroupMasterLogic.setOperationGroupMaster();
if (mProgressCallback != null) { if (mProgressCallback != null) {
mProgressCallback.callback(5); mProgressCallback.callback(10);
} }
if (interrupt) { // この時点で停止要求が来た場合先には進まない。(ServiceOption/Group/Categoryの更新は1セットで行う(トランザクションはそれぞれ別)) if (interrupt) { // この時点で停止要求が来た場合先には進まない。(ServiceOption/Group/Categoryの更新は1セットで行う(トランザクションはそれぞれ別))
Logger.d(TAG, "stop refresh worker before content update."); Logger.d(TAG, "stop refresh worker before content update.");
setFail(); setFail();
updateRefreshContentListState(-1L, null, mProgressCallback); updateRefreshContentListState(-1L, null, mProgressCallback);
if (mProgressCallback != null) {
mProgressCallback.callback(10);
}
return; return;
} }
isFinishedContentCheck = retrieveServerContent(localContents, mProgressCallback); // ContentVersionAPIを呼出し新規と更新の場合ContentInfoをDLする isFinishedContentCheck = retrieveServerContent(localContents, mProgressCallback); // ContentVersionAPIを呼出し新規と更新の場合ContentInfoをDLする
...@@ -236,13 +239,12 @@ public class ContentRefresher { ...@@ -236,13 +239,12 @@ public class ContentRefresher {
initializingRefreshing = false; initializingRefreshing = false;
if (!isRefreshing()) { if (!isRefreshing()) {
updateRefreshContentListState(-1L, null, mProgressCallback); updateRefreshContentListState(-1L, null);
} }
mProgressCallback.callback(100);
} catch (Exception e) { } catch (Exception e) {
Logger.e("refreshContent failed.", e); Logger.e("refreshContent failed.", e);
mProgressCallback.callback(100);
updateRefreshContentListState(-1L, e); updateRefreshContentListState(-1L, e);
mProgressCallback.callback(100);
} }
contentDownloader.kickTask(); contentDownloader.kickTask();
Logger.i(TAG, "refresh main thread end.-----------------------------------------------"); Logger.i(TAG, "refresh main thread end.-----------------------------------------------");
...@@ -342,11 +344,6 @@ public class ContentRefresher { ...@@ -342,11 +344,6 @@ public class ContentRefresher {
List<ContentDto> serverContents = json.contentVersions; List<ContentDto> serverContents = json.contentVersions;
// DTO Info:contentId, metaVersion, resourceVersion, contentNameKana, readerShareFlg // 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; int totalProgress = 0;
for (ContentDto serverContentDto : serverContents) { for (ContentDto serverContentDto : serverContents) {
while (isBusyRefreshingContent()) { while (isBusyRefreshingContent()) {
...@@ -386,9 +383,9 @@ public class ContentRefresher { ...@@ -386,9 +383,9 @@ public class ContentRefresher {
} }
} }
} }
if (mProgressCallback != null && totalProgress < 50) { if (mProgressCallback != null && totalProgress < 20) {
mProgressCallback.callback(progressPercent); mProgressCallback.callback(1);
totalProgress = totalProgress + progressPercent; totalProgress = totalProgress + 1;
} }
} }
......
...@@ -14,6 +14,8 @@ public class OperationTaskDto extends AbstractDto { ...@@ -14,6 +14,8 @@ public class OperationTaskDto extends AbstractDto {
public int seqId; public int seqId;
public Date insertDate; public Date insertDate;
public Date updateDate; public Date updateDate;
public String processKey;
public int processStatus;
public float pdfX; public float pdfX;
public float pdfY; public float pdfY;
public boolean isFinished; public boolean isFinished;
......
...@@ -117,7 +117,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -117,7 +117,7 @@ public class OperationLogic extends AbstractLogic {
public void initializeOperations(Callback mCallBack) throws AcmsException, NetworkDisconnectedException { public void initializeOperations(Callback mCallBack) throws AcmsException, NetworkDisconnectedException {
// 作業グループリスト取得 // 作業グループリスト取得
setWorkingGroupList(); setWorkingGroupList();
mCallBack.callback(5); mCallBack.callback(2);
// 作業一覧取得し、登録・更新・削除する // 作業一覧取得し、登録・更新・削除する
retrieveServerOperation(mCallBack); retrieveServerOperation(mCallBack);
} }
...@@ -370,7 +370,6 @@ public class OperationLogic extends AbstractLogic { ...@@ -370,7 +370,6 @@ public class OperationLogic extends AbstractLogic {
insertFlg = false; insertFlg = false;
break; break;
} }
mCallBack.callback(1);
} }
// 更新されたら以下の処理は行わない // 更新されたら以下の処理は行わない
...@@ -398,7 +397,6 @@ public class OperationLogic extends AbstractLogic { ...@@ -398,7 +397,6 @@ public class OperationLogic extends AbstractLogic {
for (OperationGroupMasterRelationDto operationGroupMasterRelationDto : serverOperationDto.operationGroupMasterRelationDtoList) { for (OperationGroupMasterRelationDto operationGroupMasterRelationDto : serverOperationDto.operationGroupMasterRelationDtoList) {
mOperationGroupMasterOperationDao.insertOperationGroupMasterOperation(operationGroupMasterRelationDto); mOperationGroupMasterOperationDao.insertOperationGroupMasterOperation(operationGroupMasterRelationDto);
} }
mCallBack.callback(2);
} }
// 作業担当グループ登録 // 作業担当グループ登録
......
...@@ -348,7 +348,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -348,7 +348,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
public boolean mMoveTaskFlg = false; public boolean mMoveTaskFlg = false;
private long currentRemoteObjectId = 0; private long currentRemoteObjectId = 0;
private static final int FINISHED_STATUS = 999;
/** /**
* スクロールステータス * スクロールステータス
...@@ -5363,6 +5363,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5363,6 +5363,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
mMainLayout.addView(operationTaskLayout); mMainLayout.addView(operationTaskLayout);
List<OperationTaskDto> tasks = mTaskHotspotJSON.getPageTasks(pageNumber); List<OperationTaskDto> tasks = mTaskHotspotJSON.getPageTasks(pageNumber);
operationTaskLayout.addAllOperationTaskIcon(rootLayout, tasks); operationTaskLayout.addAllOperationTaskIcon(rootLayout, tasks);
//画面回転の時 //画面回転の時
...@@ -5416,64 +5417,49 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5416,64 +5417,49 @@ public class ContentViewActivity extends ABVContentViewActivity {
hotspot = new JSONObject(checkParam.get(ABookKeys.HOT_SPOT)); hotspot = new JSONObject(checkParam.get(ABookKeys.HOT_SPOT));
taskCode = hotspot.getString(ABookKeys.TASK_CODE); taskCode = hotspot.getString(ABookKeys.TASK_CODE);
} }
OperationDto operation = mOperationDao.getOperation(mOperationId); OperationDto operation = mOperationDao.getOperation(mOperationId);
String jsonPath = ""; String jsonPath = "";
if ((operation.operationType == PANO || operation.operationType == DRAWING || operation.operationType == PDF) && operation.reportType == Constant.ReportType.ReportContinuous) { if ((operation.operationType == PANO || operation.operationType == DRAWING || operation.operationType == PDF) && operation.reportType == Constant.ReportType.ReportContinuous) {
jsonPath = mContentPath.replaceAll("panoImage","processList").replaceAll("taskPdf","processList"); String processKey = checkParam.get(ABookKeys.PROCESS_KEY) != null ? checkParam.get(ABookKeys.PROCESS_KEY) : "";
List<TaskDto> taskList = mTaskDao.getTaskByProcessKey(processKey);
JSONObject processInfoJson = null; if (taskList != null && taskList.size() > 0) {
JSONObject hotspotInfoJson = null; for (TaskDto task : taskList) {
String processKey = checkParam.get(ABookKeys.PROCESS_KEY) != null? checkParam.get(ABookKeys.PROCESS_KEY) : ""; if (task.phaseNo == 1) {
try { operationTaskLayout.setIconStatus(taskKey, true);
try { operationTaskLayout.currentTaskDto.taskKey = task.taskKey;
processInfoJson = new JSONObject(mOperationLogic.getProcessDataAndCreateJson(mOperationId, jsonPath, false)); operationTaskLayout.currentTaskDto.taskCode = task.taskCode;
} catch (NetworkDisconnectedException e) { jsonPath = mContentPath.replaceAll(ABookKeys.PANO_IMAGE,ABookKeys.PROCESS_LIST).replaceAll(ABookKeys.TASK_PDF, ABookKeys.PROCESS_LIST) + "/" + ABookKeys.PHASE_INFO_JSON;
e.printStackTrace(); JSONObject phaseInfo = null;
} catch (ABVException e) { int lastPhase = 0;
e.printStackTrace(); try {
} catch (IOException e) { phaseInfo = new JSONObject(FileUtil.readTextFile(jsonPath));
e.printStackTrace(); JSONArray timeLineListJSONArray = phaseInfo.getJSONArray(ABookKeys.TIME_LINE_LIST);
} for (int listCount = 0; listCount < timeLineListJSONArray.length(); listCount++) {
hotspotInfoJson = new JSONObject(FileUtil.readTextFile(jsonPath + "/taskHotspot.json")); if (timeLineListJSONArray.getJSONObject(listCount).length() == 0) {
} catch (IOException e) { break;
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");
List<TaskDto> taskList = mTaskDao.getTaskByProcessKey(processKey);
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);
} }
JSONObject timeLineJSONObject = timeLineListJSONArray.getJSONObject(listCount);
JSONArray phaseListJSONArray = timeLineJSONObject.getJSONArray(ABookKeys.PHASE_LIST);
lastPhase = lastPhase + phaseListJSONArray.length();
} }
} else { } catch (IOException e) {
if (checkParam.get("phaseNo") != null && !Objects.equals(checkParam.get("phaseNo"), "1")) { e.printStackTrace();
return; }
} else { TaskDto lastTask = null;
operationTaskLayout.setIconStatus(taskKey, true); for (TaskDto compareTask : taskList) {
operationTaskLayout.currentTaskDto.taskKey = taskKey; if (compareTask.phaseNo == lastPhase) {
operationTaskLayout.currentTaskDto.taskCode = taskCode; lastTask = compareTask;
operationTaskLayout.currentTaskDto.isFinished = false;
operationTaskLayout.addOperationTaskIcon(operationTaskLayout.currentLayout, operationTaskLayout.currentTaskDto);
} }
} }
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);
} }
int processStatus = processList.getJSONObject(listCount).getInt(ABookKeys.PROCESS_STATUS);
} }
} else { } else {
operationTaskLayout.setIconStatus(taskKey, true); operationTaskLayout.setIconStatus(taskKey, true);
......
...@@ -285,7 +285,16 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -285,7 +285,16 @@ public class OperationTaskLayout extends RelativeLayout {
public void addAllOperationTaskIcon(final ZoomRelativeLayout rootLayout, final List<OperationTaskDto> dto) { public void addAllOperationTaskIcon(final ZoomRelativeLayout rootLayout, final List<OperationTaskDto> dto) {
for (OperationTaskDto task : 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); 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