Commit b6731bf7 by Lee Jaebin

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

parent fd257eb8
......@@ -62,6 +62,8 @@ public class ABVEnvironment {
// Serverから取得したcontentVersion時のリソースパターンを一時的に保存するための変数
public int resourcePatternType;
public boolean operationGroupMasterClearFlg;
////////////////////////////// 定数 //////////////////////////////////
private static final String ServerTimeKey = "ABook";
......@@ -227,6 +229,22 @@ public class ABVEnvironment {
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 {
* @param searchStartDateStr
* @param searchEndDateStr
* @param reportTypeStr
* @param operationGroupMasterId
* @return
*/
public List<OperationDto> getOperations(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr, Integer operationGroupMasterId) {
String sql = generateGetOperationQuery(searchOperationName, searchStartDateStr, searchEndDateStr, reportTypeStr, operationGroupMasterId);
public List<OperationDto> getOperations(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) {
String sql = generateGetOperationQuery(searchOperationName, searchStartDateStr, searchEndDateStr, reportTypeStr);
return rawQueryGetDtoList(sql, null, OperationDto.class);
}
......@@ -258,10 +257,9 @@ public class OperationDao extends AbstractDao {
* @param searchStartDateStr
* @param searchEndDateStr
* @param reportTypeStr
* @param operationGroupMasterId
* @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");
StringBuffer sql = new StringBuffer();
......@@ -306,12 +304,6 @@ public class OperationDao extends AbstractDao {
sql.append(" LEFT OUTER JOIN r_operation_content AS rpc ");
sql.append(" ON top.operation_id = rpc.operation_id ");
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 ");
if (!StringUtil.isNullOrEmpty(searchOperationName)) {
sql.append(" AND top.operation_name GLOB " + "'*" + searchOperationName + "*'");
......@@ -353,12 +345,12 @@ public class OperationDao extends AbstractDao {
* @return 作業リスト
*/
public List<OperationDto> getOperationByReportType(Integer reportType) {
StringBuffer sql = new StringBuffer();
sql.append(" SELECT * ");
sql.append(" FROM t_operation ");
sql.append(" WHERE report_type = ?");
return rawQueryGetDtoList(sql.toString(), new String[] { "" + reportType }, OperationDto.class);
}
StringBuffer sql = new StringBuffer();
sql.append(" SELECT * ");
sql.append(" FROM t_operation ");
sql.append(" WHERE report_type = ?");
return rawQueryGetDtoList(sql.toString(), new String[] { "" + reportType }, OperationDto.class);
}
/**
* ユーザ情報でグループが変更した時のみ使用
......@@ -370,4 +362,19 @@ public class OperationDao extends AbstractDao {
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;
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.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.NetworkDisconnectedException;
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.OperationDao;
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.OperationGroupMasterRelationDto;
import jp.agentec.abook.abv.bl.dto.comparator.OperationGroupMasterLevelComparator;
......@@ -25,48 +29,58 @@ public class OperationGroupMasterLogic extends AbstractLogic {
private static final String TAG = "OperationGroupMasterLogic";
private OperationGroupMasterDao mOperationGroupMasterDao = AbstractDao.getDao(OperationGroupMasterDao.class);
private OperationDao mOperationDao = AbstractDao.getDao(OperationDao.class);
/**
* 作業種別・作業種別に紐づいた作業IDを取得して
* DBに登録する
*/
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();
// ローカルDBに存在する作業種別情報をDto配列でセット
List<OperationGroupMasterDto> localOperationGroupMasterDtos = mOperationGroupMasterDao.getAllOperationGroupMaster();
List<Integer> localOperationGroupMasterIds = new ArrayList<Integer>();
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) {
Logger.d(TAG, "[INSERT] OperationGroupMaster operationGroupMasterId=" + serverOperationGroupMasterDto.operationGroupMasterId + " operationGroupMasterName=" + serverOperationGroupMasterDto.operationGroupMasterName);
// DB登録処理
mOperationGroupMasterDao.insertOperationGroupMaster(serverOperationGroupMasterDto);
}
}
// 更新されたら以下の処理は行わない
if (insertFlg) {
Logger.d(TAG, "[INSERT] OperationGroupMaster operationGroupMasterId=" + serverOperationGroupMasterDto.operationGroupMasterId + " operationGroupMasterName=" + serverOperationGroupMasterDto.operationGroupMasterName);
// DB登録処理
mOperationGroupMasterDao.insertOperationGroupMaster(serverOperationGroupMasterDto);
// 作業種別関連テーブルの削除処理
for (OperationGroupMasterDto deleteOperationGroupMasterDto : localOperationGroupMasterDtos) {
updateFlg = true;
mOperationGroupMasterDao.delete(deleteOperationGroupMasterDto);
}
}
// 作業種別関連テーブルの削除処理
for (OperationGroupMasterDto deleteOperationGroupMasterDto : localOperationGroupMasterDtos) {
mOperationGroupMasterDao.delete(deleteOperationGroupMasterDto);
// 作業種別のクリアフラグをセット
ABVEnvironment.getInstance().setOperationGroupMasterClearFlg(updateFlg);
} catch (Exception e) {
Logger.e(e.getMessage());
}
}
......@@ -129,7 +143,12 @@ public class OperationGroupMasterLogic extends AbstractLogic {
return mOperationGroupMasterDao.getLastGroupLevel();
}
public List<OperationGroupMasterDto> test (Integer operationGroupMasterId) {
/**
* 親の階層パスをリストでセット
* @param operationGroupMasterId
* @return
*/
public List<OperationGroupMasterDto> getParentOperationGroupMasterForPath (Integer operationGroupMasterId) {
List<OperationGroupMasterDto> operationGroupMasterDtoList = new ArrayList<OperationGroupMasterDto>();
// 作業種別DTO取得
OperationGroupMasterDto dto = mOperationGroupMasterDao.getOperationGroupMaster(operationGroupMasterId);
......@@ -144,4 +163,13 @@ public class OperationGroupMasterLogic extends AbstractLogic {
Collections.sort(operationGroupMasterDtoList, new OperationGroupMasterLevelComparator());
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 {
* @param searchEndDateStr
* @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;
operationDtoList = mOperationDao.getOperations(searchWord, searchStartDateStr, searchEndDateStr, reportTypeStr, operationGroupMasterId);
operationDtoList = mOperationDao.getOperations(searchWord, searchStartDateStr, searchEndDateStr, reportTypeStr);
for (OperationDto operationDto : operationDtoList) {
// 作業送信フラグが存在する場合またはホットスポット更新フラグが存在する場合、needSyncFlgをtrueにセット
if (mTaskReportDao.isExistSendTaskData(operationDto.operationId) || mTaskReportDao.isExistUpdateTargetHotSpotTaskData(operationDto.operationId)) {
......
......@@ -24,21 +24,61 @@
<ImageButton
android:id="@+id/icon_filter"
style="@style/ToolBarIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/btn_view_mode"
android:onClick="onClickOperationFilterList"
android:src="@drawable/ic_filter" />
android:background="@drawable/ic_filter" />
<ImageButton
android:id="@+id/icon_operation_group_master"
style="@style/ToolBarIcon"
android:id="@+id/btn_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/icon_filter"
android:src="@drawable/ic_filter"
android:visibility="gone"/>
android:background="@drawable/ic_operation_search" />
<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
android:id="@+id/title"
......@@ -84,18 +124,8 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"
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:background="@drawable/ic_operation_search"
android:contentDescription="@string/list" />
android:background="@drawable/ic_communication_menu" />
<ImageButton
android:id="@+id/btn_sub_menu"
......@@ -131,6 +161,9 @@
android:id="@+id/operation_list_layout"
style="@style/operation_list_bg"
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>
\ No newline at end of file
......@@ -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.DefPrefKey;
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.StringUtil;
......@@ -132,7 +133,7 @@ public class ABVUIDataCache {
* 保持していた作業種別のデータをクリアする
*/
public void clearOperationGroupMaster() {
setOperationGroupMasterMode(AppDefType.OperationGroupMasterMode.NO);
setOperationGroupMasterMode(OperationLocationType.ALL);
setOperationGroupMasterId(0);
operationGroupMasterStack.clear();
}
......
......@@ -13,9 +13,9 @@ public interface AppDefType {
}
// 作業種別モードフラグ
interface OperationGroupMasterMode {
int NO = 0;
int YES = 1;
interface OperationLocationType {
int ALL = 0;
int GROUP = 1;
}
interface DefPrefKey {
......
......@@ -93,7 +93,9 @@ import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.OperationLocationType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.ViewMode;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
......@@ -130,6 +132,7 @@ public class OperationListActivity extends ABVUIActivity {
private ImageButton mViewModeButton;
private ImageButton mSearchButton;
private ImageButton mFilterButton;
private ImageButton mCommunicationButton;
private ImageButton mCommonContentButton;
......@@ -190,8 +193,9 @@ public class OperationListActivity extends ABVUIActivity {
private ABVListDialog mShowDialog;
private ImageButton mOperationGroupMasterButton;
private Map<Integer, Integer> operationCountMap;
// 全て・作業種別のセグメントボタン
private RadioGroup mLocationTypeRadioGroup;
// 作業種別のサービスオプション値を保持用フラグ
private boolean mOperationGroupMasterServiceOperationFlg;
......@@ -223,14 +227,18 @@ public class OperationListActivity extends ABVUIActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.ac_operation_list);
mListHelper = getListHelper();
// ビュー変更ボタン
mViewModeButton = (ImageButton) findViewById(R.id.btn_view_mode);
// 検索ボタン
mSearchButton = (ImageButton) findViewById(R.id.btn_search);
// フィルターボタン
mFilterButton = (ImageButton) findViewById(R.id.icon_filter);
mSearchResultLayout = (LinearLayout) findViewById(R.id.search_result);
mTitleView = (TextView) findViewById(R.id.title);
mCommunicationButton = (ImageButton) findViewById(R.id.btn_communication_menu);
mCommonContentButton = (ImageButton) findViewById(R.id.btn_common_content);
mOperationGroupMasterButton = (ImageButton) findViewById(R.id.icon_operation_group_master);
mLocationTypeRadioGroup = (RadioGroup) findViewById(R.id.segment_group);
// 作業一覧のタイトルパータンでセット
mTitleView.setText(PatternStringUtil.patternToString(getApplicationContext(),
......@@ -240,31 +248,21 @@ public class OperationListActivity extends ABVUIActivity {
mViewModeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (getABVUIDataCache().getViewMode() == AppDefType.ViewMode.PANEL) {
getABVUIDataCache().setViewMode(AppDefType.ViewMode.LIST);
if (getABVUIDataCache().getViewMode() == ViewMode.PANEL) {
getABVUIDataCache().setViewMode(ViewMode.LIST);
} else {
getABVUIDataCache().setViewMode(AppDefType.ViewMode.PANEL);
getABVUIDataCache().setViewMode(ViewMode.PANEL);
}
setOperationListView();
}
});
mOperationGroupMasterButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// インジケーター表示
showProgressPopup();
getABVUIDataCache().setOperationGroupMasterMode(AppDefType.OperationGroupMasterMode.YES);
setOperationListView();
//作業種別モードの場合は、作業種別選択ダイアログ画面を表示
showOperationGroupMasterDialog(true, false);
}
});
// サービスオプション(作業種別使用)をセット
mOperationGroupMasterServiceOperationFlg = ABVDataCache.getInstance().serviceOption.isOperationGroupMaster();
// 全て・作業種別のセグメントチェック設定
checkOperationGroupType(getABVUIDataCache().getOperationGroupMasterMode());
// 検索アイコンのクリックイベント
mSearchButton.setOnClickListener(new View.OnClickListener() {
@Override
......@@ -365,9 +363,6 @@ public class OperationListActivity extends ABVUIActivity {
private void configurationToolbarIcon() {
// ツールバーの検索結果レイアウトの表示・非表示
checkShowSearchResult();
List<PushMessageDto> pushMessageDtoList = mPushMessageLogic.getAllPushMessageList();
boolean existUnreadFlg = false;
......@@ -396,19 +391,54 @@ public class OperationListActivity extends ABVUIActivity {
// 作業種別表示・非表示
if (mOperationGroupMasterServiceOperationFlg) {
mOperationGroupMasterButton.setVisibility(View.VISIBLE);
mLocationTypeRadioGroup.setVisibility(View.VISIBLE);
// アイコンの変更
//TODO アイコンを変更(仮アイコン)
if (getABVUIDataCache().getOperationGroupMasterMode() == AppDefType.OperationGroupMasterMode.YES) {
mOperationGroupMasterButton.setImageDrawable(getRDrawable(R.drawable.ic_group_operation));
if (getABVUIDataCache().getOperationGroupMasterMode() == OperationLocationType.GROUP) {
// 検索ワード削除
clearSearch();
// フィルタのリセット
getABVUIDataCache().setOperationReportTypes(mAllOperationReportTypes);
// フィルターボタンを無効にする
mFilterButton.setImageDrawable(getRDrawable(R.drawable.ic_filter));
setEnabledImageButton(mFilterButton);
// 検索ボタンを無効にする
mSearchButton.setImageDrawable(getRDrawable(R.drawable.ic_operation_search));
setEnabledImageButton(mSearchButton);
} else {
mOperationGroupMasterButton.setImageDrawable(getRDrawable(R.drawable.ic_normal_operation));
cancelToolbarEnabledIcon();
}
} else {
// アイコン非表示
mOperationGroupMasterButton.setVisibility(View.GONE);
mLocationTypeRadioGroup.setVisibility(View.GONE);
cancelToolbarEnabledIcon();
}
// ツールバーの検索結果レイアウトの表示・非表示
checkShowSearchResult();
}
// 検索ワードのクリア
private void clearSearch() {
mSearchWord = null;
mStartDateStr = null;
mEndDateStr = null;
clearData();
}
// イメージボタンを無効にする
private void setEnabledImageButton(ImageButton button) {
button.setEnabled(false);
button.setColorFilter(0xaa808080);
}
/**
* ツールバーのアイコンを有効にする
*/
private void cancelToolbarEnabledIcon() {
mFilterButton.setEnabled(true);
mFilterButton.setColorFilter(null);
mSearchButton.setEnabled(true);
mSearchButton.setColorFilter(null);
}
/**
......@@ -514,13 +544,12 @@ public class OperationListActivity extends ABVUIActivity {
mEndDate = (TextView) mSearchDialog.findViewById(R.id.end_date);
// 33
// 検索ダイアログ画面の作業名要素
mSearchTextView = (EditText) mSearchDialog.findViewById(R.id.operation_name);
mSearchTextView.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN && keyCode == KeyEvent.KEYCODE_ENTER) {
Logger.d("------------------------------------------------set key");
//キーボードのエンターキーを無効にする
return true;
}
......@@ -620,13 +649,19 @@ public class OperationListActivity extends ABVUIActivity {
private void clearData() {
// 開始日の初期化
mStartDate.setText(StringUtil.Empty);
if (mStartDate != null) {
mStartDate.setText(StringUtil.Empty);
}
// 終了日の初期化
mEndDate.setText(StringUtil.Empty);
if (mEndDate != null) {
mEndDate.setText(StringUtil.Empty);
}
// プロジェクト名の初期化
mSearchTextView.setText(StringUtil.Empty);
// 作業名の初期化
if (mSearchTextView != null) {
mSearchTextView.setText(StringUtil.Empty);
}
}
// 開始日と終了日のバリデーション
......@@ -1961,11 +1996,10 @@ public class OperationListActivity extends ABVUIActivity {
private void checkSelectedFilterType() {
List<Integer> defaultTypeList = getOperationReportTypeList(true);
ArrayList<Integer> selectedOperationReportTypes = getOperationReportTypeList(false);
ImageButton imgBtn = (ImageButton) findViewById(R.id.icon_filter);
if (defaultTypeList.size() == selectedOperationReportTypes.size()) {
imgBtn.setImageDrawable(getRDrawable(R.drawable.ic_filter));
mFilterButton.setImageDrawable(getRDrawable(R.drawable.ic_filter));
} else {
imgBtn.setImageDrawable(getRDrawable(R.drawable.ic_filter_selected));
mFilterButton.setImageDrawable(getRDrawable(R.drawable.ic_filter_selected));
}
}
......@@ -1997,17 +2031,6 @@ public class OperationListActivity extends ABVUIActivity {
dialog.setTitle(helper.getPeekName(), R.drawable.ic_title_group_operation);
//TODO 多言語化
dialog.setLeftItemOnClickListener("解除", new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
getABVUIDataCache().setOperationGroupMasterMode(AppDefType.OperationGroupMasterMode.NO);
setOperationListView();
}
});
// autoCloseがtrueの場合、下位階層が存在しなければreturnで以下の処理は行わない
if (autoClose && operationGroupMasterDtoList.size() < 1) {
return;
......@@ -2036,7 +2059,7 @@ public class OperationListActivity extends ABVUIActivity {
@Override
public void onClick(View v) {
OperationGroupMasterListHelper helper = (OperationGroupMasterListHelper) mListHelper;
helper.popList(1);
helper.popList(1, true);
// ポップアップ再表示
dialog.dismiss();
showOperationGroupMasterDialog(false, false);
......@@ -2074,7 +2097,7 @@ public class OperationListActivity extends ABVUIActivity {
*/
private OperationListHelper getListHelper() {
OperationListHelper operationListHelper;
if (mOperationGroupMasterServiceOperationFlg && getABVUIDataCache().getOperationGroupMasterMode() == AppDefType.OperationGroupMasterMode.YES) {
if (mOperationGroupMasterServiceOperationFlg && getABVUIDataCache().getOperationGroupMasterMode() == OperationLocationType.GROUP) {
operationListHelper = new OperationGroupMasterListHelper(this);
} else {
operationListHelper = new HomeOperationListHelper(this);
......@@ -2097,4 +2120,51 @@ public class OperationListActivity extends ABVUIActivity {
public void setOperationGroupMasterId(int operationGroupMasterId) {
getABVUIDataCache().setOperationGroupMasterId(operationGroupMasterId);
}
/**
* 作業種別選択画面を閉じる処理
*/
public void closeOperationGroupMasterDialog() {
if (mShowDialog != null && mShowDialog.isShowing()) {
mShowDialog.dismiss();
}
}
/**
* 全て・作業種別セグメントのクリックイベント
* @param view
*/
public void onClickOperationLocationType(View view) {
if (view.getId() == R.id.operation_location_type_group) {
// 種別モード
getABVUIDataCache().setOperationGroupMasterMode(OperationLocationType.GROUP);
} else {
// 全て
getABVUIDataCache().setOperationGroupMasterMode(OperationLocationType.ALL);
}
// プログレスバー表示(ビューが作り終わるとcloseProgressPopup()が呼ばれる
showProgressPopup();
setOperationListView();
if (getABVUIDataCache().getOperationGroupMasterMode() == OperationLocationType.GROUP) {
//作業種別モードの場合は、作業種別選択ダイアログ画面を表示
showOperationGroupMasterDialog(true, false);
}
}
/**
* セグメントのチェック設定
* @param operationGroupType
*/
private void checkOperationGroupType(final int operationGroupType) {
switch (operationGroupType) {
case OperationLocationType.GROUP:
mLocationTypeRadioGroup.check(R.id.operation_location_type_group);
break;
case OperationLocationType.ALL:
default:
mLocationTypeRadioGroup.check(R.id.operation_location_type_all);
break;
}
}
}
......@@ -125,7 +125,7 @@ public abstract class HierarchyOperationListHelper<StackObject> extends Operatio
int popCount = mBreadCrumbsLayout.getChildCount() - button.level;
if (popCount > 0) {
popList(popCount);
popList(popCount, true);
}
}
......@@ -143,7 +143,7 @@ public abstract class HierarchyOperationListHelper<StackObject> extends Operatio
*
* @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 {
@Override
protected List<OperationDto> findOperationList() throws Exception {
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;
import java.util.ArrayList;
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.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.OperationGroupMasterDao;
......@@ -31,7 +32,8 @@ public class OperationGroupMasterListHelper extends HierarchyOperationListHelper
if (stack.size() == 0) {
// スタックが空の場合、全体を入れる
OperationGroupMasterDto operationGroupMasterDto;
if (mAppActivity.getOperationGroupMasterId() == 0) {
// 保存されたoperationGroupmasterIdが0または、存在しない場合
if (mAppActivity.getOperationGroupMasterId() == 0 || !mOperationGroupMasterDao.isExistOperationGroupMaster(mAppActivity.getOperationGroupMasterId())) {
// 最上位階層をセット
operationGroupMasterDto = mOperationGroupMasterDao.getTopOperationGroupMaster();
if (operationGroupMasterDto != null) {
......@@ -39,7 +41,7 @@ public class OperationGroupMasterListHelper extends HierarchyOperationListHelper
}
} else {
// 前回開いた際のIDでセット
List<OperationGroupMasterDto> operationGroupMasterDtoList = mOperationGroupMasterLogic.test(mAppActivity.getOperationGroupMasterId());
List<OperationGroupMasterDto> operationGroupMasterDtoList = mOperationGroupMasterLogic.getParentOperationGroupMasterForPath(mAppActivity.getOperationGroupMasterId());
if (CollectionUtil.isNotEmpty(operationGroupMasterDtoList)) {
for (OperationGroupMasterDto dto : operationGroupMasterDtoList) {
pushList(dto);
......@@ -55,34 +57,48 @@ public class OperationGroupMasterListHelper extends HierarchyOperationListHelper
}
}
/**
* データの取得処理(新着更新処理完了後行われる)
* @return
* @throws Exception
*/
@Override
protected List<OperationDto> findOperationList() throws Exception {
OperationGroupMasterDto peekOperationGroupMasterDto = stack.peek();
String reportTypeStr = getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null);
Integer operationGroupMasterId;
// operationGroupMasterIdのデータが存在しないと
if (mOperationGroupMasterDao.isExistOperationGroupMaster(peekOperationGroupMasterDto.operationGroupMasterId)) {
Integer operationGroupMasterId = null;
// operationGroupMasterIdのデータが存在、且つクリアフラグがfalseの場合
if (mOperationGroupMasterDao.isExistOperationGroupMaster(peekOperationGroupMasterDto.operationGroupMasterId) && !ABVEnvironment.getInstance().getOperationGroupMasterClearFlg()) {
operationGroupMasterId = peekOperationGroupMasterDto.operationGroupMasterId;
} else {
// 表示する作業種別が既に削除された場合、最上位階層に戻る(リセット)
popList(breadCrumbList.size() - 1);
// 保存されたoperationGroupMasterIDを0にセット
mAppActivity.setOperationGroupMasterId(0);
//TODO 最上位階層のID取得
operationGroupMasterId = 0;
popList(breadCrumbList.size() - 1, false);
// 最上位階層のデータ取得(全体)
OperationGroupMasterDto topLevelOperationGroupMasterDto = mOperationGroupMasterDao.getTopOperationGroupMaster();
if (topLevelOperationGroupMasterDto != null) {
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
public void popList(int popCount) {
public void popList(int popCount, boolean isReload) {
for (int i = 0; i < popCount; i++) {
stack.pop();
// パンくずリスト削除
removeBreadCrumbs(breadCrumbList.get(breadCrumbList.size() - 1));
}
refreshList();
if (isReload) {
// 作業一覧画面を更新する
refreshList();
}
}
@Override
......@@ -121,12 +137,21 @@ public class OperationGroupMasterListHelper extends HierarchyOperationListHelper
return groupName;
}
/**
* 親階層の情報で下の階層をリストで取得
* @return List<OperationGroupMasterDto>
*/
@Override
public List<OperationGroupMasterDto> getChildList() {
OperationGroupMasterDto peekOperationGroupMasterDto = stack.peek();
return getChildList(peekOperationGroupMasterDto.operationGroupMasterId);
}
/**
* 親階層のIDで下の階層をリストで取得
* @param operationGroupMasterId
* @return List<OperationGroupMasterDto>
*/
public List<OperationGroupMasterDto> getChildList(Integer 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