Commit 2e65f899 by Lee Munkyeong

作業一覧Webview対応中

parent 686fb965
......@@ -15,6 +15,39 @@ 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 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";
......
......@@ -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);
}
}
......@@ -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;
......@@ -1997,4 +1998,37 @@ public class OperationLogic extends AbstractLogic {
}
return isSuccess;
}
public void createOperationListJson(String filePath) {
List<OperationDto> operationList = getRefreshOperation(null, null, null, null);
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).operationStartDate, DateTimeFormat.yyyyMMdd_slash));
operationJson.put(ABookKeys.LAST_EDIT_DATE, operationList.get(i).lastEditDate);
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.CONTENT_ID, operationList.get(i).contentId);
operationJsonArray.put(operationJson);
}
operationListJsonObject.put(ABookKeys.OPERATION_LIST, operationJsonArray);
FileUtil.createFile(filePath + "/operationList.json", operationListJsonObject.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}
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();
}
}
}
......@@ -155,4 +155,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();
}
}
}
......@@ -245,15 +245,6 @@ public abstract class OperationListHelper {
}
/**
* 作業の画面更新
*/
public void refreshList() {
if (mAdapter != null) {
mAdapter.setItem(filterOperationList());
}
}
/**
* 作業の件数取得
* @return
*/
......
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