Commit d423c69f by Kim Jinsung

Merge branch 'contract/sato/1.0.210_41843' into contract/sato/1.0.210

parents 78521504 10499aee
......@@ -23,6 +23,7 @@ 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.MasterDataJSON;
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.RequirePasswordChangeJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ResultJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ServerTimeZoneJSON;
......@@ -705,6 +706,19 @@ public class AcmsClient implements AcmsClientResponseListener {
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;
}
/**********************************************************************************************/
/** 以下、共用メソッド---------------------------------------------------------------------- **/
/**********************************************************************************************/
......
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;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.dto.OperationContentDto;
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.TaskWorkerGroupDto;
import jp.agentec.adf.util.DateTimeFormat;
......@@ -56,6 +57,9 @@ public class OperationListJSON extends AcmsCommonJSON {
public static final String EnableAddReport = "enableAddReport";
public static final String OperationGroupMasterIdList = "operationGroupMasterIdList";
public static final String QuickReport = "quickReport";
public List<OperationDto> operationList;
public OperationListJSON(String jsonString) throws AcmsException {
......@@ -73,6 +77,8 @@ public class OperationListJSON extends AcmsCommonJSON {
OperationDto dto = new OperationDto();
dto.operationContentDtoList = new ArrayList<OperationContentDto>();
dto.taskWorkerGroupDtoList = new ArrayList<TaskWorkerGroupDto>();
dto.operationGroupMasterRelationDtoList = new ArrayList<OperationGroupMasterRelationDto>();
dto.operationId = operationJson.getLong(OperationId);
dto.operationType = operationJson.getInt(OperationType);
dto.operationName = operationJson.getString(OperationName);
......@@ -83,6 +89,7 @@ public class OperationListJSON extends AcmsCommonJSON {
dto.enableReportHistory = operationJson.getInt(EnableReportHistory); // 報告履歴管理
dto.enableReportEdit = operationJson.has(EnableReportEdit) ? operationJson.getInt(EnableReportEdit) : 0; // 作業編集区分
dto.enableAddReport = operationJson.has(EnableAddReport) ? operationJson.getInt(EnableAddReport) : 0; // 作業追加区分
dto.quickReport = operationJson.has(QuickReport) ? operationJson.getInt(QuickReport) : 0;
// 作業終了更新日
if (operationJson.has(OperationLastEditDate)) {
......@@ -100,7 +107,7 @@ public class OperationListJSON extends AcmsCommonJSON {
if (operationJson.has(ContentId)) {
// プロジェクト用資料の登録
OperationContentDto operationContentDto = new OperationContentDto();
operationContentDto.operationId = operationJson.getLong(OperationId);
operationContentDto.operationId = dto.operationId;
operationContentDto.contentId = operationJson.getLong(ContentId);
operationContentDto.operationContentFlg = true;
dto.operationContentDtoList.add(operationContentDto);
......@@ -111,7 +118,7 @@ public class OperationListJSON extends AcmsCommonJSON {
for (int k = 0; k < relatedContentJsonArray.length(); k++) {
// 関連資料の登録
OperationContentDto operationContentDto = new OperationContentDto();
operationContentDto.operationId = operationJson.getLong(OperationId);
operationContentDto.operationId = dto.operationId;
operationContentDto.contentId = relatedContentJsonArray.getJSONObject(k).getInt(ContentId);
operationContentDto.operationContentFlg = false;
dto.operationContentDtoList.add(operationContentDto);
......@@ -154,6 +161,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);
}
}
......
......@@ -152,11 +152,14 @@ public class AcmsApis {
public static final String ApiGetPushMessages = "getPushMessage";
// 定期点検データ送信
public static final String ApiSendRoutineTaskData = "routineTaskData";
// HACCPマスタデータ取得
public static final String ApiGetMasterData = "getMasterData";
// 作業種別データ取得
public static final String ApiOperationGroupMaster = "operationGroupMaster";
// 簡易帳票一覧取得
public static final String ApiQuickReportSearch = "quickReportSearch";
// 簡易帳票リビジョン一覧取得
public static final String ApiQuickReportRevision = "quickReportRevision";
// download
/**
* コンテンツのZIPファイルを取得<br>
......@@ -200,7 +203,9 @@ public class AcmsApis {
} 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(ApiSendPushMessage) || methodName.equals(ApiGetPushMessages) || methodName.equals(ApiSendRoutineTaskData) ||
methodName.equals(ApiGetMasterData)) {
methodName.equals(ApiGetMasterData) ||
// カテゴリ選択機能、IO帳票で3つ追加
methodName.equals(ApiOperationGroupMaster) || methodName.equals(ApiQuickReportSearch) || methodName.equals(ApiQuickReportRevision)) {
apiValue = Constant.ApiValue.checkapi;
}
......
package jp.agentec.abook.abv.bl.acms.type;
/**
* Created by leej on 2019/08/21.
*/
public enum OperationSortingType {
OperationName(0),
OperationStartDateDESC(1),
OperationStartDateASC(2),
OperationType(3),
ReadingDate(4);
private final int operationSorting;
OperationSortingType(int operationSorting) {
this.operationSorting = operationSorting;
}
/**
* 検索をかける項目の番号を返します。
* @return 検索をかける項目の番号です。
* @since 1.0.0
*/
public int type() {
return operationSorting;
}
/**
* 指定した数字に対応するSecurityPolicyCodeの値を返します。
* @param operationSorting 数字のコードです。
* @return 指定した数字に対応するSearchDivisionTypeの値です。
* @since 1.0.0
*/
public static OperationSortingType parse(int operationSorting) {
OperationSortingType sortingType;
switch (operationSorting) {
case 0: // 作業名
sortingType = OperationSortingType.OperationName;
break;
case 1: // 作業期間が新しい順
sortingType = OperationSortingType.OperationStartDateDESC;
break;
case 2: // 作業時間が古い順
sortingType = OperationSortingType.OperationStartDateASC;
break;
case 3: // 報告タイプ
sortingType = OperationSortingType.OperationType;
break;
case 4: // 閲覧日が新しい順
sortingType = OperationSortingType.ReadingDate;
break;
default: // 作業名(デフォルト)
sortingType = OperationSortingType.OperationName;
break;
}
return sortingType;
}
}
......@@ -153,5 +153,15 @@ public interface ServiceOption {
*/
int OperationChangeTime = 173;
/**
* 作業種別:N(通常)、Y(作業種別毎に絞り込み可能なボタン・画面表示)
*/
int OperationGroupMaster = 175;
/**
* I/O帳票使用
* 利用しない:N(通常)、利用する:Y
*/
int UsableIOReport = 186;
}
}
\ No newline at end of file
......@@ -61,6 +61,7 @@ public class ABVEnvironment {
// Serverから取得したcontentVersion時のリソースパターンを一時的に保存するための変数
public int resourcePatternType;
public boolean operationGroupMasterClearFlg;
////////////////////////////// 定数 //////////////////////////////////
......@@ -775,4 +776,21 @@ public class ABVEnvironment {
public String getMasterFilePath() {
return String.format(OperationMasterDataDirFormat, rootDirectory);
}
/**
* 作業種別のクリア判定フラグをセット
* @param clearFlg
*/
public void setOperationGroupMasterClearFlg(boolean clearFlg) {
this.operationGroupMasterClearFlg = clearFlg;
}
/**
* 作業種別のクリア判定フラグ取得
* @return
*/
public boolean getOperationGroupMasterClearFlg() {
return operationGroupMasterClearFlg;
}
}
......@@ -351,6 +351,22 @@ public class ServiceOption {
ServiceOptionDto dto = getServiceOption(ServiceOptionId.OperationChangeTime);
return dto.val;
}
/**
* 作業種別のサービスオプション情報取得
* @return
*/
public boolean isOperationGroupMaster() {
return isServiceOptionEnable(ServiceOptionId.OperationGroupMaster);
}
/**
* I/O帳票使用のサービスオプション情報取得
* @return
*/
public boolean isUnableIOReport() {
return isServiceOptionEnable(ServiceOptionId.UsableIOReport);
}
}
public void setDiffMinFromUTC(String timeZone) {
......
......@@ -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.MGroup;
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.MServiceOption;
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.RContentCategory;
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.SQLiteTableScript;
import jp.agentec.abook.abv.bl.data.tables.TContent;
......@@ -98,6 +100,11 @@ public class ABVDataOpenHelper {
// SPP通信端末管理テーブルをスクリプトに追加
iTableScripts.add(new TSppDevice());
// カテゴリ選択機能テーブルをスクリプトに追加
iTableScripts.add(new MOperationGroupMaster());
iTableScripts.add(new ROperationGroupMasterOperation());
return iTableScripts;
}
......
......@@ -19,7 +19,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
public class DBConnector {
private static volatile DBConnector dbConnector = null;
public static final String DatabaseName = "ABVJE";
public static final int DatabaseVersion = DatabaseVersions.Ver1_0_2;
public static final int DatabaseVersion = DatabaseVersions.Ver1_0_3;
protected SQLiteDatabase db = null;
......
......@@ -4,5 +4,6 @@ package jp.agentec.abook.abv.bl.data;
public class DatabaseVersions {
public static final int Ver1_0_0 = 1;
public static final int Ver1_0_2 = 11; // SATO HACCP 1.0.2
public static final int Ver1_0_3 = 21; // @From カテゴリ選択機能追加
}
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 level
* @return
*/
public List<OperationGroupMasterDto> getOperationGroupMasterListBylevel(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");
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.abook.abv.bl.data.DatabaseVersions;
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) {
List<String> ddl = new ArrayList<String>();
if (oldVersion < DatabaseVersions.Ver1_0_3) {
ddl.addAll(getCreateScript(newVersion));
}
return ddl;
}
@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;
import jp.agentec.abook.abv.bl.data.DatabaseVersions;
/**
* 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) {
// 「カテゴリ選択機能」アップデートで追加されたテーブル
List<String> ddl = new ArrayList<String>();
if (oldVersion < DatabaseVersions.Ver1_0_3) {
ddl.addAll(getCreateScript(newVersion));
}
return ddl;
}
@Override
public List<String> getMigrationScript(SQLiteDatabase databaseConnection, int oldVersion, int newVersion, Object... params) {
return null;
}
}
\ No newline at end of file
......@@ -8,6 +8,10 @@ import jp.agentec.abook.abv.bl.data.DatabaseVersions;
/**
* Created by leej on 2018/08/17.
*
* カテゴリ選択機能で2つ列追加
* operation_open_date
* quick_report
*/
public class TOperation extends SQLiteTableScript {
......@@ -38,6 +42,8 @@ public class TOperation extends SQLiteTableScript {
sql.append(" , enable_report_history SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , enable_report_edit SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , enable_add_report SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , operation_open_date DATETIME ");
sql.append(" , quick_report SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , PRIMARY KEY (operation_id) ");
sql.append(" ) ");
ddl.add(sql.toString());
......@@ -48,22 +54,12 @@ public class TOperation extends SQLiteTableScript {
@Override
public List<String> getUpgradeScript(int oldVersion, int newVersion) {
// List<String> ddl = new ArrayList<String>();
// if (oldVersion < DatabaseVersions.Plus_1_9_3) {
// ddl.addAll(getCreateScript(newVersion));
// }
//
// if (oldVersion < DatabaseVersions.Plus_1_9_3_5) { // カラムの追加
// ddl.add(" ALTER TABLE t_operation ADD COLUMN report_update_type INTEGER NOT NULL DEFAULT 0 ");
// }
//
// if (oldVersion < DatabaseVersions.Plus_1_9_4) { // カラムの追加
// ddl.add(" ALTER TABLE t_operation ADD COLUMN project_report_type INTEGER NOT NULL DEFAULT 0 ");
// ddl.add(" ALTER TABLE t_operation ADD COLUMN report_cycle INTEGER NOT NULL DEFAULT 0 ");
// ddl.add(" ALTER TABLE t_operation ADD COLUMN enable_report_update INTEGER NOT NULL DEFAULT 0 ");
// }
// return ddl;
return null;
List<String> ddl = new ArrayList<String>();
if (oldVersion < DatabaseVersions.Ver1_0_3) {
ddl.add(" ALTER TABLE t_operation ADD COLUMN operation_open_date DATETIME ");
ddl.add(" ALTER TABLE t_operation ADD COLUMN quick_report SMALLINT NOT NULL DEFAULT 0 ");
}
return ddl;
}
@Override
......
......@@ -31,6 +31,7 @@ import jp.agentec.abook.abv.bl.logic.ContractLogic;
import jp.agentec.abook.abv.bl.logic.EnqueteLogic;
import jp.agentec.abook.abv.bl.logic.GroupLogic;
import jp.agentec.abook.abv.bl.logic.MasterDataLogic;
import jp.agentec.abook.abv.bl.logic.OperationGroupMasterLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.DateTimeUtil;
......@@ -52,9 +53,9 @@ import jp.agentec.adf.util.DateTimeUtil;
private ContentLogic contentLogic = AbstractLogic.getLogic(ContentLogic.class);
private OperationLogic operationLogic = AbstractLogic.getLogic(OperationLogic.class);
private ContentDao contentDao = AbstractDao.getDao(ContentDao.class);
private SppDeviceDao sppDeviceDao = AbstractDao.getDao(SppDeviceDao.class);
private OperationGroupMasterLogic operationGroupMasterLogic = AbstractLogic.getLogic(OperationGroupMasterLogic.class);
private ABVDataCache cache = ABVDataCache.getInstance();
private ContentDownloader contentDownloader = ContentDownloader.getInstance();
private NetworkAdapter networkAdapter = ABVEnvironment.getInstance().networkAdapter;
......@@ -175,6 +176,9 @@ import jp.agentec.adf.util.DateTimeUtil;
// マスタデータの最新更新された時のFetchDateを一時に保存する。
ABVDataCache.getInstance().tempMasterDataFetchDate = fetchDate;
}
// 作業種別情報を取得
operationGroupMasterLogic.setOperationGroupMaster();
if (interrupt) { // この時点で停止要求が来た場合先には進まない。(ServiceOption/Group/Categoryの更新は1セットで行う(トランザクションはそれぞれ別))
Logger.d(TAG, "stop refresh worker before content update.");
......
......@@ -31,9 +31,12 @@ public class OperationDto extends AbstractDto {
public int enableReportHistory; // 0: 履歴無し, 1: 履歴可
public int enableReportEdit; // 作業編集可能区分
public int enableAddReport; // 作業追加区分
public int quickReport; // 簡易帳票区分
// 作業担当グループリスト
public List<TaskWorkerGroupDto> taskWorkerGroupDtoList;
// 作業種別に紐づく作業Dto
public List<OperationGroupMasterRelationDto> operationGroupMasterRelationDtoList;
public boolean equalsLastEdit(OperationDto dto) {
if (dto != null) {
......@@ -46,16 +49,17 @@ public class OperationDto extends AbstractDto {
@Override
public Object[] getInsertValues() {
return new Object[] { operationId, operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport };
return new Object[] { operationId, operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, quickReport };
}
@Override
public Object[] getUpdateValues() {
return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, operationId };
return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, quickReport, operationId };
}
@Override
public String[] getKeyValues() {
return new String[] { "" + operationId };
}
}
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.Map;
public class OnlineHTMLWebViewLogic extends AbstractLogic {
private static final String TAG = "OnlineHTMLWebViewLogic";
public byte[] getPostData(Map<String, String> param) {
String data = "sid=" + cache.getMemberInfo().sid;
for(Map.Entry<String, String> entry : param.entrySet()){
data += "&" + entry.getKey() + "=" + entry.getValue();
}
return data.getBytes();
}
}
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.acms.type.OperationSortingType;
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.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.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 level
* @param operationCountMap
*/
public void getAllOperationCount(int level, Map<Integer, Integer> operationCountMap) {
List<OperationGroupMasterDto> operationGroupMasterDtoList;
operationGroupMasterDtoList = mOperationGroupMasterDao.getOperationGroupMasterListBylevel(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(level, operationCountMap); // 再帰呼び出し
}
}
/**
* 最後の階層レベル取得
* @return
*/
public Integer getLastGroupLevel() {
return mOperationGroupMasterDao.getLastGroupLevel();
}
/**
* 親の階層パスをリストでセット
* @param operationGroupMasterId カテゴリID
* @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 カテゴリID
* @param operationSortingType ソートタイプ
* @return
*/
public List<OperationDto> getOperationByOperationGroupMasterId(Integer operationGroupMasterId, String reportTypeStr, OperationSortingType operationSortingType) {
return mOperationDao.getOperationsByGroupMasterId(operationGroupMasterId, reportTypeStr, operationSortingType);
}
}
......@@ -24,6 +24,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.SceneEntryJSON;
import jp.agentec.abook.abv.bl.acms.client.json.WorkerGroupJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetTaskFileParameters;
import jp.agentec.abook.abv.bl.acms.type.OperationSortingType;
import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Constant;
......@@ -40,6 +41,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.OperationContentDao;
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.TaskDao;
import jp.agentec.abook.abv.bl.data.dao.TaskReportDao;
......@@ -51,6 +53,7 @@ import jp.agentec.abook.abv.bl.dto.CategoryContentDto;
import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.OperationContentDto;
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.TaskDto;
import jp.agentec.abook.abv.bl.dto.TaskReportDto;
......@@ -78,6 +81,7 @@ public class OperationLogic extends AbstractLogic {
private TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class);
private TaskReportSendDao mTaskReportSendDao = AbstractDao.getDao(TaskReportSendDao.class);
private TaskReportItemsDao mTaskReportItemsDao = AbstractDao.getDao(TaskReportItemsDao.class);
private OperationGroupMasterOperationDao mOperationGroupMasterOperationDao = AbstractDao.getDao(OperationGroupMasterOperationDao.class);
private ContentLogic mContentLogic = AbstractLogic.getLogic(ContentLogic.class);
......@@ -139,6 +143,31 @@ public class OperationLogic extends AbstractLogic {
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);
// 更新することで登録フラグをfalseにセット
insertFlg = false;
......@@ -166,6 +195,11 @@ public class OperationLogic extends AbstractLogic {
for (OperationContentDto operationContentDto : serverOperationDto.operationContentDtoList) {
mOperationContentDao.insertOperationContent(operationContentDto);
}
// 作業種別・作業のリレーションテーブルにデータ登録
for (OperationGroupMasterRelationDto operationGroupMasterRelationDto : serverOperationDto.operationGroupMasterRelationDtoList) {
mOperationGroupMasterOperationDao.insertOperationGroupMasterOperation(operationGroupMasterRelationDto);
}
}
// 作業担当グループ登録
......
......@@ -234,5 +234,13 @@
android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.SppBluetoothPairingSettingActivity"
android:theme="@style/AppTheme"/>
<!-- @Form I/O帳票 -->
<activity
android:name="jp.agentec.abook.abv.ui.viewer.activity.OnlineHTMLWebViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
</activity>
</application>
</manifest>
\ No newline at end of file
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<stroke
android:width="1px"
android:color="#000000" />
<solid android:color="@color/bottom_toolbar"/>
</shape>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:state_enabled="false"
android:drawable="@drawable/home_common_content_icon_off"/>
<item
android:drawable="@drawable/home_common_content_icon_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_enabled="true" android:drawable="@drawable/ic_history_back_off" />
<item android:state_enabled="false" android:drawable="@drawable/ic_history_back_disable" />
</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_enabled="false"
android:drawable="@drawable/ic_batch_sync_off"/>
<item
android:drawable="@drawable/ic_batch_sync_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_enabled="false"
android:drawable="@drawable/home_icon_off"/>
<item
android:drawable="@drawable/home_icon_on"/>
</selector>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:drawable="@drawable/home_print_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:drawable="@drawable/home_print_white"/>
</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_enabled="false"
android:drawable="@drawable/ic_operation_search_off"/>
<item
android:drawable="@drawable/ic_operation_search_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_pressed="true"
android:drawable="@drawable/ic_show_list_off"/>
<item
android:drawable="@drawable/ic_show_list_on"/>
</selector>
\ No newline at end of file
......@@ -1432,4 +1432,12 @@
<string name="msg_no_nfc_setting">端末の設定からNFCを有効にする必要があります。\n端末の設定画面へ遷移しますか?</string>
<string name="select_spp_device_title">シリアル通信機器選択</string>
<string name="msg_bluetooth_connect_timeout_error">%1$sとの接続が切れました。%1$sの電源や距離を確認し、再度お試し下さい。(%2$s)</string>
<!-- カテゴリ選択機能 -->
<string name="no_child">これより下はありません。</string>
<string name="title_category">カテゴリ</string>
<string name="title_all_operation">全作業</string>
<string name="category_list">カテゴリ一覧</string>
<string name="title_quick_report_output">帳票確認</string>
</resources>
......@@ -1440,4 +1440,12 @@
<string name="msg_no_nfc_setting">단말기의 설정에서 NFC을 \n단말기의 설정화면으로 이동하시겠습니까?</string>
<string name="select_spp_device_title">시리얼 통신 기기 선택</string>
<string name="msg_bluetooth_connect_timeout_error">%1$s와의 연결이 끊겼습니다. %1$s의 전원과 거리를 확인하고 다시 시도해주세요.(%s)</string>
<!-- カテゴリ選択機能 -->
<string name="no_child">이 아래로는 데이터가 없습니다.</string>
<string name="title_category">분류</string>
<string name="title_all_operation">전체 작업</string>
<string name="category_list">분류 목록</string>
<string name="title_quick_report_output">장표 확인</string>
</resources>
\ No newline at end of file
......@@ -89,4 +89,5 @@
<color name="operation_related_content_new_mark">#ff0000</color>
<color name="operation_bg">#FFFFFF</color>
<color name="bottom_toolbar">#F2F2F2</color>
</resources>
\ No newline at end of file
......@@ -1439,4 +1439,11 @@
<string name="select_spp_device_title">シリアル通信機器選択</string>
<string name="msg_bluetooth_connect_timeout_error">%1$s with the central thermometer has been lost. Check the power and distance of %1$s and try again.(%2$s)</string>
<!-- カテゴリ選択機能 -->
<string name="no_child">No more data below.</string>
<string name="title_category">Category</string>
<string name="title_all_operation">All</string>
<string name="category_list">Select Category</string>
<string name="title_quick_report_output">Report confirmation</string>
</resources>
\ No newline at end of file
......@@ -31,6 +31,15 @@
android:onClick="onClickOperationFilterList"
android:src="@drawable/ic_filter" />
<ImageButton
android:id="@+id/btn_category_location"
style="@style/ToolBarIcon"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/icon_filter"
android:onClick="onClickGroupLocationByTablet"
android:src="@drawable/ic_category_off" />
<TextView
android:id="@+id/title"
style="@style/DialogToolBarTitle"
......@@ -43,69 +52,15 @@
android:textSize="15dp"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/search_result"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:layout_toLeftOf="@+id/btn_communication_menu"
android:background="@drawable/radius_frame"
android:gravity="center"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="5dp"
android:text="@string/search_result"
android:textColor="@color/app_color"
android:textSize="@dimen/app_normal_text_size"
android:textStyle="bold" />
</LinearLayout>
<ImageButton
android:id="@+id/btn_communication_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
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:background="@drawable/ic_operation_search"
android:contentDescription="@string/list" />
<ImageButton
android:id="@+id/btn_sub_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:layout_toLeftOf="@+id/btn_common_content"
android:background="@drawable/ic_operation_setting"
android:onClick="onClickOperationSubMenu" />
<ImageButton
android:id="@+id/btn_common_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:layout_toLeftOf="@+id/btn_help"
android:background="@drawable/ic_common_content_off" />
android:background="@drawable/btn_operation_search"
android:contentDescription="@string/list" />
<ImageButton
android:id="@+id/btn_help"
......@@ -117,11 +72,15 @@
android:background="@drawable/ic_operation_help"
android:onClick="onClickShowHelpView" />
</RelativeLayout>
<FrameLayout
android:id="@+id/operation_list_layout"
style="@style/operation_list_bg"
style="@style/content_list_bg"
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_weight="1"></FrameLayout>
<include layout="@layout/operation_common_toolbar" android:id="@+id/toolbar2"/>
</LinearLayout>
\ No newline at end of file
......@@ -4,12 +4,14 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:orientation="vertical"
android:background="@color/basic_white1"
android:clickable="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
......@@ -25,22 +27,6 @@
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center"
android:gravity="left|center" >
<ImageButton
android:id="@+id/btn_operation_home"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:background="@drawable/ic_operation_home"
android:contentDescription="@null" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center" >
......@@ -142,4 +128,6 @@
</LinearLayout>
<include layout="@layout/operation_common_toolbar" android:id="@+id/toolbar2"/>
</LinearLayout>
\ No newline at end of file
......@@ -31,6 +31,15 @@
android:onClick="onClickOperationFilterList"
android:src="@drawable/ic_filter" />
<ImageButton
android:id="@+id/btn_category_location"
style="@style/ToolBarIcon"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/icon_filter"
android:onClick="onClickGroupLocationByNormalSize"
android:src="@drawable/ic_category_off" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -52,13 +61,14 @@
</LinearLayout>
<ImageButton
android:id="@+id/btn_common_content"
android:id="@+id/btn_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:layout_centerInParent="true"
android:layout_toLeftOf="@+id/btn_help"
android:background="@drawable/ic_common_content_off" />
android:background="@drawable/btn_operation_search"
android:contentDescription="@string/list" />
<ImageButton
android:id="@+id/btn_help"
......@@ -72,73 +82,15 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/toolbar2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/operation_color"
android:minHeight="50dp"
android:visibility="visible">
<ImageButton
android:id="@+id/btn_communication_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:background="@drawable/ic_communication_menu" />
<LinearLayout
android:id="@+id/search_result"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:layout_toLeftOf="@+id/btn_search"
android:layout_marginRight="10dp"
android:background="@drawable/radius_frame"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="5dp"
android:text="@string/search_result"
android:textColor="@color/app_color"
android:textSize="@dimen/app_normal_text_size"
android:textStyle="bold" />
</LinearLayout>
<ImageButton
android:id="@+id/btn_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_centerInParent="true"
android:background="@drawable/ic_operation_search"
android:contentDescription="@string/list" />
<ImageButton
android:id="@+id/btn_sub_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:layout_alignParentRight="true"
android:background="@drawable/ic_operation_setting"
android:onClick="onClickOperationSubMenu" />
</RelativeLayout>
<FrameLayout
android:id="@+id/operation_list_layout"
style="@style/content_list_bg"
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_weight="1"></FrameLayout>
<include layout="@layout/operation_common_toolbar" android:id="@+id/toolbar2"/>
</LinearLayout>
\ No newline at end of file
......@@ -4,12 +4,14 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:orientation="vertical"
android:background="@color/basic_white1"
android:clickable="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
......@@ -25,22 +27,6 @@
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center"
android:gravity="left|center">
<ImageButton
android:id="@+id/btn_operation_home"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:background="@drawable/ic_operation_home"
android:contentDescription="@null" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center">
......@@ -136,4 +122,6 @@
</LinearLayout>
<include layout="@layout/operation_common_toolbar" android:id="@+id/toolbar2"/>
</LinearLayout>
\ No newline at end of file
......@@ -179,12 +179,24 @@
android:background="@drawable/ic_operation_task_list"
android:layout_marginRight="10dp"
android:visibility="gone" />
<ImageButton
android:id="@+id/btn_print"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_centerInParent="true"
android:layout_toLeftOf="@+id/btn_help"
android:background="@drawable/btn_operation_print_white"
android:scaleX="0.6"
android:scaleY="0.6"
android:visibility="gone" />
<ImageButton
android:id="@+id/btn_help"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_operation_help"
android:layout_marginTop="6dp"
android:layout_marginRight="10dp"
android:visibility="gone"
android:onClick="onClickShowHelpView"/>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/frameTopbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/app_color"
android:minHeight="50dp" >
<ImageButton
android:id="@+id/backBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignTop="@+id/linearLayout"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:background="@null"
android:src="@drawable/btn_history_back_for_webview" />
<Button
android:id="@+id/closeBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentLeft="false"
android:layout_alignParentStart="false"
android:layout_centerVertical="true"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:background="@drawable/btn_close"
android:contentDescription="@string/cont_desc"
android:layout_alignParentRight="true" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:id="@+id/linearLayout">
<TextView
android:id="@+id/title"
style="@style/DialogToolBarTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:textColor="@color/text_dialog"
android:textStyle="bold"
android:visibility="visible" />
</LinearLayout>
</RelativeLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical" >
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="0dp" android:layout_marginStart="0dp" />
<ProgressBar
android:id="@+id/refresh_prog"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:visibility="gone" />
</FrameLayout>
</LinearLayout>
\ 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_enabled="true" android:drawable="@drawable/ic_history_back_off" />
<item android:state_enabled="false" android:drawable="@drawable/ic_history_back_disable" />
</selector>
\ No newline at end of file
<?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"?>
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="center_vertical"
android:paddingLeft="6dip"
android:paddingRight="6dip"
android:textColor="@color/text_select"
android:text="@string/dummy_str"
/>
\ 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 @@
android:id="@+id/toolbar"
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
android:id="@+id/popup_title"
style="@style/DialogToolBarTitle"
......@@ -48,7 +57,7 @@
</LinearLayout>
<LinearLayout
android:id="@+id/left_item"
android:id="@+id/header_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/btn_layout"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/toolbar2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bottom_toolbar_border"
android:minHeight="50dp"
android:visibility="visible">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center">
<ImageButton
android:id="@+id/btn_operation_home"
style="@style/ToolBarIcon"
android:src="@drawable/btn_operation_home" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center">
<ImageButton
android:id="@+id/btn_common_content"
style="@style/ToolBarIcon"
android:src="@drawable/btn_common_content" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center">
<ImageButton
android:id="@+id/btn_communication_menu"
style="@style/ToolBarIcon"
android:layout_centerVertical="true"
android:src="@drawable/ic_communication_menu" />
</LinearLayout>
<LinearLayout
android:id="@+id/print_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center">
<ImageButton
android:id="@+id/btn_operation_print"
style="@style/ToolBarIcon"
android:layout_centerVertical="true"
android:scaleX="0.6"
android:scaleY="0.6"
android:src="@drawable/btn_operation_print" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center">
<ImageButton
android:id="@+id/btn_setting"
style="@style/ToolBarIcon"
android:layout_centerVertical="true"
android:src="@drawable/ic_operation_setting"
android:onClick="onClickSetting" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -72,4 +72,10 @@
<item></item>
<item>縦(反転)</item>
</string-array>
<string-array name="category_types">
<item>全て</item>
<item>カテゴリ</item>
</string-array>
</resources>
\ No newline at end of file
......@@ -74,4 +74,10 @@
<item>세로</item>
<item>세로(역방향)</item>
</string-array>
<string-array name="category_types">
<item>전체</item>
<item>분류</item>
</string-array>
</resources>
......@@ -112,4 +112,10 @@
<item>Report</item>
<item>Routine</item>
</string-array>
<string-array name="category_types">
<item>All</item>
<item>Category</item>
</string-array>
</resources>
\ No newline at end of file
......@@ -6,6 +6,7 @@ import jp.agentec.abook.abv.bl.common.Constant.DeviceType;
import jp.agentec.abook.abv.bl.common.Constant.ReportType;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.BluetoothPairingDeviceInfoDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto;
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.DefPrefKey;
......@@ -15,6 +16,7 @@ import jp.agentec.adf.util.StringUtil;
import android.content.Context;
import java.util.List;
import java.util.Stack;
public class ABVUIDataCache {
private static final String TAG = "ABVUIDataCache";
......@@ -53,7 +55,8 @@ public class ABVUIDataCache {
}
private void init() {
viewMode = loadViewMode();
viewMode = loadViewMode();
operationGroupMasterStack = new Stack<>();
}
public long saveLastUpdateTime() {
......@@ -264,4 +267,57 @@ public class ABVUIDataCache {
PreferenceUtil.removeUserPref(context, UserPrefKey.BLE_DEVICE_RADIATION_TEMPERATURE_ADDRESS);
}
}
// 作業種別絞り込み用のスタック
public Stack<OperationGroupMasterDto> operationGroupMasterStack;
/**
* 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);
}
/**
* ソート条件を取得
* @return ソートタイプ(デフォルト : 1(作業期間が新しい順))
*/
public int getSortCondition() {
return PreferenceUtil.getUserPref(context, UserPrefKey.OPERATION_SORT_CONDITION, 1);
}
/**
* xmlに作業種別IDをファイル書き込みする
* @param operationGroupMasterId
*/
public void setOperationGroupMasterId(int operationGroupMasterId) {
PreferenceUtil.putUserPref(context, UserPrefKey.OPERATION_GROUP_MASERT_ID, operationGroupMasterId);
}
/**
* 保持していた作業種別のデータをクリアする
*/
public void clearOperationGroupMaster() {
setOperationGroupMasterMode(AppDefType.OperationLocationType.ALL);
setOperationGroupMasterId(0);
operationGroupMasterStack.clear();
}
}
......@@ -122,6 +122,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected Button operationHomeButton;
protected ImageButton taskListButton;
protected ImageButton helpButton;
// 簡易帳票印刷ボタン
protected ImageButton printButton;
protected boolean isPageFinished;
protected Double latitude;
......
......@@ -25,6 +25,7 @@ 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.LogUtil;
import jp.agentec.abook.abv.ui.home.activity.ABookSettingActivity;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import android.content.DialogInterface;
import android.content.Intent;
......@@ -487,10 +488,12 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
}
// 設定画面表示
public void showSettingPopup() {
public void showSetting() {
Intent intent = new Intent();
intent.setClassName(getApplicationContext().getPackageName(), ABookSettingActivity.class.getName());
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
// 設定画面の前のActivityを保存する(設定画面から戻る用)
ActivityHandlingHelper.getInstance().setPreviousOfSettingActivity(this);
startActivity(intent);
// ※ 設定画面からログアウトした場合、このActivityも残らないようにfinishして遷移する
finish();
......
......@@ -11,6 +11,12 @@ public interface AppDefType {
int PANEL = 0;
int LIST = 1;
}
// 作業種別モードフラグ
interface OperationLocationType {
int ALL = 0;
int CATEGORY = 1;
}
interface DefPrefKey {
String REPEATABLE_PLAY = "repeatablePlay";
......@@ -66,6 +72,10 @@ public interface AppDefType {
String BLE_DEVICE_RADIATION_TEMPERATURE_ADDRESS = "bleDeviceRadiationTemperatureAddress"; // 放射温度計機器のアドレス
String MASTER_DATA_FETCH_DATE = "masterDataFetchDate"; // マスタデータのFetchDate
String OPERATION_GROUP_MASERT_MODE = "operation_group_master"; // 通常・作業種別モード(画面)
String OPERATION_GROUP_MASERT_ID = "operation_group_master_id"; // 作業種別のID
String OPERATION_SORT_CONDITION = "operation_sort_condition"; // 作業のソート
}
/**
......
......@@ -103,22 +103,6 @@ public class ABVListDialog extends Dialog {
getListView().setOnItemLongClickListener(listener);
}
public void setLeftItemOnClickListener(String itemName, View.OnClickListener l) {
// Button itemButton = (Button) mRoot.findViewById(R.id.popup_title_left);
// if (itemButton != null) {
// itemButton.setVisibility(View.VISIBLE);
// itemButton.setText(itemName);
// itemButton.setOnClickListener(l);
// } else {
// 携帯の場合
LinearLayout linearLayout = (LinearLayout) mRoot.findViewById(R.id.left_item);
linearLayout.setOnClickListener(l);
linearLayout.setVisibility(View.VISIBLE);
TextView textView = (TextView) mRoot.findViewById(R.id.header_title);
String suffixText = getContext().getResources().getString(R.string.to_back);
textView.setText(String.format(suffixText, itemName));
// }
}
public void setRightItemOnClickListener(int resId, View.OnClickListener l) {
ImageButton itemButton = (ImageButton) mRoot.findViewById(R.id.popup_right_image);
if (itemButton != null) {
......@@ -228,4 +212,27 @@ public class ABVListDialog extends Dialog {
}
}
}
public void setHeaderItemOnClickListener(String itemName, View.OnClickListener l) {
// 携帯の場合
LinearLayout linearLayout = (LinearLayout) mRoot.findViewById(R.id.header_item);
linearLayout.setOnClickListener(l);
linearLayout.setVisibility(View.VISIBLE);
TextView textView = (TextView) mRoot.findViewById(R.id.header_title);
String suffixText = getContext().getResources().getString(R.string.to_back);
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);
}
}
}
......@@ -14,9 +14,13 @@ import java.io.InputStream;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.download.ContentFileExtractor;
import jp.agentec.abook.abv.launcher.android.ABVApplication;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.viewer.activity.ParentWebViewActivity;
import jp.agentec.adf.util.FileUtil;
public class ABookSettingActivity extends PreferenceActivity {
......@@ -73,7 +77,29 @@ public class ABookSettingActivity extends PreferenceActivity {
// ホーム画面へ戻る処理
private void backToHome() {
Intent intent = new Intent(getApplicationContext(), OperationListActivity.class);
ABVUIActivity activity = ActivityHandlingHelper.getInstance().getPreviousOfSettingActivity();
// Chat
ParentWebViewActivity chatActity = null;
Intent intent = null;
if (activity == null) {
chatActity = ActivityHandlingHelper.getInstance().getPreviousForChatOfSettingActivity();
intent = new Intent(this, (chatActity != null ? chatActity.getClass() : OperationListActivity.class));
//noinspection VariableNotUsedInsideIf
if (chatActity != null) {
intent.putExtra("chatWebviewUrl", ABVEnvironment.getInstance().acmsAddress + ABVDataCache.getInstance().getUrlPath() + "/chatapi/chat/");
String sid = ABVDataCache.getInstance().getMemberInfo().sid;
intent.putExtra("sid", sid);
String loginId = ABVDataCache.getInstance().getMemberInfo().loginId;
String shopName = ABVDataCache.getInstance().getUrlPath();
intent.putExtra("loginId", loginId);
intent.putExtra("shopName", shopName);
}
}
if (chatActity == null) {
intent = new Intent(this, (activity != null ? activity.getClass() : OperationListActivity.class));
}
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
......
package jp.agentec.abook.abv.ui.home.activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.view.View;
import android.view.Window;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import java.util.List;
import jp.agentec.abook.abv.bl.acms.type.AcmsApis;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
import jp.agentec.abook.abv.ui.common.constant.NaviConsts;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.viewer.activity.OnlineHTMLWebViewActivity;
public class OperationActivity extends ABVUIActivity {
private static final String TAG = "OperationActivity";
protected ImageButton mOperationHomeButton; // ホームボタン
protected ImageButton mCommonContentButton; // 関連資料
protected ImageButton mCommunicationButton; // コミュニケーション
protected ImageButton mQuickReportPrintButton; // 簡易帳票印刷ボタン
private PushMessageLogic mPushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class);
private Dialog mCommunicationMenuDialog;
protected void createCommonToolber() {
// ホームボタン
mOperationHomeButton = (ImageButton) findViewById(R.id.btn_operation_home);
// 共通資料
mCommonContentButton = (ImageButton) findViewById(R.id.btn_common_content);
mCommonContentButton.setEnabled(true);
mCommonContentButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showCommonContent();
}
});
// コミュニケーション
mCommunicationButton = (ImageButton) findViewById(R.id.btn_communication_menu);
List<PushMessageDto> pushMessageDtoList = mPushMessageLogic.getAllPushMessageList();
boolean existUnreadFlg = false;
for (PushMessageDto pushMessageDto : pushMessageDtoList) {
if (!pushMessageDto.readingFlg) {
existUnreadFlg = true;
break;
}
}
if (existUnreadFlg) {
mCommunicationButton.setImageDrawable(getRDrawable(R.drawable.ic_communication_menu_with_badge));
} else {
mCommunicationButton.setImageDrawable(getRDrawable(R.drawable.ic_communication_menu));
}
mCommunicationButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showCommunicationMenuDialog();
}
});
// 簡易帳票印刷ボタン
mQuickReportPrintButton = (ImageButton) findViewById(R.id.btn_operation_print);
if (ABVDataCache.getInstance().serviceOption.isUnableIOReport()) {
mQuickReportPrintButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showPrintTargetSelect();
}
});
mQuickReportPrintButton.setVisibility(View.VISIBLE);
} else {
findViewById(R.id.print_layout).setVisibility(View.GONE);
mQuickReportPrintButton.setVisibility(View.GONE);
}
}
// 共通資料画面表示
private void showCommonContent() {
Intent intent = new Intent();
intent.setClass(OperationActivity.this, OperationRelatedContentActivity.class);
startActivity(intent);
}
/**
* コミュニケーションダイアログの表示
*/
private void showCommunicationMenuDialog() {
mCommunicationMenuDialog = new Dialog(OperationActivity.this);
mCommunicationMenuDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
mCommunicationMenuDialog.setCanceledOnTouchOutside(false);
mCommunicationMenuDialog.setContentView(R.layout.communication_menu_dialog);
List<PushMessageDto> pushMessageDtoList = mPushMessageLogic.getAllPushMessageList();
LinearLayout ll_menuItem_meeting = (LinearLayout)mCommunicationMenuDialog.findViewById(R.id.ll_item_meeting);
ll_menuItem_meeting.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ActivityHandlingHelper.getInstance().startMeetingActivity();
mCommunicationMenuDialog.dismiss();
}
});
mCommunicationMenuDialog.findViewById(R.id.close_btn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mCommunicationMenuDialog.dismiss();
}
});
mCommunicationMenuDialog.show();
}
// 設定画面へ遷移
public void onClickSetting(View v) {
showSetting();
}
/**
* インターネットが繋がってない場合のダイアログ表示
*/
protected void showDisConnectNetworkDialog() {
handler.post(new Runnable() {
@Override
public void run() {
// ヘッダーの新着更新処理を完了にさせる
stopUpdateAnimation();
final ABookAlertDialog messageDialog = AlertDialogUtil.createAlertDialog(OperationActivity.this, R.string.app_name);
messageDialog.setMessage(getString(R.string.msg_network_offline));
messageDialog.setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
messageDialog.dismiss();
}
});
messageDialog.show();
}
});
}
/**
* 簡易帳票印刷対象選択画面表示
*/
protected void showPrintTargetSelect() {
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
showDisConnectNetworkDialog();
return;
}
Intent intent = new Intent();
intent.setClass(OperationActivity.this, OnlineHTMLWebViewActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra("LINKURL", AcmsApis.getApiUrl(ABVEnvironment.getInstance().acmsAddress, ABVDataCache.getInstance().getUrlPath(), AcmsApis.ApiQuickReportSearch));
startActivity(intent, NaviConsts.Right);
}
}
......@@ -28,7 +28,6 @@ import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.bl.websocket.MeetingManager;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
......@@ -44,12 +43,11 @@ import jp.agentec.adf.util.StringUtil;
* Created by kim, changgyun on 2018/09/10.
*/
public class OperationRelatedContentActivity extends ABVUIActivity {
public class OperationRelatedContentActivity extends OperationActivity {
private static final String TAG = "OperationRelatedContentActivity";
private OperationRelatedContentSectionAdapter mOperationRelatedContentSectionAdapter;
private ImageButton mOperationHomeButton;
private ImageView mRefreshButton;
private ImageButton mOperationHelpButton;
......@@ -69,7 +67,6 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.ac_operation_related_content);
mOperationHomeButton = (ImageButton) findViewById(R.id.btn_operation_home);
mOperationHelpButton = (ImageButton) findViewById(R.id.btn_operation_help);
mTxtOperationName = (TextView) findViewById(R.id.txt_operation_name);
......@@ -77,6 +74,11 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
mContentListView = (ListView) findViewById(R.id.lv_content_list);
// 画面下ツールバー
createCommonToolber();
// 共通資料ボタン(非活性化)
mCommonContentButton.setEnabled(false);
Intent i = getIntent();
operationId = i.getLongExtra(ABookKeys.OPERATION_ID, 0);
operationName = i.getStringExtra(ABookKeys.OPERATION_NAME);
......
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;
}
}
......@@ -116,7 +116,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
public View getView(int position, View convertView, final ViewGroup parent) {
ViewHolder holder = null;
Logger.i(TAG, "OperationRelatedContentPanelAdapter getView ......");
Logger.d(TAG, "OperationRelatedContentPanelAdapter getView ......");
if (null == convertView) {
holder = new ViewHolder();
......@@ -190,7 +190,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
public void configureOperationButton(final ViewHolder holder, final ContentDto contentDto) {
Logger.i(TAG, "configureOperationButton ......");
Logger.d(TAG, "configureOperationButton ......");
holder.tvNewContentMark.setVisibility(View.GONE);
holder.operationLayout.setVisibility(View.VISIBLE);
......@@ -205,18 +205,18 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
setNewRibbon(holder, contentDto);
if (contentDto.downloadingFlg && !contentDto.isDownloadPaused()) {
Logger.i(TAG, "isPauseDownloading ......");
Logger.d(TAG, "isPauseDownloading ......");
// ダウンロード中
holder.btnPauseSave.setVisibility(View.VISIBLE);
holder.btnPauseSave.setOnClickListener(new OnDownloadPauseButtonClickListener(contentDto));
} else if (!contentDto.downloadedFlg && !contentDto.isDownloadPaused() ) {
Logger.i(TAG, "isDownloadable ......");
Logger.d(TAG, "isDownloadable ......");
holder.btnSaveContent.setVisibility(View.VISIBLE);
holder.btnSaveContent.setOnClickListener(new OnDownloadButtonClickListener(contentDto));
} else if (contentDto.downloadedFlg && contentDto.updatedFlg && !contentDto.isDownloadPaused() ) {
Logger.i(TAG, "isOpenable & isDeletable & isUpdatable......");
Logger.d(TAG, "isOpenable & isDeletable & isUpdatable......");
holder.btnOpenContent.setVisibility(View.VISIBLE);
holder.btnOpenContent.setOnClickListener(new View.OnClickListener() {
@Override
......@@ -237,7 +237,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
holder.btnUpdateContent.setOnClickListener(new OnDownloadButtonClickListener(contentDto));
} else if (contentDto.downloadedFlg && !contentDto.updatedFlg) {
Logger.i(TAG, "isOpenable & isDeletable......");
Logger.d(TAG, "isOpenable & isDeletable......");
holder.btnOpenContent.setVisibility(View.VISIBLE);
holder.btnOpenContent.setOnClickListener(new View.OnClickListener() {
@Override
......@@ -256,7 +256,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
}else if (contentDto.isDownloadPaused()) {
// ダウンロード一時停止中
Logger.i(TAG, "isDownloadPaused & isCancelable......");
Logger.d(TAG, "isDownloadPaused & isCancelable......");
holder.btnRestartSave.setVisibility(View.VISIBLE);
holder.btnRestartSave.setOnClickListener(new OnDownloadResumeButtonClickListener(contentDto));
......@@ -284,7 +284,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
}
public void updateDownloadView(ContentDto contentDto) {
Logger.i(TAG, "updateDownloadView ......");
Logger.d(TAG, "updateDownloadView ......");
ViewHolder holder = viewHolderMap.get(contentDto.contentId);
if (holder != null && holder.contentId == contentDto.contentId) {
createDownloadView(holder, contentDto);
......@@ -301,7 +301,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
* @param contentDto
*/
private void createDownloadView(ViewHolder holder, final ContentDto contentDto) {
Logger.i(TAG, "createDownloadView ......");
Logger.d(TAG, "createDownloadView ......");
ProgressBar downloadProgressBar = holder.downloadProgressBar;
ImageView thumbnail = holder.ivThumbnail;
......@@ -347,7 +347,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
AsyncTask<Params, Void, Result> task = new AsyncTask<Params, Void, Result>() {
@Override
protected Result doInBackground(Params... params) {
Logger.i(TAG, "onContentDownload start ......");
Logger.d(TAG, "onContentDownload start ......");
Result result = new Result();
result.result = mListener.onContentDownload(params[0].contentId);
return result;
......@@ -355,7 +355,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
@Override
protected void onPostExecute(Result result) {
Logger.i(TAG, "onContentDownload after ......");
Logger.d(TAG, "onContentDownload after ......");
if (!result.result) {
contentDto.downloadingFlg = false;
}
......@@ -379,7 +379,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
AsyncTask<Params, Void, Void> task = new AsyncTask<Params, Void, Void>() {
@Override
protected Void doInBackground(Params... params) {
Logger.i(TAG, "onContentDownloadPause start ......");
Logger.d(TAG, "onContentDownloadPause start ......");
mListener.onContentDownloadPause(contentDto);
return null;
}
......@@ -405,7 +405,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
AsyncTask<Params, Void, Void> task = new AsyncTask<Params, Void, Void>() {
@Override
protected Void doInBackground(Params... params) {
Logger.i(TAG, "onContentDownloadResume start ......");
Logger.d(TAG, "onContentDownloadResume start ......");
mListener.onContentDownloadResume(contentDto);
return null;
}
......
......@@ -61,6 +61,7 @@ import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVActivity;
import jp.agentec.abook.abv.ui.common.activity.ABVAuthenticatedActivity;
import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity;
import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
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.UserPrefKey;
......@@ -119,6 +120,11 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
protected ContentRefresher contentRefresher = ContentRefresher.getInstance();
// 設定画面の前に表示していたActivity
private ABVUIActivity previousOfSettingActivity;
// Chat
private ParentWebViewActivity previousOfSettingActivity2;
private ActivityHandlingHelper() {
}
......@@ -1696,4 +1702,38 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
}
return context;
}
/**
* 設定画面から戻る用
* @return 設定画面へ遷移前の画面
*/
public ABVUIActivity getPreviousOfSettingActivity() {
return previousOfSettingActivity;
}
/**
* 設定画面遷移前に設定
* @param activity
*/
public void setPreviousOfSettingActivity(ABVUIActivity activity) {
this.previousOfSettingActivity2 = null;
this.previousOfSettingActivity = activity;
}
/**
* 設定画面から戻る用
* @return 設定画面へ遷移前の画面
*/
public ParentWebViewActivity getPreviousForChatOfSettingActivity() {
return previousOfSettingActivity2;
}
/**
* 設定画面遷移前に設定
* @param activity
*/
public void setPreviousOfSettingActivity(ParentWebViewActivity activity) {
this.previousOfSettingActivity = null;
this.previousOfSettingActivity2 = activity;
}
}
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 CategoryOperationListHelper<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 CategoryOperationListHelper(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);
}
});
// パンくずのスクロールを作成
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);
}
}
// 親クラス OperationListHelperのgetOperationView()をコールする
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.acms.type.OperationSortingType;
import jp.agentec.abook.abv.bl.dto.OperationDto;
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 {
// 報告 or 定期点検
String reportTypeStr = getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null);
return operationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, reportTypeStr);
}
}
\ No newline at end of file
package jp.agentec.abook.abv.ui.home.helper;
import java.util.List;
import jp.agentec.abook.abv.bl.acms.type.OperationSortingType;
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 CategoryOperationListHelper<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 {
// クリアフラグがfalseの場合
if (ABVEnvironment.getInstance().getOperationGroupMasterClearFlg()) {
// 表示する作業種別が既に削除された場合、最上位階層に戻る(リセット)
popList(breadCrumbList.size() - 1, false);
// クリアフラグをfalseにセット
ABVEnvironment.getInstance().setOperationGroupMasterClearFlg(false);
// 作業種別の選択画面を閉じる
mAppActivity.closeOperationGroupMasterDialog();
}
OperationGroupMasterDto peekOperationGroupMasterDto = stack.peek();
// ソート方向
int operationSortType = mAppActivity.getSortCondition();
OperationSortingType operationSortingType = OperationSortingType.parse(operationSortType);
// 報告 or 定期点検
String reportTypeStr = getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null);
return mOperationGroupMasterLogic.getOperationByOperationGroupMasterId(peekOperationGroupMasterDto.operationGroupMasterId, reportTypeStr, operationSortingType);
}
/**
* 親階層へ移動処理
* @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;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.ListView;
import android.widget.Toast;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
import com.handmark.pulltorefresh.library.PullToRefreshGridView;
......@@ -15,6 +12,7 @@ import java.util.ArrayList;
import java.util.Date;
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.dto.OperationDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
......@@ -25,7 +23,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.constant.ErrorCode;
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.home.activity.OperationListActivity;
import jp.agentec.abook.abv.ui.home.adapter.AbstractOperationAdapter;
......@@ -42,13 +39,13 @@ import static jp.agentec.abook.abv.cl.util.PreferenceUtil.getUserPref;
* Created by leej on 2019/03/06.
*/
public class OperationListHelper {
public abstract class OperationListHelper {
private static final String TAG = "OperationListHelper";
private OperationListActivity mAppActivity;
protected OperationListActivity mAppActivity;
private AbstractOperationAdapter mAdapter;
private PullToRefreshListView mPullToRefreshListView;
private PullToRefreshGridView mPullToRefreshGridView;
private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class);
protected OperationLogic operationLogic = AbstractLogic.getLogic(OperationLogic.class);
private List<OperationDto> operationDtoList = new ArrayList<>();
// スマートフォンの1行のパンネル数
......@@ -67,8 +64,8 @@ public class OperationListHelper {
private List<OperationDto> filterOperationList() {
try {
String reportTypeStr = getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null);
operationDtoList = mOperationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, reportTypeStr);
operationDtoList = findOperationList();
for (OperationDto operationDto : operationDtoList) {
// 該当する作業の最後に同期した日付を取得
......@@ -77,7 +74,7 @@ public class OperationListHelper {
if (!StringUtil.isNullOrEmpty(syncedDateStr)) {
syncedDate = DateTimeUtil.toDate(syncedDateStr, DateTimeFormat.yyyyMMddHHmmss_slash);
}
mOperationLogic.updateOperationNeedSyncFlg(operationDto, syncedDate);
operationLogic.updateOperationNeedSyncFlg(operationDto, syncedDate);
}
} catch (Exception e) {
Logger.e(TAG, "findOperationList", e);
......@@ -275,4 +272,14 @@ public class OperationListHelper {
public List<OperationDto> getOperationList() {
return operationDtoList;
}
/**
* 作業を検索してListを返す
*
* @return
* @throws Exception
* @throws NetworkDisconnectedException
*/
abstract protected List<OperationDto> findOperationList() throws Exception;
}
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;
}
package jp.agentec.abook.abv.ui.viewer.activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
......@@ -37,17 +38,21 @@ import java.util.ArrayList;
import java.util.Date;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.AcmsApis;
import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
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.ContentDao;
import jp.agentec.abook.abv.bl.data.dao.OperationDao;
import jp.agentec.abook.abv.bl.download.ContentDownloader;
import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification;
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.ContractLogic;
import jp.agentec.abook.abv.cl.util.ContentLogUtil;
......@@ -58,7 +63,10 @@ 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.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
import jp.agentec.abook.abv.ui.common.constant.NaviConsts;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
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.view.ABVPopupListWindow;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.viewer.view.CheckFormWebview;
......@@ -68,6 +76,7 @@ import jp.agentec.abook.abv.ui.viewer.view.CheckFormXWalkWebview;
public class HTMLWebViewActivity extends ParentWebViewActivity {
private static final String TAG = "HTMLWebViewActivity";
/**
* Called when the activity is first created.
*/
......@@ -153,6 +162,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
boolean isFromHomeMenu = intent.getIntExtra("pageNumber", -1) == -1;
if (isFromHomeMenu) {
// ホームメニューから遷移してきた場合は、closeボタンをホームボタンに差替え
closeButton.setBackgroundResource(R.drawable.btn_home);
historyListBtn.setOnClickListener(new OnClickListener() {
@Override
......@@ -369,6 +379,15 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
}
});
// 簡易帳票印刷ボタン
printButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Logger.d(TAG, "Print");
showPrintTargetSelect();
}
});
downloadButton = (ImageButton) findViewById(R.id.btn_download);
downloadButton.setOnClickListener(new View.OnClickListener() {
@Override
......@@ -713,4 +732,37 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
}
mUploadMessage = null;
}
// 簡易帳票印刷対象選択画面表示
private void showPrintTargetSelect() {
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
showDisConnectNetworkDialog();
return;
}
Intent intent = new Intent();
intent.setClass(HTMLWebViewActivity.this, OnlineHTMLWebViewActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra("LINKURL", AcmsApis.getApiUrl(ABVEnvironment.getInstance().acmsAddress, ABVDataCache.getInstance().getUrlPath(), AcmsApis.ApiQuickReportRevision));
intent.putExtra("operationId", mOperationId);
startActivity(intent, NaviConsts.Right);
}
/**
* インターネットが繋がってない場合のダイアログ表示
*/
private void showDisConnectNetworkDialog() {
handler.post(new Runnable() {
@Override
public void run() {
final ABookAlertDialog messageDialog = AlertDialogUtil.createAlertDialog(HTMLWebViewActivity.this, R.string.app_name);
messageDialog.setMessage(getString(R.string.msg_network_offline));
messageDialog.setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
messageDialog.dismiss();
}
});
messageDialog.show();
}
});
}
}
package jp.agentec.abook.abv.ui.viewer.activity;
import android.app.DownloadManager;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.view.Window;
import android.webkit.CookieManager;
import android.webkit.DownloadListener;
import android.webkit.URLUtil;
import android.webkit.WebBackForwardList;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
import java.util.HashMap;
import java.util.Map;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OnlineHTMLWebViewLogic;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity;
/**
* Created by ogawa-y on 2020/06/22.
*/
public class OnlineHTMLWebViewActivity extends ABVContentViewActivity {
private static final String TAG = "OnlineHTMLWebView";
private WebView webView;
private Button closeButton;
private ImageButton backButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
Logger.i(TAG, "onCreate");
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE); // タイトルバー非表示
setContentView(R.layout.ac_online_html_webview);
TextView title = findViewById(R.id.title);
title.setText(R.string.title_quick_report_output);
setWebView();
// 引継ぎパラメータ
Intent intent = getIntent();
final String url = intent.getStringExtra("LINKURL"); // LinkURL
final Long operaitonId = intent.getLongExtra("operationId", -1);
Map<String, String> param = new HashMap<>();
if (operaitonId != -1) {
param.put("operationId", operaitonId.toString());
}
Logger.d(TAG,"LINKURL=" + url);
OnlineHTMLWebViewLogic logic = AbstractLogic.getLogic(OnlineHTMLWebViewLogic.class);
webView.postUrl(url, logic.getPostData(param));
// ***** 閉じるボタン
closeButton = findViewById(R.id.closeBtn);
closeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finishActivity();
}
});
// ***** 戻るボタン
backButton = findViewById(R.id.backBtn);
backButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// PDFダウンロードの場合はスキップする
WebBackForwardList bfList = webView.copyBackForwardList();
for (int i = 0, len = bfList.getCurrentIndex(); i < len; i++) {
String url = bfList.getItemAtIndex(len - i).getUrl();
if (url.contains("fileSelect")) {
continue;
}
if (webView.canGoBackOrForward(-1 * (i + 1))) {
webView.goBackOrForward(-1 * (i + 1));
break;
}
}
}
});
}
private void setWebView() {
webView = findViewById(R.id.webView);
webView.setVisibility(View.VISIBLE);
webView.setVerticalScrollbarOverlay(true); // スクロールバー部分の隙間を消す
if (Logger.isDebugEnabled()) {
webView.setWebContentsDebuggingEnabled(true); //デバッグモード(chromeからinspect可)
}
// //ブラウザの描画領域を対象としたイベントをフック
WebSettings settings = webView.getSettings();
settings.setSupportMultipleWindows(true); // 新しいウィンドウを開くイベントを取得する
settings.setLoadsImagesAutomatically(true); // イメージを自動的にロードする
settings.setBuiltInZoomControls(true); // ズーム機能を有効にする
settings.setSupportZoom(true); // ズーム機能を有効にする
settings.setJavaScriptEnabled(true); // JavaScriptを有効にする
settings.setLoadWithOverviewMode(true); // 画面の横幅にページの横幅を合わせる
settings.setUseWideViewPort(true); // 画面の横幅にページの横幅を合わせる
settings.setPluginState(WebSettings.PluginState.ON); // 「EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up.」のエラー対応(あまり効果ない?)
settings.setDomStorageEnabled(true); // WebStorage有効化
settings.setAppCacheEnabled(false);
settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
settings.setAllowFileAccessFromFileURLs(true); //Android7利用で警告ダイヤログ表示問題対応
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Logger.v(TAG, "shouldOverrideUrlLoading: %s", url);
return false;
}
@Override
public void onPageFinished(WebView view, String url) {
// ***** 戻るボタンの活性制御
backButton.setEnabled(webView.canGoBack());
super.onPageFinished(view, url);
}
});
webView.setDownloadListener(new DownloadListener() {
@Override
public void onDownloadStart(String url, String userAgent,
String contentDisposition, String mimetype,
long contentLength) {
DownloadManager.Request request = new DownloadManager.Request(
Uri.parse(url));
final String fileName = URLUtil.guessFileName(url, contentDisposition, mimetype);
request.setMimeType(mimetype);
//------------------------COOKIE!!------------------------
String cookies = CookieManager.getInstance().getCookie(url);
request.addRequestHeader("cookie", cookies);
//------------------------COOKIE!!------------------------
request.addRequestHeader("User-Agent", userAgent);
request.setTitle(fileName);
request.allowScanningByMediaScanner();
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); //Notify client once download is completed!
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, fileName);
DownloadManager dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
if (dm != null) {
dm.enqueue(request);
}
Toast.makeText(getApplicationContext(), getString(R.string.download_start), //To notify the Client that the file is being downloaded
Toast.LENGTH_LONG).show();
}
});
}
@Override
protected void finishActivity() {
setResult(RESULT_OK, new Intent());
finish();
}
}
......@@ -24,9 +24,12 @@ import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
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.ContentDao;
import jp.agentec.abook.abv.bl.data.dao.OperationDao;
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.ContentObjectLogLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
......@@ -82,6 +85,7 @@ public class ParentWebViewActivity extends ABVCheckContentViewActivity {
btnWebBack = (Button) findViewById(R.id.btnWebBack);
btnWebForward = (Button) findViewById(R.id.btnWebForward);
m_progress = (ProgressBar) findViewById(R.id.refresh_prog);
printButton = (ImageButton) findViewById(R.id.btn_print);
btnLinkOriginalBack = (Button) findViewById(R.id.btn_link_original_back);
......@@ -129,13 +133,30 @@ public class ParentWebViewActivity extends ABVCheckContentViewActivity {
setVisbilityProgress(false);
}
}
private OperationDao mOperationDao = AbstractDao.getDao(OperationDao.class);
/**
* 簡易帳票印刷ボタン活性制御
* 簡易帳票区分が1のデータが存在する場合表示、それ以外非表示
*/
private void printButtonActivityControl() {
OperationDto operation = mOperationDao.getOperation(mOperationId);
if (operation != null && operation.quickReport == 1 && ABVDataCache.getInstance().serviceOption.isUnableIOReport()) {
printButton.setVisibility(View.VISIBLE);
} else {
printButton.setVisibility(View.GONE);
}
}
@Override
protected void commonConfigureHeader() {
if (mStatusCode == Constant.XWalkWebViewDisplayStatus.InitView) { //フォームが非表示時のみヘルプボタン表示
if (mStatusCode == Constant.XWalkWebViewDisplayStatus.InitView) {
helpButton.setVisibility(View.VISIBLE);
printButtonActivityControl();
} else {
// ヘルプボタンを表示しない時、IO帳票ボタンも表示しない。
helpButton.setVisibility(View.INVISIBLE);
printButton.setVisibility(View.INVISIBLE);
}
if (Constant.XWalkWebViewDisplayStatus.TaskView == mStatusCode) {
......@@ -166,6 +187,7 @@ public class ParentWebViewActivity extends ABVCheckContentViewActivity {
if (mXWalkOpenType == Constant.XWalkOpenType.DEFAULT) {
helpButton.setVisibility(View.GONE);
printButton.setVisibility(View.GONE);
operationHomeButton.setVisibility(View.GONE);
addSceneButton.setVisibility(View.GONE);
taskListButton.setVisibility(View.GONE);
......@@ -175,6 +197,7 @@ public class ParentWebViewActivity extends ABVCheckContentViewActivity {
helpButton.setVisibility(View.INVISIBLE);
} else {
helpButton.setVisibility(View.VISIBLE);
printButtonActivityControl();
}
operationHomeButton.setVisibility(View.VISIBLE);
......
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