Commit 3ea100c1 by Jeong Gilmo

Merge branch 'feature/1.1.0_#33721' into features/1.0.500_#33721

parents 2119dc38 f819c828
...@@ -22,6 +22,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.ContentVersionsJSON; ...@@ -22,6 +22,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.ContentVersionsJSON;
import jp.agentec.abook.abv.bl.acms.client.json.GroupsJSON; import jp.agentec.abook.abv.bl.acms.client.json.GroupsJSON;
import jp.agentec.abook.abv.bl.acms.client.json.LogSendFlagJSON; import jp.agentec.abook.abv.bl.acms.client.json.LogSendFlagJSON;
import jp.agentec.abook.abv.bl.acms.client.json.NewAppStoreLoginJSON; import jp.agentec.abook.abv.bl.acms.client.json.NewAppStoreLoginJSON;
import jp.agentec.abook.abv.bl.acms.client.json.OperationGroupMasterJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ApertureMasterDataJSON; import jp.agentec.abook.abv.bl.acms.client.json.ApertureMasterDataJSON;
import jp.agentec.abook.abv.bl.acms.client.json.RequirePasswordChangeJSON; import jp.agentec.abook.abv.bl.acms.client.json.RequirePasswordChangeJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ResultJSON; import jp.agentec.abook.abv.bl.acms.client.json.ResultJSON;
...@@ -618,22 +619,29 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -618,22 +619,29 @@ public class AcmsClient implements AcmsClientResponseListener {
/** /**
* パノラマで使用するシーンを登録 * パノラマで使用するシーンを登録
* @param sid * @param sid
* @param contentId
* @param FormFile シーンで使用する画像 * @param FormFile シーンで使用する画像
* @return * @return
* @throws IOException * @throws IOException
* @throws AcmsException * @throws AcmsException
*/ */
public SceneEntryJSON sceneEntry(String sid, File FormFile) throws IOException, AcmsException, NetworkDisconnectedException { public SceneEntryJSON sceneEntry(String sid, Long contentId, File FormFile) throws IOException, AcmsException, NetworkDisconnectedException {
if (networkAdapter != null && !networkAdapter.isNetworkConnected()) { // NWのチェック if (networkAdapter != null && !networkAdapter.isNetworkConnected()) { // NWのチェック
throw new NetworkDisconnectedException(); throw new NetworkDisconnectedException();
} }
String apiUrl = AcmsApis.getApiUrl(env.acmsAddress, urlPath, AcmsApis.ApiSceneEntry); String apiUrl = AcmsApis.getApiUrl(env.acmsAddress, urlPath, AcmsApis.ApiSceneEntry);
HttpMultipart part1 = new HttpMultipart(ABookKeys.SID, sid); HttpMultipart part1 = new HttpMultipart(ABookKeys.SID, sid);
HttpMultipart part2 = new HttpMultipart(ABookKeys.FORM_FILE, FormFile); HttpMultipart part2 = new HttpMultipart(ABookKeys.CONTENT_ID, StringUtil.toString(contentId));
HttpResponse result = HttpRequestSender.post(apiUrl, new HttpMultipart[]{part1, part2}); HttpMultipart part3 = new HttpMultipart(ABookKeys.FORM_FILE, FormFile);
HttpResponse result = HttpRequestSender.post(apiUrl, new HttpMultipart[]{part1, part2, part3});
SceneEntryJSON json = new SceneEntryJSON(result.httpResponseBody); SceneEntryJSON json = new SceneEntryJSON(result.httpResponseBody);
if (json.httpStatus != 200) { if (json.httpStatus != 200) {
throw new AcmsException(ABVExceptionCode.fromResponseCode(result.httpResponseCode), null); if (json.errorMessage != null) {
if (json.errorMessage[0].equals("P007")) {
throw new AcmsException(ABVExceptionCode.P_E_ACMS_P007, json);
}
}
throw new AcmsException(ABVExceptionCode.fromResponseCode(result.httpResponseCode), new AcmsMessageJSON(result.httpResponseBody));
} }
Logger.d(TAG, "sceneEntry res: %s", json.toString()); Logger.d(TAG, "sceneEntry res: %s", json.toString());
...@@ -704,6 +712,32 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -704,6 +712,32 @@ public class AcmsClient implements AcmsClientResponseListener {
return json; return json;
} }
/**
* 作業種別の取得API
* @param param
* @return
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public OperationGroupMasterJSON getOperationGroupMaster(AcmsParameters param) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApiOperationGroupMaster, param);
OperationGroupMasterJSON json = new OperationGroupMasterJSON(response.httpResponseBody);
return json;
}
/**
* ACMSから、絞り検索マスタデータ情報を取得します。
* @param param {@link AcmsParameters} オブジェクトです。
* @return 絞り検索マスタデータを格納したリストを返します。
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public ApertureMasterDataJSON getApertureMasterData(GetApertureMasterDataParameters param) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApiGetApertureMasterData, param);
return new ApertureMasterDataJSON(response.httpResponseBody);
}
/**********************************************************************************************/ /**********************************************************************************************/
/** 以下、共用メソッド---------------------------------------------------------------------- **/ /** 以下、共用メソッド---------------------------------------------------------------------- **/
/**********************************************************************************************/ /**********************************************************************************************/
...@@ -965,16 +999,4 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -965,16 +999,4 @@ public class AcmsClient implements AcmsClientResponseListener {
} }
} }
} }
/**
* ACMSから、絞り検索マスタデータ情報を取得します。
* @param param {@link AcmsParameters} オブジェクトです。
* @return 絞り検索マスタデータを格納したリストを返します。
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public ApertureMasterDataJSON getApertureMasterData(GetApertureMasterDataParameters param) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApiGetApertureMasterData, param);
return new ApertureMasterDataJSON(response.httpResponseBody);
}
} }
package jp.agentec.abook.abv.bl.acms.client.json;
import org.json.adf.JSONArray;
import org.json.adf.JSONObject;
import java.util.ArrayList;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.JSONValidationException;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterRelationDto;
/**
* Created by leej on 2019/06/24.
*/
public class OperationGroupMasterJSON extends AcmsCommonJSON {
public static final String OperationGroupMasterList = "operationGroupMasterList";
public static final String OperationGroupMasterId = "operationGroupMasterId";
public static final String OperationGroupMasterName = "operationGroupMasterName";
public static final String OperationGroupMasterLevel = "operationGroupMasterLevel";
public static final String ParentOperationGroupMasterId = "parentOperationGroupMasterId";
public Integer[] userGroupIds;
public ArrayList<OperationGroupMasterDto> operationGroupMasterList;
public OperationGroupMasterJSON(String jsonString) throws AcmsException {
super(jsonString);
}
@Override
protected void parse(JSONObject json) throws JSONValidationException {
operationGroupMasterList = new ArrayList<OperationGroupMasterDto>();
if (json.has(OperationGroupMasterList)) {
JSONArray operationGroupMasterJsonList = json.getJSONArray(OperationGroupMasterList);
for (int i = 0; i < operationGroupMasterJsonList.length(); i++) {
OperationGroupMasterDto dto = new OperationGroupMasterDto();
JSONObject operationGroupMasterJson = operationGroupMasterJsonList.getJSONObject(i);
dto.operationGroupMasterId = getInt(operationGroupMasterJson, OperationGroupMasterId);
dto.operationGroupMasterName = getString(operationGroupMasterJson, OperationGroupMasterName);
dto.operationGroupMasterLevel = getInt(operationGroupMasterJson, OperationGroupMasterLevel);
dto.parentOperationGroupMasterId = getInt(operationGroupMasterJson, ParentOperationGroupMasterId);
operationGroupMasterList.add(dto);
}
}
}
}
...@@ -9,6 +9,7 @@ import java.util.List; ...@@ -9,6 +9,7 @@ import java.util.List;
import jp.agentec.abook.abv.bl.common.exception.AcmsException; import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.dto.OperationContentDto; import jp.agentec.abook.abv.bl.dto.OperationContentDto;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterRelationDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto; import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.dto.TaskWorkerGroupDto; import jp.agentec.abook.abv.bl.dto.TaskWorkerGroupDto;
import jp.agentec.adf.util.DateTimeFormat; import jp.agentec.adf.util.DateTimeFormat;
...@@ -56,6 +57,9 @@ public class OperationListJSON extends AcmsCommonJSON { ...@@ -56,6 +57,9 @@ public class OperationListJSON extends AcmsCommonJSON {
public static final String EnableAddReport = "enableAddReport"; public static final String EnableAddReport = "enableAddReport";
public static final String OperationGroupMasterIdList = "operationGroupMasterIdList";
public List<OperationDto> operationList; public List<OperationDto> operationList;
public OperationListJSON(String jsonString) throws AcmsException { public OperationListJSON(String jsonString) throws AcmsException {
...@@ -73,6 +77,8 @@ public class OperationListJSON extends AcmsCommonJSON { ...@@ -73,6 +77,8 @@ public class OperationListJSON extends AcmsCommonJSON {
OperationDto dto = new OperationDto(); OperationDto dto = new OperationDto();
dto.operationContentDtoList = new ArrayList<OperationContentDto>(); dto.operationContentDtoList = new ArrayList<OperationContentDto>();
dto.taskWorkerGroupDtoList = new ArrayList<TaskWorkerGroupDto>(); dto.taskWorkerGroupDtoList = new ArrayList<TaskWorkerGroupDto>();
dto.operationGroupMasterRelationDtoList = new ArrayList<OperationGroupMasterRelationDto>();
dto.operationId = operationJson.getLong(OperationId); dto.operationId = operationJson.getLong(OperationId);
dto.operationType = operationJson.getInt(OperationType); dto.operationType = operationJson.getInt(OperationType);
dto.operationName = operationJson.getString(OperationName); dto.operationName = operationJson.getString(OperationName);
...@@ -100,7 +106,7 @@ public class OperationListJSON extends AcmsCommonJSON { ...@@ -100,7 +106,7 @@ public class OperationListJSON extends AcmsCommonJSON {
if (operationJson.has(ContentId)) { if (operationJson.has(ContentId)) {
// プロジェクト用資料の登録 // プロジェクト用資料の登録
OperationContentDto operationContentDto = new OperationContentDto(); OperationContentDto operationContentDto = new OperationContentDto();
operationContentDto.operationId = operationJson.getLong(OperationId); operationContentDto.operationId = dto.operationId;
operationContentDto.contentId = operationJson.getLong(ContentId); operationContentDto.contentId = operationJson.getLong(ContentId);
operationContentDto.operationContentFlg = true; operationContentDto.operationContentFlg = true;
dto.operationContentDtoList.add(operationContentDto); dto.operationContentDtoList.add(operationContentDto);
...@@ -111,7 +117,7 @@ public class OperationListJSON extends AcmsCommonJSON { ...@@ -111,7 +117,7 @@ public class OperationListJSON extends AcmsCommonJSON {
for (int k = 0; k < relatedContentJsonArray.length(); k++) { for (int k = 0; k < relatedContentJsonArray.length(); k++) {
// 関連資料の登録 // 関連資料の登録
OperationContentDto operationContentDto = new OperationContentDto(); OperationContentDto operationContentDto = new OperationContentDto();
operationContentDto.operationId = operationJson.getLong(OperationId); operationContentDto.operationId = dto.operationId;
operationContentDto.contentId = relatedContentJsonArray.getJSONObject(k).getInt(ContentId); operationContentDto.contentId = relatedContentJsonArray.getJSONObject(k).getInt(ContentId);
operationContentDto.operationContentFlg = false; operationContentDto.operationContentFlg = false;
dto.operationContentDtoList.add(operationContentDto); dto.operationContentDtoList.add(operationContentDto);
...@@ -154,6 +160,17 @@ public class OperationListJSON extends AcmsCommonJSON { ...@@ -154,6 +160,17 @@ public class OperationListJSON extends AcmsCommonJSON {
} }
} }
// 作業種別IDリストをセット
if (operationJson.has(OperationGroupMasterIdList)) {
// 作業種別に紐づく作業種別ID、作業IDセット
JSONArray operationGroupMasterIdJsonArray = operationJson.getJSONArray(OperationGroupMasterIdList);
for (int j = 0; j < operationGroupMasterIdJsonArray.length(); j++) {
OperationGroupMasterRelationDto operationGroupMasterRelationDto = new OperationGroupMasterRelationDto();
operationGroupMasterRelationDto.operationId = dto.operationId;
operationGroupMasterRelationDto.operationGroupMasterId = operationGroupMasterIdJsonArray.getInt(j);
dto.operationGroupMasterRelationDtoList.add(operationGroupMasterRelationDto);
}
}
operationList.add(dto); operationList.add(dto);
} }
} }
......
...@@ -10,7 +10,7 @@ import jp.agentec.abook.abv.bl.common.exception.JSONValidationException; ...@@ -10,7 +10,7 @@ import jp.agentec.abook.abv.bl.common.exception.JSONValidationException;
* Created by leej on 2018/10/26. * Created by leej on 2018/10/26.
*/ */
public class SceneEntryJSON extends AcmsCommonJSON { public class SceneEntryJSON extends AcmsMessageJSON {
private static final String ResourceId = "resourceId"; private static final String ResourceId = "resourceId";
public Integer resourceId; public Integer resourceId;
......
...@@ -152,7 +152,8 @@ public class AcmsApis { ...@@ -152,7 +152,8 @@ public class AcmsApis {
public static final String ApiGetPushMessages = "getPushMessage"; public static final String ApiGetPushMessages = "getPushMessage";
// 定期点検データ送信 // 定期点検データ送信
public static final String ApiSendRoutineTaskData = "routineTaskData"; public static final String ApiSendRoutineTaskData = "routineTaskData";
// 作業種別データ取得
public static final String ApiOperationGroupMaster = "operationGroupMaster";
// 絞り検索マスタデータ取得 // 絞り検索マスタデータ取得
public static final String ApiGetApertureMasterData = "getApertureMasterData"; public static final String ApiGetApertureMasterData = "getApertureMasterData";
...@@ -199,7 +200,7 @@ public class AcmsApis { ...@@ -199,7 +200,7 @@ public class AcmsApis {
} else if (methodName.equals(ApiOperationList) || methodName.equals(ApiWorkingGroupList) || 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(ApiSendRoutineTaskData) || methodName.equals(ApiSendPushMessage) || methodName.equals(ApiGetPushMessages) || methodName.equals(ApiSendRoutineTaskData) ||
methodName.equals(ApiGetApertureMasterData)) { // 絞り検索マスタデータ取得のAPI methodName.equals(ApiOperationGroupMaster) || methodName.equals(ApiGetApertureMasterData)) {
apiValue = Constant.ApiValue.checkapi; apiValue = Constant.ApiValue.checkapi;
} }
......
...@@ -147,5 +147,10 @@ public interface ServiceOption { ...@@ -147,5 +147,10 @@ public interface ServiceOption {
* 報告タイプ:N(通常)、Y(定期点検) * 報告タイプ:N(通常)、Y(定期点検)
*/ */
int OperationReportType = 171; int OperationReportType = 171;
/**
* 作業種別:N(通常)、Y(作業種別毎に絞り込み可能なボタン・画面表示)
*/
int OperationGroupMaster = 175;
} }
} }
\ No newline at end of file
...@@ -62,6 +62,8 @@ public class ABVEnvironment { ...@@ -62,6 +62,8 @@ public class ABVEnvironment {
// Serverから取得したcontentVersion時のリソースパターンを一時的に保存するための変数 // Serverから取得したcontentVersion時のリソースパターンを一時的に保存するための変数
public int resourcePatternType; public int resourcePatternType;
public boolean operationGroupMasterClearFlg;
////////////////////////////// 定数 ////////////////////////////////// ////////////////////////////// 定数 //////////////////////////////////
private static final String ServerTimeKey = "ABook"; private static final String ServerTimeKey = "ABook";
...@@ -234,6 +236,22 @@ public class ABVEnvironment { ...@@ -234,6 +236,22 @@ public class ABVEnvironment {
return logLevel; return logLevel;
} }
/**
* 作業種別のクリア判定フラグをセット
* @param clearFlg
*/
public void setOperationGroupMasterClearFlg(boolean clearFlg) {
this.operationGroupMasterClearFlg = clearFlg;
}
/**
* 作業種別のクリア判定フラグ取得
* @return
*/
public boolean getOperationGroupMasterClearFlg() {
return operationGroupMasterClearFlg;
}
///////////////////////////////////////     以下ファイルパス関係     /////////////////////////////////////// ///////////////////////////////////////     以下ファイルパス関係     ///////////////////////////////////////
......
...@@ -224,7 +224,11 @@ public enum ABVExceptionCode { ...@@ -224,7 +224,11 @@ public enum ABVExceptionCode {
/** /**
* 既に作業報告を行う権限がありません。 * 既に作業報告を行う権限がありません。
*/ */
P_E_ACMS_P006; P_E_ACMS_P006,
/**
* ロック中である場合
*/
P_E_ACMS_P007;
/** /**
* HTTPレスポンスコードから対応するコードを返す * HTTPレスポンスコードから対応するコードを返す
......
...@@ -300,10 +300,6 @@ public class ABVDataCache { ...@@ -300,10 +300,6 @@ public class ABVDataCache {
return isServiceOptionEnable(ServiceOptionId.CatalogEdition); return isServiceOptionEnable(ServiceOptionId.CatalogEdition);
} }
public boolean isBizEdition() {
return !isServiceOptionEnable(ServiceOptionId.CatalogEdition) && !isServiceOptionEnable(ServiceOptionId.Publisher);
}
public boolean isReportGPS() { public boolean isReportGPS() {
return isServiceOptionEnable(ServiceOptionId.REPORT_GPS); return isServiceOptionEnable(ServiceOptionId.REPORT_GPS);
} }
...@@ -340,6 +336,14 @@ public class ABVDataCache { ...@@ -340,6 +336,14 @@ public class ABVDataCache {
return isServiceOptionEnable(ServiceOptionId.PanoImage); return isServiceOptionEnable(ServiceOptionId.PanoImage);
} }
/**
* 作業種別のサービスオプション情報取得
* @return
*/
public boolean isOperationGroupMaster() {
return isServiceOptionEnable(ServiceOptionId.OperationGroupMaster);
}
public boolean isServiceOptionEnable(int serviceOptionId) { public boolean isServiceOptionEnable(int serviceOptionId) {
ServiceOptionDto dto = getServiceOption(serviceOptionId); ServiceOptionDto dto = getServiceOption(serviceOptionId);
if (dto != null) { if (dto != null) {
......
...@@ -13,12 +13,14 @@ import jp.agentec.abook.abv.bl.data.tables.MAppConfig; ...@@ -13,12 +13,14 @@ import jp.agentec.abook.abv.bl.data.tables.MAppConfig;
import jp.agentec.abook.abv.bl.data.tables.MCategory; import jp.agentec.abook.abv.bl.data.tables.MCategory;
import jp.agentec.abook.abv.bl.data.tables.MGroup; import jp.agentec.abook.abv.bl.data.tables.MGroup;
import jp.agentec.abook.abv.bl.data.tables.MMemberInfo; import jp.agentec.abook.abv.bl.data.tables.MMemberInfo;
import jp.agentec.abook.abv.bl.data.tables.MOperationGroupMaster;
import jp.agentec.abook.abv.bl.data.tables.MPasswordLockInfo; import jp.agentec.abook.abv.bl.data.tables.MPasswordLockInfo;
import jp.agentec.abook.abv.bl.data.tables.MServiceOption; import jp.agentec.abook.abv.bl.data.tables.MServiceOption;
import jp.agentec.abook.abv.bl.data.tables.MWorkerGroup; import jp.agentec.abook.abv.bl.data.tables.MWorkerGroup;
import jp.agentec.abook.abv.bl.data.tables.ROperationContent; import jp.agentec.abook.abv.bl.data.tables.ROperationContent;
import jp.agentec.abook.abv.bl.data.tables.RContentCategory; import jp.agentec.abook.abv.bl.data.tables.RContentCategory;
import jp.agentec.abook.abv.bl.data.tables.RContentGroup; import jp.agentec.abook.abv.bl.data.tables.RContentGroup;
import jp.agentec.abook.abv.bl.data.tables.ROperationGroupMasterOperation;
import jp.agentec.abook.abv.bl.data.tables.RTaskWorkerGroup; import jp.agentec.abook.abv.bl.data.tables.RTaskWorkerGroup;
import jp.agentec.abook.abv.bl.data.tables.SQLiteTableScript; import jp.agentec.abook.abv.bl.data.tables.SQLiteTableScript;
import jp.agentec.abook.abv.bl.data.tables.TContent; import jp.agentec.abook.abv.bl.data.tables.TContent;
...@@ -94,6 +96,8 @@ public class ABVDataOpenHelper { ...@@ -94,6 +96,8 @@ public class ABVDataOpenHelper {
iTableScripts.add(new TTaskReportSend()); iTableScripts.add(new TTaskReportSend());
iTableScripts.add(new TTaskReportItems()); iTableScripts.add(new TTaskReportItems());
iTableScripts.add(new TPushMessage()); iTableScripts.add(new TPushMessage());
iTableScripts.add(new MOperationGroupMaster());
iTableScripts.add(new ROperationGroupMasterOperation());
return iTableScripts; return iTableScripts;
} }
......
...@@ -19,7 +19,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase; ...@@ -19,7 +19,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
public class DBConnector { public class DBConnector {
private static volatile DBConnector dbConnector = null; private static volatile DBConnector dbConnector = null;
public static final String DatabaseName = "ABVJE"; public static final String DatabaseName = "ABVJE";
public static final int DatabaseVersion = DatabaseVersions.Ver1_0_0; public static final int DatabaseVersion = DatabaseVersions.Ver1_1_0;
protected SQLiteDatabase db = null; protected SQLiteDatabase db = null;
......
...@@ -3,5 +3,6 @@ package jp.agentec.abook.abv.bl.data; ...@@ -3,5 +3,6 @@ package jp.agentec.abook.abv.bl.data;
// バージョンが上がるごとに+10すること // バージョンが上がるごとに+10すること
public class DatabaseVersions { public class DatabaseVersions {
public static final int Ver1_0_0 = 1; public static final int Ver1_0_0 = 1;
public static final int Ver1_1_0 = 11;
} }
...@@ -210,15 +210,24 @@ public class OperationDao extends AbstractDao { ...@@ -210,15 +210,24 @@ public class OperationDao extends AbstractDao {
return count > 0; return count > 0;
} }
/**
* 該当作業を削除(関連テーブルを含む)
* @param dto
*/
public void delete(OperationDto dto) { public void delete(OperationDto dto) {
delete("r_task_worker_group", "operation_id=?", dto.getKeyValues()); delete("r_task_worker_group", "operation_id=?", dto.getKeyValues());
delete("r_operation_content", "operation_id=?", dto.getKeyValues()); delete("r_operation_content", "operation_id=?", dto.getKeyValues());
delete("r_operation_group_master_relation", "operation_id=?", dto.getKeyValues());
delete("t_operation", "operation_id=?", dto.getKeyValues()); delete("t_operation", "operation_id=?", dto.getKeyValues());
} }
/**
* 作業リスト全て削除(関連テーブルを含む)
*/
public void deleteAll() { public void deleteAll() {
delete("t_push_message", null, null); delete("t_push_message", null, null);
delete("r_operation_content", null, null); delete("r_operation_content", null, null);
delete("r_operation_group_master_relation", null, null);
delete("r_task_worker_group", null, null); delete("r_task_worker_group", null, null);
delete("t_operation", null, null); delete("t_operation", null, null);
delete("t_task", null, null); delete("t_task", null, null);
...@@ -228,11 +237,28 @@ public class OperationDao extends AbstractDao { ...@@ -228,11 +237,28 @@ public class OperationDao extends AbstractDao {
delete("m_worker_group", null, null); delete("m_worker_group", null, null);
} }
/**
* 引数の検索条件で作業情報リストを取得(作業一覧表示用)
* @param searchOperationName
* @param searchStartDateStr
* @param searchEndDateStr
* @param reportTypeStr
* @return
*/
public List<OperationDto> getOperations(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) { public List<OperationDto> getOperations(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) {
String sql = generateGetOperationQuery(searchOperationName, searchStartDateStr, searchEndDateStr, reportTypeStr); String sql = generateGetOperationQuery(searchOperationName, searchStartDateStr, searchEndDateStr, reportTypeStr);
return rawQueryGetDtoList(sql, null, OperationDto.class); return rawQueryGetDtoList(sql, null, OperationDto.class);
} }
/**
* 引数の検索条件で作業情報リストを
* 取得用のsql文作成
* @param searchOperationName
* @param searchStartDateStr
* @param searchEndDateStr
* @param reportTypeStr
* @return
*/
private String generateGetOperationQuery(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) { private String generateGetOperationQuery(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) {
String curDate = DateTimeUtil.toStringInTimeZone(new Date(), DateTimeFormat.yyyyMMddHHmmss_hyphen, "UTC"); String curDate = DateTimeUtil.toStringInTimeZone(new Date(), DateTimeFormat.yyyyMMddHHmmss_hyphen, "UTC");
...@@ -336,4 +362,25 @@ public class OperationDao extends AbstractDao { ...@@ -336,4 +362,25 @@ public class OperationDao extends AbstractDao {
updateNeedSyncFlg(operationDto.operationId, true); updateNeedSyncFlg(operationDto.operationId, true);
} }
} }
/**
* 作業種別IDで関連する作業リストを取得
* @param operationGroupMasterId
* @return
*/
public List<OperationDto> getOperationByOperationGroupMasterId(Integer operationGroupMasterId) {
StringBuffer sql = new StringBuffer();
sql.append(" SELECT * ");
sql.append(" FROM t_operation AS top");
// INNER JOIN r_operation_group_master_relation
sql.append(" INNER JOIN r_operation_group_master_relation AS rog");
sql.append(" ON rog.operation_id = top.operation_id");
// LEFT OUTER JOIN r_operation_content
sql.append(" LEFT OUTER JOIN r_operation_content AS rpc ");
sql.append(" ON top.operation_id = rpc.operation_id ");
sql.append(" AND rpc.operation_content_flg = 1 ");
sql.append(" WHERE rog.operation_group_master_id = ?");
sql.append(" ORDER BY top.operation_start_date DESC, top.operation_id DESC");
return rawQueryGetDtoList(sql.toString(), new String[] { "" + operationGroupMasterId }, OperationDto.class);
}
} }
\ No newline at end of file
package jp.agentec.abook.abv.bl.data.dao;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import jp.agentec.abook.abv.bl.acms.type.SearchDivisionType;
import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.GroupDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.NumericUtil;
import jp.agentec.adf.util.StringUtil;
/**
* Created by leej on 2019/06/25.
*/
public class OperationGroupMasterDao extends AbstractDao {
private static final String TAG = "OperationGroupMasterDao";
private enum QueryType {GetAllGroups, GetRootGroups, GetGroups}
/*package*/ OperationGroupMasterDao() {
}
@Override
protected OperationGroupMasterDto convert(Cursor cursor) {
OperationGroupMasterDto dto = new OperationGroupMasterDto();
int column = cursor.getColumnIndex("operation_group_master_id");
if (column != -1) {
dto.operationGroupMasterId = cursor.getInt(column);
}
column = cursor.getColumnIndex("operation_group_master_name");
if (column != -1) {
dto.operationGroupMasterName = cursor.getString(column);
}
if (column != -1) {
column = cursor.getColumnIndex("parent_operation_group_master_id");
dto.parentOperationGroupMasterId = cursor.getInt(column);
}
column = cursor.getColumnIndex("operation_group_master_level");
if (column != -1) {
dto.operationGroupMasterLevel = cursor.getInt(column);
}
column = cursor.getColumnIndex("operation_count");
if (column != -1) {
dto.operationCount = cursor.getInt(column);
}
return dto;
}
/**
* 作業種別をDB登録処理
* @param dto
*/
public void insertOperationGroupMaster(OperationGroupMasterDto dto) {
StringBuffer sql = new StringBuffer();
sql.append(" INSERT OR IGNORE INTO m_operation_group_master (operation_group_master_id, operation_group_master_name, parent_operation_group_master_id, operation_group_master_level) ");
sql.append(" VALUES (?,?,?,?) ");
try {
beginTransaction();
insert(sql.toString(), dto.getInsertValues());
commit();
} catch (Exception e) {
rollback();
Logger.e("insertOperationGroupMaster failed.", e);
throw new RuntimeException(e);
}
Logger.v(TAG, "sql=%s", sql);
}
/**
* 作業種別をDB更新処理
* @param dto
*/
public void updateOperationGroupMaster(OperationGroupMasterDto dto) {
StringBuffer sql = new StringBuffer();
sql.append(" UPDATE m_operation_group_master ");
sql.append(" SET operation_group_master_name = ? ");
sql.append(" ,parent_operation_group_master_id = ? ");
sql.append(" ,operation_group_master_level = ? ");
sql.append(" WHERE operation_group_master_id = ? ");
try {
beginTransaction();
update(sql.toString(), dto.getUpdateValues());
commit();
} catch (Exception e) {
rollback();
Logger.e("insertGroup failed.", e);
throw new RuntimeException(e);
}
Logger.v(TAG, "sql=%s", sql);
}
/**
* 親階層のIDで子供の階層を取得
* sort:作業種別名 昇順
* @param parentId
* @return
*/
public List<OperationGroupMasterDto> getOperationGroupMasterChildList(int parentId) {
List<OperationGroupMasterDto> list;
list = rawQueryGetDtoList("select * from m_operation_group_master where parent_operation_group_master_id = ? order by operation_group_master_name ASC", new String[]{""+ parentId}, OperationGroupMasterDto.class);
return list;
}
/**
* 最上位階層を取得
* @return
*/
public OperationGroupMasterDto getTopOperationGroupMaster() {
return rawQueryGetDto("select * from m_operation_group_master where operation_group_master_level = 0", null, OperationGroupMasterDto.class);
}
/**
* 全作業種別を取得
* @return
*/
public List<OperationGroupMasterDto> getAllOperationGroupMaster() {
return rawQueryGetDtoList("select * from m_operation_group_master", null, OperationGroupMasterDto.class);
}
/**
* operationGroupMasterIdで作業種別を取得
* @param operationGroupMasterId
* @return
*/
public OperationGroupMasterDto getOperationGroupMaster(Integer operationGroupMasterId) {
return rawQueryGetDto("select * from m_operation_group_master where operation_group_master_id = ?", new String[]{"" + operationGroupMasterId}, OperationGroupMasterDto.class);
}
/**
* operationGroupMasterIdのデータ存在チェック
* @param operationGroupMasterId
* @return
*/
public boolean isExistOperationGroupMaster(Integer operationGroupMasterId) {
return getOperationGroupMaster(operationGroupMasterId) != null;
}
/**
* 作業種別に関連するテーブルを全て削除
* @param dto
*/
public void delete(OperationGroupMasterDto dto) {
// 作業種別と作業のリレーションテーブル
delete("r_operation_group_master_relation", "operation_group_master_id=?", dto.getKeyValues());
// 作業種別のマスタテーブル
delete("m_operation_group_master", "operation_group_master_id=?", dto.getKeyValues());
}
/**
* 階層の作業種別情報取得(検索結果を元にデータ取得)
* @param searchOperationName
* @param searchStartDateStr
* @param searchEndDateStr
* @param reportTypeStr
* @param level
* @return
*/
public List<OperationGroupMasterDto> getOperationGroupMasterListBylevel(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr, Integer level) {
StringBuffer sql = new StringBuffer();
sql.append(" SELECT M1.*, count(R1.operation_id) AS operation_count FROM m_operation_group_master AS M1");
sql.append(" LEFT OUTER JOIN r_operation_group_master_relation R1");
sql.append(" ON R1.operation_group_master_id = M1.operation_group_master_id");
sql.append(" AND R1.operation_id IN(");
sql.append(" SELECT operation_id FROM t_operation top");
sql.append(" WHERE top.operation_id IS NOT NULL");
if (!StringUtil.isNullOrEmpty(searchOperationName)) {
sql.append(" AND top.operation_name GLOB " + "'*" + searchOperationName + "*'");
}
if (!StringUtil.isNullOrEmpty(searchStartDateStr)) {
Date startDate = DateTimeUtil.toDate(searchStartDateStr, "UTC", DateTimeFormat.yyyyMMdd_hyphen);
sql.append(" AND top.operation_end_date >= '" + DateTimeUtil.toString(startDate, DateTimeFormat.yyyyMMdd_hyphen) + "'");
}
if (!StringUtil.isNullOrEmpty(searchEndDateStr)) {
Date endDate = DateTimeUtil.toDate(searchEndDateStr, "UTC", DateTimeFormat.yyyyMMdd_hyphen);
sql.append(" AND top.operation_start_date <= '" + DateTimeUtil.toString(endDate, DateTimeFormat.yyyyMMdd_hyphen) + "'");
}
if (reportTypeStr != null) {
sql.append(" AND top.report_type in ("+ reportTypeStr +")");
}
sql.append(" )");
sql.append(" WHERE M1.operation_group_master_level =? ");
sql.append(" GROUP BY M1.operation_group_master_id");
Logger.v(TAG, "sql=%s", sql);
return rawQueryGetDtoList(sql.toString(), new String[]{""+ level}, OperationGroupMasterDto.class);
}
/**
* 最後のOperationGroupMasterレベル取得
* @return
*/
public Integer getLastGroupLevel() {
return rawQueryGetInt("SELECT MAX(operation_group_master_level) FROM m_operation_group_master", null);
}
}
\ No newline at end of file
package jp.agentec.abook.abv.bl.data.dao;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
import jp.agentec.abook.abv.bl.common.db.SQLiteStatement;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterRelationDto;
/**
* Created by leej on 2019/06/26.
*/
public class OperationGroupMasterOperationDao extends AbstractDao {
private static final String TAG = "OperationGroupMasterDao";
private enum QueryType {GetAllGroups, GetRootGroups, GetGroups}
/*package*/ OperationGroupMasterOperationDao() {
}
@Override
protected OperationGroupMasterRelationDto convert(Cursor cursor) {
OperationGroupMasterRelationDto dto = new OperationGroupMasterRelationDto();
int column = cursor.getColumnIndex("operation_group_master_id");
if (column != -1) {
dto.operationGroupMasterId = cursor.getInt(column);
}
column = cursor.getColumnIndex("operation_id");
if (column != -1) {
dto.operationId = cursor.getLong(column);
}
return dto;
}
/**
* 作業種別と作業のリレーションテーブル削除
* @param operationGroupMasterId
*/
public void deleteOperationGroupMasterOperation(Integer operationGroupMasterId, Long operationId) {
delete("r_operation_group_master_relation", "operation_group_master_id=? AND operation_id=?", new String[]{""+ operationGroupMasterId, ""+ operationId});
}
/**
* 作業種別と作業のリレーションテーブルのDB登録処理
* @param dto
*/
public boolean insertOperationGroupMasterOperation(OperationGroupMasterRelationDto dto) {
StringBuffer sql = new StringBuffer();
sql.append(" INSERT OR IGNORE INTO r_operation_group_master_relation ");
sql.append(" SELECT " + dto.operationGroupMasterId);
sql.append(" , " + dto.operationId);
sql.append(" FROM t_operation AS top ");
sql.append(" LEFT OUTER JOIN r_operation_group_master_relation AS rmogm ");
sql.append(" ON rmogm.operation_group_master_id = ? ");
sql.append(" AND top.operation_id <> rmogm.operation_id ");
sql.append(" WHERE top.operation_id = ? ");
sql.append(" GROUP BY rmogm.operation_group_master_id ");
SQLiteStatement stmt = null;
Logger.v(TAG, "sql=%s", sql);
try {
SQLiteDatabase db = getDatabase();
stmt = db.compileStatement(sql.toString());
stmt.bindLong(1, dto.operationGroupMasterId);
stmt.bindLong(2, dto.operationId);
return (stmt.executeInsert() > 0);
} finally {
if (stmt != null) {
stmt.close();
}
}
}
/**
* 作業種別IDで関連する作業のIDを取得
* @param operationId
* @return
*/
public List<Integer> getOperationGroupMasterIds(Long operationId) {
return rawQueryGetIntegerList("select operation_group_master_id from r_operation_group_master_relation where operation_id=?", new String[]{""+ operationId});
}
}
\ No newline at end of file
package jp.agentec.abook.abv.bl.data.tables;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
import jp.agentec.adf.util.StringUtil;
/**
* Created by leej on 2019/06/24.
*/
public class MOperationGroupMaster extends SQLiteTableScript {
public MOperationGroupMaster() {
super();
}
@Override
public List<String> getCreateScript(int version) {
List<String> ddl = new ArrayList<String>();
StringBuffer sql = new StringBuffer();
sql.append(" CREATE TABLE m_operation_group_master ( ");
sql.append(" operation_group_master_id INTEGER NOT NULL ");
sql.append(" , operation_group_master_name VARCHAR(64) NOT NULL ");
sql.append(" , parent_operation_group_master_id INTEGER ");
sql.append(" , operation_group_master_level INTEGER NOT NULL ");
sql.append(" , PRIMARY KEY (operation_group_master_id) ");
sql.append(" ) ");
ddl.add(sql.toString());
StringUtil.clear(sql);
sql.append(" CREATE INDEX idx_group_master_1 ON m_operation_group_master ( ");
sql.append(" parent_operation_group_master_id ");
sql.append(" ) ");
ddl.add(sql.toString());
return ddl;
}
@Override
public List<String> getUpgradeScript(int oldVersion, int newVersion) {
return null;
}
@Override
public List<String> getMigrationScript(SQLiteDatabase databaseConnection, int oldVersion, int newVersion, Object... params) {
return null;
}
}
package jp.agentec.abook.abv.bl.data.tables;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
/**
* Created by leej on 2019/06/25.
*/
public class ROperationGroupMasterOperation extends SQLiteTableScript {
public ROperationGroupMasterOperation() {
super();
}
@Override
public List<String> getCreateScript(int version) {
List<String> ddl = new ArrayList<String>();
StringBuffer sql = new StringBuffer();
sql.append(" CREATE TABLE r_operation_group_master_relation ( ");
sql.append(" operation_group_master_id INTEGER NOT NULL ");
sql.append(" , operation_id BIGINT NOT NULL ");
sql.append(" , PRIMARY KEY (operation_group_master_id, operation_id) ");
sql.append(" , FOREIGN KEY (operation_group_master_id) REFERENCES m_operation_group_master (operation_group_master_id) ");
sql.append(" , FOREIGN KEY (operation_id) REFERENCES t_operation (operation_id)");
sql.append(" ) ");
ddl.add(sql.toString());
return ddl;
}
@Override
public List<String> getUpgradeScript(int oldVersion, int newVersion) {
return null;
}
@Override
public List<String> getMigrationScript(SQLiteDatabase databaseConnection, int oldVersion, int newVersion, Object... params) {
return null;
}
}
\ No newline at end of file
...@@ -344,6 +344,7 @@ public class ContentRefresher { ...@@ -344,6 +344,7 @@ public class ContentRefresher {
try { try {
// サーバー通信でプロジェクト取得 // サーバー通信でプロジェクト取得
operationLogic.initializeOperations(); operationLogic.initializeOperations();
} catch (Exception e1) { } catch (Exception e1) {
Logger.e(TAG, e1); Logger.e(TAG, e1);
e = e1; e = e1;
......
...@@ -32,6 +32,8 @@ public class OperationDto extends AbstractDto { ...@@ -32,6 +32,8 @@ public class OperationDto extends AbstractDto {
public int enableReportEdit; // 作業編集可能区分 public int enableReportEdit; // 作業編集可能区分
public int enableAddReport; // 作業追加区分 public int enableAddReport; // 作業追加区分
public List<OperationGroupMasterRelationDto> operationGroupMasterRelationDtoList; // 作業種別に紐づく作業Dto
// 作業担当グループリスト // 作業担当グループリスト
public List<TaskWorkerGroupDto> taskWorkerGroupDtoList; public List<TaskWorkerGroupDto> taskWorkerGroupDtoList;
......
package jp.agentec.abook.abv.bl.dto;
import java.util.List;
/**
* Created by leej on 2019/06/25.
*/
public class OperationGroupMasterDto extends AbstractDto {
public int operationGroupMasterId; // 作業種別ID
public String operationGroupMasterName; // 作業種別名称
public int parentOperationGroupMasterId; // 作業種別の親階層ID
public int operationGroupMasterLevel; // 作業種別の階層レベル
public int operationCount = 0; // 作業種別に紐づく作業数
public OperationGroupMasterDto() {
}
@Override
public Object[] getInsertValues() {
return new Object[]{operationGroupMasterId, operationGroupMasterName, parentOperationGroupMasterId, operationGroupMasterLevel};
}
@Override
public Object[] getUpdateValues() {
return new Object[]{operationGroupMasterName, parentOperationGroupMasterId, operationGroupMasterLevel, operationGroupMasterId};
}
@Override
public String[] getKeyValues() {
return new String[]{""+ operationGroupMasterId};
}
}
\ No newline at end of file
package jp.agentec.abook.abv.bl.dto;
/**
* Created by leej on 2019/06/25.
*/
public class OperationGroupMasterRelationDto extends AbstractDto {
// 作業種別ID
public Integer operationGroupMasterId;
// 作業ID
public Long operationId;
@Override
public Object[] getInsertValues() {
return new Object[]{operationGroupMasterId, operationId};
}
@Override
public String[] getKeyValues() {
return new String[]{""+ operationGroupMasterId};
}
}
\ No newline at end of file
package jp.agentec.abook.abv.bl.dto.comparator;
import java.util.Comparator;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto;
/**
* Created by leej on 2019/06/28.
*/
public class OperationGroupMasterLevelComparator implements Comparator<OperationGroupMasterDto> {
@Override
public int compare(OperationGroupMasterDto dto1, OperationGroupMasterDto dto2) {
int operationGroupMasterLevel1 = dto1.operationGroupMasterLevel;
int operationGroupMasterLevel2 = dto2.operationGroupMasterLevel;
int result;
if (operationGroupMasterLevel1 > operationGroupMasterLevel2) {
result = 1;
} else if(operationGroupMasterLevel1 == operationGroupMasterLevel2) {
result = 0;
} else {
result = -1;
}
return result;
}
}
\ No newline at end of file
package jp.agentec.abook.abv.bl.logic;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.OperationGroupMasterJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.OperationDao;
import jp.agentec.abook.abv.bl.data.dao.OperationGroupMasterDao;
import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterRelationDto;
import jp.agentec.abook.abv.bl.dto.comparator.OperationGroupMasterLevelComparator;
/**
* Created by leej on 2019/06/26.
*/
public class OperationGroupMasterLogic extends AbstractLogic {
private static final String TAG = "OperationGroupMasterLogic";
private OperationGroupMasterDao mOperationGroupMasterDao = AbstractDao.getDao(OperationGroupMasterDao.class);
private OperationDao mOperationDao = AbstractDao.getDao(OperationDao.class);
/**
* 作業種別・作業種別に紐づいた作業IDを取得して
* DBに登録する
*/
public void setOperationGroupMaster() throws NetworkDisconnectedException, AcmsException {
try {
// サーバー通信で、作業種別情報を取得する
List<OperationGroupMasterDto> serverOperationGroupMasterDtos = getOperationGroupMasterServerData();
// ローカルDBに存在する作業種別情報をDto配列でセット
List<OperationGroupMasterDto> localOperationGroupMasterDtos = mOperationGroupMasterDao.getAllOperationGroupMaster();
List<Integer> localOperationGroupMasterIds = new ArrayList<Integer>();
boolean updateFlg = false;
for (OperationGroupMasterDto serverOperationGroupMasterDto : serverOperationGroupMasterDtos) {
// DB登録フラグ
boolean insertFlg = true;
for (OperationGroupMasterDto localOperationGroupMasterDto : localOperationGroupMasterDtos) {
// サーバーで取得したIDでローカルに存在するか比較して、更新・登録を判定
if (serverOperationGroupMasterDto.operationGroupMasterId == localOperationGroupMasterDto.operationGroupMasterId) {
// DB更新処理(作業種別の親階層が変更されたか、作業種別名が変更されたときのみ)
if (serverOperationGroupMasterDto.parentOperationGroupMasterId != localOperationGroupMasterDto.parentOperationGroupMasterId || !serverOperationGroupMasterDto.operationGroupMasterName.equals(localOperationGroupMasterDto.operationGroupMasterName)) {
Logger.d(TAG, "[UPDATE] OperationGroupMaster operationGroupMasterId=" + serverOperationGroupMasterDto.operationGroupMasterId + " operationGroupMasterName=" + serverOperationGroupMasterDto.operationGroupMasterName);
mOperationGroupMasterDao.updateOperationGroupMaster(serverOperationGroupMasterDto);
updateFlg = true;
}
// 更新処理が終わったら登録フラグをfalseにしてlocalOperationGroupMasterDtosから除外する
insertFlg = false;
localOperationGroupMasterDtos.remove(localOperationGroupMasterDto);
break;
}
}
// 更新されたら以下の処理は行わない
if (insertFlg) {
Logger.d(TAG, "[INSERT] OperationGroupMaster operationGroupMasterId=" + serverOperationGroupMasterDto.operationGroupMasterId + " operationGroupMasterName=" + serverOperationGroupMasterDto.operationGroupMasterName);
// DB登録処理
mOperationGroupMasterDao.insertOperationGroupMaster(serverOperationGroupMasterDto);
}
}
// 作業種別関連テーブルの削除処理
for (OperationGroupMasterDto deleteOperationGroupMasterDto : localOperationGroupMasterDtos) {
updateFlg = true;
mOperationGroupMasterDao.delete(deleteOperationGroupMasterDto);
}
// 作業種別のクリアフラグをセット
ABVEnvironment.getInstance().setOperationGroupMasterClearFlg(updateFlg);
} catch (Exception e) {
Logger.e(e.getMessage());
}
}
/**
* API通信で取得した作業種別情報のリストを返す
* @return
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
private List<OperationGroupMasterDto> getOperationGroupMasterServerData() throws NetworkDisconnectedException, AcmsException {
AcmsParameters param = new AcmsParameters(cache.getMemberInfo().sid);
OperationGroupMasterJSON json = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getOperationGroupMaster(param);
return json.operationGroupMasterList;
}
/**
* 作業種別毎に作業数(子グループの作業も含む)を
* operationCountMapにセットする
* @param searchOperationName
* @param searchStartDateStr
* @param searchEndDateStr
* @param reportTypeStr
* @param level
* @param operationCountMap
*/
public void getAllOperationCount(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr, int level, Map<Integer, Integer> operationCountMap) {
List<OperationGroupMasterDto> operationGroupMasterDtoList;
operationGroupMasterDtoList = mOperationGroupMasterDao.getOperationGroupMasterListBylevel(searchOperationName, searchStartDateStr, searchEndDateStr, reportTypeStr, level);
// ルート階層の場合は以下の処理しない
if (level > 0 && operationGroupMasterDtoList != null) {
for (OperationGroupMasterDto operationGroupMasterDto : operationGroupMasterDtoList) {
if (operationCountMap.containsKey(operationGroupMasterDto.operationGroupMasterId)) {
operationCountMap.put(operationGroupMasterDto.operationGroupMasterId, operationCountMap.get(operationGroupMasterDto.operationGroupMasterId) + operationGroupMasterDto.operationCount);
} else {
operationCountMap.put(operationGroupMasterDto.operationGroupMasterId, operationGroupMasterDto.operationCount);
}
// 値が存在する場合
if (operationCountMap.get(operationGroupMasterDto.operationGroupMasterId) > 0) {
if (operationCountMap.containsKey(operationGroupMasterDto.parentOperationGroupMasterId)) {
// 更新
operationCountMap.put(operationGroupMasterDto.parentOperationGroupMasterId, operationCountMap.get(operationGroupMasterDto.parentOperationGroupMasterId) + operationCountMap.get(operationGroupMasterDto.operationGroupMasterId));
} else {
// 新規
operationCountMap.put(operationGroupMasterDto.parentOperationGroupMasterId, operationCountMap.get(operationGroupMasterDto.operationGroupMasterId));
}
}
}
level--;
getAllOperationCount(searchOperationName, searchStartDateStr, searchEndDateStr, reportTypeStr, level, operationCountMap); // 再帰呼び出し
}
}
/**
* 最後の階層レベル取得
* @return
*/
public Integer getLastGroupLevel() {
return mOperationGroupMasterDao.getLastGroupLevel();
}
/**
* 親の階層パスをリストでセット
* @param operationGroupMasterId
* @return
*/
public List<OperationGroupMasterDto> getParentOperationGroupMasterForPath (Integer operationGroupMasterId) {
List<OperationGroupMasterDto> operationGroupMasterDtoList = new ArrayList<OperationGroupMasterDto>();
// 作業種別DTO取得
OperationGroupMasterDto dto = mOperationGroupMasterDao.getOperationGroupMaster(operationGroupMasterId);
operationGroupMasterDtoList.add(dto);
int parentId = dto.parentOperationGroupMasterId;
for (int i = 0; i < dto.operationGroupMasterLevel; i++) {
OperationGroupMasterDto parentOperationDto = mOperationGroupMasterDao.getOperationGroupMaster(parentId);
parentId = parentOperationDto.parentOperationGroupMasterId;
operationGroupMasterDtoList.add(parentOperationDto);
}
Collections.sort(operationGroupMasterDtoList, new OperationGroupMasterLevelComparator());
return operationGroupMasterDtoList;
}
/**
* 作業種別IDで関連する作業リストを取得
* @param operationGroupMasterId
* @return
*/
public List<OperationDto> getOperationByOperationGroupMasterId(Integer operationGroupMasterId) {
return mOperationDao.getOperationByOperationGroupMasterId(operationGroupMasterId);
}
}
...@@ -38,6 +38,7 @@ import jp.agentec.abook.abv.bl.data.dao.AbstractDao; ...@@ -38,6 +38,7 @@ import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao; import jp.agentec.abook.abv.bl.data.dao.ContentDao;
import jp.agentec.abook.abv.bl.data.dao.OperationContentDao; import jp.agentec.abook.abv.bl.data.dao.OperationContentDao;
import jp.agentec.abook.abv.bl.data.dao.OperationDao; import jp.agentec.abook.abv.bl.data.dao.OperationDao;
import jp.agentec.abook.abv.bl.data.dao.OperationGroupMasterOperationDao;
import jp.agentec.abook.abv.bl.data.dao.PushMessageDao; import jp.agentec.abook.abv.bl.data.dao.PushMessageDao;
import jp.agentec.abook.abv.bl.data.dao.TaskDao; import jp.agentec.abook.abv.bl.data.dao.TaskDao;
import jp.agentec.abook.abv.bl.data.dao.TaskReportDao; import jp.agentec.abook.abv.bl.data.dao.TaskReportDao;
...@@ -49,6 +50,7 @@ import jp.agentec.abook.abv.bl.dto.CategoryContentDto; ...@@ -49,6 +50,7 @@ import jp.agentec.abook.abv.bl.dto.CategoryContentDto;
import jp.agentec.abook.abv.bl.dto.ContentDto; import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.OperationContentDto; import jp.agentec.abook.abv.bl.dto.OperationContentDto;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterRelationDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto; import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.dto.TaskDto; import jp.agentec.abook.abv.bl.dto.TaskDto;
import jp.agentec.abook.abv.bl.dto.TaskReportDto; import jp.agentec.abook.abv.bl.dto.TaskReportDto;
...@@ -76,22 +78,32 @@ public class OperationLogic extends AbstractLogic { ...@@ -76,22 +78,32 @@ public class OperationLogic extends AbstractLogic {
private TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class); private TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class);
private TaskReportSendDao mTaskReportSendDao = AbstractDao.getDao(TaskReportSendDao.class); private TaskReportSendDao mTaskReportSendDao = AbstractDao.getDao(TaskReportSendDao.class);
private TaskReportItemsDao mTaskReportItemsDao = AbstractDao.getDao(TaskReportItemsDao.class); private TaskReportItemsDao mTaskReportItemsDao = AbstractDao.getDao(TaskReportItemsDao.class);
private OperationGroupMasterOperationDao mOperationGroupMasterOperationDao = AbstractDao.getDao(OperationGroupMasterOperationDao.class);
private ContentLogic mContentLogic = AbstractLogic.getLogic(ContentLogic.class); private ContentLogic mContentLogic = AbstractLogic.getLogic(ContentLogic.class);
private OperationGroupMasterLogic mOperationGroupMasterLogic = AbstractLogic.getLogic(OperationGroupMasterLogic.class);
private PushMessageDao mPushMessageDao = AbstractDao.getDao(PushMessageDao.class); private PushMessageDao mPushMessageDao = AbstractDao.getDao(PushMessageDao.class);
private TaskWorkerGroupDao mTaskWorkerGroupDao = AbstractDao.getDao(TaskWorkerGroupDao.class); private TaskWorkerGroupDao mTaskWorkerGroupDao = AbstractDao.getDao(TaskWorkerGroupDao.class);
/**
* 作業に関連する情報取得(API通信で取得して、DB保存処理)
* @throws AcmsException
* @throws NetworkDisconnectedException
*/
public void initializeOperations() throws AcmsException, NetworkDisconnectedException { public void initializeOperations() throws AcmsException, NetworkDisconnectedException {
// 作業グループリスト取得 // 作業グループリスト取得
setWorkingGroupList(); setWorkingGroupList();
// プロジェクト一覧取得し、登録・更新・削除する // 作業種別・作業種別に紐づいた作業IDを取得
mOperationGroupMasterLogic.setOperationGroupMaster();
// 作業一覧取得し、登録・更新・削除する
retrieveServerOperation(); retrieveServerOperation();
} }
/** /**
* プロジェクト一覧取得し、登録・更新・削除する * 作業一覧取得し、登録・更新・削除する
* *
* @throws AcmsException * @throws AcmsException
* @throws NetworkDisconnectedException * @throws NetworkDisconnectedException
...@@ -105,12 +117,11 @@ public class OperationLogic extends AbstractLogic { ...@@ -105,12 +117,11 @@ public class OperationLogic extends AbstractLogic {
for (OperationDto serverOperationDto : serverOperations) { for (OperationDto serverOperationDto : serverOperations) {
// 登録フラグ // 登録フラグ
boolean insertFlg = true; boolean insertFlg = true;
for (OperationDto localProjcetDto : localOperations) { for (OperationDto localOperationDto : localOperations) {
if (serverOperationDto.operationId.equals(localProjcetDto.operationId)) { if (serverOperationDto.operationId.equals(localOperationDto.operationId)) {
//update //update
serverOperationDto.needSyncFlg = serverOperationDto.equalsLastEdit(localProjcetDto) ? localProjcetDto.needSyncFlg : true; serverOperationDto.needSyncFlg = serverOperationDto.equalsLastEdit(localOperationDto) ? localOperationDto.needSyncFlg : true;
List<Long> localOperationContentIds = mOperationContentDao.getContentIds(serverOperationDto.operationId); List<Long> localOperationContentIds = mOperationContentDao.getContentIds(serverOperationDto.operationId);
boolean operationContentFlg = false;
for (OperationContentDto operationContentDto : serverOperationDto.operationContentDtoList) { for (OperationContentDto operationContentDto : serverOperationDto.operationContentDtoList) {
if (localOperationContentIds == null || localOperationContentIds.size() == 0) { if (localOperationContentIds == null || localOperationContentIds.size() == 0) {
// insert // insert
...@@ -129,7 +140,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -129,7 +140,7 @@ public class OperationLogic extends AbstractLogic {
if (localOperationContentIds != null) { if (localOperationContentIds != null) {
// 関連資料の削除処理 // 関連資料の削除処理
for (Long deleteContentId : localOperationContentIds) { for (Long deleteContentId : localOperationContentIds) {
mOperationContentDao.deleteOperationContent(localProjcetDto.operationId, deleteContentId); mOperationContentDao.deleteOperationContent(localOperationDto.operationId, deleteContentId);
} }
} }
...@@ -137,6 +148,31 @@ public class OperationLogic extends AbstractLogic { ...@@ -137,6 +148,31 @@ public class OperationLogic extends AbstractLogic {
serverOperationDto.contentCreatingFlg = false; serverOperationDto.contentCreatingFlg = false;
} }
// ローカルにある作業情報に紐づく全作業IDを取得
List<Integer> localOperationGroupMasterIds = mOperationGroupMasterOperationDao.getOperationGroupMasterIds(serverOperationDto.operationId);
for (OperationGroupMasterRelationDto operationGroupMasterRelationDto : serverOperationDto.operationGroupMasterRelationDtoList) {
if (localOperationGroupMasterIds == null || localOperationGroupMasterIds.size() == 0) {
// 作業IDが存在しなければ、登録する
mOperationGroupMasterOperationDao.insertOperationGroupMasterOperation(operationGroupMasterRelationDto);
} else {
// ローカル(DB)に作業IDが存在するかチェックして更新・登録を判定
int localOperationContentIndex = localOperationGroupMasterIds.indexOf(operationGroupMasterRelationDto.operationGroupMasterId);
if (localOperationContentIndex >= 0) {
// 作業IDが存在するので更新
localOperationGroupMasterIds.remove(localOperationContentIndex);
} else {
// 作業IDが存在しないので登録
mOperationGroupMasterOperationDao.insertOperationGroupMasterOperation(operationGroupMasterRelationDto);
}
}
}
if (localOperationGroupMasterIds != null) {
// ローカルとサーバーの差分は削除と見做し、削除処理を行う。
for (Integer deleteOperationGroupMasterId : localOperationGroupMasterIds) {
mOperationGroupMasterOperationDao.deleteOperationGroupMasterOperation(deleteOperationGroupMasterId, serverOperationDto.operationId);
}
}
mOperationDao.update(serverOperationDto); mOperationDao.update(serverOperationDto);
// 更新することで登録フラグをfalseにセット // 更新することで登録フラグをfalseにセット
insertFlg = false; insertFlg = false;
...@@ -164,6 +200,11 @@ public class OperationLogic extends AbstractLogic { ...@@ -164,6 +200,11 @@ public class OperationLogic extends AbstractLogic {
for (OperationContentDto operationContentDto : serverOperationDto.operationContentDtoList) { for (OperationContentDto operationContentDto : serverOperationDto.operationContentDtoList) {
mOperationContentDao.insertOperationContent(operationContentDto); mOperationContentDao.insertOperationContent(operationContentDto);
} }
// 作業種別・作業のリレーションテーブルにデータ登録
for (OperationGroupMasterRelationDto operationGroupMasterRelationDto : serverOperationDto.operationGroupMasterRelationDtoList) {
mOperationGroupMasterOperationDao.insertOperationGroupMasterOperation(operationGroupMasterRelationDto);
}
} }
// 作業担当グループ登録 // 作業担当グループ登録
...@@ -195,7 +236,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -195,7 +236,7 @@ public class OperationLogic extends AbstractLogic {
deleteListDtoArray.add(localProjcetDto); deleteListDtoArray.add(localProjcetDto);
} }
} }
// サーバーから取得したプロジェクト情報がローカルに存在しないので削除する // サーバーから取得した作業情報がローカルに存在しないので削除する
for (OperationDto deleteOperationDto : deleteListDtoArray) { for (OperationDto deleteOperationDto : deleteListDtoArray) {
List<TaskDto> taskDtoList = mTaskDao.selectAllTaskByOperationId(deleteOperationDto.operationId); List<TaskDto> taskDtoList = mTaskDao.selectAllTaskByOperationId(deleteOperationDto.operationId);
List<Long> contentIds = mOperationContentDao.getContentIds(deleteOperationDto.operationId); List<Long> contentIds = mOperationContentDao.getContentIds(deleteOperationDto.operationId);
...@@ -1337,11 +1378,12 @@ public class OperationLogic extends AbstractLogic { ...@@ -1337,11 +1378,12 @@ public class OperationLogic extends AbstractLogic {
/** /**
* シーンの登録 * シーンの登録
* @param file * @param file
* @param contentId
* @throws IOException * @throws IOException
* @throws AcmsException * @throws AcmsException
*/ */
public Integer sendScene(File file) throws IOException, AcmsException, NetworkDisconnectedException { public Integer sendScene(File file, Long contentId) throws IOException, AcmsException, NetworkDisconnectedException {
SceneEntryJSON json = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).sceneEntry(cache.getMemberInfo().sid, file); SceneEntryJSON json = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).sceneEntry(cache.getMemberInfo().sid, contentId, file);
return json.resourceId; return json.resourceId;
} }
......
...@@ -11,7 +11,7 @@ android { ...@@ -11,7 +11,7 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 15 minSdkVersion 15
targetSdkVersion 26 targetSdkVersion 28
//abvEnvironments //abvEnvironments
resValue("string", "acms_address", "${acms_address}") resValue("string", "acms_address", "${acms_address}")
resValue("string", "download_server_address", "${download_server_address}") resValue("string", "download_server_address", "${download_server_address}")
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:state_pressed="true"
android:drawable="@drawable/ic_show_list_off"/>
<item
android:drawable="@drawable/ic_show_list_on"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_checked="true"
android:state_pressed="true"
android:drawable="@drawable/operation_location_segment_on" />
<item
android:state_checked="true"
android:drawable="@drawable/operation_location_segment_on" />
<item
android:state_checked="false"
android:state_pressed="true"
android:drawable="@drawable/operation_location_segment_off" />
<item
android:state_checked="false"
android:drawable="@drawable/operation_location_segment_off" />
</selector>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<stroke android:width="1dp" android:color="@android:color/white" />
<solid android:color="@color/operation_color"/>
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<stroke android:width="1dp" android:color="@android:color/white" />
<solid android:color="@android:color/white"/>
</shape>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/operation_color" android:state_checked="true" />
<item android:color="@android:color/white" android:state_checked="false"/>
</selector>
\ No newline at end of file
...@@ -117,6 +117,7 @@ ...@@ -117,6 +117,7 @@
<string name="password_condition">半角英数字,記号(-_)のみ\n6文字以上16文字以下\n英数字両方を利用する\n同じ文字を3文字以上連続して使用しない\n前回パスワードに使った文字は4文字以上使用しない。</string> <string name="password_condition">半角英数字,記号(-_)のみ\n6文字以上16文字以下\n英数字両方を利用する\n同じ文字を3文字以上連続して使用しない\n前回パスワードに使った文字は4文字以上使用しない。</string>
<string name="no_content_need_refresh">該当資料は存在しないか、閲覧権限の無い資料です。</string> <string name="no_content_need_refresh">該当資料は存在しないか、閲覧権限の無い資料です。</string>
<string name="content_num">No.</string> <string name="content_num">No.</string>
<string name="no_child">これより下はありません。</string>
<string name="no_content_history">閲覧履歴がありません。</string> <string name="no_content_history">閲覧履歴がありません。</string>
<string name="contractor">事業者</string> <string name="contractor">事業者</string>
<string name="showPassword">パスワードを表示する</string> <string name="showPassword">パスワードを表示する</string>
...@@ -517,6 +518,11 @@ ...@@ -517,6 +518,11 @@
<string name="msg_help_list_report_add">新たに報告を追加することができます。</string> <string name="msg_help_list_report_add">新たに報告を追加することができます。</string>
<string name="msg_help_360_move">このボタンを押すと作業コードラベルを移動させることができるようになります。</string> <string name="msg_help_360_move">このボタンを押すと作業コードラベルを移動させることができるようになります。</string>
<string name="msg_help_360_touch">このボタンを押すと作業コードボタンのタップが可能になり、報告できるようになります。</string> <string name="msg_help_360_touch">このボタンを押すと作業コードボタンのタップが可能になり、報告できるようになります。</string>
<!-- 1.1.0 -->
<string name="operation_category">カテゴリ</string>
<string name="type_all">全て</string>
<!-- 1.0.1 Resource Pattern 1 --> <!-- 1.0.1 Resource Pattern 1 -->
<!-- 1.9.0.0--> <!-- 1.9.0.0-->
<string name="meetingroom_setting_1">会議室設定(1)</string> <string name="meetingroom_setting_1">会議室設定(1)</string>
......
...@@ -118,6 +118,7 @@ ...@@ -118,6 +118,7 @@
<string name="password_condition">영문, 숫자,기호(-_)만 입력\n6문자이상16문자이하\n영문,숫자 혼합 사용\n동일 문자 3문자 연속 사용금지\n이전 패스워드랑 연속 4문자 이상 같은 문자 사용 금지</string> <string name="password_condition">영문, 숫자,기호(-_)만 입력\n6문자이상16문자이하\n영문,숫자 혼합 사용\n동일 문자 3문자 연속 사용금지\n이전 패스워드랑 연속 4문자 이상 같은 문자 사용 금지</string>
<string name="no_content_need_refresh">해당 자료는 존재하지 않거나 열람권한이 없는 자료입니다.</string> <string name="no_content_need_refresh">해당 자료는 존재하지 않거나 열람권한이 없는 자료입니다.</string>
<string name="content_num">No.</string> <string name="content_num">No.</string>
<string name="no_child">이 아래로는 데이터가 없습니다.</string>
<string name="no_content_history">열람 이력이 없습니다.</string> <string name="no_content_history">열람 이력이 없습니다.</string>
<string name="contractor">사업자</string> <string name="contractor">사업자</string>
<string name="showPassword">패스워드를 표시</string> <string name="showPassword">패스워드를 표시</string>
...@@ -520,6 +521,10 @@ ...@@ -520,6 +521,10 @@
<string name="msg_help_360_move">이 버튼을 누르면 작업 코드 버튼의 이동이 가능하게 됩니다.</string> <string name="msg_help_360_move">이 버튼을 누르면 작업 코드 버튼의 이동이 가능하게 됩니다.</string>
<string name="msg_help_360_touch">이 버튼을 누르면 작업 코드 버튼의 탭이 가능하게 되므로 보고 화면 표시가 가능하게 됩니다.</string> <string name="msg_help_360_touch">이 버튼을 누르면 작업 코드 버튼의 탭이 가능하게 되므로 보고 화면 표시가 가능하게 됩니다.</string>
<!-- 1.1.0 -->
<string name="operation_category">カテゴリ</string>
<string name="type_all">全て</string>
<!-- 1.0.1 Resource Pattern 1 --> <!-- 1.0.1 Resource Pattern 1 -->
<!-- 1.9.0.0--> <!-- 1.9.0.0-->
<string name="meetingroom_setting_1">회의실 설정(1)</string> <string name="meetingroom_setting_1">회의실 설정(1)</string>
...@@ -634,6 +639,7 @@ ...@@ -634,6 +639,7 @@
<string name="msg_help_report_task_director_main_1">지시자가 등록한 내용을 표시합니다.</string> <string name="msg_help_report_task_director_main_1">지시자가 등록한 내용을 표시합니다.</string>
<string name="msg_help_report_task_director_input_1">작업보고화면을 표시합니다.</string> <string name="msg_help_report_task_director_input_1">작업보고화면을 표시합니다.</string>
<!-- 1.0.1 Resource Pattern 1 -->
<string name="title_permission_dialog_1">애플리케이션권한(1)</string> <string name="title_permission_dialog_1">애플리케이션권한(1)</string>
<string name="msg_permission_dialog_storage_update_1">앱을 버젼업하기 위해서는 외부스트레지 이용권한이 필요합니다. \n앱설정화면으로 이동합니다.(1)</string> <string name="msg_permission_dialog_storage_update_1">앱을 버젼업하기 위해서는 외부스트레지 이용권한이 필요합니다. \n앱설정화면으로 이동합니다.(1)</string>
<string name="msg_permission_dialog_location_1">위치정보이용권한이 필요합니다.\n앱설정화면으로 이동합니다.(1)</string> <string name="msg_permission_dialog_location_1">위치정보이용권한이 필요합니다.\n앱설정화면으로 이동합니다.(1)</string>
......
...@@ -117,6 +117,7 @@ ...@@ -117,6 +117,7 @@
<string name="password_condition">Alphanumeric,-,_ only available\nfrom 6chars to 16chars\nUse both Alphabet and Number\nCannot use same 3 letters continuously\nCannot use more than 4 letters in previous password.</string> <string name="password_condition">Alphanumeric,-,_ only available\nfrom 6chars to 16chars\nUse both Alphabet and Number\nCannot use same 3 letters continuously\nCannot use more than 4 letters in previous password.</string>
<string name="no_content_need_refresh">Content not found or No authority.</string> <string name="no_content_need_refresh">Content not found or No authority.</string>
<string name="content_num">No.</string> <string name="content_num">No.</string>
<string name="no_child">No more data below.</string>
<string name="no_content_history">No reading history.</string> <string name="no_content_history">No reading history.</string>
<string name="contractor">Company</string> <string name="contractor">Company</string>
<string name="showPassword">show password</string> <string name="showPassword">show password</string>
...@@ -523,6 +524,11 @@ ...@@ -523,6 +524,11 @@
<string name="msg_help_list_report_add">You can add new reports.</string> <string name="msg_help_list_report_add">You can add new reports.</string>
<string name="msg_help_360_move">Press this button to move the work code label.</string> <string name="msg_help_360_move">Press this button to move the work code label.</string>
<string name="msg_help_360_touch">If you press this button, you will be able to touch the work code button, so you can report the work.</string> <string name="msg_help_360_touch">If you press this button, you will be able to touch the work code button, so you can report the work.</string>
<!-- 1.1.0 -->
<string name="operation_category">カテゴリ</string>
<string name="type_all">全て</string>
<!-- 1.0.1 Resource Pattern 1 --> <!-- 1.0.1 Resource Pattern 1 -->
<!-- 1.9.0.0--> <!-- 1.9.0.0-->
<string name="meetingroom_setting_1">Meeting room setting(1)</string> <string name="meetingroom_setting_1">Meeting room setting(1)</string>
......
...@@ -29,7 +29,7 @@ android { ...@@ -29,7 +29,7 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 15 minSdkVersion 15
targetSdkVersion 26 targetSdkVersion 28
multiDexEnabled true multiDexEnabled true
} }
sourceSets { sourceSets {
......
...@@ -24,31 +24,65 @@ ...@@ -24,31 +24,65 @@
<ImageButton <ImageButton
android:id="@+id/icon_filter" android:id="@+id/icon_filter"
style="@style/ToolBarIcon" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="10dp" android:layout_marginLeft="15dp"
android:layout_toRightOf="@+id/btn_view_mode" android:layout_toRightOf="@+id/btn_view_mode"
android:onClick="onClickOperationFilterList" android:onClick="onClickOperationFilterList"
android:src="@drawable/ic_filter" /> android:background="@drawable/ic_filter" />
<TextView <ImageButton
android:id="@+id/title" android:id="@+id/btn_search"
style="@style/DialogToolBarTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:text="@string/operation_list" android:layout_marginLeft="15dp"
android:textColor="@color/text_dialog" android:layout_toRightOf="@+id/icon_filter"
android:textSize="15dp" android:background="@drawable/ic_operation_search" />
<RadioGroup
android:id="@+id/segment_group"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:layout_toRightOf="@+id/btn_search"
android:orientation="horizontal"
android:visibility="visible">
<RadioButton
android:id="@+id/operation_location_type_all"
android:layout_width="80dp"
android:layout_height="match_parent"
android:background="@drawable/operation_location_segment_background"
android:button="@null"
android:checked="true"
android:gravity="center"
android:onClick="onClickOperationLocationType"
android:textColor="@drawable/operation_location_text_color"
android:text="@string/type_all"
android:textStyle="bold" /> android:textStyle="bold" />
<RadioButton
android:id="@+id/operation_location_type_group"
android:layout_width="80dp"
android:layout_height="match_parent"
android:background="@drawable/operation_location_segment_background"
android:button="@null"
android:gravity="center"
android:onClick="onClickOperationLocationType"
android:textColor="@drawable/operation_location_text_color"
android:text="@string/operation_category"
android:textStyle="bold" />
</RadioGroup>
<LinearLayout <LinearLayout
android:id="@+id/search_result" android:id="@+id/search_result"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="10dp" android:layout_marginRight="15dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_toLeftOf="@+id/btn_communication_menu" android:layout_toLeftOf="@+id/btn_communication_menu"
android:background="@drawable/radius_frame" android:background="@drawable/radius_frame"
...@@ -74,26 +108,16 @@ ...@@ -74,26 +108,16 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="10dp" android:layout_marginRight="15dp"
android:layout_toLeftOf="@+id/btn_search"
android:background="@drawable/ic_communication_menu" />
<ImageButton
android:id="@+id/btn_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:layout_toLeftOf="@+id/btn_sub_menu" android:layout_toLeftOf="@+id/btn_sub_menu"
android:background="@drawable/ic_operation_search" android:background="@drawable/ic_communication_menu" />
android:contentDescription="@string/list" />
<ImageButton <ImageButton
android:id="@+id/btn_sub_menu" android:id="@+id/btn_sub_menu"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="10dp" android:layout_marginRight="15dp"
android:layout_toLeftOf="@+id/btn_common_content" android:layout_toLeftOf="@+id/btn_common_content"
android:background="@drawable/ic_operation_setting" android:background="@drawable/ic_operation_setting"
android:onClick="onClickOperationSubMenu" /> android:onClick="onClickOperationSubMenu" />
...@@ -103,7 +127,7 @@ ...@@ -103,7 +127,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="10dp" android:layout_marginRight="15dp"
android:layout_toLeftOf="@+id/btn_help" android:layout_toLeftOf="@+id/btn_help"
android:background="@drawable/ic_common_content_off" /> android:background="@drawable/ic_common_content_off" />
...@@ -122,6 +146,9 @@ ...@@ -122,6 +146,9 @@
android:id="@+id/operation_list_layout" android:id="@+id/operation_list_layout"
style="@style/operation_list_bg" style="@style/operation_list_bg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -31,25 +31,41 @@ ...@@ -31,25 +31,41 @@
android:onClick="onClickOperationFilterList" android:onClick="onClickOperationFilterList"
android:src="@drawable/ic_filter" /> android:src="@drawable/ic_filter" />
<LinearLayout <RadioGroup
android:id="@+id/segment_group"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="30dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true">
<TextView
android:id="@+id/title"
style="@style/DialogToolBarTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/operation_list"
android:layout_marginRight="25dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:textColor="@color/text_dialog" android:layout_marginLeft="15dp"
android:visibility="visible" android:layout_toRightOf="@+id/icon_filter"
android:orientation="horizontal"
android:visibility="visible">
<RadioButton
android:id="@+id/operation_location_type_all"
android:layout_width="80dp"
android:layout_height="match_parent"
android:background="@drawable/operation_location_segment_background"
android:button="@null"
android:checked="true"
android:gravity="center"
android:onClick="onClickOperationLocationType"
android:textColor="@drawable/operation_location_text_color"
android:text="@string/type_all"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout> <RadioButton
android:id="@+id/operation_location_type_group"
android:layout_width="80dp"
android:layout_height="match_parent"
android:background="@drawable/operation_location_segment_background"
android:button="@null"
android:gravity="center"
android:onClick="onClickOperationLocationType"
android:textColor="@drawable/operation_location_text_color"
android:text="@string/operation_category"
android:textStyle="bold" />
</RadioGroup>
<ImageButton <ImageButton
android:id="@+id/btn_common_content" android:id="@+id/btn_common_content"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:gravity="center_vertical"
android:orientation="horizontal" >
<Button
android:id="@+id/btn_show_list_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_show_list" />
<HorizontalScrollView
android:id="@+id/bread_crumbs_scroll_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" >
<LinearLayout
android:id="@+id/bread_crumbs_layout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal" >
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:paddingLeft="10dp"
android:paddingBottom="8dp"
android:src="@drawable/icon_folder_empty_on" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/itemText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/imageView1"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:layout_gravity="center"
android:text="@string/dummy_str"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/text_select" />
<TextView
android:id="@+id/itemCountText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_toLeftOf="@+id/nextLevel"
android:layout_gravity="center"
android:textSize="20sp" />
<ImageView
android:id="@+id/nextLevel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:src="@drawable/ic_navigation_next_item"
android:layout_gravity="center"
android:visibility="invisible" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
...@@ -10,6 +10,15 @@ ...@@ -10,6 +10,15 @@
android:id="@+id/toolbar" android:id="@+id/toolbar"
style="@style/DialogToolBarHolo"> style="@style/DialogToolBarHolo">
<Button
android:id="@+id/popup_left_title"
style="@style/ButtonABookLight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:visibility="gone" />
<TextView <TextView
android:id="@+id/popup_title" android:id="@+id/popup_title"
style="@style/DialogToolBarTitle" style="@style/DialogToolBarTitle"
...@@ -48,24 +57,24 @@ ...@@ -48,24 +57,24 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/left_item" android:id="@+id/header_item"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/btn_layout" android:background="@drawable/btn_layout"
android:orientation="vertical" android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingBottom="8dp" android:paddingBottom="8dp"
android:visibility="gone" ><!-- ツールバー背景イメージの影の高さがあるため、8dpほどpaddingを入れる --> android:paddingLeft="10dp"
android:visibility="gone"><!-- ツールバー背景イメージの影の高さがあるため、8dpほどpaddingを入れる -->
<TextView <TextView
android:id="@+id/header_title" android:id="@+id/header_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableLeft="@drawable/blue_arrow_up" android:drawableLeft="@drawable/blue_arrow_up"
android:gravity="center_vertical" android:gravity="center_vertical"
android:maxLines="1"
android:text="@string/dummy_str" android:text="@string/dummy_str"
android:textColor="@color/text_select" android:textColor="@color/text_select"
android:textSize="@dimen/app_normal_text_size" android:textSize="@dimen/app_normal_text_size" />
android:maxLines="1" />
</LinearLayout> </LinearLayout>
<View <View
......
...@@ -4,15 +4,18 @@ import java.util.ArrayList; ...@@ -4,15 +4,18 @@ import java.util.ArrayList;
import jp.agentec.abook.abv.bl.common.Constant.ReportType; import jp.agentec.abook.abv.bl.common.Constant.ReportType;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.DefPrefKey; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.DefPrefKey;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.OperationLocationType;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
import android.content.Context; import android.content.Context;
import java.util.List; import java.util.List;
import java.util.Stack;
public class ABVUIDataCache { public class ABVUIDataCache {
private static final String TAG = "ABVUIDataCache"; private static final String TAG = "ABVUIDataCache";
...@@ -22,6 +25,9 @@ public class ABVUIDataCache { ...@@ -22,6 +25,9 @@ public class ABVUIDataCache {
// ホーム画面項目 // ホーム画面項目
private int viewMode; // パンネル、リスト形式 private int viewMode; // パンネル、リスト形式
// 作業種別絞り込み用のスタック
public Stack<OperationGroupMasterDto> operationGroupMasterStack;
private ArrayList<Integer> mReportTypes; private ArrayList<Integer> mReportTypes;
public long lastUpdateTime = -1; public long lastUpdateTime = -1;
...@@ -50,8 +56,10 @@ public class ABVUIDataCache { ...@@ -50,8 +56,10 @@ public class ABVUIDataCache {
init(); init();
} }
// 初期状態
private void init() { private void init() {
viewMode = loadViewMode(); viewMode = loadViewMode();
operationGroupMasterStack = new Stack<>();
} }
public long saveLastUpdateTime() { public long saveLastUpdateTime() {
...@@ -89,6 +97,48 @@ public class ABVUIDataCache { ...@@ -89,6 +97,48 @@ public class ABVUIDataCache {
} }
/** /**
* xmlにファイル書き込みされた
* 通常・作業種別のモード切り替えの値を取得
* @return
*/
public int getOperationGroupMasterMode() {
return PreferenceUtil.getUserPref(context, UserPrefKey.OPERATION_GROUP_MASERT_MODE, 0);
}
/**
* 通常・作業種別のモード切り替えの値をxmlにファイル書き込みする
* @param operationGroupMasterMode
*/
public void setOperationGroupMasterMode(int operationGroupMasterMode) {
PreferenceUtil.putUserPref(context, UserPrefKey.OPERATION_GROUP_MASERT_MODE, operationGroupMasterMode);
}
/**
* xmlに書き込みされた作業種別IDを取得
* @return
*/
public int getOperationGroupMasterId() {
return PreferenceUtil.getUserPref(context, UserPrefKey.OPERATION_GROUP_MASERT_ID, 0);
}
/**
* xmlに作業種別IDをファイル書き込みする
* @param operationGroupMasterId
*/
public void setOperationGroupMasterId(int operationGroupMasterId) {
PreferenceUtil.putUserPref(context, UserPrefKey.OPERATION_GROUP_MASERT_ID, operationGroupMasterId);
}
/**
* 保持していた作業種別のデータをクリアする
*/
public void clearOperationGroupMaster() {
setOperationGroupMasterMode(OperationLocationType.ALL);
setOperationGroupMasterId(0);
operationGroupMasterStack.clear();
}
/**
* コンテンツビューからコンテンツビューへ * コンテンツビューからコンテンツビューへ
* 戻る時のコンテンツIDとページのセット * 戻る時のコンテンツIDとページのセット
* @param contentId * @param contentId
......
...@@ -664,24 +664,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -664,24 +664,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) { if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(ABVContentViewActivity.this, PatternStringUtil.patternToInt(getApplicationContext(), showConfirmSavePanoEdit();
R.string.pano_edit,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
// リソースパターンの適用
alertDialog.setMessage(PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_confirm_save_pano_edit,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
alertDialog.setNegativeButton(R.string.cancel, null);
alertDialog.setPositiveButton(R.string.ok,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
callUnloadAuth();
dialog.dismiss();
finish();
}
});
alertDialog.show();
} else { } else {
// 作業終了する時、作業ID設定して作業一覧で使用するメソットを行う。 // 作業終了する時、作業ID設定して作業一覧で使用するメソットを行う。
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId); putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
...@@ -754,6 +737,30 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -754,6 +737,30 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}); });
} }
/**
* 編集を終了しますかのダイアログメッセージ表示
*/
public void showConfirmSavePanoEdit() {
ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(ABVContentViewActivity.this, PatternStringUtil.patternToInt(getApplicationContext(),
R.string.pano_edit,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
// リソースパターンの適用
alertDialog.setMessage(PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_confirm_save_pano_edit,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
alertDialog.setNegativeButton(R.string.cancel, null);
alertDialog.setPositiveButton(R.string.ok,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
callUnloadAuth();
dialog.dismiss();
finish();
}
});
alertDialog.show();
}
//以下のメッソドは子ActivityにOverideで使用 //以下のメッソドは子ActivityにOverideで使用
protected void finishActivity() {} protected void finishActivity() {}
protected void webViewLoadUrl(String url){} protected void webViewLoadUrl(String url){}
......
...@@ -12,6 +12,12 @@ public interface AppDefType { ...@@ -12,6 +12,12 @@ public interface AppDefType {
int LIST = 1; int LIST = 1;
} }
// 作業種別モードフラグ
interface OperationLocationType {
int ALL = 0;
int GROUP = 1;
}
interface DefPrefKey { interface DefPrefKey {
String REPEATABLE_PLAY = "repeatablePlay"; String REPEATABLE_PLAY = "repeatablePlay";
String WIFI_ALERT_ENABLE = "wifiAlertEnable"; String WIFI_ALERT_ENABLE = "wifiAlertEnable";
...@@ -56,8 +62,11 @@ public interface AppDefType { ...@@ -56,8 +62,11 @@ public interface AppDefType {
String OPERATION_REPORT_TYPES = "operationReportTypes"; String OPERATION_REPORT_TYPES = "operationReportTypes";
String RESOURCE_PATTERN_TYPE = "resourcePatternType"; // 文言リソースパターン String RESOURCE_PATTERN_TYPE = "resourcePatternType"; // 文言リソースパターン
String APERTURE_MASTER_DATA_FETCH_DATE = "apertureMasterDataFetchDate"; // 絞り検索マスタデータのFetchDate
String OPERATION_GROUP_MASERT_MODE = "operation_group_master"; // 通常・作業種別モード(画面)
String OPERATION_GROUP_MASERT_ID = "operation_group_master_id"; // 作業種別のID
String APERTURE_MASTER_DATA_FETCH_DATE = "apertureMasterDataFetchDate"; // 絞り検索マスタデータのFetchDate
} }
/** /**
......
...@@ -103,7 +103,7 @@ public class ABVListDialog extends Dialog { ...@@ -103,7 +103,7 @@ public class ABVListDialog extends Dialog {
getListView().setOnItemLongClickListener(listener); getListView().setOnItemLongClickListener(listener);
} }
public void setLeftItemOnClickListener(String itemName, View.OnClickListener l) { public void setHeaderItemOnClickListener(String itemName, View.OnClickListener l) {
// Button itemButton = (Button) mRoot.findViewById(R.id.popup_title_left); // Button itemButton = (Button) mRoot.findViewById(R.id.popup_title_left);
// if (itemButton != null) { // if (itemButton != null) {
// itemButton.setVisibility(View.VISIBLE); // itemButton.setVisibility(View.VISIBLE);
...@@ -111,7 +111,7 @@ public class ABVListDialog extends Dialog { ...@@ -111,7 +111,7 @@ public class ABVListDialog extends Dialog {
// itemButton.setOnClickListener(l); // itemButton.setOnClickListener(l);
// } else { // } else {
// 携帯の場合 // 携帯の場合
LinearLayout linearLayout = (LinearLayout) mRoot.findViewById(R.id.left_item); LinearLayout linearLayout = (LinearLayout) mRoot.findViewById(R.id.header_item);
linearLayout.setOnClickListener(l); linearLayout.setOnClickListener(l);
linearLayout.setVisibility(View.VISIBLE); linearLayout.setVisibility(View.VISIBLE);
TextView textView = (TextView) mRoot.findViewById(R.id.header_title); TextView textView = (TextView) mRoot.findViewById(R.id.header_title);
...@@ -119,6 +119,21 @@ public class ABVListDialog extends Dialog { ...@@ -119,6 +119,21 @@ public class ABVListDialog extends Dialog {
textView.setText(String.format(suffixText, itemName)); textView.setText(String.format(suffixText, itemName));
// } // }
} }
/**
* 左側の要素イベント
* @param itemName
* @param l
*/
public void setLeftItemOnClickListener(String itemName, View.OnClickListener l) {
Button itemButton = (Button) mRoot.findViewById(R.id.popup_left_title);
if (itemButton != null) {
itemButton.setText(itemName);
itemButton.setVisibility(View.VISIBLE);
itemButton.setOnClickListener(l);
}
}
public void setRightItemOnClickListener(int resId, View.OnClickListener l) { public void setRightItemOnClickListener(int resId, View.OnClickListener l) {
ImageButton itemButton = (ImageButton) mRoot.findViewById(R.id.popup_right_image); ImageButton itemButton = (ImageButton) mRoot.findViewById(R.id.popup_right_image);
if (itemButton != null) { if (itemButton != null) {
......
...@@ -34,7 +34,6 @@ import android.widget.TextView; ...@@ -34,7 +34,6 @@ import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.handmark.pulltorefresh.library.PullToRefreshBase; import com.handmark.pulltorefresh.library.PullToRefreshBase;
import com.handmark.pulltorefresh.library.PullToRefreshGridView;
import net.lingala.zip4j.exception.ZipException; import net.lingala.zip4j.exception.ZipException;
...@@ -50,7 +49,9 @@ import java.util.ArrayList; ...@@ -50,7 +49,9 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient; import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.ApertureMasterDataJSON; import jp.agentec.abook.abv.bl.acms.client.json.ApertureMasterDataJSON;
...@@ -83,17 +84,21 @@ import jp.agentec.abook.abv.bl.dto.ContentDto; ...@@ -83,17 +84,21 @@ import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.FixPushMessageDto; import jp.agentec.abook.abv.bl.dto.FixPushMessageDto;
import jp.agentec.abook.abv.bl.dto.OperationContentDto; import jp.agentec.abook.abv.bl.dto.OperationContentDto;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto; import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.dto.TaskDto; import jp.agentec.abook.abv.bl.dto.TaskDto;
import jp.agentec.abook.abv.bl.dto.TaskReportDto; import jp.agentec.abook.abv.bl.dto.TaskReportDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationGroupMasterLogic;
import jp.agentec.abook.abv.bl.logic.ApertureMasterDataLogic; import jp.agentec.abook.abv.bl.logic.ApertureMasterDataLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic; import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic; import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity; import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.OperationLocationType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.ViewMode;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode; import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage; import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog; import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
...@@ -102,12 +107,16 @@ import jp.agentec.abook.abv.ui.common.util.ABVToastUtil; ...@@ -102,12 +107,16 @@ import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil; import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.util.KeyboardUtils; import jp.agentec.abook.abv.ui.common.util.KeyboardUtils;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil; import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.common.view.ABVListDialog;
import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow; import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow;
import jp.agentec.abook.abv.ui.home.adapter.FixPushMessageAdapter; import jp.agentec.abook.abv.ui.home.adapter.FixPushMessageAdapter;
import jp.agentec.abook.abv.ui.home.adapter.HierarchyOperationGroupListAdapter;
import jp.agentec.abook.abv.ui.home.adapter.OperationSelectAdapter; import jp.agentec.abook.abv.ui.home.adapter.OperationSelectAdapter;
import jp.agentec.abook.abv.ui.home.adapter.PushMessageListAdapter; import jp.agentec.abook.abv.ui.home.adapter.PushMessageListAdapter;
import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper; import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.home.helper.HomeOperationListHelper;
import jp.agentec.abook.abv.ui.home.helper.OperationGroupMasterListHelper;
import jp.agentec.abook.abv.ui.home.helper.OperationListHelper; import jp.agentec.abook.abv.ui.home.helper.OperationListHelper;
import jp.agentec.abook.abv.ui.viewer.activity.HTMLXWalkWebViewActivity; import jp.agentec.abook.abv.ui.viewer.activity.HTMLXWalkWebViewActivity;
import jp.agentec.adf.util.DateTimeFormat; import jp.agentec.adf.util.DateTimeFormat;
...@@ -126,11 +135,10 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -126,11 +135,10 @@ public class OperationListActivity extends ABVUIActivity {
private ImageButton mViewModeButton; private ImageButton mViewModeButton;
private ImageButton mSearchButton; private ImageButton mSearchButton;
private ImageButton mFilterButton;
private ImageButton mCommunicationButton; private ImageButton mCommunicationButton;
private ImageButton mCommonContentButton; private ImageButton mCommonContentButton;
private List<OperationDto> mOperationList;
public String mSearchWord; public String mSearchWord;
public String mStartDateStr; public String mStartDateStr;
public String mEndDateStr; public String mEndDateStr;
...@@ -139,7 +147,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -139,7 +147,6 @@ public class OperationListActivity extends ABVUIActivity {
private TextView mStartDate; private TextView mStartDate;
private TextView mEndDate; private TextView mEndDate;
private LinearLayout mSearchResultLayout; private LinearLayout mSearchResultLayout;
private TextView mTitleView;
private LinearLayout mReportTypeLayoutLabel; private LinearLayout mReportTypeLayoutLabel;
private LinearLayout mReportTypeLayoutButton; private LinearLayout mReportTypeLayoutButton;
...@@ -157,6 +164,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -157,6 +164,7 @@ public class OperationListActivity extends ABVUIActivity {
private TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class); private TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class);
private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class); private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class);
private OperationGroupMasterLogic mOperationGroupMasterLogic = AbstractLogic.getLogic(OperationGroupMasterLogic.class);
private TaskDao mTaskDao = AbstractDao.getDao(TaskDao.class); private TaskDao mTaskDao = AbstractDao.getDao(TaskDao.class);
private PushMessageLogic mPushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class); private PushMessageLogic mPushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class);
...@@ -185,6 +193,15 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -185,6 +193,15 @@ public class OperationListActivity extends ABVUIActivity {
private ArrayList<Integer> mAllOperationReportTypes; private ArrayList<Integer> mAllOperationReportTypes;
private ABVListDialog mShowDialog;
private Map<Integer, Integer> operationCountMap;
// 全て・作業種別のセグメントボタン
private RadioGroup mLocationTypeRadioGroup;
// 作業種別のサービスオプション値を保持用フラグ
private boolean mOperationGroupMasterServiceOperationFlg;
// 絞り検索マスタデータ // 絞り検索マスタデータ
// private Date mApertureLastEditDate; // private Date mApertureLastEditDate;
// 絞り検索マスタLogic // 絞り検索マスタLogic
...@@ -203,11 +220,12 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -203,11 +220,12 @@ public class OperationListActivity extends ABVUIActivity {
vg.removeAllViews(); vg.removeAllViews();
vg.addView(child); vg.addView(child);
// ツールバーのビューモードイメージ変更 // ツールバーのビューモードイメージ変更
if (child instanceof PullToRefreshGridView) { if (getABVUIDataCache().getViewMode() == AppDefType.ViewMode.PANEL) {
mViewModeButton.setBackground(getRDrawable(R.drawable.ic_display_list)); mViewModeButton.setBackground(getRDrawable(R.drawable.ic_display_list));
} else { } else {
mViewModeButton.setBackground(getRDrawable(R.drawable.ic_display_pannel)); mViewModeButton.setBackground(getRDrawable(R.drawable.ic_display_pannel));
} }
closeProgressPopup();
} }
} }
...@@ -215,32 +233,38 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -215,32 +233,38 @@ public class OperationListActivity extends ABVUIActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.ac_operation_list); setContentView(R.layout.ac_operation_list);
mListHelper = new OperationListHelper(this);; mListHelper = getListHelper();
// ビュー変更ボタン
mViewModeButton = (ImageButton) findViewById(R.id.btn_view_mode); mViewModeButton = (ImageButton) findViewById(R.id.btn_view_mode);
// 検索ボタン
mSearchButton = (ImageButton) findViewById(R.id.btn_search); mSearchButton = (ImageButton) findViewById(R.id.btn_search);
// フィルターボタン
mFilterButton = (ImageButton) findViewById(R.id.icon_filter);
mSearchResultLayout = (LinearLayout) findViewById(R.id.search_result); mSearchResultLayout = (LinearLayout) findViewById(R.id.search_result);
mTitleView = (TextView) findViewById(R.id.title);
mCommunicationButton = (ImageButton) findViewById(R.id.btn_communication_menu); mCommunicationButton = (ImageButton) findViewById(R.id.btn_communication_menu);
mCommonContentButton = (ImageButton) findViewById(R.id.btn_common_content); mCommonContentButton = (ImageButton) findViewById(R.id.btn_common_content);
mLocationTypeRadioGroup = (RadioGroup) findViewById(R.id.segment_group);
// 作業一覧のタイトルパータンでセット // ビュー変更ボタンのタッチイベント
mTitleView.setText(PatternStringUtil.patternToString(getApplicationContext(),
R.string.operation_list,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
mViewModeButton.setOnClickListener(new View.OnClickListener() { mViewModeButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (getABVUIDataCache().getViewMode() == AppDefType.ViewMode.PANEL) { if (getABVUIDataCache().getViewMode() == ViewMode.PANEL) {
getABVUIDataCache().setViewMode(AppDefType.ViewMode.LIST); getABVUIDataCache().setViewMode(ViewMode.LIST);
} else { } else {
getABVUIDataCache().setViewMode(AppDefType.ViewMode.PANEL); getABVUIDataCache().setViewMode(ViewMode.PANEL);
} }
setOperationListView(); setOperationListView();
} }
}); });
// サービスオプション(作業種別使用)をセット
mOperationGroupMasterServiceOperationFlg = ABVDataCache.getInstance().serviceOption.isOperationGroupMaster();
// 全て・作業種別のセグメントチェック設定
checkOperationGroupType(getABVUIDataCache().getOperationGroupMasterMode());
// 検索アイコンのクリックイベント // 検索アイコンのクリックイベント
mSearchButton.setOnClickListener(new View.OnClickListener() { mSearchButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
...@@ -259,6 +283,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -259,6 +283,7 @@ public class OperationListActivity extends ABVUIActivity {
mSelectedFixPuchMessagePosition = 0; mSelectedFixPuchMessagePosition = 0;
mSendType = 0; mSendType = 0;
// コミュニケーションボタン
mCommunicationButton.setOnClickListener(new View.OnClickListener() { mCommunicationButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
...@@ -266,6 +291,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -266,6 +291,7 @@ public class OperationListActivity extends ABVUIActivity {
} }
}); });
// 共通関連資料ボタン
mCommonContentButton.setOnClickListener(new View.OnClickListener() { mCommonContentButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
...@@ -366,20 +392,70 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -366,20 +392,70 @@ public class OperationListActivity extends ABVUIActivity {
} }
// フィルター選択判定 // フィルター選択判定
checkSelectedFilterType(); checkSelectedFilterType();
// 作業種別表示・非表示
if (mOperationGroupMasterServiceOperationFlg) {
mLocationTypeRadioGroup.setVisibility(View.VISIBLE);
// アイコンの変更
if (getABVUIDataCache().getOperationGroupMasterMode() == OperationLocationType.GROUP) {
// 検索ワード削除
clearSearch();
// フィルタのリセット
getABVUIDataCache().setOperationReportTypes(mAllOperationReportTypes);
// フィルターボタンを無効にする
mFilterButton.setImageDrawable(getRDrawable(R.drawable.ic_filter));
setEnabledImageButton(mFilterButton);
// 検索ボタンを無効にする
mSearchButton.setImageDrawable(getRDrawable(R.drawable.ic_operation_search));
setEnabledImageButton(mSearchButton);
} else {
cancelToolbarEnabledIcon();
}
} else {
// アイコン非表示
mLocationTypeRadioGroup.setVisibility(View.GONE);
cancelToolbarEnabledIcon();
}
// ツールバーの検索結果レイアウトの表示・非表示
checkShowSearchResult();
}
// 検索ワードのクリア
private void clearSearch() {
mSearchWord = null;
mStartDateStr = null;
mEndDateStr = null;
clearData();
}
// イメージボタンを無効にする
private void setEnabledImageButton(ImageButton button) {
button.setEnabled(false);
button.setColorFilter(0xaa808080);
}
/**
* ツールバーのアイコンを有効にする
*/
private void cancelToolbarEnabledIcon() {
mFilterButton.setEnabled(true);
mFilterButton.setColorFilter(null);
mSearchButton.setEnabled(true);
mSearchButton.setColorFilter(null);
} }
/** /**
* ビューを作り直す。 * ビューを作り直す。
*/ */
public void setOperationListView() { public void setOperationListView() {
mListHelper = getListHelper();
handler.post(new ReloadHandler()); handler.post(new ReloadHandler());
configurationToolbarIcon(); configurationToolbarIcon();
} }
// ビューを作り直さずにリストだけ更新する // ビューを作り直さずにリストだけ更新する
public void refreshOperationList() { public void refreshOperationList() {
Logger.d(TAG, "refreshContentList");
mListHelper.refreshList(); mListHelper.refreshList();
configurationToolbarIcon(); configurationToolbarIcon();
} }
...@@ -399,7 +475,18 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -399,7 +475,18 @@ public class OperationListActivity extends ABVUIActivity {
setResourcePattern(); setResourcePattern();
// 絞り検索マスタデータ最新更新する時fetchDateをローカルに保存する。 // 絞り検索マスタデータ最新更新する時fetchDateをローカルに保存する。
setApertureMasterDataFetchDate(); setApertureMasterDataFetchDate();
if (mOperationGroupMasterServiceOperationFlg == ABVDataCache.getInstance().serviceOption.isOperationGroupMaster()) {
// サービスオプションが変わってない場合は、ビューは作らずにデータのみ更新
refreshOperationList(); refreshOperationList();
} else {
// 初期化
getABVUIDataCache().clearOperationGroupMaster();
mOperationGroupMasterServiceOperationFlg = ABVDataCache.getInstance().serviceOption.isOperationGroupMaster();
// ビューを作り直す
setOperationListView();
}
} }
} }
}); });
...@@ -464,13 +551,12 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -464,13 +551,12 @@ public class OperationListActivity extends ABVUIActivity {
mEndDate = (TextView) mSearchDialog.findViewById(R.id.end_date); mEndDate = (TextView) mSearchDialog.findViewById(R.id.end_date);
// 33 // 検索ダイアログ画面の作業名要素
mSearchTextView = (EditText) mSearchDialog.findViewById(R.id.operation_name); mSearchTextView = (EditText) mSearchDialog.findViewById(R.id.operation_name);
mSearchTextView.setOnKeyListener(new View.OnKeyListener() { mSearchTextView.setOnKeyListener(new View.OnKeyListener() {
@Override @Override
public boolean onKey(View v, int keyCode, KeyEvent event) { public boolean onKey(View v, int keyCode, KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN && keyCode == KeyEvent.KEYCODE_ENTER) { if (event.getAction() == KeyEvent.ACTION_DOWN && keyCode == KeyEvent.KEYCODE_ENTER) {
Logger.d("------------------------------------------------set key");
//キーボードのエンターキーを無効にする //キーボードのエンターキーを無効にする
return true; return true;
} }
...@@ -570,14 +656,20 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -570,14 +656,20 @@ public class OperationListActivity extends ABVUIActivity {
private void clearData() { private void clearData() {
// 開始日の初期化 // 開始日の初期化
if (mStartDate != null) {
mStartDate.setText(StringUtil.Empty); mStartDate.setText(StringUtil.Empty);
}
// 終了日の初期化 // 終了日の初期化
if (mEndDate != null) {
mEndDate.setText(StringUtil.Empty); mEndDate.setText(StringUtil.Empty);
}
// プロジェクト名の初期化 // 作業名の初期化
if (mSearchTextView != null) {
mSearchTextView.setText(StringUtil.Empty); mSearchTextView.setText(StringUtil.Empty);
} }
}
// 開始日と終了日のバリデーション // 開始日と終了日のバリデーション
private boolean dateValidation(TextView textView, String targetDateStr) { private boolean dateValidation(TextView textView, String targetDateStr) {
...@@ -614,11 +706,9 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -614,11 +706,9 @@ public class OperationListActivity extends ABVUIActivity {
if (StringUtil.isNullOrEmpty(mSearchWord) && StringUtil.isNullOrEmpty(mStartDateStr) && StringUtil.isNullOrEmpty(mEndDateStr)) { if (StringUtil.isNullOrEmpty(mSearchWord) && StringUtil.isNullOrEmpty(mStartDateStr) && StringUtil.isNullOrEmpty(mEndDateStr)) {
// 検索ワードが存在しない場合、検索結果ではないので非表示 // 検索ワードが存在しない場合、検索結果ではないので非表示
mSearchResultLayout.setVisibility(View.GONE); mSearchResultLayout.setVisibility(View.GONE);
mTitleView.setVisibility(View.VISIBLE);
} else { } else {
// 検索ワードが存在するため、検索結果と見做し、表示 // 検索ワードが存在するため、検索結果と見做し、表示
mSearchResultLayout.setVisibility(View.VISIBLE); mSearchResultLayout.setVisibility(View.VISIBLE);
mTitleView.setVisibility(View.GONE);
} }
} }
...@@ -1167,7 +1257,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1167,7 +1257,7 @@ public class OperationListActivity extends ABVUIActivity {
mOperationLogic.sendPanoContent(operationDto.operationId, operationDto.operationName, file); mOperationLogic.sendPanoContent(operationDto.operationId, operationDto.operationName, file);
isError = false; isError = false;
} catch (ABVException e) { } catch (ABVException e) {
//noroutineion EnumSwitchStatementWhichMissesCases //noinspection EnumSwitchStatementWhichMissesCases
switch (e.getCode()) { switch (e.getCode()) {
case P_E_ACMS_P001: case P_E_ACMS_P001:
showSimpleAlertDialog(R.string.app_name, showSimpleAlertDialog(R.string.app_name,
...@@ -1757,7 +1847,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1757,7 +1847,6 @@ public class OperationListActivity extends ABVUIActivity {
} }
} }
}); });
} }
/** /**
...@@ -1873,7 +1962,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1873,7 +1962,7 @@ public class OperationListActivity extends ABVUIActivity {
if (selectedOperationReportTypeIds.size() > 0) { if (selectedOperationReportTypeIds.size() > 0) {
getABVUIDataCache().setOperationReportTypes(selectedOperationReportTypeIds); getABVUIDataCache().setOperationReportTypes(selectedOperationReportTypeIds);
setOperationListView(); refreshOperationList();
} else { } else {
((CheckedTextView)view).setChecked(true); ((CheckedTextView)view).setChecked(true);
listView.getCheckedItemPositions().put(position, true); listView.getCheckedItemPositions().put(position, true);
...@@ -1913,11 +2002,189 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1913,11 +2002,189 @@ public class OperationListActivity extends ABVUIActivity {
private void checkSelectedFilterType() { private void checkSelectedFilterType() {
List<Integer> defaultTypeList = getOperationReportTypeList(true); List<Integer> defaultTypeList = getOperationReportTypeList(true);
ArrayList<Integer> selectedOperationReportTypes = getOperationReportTypeList(false); ArrayList<Integer> selectedOperationReportTypes = getOperationReportTypeList(false);
ImageButton imgBtn = (ImageButton) findViewById(R.id.icon_filter);
if (defaultTypeList.size() == selectedOperationReportTypes.size()) { if (defaultTypeList.size() == selectedOperationReportTypes.size()) {
imgBtn.setImageDrawable(getRDrawable(R.drawable.ic_filter)); mFilterButton.setImageDrawable(getRDrawable(R.drawable.ic_filter));
} else {
mFilterButton.setImageDrawable(getRDrawable(R.drawable.ic_filter_selected));
}
}
/**
* 作業種別の選択のダイアログ画面表示
* @param isInit
* @param autoClose 直下階層が存在しない場合、ダイアログを自動で閉じる
*/
public void showOperationGroupMasterDialog(boolean isInit, boolean autoClose) {
if (isInit) {
// 最後の階層レベルを取得
Integer lastLevel = mOperationGroupMasterLogic.getLastGroupLevel();
operationCountMap = new HashMap<Integer, Integer>();
// 作業種別毎に作業数をMapにセット
String reportTypeStr = getUserPref(AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null);
mOperationGroupMasterLogic.getAllOperationCount(mSearchWord, mStartDateStr, mEndDateStr, reportTypeStr, lastLevel, operationCountMap);
}
// 既にダイアログが存在するか、開いた状態である場合は何もしない
if (mShowDialog != null && mShowDialog.isShowing()) {
return;
}
final ABVListDialog dialog = new ABVListDialog(this);
// 外側タップしてもダイアログ画面が閉じられないように設定
dialog.setCanceledOnTouchOutside(false);
mShowDialog = dialog;
OperationGroupMasterListHelper helper = (OperationGroupMasterListHelper) mListHelper;
ArrayList<String> groupNames = new ArrayList<>();
// 直下の作業種別リスト情報を取得
final List<OperationGroupMasterDto> operationGroupMasterDtoList = helper.getChildList();
dialog.setTitle(helper.getPeekName(), R.drawable.ic_title_group_operation);
// 閉じるボタン
dialog.setRightItemOnClickListener(R.drawable.ic_operation_close, new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
// autoCloseがtrueの場合、下位階層が存在しなければreturnで以下の処理は行わない
if (autoClose && operationGroupMasterDtoList.size() < 1) {
return;
}
boolean[] haveChildFlags = new boolean[operationGroupMasterDtoList.size()];
int[] operationCounts = new int[operationGroupMasterDtoList.size()];
int i = 0;
for (OperationGroupMasterDto dto : operationGroupMasterDtoList) {
int operationGroupMasterId = dto.operationGroupMasterId;
groupNames.add(dto.operationGroupMasterName);
// 下位階層があるか否かチェック
haveChildFlags[i] = helper.getChildList(operationGroupMasterId).size() > 0;
// 子グループも含めて作業種別に紐づく作業数
operationCounts[i] = operationCountMap.get(operationGroupMasterId);
i++;
}
final HierarchyOperationGroupListAdapter adapter = new HierarchyOperationGroupListAdapter(this, groupNames, haveChildFlags, operationCounts);
// 上位階層がある場合、上位階層に戻るボタンを追加
if (helper.getStackSize() > 1) {
dialog.setListViewAdapter(adapter);
String backToName = helper.getPrePeekName();
// スマートフォン端末で20文字を超えた場合、20文字まで切り落として後ろに...をつけて表示
if (isNormalSize() && backToName.length() > 20) {
backToName = backToName.substring(0, 20) + "...";
}
dialog.setHeaderItemOnClickListener(backToName, new View.OnClickListener() {
@Override
public void onClick(View v) {
OperationGroupMasterListHelper helper = (OperationGroupMasterListHelper) mListHelper;
helper.popList(1, true);
// ポップアップ再表示
dialog.dismiss();
showOperationGroupMasterDialog(false, false);
}
});
} else {
dialog.setListViewAdapter(adapter);
}
// 直下階層の要素をクリックイベント
dialog.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
OperationGroupMasterDto operationGroupMasterDto = operationGroupMasterDtoList.get(position);
OperationGroupMasterListHelper helper = (OperationGroupMasterListHelper) mListHelper;
helper.pushList(operationGroupMasterDto);
// ポップアップ再表示
dialog.dismiss();
showOperationGroupMasterDialog(false, true);
}
});
// リストが空の時表示するテキストを設定
dialog.setListEmptyText(getString(R.string.no_child));
if (isNormalSize()) {
dialog.showHalfSize();
} else { } else {
imgBtn.setImageDrawable(getRDrawable(R.drawable.ic_filter_selected)); dialog.show();
}
}
/**
* operationListHelperに通常か作業種別のhelperをセット
* @return
*/
private OperationListHelper getListHelper() {
OperationListHelper operationListHelper;
if (mOperationGroupMasterServiceOperationFlg && getABVUIDataCache().getOperationGroupMasterMode() == OperationLocationType.GROUP) {
operationListHelper = new OperationGroupMasterListHelper(this);
} else {
operationListHelper = new HomeOperationListHelper(this);
}
return operationListHelper;
}
/**
* 作業種別ID取得
* @return
*/
public int getOperationGroupMasterId() {
return getABVUIDataCache().getOperationGroupMasterId();
}
/**
* 開いた作業種別ID保存
* @param operationGroupMasterId
*/
public void setOperationGroupMasterId(int operationGroupMasterId) {
getABVUIDataCache().setOperationGroupMasterId(operationGroupMasterId);
}
/**
* 作業種別選択画面を閉じる処理
*/
public void closeOperationGroupMasterDialog() {
if (mShowDialog != null && mShowDialog.isShowing()) {
mShowDialog.dismiss();
}
}
/**
* セグメント(全て・カテゴリ)のクリックイベント
* @param view
*/
public void onClickOperationLocationType(View view) {
if (view.getId() == R.id.operation_location_type_group) {
// カテゴリ
getABVUIDataCache().setOperationGroupMasterMode(OperationLocationType.GROUP);
} else {
// 全て
getABVUIDataCache().setOperationGroupMasterMode(OperationLocationType.ALL);
}
// プログレスバー表示(ビューが作り終わるとcloseProgressPopup()が呼ばれる
showProgressPopup();
setOperationListView();
if (getABVUIDataCache().getOperationGroupMasterMode() == OperationLocationType.GROUP) {
//作業種別モードの場合は、作業種別選択ダイアログ画面を表示
showOperationGroupMasterDialog(true, false);
}
}
/**
* セグメントのチェック設定
* @param operationGroupType
*/
private void checkOperationGroupType(final int operationGroupType) {
switch (operationGroupType) {
case OperationLocationType.GROUP:
mLocationTypeRadioGroup.check(R.id.operation_location_type_group);
break;
case OperationLocationType.ALL:
default:
mLocationTypeRadioGroup.check(R.id.operation_location_type_all);
break;
} }
} }
......
package jp.agentec.abook.abv.ui.home.adapter;
import java.util.ArrayList;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.launcher.android.R;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class HierarchyOperationGroupListAdapter extends BaseAdapter {
private static LayoutInflater mInflater = null;
private ArrayList<String> mNameList = new ArrayList<>();
private boolean[] mHaveChildFlags;
private int[] mOperationCounts;
public HierarchyOperationGroupListAdapter(Context context, ArrayList<String> nameList, boolean[] haveChildFlags, int[] operationCounts) {
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mNameList = nameList;
mHaveChildFlags = haveChildFlags;
mOperationCounts = operationCounts;
}
@Override
public int getCount() {
return mNameList.size();
}
@Override
public Object getItem(int position) {
return mNameList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
public void remove(int position) {
mNameList.remove(position);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (null == convertView) {
convertView = mInflater.inflate(R.layout.item_popup_list_item, null);
holder = new ViewHolder();
holder.title = (TextView) convertView.findViewById(R.id.itemText);
holder.nextLevel = (ImageView) convertView.findViewById(R.id.nextLevel);
holder.itemCount = (TextView) convertView.findViewById(R.id.itemCountText);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
// タイトル
holder.title.setText((String)getItem(position));
// 子作業種別がある場合、「>」を表示
if (mHaveChildFlags[position]) {
holder.nextLevel.setVisibility(View.VISIBLE);
} else {
holder.nextLevel.setVisibility(View.INVISIBLE);
}
// 作業数
holder.itemCount.setText("" + mOperationCounts[position]);
return convertView;
}
static class ViewHolder {
TextView title;
ImageView nextLevel;
TextView itemCount;
}
}
package jp.agentec.abook.abv.ui.home.helper;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.HorizontalScrollView;
import android.widget.LinearLayout;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.home.activity.OperationListActivity;
import jp.agentec.abook.abv.ui.home.view.BreadCrumbButton;
import static jp.agentec.abook.abv.cl.util.PreferenceUtil.getUserPref;
/**
* 階層構造をロジックの共通処理を実装
* @author jang
*
*/
public abstract class HierarchyOperationListHelper<StackObject> extends OperationListHelper implements OnClickListener {
private final int MP = LayoutParams.MATCH_PARENT;
private final int WP = LayoutParams.WRAP_CONTENT;
protected Stack<StackObject> stack;
private LinearLayout mHierarchyContentLayout = null;
private LinearLayout mBreadCrumbsLayout = null;
private ViewGroup mOperationListView = null;
protected ArrayList<BreadCrumbButton> breadCrumbList = null;
private HorizontalScrollView panList;
/**
* 階層構造を持つ親クラス
* @param appActivity
*/
public HierarchyOperationListHelper(OperationListActivity appActivity) {
super(appActivity);
mHierarchyContentLayout = new LinearLayout(appActivity);
mHierarchyContentLayout.setOrientation(LinearLayout.VERTICAL);
View v = new View(appActivity);
v.setBackgroundColor(Color.GRAY);
LinearLayout.LayoutParams vlp = new LinearLayout.LayoutParams(MP, 1);
mHierarchyContentLayout.addView(v, vlp);
LinearLayout panListLayout = (LinearLayout) LayoutInflater.from(appActivity).inflate(R.layout.content_breadcrumb_layout, null);
// 階層構造ビューを表示するボタン
panListLayout.findViewById(R.id.btn_show_list_view).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mAppActivity.showOperationGroupMasterDialog(true,false);
}
});
// パンくずのスクロールを作成
panList = (HorizontalScrollView) panListLayout.findViewById(R.id.bread_crumbs_scroll_view);
mBreadCrumbsLayout = (LinearLayout) panListLayout.findViewById(R.id.bread_crumbs_layout);
breadCrumbList = new ArrayList<>();
// パンくずリストを追加
mHierarchyContentLayout.addView(panListLayout, new LinearLayout.LayoutParams(MP, WP));
}
public void addBreadCrumbs(String name) {
addBreadCrumbs(name, stack.size() + 1);
}
public void addBreadCrumbs(String name, int level) {
BreadCrumbButton bcb = new BreadCrumbButton(mAppActivity, name);
bcb.level = level;
breadCrumbList.add(bcb);
bcb.setOnClickListener(this);
LayoutParams l = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
mBreadCrumbsLayout.addView(bcb, l);
// 右側へスクロールさせる
panList.post(new Runnable() {
@Override
public void run() {
panList.fullScroll(View.FOCUS_RIGHT);
}
});
}
protected void removeBreadCrumbs(View v) {
mBreadCrumbsLayout.removeView(v);
if (v instanceof BreadCrumbButton) {
breadCrumbList.remove(v);
}
}
/**
* 作業一覧のViewGroup取得
* @return
*/
@Override
public ViewGroup getOperationView() {
if (mOperationListView != null) {
ViewGroup parent = (ViewGroup) mOperationListView.getParent();
if (parent != null) {
parent.removeView(mOperationListView);
}
}
mOperationListView = super.getOperationView();
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(MP, 1);
lp.weight = 1;
mHierarchyContentLayout.addView(mOperationListView, 0, lp);
return mHierarchyContentLayout;
}
/**
* HorizontalScrollViewパンくずボタンをクリック時に呼ばれるメソッド
*/
@Override
public void onClick(View v) {
BreadCrumbButton button = (BreadCrumbButton) v;
int popCount = mBreadCrumbsLayout.getChildCount() - button.level;
if (popCount > 0) {
popList(popCount, true);
}
}
/**
* 階層スタックの現在のサイズを返します
*
* @return
*/
public int getStackSize() {
return stack.size();
}
/**
* 指定した階層分上のリストへ移動する
*
* @param popCount いくつ上の階層を表示するか指定します。
*/
abstract public void popList(int popCount, boolean isReload);
/**
* 一つ下の階層のリストへ移動する
*
* @param stackObject
*/
abstract public void pushList(StackObject stackObject);
/**
* 子階層の一覧を取得します
* @return
*/
abstract public List<StackObject> getChildList();
/**
* 現在の階層の名前を取得します
* @return
*/
abstract public String getPeekName();
/**
* 一つ上の階層の名前を取得します
* @return
*/
abstract public String getPrePeekName();
}
package jp.agentec.abook.abv.ui.home.helper;
import java.util.List;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.home.activity.OperationListActivity;
import static jp.agentec.abook.abv.cl.util.PreferenceUtil.getUserPref;
/**
* Created by leej on 2019/06/24.
*/
public class HomeOperationListHelper extends OperationListHelper {
private static final String TAG = "HomeOperationListHelper";
public HomeOperationListHelper(OperationListActivity activity) {
super(activity);
}
@Override
protected List<OperationDto> findOperationList() throws Exception {
String reportTypeStr = getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null);
return operationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, reportTypeStr);
}
}
package jp.agentec.abook.abv.ui.home.helper;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.OperationGroupMasterDao;
import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationGroupMasterLogic;
import jp.agentec.abook.abv.launcher.android.ABVApplication;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.home.activity.OperationListActivity;
import jp.agentec.adf.util.CollectionUtil;
import static jp.agentec.abook.abv.cl.util.PreferenceUtil.getUserPref;
public class OperationGroupMasterListHelper extends HierarchyOperationListHelper<OperationGroupMasterDto> {
private static final String TAG = "OperationGroupMasterListHelper";
private OperationGroupMasterDao mOperationGroupMasterDao = AbstractDao.getDao(OperationGroupMasterDao.class);
private OperationGroupMasterLogic mOperationGroupMasterLogic = AbstractLogic.getLogic(OperationGroupMasterLogic.class);
public OperationGroupMasterListHelper(OperationListActivity appActivity) {
super(appActivity);
// キャッシュのスタックを利用する
stack = ABVApplication.getABVUIDataCache(mAppActivity).operationGroupMasterStack;
if (stack.size() == 0) {
// スタックが空の場合、全体を入れる
OperationGroupMasterDto operationGroupMasterDto;
// 保存されたoperationGroupmasterIdが0または、存在しない場合
if (mAppActivity.getOperationGroupMasterId() == 0 || !mOperationGroupMasterDao.isExistOperationGroupMaster(mAppActivity.getOperationGroupMasterId())) {
// 最上位階層をセット
operationGroupMasterDto = mOperationGroupMasterDao.getTopOperationGroupMaster();
if (operationGroupMasterDto != null) {
pushList(operationGroupMasterDto);
}
} else {
// 前回開いた際のIDでセット
List<OperationGroupMasterDto> operationGroupMasterDtoList = mOperationGroupMasterLogic.getParentOperationGroupMasterForPath(mAppActivity.getOperationGroupMasterId());
if (CollectionUtil.isNotEmpty(operationGroupMasterDtoList)) {
for (OperationGroupMasterDto dto : operationGroupMasterDtoList) {
pushList(dto);
}
}
}
} else {
// スタックに積まれている分だけパンくずボタンを作成
for (int i = 0; i < stack.size(); i++) {
OperationGroupMasterDto groupDto = stack.get(i);
addBreadCrumbs(groupDto.operationGroupMasterName, i + 1);
}
}
}
/**
* データの取得処理(新着更新処理完了後行われる)
* @return
* @throws Exception
*/
@Override
protected List<OperationDto> findOperationList() throws Exception {
OperationGroupMasterDto peekOperationGroupMasterDto = stack.peek();
String reportTypeStr = getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null);
Integer operationGroupMasterId = null;
// operationGroupMasterIdのデータが存在、且つクリアフラグがfalseの場合
if (mOperationGroupMasterDao.isExistOperationGroupMaster(peekOperationGroupMasterDto.operationGroupMasterId) && !ABVEnvironment.getInstance().getOperationGroupMasterClearFlg()) {
operationGroupMasterId = peekOperationGroupMasterDto.operationGroupMasterId;
} else {
// 表示する作業種別が既に削除された場合、最上位階層に戻る(リセット)
popList(breadCrumbList.size() - 1, false);
// クリアフラグをfalseにセット
ABVEnvironment.getInstance().setOperationGroupMasterClearFlg(false);
// 作業種別の選択画面を閉じる
mAppActivity.closeOperationGroupMasterDialog();
}
// 作業種別IDで紐づく作業リストを取得
return mOperationGroupMasterLogic.getOperationByOperationGroupMasterId(operationGroupMasterId);
}
/**
* 親階層へ移動処理
* @param popCount いくつ上の階層を表示するか指定します。
* @param isReload リロードする・しない判定
*/
@Override
public void popList(int popCount, boolean isReload) {
for (int i = 0; i < popCount; i++) {
stack.pop();
// パンくずリスト削除
removeBreadCrumbs(breadCrumbList.get(breadCrumbList.size() - 1));
}
// 移動した作業種別のIDセット
mAppActivity.setOperationGroupMasterId(stack.get(getStackSize() - 1).operationGroupMasterId);
breadCrumbList.get(breadCrumbList.size() - 1);
if (isReload) {
// 作業一覧画面を更新する
refreshList();
}
}
@Override
public void pushList(OperationGroupMasterDto operationGroupMasterDto) {
if (operationGroupMasterDto == null) {
Logger.w(TAG, "[pushList] groupDto is null");
return;
}
// パンくずリスト追加
addBreadCrumbs(operationGroupMasterDto.operationGroupMasterName);
// ID保存
mAppActivity.setOperationGroupMasterId(operationGroupMasterDto.operationGroupMasterId);
stack.push(operationGroupMasterDto);
refreshList();
}
@Override
public String getPrePeekName() {
String groupName = "";
if (stack.size() > 1) {
groupName = stack.get(stack.size() - 2).operationGroupMasterName;
}
return groupName;
}
@Override
public String getPeekName() {
String groupName = "";
if (stack.size() > 0) {
groupName = stack.peek().operationGroupMasterName;
}
return groupName;
}
/**
* 親階層の情報で下の階層をリストで取得
* @return List<OperationGroupMasterDto>
*/
@Override
public List<OperationGroupMasterDto> getChildList() {
OperationGroupMasterDto peekOperationGroupMasterDto = stack.peek();
return getChildList(peekOperationGroupMasterDto.operationGroupMasterId);
}
/**
* 親階層のIDで下の階層をリストで取得
* @param operationGroupMasterId
* @return List<OperationGroupMasterDto>
*/
public List<OperationGroupMasterDto> getChildList(Integer operationGroupMasterId) {
return mOperationGroupMasterDao.getOperationGroupMasterChildList(operationGroupMasterId);
}
}
package jp.agentec.abook.abv.ui.home.helper; package jp.agentec.abook.abv.ui.home.helper;
import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.GridView; import android.widget.GridView;
import android.widget.ListView; import android.widget.ListView;
import android.widget.Toast;
import com.handmark.pulltorefresh.library.PullToRefreshBase; import com.handmark.pulltorefresh.library.PullToRefreshBase;
import com.handmark.pulltorefresh.library.PullToRefreshGridView; import com.handmark.pulltorefresh.library.PullToRefreshGridView;
...@@ -14,6 +11,7 @@ import com.handmark.pulltorefresh.library.PullToRefreshListView; ...@@ -14,6 +11,7 @@ import com.handmark.pulltorefresh.library.PullToRefreshListView;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
...@@ -24,7 +22,6 @@ import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; ...@@ -24,7 +22,6 @@ import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.ViewMode; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.ViewMode;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode; import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage; import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil; import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.home.activity.OperationListActivity; import jp.agentec.abook.abv.ui.home.activity.OperationListActivity;
import jp.agentec.abook.abv.ui.home.adapter.AbstractOperationAdapter; import jp.agentec.abook.abv.ui.home.adapter.AbstractOperationAdapter;
...@@ -38,13 +35,13 @@ import static jp.agentec.abook.abv.cl.util.PreferenceUtil.getUserPref; ...@@ -38,13 +35,13 @@ import static jp.agentec.abook.abv.cl.util.PreferenceUtil.getUserPref;
* Created by leej on 2019/03/06. * Created by leej on 2019/03/06.
*/ */
public class OperationListHelper { public abstract class OperationListHelper {
private static final String TAG = "OperationListHelper"; private static final String TAG = "OperationListHelper";
private OperationListActivity mAppActivity; protected OperationListActivity mAppActivity;
private AbstractOperationAdapter mAdapter; private AbstractOperationAdapter mAdapter;
private PullToRefreshListView mPullToRefreshListView; private PullToRefreshListView mPullToRefreshListView;
private PullToRefreshGridView mPullToRefreshGridView; private PullToRefreshGridView mPullToRefreshGridView;
private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class); protected OperationLogic operationLogic = AbstractLogic.getLogic(OperationLogic.class);
private List<OperationDto> operationDtoList = new ArrayList<>(); private List<OperationDto> operationDtoList = new ArrayList<>();
// スマートフォンの1行のパンネル数 // スマートフォンの1行のパンネル数
...@@ -61,10 +58,19 @@ public class OperationListHelper { ...@@ -61,10 +58,19 @@ public class OperationListHelper {
mPullToRefreshGridView = new PullToRefreshGridView(activity); mPullToRefreshGridView = new PullToRefreshGridView(activity);
} }
/**
* 作業を検索してListを返す
*
* @return
* @throws Exception
* @throws NetworkDisconnectedException
*/
abstract protected List<OperationDto> findOperationList() throws Exception;
private List<OperationDto> filterOperationList() { private List<OperationDto> filterOperationList() {
try { try {
String reportTypeStr = getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null); operationDtoList = findOperationList();
operationDtoList = mOperationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, reportTypeStr);
} catch (Exception e) { } catch (Exception e) {
Logger.e(TAG, "findOperationList", e); Logger.e(TAG, "findOperationList", e);
ErrorMessage.showErrorMessageToast(mAppActivity.getApplicationContext(), ErrorCode.E107); ErrorMessage.showErrorMessageToast(mAppActivity.getApplicationContext(), ErrorCode.E107);
...@@ -247,7 +253,7 @@ public class OperationListHelper { ...@@ -247,7 +253,7 @@ public class OperationListHelper {
} }
/** /**
* プロジェクトの件数取得 * 作業の件数取得
* @return * @return
*/ */
public int getOperationCount() { public int getOperationCount() {
...@@ -255,7 +261,7 @@ public class OperationListHelper { ...@@ -255,7 +261,7 @@ public class OperationListHelper {
} }
/** /**
* プロジェクトリスト取得 * 作業リスト取得
* @return * @return
*/ */
public List<OperationDto> getOperationList() { public List<OperationDto> getOperationList() {
......
package jp.agentec.abook.abv.ui.home.view;
import jp.agentec.abook.abv.launcher.android.R;
import android.content.Context;
import android.graphics.Color;
import android.widget.Button;
/**
* パンくず履歴用のボタン
* @author jang
*
*/
public class BreadCrumbButton extends Button {
private BreadCrumbButton(Context context) {
super(context);
}
public BreadCrumbButton(Context context, String name) {
super(context);
this.name = name;
setText(name);
setTextColor(Color.BLACK);
setBackgroundResource(R.drawable.btn_breadcrumbs);
setPadding(10, 0, 40, 0);
}
public int level;
public String name;
}
...@@ -242,39 +242,6 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -242,39 +242,6 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
webView.setWebViewClient(new WebViewClient() { webView.setWebViewClient(new WebViewClient() {
@Override @Override
public WebResourceResponse shouldInterceptRequest(WebView view, final String url) {
if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
// 360編集画面時に以下の処理でステータスコードのチェックを行う
if (!url.contains("%")) {
new Thread(new Runnable() {
@Override
public void run() {
HttpGet httpGet = new HttpGet(url);
HttpResponse response;
HttpClient client = new DefaultHttpClient();
try {
response = client.execute(httpGet);
final int statusCode = response.getStatusLine().getStatusCode();
Logger.d("shouldInterceptRequest url :" + url + " status code : " + statusCode);
if (statusCode >= 400) {
handler.post(new Runnable() {
@Override
public void run() {
commonOnReceivedResponseHeaders(url, statusCode);
}
});
}
} catch (IOException e) {
Logger.e(TAG, e);
}
}
}).start();
}
}
return null;
}
@Override
public void onLoadResource(WebView view, String url) { public void onLoadResource(WebView view, String url) {
backCheckFlg = view.canGoBack(); backCheckFlg = view.canGoBack();
forwardCheckFlg = view.canGoForward(); forwardCheckFlg = view.canGoForward();
...@@ -540,20 +507,8 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -540,20 +507,8 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
@Override @Override
public boolean onKeyUp(int keyCode, KeyEvent event) { public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (mOperationId != null && mOperationId > -1) {
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
}
if (isLinkedContent) {
goToBack();
} else {
finishActivity();
}
} else {
return super.onKeyUp(keyCode, event); return super.onKeyUp(keyCode, event);
} }
return false;
}
@Override @Override
public boolean onKeyDown(int keyCode, KeyEvent event) { public boolean onKeyDown(int keyCode, KeyEvent event) {
...@@ -561,20 +516,6 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -561,20 +516,6 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
} }
@Override @Override
protected void finishActivity() {
setResult(RESULT_OK, new Intent());
finish();
if (objectId == -1) { // HTMLコンテンツの場合で、KeyUpではない場合、全コンテンツActivityを終了
if (isLinkedContent) {
ActivityHandlingHelper.getInstance().finishAllLinkContentViewActivity();
} else {
ActivityHandlingHelper.getInstance().finishAllContentViewActivity();
}
}
}
@Override
public void onResume() { public void onResume() {
Logger.i(TAG, "onResume"); Logger.i(TAG, "onResume");
super.onResume(); super.onResume();
......
...@@ -252,11 +252,6 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity { ...@@ -252,11 +252,6 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
}); });
webView.setResourceClient(new XWalkResourceClient(webView) { webView.setResourceClient(new XWalkResourceClient(webView) {
@Override
public void onReceivedResponseHeaders (XWalkView view, XWalkWebResourceRequest request, XWalkWebResourceResponse response) {
String uri = request.getUrl().toString();
commonOnReceivedResponseHeaders(uri, response.getStatusCode());
}
@Override @Override
public void onReceivedLoadError (XWalkView view, int errorCode, String description, String failingUrl) { public void onReceivedLoadError (XWalkView view, int errorCode, String description, String failingUrl) {
...@@ -579,35 +574,13 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity { ...@@ -579,35 +574,13 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
@Override @Override
public boolean onKeyUp(int keyCode, KeyEvent event) { public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (mOperationId != null && mOperationId > -1) {
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
}
if (isLinkedContent) {
goToBack();
} else {
finishActivity();
}
} else {
return super.onKeyUp(keyCode, event); return super.onKeyUp(keyCode, event);
} }
return false;
}
@Override @Override
public boolean onKeyDown(int keyCode, KeyEvent event) { public boolean onKeyDown(int keyCode, KeyEvent event) {
return super.onKeyDown(keyCode, event); return super.onKeyDown(keyCode, event);
} }
@Override
protected void finishActivity() {
setResult(RESULT_OK, new Intent());
finish();
if (isLinkedContent) {
ActivityHandlingHelper.getInstance().finishAllLinkContentViewActivity();
} else {
ActivityHandlingHelper.getInstance().finishAllContentViewActivity();
}
}
@Override @Override
public void onResume() { public void onResume() {
...@@ -622,13 +595,13 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity { ...@@ -622,13 +595,13 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
protected void onStop() { protected void onStop() {
super.onStop(); super.onStop();
webView.stopLoading(); webView.stopLoading();
if (objectLogId != -1) { if (objectLogId == -1) {
ContentLogUtil.getInstance().endObjectLog(getContentId(), objectLogId);
} else {
if (lastPageStartDate != null) { // 360の場合 if (lastPageStartDate != null) { // 360の場合
ContentLogUtil.getInstance().endContentPageReadLog(contentId, lastPageNo, readingLogId); ContentLogUtil.getInstance().endContentPageReadLog(contentId, lastPageNo, readingLogId);
AbstractLogic.getLogic(ContentReadingLogLogic.class).endContentReadLog(contentId); AbstractLogic.getLogic(ContentReadingLogLogic.class).endContentReadLog(contentId);
} }
} else {
ContentLogUtil.getInstance().endObjectLog(getContentId(), objectLogId);
} }
} }
......
...@@ -3,7 +3,9 @@ package jp.agentec.abook.abv.ui.viewer.activity; ...@@ -3,7 +3,9 @@ package jp.agentec.abook.abv.ui.viewer.activity;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageButton; import android.widget.ImageButton;
...@@ -22,6 +24,8 @@ import jp.agentec.abook.abv.bl.common.Callback; ...@@ -22,6 +24,8 @@ import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor; 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.constant.ABookKeys; import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao; import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao; import jp.agentec.abook.abv.bl.data.dao.ContentDao;
...@@ -95,33 +99,6 @@ public class ParentWebViewActivity extends ABVContentViewActivity { ...@@ -95,33 +99,6 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
} }
} }
protected void commonOnReceivedResponseHeaders(String uri, int statusCode) {
if (uri.contains("vtour") || uri.contains("authByCheck")) {
if(statusCode >= 400) {
// エラーのため、空のURLをロードさせ、白い画面で表示させる
webViewLoadUrl("");
ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(this, R.string.app_name);
// リソースパターンの適用
alertDialog.setMessage(String.format(PatternStringUtil.patternToString(getApplicationContext(),
R.string.error_msg_open_pano_edit,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)),
statusCode + ""));
// リソースパターンの適用
alertDialog.setPositiveButton(PatternStringUtil.patternToInt(getApplicationContext(),
R.string.ok,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
finish();
}
});
alertDialog.show();
}
}
}
protected void commonProgressChanged(int progress) { protected void commonProgressChanged(int progress) {
setVisbilityProgress(true); setVisbilityProgress(true);
if (progress >= 100) { if (progress >= 100) {
...@@ -240,6 +217,41 @@ public class ParentWebViewActivity extends ABVContentViewActivity { ...@@ -240,6 +217,41 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
} }
@Override @Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
showConfirmSavePanoEdit();
} else {
if (mOperationId != null && mOperationId > -1) {
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
}
if (isLinkedContent) {
goToBack();
} else {
finishActivity();
}
}
} else {
return super.onKeyUp(keyCode, event);
}
return false;
}
@Override
protected void finishActivity() {
setResult(RESULT_OK, new Intent());
finish();
if (objectId == -1) { // HTMLコンテンツの場合で、KeyUpではない場合、全コンテンツActivityを終了
if (isLinkedContent) {
ActivityHandlingHelper.getInstance().finishAllLinkContentViewActivity();
} else {
ActivityHandlingHelper.getInstance().finishAllContentViewActivity();
}
}
}
@Override
protected void onDestroy() { protected void onDestroy() {
Logger.d(TAG, "onDestroy"); Logger.d(TAG, "onDestroy");
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
...@@ -278,7 +290,7 @@ public class ParentWebViewActivity extends ABVContentViewActivity { ...@@ -278,7 +290,7 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
if (responseUri != null && responseUri.getPath() != null) { if (responseUri != null && responseUri.getPath() != null) {
File file = new File(responseUri.getPath()); File file = new File(responseUri.getPath());
try { try {
final Integer resourceId = AbstractLogic.getLogic(OperationLogic.class).sendScene(file); final Integer resourceId = AbstractLogic.getLogic(OperationLogic.class).sendScene(file, contentId);
if (resourceId != null) { if (resourceId != null) {
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
...@@ -319,6 +331,26 @@ public class ParentWebViewActivity extends ABVContentViewActivity { ...@@ -319,6 +331,26 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
} }
}); });
} }
} catch (AcmsException ex) {
Logger.e(TAG, ex);
if (ex.getCode() == ABVExceptionCode.P_E_ACMS_P007) {
// シーン追加時、ロック状態である場合
runOnUiThread(new Runnable() {
@Override
public void run() {
closeProgressPopup();
webViewLoadUrl(String.format("javascript:EDC.handleError({ 'status' : 400 }, '', {'message' : 'C018'})"));
}
});
} else {
handler.post(new Runnable() {
@Override
public void run() {
closeProgressPopup();
showFailedSceneApiDialog();
}
});
}
} catch (Exception e) { } catch (Exception e) {
Logger.e(TAG, e); Logger.e(TAG, e);
handler.post(new Runnable() { handler.post(new Runnable() {
......
...@@ -6,7 +6,7 @@ android { ...@@ -6,7 +6,7 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 26 targetSdkVersion 28
} }
buildTypes { buildTypes {
......
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