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,9 +947,12 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// プッシュメッセージで未読がなければ、下辺ツールバーのコミュニケーションボタンのバッジを外す
List<PushMessageDto> checkPushMessageList = mPushMessageListAdapter.getItems();
if (!checkUnReadCommunication(checkPushMessageList)) {
//OperationListActivityのwebview化のためnullチェック(OperationListActivityのナビゲーションはWebview内に含んでいる)
if (communicationButton != null) {
communicationButton.setImageResource(R.drawable.ic_communication_menu);
}
}
}
});
mPushMessageListView.invalidate();
mPushMessageListView.setClickable(false);
......
......@@ -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