Commit 2324d341 by Kim Jinsung

#39910 連続作業機能

全削除機能実装
parent dbe02eef
...@@ -42,6 +42,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.AddMemberGroupParameters; ...@@ -42,6 +42,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.AddMemberGroupParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.AppStoreNewLoginParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.AppStoreNewLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.CheckSendLogParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.CheckSendLogParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ContentReadingLogParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.ContentReadingLogParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.DeleteProcessParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.EnqueteReplyParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.EnqueteReplyParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.EnterpriseLoginParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.EnterpriseLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.EnterpriseNewLoginParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.EnterpriseNewLoginParameters;
...@@ -762,6 +763,17 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -762,6 +763,17 @@ public class AcmsClient implements AcmsClientResponseListener {
return new ApertureMasterDataJSON(response.httpResponseBody); return new ApertureMasterDataJSON(response.httpResponseBody);
} }
/**
* 工程情報を全部削除する。(全削除ボタンタップ時)
* @param params (Sid, operationId, processKey情報)
* @return 結果Json
* @throws ABVException
* @throws NetworkDisconnectedException
*/
public void sendDeleteProcess(DeleteProcessParameters params) throws ABVException, NetworkDisconnectedException {
HttpResponse response = send(AcmsApis.ApiDeleteProcess, params);
validateHttpResponse(response, AcmsApis.ApiGetPushMessages);
}
/**********************************************************************************************/ /**********************************************************************************************/
/** 以下、共用メソッド---------------------------------------------------------------------- **/ /** 以下、共用メソッド---------------------------------------------------------------------- **/
/**********************************************************************************************/ /**********************************************************************************************/
......
package jp.agentec.abook.abv.bl.acms.client.parameters;
public class DeleteProcessParameters extends AcmsParameters {
private long operationId;
private String processKey;
public DeleteProcessParameters(String sid, long operationId, String processKey) {
super(sid);
this.operationId = operationId;
this.processKey = processKey;
}
public long getOperationId() { return this.operationId; }
public String getProcessKey() { return this.processKey; }
}
...@@ -160,9 +160,13 @@ public class AcmsApis { ...@@ -160,9 +160,13 @@ public class AcmsApis {
public static final String ApiQuickReportSearch = "quickReportSearch"; public static final String ApiQuickReportSearch = "quickReportSearch";
// 簡易帳票リビジョン一覧取得 // 簡易帳票リビジョン一覧取得
public static final String ApiQuickReportRevision = "quickReportRevision"; public static final String ApiQuickReportRevision = "quickReportRevision";
// 連続作業の承認情報取得 // 連続作業の承認情報取得
public static final String ApiGetProcessData = "getProcessData"; public static final String ApiGetProcessData = "getProcessData";
// 連続作業の全工程の全削除の送信
public static final String ApiDeleteProcess = "deleteProcess";
// チャット // チャット
public static final String ChatApiUrlFormat = "%s/%s/chatapi/%s/"; public static final String ChatApiUrlFormat = "%s/%s/chatapi/%s/";
public static final String ApiGetChatPushData = "push"; public static final String ApiGetChatPushData = "push";
...@@ -211,7 +215,7 @@ public class AcmsApis { ...@@ -211,7 +215,7 @@ public class AcmsApis {
methodName.equals(ApiGetTaskFile) || methodName.equals(ApiSceneEntry) || methodName.equals(ApiTaskContentEntry) || methodName.equals(ApiGetTaskFile) || methodName.equals(ApiSceneEntry) || methodName.equals(ApiTaskContentEntry) ||
methodName.equals(ApiSendPushMessage) || methodName.equals(ApiGetPushMessages) || methodName.equals(ApiSendRoutineTaskData) || methodName.equals(ApiSendPushMessage) || methodName.equals(ApiGetPushMessages) || methodName.equals(ApiSendRoutineTaskData) ||
methodName.equals(ApiOperationGroupMaster) || methodName.equals(ApiGetApertureMasterData) || methodName.equals(ApiQuickReportSearch) || methodName.equals(ApiQuickReportRevision) methodName.equals(ApiOperationGroupMaster) || methodName.equals(ApiGetApertureMasterData) || methodName.equals(ApiQuickReportSearch) || methodName.equals(ApiQuickReportRevision)
|| methodName.equals(ApiGetProcessData)) { || methodName.equals(ApiGetProcessData) || methodName.equals(ApiDeleteProcess)) {
apiValue = Constant.ApiValue.checkapi; apiValue = Constant.ApiValue.checkapi;
} else if (methodName.equals(ApiGetChatPushData)) { // pushActionはchatapiを指定 } else if (methodName.equals(ApiGetChatPushData)) { // pushActionはchatapiを指定
apiValue = Constant.ApiValue.chatapi; apiValue = Constant.ApiValue.chatapi;
......
...@@ -91,7 +91,7 @@ public class AbstractDao { ...@@ -91,7 +91,7 @@ public class AbstractDao {
protected long delete(String table, String whereClause, String[] whereArgs) { protected long delete(String table, String whereClause, String[] whereArgs) {
SQLiteDatabase db = dbConn.getDatabase(); SQLiteDatabase db = dbConn.getDatabase();
if (Logger.isVerboseEnabled()) { if (Logger.isVerboseEnabled()) {
Logger.v(TAG, "table=%s where=%s [%s]", table, whereClause, join(whereArgs)); Logger.v(TAG, "delete table=%s where=%s [%s]", table, whereClause, join(whereArgs));
} }
return db.delete(table, whereClause, whereArgs); return db.delete(table, whereClause, whereArgs);
} }
......
...@@ -80,6 +80,10 @@ public class TaskDao extends AbstractDao { ...@@ -80,6 +80,10 @@ public class TaskDao extends AbstractDao {
return rawQueryGetDtoList("select * from t_task where operation_id = ? and del_flg = 0 ", new String[]{"" + operationId}, TaskDto.class); return rawQueryGetDtoList("select * from t_task where operation_id = ? and del_flg = 0 ", new String[]{"" + operationId}, TaskDto.class);
} }
public List<TaskDto> selectTaskByOperationId(Long operationId, boolean deleteFlg) {
return rawQueryGetDtoList("select * from t_task where operation_id = ? and del_flg = ? ", new String[]{"" + operationId, "" + (deleteFlg ? 1 : 0)}, TaskDto.class);
}
public List<TaskDto> selectTaskGroupByProcessKeyByOperationId(Long operationId) { public List<TaskDto> selectTaskGroupByProcessKeyByOperationId(Long operationId) {
return rawQueryGetDtoList("select *, min(phase_no) as min_phase_no from t_task where operation_id = ? and del_flg = 0 group by process_key order by rowid asc", new String[]{"" + operationId}, TaskDto.class); return rawQueryGetDtoList("select *, min(phase_no) as min_phase_no from t_task where operation_id = ? and del_flg = 0 group by process_key order by rowid asc", new String[]{"" + operationId}, TaskDto.class);
} }
...@@ -116,8 +120,8 @@ public class TaskDao extends AbstractDao { ...@@ -116,8 +120,8 @@ public class TaskDao extends AbstractDao {
+ "task_name, " + "task_name, "
+ "phase_no, " + "phase_no, "
+ "phase_status, " + "phase_status, "
+ "process_status, " + "process_key, "
+ "process_key) " + "process_status) "
+ "values " + "values "
+ "(?,?,?,?,?,?,?,?,?,?,?)", + "(?,?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues()); dto.getInsertValues());
...@@ -165,7 +169,18 @@ public class TaskDao extends AbstractDao { ...@@ -165,7 +169,18 @@ public class TaskDao extends AbstractDao {
delete("t_task_report_send", "task_key=?", keyValues); delete("t_task_report_send", "task_key=?", keyValues);
delete("t_task_report_approval", "task_key=?", keyValues); delete("t_task_report_approval", "task_key=?", keyValues);
} }
/**
* 作業削除(連続作業用)
* @param taskKey
*/
public void deleteTaskData(String taskKey, String processKey) {
String[] keyValues = new String[]{""+ taskKey};
delete("t_task", "task_key=?", keyValues);
delete("t_task_report", "task_key=?", keyValues);
delete("t_task_report_items", "task_key=?", keyValues);
delete("t_task_report_send", "task_key=?", keyValues);
delete("t_task_report_approval", "process_key=?", new String[]{processKey});
}
/** /**
* 作業削除 * 作業削除
* @param dto * @param dto
......
...@@ -98,4 +98,12 @@ public class TaskReportApprovalDao extends AbstractDao { ...@@ -98,4 +98,12 @@ public class TaskReportApprovalDao extends AbstractDao {
dto.getUpdateValues()); dto.getUpdateValues());
return count > 0; return count > 0;
} }
/**
* テーブル物理削除
* @param processKey 工程キー
*/
public void delete(String processKey) {
delete("t_task_report_approval", "process_key=?", new String[] { processKey });
}
} }
...@@ -79,4 +79,12 @@ public class TaskReportItemsDao extends AbstractDao { ...@@ -79,4 +79,12 @@ public class TaskReportItemsDao extends AbstractDao {
long count = update("update t_task_report_items set input_value=? where task_report_level=? and item_key=? and task_key=? ", dto.getUpdateValues()); long count = update("update t_task_report_items set input_value=? where task_report_level=? and item_key=? and task_key=? ", dto.getUpdateValues());
return (count > 0); return (count > 0);
} }
/**
* テーブル物理削除
* @param taskKey タスクキー
*/
public void delete(String taskKey) {
delete("t_task_report_items", "task_key=?", new String[] { taskKey });
}
} }
\ No newline at end of file
...@@ -30,7 +30,7 @@ public class TaskDto extends AbstractDto { ...@@ -30,7 +30,7 @@ public class TaskDto extends AbstractDto {
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
return new Object[] { taskKey, taskId, operationId, taskCode, taskStatus, taskHotSpotInfo, taskName, phaseNo, phaseStatus, processStatus, processKey}; return new Object[] { taskKey, taskId, operationId, taskCode, taskStatus, taskHotSpotInfo, taskName, phaseNo, phaseStatus, processKey, processStatus};
} }
@Override @Override
......
...@@ -25,10 +25,12 @@ import jp.agentec.abook.abv.bl.acms.client.json.ProcessDataJSON; ...@@ -25,10 +25,12 @@ import jp.agentec.abook.abv.bl.acms.client.json.ProcessDataJSON;
import jp.agentec.abook.abv.bl.acms.client.json.SceneEntryJSON; import jp.agentec.abook.abv.bl.acms.client.json.SceneEntryJSON;
import jp.agentec.abook.abv.bl.acms.client.json.WorkerGroupJSON; import jp.agentec.abook.abv.bl.acms.client.json.WorkerGroupJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.DeleteProcessParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetTaskFileParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.GetTaskFileParameters;
import jp.agentec.abook.abv.bl.acms.type.OperationSortingType; import jp.agentec.abook.abv.bl.acms.type.OperationSortingType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.Callback; import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys; import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
...@@ -484,6 +486,41 @@ public class OperationLogic extends AbstractLogic { ...@@ -484,6 +486,41 @@ public class OperationLogic extends AbstractLogic {
} }
} }
/**
* 「全削除」ボタンで、すべての工程情報を削除する。
* @param operationId 作業ID
* @param contentId コンテンツID
* @param contentPath コンテンツファイルパス
* @param processKey 工程ID
* @throws IOException
*/
public void deleteProcessAllReport(long operationId, long contentId, String processKey, String contentPath) throws IOException {
//作業送信フラグ更新
mOperationDao.updateNeedSyncFlg(operationId, true);
//作業タスク削除フラグ更新
List<TaskDto> taskDtoList = mTaskDao.getTaskByProcessKey(processKey);
for (TaskDto taskDto : taskDtoList) {
taskDto.delFlg = true;
taskDto.taskStatus = 0;
mTaskDao.update(taskDto);
//作業報告更新
TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskDto.taskKey, Constant.TaskReportLevel.ReportType);
taskReportDto.dataSendFlg = false;
taskReportDto.attachedFileSendFlg = false;
taskReportDto.jsonData = "";
mTaskReportDao.update(taskReportDto);
//承認情報削除
mTaskReportApprovalDao.delete(processKey);
//報告(Suggest)情報削除
mTaskReportItemsDao.delete(taskDto.taskKey);
//作業ファイル削除
deleteTaskFileData(operationId, contentId, taskDto.taskKey, Constant.TaskReportLevel.ReportType);
}
createJsonForOperationContent(operationId, contentPath, false);
}
/** /**
* 定期点検データ新規 * 定期点検データ新規
...@@ -966,7 +1003,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -966,7 +1003,7 @@ public class OperationLogic extends AbstractLogic {
* @param contentPath 保存パス * @param contentPath 保存パス
* @throws IOException * @throws IOException
*/ */
private void createPhaseStatusJson(Long operationId, String contentPath) throws IOException { public void createPhaseStatusJson(Long operationId, String contentPath) throws IOException {
List<TaskDto> taskDtoProcessKeyList = mTaskDao.selectTaskGroupByProcessKeyByOperationId(operationId); List<TaskDto> taskDtoProcessKeyList = mTaskDao.selectTaskGroupByProcessKeyByOperationId(operationId);
List<JSONObject> processInfoList = new ArrayList<JSONObject>(); List<JSONObject> processInfoList = new ArrayList<JSONObject>();
for (TaskDto taskDtoProcessKey : taskDtoProcessKeyList) { for (TaskDto taskDtoProcessKey : taskDtoProcessKeyList) {
...@@ -1014,7 +1051,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1014,7 +1051,7 @@ public class OperationLogic extends AbstractLogic {
* @param contentPath * @param contentPath
* @throws IOException * @throws IOException
*/ */
public void createProcessInfoJson(Long operationId, String contentPath) throws IOException { private void createProcessInfoJson(Long operationId, String contentPath) throws IOException {
List<JSONObject> taskJsonList = new ArrayList<JSONObject>(); List<JSONObject> taskJsonList = new ArrayList<JSONObject>();
JSONObject processInfoJson = new JSONObject(); JSONObject processInfoJson = new JSONObject();
List<TaskDto> taskDtoList = mTaskDao.selectTaskGroupByProcessKeyByOperationId(operationId); List<TaskDto> taskDtoList = mTaskDao.selectTaskGroupByProcessKeyByOperationId(operationId);
...@@ -1504,7 +1541,13 @@ public class OperationLogic extends AbstractLogic { ...@@ -1504,7 +1541,13 @@ public class OperationLogic extends AbstractLogic {
if (taskReportDto.delFlg) { if (taskReportDto.delFlg) {
// 物理削除 // 物理削除
mTaskDao.deleteTaskData(taskReportDto.taskKey); if (operationDto.reportType == Constant.ReportType.ReportContinuous) { //連続作業
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskReportDto.taskKey);
mTaskDao.deleteTaskData(taskReportDto.taskKey, taskDto.processKey);
} else {
mTaskDao.deleteTaskData(taskReportDto.taskKey);
}
} else { } else {
taskReportDto.dataSendFlg = false; taskReportDto.dataSendFlg = false;
taskReportDto.attachedFileSendFlg = false; taskReportDto.attachedFileSendFlg = false;
...@@ -1901,12 +1944,12 @@ public class OperationLogic extends AbstractLogic { ...@@ -1901,12 +1944,12 @@ public class OperationLogic extends AbstractLogic {
//Taskデータ更新(phaseStatus, processStatus) //Taskデータ更新(phaseStatus, processStatus)
mTaskDao.updateStatus(taskDto.processKey, phaseTaskDto.phaseNo, taskDto.processStatus, phaseTaskDto.phaseStatus); mTaskDao.updateStatus(taskDto.processKey, phaseTaskDto.phaseNo, taskDto.processStatus, phaseTaskDto.phaseStatus);
for (TaskReportApprovalDto taskReportApprovalDto : phaseTaskDto.taskReportApprovalDtoList) { for (TaskReportApprovalDto taskReportApprovalDto : phaseTaskDto.taskReportApprovalDtoList) {
taskReportApprovalDto.processKey = taskDto.processKey;
taskReportApprovalDto.phaseNo = phaseTaskDto.phaseNo;
//TaskReportApprovalデータ追加・更新 //TaskReportApprovalデータ追加・更新
if (mTaskReportApprovalDao.selectTaskReportApprovalByProcessKey(taskDto.processKey, phaseTaskDto.phaseNo, taskReportApprovalDto.approvalNo) != null) { if (mTaskReportApprovalDao.selectTaskReportApprovalByProcessKey(taskDto.processKey, phaseTaskDto.phaseNo, taskReportApprovalDto.approvalNo) != null) {
mTaskReportApprovalDao.update(taskReportApprovalDto); mTaskReportApprovalDao.update(taskReportApprovalDto);
} else { } else {
taskReportApprovalDto.processKey = taskDto.processKey;
taskReportApprovalDto.phaseNo = phaseTaskDto.phaseNo;
mTaskReportApprovalDao.insert(taskReportApprovalDto); mTaskReportApprovalDao.insert(taskReportApprovalDto);
} }
} }
...@@ -1915,4 +1958,43 @@ public class OperationLogic extends AbstractLogic { ...@@ -1915,4 +1958,43 @@ public class OperationLogic extends AbstractLogic {
} }
} }
/**
* 工程情報を全部削除する。(全削除ボタンタップ時)
* @param operationId 作業ID
* @param processKey 工程キー
* @throws Exception 例外
* @throws ABVException 例外
*/
public void sendDeleteProcess(final long operationId, final String processKey) throws Exception, ABVException {
DeleteProcessParameters parameters = new DeleteProcessParameters(ABVDataCache.getInstance().getMemberInfo().sid, operationId, processKey);
AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).sendDeleteProcess(parameters);
}
/**
* 同期処理で、削除された工程情報を
* @param operationId
* @throws Exception
* @throws AcmsException
*/
public boolean deleteProcess(long operationId) throws Exception {
List<TaskDto> taskDtoList = mTaskDao.selectTaskByOperationId(operationId, true);
List<String> sendedProcessKeyList = new ArrayList<String>();
boolean isSuccess = true;
try {
for (TaskDto taskDto : taskDtoList) {
if (sendedProcessKeyList.contains(taskDto.processKey)) {
continue;
}
sendDeleteProcess(taskDto.operationId, taskDto.processKey);
sendedProcessKeyList.add(taskDto.processKey);
}
} catch (AcmsException ex) {
isSuccess = false;
Logger.e(TAG, "deleteProcess ex = ", ex);
} catch (Exception e) {
isSuccess = false;
Logger.e(TAG, "deleteProcess e = ", e);
}
return isSuccess;
}
} }
...@@ -1477,4 +1477,8 @@ ...@@ -1477,4 +1477,8 @@
<string name="msg_error_chat_room_name_too_long">ルーム名は文字列20字以内に入力してください。</string> <string name="msg_error_chat_room_name_too_long">ルーム名は文字列20字以内に入力してください。</string>
<string name="msg_error_chat_name_has_invalid_character">特殊文字 ;/?:@&amp;=+$,-_.!~*\'()#\\\"` はルーム名に含めることができません。</string> <string name="msg_error_chat_name_has_invalid_character">特殊文字 ;/?:@&amp;=+$,-_.!~*\'()#\\\"` はルーム名に含めることができません。</string>
<string name="msg_error_chat_room_sc_forbidden">認証に失敗しました。再度ログインが必要です。</string> <string name="msg_error_chat_room_sc_forbidden">認証に失敗しました。再度ログインが必要です。</string>
<!-- 連続作業 -->
<string name="msg_error_all_process_delete">全削除の送信に失敗しました。</string>
</resources> </resources>
...@@ -1483,4 +1483,5 @@ ...@@ -1483,4 +1483,5 @@
<string name="msg_error_chat_room_name_too_long">방 제목은 20자 이내로 입력해 주세요.</string> <string name="msg_error_chat_room_name_too_long">방 제목은 20자 이내로 입력해 주세요.</string>
<string name="msg_error_chat_name_has_invalid_character">특수문자 ;/?:@&amp;=+$,-_.!~*\'()#\\\"` 는 방 제목에 포함될 수 없습니다.</string> <string name="msg_error_chat_name_has_invalid_character">특수문자 ;/?:@&amp;=+$,-_.!~*\'()#\\\"` 는 방 제목에 포함될 수 없습니다.</string>
<string name="msg_error_chat_room_sc_forbidden">사용자 정보를 확인할 수 없습니다. 다시 로그인하시기 바랍니다.</string> <string name="msg_error_chat_room_sc_forbidden">사용자 정보를 확인할 수 없습니다. 다시 로그인하시기 바랍니다.</string>
<string name="msg_error_all_process_delete">모두 삭제 송신에 실패하였습니다.</string>
</resources> </resources>
\ No newline at end of file
...@@ -1480,4 +1480,5 @@ ...@@ -1480,4 +1480,5 @@
<string name="msg_error_chat_room_name_too_long">Please enter room name less than 20 characters.</string> <string name="msg_error_chat_room_name_too_long">Please enter room name less than 20 characters.</string>
<string name="msg_error_chat_name_has_invalid_character">The character ;/?:@&amp;=+$,-_.!~*\'()#\\\"` cannot be included in the roomname.</string> <string name="msg_error_chat_name_has_invalid_character">The character ;/?:@&amp;=+$,-_.!~*\'()#\\\"` cannot be included in the roomname.</string>
<string name="msg_error_chat_room_sc_forbidden">Failed to authenticate. Please login again.</string> <string name="msg_error_chat_room_sc_forbidden">Failed to authenticate. Please login again.</string>
<string name="msg_error_all_process_delete">Failed to send all deletes.</string>
</resources> </resources>
...@@ -913,7 +913,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -913,7 +913,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT, if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT,
ABookKeys.CMD_DELETE_TASK_REPORT, ABookKeys.CMD_CANCEL_TASK_REPORT, ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT, ABookKeys.CMD_CHANGE_TASK_REPORT)) { ABookKeys.CMD_DELETE_TASK_REPORT, ABookKeys.CMD_CANCEL_TASK_REPORT, ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT, ABookKeys.CMD_CHANGE_TASK_REPORT, ABookKeys.CMD_DELETE_PROCESS)) {
try { try {
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT)) { if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT)) {
...@@ -922,6 +922,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -922,6 +922,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
R.string.file_initialization, R.string.file_initialization,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
} }
//連続作業の全削除ボタンタップ時のインジケーター表示
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_DELETE_PROCESS)) {
showProgressPopup(PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_common_processing,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
}
if (isOperationPdf && operationTaskDto != null && StringUtil.equalsAny(mCmd, if (isOperationPdf && operationTaskDto != null && StringUtil.equalsAny(mCmd,
ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_INSERT_TASK_REPORT,
...@@ -962,9 +968,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -962,9 +968,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public Object callback(Object ret) { public Object callback(Object ret) {
final boolean isError = (boolean)ret; final boolean isError = (boolean)ret;
closeProgressPopup(); closeProgressPopup();
// 報告・報告(回答)の切り替えボタンタップ // 報告・報告(回答)の切り替えボタンタップ、連続作業の全削除ボタンタップ
if (mCmd.equals(ABookKeys.CMD_CHANGE_TASK_REPORT)) { if (mCmd.equals(ABookKeys.CMD_CHANGE_TASK_REPORT) || mCmd.equals(ABookKeys.CMD_DELETE_PROCESS)) {
afterABookCheckApi(mCmd, mTaskKey, 0, "", null, isOperationPdf()); afterABookCheckApi(mCmd, mTaskKey, 0, "", null, isOperationPdf());
if (mCmd.equals(ABookKeys.CMD_DELETE_PROCESS)) {
if (isError) {
showSimpleAlertDialog(R.string.error,R.string.msg_error_all_process_delete);
}
}
return null; return null;
} }
......
...@@ -869,6 +869,15 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -869,6 +869,15 @@ public class OperationListActivity extends ABVUIActivity {
// 報告送信 // 報告送信
mOperationLogic.sendTaskReportSendData(operationId, progressCallback); mOperationLogic.sendTaskReportSendData(operationId, progressCallback);
//工程全削除の送信(連続作業)
if (reportType == ReportType.ReportContinuous) {
if (!mOperationLogic.deleteProcess(operationId)) { //工程全削除送信失敗時
return PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_error_all_process_delete,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
}
}
progressDialogHorizontal.setProgress(60); progressDialogHorizontal.setProgress(60);
// 報告受信 // 報告受信
mOperationLastEditDate = receptionTaskData(operationId, progressCallback, errorMsg); mOperationLastEditDate = receptionTaskData(operationId, progressCallback, errorMsg);
...@@ -878,7 +887,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -878,7 +887,6 @@ public class OperationListActivity extends ABVUIActivity {
mOperationLogic.getProcessData(operationId); mOperationLogic.getProcessData(operationId);
} }
// mOperationLastEditDateがnullの場合、エラーと見做す // mOperationLastEditDateがnullの場合、エラーと見做す
if (mOperationLastEditDate != null && reportType == ReportType.RoutineTask) { if (mOperationLastEditDate != null && reportType == ReportType.RoutineTask) {
if (buttonEventFlag) { if (buttonEventFlag) {
......
...@@ -104,7 +104,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -104,7 +104,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
case ABookKeys.CMD_UPDATE_TASK_REPORT: case ABookKeys.CMD_UPDATE_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, reportType, taskReportLevel, false); insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, reportType, taskReportLevel, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel, processKey, phaseNo); copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel, processKey, phaseNo);
sendTaskData(context, operationId, taskKey, taskReportLevel, reportType); sendTaskData(context, operationId, taskKey, taskReportLevel, reportType, contentPath);
break; break;
case ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT: // 一時保存 case ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT: // 一時保存
insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, reportType, taskReportLevel, true); insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, reportType, taskReportLevel, true);
...@@ -137,9 +137,13 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -137,9 +137,13 @@ public class ABookCheckWebViewHelper extends ABookHelper {
mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, null, true, false); mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, null, true, false);
} }
sendTaskData(context, operationId, taskKey, taskReportLevel, reportType); sendTaskData(context, operationId, taskKey, taskReportLevel, reportType, contentPath);
break; break;
case ABookKeys.CMD_DELETE_PROCESS: //工程情報「全削除」
mOperationLogic.deleteProcessAllReport(operationId, contentId, processKey, contentPath);
sendDeleteProcess(context, operationId, processKey);
break;
case ABookKeys.CMD_MOVE_HOT_SPOT: case ABookKeys.CMD_MOVE_HOT_SPOT:
mOperationLogic.updateTaskHotspot(taskKey, param); mOperationLogic.updateTaskHotspot(taskKey, param);
mOperationLogic.createHopSpotJson(operationId, contentPath); mOperationLogic.createHopSpotJson(operationId, contentPath);
...@@ -153,12 +157,49 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -153,12 +157,49 @@ public class ABookCheckWebViewHelper extends ABookHelper {
} }
/** /**
* 工程情報を全部削除する。(全削除ボタンタップ時)
* @param context ABVContentViewActivity
* @param operationId 作業ID
* @param processKey 工程キー
*/
private void sendDeleteProcess(final ABVContentViewActivity context, final long operationId, final String processKey) {
// ネットワーク通信チェック
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
mFinishCallback.callback(false);
return;
}
CommonExecutor.execute(new Runnable() {
@Override
public void run() {
try {
mOperationLogic.sendDeleteProcess(operationId, processKey);
} catch (AcmsException ex) {
Logger.e(TAG, "sendDeleteProcess ex = %s", ex.getLocalizedMessage());
} catch (Exception e) {
Logger.e(TAG, "sendDeleteProcess e = %s", e.getLocalizedMessage());
} finally {
//全削除ボタンタップ時にはエラーメッセージ表示しない。
mFinishCallback.callback(false);
}
}
});
}
/**
* 作業報告・指示データ送信処理(共通) * 作業報告・指示データ送信処理(共通)
* @param context ABVContentViewActivity * @param context ABVContentViewActivity
* @param operationId プロジェクトID * @param operationId プロジェクトID
* @param taskKey タスクキー * @param taskKey タスクキー
*/ */
private void sendTaskData(final ABVContentViewActivity context, final long operationId, final String taskKey, final int taskReportLevel, final int reportType) { /**
* 作業報告・指示データ送信処理(共通)
* @param context 報告画面コンテキスト
* @param operationId 作業ID
* @param taskKey タスクキー
* @param taskReportLevel 報告レベル
* @param reportType 報告タイプ
* @param contentPath コンテンツファイルパス
*/
private void sendTaskData(final ABVContentViewActivity context, final long operationId, final String taskKey, final int taskReportLevel, final int reportType, final String contentPath) {
// needSyncFlgをtrueに設定 // needSyncFlgをtrueに設定
mOperationLogic.updateSyncOperation(operationId, true); mOperationLogic.updateSyncOperation(operationId, true);
...@@ -197,6 +238,8 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -197,6 +238,8 @@ public class ABookCheckWebViewHelper extends ABookHelper {
if (reportType == Constant.ReportType.ReportContinuous) { if (reportType == Constant.ReportType.ReportContinuous) {
//連続作業のみ承認データ取得 //連続作業のみ承認データ取得
mOperationLogic.getProcessData(operationId); mOperationLogic.getProcessData(operationId);
//承認情報Jsonファイル更新
mOperationLogic.createPhaseStatusJson(operationId, contentPath);
} }
} catch (AcmsException ex) { } catch (AcmsException ex) {
//noinspection EnumSwitchStatementWhichMissesCases //noinspection EnumSwitchStatementWhichMissesCases
......
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