Commit fcc8f297 by Lee Jaebin

#32825 作業一覧画面改善

parent 3144d053
......@@ -579,67 +579,6 @@ public class AcmsClient implements AcmsClientResponseListener {
}
/**
* 定期点検データ送信
* @param sid
* @param operationId
* @param taskReportId
* @param taskReportInfoId
* @param reportStartDate
* @param taskReportInfo
* @param formFile
* @param attachedChangeFlag
* @param taskReportSendSaveDate
* @return
* @throws ABVException
* @throws NetworkDisconnectedException
* @throws IOException
*/
public AcmsMessageJSON sendRoutineTaskReportData(String sid, long operationId, int taskReportId, int taskReportInfoId
, Date reportStartDate, String taskReportInfo, File formFile, boolean attachedChangeFlag, Date taskReportSendSaveDate) throws ABVException, NetworkDisconnectedException, IOException {
if (networkAdapter != null && !networkAdapter.isNetworkConnected()) { // NWのチェック
throw new NetworkDisconnectedException();
}
HttpResponse result;
String apiUrl = AcmsApis.getApiUrl(env.acmsAddress, urlPath, AcmsApis.ApiSendRoutineTaskData);
List<HttpMultipart> HttpMultipartList = new ArrayList<HttpMultipart>();
HttpMultipartList.add(new HttpMultipart(ABookKeys.SID, sid));
HttpMultipartList.add(new HttpMultipart(ABookKeys.OPERATION_ID, StringUtil.toString(operationId)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_ID, StringUtil.toString(taskReportId)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO_ID, StringUtil.toString(taskReportInfoId)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.REPORT_START_DATE, DateTimeUtil.toStringForCmsGMT(reportStartDate)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO, taskReportInfo));
HttpMultipartList.add(new HttpMultipart(ABookKeys.ATTACHED_CHANGE_FLAG, attachedChangeFlag ? "1" : "0"));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_SAVE_DATE, DateTimeUtil.toStringForCmsGMT(taskReportSendSaveDate)));
if (formFile != null) {
HttpMultipartList.add(new HttpMultipart(ABookKeys.FORM_FILE, formFile));
}
result = HttpRequestSender.post(apiUrl, HttpMultipartList.toArray(new HttpMultipart[HttpMultipartList.size()]));
Logger.d(TAG, "[sendRoutineTaskReportData].request: operationId=%d, taskReportId=%d, taskReportInfoId=%d, reportStartDate=%tc, taskReportInfo=%s, attachedChangeFlag=%b, taskReportSendSaveDate=%tc"
, operationId, taskReportId, taskReportInfoId, reportStartDate, taskReportInfo, attachedChangeFlag, taskReportSendSaveDate);
AcmsMessageJSON json = new AcmsMessageJSON(result.httpResponseBody);
Logger.d(TAG, "[sendRoutineTaskReportData].response: %s", json);
if (json.errorMessage != null) {
if (json.errorMessage[0].equals("P003")) {
throw new ABVException(ABVExceptionCode.P_E_ACMS_P003);
} else if (json.errorMessage[0].equals("P004")) {
throw new ABVException(ABVExceptionCode.P_E_ACMS_P004);
} else if (json.errorMessage[0].equals("P005")) {
throw new ABVException(ABVExceptionCode.P_E_ACMS_P005);
}
}
if (json.httpStatus != 200) {
throw new AcmsException(ABVExceptionCode.S_E_ACMS_0001, json);
}
return json;
}
/**
* プロジェクトの作業データ取得
* @param param
* @return
......
......@@ -156,4 +156,10 @@ public class Constant {
int NO = 0;
int YES = 1;
}
// 作業可能区分
public interface EnableReport {
int NO = 0;
int YES = 1;
}
}
......@@ -100,6 +100,11 @@ public class OperationDao extends AbstractDao {
dto.enableReportEdit = cursor.getInt(column);
}
column = cursor.getColumnIndex("report_type");
if (column != -1) {
dto.reportType = cursor.getInt(column);
}
return dto;
}
......
......@@ -60,6 +60,16 @@ public class TaskReportDao extends AbstractDao {
if (column != -1) {
dto.reportedFlag = toBool(cursor.getInt(column));
}
column = cursor.getColumnIndex("enable_report");
if (column != -1) {
dto.enableReport = cursor.getInt(column);
}
column = cursor.getColumnIndex("task_report_level");
if (column != -1) {
dto.taskReportLevel = cursor.getInt(column);
}
return dto;
}
......@@ -76,12 +86,20 @@ public class TaskReportDao extends AbstractDao {
+ "task_report_info_id, "
+ "report_start_date, "
+ "report_end_date, "
+ "reported_flg) "
+ "enable_report, "
+ "reported_flg, "
+ "task_report_level) "
+ "values "
+ "(?,?,?,?,?,?,?,?,?,?,?)",
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues());
}
/**
* 作業IDで報告取得
* (作業報告タイプ 昇順、作業報告ID 昇順、報告開始日 昇順)
* @param operationId
* @return
*/
public List<TaskReportDto> getTaskReportByOperationId(Long operationId) {
StringBuilder sb = new StringBuilder();
sb.append(" select ttr.* ");
......@@ -91,7 +109,7 @@ public class TaskReportDao extends AbstractDao {
sb.append(" ON tt.task_key == ttr.task_key ");
sb.append(" WHERE tt.del_flg = 0");
sb.append(" AND tt.operation_id = ?");
sb.append(" ORDER BY task_report_id ASC, report_start_date ASC");
sb.append(" ORDER BY task_report_level ASC, task_report_id ASC, report_start_date ASC");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class);
}
......@@ -127,8 +145,10 @@ public class TaskReportDao extends AbstractDao {
+ "task_report_info_id=?, "
+ "report_start_date=?, "
+ "report_end_date=?, "
+ "reported_flg=? "
+ "where task_key=?",
+ "enable_report=?, "
+ "reported_flg=?, "
+ "task_report_level=? "
+ "where task_key=? AND task_report_level=?",
dto.getUpdateValues());
return count > 0;
}
......@@ -189,7 +209,7 @@ public class TaskReportDao extends AbstractDao {
}
public List<TaskReportDto> selectByTaskKey(String taskKey, int taskReportLevel) {
return rawQueryGetDtoList("select * from t_task_report where task_key=? and task_report_level", new String[]{ "" + taskKey, "" + taskReportLevel }, TaskReportDto.class);
return rawQueryGetDtoList("select * from t_task_report where task_key=? and task_report_level=?", new String[]{ "" + taskKey, "" + taskReportLevel }, TaskReportDto.class);
}
public List<TaskReportDto> selectAll() {
......
......@@ -73,7 +73,7 @@ public class TaskWorkerGroupDao extends AbstractDao {
sql.append(" INNER JOIN m_worker_group AS mwg ");
sql.append(" ON rtwg.group_id = mwg.group_id ");
sql.append(" WHERE rtwg.operation_id = ? ");
sql.append(" ORDER BY rtwg.task_report_level DESC ");
sql.append(" ORDER BY rtwg.task_report_level ASC ");
Logger.v(TAG, "sql=%s", sql);
return rawQueryGetDtoList(sql.toString(), new String[]{""+ operationId}, TaskWorkerGroupDto.class);
}
......
......@@ -29,12 +29,12 @@ public class TaskReportDto extends AbstractDto {
@Override
public Object[] getInsertValues() {
return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, reportedFlag};
return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, enableReport, reportedFlag, taskReportLevel};
}
@Override
public Object[] getUpdateValues() {
return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, reportedFlag, taskKey };
return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, enableReport, reportedFlag, taskReportLevel, taskKey, taskReportLevel };
}
@Override
......
......@@ -244,7 +244,7 @@ public class OperationLogic extends AbstractLogic {
* @param dataSendFlg
* @throws IOException
*/
public void insertTaskReport(String taskKey, long operationId, long contentId, JSONObject taskDirectionsJson, String hotSpotInfo, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException {
public void insertTaskReport(String taskKey, long operationId, long contentId, int enableReport, JSONObject taskDirectionsJson, String hotSpotInfo, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException {
TaskDto taskDto = new TaskDto();
TaskReportDto taskReportDto = new TaskReportDto();
......@@ -278,6 +278,8 @@ public class OperationLogic extends AbstractLogic {
taskReportDto.attachedFileSendFlg = attachedChangeFlag;
// 作業報告
taskReportDto.taskReportLevel = Constant.TaskReportLevel.ReportType;
// 報告可能区分
taskReportDto.enableReport = enableReport;
if (localAttachedFileName != null) {
taskReportDto.localAttachedFileName = localAttachedFileName;
}
......@@ -318,7 +320,7 @@ public class OperationLogic extends AbstractLogic {
* @param dataSendFlg
* @throws IOException
*/
public void updateTaskReport(String taskKey, long operationId, long contentId, JSONObject taskReportJson, String hotSpotInfo, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException {
public void updateTaskReport(String taskKey, long operationId, long contentId, int enableReport, JSONObject taskReportJson, String hotSpotInfo, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
if (taskDto == null) {
// ignore
......@@ -351,7 +353,10 @@ public class OperationLogic extends AbstractLogic {
}
taskReportDto.jsonData = taskReportJson.toString();
taskReportDto.dataSendFlg = dataSendFlg;
// 作業報告階層
taskReportDto.taskReportLevel = Constant.TaskReportLevel.ReportType;
// 報告可能区分
taskReportDto.enableReport = enableReport;
// attachedFileSendFlgがtrueの場合は、更新しない
if (!taskReportDto.attachedFileSendFlg) {
......@@ -453,6 +458,7 @@ public class OperationLogic extends AbstractLogic {
taskReportDto.jsonData = taskReportJson.toString();
taskReportDto.dataSendFlg = dataSendFlg;
taskReportDto.attachedFileSendFlg = attachedChangeFlag;
taskReportDto.taskReportLevel = Constant.TaskReportLevel.ReportReplyType;
// 削除の時、deleteではなく、jsonDataを空にして、データが残っているので、updateする
List<TaskReportDto> taskReport = mTaskReportDao.selectByTaskKey(taskReportDto.taskKey, Constant.TaskReportLevel.ReportReplyType);
......@@ -897,12 +903,12 @@ public class OperationLogic extends AbstractLogic {
*/
public void createJsonForOperationContent(Long operationId, String contentPath, boolean routineTaskReportFlg) throws IOException {
try {
if (routineTaskReportFlg) {
// 定期点検
createRoutineTaskReportJson(operationId, contentPath);
} else {
createTaskReportJson(operationId, contentPath);
// if (routineTaskReportFlg) {
// createRoutineTaskReportJson(operationId, contentPath);
// } else {
// createTaskReportJson(operationId, contentPath);
// }
}
createTaskReportSuggestJson(operationId, contentPath);
createHopSpotJson(operationId, contentPath);
} catch (IOException e) {
......@@ -1022,7 +1028,7 @@ public class OperationLogic extends AbstractLogic {
}
/**
* 作業指示、作業報告用のjsonファイル
* 作業報告用のjsonファイル
* 報告と報告(回答)のデータの区分が必要なので、「taskReport_0」と「taskReport_1」で形式で作成
* 報告(回答)の場合はtaskReport_1を作成
*
......@@ -1034,19 +1040,36 @@ public class OperationLogic extends AbstractLogic {
List<JSONObject> taskReportJsonList = new ArrayList<JSONObject>();
JSONObject taskReportJson = new JSONObject();
List<TaskReportDto> taskReportDtoList = mTaskReportDao.getTaskReportByOperationId(operationId);
// #32926 作業報告画面改善 start
int taskReportLevel = 0;
int level = 0;
int listCount = 0;
for (TaskReportDto dto : taskReportDtoList) {
taskReportLevel = dto.taskReportLevel;
listCount++; // 最後のインデックスの判定のため
if (level != dto.taskReportLevel) {
taskReportJson.put(String.format("taskReport_%s", String.valueOf(level)), taskReportJsonList);
taskReportJsonList = new ArrayList<JSONObject>();
level++;
}
if(dto.jsonData != null && dto.jsonData.length() > 0) {
taskReportJsonList.add(new JSONObject(dto.jsonData).put(ABookKeys.HAS_AUTHORITY, dto.enableReport));
}
// 最後の時、taskReport_{level}でセット
if (listCount == taskReportDtoList.size()) {
taskReportJson.put(String.format("taskReport_%s", String.valueOf(level)), taskReportJsonList);
}
level = dto.taskReportLevel;
}
// データが存在しない場合、
if (taskReportDtoList.size() <= 0) {
taskReportJson.put("taskReport_0", taskReportJsonList);
}
taskReportJson.put(String.format("taskReport_%d", taskReportLevel), taskReportJsonList);
Logger.d(TAG, "createTaskReportJson : " + taskReportJson.toString());
Logger.d(TAG,contentPath + "/" + ABookKeys.TASK_REPORT + ".json");
// #32926 作業報告画面改善 end
FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJson.toString());
}
......@@ -1055,7 +1078,6 @@ public class OperationLogic extends AbstractLogic {
List<JSONObject> taskReportJsonList = new ArrayList<JSONObject>();
JSONObject taskReportJsonRoot = new JSONObject();
JSONObject taskReportJsonRow;
// #32926 作業報告画面改善 start
int taskReportLevel = 0;
int taskReportId = 0;
List<TaskReportDto> routineTaskReportDtoList = mTaskReportDao.getTaskReportByOperationId(operationId);
......@@ -1071,7 +1093,7 @@ public class OperationLogic extends AbstractLogic {
List<JSONObject> taskReportInfoList = new ArrayList<JSONObject>();
if (!StringUtil.isNullOrEmpty(dto.jsonData)) {
taskReportInfoList.add(new JSONObject(dto.jsonData));
taskReportInfoList.add(new JSONObject(dto.jsonData).put(ABookKeys.HAS_AUTHORITY, dto.enableReport));
}
taskReportJsonRow.put(ABookKeys.TASK_REPORT_INFO, taskReportInfoList);
taskReportJsonList.add(taskReportJsonRow);
......@@ -1081,7 +1103,6 @@ public class OperationLogic extends AbstractLogic {
taskReportJsonRoot.put(String.format("taskReport_%d", taskReportLevel), taskReportJsonList);
Logger.d(TAG, "createRoutineTaskReportJson : " + taskReportJsonRoot.toString());
Logger.d(TAG,contentPath + "/" + ABookKeys.TASK_REPORT + ".json");
// #32926 作業報告画面改善 end
FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJsonRoot.toString());
}
......@@ -1337,7 +1358,7 @@ public class OperationLogic extends AbstractLogic {
// 定期点検
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportId, strReportStartDate, taskReportSendDto.taskReportSendId));
} else {
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey,taskReportLevel, taskReportSendDto.taskReportSendId));
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportDto.taskReportLevel, taskReportSendDto.taskReportSendId));
}
} catch (ABVException ex) {
if (ex.getCode() == ABVExceptionCode.P_E_ACMS_P005) {
......@@ -1345,6 +1366,7 @@ public class OperationLogic extends AbstractLogic {
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportId, strReportStartDate, taskReportSendDto.taskReportSendId));
return true;
}
throw ex;
} catch (Exception ex) {
throw ex;
} finally {
......
......@@ -74,8 +74,8 @@
</string-array>
<string-array name="operation_report_types">
<item>タイプ1</item>
<item>タイプ2</item>
<item>タイプ3</item>
<item>報告</item>
<item>定期点検</item>
<item>報告(回答)</item>
</string-array>
</resources>
\ No newline at end of file
......@@ -107,7 +107,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public Long mOperationId;
protected int mXWalkOpenType = -1;
protected int mOperationType;
protected int enableReportHistory; //0:履歴無し 1:履歴可
protected int mEnableReportHistory; //0:履歴無し 1:履歴可
// 報告可能区分
protected int mEnableReportEdit; //0:報告無し 1:報告可
protected String mContentPath;
protected int mStatusCode;
protected boolean isOperationPdf = false;
......@@ -154,8 +156,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (!isLinkedContent) {
operationDto = AbstractLogic.getLogic(OperationLogic.class).getOperation(mOperationId);
mXWalkOpenType = intent.getIntExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, Constant.XWalkOpenType.DEFAULT);
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
mOperationType = operationDto.operationType;
if (mOperationType != OperationType.PDF && isNormalSize()) {
// 縦画面固定
......@@ -171,8 +173,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}).start();
mStatusCode = 0;
}
enableReportHistory = operationDto.enableReportHistory;
mEnableReportEdit = operationDto.enableReportEdit;
mEnableReportHistory = operationDto.enableReportHistory;
linkUrl = intent.getStringExtra("LINKURL"); // LinkURL
......@@ -646,8 +648,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected void createCheckToolbar() {
final RelativeLayout fl;
if (operationDto != null && operationDto.operationType == OperationType.PDF &&
(mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION || mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT)) {
if (operationDto != null && operationDto.operationType == OperationType.PDF && mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
fl = (RelativeLayout) findViewById(R.id.RelativeLayout2);
} else {
fl = (RelativeLayout) findViewById(R.id.frameTopbar);
......@@ -689,8 +690,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
});
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
if (mOperationType != OperationType.PDF && isNormalSize()) {
// 縦画面固定
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
......@@ -923,7 +924,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
};
ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this,
mCmd, mTaskKey, enableReportHistory, abookCheckParam, mOperationId, mContentPath, getContentId(),
mCmd, mTaskKey, mEnableReportHistory, abookCheckParam, mOperationId, mContentPath, getContentId(),
operationDto.reportType, finishCallback,
taskReportLevel);
......@@ -1181,8 +1182,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
return isOperationPdf;
}
public boolean isDirector() {
return mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION;
/**
* 報告可能フラグ
* @return
*/
public boolean isReportEdit() {
return mEnableReportEdit == Constant.EnableReportEdit.YES;
}
/**
......
......@@ -896,7 +896,7 @@ public class OperationListActivity extends ABVUIActivity {
taskReportJson.put(ABookKeys.TASK_STATUS, serverTaskDto.taskStatus);
// 作業報告を更新
// update
mOperationLogic.updateTaskReport(serverTaskDto.taskKey, serverTaskDto.operationId, operationContentDto.contentId,
mOperationLogic.updateTaskReport(serverTaskDto.taskKey, serverTaskDto.operationId, operationContentDto.contentId, taskReportDto.enableReport,
taskReportJson, serverTaskDto.taskHotSpotInfo, attachedFileName, false, false);
} else {
// 作業報告(回答)
......@@ -924,7 +924,7 @@ public class OperationListActivity extends ABVUIActivity {
taskReportJson = new JSONObject(taskReportDto.jsonData);
taskReportJson.put(ABookKeys.TASK_STATUS, serverTaskDto.taskStatus);
mOperationLogic.insertTaskReport(serverTaskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId,
mOperationLogic.insertTaskReport(serverTaskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId, taskReportDto.enableReport,
taskReportJson, serverTaskDto.taskHotSpotInfo, attachedFileName, false, false);
} else {
if (taskReportDto.jsonData != null) {
......
......@@ -90,8 +90,6 @@ public class ABookCheckWebViewHelper extends ABookHelper {
String reportStartDate = "";
boolean sendTaskReportDataFlg = false;
// TODO検討
// copyTaskAttachedMovie(operationId, contentId, taskKey, String.valueOf(taskReportLevel));
if (reportType == Constant.ReportType.Routine) {
taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = param.get(ABookKeys.REPORT_START_DATE).replace("T", " ");
......@@ -115,12 +113,10 @@ public class ABookCheckWebViewHelper extends ABookHelper {
sendTaskData(context, operationId, taskKey, taskReportLevel);
break;
// #32782 指示者テーブル関連削除 end
case ABookKeys.CMD_MOVE_HOT_SPOT:
mOperationLogic.updateTaskHotspot(taskKey, param);
mOperationLogic.createHopSpotJson(operationId, contentPath);
break;
// case ABookKeys.CMD_CANCEL_TASK_DIRECTIONS:
case ABookKeys.CMD_CANCEL_TASK_REPORT:
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
mFinishCallback.callback(false);
......@@ -164,12 +160,11 @@ public class ABookCheckWebViewHelper extends ABookHelper {
OperationDto operationDto = mOperationLogic.getOperation(operationId);
boolean isError = false;
try {
mOperationLogic.updateSyncOperation(operationId, true);
if (mOperationLogic.sendTaskReportSendData(operationId, taskKey, taskReportLevel, progressCallback)) {
context.handleErrorMessageToast(R.string.P005);
}
mOperationLogic.updateSyncOperation(operationId, true);
} catch (ABVException ex) {
Logger.e(TAG, "sendTaskData", ex);
// if (isDirections) {
......@@ -300,9 +295,9 @@ public class ABookCheckWebViewHelper extends ABookHelper {
if (taskReportLevel == Constant.TaskReportLevel.ReportType) {
String hotSpotInfo = param.get(ABookKeys.HOT_SPOT);
if (insertFlg) {
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportJson, hotSpotInfo, null, attachedChangeFlag, true);
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, Constant.EnableReport.YES, taskReportJson, hotSpotInfo, null, attachedChangeFlag, true);
} else {
mOperationLogic.updateTaskReport(taskKey, operationId, contentId, taskReportJson, hotSpotInfo, null, attachedChangeFlag, true);
mOperationLogic.updateTaskReport(taskKey, operationId, contentId, Constant.EnableReport.YES, taskReportJson, hotSpotInfo, null, attachedChangeFlag, true);
}
} else {
if (insertFlg) {
......@@ -340,6 +335,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
copyTaskAttachedMovie(operationId, contentId, taskDto.taskKey, taskReportDto.taskReportLevel);
}
}
}
} catch (IOException e) {
Logger.e(TAG, "fileCopyToCacheAttachedDir error. ", e);
......
......@@ -89,7 +89,6 @@ import jp.agentec.abook.abv.bl.acms.client.json.content.PageInfoJSON;
import jp.agentec.abook.abv.bl.acms.client.json.content.PageInfoJSON.PageInfoJSONData;
import jp.agentec.abook.abv.bl.acms.client.json.content.PageObjectJSON;
import jp.agentec.abook.abv.bl.acms.client.json.content.TaskHotspotJSON;
import jp.agentec.abook.abv.bl.acms.type.OperationAuthLevel;
import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
......@@ -4913,7 +4912,6 @@ public class ContentViewActivity extends ABVContentViewActivity {
}
switch (mXWalkOpenType) {
case Constant.XWalkOpenType.TASK_DERECTION:
case Constant.XWalkOpenType.TASK_REPORT:
if (mOperationType == OperationType.LIST) {
taskListButton.setVisibility(View.GONE);
......@@ -5041,8 +5039,8 @@ public class ContentViewActivity extends ABVContentViewActivity {
// 移動・タップの切り替えボタン
btnMoveOrClickToggleIcon = (ImageButton) mScaleZoomLayout.findViewById(id.btn_move_click_toggle);
if (isDirector()) {
// 指示者の場合
if (isReportEdit()) {
// 報告の場合
btnMoveOrClickToggleIcon.setVisibility(View.VISIBLE);
btnMoveOrClickToggleIcon.setOnClickListener(new View.OnClickListener() {
@Override
......@@ -5058,7 +5056,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
}
});
} else {
// 作業者の場合
// 報告(回答)の場合
btnMoveOrClickToggleIcon.setVisibility(View.INVISIBLE);
}
......@@ -5243,7 +5241,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
}
public int getOperationReportUpdateType() {
return enableReportHistory;
return mEnableReportHistory;
}
/**
......
......@@ -329,7 +329,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
}
});
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION || mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
webView.addJavascriptInterface(jsInf, "android");
}
Logger.d(TAG, "loadUrl: " + url);
......
......@@ -349,7 +349,7 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
return false;
}
});
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION || mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
webView.addJavascriptInterface(jsInf, "android");
}
// webView.postUrl(url,EncodingUtils.getBytes("", "utf-8"));
......
......@@ -184,7 +184,6 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
}
switch (mXWalkOpenType) {
case Constant.XWalkOpenType.TASK_DERECTION:
case Constant.XWalkOpenType.TASK_REPORT:
if (mOperationType == OperationType.LIST) {
taskListButton.setVisibility(View.GONE);
......@@ -212,7 +211,7 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
@Override
protected void onDestroy() {
Logger.d(TAG, "onDestroy");
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION || mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
// tempファイル削除
FileUtil.delete(ABVEnvironment.getInstance().getTempDirPath(contentId));
FileUtil.delete(ABVEnvironment.getInstance().getAttachedMoviesFilePath(contentId));
......
......@@ -244,7 +244,7 @@ public class OperationTaskLayout extends RelativeLayout {
taskView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent event) {
if (mContext.mMoveTaskFlg && rootLayout.isEnableOperationTaskNewOrMove()) {
if (mContext.mMoveTaskFlg && mContext.isReportEdit()) {
// 指示者且つ、移動モードの場合
if (event.getAction() == MotionEvent.ACTION_DOWN) {
ClipData data = ClipData.newPlainText("", "");
......
......@@ -924,7 +924,7 @@ public class ZoomRelativeLayout extends RelativeLayout {
Logger.v(TAG, "[OnDoubleTapListener]:[onDoubleTap]");
if (isOperationPdf && mContext instanceof ContentViewActivity) {
if(((ContentViewActivity) mContext).getOpenedProjestTask() || !isEnableOperationTaskNewOrMove() || ((ContentViewActivity) mContext).mMoveTaskFlg) {
if(((ContentViewActivity) mContext).getOpenedProjestTask() || !((ContentViewActivity) mContext).isReportEdit() || ((ContentViewActivity) mContext).mMoveTaskFlg) {
return true;
}
......@@ -999,10 +999,6 @@ public class ZoomRelativeLayout extends RelativeLayout {
}
};
public boolean isEnableOperationTaskNewOrMove() {
return ((ContentViewActivity)mContext).isDirector();
}
public boolean isZooming() {
return mScaleFactor > 1.0f;
}
......
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