Commit 3e9b57d2 by Lee Munkyeong

図面hotspot色不具合対応

parent c65acac7
......@@ -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;
......@@ -1222,7 +1223,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 +1250,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 +1258,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 +2171,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
......
......@@ -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;
......@@ -5404,14 +5416,81 @@ 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) {
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");
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);
}
}
} 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);
}
}
}
int processStatus = processList.getJSONObject(listCount).getInt(ABookKeys.PROCESS_STATUS);
}
} 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);
......
......@@ -302,6 +302,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