Commit 4bd6e259 by Lee Munkyeong

Merge branch 'features/1.4.0_lmk' into 'features/1.4.0'

Features/1.4.0 lmk

See merge request !185
parents 5b2988de 8541bbcf
[submodule "ABookCommunication_WebView"]
path = ABVJE_Launcher_Android/assets/chat
url = git@gitlab.agentec.jp:abookCommunication/chat_webview.git
[submodule "design"]
path = design
url = git@gitlab.agentec.jp:abookCheck/design.git
[submodule "ABVJE_Launcher_Android/assets/check"]
path = ABVJE_Launcher_Android/assets/check
url = https://gitlab.agentec.jp/abookCheck/design.git
......@@ -61,6 +61,8 @@ public class OperationListJSON extends AcmsCommonJSON {
public static final String OperationGroupMasterIdList = "operationGroupMasterIdList";
public static final String QuickReport = "quickReport";
public static final String PermitCode = "permitCode";
public static final String PermitCodeRequiredFlg = "permitCodeRequiredFlg";
public List<OperationDto> operationList;
......@@ -92,6 +94,8 @@ public class OperationListJSON extends AcmsCommonJSON {
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;
dto.permitCode = operationJson.has(PermitCode) ? operationJson.getString(PermitCode) : "";
dto.permitCodeRequiredFlg = operationJson.has(PermitCodeRequiredFlg) ? operationJson.getInt(PermitCodeRequiredFlg) : 0;
// 作業終了更新日
if (operationJson.has(OperationLastEditDate)) {
......
......@@ -15,6 +15,41 @@ public class ABookKeys {
public static final String OPERATION_ID = "operationId";
public static final String OPERATION_NAME = "operationName";
public static final String OPERATION_LIST = "operationList";
public static final String OPERATION_DESCRIPTIONS = "operationDescriptions";
public static final String OPERATION_TYPE = "operationType";
public static final String OPERATION_START_DATE = "operationStartDate";
public static final String OPERATION_END_DATE = "operationEndDate";
public static final String LAST_EDIT_DATE = "lastEditDate";
public static final String NEED_SYNC_FLG = "needSyncFlg";
public static final String REPORT_TYPE = "reportType";
public static final String ENABLE_REPORT_HISTORY = "enableReportHistory";
public static final String ENABLE_ADD_REPORT = "enableAddReport";
public static final String QUICK_REPORT = "quickReport";
public static final String PERMIT_CODE_REQUIRED_FLG = "permitCodeRequiredFlg";
public static final String PERMIT_CODE = "permitCode";
public static final String OPERATION_GROUPMASTER_LIST = "operationGroupMasterList";
public static final String OPERATION_GROUPMASTER_ID = "operationGroupMasterId";
public static final String OPERATION_GROUPMASTER_NAME = "operationGroupMasterName";
public static final String OPERATION_GROUPMASTER_LEVEL = "operationGroupMasterLevel";
public static final String OPERATION_GROUPMASTER_PARENTID = "parentOperationGroupMasterId";
public static final String OPERATION_GROUPMASTER_TREEPATH = "treePath";
public static final String OPERATION_GROUPMASTER_COUNTOPERATION = "countOperation";
public static final String OPERATION_GROUPMASTER_RELATION_LIST = "operationGroupMasterRelationList";
public static final String OPERATION_GROUPMASTER_RELATION_MASTERID = "operationGroupMasterId";
public static final String OPERATION_GROUPMASTER_RELATION_OPERATIONID = "operationId";
public static final String OPERATION_PUSHMESSAGE_LIST = "pushMessageList";
public static final String OPERATION_PUSHMESSAGEID = "pushMessageId";
public static final String OPERATION_OPERATIONID = "operationId";
public static final String OPERATION_OPERATIONNAME = "operationName";
public static final String OPERATION_PUSHSENDLOGINID = "pushSendLoginId";
public static final String OPERATION_PUSHSENDDATE = "pushSendDate";
public static final String OPERATION_PUSHMESSAGE = "pushMessage";
public static final String OPERATION_READINGFLG = "readingFlg";
// ABOOKCHECK SCHEME
public static final String ABOOK_CHECK_API = "abookcheck-api";
public static final String CMD_MOVE_HOT_SPOT = "moveHotspot";
......@@ -48,6 +83,20 @@ public class ABookKeys {
public static final String ATTACHED_CHANGE_FLAG = "attachedChangeFlag";
public static final String ROUTINE_TASK_FLAG = "routineTaskFlag";
public static final String UPDATE_HOTSPOT_ONLY_FLAG = "updateHotSpotOnlyFlag";
//Webviewから呼び出すApiキー
public static final class CMD_KEY{
public static final String GO_SETTING = "goSetting";
public static final String GO_RELATION_CONTENT = "goRelationContent";
public static final String GO_PRINT_TARGET = "goPrintTarget";
public static final String GO_OPERATION = "goOperation";
public static final String GO_COMMUNICATION = "goCommunication";
public static final String GO_PANORAMA_EDIT = "goPanoramaEdit";
public static final String REFRESH_CONTENT = "refreshContent";
public static final String CHANGE_OPERATION_GROUP_MASTER = "changeOperationGroupMaster";
}
// #32782 指示者テーブル関連削除 start
// TODO change TASK_DIRECTIONS 削除が必要
// public static final String TASK_DIRECTIONS = "taskReport";
......
......@@ -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_2_362;
public static final int DatabaseVersion = DatabaseVersions.Ver1_4_0;
protected SQLiteDatabase db = null;
......
......@@ -6,6 +6,7 @@ public class DatabaseVersions {
public static final int Ver1_1_0 = 11;
public static final int Ver1_2_0 = 21;
public static final int Ver1_2_3 = 22;
public static final int Ver1_4_0 = 41;
//連続作業機能追加
public static final int Ver1_2_360 = 23;
//チャット機能追加(1.2.360障害対応。)
......
......@@ -116,6 +116,16 @@ public class OperationDao extends AbstractDao {
dto.quickReport = cursor.getInt(column);
}
column = cursor.getColumnIndex("permit_code");
if (column != -1) {
dto.permitCode = cursor.getString(column);
}
column = cursor.getColumnIndex("permit_code_required_flg");
if (column != -1) {
dto.permitCodeRequiredFlg = cursor.getInt(column);
}
return dto;
}
......@@ -191,15 +201,17 @@ public class OperationDao extends AbstractDao {
+ "enable_report_history, "
+ "enable_report_edit,"
+ "enable_add_report,"
+ "quick_report) "
+ "quick_report,"
+ "permit_code,"
+ "permit_code_required_flg) "
+ "values "
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues());
}
public boolean update(OperationDto dto) {
long count = update("update t_operation "
+ "set "
long count = update("UPDATE t_operation "
+ "SET "
+ "operation_name=?, "
+ "operation_descriptions=?, "
+ "operation_start_date=?, "
......@@ -215,8 +227,10 @@ public class OperationDao extends AbstractDao {
+ "enable_report_history=?, "
+ "enable_report_edit=?, "
+ "enable_add_report=?, "
+ "quick_report=? "
+ "where operation_id=?",
+ "quick_report=?, "
+ "permit_code=?, "
+ "permit_code_required_flg=? "
+ "WHERE operation_id=?",
dto.getUpdateValues());
return count > 0;
}
......@@ -310,6 +324,8 @@ public class OperationDao extends AbstractDao {
sql.append(" top.enable_report_update, ");
sql.append(" top.enable_report_edit, ");
sql.append(" top.enable_add_report, ");
sql.append(" top.permit_code, ");
sql.append(" top.permit_code_required_flg, ");
sql.append(" CASE ");
sql.append(" WHEN report_type = 1 THEN ( ");
sql.append(" SELECT strftime('%Y/%m/%d %H:%M', datetime(ttr.report_start_date, 'localtime')) || ' ~ ' || strftime('%Y/%m/%d %H:%M', datetime(ttr.report_end_date, 'localtime')) ");
......
......@@ -10,6 +10,7 @@ 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.abook.abv.bl.dto.OperationGroupMasterRelationDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.NumericUtil;
......@@ -51,7 +52,10 @@ public class OperationGroupMasterDao extends AbstractDao {
if (column != -1) {
dto.operationCount = cursor.getInt(column);
}
column = cursor.getColumnIndex("tree_path");
if (column != -1) {
dto.treePath = cursor.getString(column);
}
return dto;
}
......@@ -185,4 +189,25 @@ public class OperationGroupMasterDao extends AbstractDao {
public Integer getLastGroupLevel() {
return rawQueryGetInt("SELECT MAX(operation_group_master_level) FROM m_operation_group_master", null);
}
public List<OperationGroupMasterDto> getOperationGroupMasterTreeData() {
return rawQueryGetDtoList("WITH RECURSIVE paths(operation_group_master_id, tree_path) AS (\n" +
" SELECT operation_group_master_id, operation_group_master_id\n" +
" FROM m_operation_group_master AS nodes\n" +
" WHERE parent_operation_group_master_id = 0\n" +
" UNION\n" +
" SELECT nodes.operation_group_master_id, paths.tree_path || '/' || nodes.operation_group_master_id\n" +
" FROM m_operation_group_master AS nodes\n" +
" JOIN paths\n" +
" WHERE nodes.parent_operation_group_master_id = paths.operation_group_master_id\n" +
")\n" +
"SELECT m.*, paths.tree_path, COUNT(r.operation_id) count_operation\n" +
"FROM paths\n" +
" JOIN m_operation_group_master AS m\n" +
" ON paths.operation_group_master_id = m.operation_group_master_id\n" +
" LEFT JOIN r_operation_group_master_relation r\n" +
" ON paths.operation_group_master_id = r.operation_group_master_id\n" +
"GROUP BY m.operation_group_master_id\n" +
"ORDER By m.operation_group_master_name ASC", null, OperationGroupMasterDto.class);
}
}
\ No newline at end of file
......@@ -86,4 +86,8 @@ public class OperationGroupMasterOperationDao extends AbstractDao {
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});
}
public List<OperationGroupMasterRelationDto> getAllGroupMasterRelation() {
return rawQueryGetDtoList("select * from r_operation_group_master_relation", null, OperationGroupMasterRelationDto.class);
}
}
\ No newline at end of file
......@@ -137,4 +137,6 @@ public class PushMessageDao extends AbstractDao {
Logger.v(TAG, "sql=%s", sql);
return rawQueryGetDto(sql.toString(), args, PushMessageDto.class);
}
}
......@@ -40,6 +40,8 @@ public class TOperation extends SQLiteTableScript {
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(" , permit_code TEXT ");
sql.append(" , permit_code_required_flg ");
sql.append(" , PRIMARY KEY (operation_id) ");
sql.append(" ) ");
ddl.add(sql.toString());
......@@ -58,6 +60,10 @@ public class TOperation extends SQLiteTableScript {
if (oldVersion < DatabaseVersions.Ver1_2_3) {
ddl.add("ALTER TABLE t_operation ADD COLUMN quick_report SMALLINT NOT NULL DEFAULT 0 ");
}
if (oldVersion < DatabaseVersions.Ver1_4_0) {
ddl.add("ALTER TABLE t_operation ADD COLUMN permit_code TEXT ");
ddl.add("ALTER TABLE t_operation ADD COLUMN permit_code_required_flg SMALLINT ");
}
return ddl;
}
......
......@@ -32,6 +32,8 @@ public class OperationDto extends AbstractDto {
public int enableReportEdit; // 作業編集可能区分
public int enableAddReport; // 作業追加区分
public int quickReport; // 簡易帳票区分
public String permitCode; // 許可スキャンコード
public int permitCodeRequiredFlg; // 許可スキャン必須フラグ
public List<OperationGroupMasterRelationDto> operationGroupMasterRelationDtoList; // 作業種別に紐づく作業Dto
......@@ -49,12 +51,12 @@ 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, quickReport };
return new Object[] { operationId, operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, quickReport, permitCode, permitCodeRequiredFlg};
}
@Override
public Object[] getUpdateValues() {
return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, quickReport, operationId };
return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, quickReport, permitCode, permitCodeRequiredFlg, operationId };
}
@Override
......
......@@ -12,6 +12,7 @@ public class OperationGroupMasterDto extends AbstractDto {
public int parentOperationGroupMasterId; // 作業種別の親階層ID
public int operationGroupMasterLevel; // 作業種別の階層レベル
public int operationCount = 0; // 作業種別に紐づく作業数
public String treePath ; // 作業種別のTreeデータ
public OperationGroupMasterDto() {
}
......
package jp.agentec.abook.abv.bl.logic;
import org.json.adf.JSONArray;
import org.json.adf.JSONObject;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
......@@ -10,15 +13,19 @@ 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.constant.ABookKeys;
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.data.dao.OperationGroupMasterOperationDao;
import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterRelationDto;
import jp.agentec.abook.abv.bl.dto.comparator.OperationGroupMasterLevelComparator;
import jp.agentec.adf.util.FileUtil;
/**
* Created by leej on 2019/06/26.
......@@ -28,6 +35,7 @@ public class OperationGroupMasterLogic extends AbstractLogic {
private static final String TAG = "OperationGroupMasterLogic";
private OperationGroupMasterDao mOperationGroupMasterDao = AbstractDao.getDao(OperationGroupMasterDao.class);
private OperationGroupMasterOperationDao mOperationGroupMasterOperationDao = AbstractDao.getDao(OperationGroupMasterOperationDao.class);
private OperationDao mOperationDao = AbstractDao.getDao(OperationDao.class);
/**
......@@ -168,4 +176,46 @@ public class OperationGroupMasterLogic extends AbstractLogic {
public List<OperationDto> getOperationByOperationGroupMasterId(Integer operationGroupMasterId, OperationSortingType operationSortingType) {
return mOperationDao.getOperationsByGroupMasterId(operationGroupMasterId, operationSortingType);
}
public void createOperationGroupMasterListJson(String filePath) {
List<OperationGroupMasterDto> localOperationGroupMasterDtos = mOperationGroupMasterDao.getOperationGroupMasterTreeData();
JSONObject operationListJsonObject = new JSONObject();
try {
JSONArray operationJsonArray = new JSONArray();
for (int i = 0; i < localOperationGroupMasterDtos.size(); i++) {
JSONObject operationJson = new JSONObject();
operationJson.put(ABookKeys.OPERATION_GROUPMASTER_ID, localOperationGroupMasterDtos.get(i).operationGroupMasterId);
operationJson.put(ABookKeys.OPERATION_GROUPMASTER_NAME, localOperationGroupMasterDtos.get(i).operationGroupMasterName);
operationJson.put(ABookKeys.OPERATION_GROUPMASTER_LEVEL, localOperationGroupMasterDtos.get(i).operationGroupMasterLevel);
operationJson.put(ABookKeys.OPERATION_GROUPMASTER_PARENTID, localOperationGroupMasterDtos.get(i).parentOperationGroupMasterId);
operationJson.put(ABookKeys.OPERATION_GROUPMASTER_TREEPATH, localOperationGroupMasterDtos.get(i).treePath);
operationJson.put(ABookKeys.OPERATION_GROUPMASTER_COUNTOPERATION, localOperationGroupMasterDtos.get(i).operationCount);
operationJsonArray.put(operationJson);
}
operationListJsonObject.put(ABookKeys.OPERATION_GROUPMASTER_LIST, operationJsonArray);
FileUtil.createFile(filePath + "/" + ABookKeys.OPERATION_GROUPMASTER_LIST + ".json", operationListJsonObject.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
public void createOperationGroupMasterRelationListJson(String filePath) {
List<OperationGroupMasterRelationDto> operationList = mOperationGroupMasterOperationDao.getAllGroupMasterRelation();
JSONObject operationListJsonObject = new JSONObject();
try {
JSONArray operationJsonArray = new JSONArray();
for (int i = 0; i < operationList.size(); i++) {
JSONObject operationJson = new JSONObject();
operationJson.put(ABookKeys.OPERATION_GROUPMASTER_RELATION_MASTERID, operationList.get(i).operationGroupMasterId);
operationJson.put(ABookKeys.OPERATION_GROUPMASTER_RELATION_OPERATIONID, operationList.get(i).operationId);
operationJsonArray.put(operationJson);
}
operationListJsonObject.put(ABookKeys.OPERATION_GROUPMASTER_RELATION_LIST, operationJsonArray);
FileUtil.createFile(filePath + "/" + ABookKeys.OPERATION_GROUPMASTER_RELATION_LIST + ".json", operationListJsonObject.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}
......@@ -58,6 +58,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.OperationGroupMasterDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterRelationDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.dto.TaskDto;
......@@ -122,7 +123,7 @@ public class OperationLogic extends AbstractLogic {
List<OperationDto> serverOperations = json.operationList;
//サーバーからチャットプシュデータを取得
if (ABVDataCache.getInstance().serviceOption.isChat()) {
/*if (ABVDataCache.getInstance().serviceOption.isChat()) {
ChatPushDataJSON chatPushJson = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getChatPushList(param);
for ( PushMessageDto dto : chatPushJson.pushMessageList) {
PushMessageDto dtoTemp = mPushMessageDao.selectChat(dto.pushMessageId, dto.operationId, dto.pushSendDate);
......@@ -130,7 +131,7 @@ public class OperationLogic extends AbstractLogic {
mPushMessageDao.insert(dto);
}
}
}
}*/
......@@ -1997,4 +1998,40 @@ public class OperationLogic extends AbstractLogic {
}
return isSuccess;
}
public String createOperationListJson(List<OperationDto> operationList, String filePath) {
JSONObject operationListJsonObject = new JSONObject();
try {
JSONArray operationJsonArray = new JSONArray();
for (int i = 0; i < operationList.size(); i++) {
JSONObject operationJson = new JSONObject();
operationJson.put(ABookKeys.OPERATION_ID, operationList.get(i).operationId);
operationJson.put(ABookKeys.OPERATION_NAME, operationList.get(i).operationName);
operationJson.put(ABookKeys.OPERATION_DESCRIPTIONS, operationList.get(i).operationDescriptions);
operationJson.put(ABookKeys.OPERATION_TYPE, operationList.get(i).operationType);
operationJson.put(ABookKeys.OPERATION_START_DATE, DateTimeUtil.toString(operationList.get(i).operationStartDate, DateTimeFormat.yyyyMMdd_slash));
operationJson.put(ABookKeys.OPERATION_END_DATE, DateTimeUtil.toString(operationList.get(i).operationEndDate, DateTimeFormat.yyyyMMdd_slash));
operationJson.put(ABookKeys.LAST_EDIT_DATE, DateTimeUtil.toString(operationList.get(i).lastEditDate, DateTimeFormat.yyyyMMdd_slash));
operationJson.put(ABookKeys.NEED_SYNC_FLG, operationList.get(i).needSyncFlg);
operationJson.put(ABookKeys.REPORT_TYPE, operationList.get(i).reportType);
operationJson.put(ABookKeys.REPORT_CYCLE, operationList.get(i).reportCycle);
operationJson.put(ABookKeys.ENABLE_REPORT_UPDATE, operationList.get(i).enableReportUpdate);
operationJson.put(ABookKeys.ENABLE_REPORT_HISTORY, operationList.get(i).enableReportHistory);
operationJson.put(ABookKeys.ENABLE_ADD_REPORT, operationList.get(i).enableAddReport);
operationJson.put(ABookKeys.QUICK_REPORT, operationList.get(i).quickReport);
operationJson.put(ABookKeys.PERMIT_CODE, operationList.get(i).permitCode);
operationJson.put(ABookKeys.PERMIT_CODE_REQUIRED_FLG, operationList.get(i).permitCodeRequiredFlg);
operationJson.put(ABookKeys.CONTENT_ID, operationList.get(i).contentId);
operationJsonArray.put(operationJson);
}
operationListJsonObject.put(ABookKeys.OPERATION_LIST, operationJsonArray);
if (!StringUtil.isNullOrEmpty(filePath)) {
FileUtil.createFile(filePath + "/operationList.json", operationListJsonObject.toString());
}
} catch (Exception e) {
e.printStackTrace();
}
return operationListJsonObject.toString();
}
}
package jp.agentec.abook.abv.bl.logic;
import org.json.adf.JSONArray;
import org.json.adf.JSONObject;
import java.io.IOException;
import java.util.List;
......@@ -14,7 +17,9 @@ 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.PushMessageDao;
import jp.agentec.abook.abv.bl.dto.FixPushMessageDto;
import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.adf.util.FileUtil;
/**
* Created by kim jinsung on 2018/09/17.
......@@ -62,4 +67,32 @@ public class PushMessageLogic extends AbstractLogic {
public void updateReadingFlg(long pushMessageId) {
mPushMessageDao.updateReadingFlg(pushMessageId);
}
public List<PushMessageDto> getAllPushMessage() {
return mPushMessageDao.selectAll();
}
public void createOperationPushMessageListJson(String filePath) {
List<PushMessageDto> pushList = getAllPushMessage();
JSONObject pushListJsonObject = new JSONObject();
try {
JSONArray pushJsonArray = new JSONArray();
for (int i = 0; i < pushList.size(); i++) {
JSONObject pushJson = new JSONObject();
pushJson.put(ABookKeys.OPERATION_PUSHMESSAGEID, pushList.get(i).pushMessageId);
pushJson.put(ABookKeys.OPERATION_OPERATIONID, pushList.get(i).operationId);
pushJson.put(ABookKeys.OPERATION_OPERATIONNAME, pushList.get(i).operationName);
pushJson.put(ABookKeys.OPERATION_PUSHSENDLOGINID, pushList.get(i).pushSendLoginId);
pushJson.put(ABookKeys.OPERATION_PUSHSENDDATE, pushList.get(i).pushSendDate);
pushJson.put(ABookKeys.OPERATION_PUSHMESSAGE, pushList.get(i).pushMessage);
pushJson.put(ABookKeys.OPERATION_READINGFLG, pushList.get(i).readingFlg);
pushJsonArray.put(pushJson);
}
pushListJsonObject.put(ABookKeys.OPERATION_PUSHMESSAGE_LIST, pushJsonArray);
FileUtil.createFile(filePath + "/" + ABookKeys.OPERATION_PUSHMESSAGE_LIST + ".json", pushListJsonObject.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}
Subproject commit 44603713517d4aecaa49ccc4d4b8427e2db2e12c
Subproject commit 0a9dd91eab004d76ae2fec60aae676d3c5058d30
......@@ -947,7 +947,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// プッシュメッセージで未読がなければ、下辺ツールバーのコミュニケーションボタンのバッジを外す
List<PushMessageDto> checkPushMessageList = mPushMessageListAdapter.getItems();
if (!checkUnReadCommunication(checkPushMessageList)) {
communicationButton.setImageResource(R.drawable.ic_communication_menu);
//OperationListActivityのwebview化のためnullチェック(OperationListActivityのナビゲーションはWebview内に含んでいる)
if (communicationButton != null) {
communicationButton.setImageResource(R.drawable.ic_communication_menu);
}
}
}
});
......
......@@ -5,16 +5,11 @@ import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.webkit.JavascriptInterface;
import android.webkit.WebSettings;
......@@ -24,11 +19,7 @@ import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.GridView;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RadioGroup;
import android.widget.TextView;
......@@ -40,10 +31,7 @@ import net.lingala.zip4j.exception.ZipException;
import org.json.adf.JSONObject;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
......@@ -72,7 +60,6 @@ import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.common.util.JsonUtil;
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.OperationContentDao;
......@@ -90,13 +77,13 @@ import jp.agentec.abook.abv.bl.dto.TaskReportDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationGroupMasterLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.viewer.activity.OnlineHTMLWebViewActivity;
import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.OperationLocationType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.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.constant.NaviConsts;
......@@ -108,7 +95,6 @@ import jp.agentec.abook.abv.ui.common.view.ABVBatchSyncView;
import jp.agentec.abook.abv.ui.common.view.ABVListDialog;
import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow;
import jp.agentec.abook.abv.ui.home.adapter.HierarchyOperationGroupListAdapter;
import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.home.helper.HomeOperationListHelper;
......@@ -116,7 +102,6 @@ import jp.agentec.abook.abv.ui.home.helper.OperationGroupMasterListHelper;
import jp.agentec.abook.abv.ui.home.helper.OperationListHelper;
import jp.agentec.abook.abv.ui.viewer.activity.DeviceImageListActivity;
import jp.agentec.abook.abv.ui.viewer.activity.HTMLXWalkWebViewActivity;
import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil;
......@@ -126,7 +111,6 @@ import jp.agentec.adf.util.StringUtil;
/**
* Created by leej on 2018/08/17
*/
public class OperationListActivity extends ABVUIActivity {
private static final String TAG = "OperationListActivity";
......@@ -135,16 +119,6 @@ public class OperationListActivity extends ABVUIActivity {
private final String OPERATION_LIST_PAGE = "file:///android_asset/check/app/index.html?";
private JsInf jsInf = new JsInf();
private ImageButton mViewModeButton; // パンネル・リスト表示ボタン
private ImageButton mSearchButton; // 検索ボタン
private ImageButton mCommonContentButton; // 共通資料ボタン
private ImageButton mOperationBatchSyncButton; // カテゴリの一括同期ボタン
private ImageButton mCategoryLocationButton; // カテゴリ選択ボタン
private ImageButton mQuickReportPrintButton; // 簡易帳票印刷ボタン
private TextView mOperationTitle; // 一覧のタイトル
// 検索画面の条件(文字列)
public String mSearchWord; // 検索画面の値(作業名)
public String mStartDateStr; // 検索画面の値(作業開始日)
......@@ -163,6 +137,7 @@ public class OperationListActivity extends ABVUIActivity {
private TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class);
private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class);
private OperationGroupMasterLogic mOperationGroupMasterLogic = AbstractLogic.getLogic(OperationGroupMasterLogic.class);
private PushMessageLogic mPushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class);
private TaskDao mTaskDao = AbstractDao.getDao(TaskDao.class);
private boolean activityResultFlg;
......@@ -182,27 +157,6 @@ public class OperationListActivity extends ABVUIActivity {
private static final int SUB_DIVICE_IMAGE_LIST_ACTIVITY = 1001;
private Long mSelectedOperationId;
// ビューの作成
private class ReloadHandler implements Runnable {
@Override
public void run() {
View child = mListHelper.getOperationView();
ViewGroup parent = (ViewGroup) child.getParent();
if (parent != null) {
parent.removeView(child);
}
FrameLayout vg = (FrameLayout) findViewById(R.id.operation_list_layout);
vg.removeAllViews();
vg.addView(child);
// ツールバーのビューモードイメージ変更
if (getABVUIDataCache().getViewMode() == AppDefType.ViewMode.PANEL) {
mViewModeButton.setImageResource(R.drawable.ic_display_list);
} else {
mViewModeButton.setImageResource(R.drawable.ic_display_pannel);
}
closeProgressPopup();
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -219,7 +173,7 @@ public class OperationListActivity extends ABVUIActivity {
WebSettings settings = mCheckWebView.getSettings();
settings.setJavaScriptEnabled(true); //Javascriptを有効にする。
settings.setAppCacheEnabled(true);
settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
settings.setCacheMode(WebSettings.LOAD_DEFAULT);
settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
settings.setDomStorageEnabled(true);
......@@ -234,76 +188,16 @@ public class OperationListActivity extends ABVUIActivity {
ArrayList<String> paramList = new ArrayList<String>();
paramList.add("debug=1");
paramList.add("mobile_flg=1");
paramList.add("is_android=1");
paramList.add("app=android");
paramList.add("mobile_flg=" + (isNormalSize() ? "1" : "0"));
mCheckWebView.postUrl(OPERATION_LIST_PAGE + StringUtil.join("&", paramList), null);
mListHelper = getListHelper();
updateNeedSyncRoutineOperation();
mOperationGroupMasterServiceOperationFlg = ABVDataCache.getInstance().serviceOption.isOperationGroupMaster();
//setOperationListView();
// サービスオプション(作業種別使用)をセット
mOperationGroupMasterServiceOperationFlg = ABVDataCache.getInstance().serviceOption.isOperationGroupMaster();
// 検索ボタン
// mSearchButton = (ImageButton) findViewById(R.id.btn_search);
//
// // ツールバーのタイトル表示
// mOperationTitle = (TextView) findViewById(R.id.operation_title);
// mOperationBatchSyncButton = (ImageButton) findViewById(R.id.btn_batch_sync);
//
// communicationButton = (ImageButton) findViewById(R.id.btn_communication_menu);
// mCommonContentButton = (ImageButton) findViewById(R.id.btn_common_content);
// mCategoryLocationButton = (ImageButton) findViewById(R.id.btn_category_location);
// mQuickReportPrintButton = (ImageButton) findViewById(R.id.btn_operation_print);
//
// // 定期点検で同期ボタンタップの日付と現在の日付が異なる且つ、作業するデータが存在しない場合、needSyncFlgをtrueに更新
// updateNeedSyncRoutineOperation();
//
// // 非活性化する(ホーム画面ではホームボタンが必要ないため)
// ImageButton operationHomeButton = (ImageButton) findViewById(R.id.btn_operation_home);
// operationHomeButton.setEnabled(false);
//
// // ビュー変更ボタンのタッチイベント
// mViewModeButton.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// if (getABVUIDataCache().getViewMode() == ViewMode.PANEL) {
// getABVUIDataCache().setViewMode(ViewMode.LIST);
// } else {
// getABVUIDataCache().setViewMode(ViewMode.PANEL);
// }
// setOperationListView();
// }
// });
//
// // サービスオプション(作業種別使用)をセット
// mOperationGroupMasterServiceOperationFlg = ABVDataCache.getInstance().serviceOption.isOperationGroupMaster();
//
// // 検索アイコンのクリックイベント
// mSearchButton.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// showSearchDialog();
// }
// });
//
// // コミュニケーションボタン
// communicationButton.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// showCommunicationMenuDialog();
// }
// });
//
// // 共通関連資料ボタン
// mCommonContentButton.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// showCommonContent();
// }
// });
//
//TODO Control print button in Webview
// if (ABVDataCache.getInstance().serviceOption.isUnableIOReport()) {
// // 簡易帳票印刷ボタン
// mQuickReportPrintButton.setOnClickListener(new View.OnClickListener() {
......@@ -342,63 +236,64 @@ public class OperationListActivity extends ABVUIActivity {
// showBatchSyncDialog();
// }
// });
//
//
// if (!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.PushMessageKey.operationId))) {
// final long operationId = Long.parseLong(getIntent().getStringExtra(AppDefType.PushMessageKey.operationId));
// String message = getIntent().getStringExtra(AppDefType.PushMessageKey.message);
// if (operationId > 0) {
// final ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(this, getRString(R.string.app_name), message);
// // リソースパターンの適用
// alertDialog.setPositiveButton(PatternStringUtil.patternToInt(getApplicationContext(), R.string.work_report, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)),
// new DialogInterface.OnClickListener() {
// @Override
// public void onClick(DialogInterface dialog, int whichButton) {
// if (contentRefresher.isRefreshing()) {
// // リソースパターンの適用
// ErrorMessage.showErrorMessageToast(OperationListActivity.this, PatternStringUtil.patternToInt(getApplicationContext(),
// R.string.msg_routineTask_report_disable_refreshing,
// getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
// } else if(ActivityHandlingHelper.getInstance().isMeetingConnected()) {
// // リソースパターンの適用
// ErrorMessage.showErrorMessageToast(OperationListActivity.this, PatternStringUtil.patternToInt(getApplicationContext(),
// R.string.msg_routineTask_report_disable_meeting_room,
// getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
// } else if (isShowingBatchSync()) {
// // 一括同期中は移動しない
// ErrorMessage.showErrorMessageToast(OperationListActivity.this, getString(R.string.msg_batch_sync_move_operation_view));
// } else {
// OperationDto operationDto = mOperationLogic.getOperation(operationId);
//
// if (operationDto == null) {
// // リソースパターンの適用
// ErrorMessage.showErrorMessageToast(OperationListActivity.this, PatternStringUtil.patternToInt(getApplicationContext(),
// R.string.msg_routineTask_report_disable_no_operation,
// getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
// } else if (operationDto.needSyncFlg) {
// // リソースパターンの適用
// ErrorMessage.showErrorMessageToast(OperationListActivity.this, PatternStringUtil.patternToInt(getApplicationContext(),
// R.string.msg_routineTask_report_disable_not_updated,
// getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
// } else {
// startTaskDirectionOrReportView(operationDto);
// }
// }
//
// dialog.dismiss();
// }
// });
//
// alertDialog.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
// @Override
// public void onClick(DialogInterface dialog, int whichButton) {
// dialog.dismiss();
// }
// });
//
// alertDialog.show();
// }
// }
if (!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.PushMessageKey.operationId))) {
final long operationId = Long.parseLong(getIntent().getStringExtra(AppDefType.PushMessageKey.operationId));
String message = getIntent().getStringExtra(AppDefType.PushMessageKey.message);
if (operationId > 0) {
final ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(this, getRString(R.string.app_name), message);
// リソースパターンの適用
alertDialog.setPositiveButton(PatternStringUtil.patternToInt(getApplicationContext(), R.string.work_report, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
if (contentRefresher.isRefreshing()) {
// リソースパターンの適用
ErrorMessage.showErrorMessageToast(OperationListActivity.this, PatternStringUtil.patternToInt(getApplicationContext(),
R.string.msg_routineTask_report_disable_refreshing,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
} else if(ActivityHandlingHelper.getInstance().isMeetingConnected()) {
// リソースパターンの適用
ErrorMessage.showErrorMessageToast(OperationListActivity.this, PatternStringUtil.patternToInt(getApplicationContext(),
R.string.msg_routineTask_report_disable_meeting_room,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
} else if (isShowingBatchSync()) {
// 一括同期中は移動しない
ErrorMessage.showErrorMessageToast(OperationListActivity.this, getString(R.string.msg_batch_sync_move_operation_view));
} else {
OperationDto operationDto = mOperationLogic.getOperation(operationId);
if (operationDto == null) {
// リソースパターンの適用
ErrorMessage.showErrorMessageToast(OperationListActivity.this, PatternStringUtil.patternToInt(getApplicationContext(),
R.string.msg_routineTask_report_disable_no_operation,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
} else if (operationDto.needSyncFlg) {
// リソースパターンの適用
ErrorMessage.showErrorMessageToast(OperationListActivity.this, PatternStringUtil.patternToInt(getApplicationContext(),
R.string.msg_routineTask_report_disable_not_updated,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
} else {
startTaskDirectionOrReportView(operationDto);
}
}
dialog.dismiss();
}
});
alertDialog.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss();
}
});
alertDialog.show();
}
}
// // プッシュメッセージがある場合
// else if (!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName)) &&
// getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0') > 0) {
......@@ -406,26 +301,126 @@ public class OperationListActivity extends ABVUIActivity {
// getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'),
// getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName));
// }
//
// // リスト更新
// setOperationListView();
}
private class JsInf {
@JavascriptInterface
public void sendParam(String param) {
JSONObject jsonParam = new JSONObject(param);
if (jsonParam.has("cmd")) {
switch (jsonParam.getString("cmd")){
case "goSetting":
OperationDto operationDto;
if (jsonParam.has(ABookKeys.CMD)) {
switch (jsonParam.getString(ABookKeys.CMD)){
case ABookKeys.CMD_KEY.GO_SETTING:
showSetting();
break;
case "":
case ABookKeys.CMD_KEY.GO_RELATION_CONTENT:
showCommonContent();
break;
case ABookKeys.CMD_KEY.GO_PRINT_TARGET:
showPrintTargetSelect();
break;
case ABookKeys.CMD_KEY.GO_OPERATION:
if (!jsonParam.has(ABookKeys.OPERATION_ID)) {
break;
}
final OperationDto tempOperationDto = mOperationDao.getOperationJoinContent(jsonParam.getInt(ABookKeys.OPERATION_ID));
if (tempOperationDto.needSyncFlg) {
runOnUiThread(new Runnable() {
@Override
public void run() {
startSyncOperation(tempOperationDto, new Runnable() {
@Override
public void run() {
openReportView(tempOperationDto);
}
});
}
});
} else {
openReportView(tempOperationDto);
}
break;
case ABookKeys.CMD_KEY.GO_COMMUNICATION:
showCommunicationMenuDialog();
break;
case ABookKeys.CMD_KEY.GO_PANORAMA_EDIT:
final OperationDto panoramaOperationDto = mOperationDao.getOperationJoinContent(jsonParam.getInt(ABookKeys.OPERATION_ID));
if (panoramaOperationDto.needSyncFlg) {
runOnUiThread(new Runnable() {
@Override
public void run() {
startSyncOperation(panoramaOperationDto, new Runnable() {
@Override
public void run() {
startTaskDirectionOrReportView(panoramaOperationDto);
}
});
}
});
} else {
startTaskDirectionOrReportView(panoramaOperationDto);
}
break;
case ABookKeys.CMD_KEY.REFRESH_CONTENT:
clearSearch();
runOnUiThread(new Runnable() {
@Override
public void run() {
mCheckWebView.loadUrl("javascript:CHK.initReportApp();");
}
});
break;
case ABookKeys.CMD_KEY.CHANGE_OPERATION_GROUP_MASTER:
clearSearch();
List<OperationDto>operationList = mOperationGroupMasterLogic.getOperationByOperationGroupMasterId(jsonParam.getInt(ABookKeys.OPERATION_GROUPMASTER_ID), null);
mOperationLogic.createOperationListJson(operationList, null);
break;
}
}
}
@JavascriptInterface
public String getCachePath() {
return getCacheDir().getAbsolutePath();
}
@JavascriptInterface
public String searchOperationList(String searchKeyword, String searchStartDate, String searchEndDate, int operationGroupMasterId) {
mSearchWord = searchKeyword;
mStartDateStr = searchStartDate;
mEndDateStr = searchEndDate;
List<OperationDto> operationList;
if (operationGroupMasterId != 0) {
operationList = mOperationGroupMasterLogic.getOperationByOperationGroupMasterId(operationGroupMasterId, null);
} else {
operationList = mListHelper.filterOperationList();
}
String searchOperationListStr = mOperationLogic.createOperationListJson(operationList, null);
return searchOperationListStr;
}
@JavascriptInterface
public void startScan() {
//TODO ConnectScanner
}
@JavascriptInterface
public void stopScan() {
//TODO DisconnectScanner
}
}
//TODO Method called when code is scanned
public void onScanned(String code) {
mCheckWebView.loadUrl("javascript:CHK.scanResult(" + code + ");");
}
// 共通資料画面表示
......@@ -449,52 +444,6 @@ public class OperationListActivity extends ABVUIActivity {
startActivity(intent, NaviConsts.Right);
}
// ツールバーの設定
private void configurationToolbarIcon() {
// バッチを付けるか判定して、イメージを設定
setCommunicationImageButton();
// 作業種別表示・非表示
if (mOperationGroupMasterServiceOperationFlg) {
mCategoryLocationButton.setVisibility(View.VISIBLE);
// アイコンの変更
if (getABVUIDataCache().getOperationGroupMasterMode() == OperationLocationType.CATEGORY) {
setCategoryImage(true);
mOperationTitle.setText(R.string.title_category);
// 検索ワード削除
clearSearch();
// 検索ボタンを無効にする
mSearchButton.setEnabled(false);
// 一括同期ボタン表示
mOperationBatchSyncButton.setVisibility(View.VISIBLE);
} else {
// 全て
// 検索ボタンを活性化
mSearchButton.setEnabled(true);
setCategoryImage(false);
// 一括同期ボタン非表示
mOperationBatchSyncButton.setVisibility(View.GONE);
mOperationTitle.setText(R.string.title_all_operation);
}
} else {
mOperationTitle.setText(R.string.title_all_operation);
// アイコン非表示
setCategoryImage(false);
mCategoryLocationButton.setVisibility(View.GONE);
// 一括同期ボタンを非表示
mOperationBatchSyncButton.setVisibility(View.GONE);
// 検索ボタンを活性化
mSearchButton.setEnabled(true);
}
// 検索済みの場合、タイトルを「検索結果」にする
if (isSearched()) {
mOperationTitle.setText(R.string.search_result);
}
}
// 検索ワードのクリア
private void clearSearch() {
mSearchWord = null;
......@@ -508,25 +457,15 @@ public class OperationListActivity extends ABVUIActivity {
return !(StringUtil.isNullOrEmpty(mSearchWord) && StringUtil.isNullOrEmpty(mStartDateStr) && StringUtil.isNullOrEmpty(mEndDateStr));
}
// カテゴリのアイコンイメージ設定
private void setCategoryImage(boolean isCategory) {
mCategoryLocationButton.setImageResource(isCategory ? R.drawable.ic_category_on : R.drawable.ic_category_off);
}
/**
* ビューを作り直す。
*/
public void setOperationListView() {
mListHelper = getListHelper();
handler.post(new ReloadHandler());
configurationToolbarIcon();
screenRefresh();
}
// ビューを作り直さずにリストだけ更新する
public void refreshOperationList() {
mListHelper.refreshList();
configurationToolbarIcon();
}
@Override
public void onRefreshedContent(final boolean result, long contentId, Exception e) {
......@@ -544,19 +483,13 @@ public class OperationListActivity extends ABVUIActivity {
// 絞り検索マスタデータ最新更新する時fetchDateをローカルに保存する。
setApertureMasterDataFetchDate();
if (mOperationGroupMasterServiceOperationFlg == ABVDataCache.getInstance().serviceOption.isOperationGroupMaster()) {
// サービスオプションが変わってない場合は、ビューは作らずにデータのみ更新
refreshOperationList();
} else {
if (mOperationGroupMasterServiceOperationFlg != ABVDataCache.getInstance().serviceOption.isOperationGroupMaster()) {
// 初期化
getABVUIDataCache().clearOperationGroupMaster();
mOperationGroupMasterServiceOperationFlg = ABVDataCache.getInstance().serviceOption.isOperationGroupMaster();
// 作業種別の選択画面を閉じる
closeOperationGroupMasterDialog();
// ビューを作り直す
setOperationListView();
}
screenRefresh();
}
}
});
......@@ -572,6 +505,7 @@ public class OperationListActivity extends ABVUIActivity {
@Override
public void onResume() {
//showProgressPopup();
Logger.i(TAG, "onResume:start");
super.onResume();
//アプリロック状態の場合、何もしない。
......@@ -582,39 +516,12 @@ public class OperationListActivity extends ABVUIActivity {
// 一括同期中の場合何もしない
return;
}
List<OperationDto> operationDtoList = mListHelper.filterOperationList();
//refreshOperationList();
//refreshOperationList();
// 報告画面から作業一覧へ戻った時の同期処理
/*final long operationId = getUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, -1L);
final long operationId = getUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, -1L);
if (operationId != -1) {
final OperationDto operationDto = mOperationLogic.getOperation(operationId);
dataRefresh(true);
// リソースパターンの適用
showProgressView(PatternStringUtil.patternToString(getApplicationContext(),
R.string.synchronizing,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
CommonExecutor.execute(new Runnable() {
@Override
public void run() {
Logger.d(TAG, "onResume Sync operationId : " + operationId);
if (operationDto != null && operationDto.needSyncFlg) {
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
closeProgressPopup();
ABVToastUtil.showMakeText(OperationListActivity.this, R.string.msg_network_offline, Toast.LENGTH_SHORT);
return;
}
// 同期処理後、直列処理で新着更新を行う。
singleSyncOperation(operationId, operationDto.reportType);
} else {
closeProgressPopup();
}
dataRefresh(true);
}
});
}
if (!activityResultFlg && operationId == -1) {
......@@ -622,8 +529,18 @@ public class OperationListActivity extends ABVUIActivity {
}
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, -1L);
activityResultFlg = false;
runOnUiThread(new Runnable() {
@Override
public void run() {
try {
createJsonForOperationList(getCacheDir().getAbsolutePath());
//closeProgressPopup();
} catch (Exception e) {
Logger.d("Update error");
}
}
});
configurationToolbarIcon();*/
}
// 検索ダイアログ表示
......@@ -685,7 +602,7 @@ public class OperationListActivity extends ABVUIActivity {
mStartDateStr = StringUtil.toString(mStartDate.getText());
mEndDateStr = StringUtil.toString(mEndDate.getText());
refreshOperationList();
screenRefresh();
mSearchDialog.dismiss();
// 検索条件に条件がある場合のみ、件数のトーストメッセージは表示する
......@@ -721,7 +638,6 @@ public class OperationListActivity extends ABVUIActivity {
int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DAY_OF_MONTH);
//TODO layout変更 => DatePickerDialog.Theme_Holo_Light
final DatePickerDialog dpd = new DatePickerDialog(this, android.R.style.Theme_Holo_Light_Dialog, new DatePickerDialog.OnDateSetListener() {
@Override
......@@ -1014,7 +930,7 @@ public class OperationListActivity extends ABVUIActivity {
progressDialogHorizontal.setProgress(100);
}
mOperationLastEditDate = null;
refreshOperationList();
//screenRefresh();
closeProgressPopup();
}
});
......@@ -1324,7 +1240,7 @@ public class OperationListActivity extends ABVUIActivity {
if (requestCode == SUB_DIVICE_IMAGE_LIST_ACTIVITY && resultCode == RESULT_OK) {
mOperationLogic.setContentCreatingFlg(mSelectedOperationId);
refreshOperationList();
//screenRefresh();
//10秒(コンテンツ作成し、公開までの時間)に新着更新させる。
showProgressView(getString(R.string.msg_common_processing));
......@@ -1404,7 +1320,7 @@ public class OperationListActivity extends ABVUIActivity {
* 同期処理
* @param operationDto
*/
public void startSyncOperation(final OperationDto operationDto) {
public void startSyncOperation(final OperationDto operationDto, final Runnable callback) {
//ネットワークチェック
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
ABVToastUtil.showMakeText(OperationListActivity.this, R.string.request_network_connection, Toast.LENGTH_SHORT);
......@@ -1678,15 +1594,6 @@ public class OperationListActivity extends ABVUIActivity {
}
/**
* 作業種別選択画面を閉じる処理
*/
public void closeOperationGroupMasterDialog() {
if (mShowDialog != null && mShowDialog.isShowing()) {
mShowDialog.dismiss();
}
}
/**
* 絞り検索の日付を設定
*/
private void setApertureMasterDataFetchDate() {
......@@ -1795,19 +1702,6 @@ public class OperationListActivity extends ABVUIActivity {
return true;
}
/**
* 一括同期の活性化・非活性化チェック
*/
public void checkBatchNeedSyncButton(Integer operationGroupMasterId) {
if (mOperationDao.hasNeedSyncOperationByGroupMasterId(operationGroupMasterId)) {
// 選択したカテゴリ一覧でneedSyncFlgがtrueの作業が存在すれば、活性化する
mOperationBatchSyncButton.setEnabled(true);
} else {
// 一括同期ボタンを非活性化する
mOperationBatchSyncButton.setEnabled(false);
}
}
@Override
public void onDestroy() {
Logger.d(TAG, "onDestroy");
......@@ -1842,7 +1736,7 @@ public class OperationListActivity extends ABVUIActivity {
Logger.d(TAG, "onClickSortMenuByTablet id:" + id);
getABVUIDataCache().setSortCondition((int)id);
// ビューア更新
refreshOperationList();
screenRefresh();
}
});
......@@ -1883,7 +1777,7 @@ public class OperationListActivity extends ABVUIActivity {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
getABVUIDataCache().setSortCondition((int)id);
refreshOperationList();
screenRefresh();
}
});
......@@ -1987,11 +1881,6 @@ public class OperationListActivity extends ABVUIActivity {
showProgressPopup();
setOperationListView();
}
if (getABVUIDataCache().getOperationGroupMasterMode() == OperationLocationType.CATEGORY) {
//作業種別モードの場合は、作業種別選択ダイアログ画面を表示
showOperationGroupMasterDialog(true);
}
}
/**
......@@ -2002,4 +1891,27 @@ public class OperationListActivity extends ABVUIActivity {
return getABVUIDataCache().getSortCondition();
}
public void createJsonForOperationList(String filePath) {
clearSearch();
List<OperationDto> operationList = mListHelper.filterOperationList();
mOperationLogic.createOperationListJson(operationList, filePath);
mOperationGroupMasterLogic.createOperationGroupMasterListJson(filePath);
mOperationGroupMasterLogic.createOperationGroupMasterRelationListJson(filePath);
mPushMessageLogic.createOperationPushMessageListJson(filePath);
}
public void screenRefresh() {
runOnUiThread(new Runnable() {
@Override
public void run() {
try {
createJsonForOperationList(getCacheDir().getAbsolutePath());
mCheckWebView.loadUrl("javascript:CHK.initReportApp();");
} catch (Exception e) {
Logger.d("Update error");
}
}
});
}
}
......@@ -68,11 +68,9 @@ public class OperationGroupMasterListHelper extends CategoryOperationListHelper<
// クリアフラグをfalseにセット
ABVEnvironment.getInstance().setOperationGroupMasterClearFlg(false);
// 作業種別の選択画面を閉じる
mAppActivity.closeOperationGroupMasterDialog();
}
OperationGroupMasterDto peekOperationGroupMasterDto = stack.peek();
mAppActivity.checkBatchNeedSyncButton(peekOperationGroupMasterDto.operationGroupMasterId);
int operationSortType = mAppActivity.getSortCondition();
OperationSortingType operationSortingType = OperationSortingType.parse(operationSortType);
// 作業種別IDで紐づく作業リストを取得
......@@ -155,4 +153,11 @@ public class OperationGroupMasterListHelper extends CategoryOperationListHelper<
public List<OperationGroupMasterDto> getChildList(Integer operationGroupMasterId) {
return mOperationGroupMasterDao.getOperationGroupMasterChildList(operationGroupMasterId);
}
public void refreshList() {
OperationListActivity operationListActivity = ActivityHandlingHelper.getInstance().getActivity(OperationListActivity.class);
if (operationListActivity != null) {
operationListActivity.screenRefresh();
}
}
}
......@@ -167,7 +167,7 @@ public abstract class OperationListHelper {
@Override
public void onSyncOperation(final OperationDto operationDto) {
// 同期処理
mAppActivity.startSyncOperation(operationDto);
mAppActivity.startSyncOperation(operationDto, null);
}
});
......@@ -235,7 +235,7 @@ public abstract class OperationListHelper {
@Override
public void onSyncOperation(final OperationDto operationDto) {
// 同期処理
mAppActivity.startSyncOperation(operationDto);
mAppActivity.startSyncOperation(operationDto, null);
}
});
......@@ -245,15 +245,6 @@ public abstract class OperationListHelper {
}
/**
* 作業の画面更新
*/
public void refreshList() {
if (mAdapter != null) {
mAdapter.setItem(filterOperationList());
}
}
/**
* 作業の件数取得
* @return
*/
......
......@@ -25,6 +25,7 @@ import android.widget.RelativeLayout;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.AcmsApis;
......@@ -40,8 +41,11 @@ 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.OperationDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.cl.util.ContentLogUtil;
import jp.agentec.abook.abv.launcher.android.R;
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;
import jp.agentec.abook.abv.ui.common.constant.NaviConsts;
......@@ -71,6 +75,8 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
private JsInf jsInf = new JsInf();
private ValueCallback<Uri[]> mUploadMessage;
private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class);
@Override
public void onCreate(Bundle savedInstanceState) {
Logger.i(TAG, "onCreate");
......@@ -120,7 +126,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
final RelativeLayout fl = (RelativeLayout) findViewById(R.id.frameTopbar);
fl.setVisibility(View.GONE);
// ***** 戻るボタン
closeButton.setOnClickListener(new View.OnClickListener() {
@Override
......@@ -475,6 +481,26 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
public void openEditPage() {
commonOpenEditPage();
}
@JavascriptInterface
public void goOperationHome() {
if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
showConfirmSavePanoEdit();
} else {
// 作業終了する時、作業ID設定して作業一覧で使用するメソットを行う。
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
finishActivity(); // 開いてる画面を閉じる
}
}
@JavascriptInterface
public String getOperation() {
ArrayList<OperationDto> operationDtos = new ArrayList<OperationDto>();
OperationDto opertaionDto = mOperationLogic.getOperation(mOperationId);
operationDtos.add(opertaionDto);
String operationJson = mOperationLogic.createOperationListJson(operationDtos, null);
return operationJson;
}
}
@Override
......
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