Commit 2e65f899 by Lee Munkyeong

作業一覧Webview対応中

parent 686fb965
...@@ -15,6 +15,39 @@ public class ABookKeys { ...@@ -15,6 +15,39 @@ public class ABookKeys {
public static final String OPERATION_ID = "operationId"; public static final String OPERATION_ID = "operationId";
public static final String OPERATION_NAME = "operationName"; 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 // ABOOKCHECK SCHEME
public static final String ABOOK_CHECK_API = "abookcheck-api"; public static final String ABOOK_CHECK_API = "abookcheck-api";
public static final String CMD_MOVE_HOT_SPOT = "moveHotspot"; public static final String CMD_MOVE_HOT_SPOT = "moveHotspot";
......
...@@ -10,6 +10,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase; ...@@ -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.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.GroupDto; import jp.agentec.abook.abv.bl.dto.GroupDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto; 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.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.NumericUtil; import jp.agentec.adf.util.NumericUtil;
...@@ -51,7 +52,10 @@ public class OperationGroupMasterDao extends AbstractDao { ...@@ -51,7 +52,10 @@ public class OperationGroupMasterDao extends AbstractDao {
if (column != -1) { if (column != -1) {
dto.operationCount = cursor.getInt(column); dto.operationCount = cursor.getInt(column);
} }
column = cursor.getColumnIndex("tree_path");
if (column != -1) {
dto.treePath = cursor.getString(column);
}
return dto; return dto;
} }
...@@ -185,4 +189,25 @@ public class OperationGroupMasterDao extends AbstractDao { ...@@ -185,4 +189,25 @@ public class OperationGroupMasterDao extends AbstractDao {
public Integer getLastGroupLevel() { public Integer getLastGroupLevel() {
return rawQueryGetInt("SELECT MAX(operation_group_master_level) FROM m_operation_group_master", null); 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 { ...@@ -86,4 +86,8 @@ public class OperationGroupMasterOperationDao extends AbstractDao {
public List<Integer> getOperationGroupMasterIds(Long operationId) { 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}); 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 { ...@@ -137,4 +137,6 @@ public class PushMessageDao extends AbstractDao {
Logger.v(TAG, "sql=%s", sql); Logger.v(TAG, "sql=%s", sql);
return rawQueryGetDto(sql.toString(), args, PushMessageDto.class); return rawQueryGetDto(sql.toString(), args, PushMessageDto.class);
} }
} }
...@@ -12,6 +12,7 @@ public class OperationGroupMasterDto extends AbstractDto { ...@@ -12,6 +12,7 @@ public class OperationGroupMasterDto extends AbstractDto {
public int parentOperationGroupMasterId; // 作業種別の親階層ID public int parentOperationGroupMasterId; // 作業種別の親階層ID
public int operationGroupMasterLevel; // 作業種別の階層レベル public int operationGroupMasterLevel; // 作業種別の階層レベル
public int operationCount = 0; // 作業種別に紐づく作業数 public int operationCount = 0; // 作業種別に紐づく作業数
public String treePath ; // 作業種別のTreeデータ
public OperationGroupMasterDto() { public OperationGroupMasterDto() {
} }
......
package jp.agentec.abook.abv.bl.logic; package jp.agentec.abook.abv.bl.logic;
import org.json.adf.JSONArray;
import org.json.adf.JSONObject;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
...@@ -10,15 +13,19 @@ import jp.agentec.abook.abv.bl.acms.client.json.OperationGroupMasterJSON; ...@@ -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.client.parameters.AcmsParameters;
import jp.agentec.abook.abv.bl.acms.type.OperationSortingType; import jp.agentec.abook.abv.bl.acms.type.OperationSortingType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; 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.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException; import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao; 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.OperationDao;
import jp.agentec.abook.abv.bl.data.dao.OperationGroupMasterDao; 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.OperationDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto; 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.abook.abv.bl.dto.comparator.OperationGroupMasterLevelComparator;
import jp.agentec.adf.util.FileUtil;
/** /**
* Created by leej on 2019/06/26. * Created by leej on 2019/06/26.
...@@ -28,6 +35,7 @@ public class OperationGroupMasterLogic extends AbstractLogic { ...@@ -28,6 +35,7 @@ public class OperationGroupMasterLogic extends AbstractLogic {
private static final String TAG = "OperationGroupMasterLogic"; private static final String TAG = "OperationGroupMasterLogic";
private OperationGroupMasterDao mOperationGroupMasterDao = AbstractDao.getDao(OperationGroupMasterDao.class); private OperationGroupMasterDao mOperationGroupMasterDao = AbstractDao.getDao(OperationGroupMasterDao.class);
private OperationGroupMasterOperationDao mOperationGroupMasterOperationDao = AbstractDao.getDao(OperationGroupMasterOperationDao.class);
private OperationDao mOperationDao = AbstractDao.getDao(OperationDao.class); private OperationDao mOperationDao = AbstractDao.getDao(OperationDao.class);
/** /**
...@@ -168,4 +176,46 @@ public class OperationGroupMasterLogic extends AbstractLogic { ...@@ -168,4 +176,46 @@ public class OperationGroupMasterLogic extends AbstractLogic {
public List<OperationDto> getOperationByOperationGroupMasterId(Integer operationGroupMasterId, OperationSortingType operationSortingType) { public List<OperationDto> getOperationByOperationGroupMasterId(Integer operationGroupMasterId, OperationSortingType operationSortingType) {
return mOperationDao.getOperationsByGroupMasterId(operationGroupMasterId, 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; ...@@ -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.ContentDto;
import jp.agentec.abook.abv.bl.dto.OperationContentDto; import jp.agentec.abook.abv.bl.dto.OperationContentDto;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterRelationDto; import jp.agentec.abook.abv.bl.dto.OperationGroupMasterRelationDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto; import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.dto.TaskDto; import jp.agentec.abook.abv.bl.dto.TaskDto;
...@@ -1997,4 +1998,37 @@ public class OperationLogic extends AbstractLogic { ...@@ -1997,4 +1998,37 @@ public class OperationLogic extends AbstractLogic {
} }
return isSuccess; 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; package jp.agentec.abook.abv.bl.logic;
import org.json.adf.JSONArray;
import org.json.adf.JSONObject;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
...@@ -14,7 +17,9 @@ import jp.agentec.abook.abv.bl.common.log.Logger; ...@@ -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.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.PushMessageDao; import jp.agentec.abook.abv.bl.data.dao.PushMessageDao;
import jp.agentec.abook.abv.bl.dto.FixPushMessageDto; 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.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.adf.util.FileUtil;
/** /**
* Created by kim jinsung on 2018/09/17. * Created by kim jinsung on 2018/09/17.
...@@ -62,4 +67,32 @@ public class PushMessageLogic extends AbstractLogic { ...@@ -62,4 +67,32 @@ public class PushMessageLogic extends AbstractLogic {
public void updateReadingFlg(long pushMessageId) { public void updateReadingFlg(long pushMessageId) {
mPushMessageDao.updateReadingFlg(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();
}
}
} }
...@@ -10,7 +10,9 @@ import android.graphics.Bitmap; ...@@ -10,7 +10,9 @@ import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.util.Log;
import android.view.Gravity; import android.view.Gravity;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
...@@ -34,14 +36,19 @@ import android.widget.RadioGroup; ...@@ -34,14 +36,19 @@ import android.widget.RadioGroup;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.handmark.pulltorefresh.library.PullToRefreshBase; import com.handmark.pulltorefresh.library.PullToRefreshBase;
import net.lingala.zip4j.exception.ZipException; import net.lingala.zip4j.exception.ZipException;
import org.json.adf.JSONArray;
import org.json.adf.JSONException;
import org.json.adf.JSONObject; import org.json.adf.JSONObject;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
...@@ -56,6 +63,7 @@ import java.util.Stack; ...@@ -56,6 +63,7 @@ import java.util.Stack;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient; import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON; import jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON;
import jp.agentec.abook.abv.bl.acms.client.json.OperationListJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters;
import jp.agentec.abook.abv.bl.acms.type.AcmsApis; import jp.agentec.abook.abv.bl.acms.type.AcmsApis;
import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType; import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
...@@ -90,6 +98,7 @@ import jp.agentec.abook.abv.bl.dto.TaskReportDto; ...@@ -90,6 +98,7 @@ import jp.agentec.abook.abv.bl.dto.TaskReportDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationGroupMasterLogic; import jp.agentec.abook.abv.bl.logic.OperationGroupMasterLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic; import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.viewer.activity.OnlineHTMLWebViewActivity; import jp.agentec.abook.abv.ui.viewer.activity.OnlineHTMLWebViewActivity;
...@@ -163,6 +172,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -163,6 +172,7 @@ public class OperationListActivity extends ABVUIActivity {
private TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class); private TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class);
private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class); private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class);
private OperationGroupMasterLogic mOperationGroupMasterLogic = AbstractLogic.getLogic(OperationGroupMasterLogic.class); private OperationGroupMasterLogic mOperationGroupMasterLogic = AbstractLogic.getLogic(OperationGroupMasterLogic.class);
private PushMessageLogic mPushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class);
private TaskDao mTaskDao = AbstractDao.getDao(TaskDao.class); private TaskDao mTaskDao = AbstractDao.getDao(TaskDao.class);
private boolean activityResultFlg; private boolean activityResultFlg;
...@@ -219,7 +229,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -219,7 +229,7 @@ public class OperationListActivity extends ABVUIActivity {
WebSettings settings = mCheckWebView.getSettings(); WebSettings settings = mCheckWebView.getSettings();
settings.setJavaScriptEnabled(true); //Javascriptを有効にする。 settings.setJavaScriptEnabled(true); //Javascriptを有効にする。
settings.setAppCacheEnabled(true); settings.setAppCacheEnabled(true);
settings.setCacheMode(WebSettings.LOAD_NO_CACHE); settings.setCacheMode(WebSettings.LOAD_DEFAULT);
settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
settings.setDomStorageEnabled(true); settings.setDomStorageEnabled(true);
...@@ -236,74 +246,15 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -236,74 +246,15 @@ public class OperationListActivity extends ABVUIActivity {
paramList.add("debug=1"); paramList.add("debug=1");
paramList.add("mobile_flg=1"); paramList.add("mobile_flg=1");
paramList.add("is_android=1"); paramList.add("is_android=1");
paramList.add("app=android");
mCheckWebView.postUrl(OPERATION_LIST_PAGE + StringUtil.join("&", paramList), null); mCheckWebView.postUrl(OPERATION_LIST_PAGE + StringUtil.join("&", paramList), null);
mListHelper = getListHelper(); mListHelper = getListHelper();
updateNeedSyncRoutineOperation(); updateNeedSyncRoutineOperation();
mOperationGroupMasterServiceOperationFlg = ABVDataCache.getInstance().serviceOption.isOperationGroupMaster(); mOperationGroupMasterServiceOperationFlg = ABVDataCache.getInstance().serviceOption.isOperationGroupMaster();
//setOperationListView();
// 検索ボタン
// 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(); // 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();
// }
// });
//
// if (ABVDataCache.getInstance().serviceOption.isUnableIOReport()) { // if (ABVDataCache.getInstance().serviceOption.isUnableIOReport()) {
// // 簡易帳票印刷ボタン // // 簡易帳票印刷ボタン
// mQuickReportPrintButton.setOnClickListener(new View.OnClickListener() { // mQuickReportPrintButton.setOnClickListener(new View.OnClickListener() {
...@@ -407,27 +358,67 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -407,27 +358,67 @@ public class OperationListActivity extends ABVUIActivity {
// getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName)); // getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName));
// } // }
// //
// // リスト更新
// setOperationListView();
} }
private class JsInf { private class JsInf {
@JavascriptInterface @JavascriptInterface
public void sendParam(String param) { public void sendParam(String param) {
JSONObject jsonParam = new JSONObject(param); JSONObject jsonParam = new JSONObject(param);
OperationDto operationDto;
if (jsonParam.has("cmd")) { if (jsonParam.has("cmd")) {
switch (jsonParam.getString("cmd")){ switch (jsonParam.getString("cmd")){
case "goSetting": case "goSetting":
showSetting(); showSetting();
break; break;
case "": case "goRelationContent":
showCommonContent();
break;
case "goPrintTarget":
showPrintTargetSelect();
break;
case "goOperation":
if (!jsonParam.has("operationId")) {
break; break;
} }
final OperationDto tempOperationDto = mOperationDao.getOperationJoinContent(jsonParam.getInt("operationId"));
runOnUiThread(new Runnable() {
@Override
public void run() {
startSyncOperation(tempOperationDto);
}
});
openReportView(tempOperationDto);
break;
case "goCommunication":
showCommunicationMenuDialog();
break;
case "goPanoramaEdit":
final OperationDto panoramaOperationDto = mOperationDao.getOperationJoinContent(jsonParam.getInt("operationId"));
runOnUiThread(new Runnable() {
@Override
public void run() {
startSyncOperation(panoramaOperationDto);
}
});
startTaskDirectionOrReportView(panoramaOperationDto);
break;
} }
} }
} }
@JavascriptInterface
public String getCachePath() {
return getCacheDir().getAbsolutePath();
}
}
// 共通資料画面表示 // 共通資料画面表示
private void showCommonContent() { private void showCommonContent() {
Intent intent = new Intent(); Intent intent = new Intent();
...@@ -518,15 +509,10 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -518,15 +509,10 @@ public class OperationListActivity extends ABVUIActivity {
*/ */
public void setOperationListView() { public void setOperationListView() {
mListHelper = getListHelper(); mListHelper = getListHelper();
handler.post(new ReloadHandler()); //setPagereLoad
configurationToolbarIcon(); //handler.post(new ReloadHandler());
} }
// ビューを作り直さずにリストだけ更新する
public void refreshOperationList() {
mListHelper.refreshList();
configurationToolbarIcon();
}
@Override @Override
public void onRefreshedContent(final boolean result, long contentId, Exception e) { public void onRefreshedContent(final boolean result, long contentId, Exception e) {
...@@ -546,7 +532,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -546,7 +532,7 @@ public class OperationListActivity extends ABVUIActivity {
if (mOperationGroupMasterServiceOperationFlg == ABVDataCache.getInstance().serviceOption.isOperationGroupMaster()) { if (mOperationGroupMasterServiceOperationFlg == ABVDataCache.getInstance().serviceOption.isOperationGroupMaster()) {
// サービスオプションが変わってない場合は、ビューは作らずにデータのみ更新 // サービスオプションが変わってない場合は、ビューは作らずにデータのみ更新
refreshOperationList(); //screenRefresh();
} else { } else {
// 初期化 // 初期化
getABVUIDataCache().clearOperationGroupMaster(); getABVUIDataCache().clearOperationGroupMaster();
...@@ -582,39 +568,12 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -582,39 +568,12 @@ public class OperationListActivity extends ABVUIActivity {
// 一括同期中の場合何もしない // 一括同期中の場合何もしない
return; 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) { if (operationId != -1) {
final OperationDto operationDto = mOperationLogic.getOperation(operationId); final OperationDto operationDto = mOperationLogic.getOperation(operationId);
// リソースパターンの適用
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); dataRefresh(true);
} // リソースパターンの適用
});
} }
if (!activityResultFlg && operationId == -1) { if (!activityResultFlg && operationId == -1) {
...@@ -622,8 +581,19 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -622,8 +581,19 @@ public class OperationListActivity extends ABVUIActivity {
} }
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, -1L); putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, -1L);
activityResultFlg = false; activityResultFlg = false;
showProgressPopup();
runOnUiThread(new Runnable() {
@Override
public void run() {
try {
createJsonForOperationList(getCacheDir().getAbsolutePath());
closeProgressPopup();
} catch (Exception e) {
Logger.d("Update error");
}
}
});
configurationToolbarIcon();*/
} }
// 検索ダイアログ表示 // 検索ダイアログ表示
...@@ -685,7 +655,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -685,7 +655,7 @@ public class OperationListActivity extends ABVUIActivity {
mStartDateStr = StringUtil.toString(mStartDate.getText()); mStartDateStr = StringUtil.toString(mStartDate.getText());
mEndDateStr = StringUtil.toString(mEndDate.getText()); mEndDateStr = StringUtil.toString(mEndDate.getText());
refreshOperationList(); screenRefresh();
mSearchDialog.dismiss(); mSearchDialog.dismiss();
// 検索条件に条件がある場合のみ、件数のトーストメッセージは表示する // 検索条件に条件がある場合のみ、件数のトーストメッセージは表示する
...@@ -721,7 +691,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -721,7 +691,6 @@ public class OperationListActivity extends ABVUIActivity {
int month = calendar.get(Calendar.MONTH); int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DAY_OF_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() { final DatePickerDialog dpd = new DatePickerDialog(this, android.R.style.Theme_Holo_Light_Dialog, new DatePickerDialog.OnDateSetListener() {
@Override @Override
...@@ -1014,7 +983,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1014,7 +983,7 @@ public class OperationListActivity extends ABVUIActivity {
progressDialogHorizontal.setProgress(100); progressDialogHorizontal.setProgress(100);
} }
mOperationLastEditDate = null; mOperationLastEditDate = null;
refreshOperationList(); //screenRefresh();
closeProgressPopup(); closeProgressPopup();
} }
}); });
...@@ -1324,7 +1293,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1324,7 +1293,7 @@ public class OperationListActivity extends ABVUIActivity {
if (requestCode == SUB_DIVICE_IMAGE_LIST_ACTIVITY && resultCode == RESULT_OK) { if (requestCode == SUB_DIVICE_IMAGE_LIST_ACTIVITY && resultCode == RESULT_OK) {
mOperationLogic.setContentCreatingFlg(mSelectedOperationId); mOperationLogic.setContentCreatingFlg(mSelectedOperationId);
refreshOperationList(); //screenRefresh();
//10秒(コンテンツ作成し、公開までの時間)に新着更新させる。 //10秒(コンテンツ作成し、公開までの時間)に新着更新させる。
showProgressView(getString(R.string.msg_common_processing)); showProgressView(getString(R.string.msg_common_processing));
...@@ -1842,7 +1811,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1842,7 +1811,7 @@ public class OperationListActivity extends ABVUIActivity {
Logger.d(TAG, "onClickSortMenuByTablet id:" + id); Logger.d(TAG, "onClickSortMenuByTablet id:" + id);
getABVUIDataCache().setSortCondition((int)id); getABVUIDataCache().setSortCondition((int)id);
// ビューア更新 // ビューア更新
refreshOperationList(); screenRefresh();
} }
}); });
...@@ -1883,7 +1852,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1883,7 +1852,7 @@ public class OperationListActivity extends ABVUIActivity {
@Override @Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
getABVUIDataCache().setSortCondition((int)id); getABVUIDataCache().setSortCondition((int)id);
refreshOperationList(); screenRefresh();
} }
}); });
...@@ -2002,4 +1971,26 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -2002,4 +1971,26 @@ public class OperationListActivity extends ABVUIActivity {
return getABVUIDataCache().getSortCondition(); return getABVUIDataCache().getSortCondition();
} }
public void createJsonForOperationList(String filePath) {
mOperationLogic.createOperationListJson(filePath);
mOperationGroupMasterLogic.createOperationGroupMasterListJson(filePath);
mOperationGroupMasterLogic.createOperationGroupMasterRelationListJson(filePath);
mPushMessageLogic.createOperationPushMessageListJson(filePath);
}
public void screenRefresh() {
showProgressPopup();
runOnUiThread(new Runnable() {
@Override
public void run() {
try {
createJsonForOperationList(getCacheDir().getAbsolutePath());
mCheckWebView.loadUrl("javascript:location.reload();");
closeProgressPopup();
} catch (Exception e) {
Logger.d("Update error");
}
}
});
}
} }
...@@ -155,4 +155,11 @@ public class OperationGroupMasterListHelper extends CategoryOperationListHelper< ...@@ -155,4 +155,11 @@ public class OperationGroupMasterListHelper extends CategoryOperationListHelper<
public List<OperationGroupMasterDto> getChildList(Integer operationGroupMasterId) { public List<OperationGroupMasterDto> getChildList(Integer operationGroupMasterId) {
return mOperationGroupMasterDao.getOperationGroupMasterChildList(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 { ...@@ -245,15 +245,6 @@ public abstract class OperationListHelper {
} }
/** /**
* 作業の画面更新
*/
public void refreshList() {
if (mAdapter != null) {
mAdapter.setItem(filterOperationList());
}
}
/**
* 作業の件数取得 * 作業の件数取得
* @return * @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