Commit b6731bf7 by Lee Jaebin

#34190 作業種別毎に作業を絞り込み機能追加

parent fd257eb8
...@@ -62,6 +62,8 @@ public class ABVEnvironment { ...@@ -62,6 +62,8 @@ public class ABVEnvironment {
// Serverから取得したcontentVersion時のリソースパターンを一時的に保存するための変数 // Serverから取得したcontentVersion時のリソースパターンを一時的に保存するための変数
public int resourcePatternType; public int resourcePatternType;
public boolean operationGroupMasterClearFlg;
////////////////////////////// 定数 ////////////////////////////////// ////////////////////////////// 定数 //////////////////////////////////
private static final String ServerTimeKey = "ABook"; private static final String ServerTimeKey = "ABook";
...@@ -227,6 +229,22 @@ public class ABVEnvironment { ...@@ -227,6 +229,22 @@ public class ABVEnvironment {
return logLevel; return logLevel;
} }
/**
* 作業種別のクリア判定フラグをセット
* @param clearFlg
*/
public void setOperationGroupMasterClearFlg(boolean clearFlg) {
this.operationGroupMasterClearFlg = clearFlg;
}
/**
* 作業種別のクリア判定フラグ取得
* @return
*/
public boolean getOperationGroupMasterClearFlg() {
return operationGroupMasterClearFlg;
}
///////////////////////////////////////     以下ファイルパス関係     /////////////////////////////////////// ///////////////////////////////////////     以下ファイルパス関係     ///////////////////////////////////////
......
...@@ -243,11 +243,10 @@ public class OperationDao extends AbstractDao { ...@@ -243,11 +243,10 @@ public class OperationDao extends AbstractDao {
* @param searchStartDateStr * @param searchStartDateStr
* @param searchEndDateStr * @param searchEndDateStr
* @param reportTypeStr * @param reportTypeStr
* @param operationGroupMasterId
* @return * @return
*/ */
public List<OperationDto> getOperations(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr, Integer operationGroupMasterId) { public List<OperationDto> getOperations(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) {
String sql = generateGetOperationQuery(searchOperationName, searchStartDateStr, searchEndDateStr, reportTypeStr, operationGroupMasterId); String sql = generateGetOperationQuery(searchOperationName, searchStartDateStr, searchEndDateStr, reportTypeStr);
return rawQueryGetDtoList(sql, null, OperationDto.class); return rawQueryGetDtoList(sql, null, OperationDto.class);
} }
...@@ -258,10 +257,9 @@ public class OperationDao extends AbstractDao { ...@@ -258,10 +257,9 @@ public class OperationDao extends AbstractDao {
* @param searchStartDateStr * @param searchStartDateStr
* @param searchEndDateStr * @param searchEndDateStr
* @param reportTypeStr * @param reportTypeStr
* @param operationGroupMasterId
* @return * @return
*/ */
private String generateGetOperationQuery(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr, Integer operationGroupMasterId) { private String generateGetOperationQuery(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) {
String curDate = DateTimeUtil.toStringInTimeZone(new Date(), DateTimeFormat.yyyyMMddHHmmss_hyphen, "UTC"); String curDate = DateTimeUtil.toStringInTimeZone(new Date(), DateTimeFormat.yyyyMMddHHmmss_hyphen, "UTC");
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
...@@ -306,12 +304,6 @@ public class OperationDao extends AbstractDao { ...@@ -306,12 +304,6 @@ public class OperationDao extends AbstractDao {
sql.append(" LEFT OUTER JOIN r_operation_content AS rpc "); sql.append(" LEFT OUTER JOIN r_operation_content AS rpc ");
sql.append(" ON top.operation_id = rpc.operation_id "); sql.append(" ON top.operation_id = rpc.operation_id ");
sql.append(" AND rpc.operation_content_flg = 1 "); sql.append(" AND rpc.operation_content_flg = 1 ");
// 作業種別IDに紐づく作業のみ検索するため、INNER JOINする
if (operationGroupMasterId != null) {
sql.append(" INNER JOIN r_operation_group_master_relation AS rogmo ");
sql.append(" ON rogmo.operation_id = top.operation_id ");
sql.append(" AND rogmo.operation_group_master_id =" + operationGroupMasterId);
}
sql.append(" WHERE top.operation_id IS NOT NULL "); sql.append(" WHERE top.operation_id IS NOT NULL ");
if (!StringUtil.isNullOrEmpty(searchOperationName)) { if (!StringUtil.isNullOrEmpty(searchOperationName)) {
sql.append(" AND top.operation_name GLOB " + "'*" + searchOperationName + "*'"); sql.append(" AND top.operation_name GLOB " + "'*" + searchOperationName + "*'");
...@@ -353,12 +345,12 @@ public class OperationDao extends AbstractDao { ...@@ -353,12 +345,12 @@ public class OperationDao extends AbstractDao {
* @return 作業リスト * @return 作業リスト
*/ */
public List<OperationDto> getOperationByReportType(Integer reportType) { public List<OperationDto> getOperationByReportType(Integer reportType) {
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
sql.append(" SELECT * "); sql.append(" SELECT * ");
sql.append(" FROM t_operation "); sql.append(" FROM t_operation ");
sql.append(" WHERE report_type = ?"); sql.append(" WHERE report_type = ?");
return rawQueryGetDtoList(sql.toString(), new String[] { "" + reportType }, OperationDto.class); return rawQueryGetDtoList(sql.toString(), new String[] { "" + reportType }, OperationDto.class);
} }
/** /**
* ユーザ情報でグループが変更した時のみ使用 * ユーザ情報でグループが変更した時のみ使用
...@@ -370,4 +362,19 @@ public class OperationDao extends AbstractDao { ...@@ -370,4 +362,19 @@ public class OperationDao extends AbstractDao {
updateNeedSyncFlg(operationDto.operationId, true); updateNeedSyncFlg(operationDto.operationId, true);
} }
} }
/**
* 作業種別IDで関連する作業リストを取得
* @param operationGroupMasterId
* @return
*/
public List<OperationDto> getOperationByOperationGroupMasterId(Integer operationGroupMasterId) {
StringBuffer sql = new StringBuffer();
sql.append(" SELECT * ");
sql.append(" FROM t_operation AS top");
sql.append(" INNER JOIN r_operation_group_master_relation AS rog");
sql.append(" ON rog.operation_id = top.operation_id");
sql.append(" WHERE rog.operation_group_master_id = ?");
return rawQueryGetDtoList(sql.toString(), new String[] { "" + operationGroupMasterId }, OperationDto.class);
}
} }
\ No newline at end of file
...@@ -8,11 +8,15 @@ import java.util.Map; ...@@ -8,11 +8,15 @@ import java.util.Map;
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.OperationGroupMasterJSON; 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.common.ABVEnvironment;
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.ABVDataCache;
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.OperationGroupMasterDao; import jp.agentec.abook.abv.bl.data.dao.OperationGroupMasterDao;
import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto; import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto;
import jp.agentec.abook.abv.bl.dto.OperationGroupMasterRelationDto; 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;
...@@ -25,48 +29,58 @@ public class OperationGroupMasterLogic extends AbstractLogic { ...@@ -25,48 +29,58 @@ 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 OperationDao mOperationDao = AbstractDao.getDao(OperationDao.class);
/** /**
* 作業種別・作業種別に紐づいた作業IDを取得して * 作業種別・作業種別に紐づいた作業IDを取得して
* DBに登録する * DBに登録する
*/ */
public void setOperationGroupMaster() throws NetworkDisconnectedException, AcmsException { public void setOperationGroupMaster() throws NetworkDisconnectedException, AcmsException {
try {
// サーバー通信で、作業種別情報を取得する
List<OperationGroupMasterDto> serverOperationGroupMasterDtos = getOperationGroupMasterServerData();
// ローカルDBに存在する作業種別情報をDto配列でセット
List<OperationGroupMasterDto> localOperationGroupMasterDtos = mOperationGroupMasterDao.getAllOperationGroupMaster();
List<Integer> localOperationGroupMasterIds = new ArrayList<Integer>();
boolean updateFlg = false;
for (OperationGroupMasterDto serverOperationGroupMasterDto : serverOperationGroupMasterDtos) {
// DB登録フラグ
boolean insertFlg = true;
for (OperationGroupMasterDto localOperationGroupMasterDto : localOperationGroupMasterDtos) {
// サーバーで取得したIDでローカルに存在するか比較して、更新・登録を判定
if (serverOperationGroupMasterDto.operationGroupMasterId == localOperationGroupMasterDto.operationGroupMasterId) {
// DB更新処理(作業種別の親階層が変更されたか、作業種別名が変更されたときのみ)
if (serverOperationGroupMasterDto.parentOperationGroupMasterId != localOperationGroupMasterDto.parentOperationGroupMasterId || !serverOperationGroupMasterDto.operationGroupMasterName.equals(localOperationGroupMasterDto.operationGroupMasterName)) {
Logger.d(TAG, "[UPDATE] OperationGroupMaster operationGroupMasterId=" + serverOperationGroupMasterDto.operationGroupMasterId + " operationGroupMasterName=" + serverOperationGroupMasterDto.operationGroupMasterName);
mOperationGroupMasterDao.updateOperationGroupMaster(serverOperationGroupMasterDto);
updateFlg = true;
}
// 更新処理が終わったら登録フラグをfalseにしてlocalOperationGroupMasterDtosから除外する
insertFlg = false;
localOperationGroupMasterDtos.remove(localOperationGroupMasterDto);
break;
}
}
// サーバー通信で、作業種別情報を取得する // 更新されたら以下の処理は行わない
List<OperationGroupMasterDto> serverOperationGroupMasterDtos = getOperationGroupMasterServerData(); if (insertFlg) {
// ローカルDBに存在する作業種別情報をDto配列でセット Logger.d(TAG, "[INSERT] OperationGroupMaster operationGroupMasterId=" + serverOperationGroupMasterDto.operationGroupMasterId + " operationGroupMasterName=" + serverOperationGroupMasterDto.operationGroupMasterName);
List<OperationGroupMasterDto> localOperationGroupMasterDtos = mOperationGroupMasterDao.getAllOperationGroupMaster(); // DB登録処理
List<Integer> localOperationGroupMasterIds = new ArrayList<Integer>(); mOperationGroupMasterDao.insertOperationGroupMaster(serverOperationGroupMasterDto);
for (OperationGroupMasterDto serverOperationGroupMasterDto : serverOperationGroupMasterDtos) {
// DB登録フラグ
boolean insertFlg = true;
for (OperationGroupMasterDto localOperationGroupMasterDto : localOperationGroupMasterDtos) {
// サーバーで取得したIDでローカルに存在するか比較して、更新・登録を判定
if (serverOperationGroupMasterDto.operationGroupMasterId == localOperationGroupMasterDto.operationGroupMasterId) {
// DB更新処理
Logger.d(TAG, "[UPDATE] OperationGroupMaster operationGroupMasterId=" + serverOperationGroupMasterDto.operationGroupMasterId + " operationGroupMasterName=" + serverOperationGroupMasterDto.operationGroupMasterName);
mOperationGroupMasterDao.updateOperationGroupMaster(serverOperationGroupMasterDto);
// 更新処理が終わったら登録フラグをfalseにしてlocalOperationGroupMasterDtosから除外する
insertFlg = false;
localOperationGroupMasterDtos.remove(localOperationGroupMasterDto);
break;
} }
} }
// 更新されたら以下の処理は行わない // 作業種別関連テーブルの削除処理
if (insertFlg) { for (OperationGroupMasterDto deleteOperationGroupMasterDto : localOperationGroupMasterDtos) {
Logger.d(TAG, "[INSERT] OperationGroupMaster operationGroupMasterId=" + serverOperationGroupMasterDto.operationGroupMasterId + " operationGroupMasterName=" + serverOperationGroupMasterDto.operationGroupMasterName); updateFlg = true;
// DB登録処理 mOperationGroupMasterDao.delete(deleteOperationGroupMasterDto);
mOperationGroupMasterDao.insertOperationGroupMaster(serverOperationGroupMasterDto);
} }
}
// 作業種別関連テーブルの削除処理 // 作業種別のクリアフラグをセット
for (OperationGroupMasterDto deleteOperationGroupMasterDto : localOperationGroupMasterDtos) { ABVEnvironment.getInstance().setOperationGroupMasterClearFlg(updateFlg);
mOperationGroupMasterDao.delete(deleteOperationGroupMasterDto); } catch (Exception e) {
Logger.e(e.getMessage());
} }
} }
...@@ -129,7 +143,12 @@ public class OperationGroupMasterLogic extends AbstractLogic { ...@@ -129,7 +143,12 @@ public class OperationGroupMasterLogic extends AbstractLogic {
return mOperationGroupMasterDao.getLastGroupLevel(); return mOperationGroupMasterDao.getLastGroupLevel();
} }
public List<OperationGroupMasterDto> test (Integer operationGroupMasterId) { /**
* 親の階層パスをリストでセット
* @param operationGroupMasterId
* @return
*/
public List<OperationGroupMasterDto> getParentOperationGroupMasterForPath (Integer operationGroupMasterId) {
List<OperationGroupMasterDto> operationGroupMasterDtoList = new ArrayList<OperationGroupMasterDto>(); List<OperationGroupMasterDto> operationGroupMasterDtoList = new ArrayList<OperationGroupMasterDto>();
// 作業種別DTO取得 // 作業種別DTO取得
OperationGroupMasterDto dto = mOperationGroupMasterDao.getOperationGroupMaster(operationGroupMasterId); OperationGroupMasterDto dto = mOperationGroupMasterDao.getOperationGroupMaster(operationGroupMasterId);
...@@ -144,4 +163,13 @@ public class OperationGroupMasterLogic extends AbstractLogic { ...@@ -144,4 +163,13 @@ public class OperationGroupMasterLogic extends AbstractLogic {
Collections.sort(operationGroupMasterDtoList, new OperationGroupMasterLevelComparator()); Collections.sort(operationGroupMasterDtoList, new OperationGroupMasterLevelComparator());
return operationGroupMasterDtoList; return operationGroupMasterDtoList;
} }
/**
* 作業種別IDで関連する作業リストを取得
* @param operationGroupMasterId
* @return
*/
public List<OperationDto> getOperationByOperationGroupMasterId(Integer operationGroupMasterId) {
return mOperationDao.getOperationByOperationGroupMasterId(operationGroupMasterId);
}
} }
...@@ -1074,9 +1074,9 @@ public class OperationLogic extends AbstractLogic { ...@@ -1074,9 +1074,9 @@ public class OperationLogic extends AbstractLogic {
* @param searchEndDateStr * @param searchEndDateStr
* @return * @return
*/ */
public List<OperationDto> getRefreshOperation(String searchWord, String searchStartDateStr, String searchEndDateStr, String reportTypeStr, Integer operationGroupMasterId) { public List<OperationDto> getRefreshOperation(String searchWord, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) {
List<OperationDto> operationDtoList; List<OperationDto> operationDtoList;
operationDtoList = mOperationDao.getOperations(searchWord, searchStartDateStr, searchEndDateStr, reportTypeStr, operationGroupMasterId); operationDtoList = mOperationDao.getOperations(searchWord, searchStartDateStr, searchEndDateStr, reportTypeStr);
for (OperationDto operationDto : operationDtoList) { for (OperationDto operationDto : operationDtoList) {
// 作業送信フラグが存在する場合またはホットスポット更新フラグが存在する場合、needSyncFlgをtrueにセット // 作業送信フラグが存在する場合またはホットスポット更新フラグが存在する場合、needSyncFlgをtrueにセット
if (mTaskReportDao.isExistSendTaskData(operationDto.operationId) || mTaskReportDao.isExistUpdateTargetHotSpotTaskData(operationDto.operationId)) { if (mTaskReportDao.isExistSendTaskData(operationDto.operationId) || mTaskReportDao.isExistUpdateTargetHotSpotTaskData(operationDto.operationId)) {
......
...@@ -24,21 +24,61 @@ ...@@ -24,21 +24,61 @@
<ImageButton <ImageButton
android:id="@+id/icon_filter" android:id="@+id/icon_filter"
style="@style/ToolBarIcon" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/btn_view_mode" android:layout_toRightOf="@+id/btn_view_mode"
android:onClick="onClickOperationFilterList" android:onClick="onClickOperationFilterList"
android:src="@drawable/ic_filter" /> android:background="@drawable/ic_filter" />
<ImageButton <ImageButton
android:id="@+id/icon_operation_group_master" android:id="@+id/btn_search"
style="@style/ToolBarIcon" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/icon_filter" android:layout_toRightOf="@+id/icon_filter"
android:src="@drawable/ic_filter" android:background="@drawable/ic_operation_search" />
android:visibility="gone"/>
<RadioGroup
android:id="@+id/segment_group"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/btn_search"
android:orientation="horizontal"
android:visibility="visible">
<RadioButton
android:id="@+id/operation_location_type_all"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/radio_left"
android:button="@null"
android:checked="true"
android:gravity="center"
android:onClick="onClickOperationLocationType"
android:text="全て"
android:textColor="@color/operation_default_text_color"
android:textStyle="bold" />
<RadioButton
android:id="@+id/operation_location_type_group"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/radio_right"
android:button="@null"
android:gravity="center"
android:onClick="onClickOperationLocationType"
android:text="カテゴリ"
android:textColor="@color/operation_default_text_color"
android:textStyle="bold" />
</RadioGroup>
<TextView <TextView
android:id="@+id/title" android:id="@+id/title"
...@@ -84,18 +124,8 @@ ...@@ -84,18 +124,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:layout_toLeftOf="@+id/btn_search"
android:background="@drawable/ic_communication_menu" />
<ImageButton
android:id="@+id/btn_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:layout_toLeftOf="@+id/btn_sub_menu" android:layout_toLeftOf="@+id/btn_sub_menu"
android:background="@drawable/ic_operation_search" android:background="@drawable/ic_communication_menu" />
android:contentDescription="@string/list" />
<ImageButton <ImageButton
android:id="@+id/btn_sub_menu" android:id="@+id/btn_sub_menu"
...@@ -131,6 +161,9 @@ ...@@ -131,6 +161,9 @@
android:id="@+id/operation_list_layout" android:id="@+id/operation_list_layout"
style="@style/operation_list_bg" style="@style/operation_list_bg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -9,6 +9,7 @@ import jp.agentec.abook.abv.cl.util.PreferenceUtil; ...@@ -9,6 +9,7 @@ import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.DefPrefKey; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.DefPrefKey;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.OperationLocationType;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
...@@ -132,7 +133,7 @@ public class ABVUIDataCache { ...@@ -132,7 +133,7 @@ public class ABVUIDataCache {
* 保持していた作業種別のデータをクリアする * 保持していた作業種別のデータをクリアする
*/ */
public void clearOperationGroupMaster() { public void clearOperationGroupMaster() {
setOperationGroupMasterMode(AppDefType.OperationGroupMasterMode.NO); setOperationGroupMasterMode(OperationLocationType.ALL);
setOperationGroupMasterId(0); setOperationGroupMasterId(0);
operationGroupMasterStack.clear(); operationGroupMasterStack.clear();
} }
......
...@@ -13,9 +13,9 @@ public interface AppDefType { ...@@ -13,9 +13,9 @@ public interface AppDefType {
} }
// 作業種別モードフラグ // 作業種別モードフラグ
interface OperationGroupMasterMode { interface OperationLocationType {
int NO = 0; int ALL = 0;
int YES = 1; int GROUP = 1;
} }
interface DefPrefKey { interface DefPrefKey {
......
...@@ -125,7 +125,7 @@ public abstract class HierarchyOperationListHelper<StackObject> extends Operatio ...@@ -125,7 +125,7 @@ public abstract class HierarchyOperationListHelper<StackObject> extends Operatio
int popCount = mBreadCrumbsLayout.getChildCount() - button.level; int popCount = mBreadCrumbsLayout.getChildCount() - button.level;
if (popCount > 0) { if (popCount > 0) {
popList(popCount); popList(popCount, true);
} }
} }
...@@ -143,7 +143,7 @@ public abstract class HierarchyOperationListHelper<StackObject> extends Operatio ...@@ -143,7 +143,7 @@ public abstract class HierarchyOperationListHelper<StackObject> extends Operatio
* *
* @param popCount いくつ上の階層を表示するか指定します。 * @param popCount いくつ上の階層を表示するか指定します。
*/ */
abstract public void popList(int popCount); abstract public void popList(int popCount, boolean isReload);
/** /**
* 一つ下の階層のリストへ移動する * 一つ下の階層のリストへ移動する
......
...@@ -27,6 +27,6 @@ public class HomeOperationListHelper extends OperationListHelper { ...@@ -27,6 +27,6 @@ public class HomeOperationListHelper extends OperationListHelper {
@Override @Override
protected List<OperationDto> findOperationList() throws Exception { protected List<OperationDto> findOperationList() throws Exception {
String reportTypeStr = getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null); String reportTypeStr = getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null);
return operationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, reportTypeStr, null); return operationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, reportTypeStr);
} }
} }
...@@ -3,6 +3,7 @@ package jp.agentec.abook.abv.ui.home.helper; ...@@ -3,6 +3,7 @@ package jp.agentec.abook.abv.ui.home.helper;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
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.OperationGroupMasterDao; import jp.agentec.abook.abv.bl.data.dao.OperationGroupMasterDao;
...@@ -31,7 +32,8 @@ public class OperationGroupMasterListHelper extends HierarchyOperationListHelper ...@@ -31,7 +32,8 @@ public class OperationGroupMasterListHelper extends HierarchyOperationListHelper
if (stack.size() == 0) { if (stack.size() == 0) {
// スタックが空の場合、全体を入れる // スタックが空の場合、全体を入れる
OperationGroupMasterDto operationGroupMasterDto; OperationGroupMasterDto operationGroupMasterDto;
if (mAppActivity.getOperationGroupMasterId() == 0) { // 保存されたoperationGroupmasterIdが0または、存在しない場合
if (mAppActivity.getOperationGroupMasterId() == 0 || !mOperationGroupMasterDao.isExistOperationGroupMaster(mAppActivity.getOperationGroupMasterId())) {
// 最上位階層をセット // 最上位階層をセット
operationGroupMasterDto = mOperationGroupMasterDao.getTopOperationGroupMaster(); operationGroupMasterDto = mOperationGroupMasterDao.getTopOperationGroupMaster();
if (operationGroupMasterDto != null) { if (operationGroupMasterDto != null) {
...@@ -39,7 +41,7 @@ public class OperationGroupMasterListHelper extends HierarchyOperationListHelper ...@@ -39,7 +41,7 @@ public class OperationGroupMasterListHelper extends HierarchyOperationListHelper
} }
} else { } else {
// 前回開いた際のIDでセット // 前回開いた際のIDでセット
List<OperationGroupMasterDto> operationGroupMasterDtoList = mOperationGroupMasterLogic.test(mAppActivity.getOperationGroupMasterId()); List<OperationGroupMasterDto> operationGroupMasterDtoList = mOperationGroupMasterLogic.getParentOperationGroupMasterForPath(mAppActivity.getOperationGroupMasterId());
if (CollectionUtil.isNotEmpty(operationGroupMasterDtoList)) { if (CollectionUtil.isNotEmpty(operationGroupMasterDtoList)) {
for (OperationGroupMasterDto dto : operationGroupMasterDtoList) { for (OperationGroupMasterDto dto : operationGroupMasterDtoList) {
pushList(dto); pushList(dto);
...@@ -55,34 +57,48 @@ public class OperationGroupMasterListHelper extends HierarchyOperationListHelper ...@@ -55,34 +57,48 @@ public class OperationGroupMasterListHelper extends HierarchyOperationListHelper
} }
} }
/**
* データの取得処理(新着更新処理完了後行われる)
* @return
* @throws Exception
*/
@Override @Override
protected List<OperationDto> findOperationList() throws Exception { protected List<OperationDto> findOperationList() throws Exception {
OperationGroupMasterDto peekOperationGroupMasterDto = stack.peek(); OperationGroupMasterDto peekOperationGroupMasterDto = stack.peek();
String reportTypeStr = getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null); String reportTypeStr = getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null);
Integer operationGroupMasterId; Integer operationGroupMasterId = null;
// operationGroupMasterIdのデータが存在しないと // operationGroupMasterIdのデータが存在、且つクリアフラグがfalseの場合
if (mOperationGroupMasterDao.isExistOperationGroupMaster(peekOperationGroupMasterDto.operationGroupMasterId)) { if (mOperationGroupMasterDao.isExistOperationGroupMaster(peekOperationGroupMasterDto.operationGroupMasterId) && !ABVEnvironment.getInstance().getOperationGroupMasterClearFlg()) {
operationGroupMasterId = peekOperationGroupMasterDto.operationGroupMasterId; operationGroupMasterId = peekOperationGroupMasterDto.operationGroupMasterId;
} else { } else {
// 表示する作業種別が既に削除された場合、最上位階層に戻る(リセット) // 表示する作業種別が既に削除された場合、最上位階層に戻る(リセット)
popList(breadCrumbList.size() - 1); popList(breadCrumbList.size() - 1, false);
// 保存されたoperationGroupMasterIDを0にセット // 最上位階層のデータ取得(全体)
mAppActivity.setOperationGroupMasterId(0); OperationGroupMasterDto topLevelOperationGroupMasterDto = mOperationGroupMasterDao.getTopOperationGroupMaster();
//TODO 最上位階層のID取得 if (topLevelOperationGroupMasterDto != null) {
operationGroupMasterId = 0; operationGroupMasterId = topLevelOperationGroupMasterDto.operationGroupMasterId;
// 最上位階層のoperationGroupMasterIdをセット
mAppActivity.setOperationGroupMasterId(operationGroupMasterId);
}
ABVEnvironment.getInstance().setOperationGroupMasterClearFlg(false);
// 作業種別の選択画面を閉じる
mAppActivity.closeOperationGroupMasterDialog();
} }
return operationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, reportTypeStr, operationGroupMasterId); return mOperationGroupMasterLogic.getOperationByOperationGroupMasterId(operationGroupMasterId);
} }
@Override @Override
public void popList(int popCount) { public void popList(int popCount, boolean isReload) {
for (int i = 0; i < popCount; i++) { for (int i = 0; i < popCount; i++) {
stack.pop(); stack.pop();
// パンくずリスト削除 // パンくずリスト削除
removeBreadCrumbs(breadCrumbList.get(breadCrumbList.size() - 1)); removeBreadCrumbs(breadCrumbList.get(breadCrumbList.size() - 1));
} }
refreshList(); if (isReload) {
// 作業一覧画面を更新する
refreshList();
}
} }
@Override @Override
...@@ -121,12 +137,21 @@ public class OperationGroupMasterListHelper extends HierarchyOperationListHelper ...@@ -121,12 +137,21 @@ public class OperationGroupMasterListHelper extends HierarchyOperationListHelper
return groupName; return groupName;
} }
/**
* 親階層の情報で下の階層をリストで取得
* @return List<OperationGroupMasterDto>
*/
@Override @Override
public List<OperationGroupMasterDto> getChildList() { public List<OperationGroupMasterDto> getChildList() {
OperationGroupMasterDto peekOperationGroupMasterDto = stack.peek(); OperationGroupMasterDto peekOperationGroupMasterDto = stack.peek();
return getChildList(peekOperationGroupMasterDto.operationGroupMasterId); return getChildList(peekOperationGroupMasterDto.operationGroupMasterId);
} }
/**
* 親階層のIDで下の階層をリストで取得
* @param operationGroupMasterId
* @return List<OperationGroupMasterDto>
*/
public List<OperationGroupMasterDto> getChildList(Integer operationGroupMasterId) { public List<OperationGroupMasterDto> getChildList(Integer operationGroupMasterId) {
return mOperationGroupMasterDao.getOperationGroupMasterChildList(operationGroupMasterId); return mOperationGroupMasterDao.getOperationGroupMasterChildList(operationGroupMasterId);
} }
......
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