Commit be91422e by Lee Jaebin

#32825 作業一覧画面改善

parent c77c8c57
...@@ -505,8 +505,8 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -505,8 +505,8 @@ public class AcmsClient implements AcmsClientResponseListener {
} }
//作業者グループ取得 //作業者グループ取得
public WorkerGroupJSON getWorkerGroupList(AcmsParameters param) throws NetworkDisconnectedException, AcmsException { public WorkerGroupJSON getWorkingGroupList(AcmsParameters param) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApiWorkerGroupList, param); HttpResponse response = send(AcmsApis.ApiWorkingGroupList, param);
WorkerGroupJSON json = new WorkerGroupJSON(response.httpResponseBody); WorkerGroupJSON json = new WorkerGroupJSON(response.httpResponseBody);
return json; return json;
...@@ -518,7 +518,7 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -518,7 +518,7 @@ public class AcmsClient implements AcmsClientResponseListener {
* @param operationId * @param operationId
* @param taskKey * @param taskKey
* @param delFlag * @param delFlag
* @param taskType * @param taskReportLevel
* @param taskHotspotInfo * @param taskHotspotInfo
* @param taskReportInfo * @param taskReportInfo
* @param formFile * @param formFile
...@@ -527,7 +527,7 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -527,7 +527,7 @@ public class AcmsClient implements AcmsClientResponseListener {
* @throws NetworkDisconnectedException * @throws NetworkDisconnectedException
* @throws IOException * @throws IOException
*/ */
public AcmsMessageJSON sendTaskData(String sid, String operationId, String taskKey, String delFlag, String taskType, String taskHotspotInfo, String taskReportInfo, File formFile, boolean attachedFileSendFlg, Date taskReportSendSaveDate) throws ABVException, NetworkDisconnectedException, IOException { public AcmsMessageJSON sendTaskData(String sid, String operationId, String taskKey, String delFlag, String taskReportLevel, String taskHotspotInfo, String taskReportInfo, File formFile, boolean attachedFileSendFlg, Date taskReportSendSaveDate) throws ABVException, NetworkDisconnectedException, IOException {
if (networkAdapter != null && !networkAdapter.isNetworkConnected()) { // NWのチェック if (networkAdapter != null && !networkAdapter.isNetworkConnected()) { // NWのチェック
throw new NetworkDisconnectedException(); throw new NetworkDisconnectedException();
} }
...@@ -538,7 +538,7 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -538,7 +538,7 @@ public class AcmsClient implements AcmsClientResponseListener {
HttpMultipartList.add(new HttpMultipart(ABookKeys.OPERATION_ID, operationId)); HttpMultipartList.add(new HttpMultipart(ABookKeys.OPERATION_ID, operationId));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_KEY, taskKey)); HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_KEY, taskKey));
HttpMultipartList.add(new HttpMultipart(ABookKeys.DEL_FLAG, delFlag)); HttpMultipartList.add(new HttpMultipart(ABookKeys.DEL_FLAG, delFlag));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_TYPE, taskType)); HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_LEVEL, taskReportLevel));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_HOT_SPOT_INFO, taskHotspotInfo)); HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_HOT_SPOT_INFO, taskHotspotInfo));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO, taskReportInfo)); HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO, taskReportInfo));
HttpMultipartList.add(new HttpMultipart(ABookKeys.ATTACHED_CHANGE_FLAG, attachedFileSendFlg ? "1" : "0")); HttpMultipartList.add(new HttpMultipart(ABookKeys.ATTACHED_CHANGE_FLAG, attachedFileSendFlg ? "1" : "0"));
...@@ -552,7 +552,7 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -552,7 +552,7 @@ public class AcmsClient implements AcmsClientResponseListener {
} }
result = HttpRequestSender.post(apiUrl, HttpMultipartList.toArray(new HttpMultipart[HttpMultipartList.size()])); result = HttpRequestSender.post(apiUrl, HttpMultipartList.toArray(new HttpMultipart[HttpMultipartList.size()]));
Logger.d(TAG, "[sendTaskData]: operationId=%s, taskKey=%s, delFlag=%s, task_type=%s, taskHopspotInfo=%s, taskReportInfo=%s, attachedFileSendFlg=%s", operationId, taskKey, delFlag, taskType, taskHotspotInfo, taskReportInfo, attachedFileSendFlg); Logger.d(TAG, "[sendTaskData]: operationId=%s, taskKey=%s, delFlag=%s, taskReportLevel=%s, taskHopspotInfo=%s, taskReportInfo=%s, attachedFileSendFlg=%s", operationId, taskKey, delFlag, taskReportLevel, taskHotspotInfo, taskReportInfo, attachedFileSendFlg);
AcmsMessageJSON json = new AcmsMessageJSON(result.httpResponseBody); AcmsMessageJSON json = new AcmsMessageJSON(result.httpResponseBody);
Logger.d(TAG, "sendTaskData res: %s", json); Logger.d(TAG, "sendTaskData res: %s", json);
...@@ -836,7 +836,7 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -836,7 +836,7 @@ public class AcmsClient implements AcmsClientResponseListener {
HttpTaskWorker<HttpParameterObject> httpTaskThread = new HttpTaskWorker<HttpParameterObject>(methodName, apiUrl, param); HttpTaskWorker<HttpParameterObject> httpTaskThread = new HttpTaskWorker<HttpParameterObject>(methodName, apiUrl, param);
try{ try {
httpTaskThread.start(); httpTaskThread.start();
httpTaskThread.join(HttpRequestSender.DefaultConnectionTimeout); httpTaskThread.join(HttpRequestSender.DefaultConnectionTimeout);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -67,12 +67,6 @@ public class OperationDataJSON extends AcmsCommonJSON { ...@@ -67,12 +67,6 @@ public class OperationDataJSON extends AcmsCommonJSON {
for (int i = 0; i < taskList.length(); i++) { for (int i = 0; i < taskList.length(); i++) {
JSONObject taskJson = taskList.getJSONObject(i); JSONObject taskJson = taskList.getJSONObject(i);
TaskDto dto = new TaskDto(); TaskDto dto = new TaskDto();
// #32782 指示者テーブル関連削除 start
// TODO change
// dto.taskDirectionsDto = new TaskReportDto();
dto.taskDirectionsDto = new TaskDirectionsDto();
// #32782 指示者テーブル関連削除 end
dto.taskReportDto = new TaskReportDto();
dto.operationId = taskJson.getLong(OperationId); dto.operationId = taskJson.getLong(OperationId);
dto.taskId = taskJson.getLong(TaskId); dto.taskId = taskJson.getLong(TaskId);
...@@ -82,26 +76,6 @@ public class OperationDataJSON extends AcmsCommonJSON { ...@@ -82,26 +76,6 @@ public class OperationDataJSON extends AcmsCommonJSON {
dto.taskHotSpotInfo = taskJson.getJSONObject(TaskHotspotInfo).toString(); dto.taskHotSpotInfo = taskJson.getJSONObject(TaskHotspotInfo).toString();
// if(taskJson.has(TaskDirectionsInfo)) {
// dto.taskDirectionsDto.jsonData = taskJson.getJSONObject(TaskDirectionsInfo).toString();
// }
// if(taskJson.has(TaskDirectionsKey)) {
// dto.taskDirectionsDto.attachedFileName = taskJson.getString(TaskDirectionsKey);
// }
//
// if (taskJson.has(TaskReportInfo)) {
// Object object = taskJson.get(TaskReportInfo);
// if (object instanceof String) {
// dto.taskReportDto.jsonData = null;
// } else {
// dto.taskReportDto.jsonData = taskJson.getJSONObject(TaskReportInfo).toString();
// }
// }
// if (taskJson.has(TaskReportKey)) {
// dto.taskReportDto.attachedFileName = taskJson.getString(TaskReportKey);
// }
// 作業報告詳細リスト // 作業報告詳細リスト
JSONArray taskReportList = taskJson.getJSONArray(TaskReportList); JSONArray taskReportList = taskJson.getJSONArray(TaskReportList);
for (int j = 0; j < taskReportList.length(); j++) { for (int j = 0; j < taskReportList.length(); j++) {
...@@ -120,9 +94,9 @@ public class OperationDataJSON extends AcmsCommonJSON { ...@@ -120,9 +94,9 @@ public class OperationDataJSON extends AcmsCommonJSON {
if (taskReportJson.has(TaskReportInfo)) { if (taskReportJson.has(TaskReportInfo)) {
Object object = taskJson.get(TaskReportInfo); Object object = taskJson.get(TaskReportInfo);
if (object instanceof String) { if (object instanceof String) {
dto.taskReportDto.jsonData = null; taskReportDto.jsonData = null;
} else { } else {
dto.taskReportDto.jsonData = taskJson.getJSONObject(TaskReportInfo).toString(); taskReportDto.jsonData = taskJson.getJSONObject(TaskReportInfo).toString();
} }
} }
dto.taskReportDtoList.add(taskReportDto); dto.taskReportDtoList.add(taskReportDto);
......
...@@ -21,30 +21,17 @@ import jp.agentec.adf.util.DateTimeUtil; ...@@ -21,30 +21,17 @@ import jp.agentec.adf.util.DateTimeUtil;
public class OperationListJSON extends AcmsCommonJSON { public class OperationListJSON extends AcmsCommonJSON {
// TODO public static final String OperationList = "operationList";
// サーバ作業後、対応必要「project」→「operation」 public static final String OperationId = "operationId";
public static final String OperationList = "projectList"; public static final String OperationType = "operationType";
public static final String OperationId = "projectId"; public static final String ReportType = "reportType";
public static final String OperationType = "projectType"; public static final String OperationName = "operationName";
public static final String OperationName = "projectName"; public static final String OperationDescriptions = "operationDescriptions";
public static final String OperationDescriptions = "projectDescriptions"; public static final String OperationStartDate = "operationStartDate";
public static final String OperationStartDate = "projectStartDate"; public static final String OperationEndDate = "operationEndDate";
public static final String OperationEndDate = "projectEndDate"; public static final String OperationStatus = "operationStatus";
public static final String OperationStatus = "projectStatus"; public static final String OperationLastEditDate = "operationLastEditDate";
public static final String OperationLastEditDate = "projectLastEditDate";
public static final String ContentId = "contentId"; public static final String ContentId = "contentId";
public static final String RelatedContentList = "relatedContentList";
public static final String PushMessageList = "pushMessageList";
public static final String PushMessageId = "pushMessageId";
public static final String PushSendLoginId = "pushSendLoginId";
public static final String PushSendDate = "pushSendDate";
public static final String PushMessage = "pushMessage";
// TODO 削除予定
public static final String OperationReportType = "projectReportType";
public static final String ReportUpdateType = "reportUpdateType";
//定期点検用 //定期点検用
public static final String ReportCycle = "reportCycle"; public static final String ReportCycle = "reportCycle";
public static final String EnableReportUpdate = "enableReportUpdate"; public static final String EnableReportUpdate = "enableReportUpdate";
...@@ -54,10 +41,17 @@ public class OperationListJSON extends AcmsCommonJSON { ...@@ -54,10 +41,17 @@ public class OperationListJSON extends AcmsCommonJSON {
// 作業担当グループリスト // 作業担当グループリスト
public static final String WorkingGroupList = "workingGroupList"; public static final String WorkingGroupList = "workingGroupList";
public static final String ReportLevel = "reportLevel"; // 報告階層 public static final String ReportLevel = "reportLevel"; // 報告階層
public static final String GroupList = "groupList"; // グループリスト
public static final String GroupId = "groupId"; // グループID public static final String GroupId = "groupId"; // グループID
public static final String GroupList = "groupList"; // グループリスト
public static final String ReportType = "reportType"; public static final String RelatedContentList = "relatedContentList";
public static final String PushMessageList = "pushMessageList";
public static final String PushMessageId = "pushMessageId";
public static final String PushSendLoginId = "pushSendLoginId";
public static final String PushSendDate = "pushSendDate";
public static final String PushMessage = "pushMessage";
public List<OperationDto> operationList; public List<OperationDto> operationList;
...@@ -82,19 +76,16 @@ public class OperationListJSON extends AcmsCommonJSON { ...@@ -82,19 +76,16 @@ public class OperationListJSON extends AcmsCommonJSON {
dto.operationDescriptions = operationJson.getString(OperationDescriptions); dto.operationDescriptions = operationJson.getString(OperationDescriptions);
dto.operationStartDate = DateTimeUtil.toDate(operationJson.getString(OperationStartDate), "UTC", DateTimeFormat.yyyyMMdd_hyphen); dto.operationStartDate = DateTimeUtil.toDate(operationJson.getString(OperationStartDate), "UTC", DateTimeFormat.yyyyMMdd_hyphen);
dto.operationEndDate = DateTimeUtil.toDate(operationJson.getString(OperationEndDate), "UTC", DateTimeFormat.yyyyMMdd_hyphen); dto.operationEndDate = DateTimeUtil.toDate(operationJson.getString(OperationEndDate), "UTC", DateTimeFormat.yyyyMMdd_hyphen);
dto.reportUpdateType = operationJson.has(ReportUpdateType) ? operationJson.getInt(ReportUpdateType) : 0;
// 1.0.1で追加 // 1.0.1で追加
dto.operationStatus = operationJson.getInt(OperationStatus); // 作業状況 dto.operationStatus = operationJson.getInt(OperationStatus); // 作業状況
dto.reportType = operationJson.getInt(ReportType); // 作業報告タイプ dto.reportType = operationJson.getInt(ReportType); // 作業報告タイプ
dto.enableReportHistory = operationJson.getInt(EnableReportHistory); // 報告履歴管理 dto.enableReportHistory = operationJson.getInt(EnableReportHistory); // 報告履歴管理
// 作業終了更新日
if (operationJson.has(OperationLastEditDate)) { if (operationJson.has(OperationLastEditDate)) {
dto.lastEditDate = DateTimeUtil.toDate(operationJson.getString(OperationLastEditDate), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen); dto.lastEditDate = DateTimeUtil.toDate(operationJson.getString(OperationLastEditDate), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
} }
if (operationJson.has(OperationReportType)) {
dto.operationReportType = operationJson.getInt(OperationReportType);
}
if (operationJson.has(ReportCycle)) { if (operationJson.has(ReportCycle)) {
dto.reportCycle = operationJson.getInt(ReportCycle); dto.reportCycle = operationJson.getInt(ReportCycle);
......
...@@ -44,9 +44,9 @@ public class RoutineTaskDataJSON extends OperationDataJSON { ...@@ -44,9 +44,9 @@ public class RoutineTaskDataJSON extends OperationDataJSON {
// #32782 指示者テーブル関連削除 start // #32782 指示者テーブル関連削除 start
// TODO change // TODO change
// dto.taskDirectionsDto = new TaskReportDto(); // dto.taskDirectionsDto = new TaskReportDto();
dto.taskDirectionsDto = new TaskDirectionsDto(); // dto.taskDirectionsDto = new TaskDirectionsDto();
// #32782 指示者テーブル関連削除 end // // #32782 指示者テーブル関連削除 end
dto.taskReportDto = new TaskReportDto(); // dto.taskReportDto = new TaskReportDto();
dto.operationId = taskJson.getLong(OperationId); dto.operationId = taskJson.getLong(OperationId);
dto.taskId = taskJson.getLong(TaskId); dto.taskId = taskJson.getLong(TaskId);
......
...@@ -133,9 +133,9 @@ public class AcmsApis { ...@@ -133,9 +133,9 @@ public class AcmsApis {
// デバイストークン更新 // デバイストークン更新
public static final String ApiUrlUpdateDeviceToken = "updateDeviceToken"; public static final String ApiUrlUpdateDeviceToken = "updateDeviceToken";
// プロジェクト一覧取得 // プロジェクト一覧取得
public static final String ApiOperationList = "projectList"; public static final String ApiOperationList = "operationList";
// 作業者グループ取得 // 作業者グループ取得
public static final String ApiWorkerGroupList = "workerGroupList"; public static final String ApiWorkingGroupList = "workingGroupList";
// 作業データ送信 // 作業データ送信
public static final String ApiSendTaskData = "taskData"; public static final String ApiSendTaskData = "taskData";
// 作業データ取得 // 作業データ取得
...@@ -196,7 +196,7 @@ public class AcmsApis { ...@@ -196,7 +196,7 @@ public class AcmsApis {
if (methodName.equals(ApiUrlNewAppStoreLogin) || methodName.equals(ApiUrlAppStoreNewLogin) || methodName.equals(ApiUrlServerTime) || methodName.equals(ApiUrlServerTimeZone)) { if (methodName.equals(ApiUrlNewAppStoreLogin) || methodName.equals(ApiUrlAppStoreNewLogin) || methodName.equals(ApiUrlServerTime) || methodName.equals(ApiUrlServerTimeZone)) {
apiValue = Constant.ApiValue.nuapi; apiValue = Constant.ApiValue.nuapi;
} else if (methodName.equals(ApiOperationList) || methodName.equals(ApiWorkerGroupList) || methodName.equals(ApiSendTaskData) || methodName.equals(ApiGetOperationData) || } else if (methodName.equals(ApiOperationList) || methodName.equals(ApiWorkingGroupList) || methodName.equals(ApiSendTaskData) || methodName.equals(ApiGetOperationData) ||
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(ApiGetRoutineTaskData) || methodName.equals(ApiSendRoutineTaskData)) { methodName.equals(ApiSendPushMessage) || methodName.equals(ApiGetPushMessages) || methodName.equals(ApiGetRoutineTaskData) || methodName.equals(ApiSendRoutineTaskData)) {
apiValue = Constant.ApiValue.checkapi; apiValue = Constant.ApiValue.checkapi;
......
...@@ -77,7 +77,7 @@ public class ABookKeys { ...@@ -77,7 +77,7 @@ public class ABookKeys {
public static final String SID = "sid"; public static final String SID = "sid";
public static final String FORM_FILE = "formFile"; public static final String FORM_FILE = "formFile";
public static final String DEL_FLAG = "delFlag"; public static final String DEL_FLAG = "delFlag";
public static final String TASK_TYPE = "taskType"; public static final String TASK_REPORT_LEVEL = "taskReportLevel";
public static final String TASK_HOT_SPOT_INFO = "taskHotspotInfo"; public static final String TASK_HOT_SPOT_INFO = "taskHotspotInfo";
public static final String TASK_REPORT_INFO = "taskReportInfo"; public static final String TASK_REPORT_INFO = "taskReportInfo";
public static final String TASK_REPORT_SAVE_DATE = "saveDate"; public static final String TASK_REPORT_SAVE_DATE = "saveDate";
......
...@@ -275,10 +275,12 @@ public class OperationDao extends AbstractDao { ...@@ -275,10 +275,12 @@ public class OperationDao extends AbstractDao {
} }
if (operationReportTypeStr != null) { if (operationReportTypeStr != null) {
sql.append(" AND top.operation_report_type in ("+ operationReportTypeStr +")"); // sql.append(" AND top.operation_report_type in ("+ operationReportTypeStr +")");
sql.append(" AND top.report_type in ("+ operationReportTypeStr +")");
} }
sql.append(" ORDER BY top.operation_report_type DESC, top.operation_start_date DESC, top.operation_id DESC"); // sql.append(" ORDER BY top.operation_report_type DESC, top.operation_start_date DESC, top.operation_id DESC");
sql.append(" ORDER BY top.report_type DESC, top.operation_start_date DESC, top.operation_id DESC");
Logger.v(TAG, "sql=%s", sql); Logger.v(TAG, "sql=%s", sql);
......
...@@ -160,8 +160,14 @@ public class TaskReportDao extends AbstractDao { ...@@ -160,8 +160,14 @@ public class TaskReportDao extends AbstractDao {
// #32782 指示者テーブル関連削除 end // #32782 指示者テーブル関連削除 end
} }
public String getTaskReportAttachedFileName(String taskKey) { /**
return rawQueryGetString("select local_attached_file_name from t_task_report where task_key=?", new String[]{"" + taskKey}); * 作業キー、作業
* @param taskKey
* @param taskReportLevel
* @return
*/
public String getTaskReportAttachedFileName(String taskKey, int taskReportLevel) {
return rawQueryGetString("select local_attached_file_name from t_task_report where task_key=? AND task_report_level=?", new String[]{"" + taskKey, "" + taskReportLevel});
} }
public List<TaskReportDto> selectByTaskKey(String taskKey) { public List<TaskReportDto> selectByTaskKey(String taskKey) {
......
...@@ -17,13 +17,6 @@ public class TaskDto extends AbstractDto { ...@@ -17,13 +17,6 @@ public class TaskDto extends AbstractDto {
public List<TaskReportDto> taskReportDtoList; public List<TaskReportDto> taskReportDtoList;
public boolean delFlg; public boolean delFlg;
// #32782 指示者テーブル関連削除 start
// TODO TaskDirectionDto から TaskReportDto に変更、taskDirectionsDto 名を変更必要
// public TaskReportDto taskDirectionsDto;
public TaskDirectionsDto taskDirectionsDto;
// #32782 指示者テーブル関連削除 end
public TaskReportDto taskReportDto;
public int taskReportId; public int taskReportId;
public List<RoutineTaskReportDto> RoutineTaskReportList; public List<RoutineTaskReportDto> RoutineTaskReportList;
......
...@@ -23,7 +23,6 @@ import jp.agentec.abook.abv.bl.acms.client.json.SceneEntryJSON; ...@@ -23,7 +23,6 @@ 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.GetTaskFileParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.GetTaskFileParameters;
import jp.agentec.abook.abv.bl.acms.type.OperationAuthLevel;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
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;
...@@ -94,7 +93,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -94,7 +93,7 @@ public class OperationLogic extends AbstractLogic {
// プロジェクト一覧取得し、登録・更新・削除する // プロジェクト一覧取得し、登録・更新・削除する
retrieveServerOperation(); retrieveServerOperation();
// 作業者グループリスト取得 // 作業者グループリスト取得
setWorkerGroupList(); setWorkingGroupList();
} }
/** /**
...@@ -207,9 +206,9 @@ public class OperationLogic extends AbstractLogic { ...@@ -207,9 +206,9 @@ public class OperationLogic extends AbstractLogic {
* @throws NetworkDisconnectedException * @throws NetworkDisconnectedException
* @throws AcmsException * @throws AcmsException
*/ */
private void setWorkerGroupList() throws NetworkDisconnectedException, AcmsException { private void setWorkingGroupList() throws NetworkDisconnectedException, AcmsException {
AcmsParameters param = new AcmsParameters(cache.getMemberInfo().sid); AcmsParameters param = new AcmsParameters(cache.getMemberInfo().sid);
WorkerGroupJSON json = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getWorkerGroupList(param); WorkerGroupJSON json = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getWorkingGroupList(param);
mWorkerGroupDao.deleteAll(); mWorkerGroupDao.deleteAll();
for (WorkerGroupDto dto : json.workerGroupList) { for (WorkerGroupDto dto : json.workerGroupList) {
mWorkerGroupDao.insert(dto); mWorkerGroupDao.insert(dto);
...@@ -1785,43 +1784,43 @@ public class OperationLogic extends AbstractLogic { ...@@ -1785,43 +1784,43 @@ public class OperationLogic extends AbstractLogic {
} }
if (taskDirectionsDtoList != null && taskDirectionsDtoList.size() > 0) { // if (taskDirectionsDtoList != null && taskDirectionsDtoList.size() > 0) {
//プログレスを40%進行させるための計算 // //プログレスを40%進行させるための計算
int progress = maxProgress / taskDirectionsDtoList.size(); // int progress = maxProgress / taskDirectionsDtoList.size();
//
for (TaskDirectionsDto dto : taskDirectionsDtoList) { // for (TaskDirectionsDto dto : taskDirectionsDtoList) {
File zipFile = null; // File zipFile = null;
if (dto.attachedFileSendFlg) { // if (dto.attachedFileSendFlg) {
String fileName = null; // String fileName = null;
zipFile = createAttachedFile(operationId, dto.taskKey, true); // zipFile = createAttachedFile(operationId, dto.taskKey, true);
if (zipFile != null) { // if (zipFile != null) {
fileName = FileUtil.getFilenameWithoutExt(zipFile.getName()); // fileName = FileUtil.getFilenameWithoutExt(zipFile.getName());
} // }
dto.localAttachedFileName = fileName != null ? SecurityUtil.getMd5Hash(fileName) : null; // dto.localAttachedFileName = fileName != null ? SecurityUtil.getMd5Hash(fileName) : null;
} // }
//
AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).sendTaskData // AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).sendTaskData
(cache.getMemberInfo().sid, String.valueOf(operationId), dto.taskKey, dto.delFlg ? "1" : "0", String.valueOf(0), dto.taskHotSpotInfo, dto.jsonData, zipFile, dto.attachedFileSendFlg, null); // (cache.getMemberInfo().sid, String.valueOf(operationId), dto.taskKey, dto.delFlg ? "1" : "0", String.valueOf(0), dto.taskHotSpotInfo, dto.jsonData, zipFile, dto.attachedFileSendFlg, null);
//
if (zipFile != null) { // if (zipFile != null) {
zipFile.delete(); // zipFile.delete();
} // }
if (dto.delFlg) { // if (dto.delFlg) {
// 物理削除 // // 物理削除
mTaskDao.deleteTaskData(dto.taskKey, true); // mTaskDao.deleteTaskData(dto.taskKey, true);
} else { // } else {
dto.dataSendFlg = false; // dto.dataSendFlg = false;
dto.attachedFileSendFlg = false; // dto.attachedFileSendFlg = false;
mTaskDirectionsDao.update(dto); // mTaskDirectionsDao.update(dto);
} // }
progressCallback.callback(new Integer(progress)); // progressCallback.callback(new Integer(progress));
} // }
} // }
//
//
//
//
//
if (taskReportDtoList != null && taskReportDtoList.size() > 0) { if (taskReportDtoList != null && taskReportDtoList.size() > 0) {
OperationDto operationDto = mOperationDao.getOperation(operationId); OperationDto operationDto = mOperationDao.getOperation(operationId);
...@@ -1856,7 +1855,8 @@ public class OperationLogic extends AbstractLogic { ...@@ -1856,7 +1855,8 @@ public class OperationLogic extends AbstractLogic {
cache.getMemberInfo().sid, cache.getMemberInfo().sid,
String.valueOf(operationId), String.valueOf(operationId),
taskReportDto.taskKey, taskReportDto.taskKey,
taskReportDto.delFlg ? "1" : "0", String.valueOf(1), taskReportDto.delFlg ? "1" : "0",
String.valueOf(taskReportDto.taskReportLevel),
taskReportDto.taskHotSpotInfo, taskReportDto.taskHotSpotInfo,
taskReportSendDto.jsonData, taskReportSendDto.jsonData,
zipFile, zipFile,
......
...@@ -663,7 +663,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -663,7 +663,7 @@ public class OperationListActivity extends ABVUIActivity {
if (operationContentDto != null) { if (operationContentDto != null) {
if (notification.downloadStatus == DownloadStatusType.Succeeded) { if (notification.downloadStatus == DownloadStatusType.Succeeded) {
OperationDto operationDto = mOperationLogic.getOperation(operationContentDto.operationId); OperationDto operationDto = mOperationLogic.getOperation(operationContentDto.operationId);
syncOperation(operationContentDto.operationId, operationDto.operationReportType, true); syncOperation(operationContentDto.operationId, operationDto.reportType, true);
} else if (notification.downloadStatus == DownloadStatusType.Failed || notification.downloadStatus == DownloadStatusType.Canceled || notification.downloadStatus == DownloadStatusType.Paused) { } else if (notification.downloadStatus == DownloadStatusType.Failed || notification.downloadStatus == DownloadStatusType.Canceled || notification.downloadStatus == DownloadStatusType.Paused) {
Logger.i(TAG, "syncOperation update is failed downloadStatus : " + notification.downloadStatus); Logger.i(TAG, "syncOperation update is failed downloadStatus : " + notification.downloadStatus);
closeProgressPopup(); closeProgressPopup();
...@@ -683,10 +683,10 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -683,10 +683,10 @@ public class OperationListActivity extends ABVUIActivity {
/** /**
* プロジェクト同期処理 * プロジェクト同期処理
* @param operationId * @param operationId
* @param operationReportType * @param reportType
* @param buttonEventFlag * @param buttonEventFlag
*/ */
public void syncOperation(final long operationId, int operationReportType, boolean buttonEventFlag) { public void syncOperation(final long operationId, int reportType, boolean buttonEventFlag) {
Logger.i(TAG, "---sync start"); Logger.i(TAG, "---sync start");
// ネットワーク通信チェック // ネットワーク通信チェック
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) { if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
...@@ -716,24 +716,22 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -716,24 +716,22 @@ public class OperationListActivity extends ABVUIActivity {
return null; return null;
} }
}; };
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
mOperationLogic.sendTaskDirectionsData(operationId, null, progressCallback); if (reportType == OperationReportType.ROUTINE_TASK) {
} else { // 定期点検
// 作業報告 if (mOperationLogic.sendRoutineTaskReportSendData(operationId, null, progressCallback) > 0) {
if (operationReportType == Constant.OperationReportType.ROUTINE_TASK) { handleErrorMessageToast(R.string.P005);
if (mOperationLogic.sendRoutineTaskReportSendData(operationId, null, progressCallback) > 0) {
handleErrorMessageToast(R.string.P005);
}
} else {
mOperationLogic.sendTaskReportSendData(operationId, null, progressCallback);
} }
} else {
// 報告送信
mOperationLogic.sendTaskReportSendData(operationId, null, progressCallback);
} }
mOperationLogic.
progressDialogHorizontal.setProgress(60); progressDialogHorizontal.setProgress(60);
// 報告受信
mOperationLastEditDate = receptionTaskData(operationId, progressCallback, buttonEventFlag); mOperationLastEditDate = receptionTaskData(operationId, progressCallback, buttonEventFlag);
if (operationReportType == Constant.OperationReportType.ROUTINE_TASK) { if (reportType == Constant.OperationReportType.ROUTINE_TASK) {
if (buttonEventFlag) { if (buttonEventFlag) {
String dialogMsg = null; String dialogMsg = null;
// 定期点検プロジェクトの利用可能日付を取得 // 定期点検プロジェクトの利用可能日付を取得
...@@ -917,7 +915,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -917,7 +915,6 @@ public class OperationListActivity extends ABVUIActivity {
} }
lastEditDate = json.lastEditDate; lastEditDate = json.lastEditDate;
} else { } else {
// TODO
OperationDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getOpereationData(param); OperationDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getOpereationData(param);
//プログレスを40%進行させるための計算 //プログレスを40%進行させるための計算
...@@ -926,68 +923,16 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -926,68 +923,16 @@ public class OperationListActivity extends ABVUIActivity {
progress = 40 / json.taskDtoList.size(); progress = 40 / json.taskDtoList.size();
} }
// #32782 指示者テーブル関連削除 start
// TODO change
/*
// JSONObject taskDirectionJson;
JSONObject taskReportJson; JSONObject taskReportJson;
for (TaskDto taskDto : json.taskDtoList) { for (TaskDto taskDto : json.taskDtoList) {
String directionsAttachedFileName = taskDto.taskDirectionsDto.attachedFileName; for (TaskReportDto taskReportDto : taskDto.taskReportDtoList) {
String reportAttachedFileName = taskDto.taskReportDto.attachedFileName; String reportAttachedFileName = taskReportDto.attachedFileName;
if (taskReportDto.taskReportLevel == Constant.TaskReportLevel.ReportType) {
// 0305 start taskReportJson = new JSONObject(taskReportDto.jsonData);
taskReportJson = new JSONObject(taskDto.taskDirectionsDto.jsonData); taskReportJson.put(ABookKeys.TASK_STATUS, taskDto.taskStatus);
taskReportJson.put(ABookKeys.TASK_STATUS, taskDto.taskStatus);
// 0305 end
int localTaskIndex = localTaskList.indexOf(taskDto);
if (localTaskIndex >= 0) {
// 添付ファイルが存在する場合、取得して解凍する。
refreshTaskFile(operationId, operationContentDto.contentId, taskDto.taskId, taskDto.taskKey, directionsAttachedFileName, reportAttachedFileName);
if (isSyncGetTaskFileError) {
return null;
} }
// #32782 指示者テーブル関連削除 start
// 作業更新
mOperationLogic.updateTaskReport(taskDto.taskKey, taskDto.operationId, operationContentDto.contentId,
taskReportJson, directionsAttachedFileName, false, false, taskDto.taskHotSpotInfo);
localTaskList.remove(taskDto);
// 報告データが存在すると作業報告を更新する
if (taskDto.taskReportDto.jsonData != null) {
mOperationLogic.updateTaskReport(taskDto.taskKey, taskDto.operationId, operationContentDto.contentId,
taskReportJson, reportAttachedFileName, false, false, taskDto.taskHotSpotInfo);
}
// #32782 指示者テーブル関連削除 end
} else {
// 添付ファイルが存在する場合、取得して解凍する。
refreshTaskFile(operationId, operationContentDto.contentId, taskDto.taskId, taskDto.taskKey, directionsAttachedFileName, reportAttachedFileName);
if (isSyncGetTaskFileError) {
return null;
}
// #32782 指示者テーブル関連削除 start
// 作業登録
mOperationLogic.insertTaskReport(taskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId,
taskReportJson, directionsAttachedFileName, false, false, taskDto.taskHotSpotInfo);
if (taskDto.taskReportDto.jsonData != null) {
mOperationLogic.insertTaskReport(taskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId,
taskReportJson, reportAttachedFileName, false, false, taskDto.taskHotSpotInfo);
}
// #32782 指示者テーブル関連削除 end
} }
progressCallback.callback(new Integer(progress));
}
*/
JSONObject taskDirectionJson;
for (TaskDto taskDto : json.taskDtoList) {
String directionsAttachedFileName = taskDto.taskDirectionsDto.attachedFileName;
String reportAttachedFileName = taskDto.taskReportDto.attachedFileName;
taskDirectionJson = new JSONObject(taskDto.taskDirectionsDto.jsonData);
taskDirectionJson.put(ABookKeys.TASK_STATUS, taskDto.taskStatus);
int localTaskIndex = localTaskList.indexOf(taskDto); int localTaskIndex = localTaskList.indexOf(taskDto);
if (localTaskIndex >= 0) { if (localTaskIndex >= 0) {
...@@ -1057,7 +1002,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1057,7 +1002,7 @@ public class OperationListActivity extends ABVUIActivity {
mTaskDao.delete(taskDto); mTaskDao.delete(taskDto);
} }
String reportAttachedFileName = serverTaskDto.taskReportDto.attachedFileName; // String reportAttachedFileName = serverTaskDto.taskReportDto.attachedFileName;
} }
...@@ -1066,14 +1011,10 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1066,14 +1011,10 @@ public class OperationListActivity extends ABVUIActivity {
return lastEditDate; return lastEditDate;
} }
public void refreshTaskFile(final long operationId, final long contentId, final long taskId, final String taskKey, final String directionsAttachedFileName, final String reportAttachedFileName) throws ABVException, InterruptedException, ZipException, NoSuchAlgorithmException, IOException { public void refreshTaskFile(final long operationId, final long contentId, final long taskId, final String taskKey, final String attachedFileName) throws ABVException, InterruptedException, ZipException, NoSuchAlgorithmException, IOException {
// 既存の添付ディレクトリ削除 // 既存の添付ディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey)); FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
// #32782 指示者テーブル関連削除 start
// TODO change
String directionsLocalAttachedFileName = mTaskDirectionsDao.getTaskDirectionsAttachedFileName(taskKey);
// String directionsLocalAttachedFileName = mTaskReportDao.getTaskReportAttachedFileName(taskKey);
// #32782 指示者テーブル関連削除 end // #32782 指示者テーブル関連削除 end
String reportLocalAttachedFileName = mTaskReportDao.getTaskReportAttachedFileName(taskKey); String reportLocalAttachedFileName = mTaskReportDao.getTaskReportAttachedFileName(taskKey);
int count = 0; int count = 0;
......
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