Commit fbc108a4 by Lee Jaebin

#34867 作業並び替え機能

parent 9ce2a1f8
package jp.agentec.abook.abv.bl.acms.type;
/**
* Created by leej on 2019/08/21.
*/
public enum OperationSortingType {
OperationName(0),
OperationStartDateDESC(1),
OperationStartDateASC(2),
OperationType(3),
ReadingDate(4);
private final int operationSorting;
OperationSortingType(int operationSorting) {
this.operationSorting = operationSorting;
}
/**
* 検索をかける項目の番号を返します。
* @return 検索をかける項目の番号です。
* @since 1.0.0
*/
public int type() {
return operationSorting;
}
/**
* 指定した数字に対応するSecurityPolicyCodeの値を返します。
* @param operationSorting 数字のコードです。
* @return 指定した数字に対応するSearchDivisionTypeの値です。
* @since 1.0.0
*/
public static OperationSortingType parse(int operationSorting) {
OperationSortingType sortingType;
switch (operationSorting) {
case 0:
sortingType = OperationSortingType.OperationName;
break;
case 1:
sortingType = OperationSortingType.OperationStartDateDESC;
break;
case 2:
sortingType = OperationSortingType.OperationStartDateASC;
break;
case 3:
sortingType = OperationSortingType.OperationType;
break;
case 4:
sortingType = OperationSortingType.ReadingDate;
break;
default:
sortingType = OperationSortingType.OperationName;
break;
}
return sortingType;
}
}
...@@ -19,7 +19,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase; ...@@ -19,7 +19,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
public class DBConnector { public class DBConnector {
private static volatile DBConnector dbConnector = null; private static volatile DBConnector dbConnector = null;
public static final String DatabaseName = "ABVJE"; public static final String DatabaseName = "ABVJE";
public static final int DatabaseVersion = DatabaseVersions.Ver1_1_0; public static final int DatabaseVersion = DatabaseVersions.Ver1_2_0;
protected SQLiteDatabase db = null; protected SQLiteDatabase db = null;
......
...@@ -4,5 +4,6 @@ package jp.agentec.abook.abv.bl.data; ...@@ -4,5 +4,6 @@ package jp.agentec.abook.abv.bl.data;
public class DatabaseVersions { public class DatabaseVersions {
public static final int Ver1_0_0 = 1; public static final int Ver1_0_0 = 1;
public static final int Ver1_1_0 = 11; public static final int Ver1_1_0 = 11;
public static final int Ver1_2_0 = 21;
} }
...@@ -4,9 +4,11 @@ import java.util.ArrayList; ...@@ -4,9 +4,11 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.acms.type.OperationSortingType;
import jp.agentec.abook.abv.bl.common.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.db.Cursor; import jp.agentec.abook.abv.bl.common.db.Cursor;
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.SortDirection;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.adf.util.DateTimeFormat; import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
...@@ -211,6 +213,15 @@ public class OperationDao extends AbstractDao { ...@@ -211,6 +213,15 @@ public class OperationDao extends AbstractDao {
} }
/** /**
* 作業閲覧日付
* @param operationId
* @return
*/
public boolean updateReadingDate(Long operationId) {
return update("update t_operation set operation_open_date=? WHERE operation_id=?", new Object[]{DateTimeUtil.getCurrentTimestamp(), operationId}) > 0;
}
/**
* 該当作業を削除(関連テーブルを含む) * 該当作業を削除(関連テーブルを含む)
* @param dto * @param dto
*/ */
...@@ -242,11 +253,11 @@ public class OperationDao extends AbstractDao { ...@@ -242,11 +253,11 @@ public class OperationDao extends AbstractDao {
* @param searchOperationName * @param searchOperationName
* @param searchStartDateStr * @param searchStartDateStr
* @param searchEndDateStr * @param searchEndDateStr
* @param reportTypeStr * @param operationSortType
* @return * @return
*/ */
public List<OperationDto> getOperations(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) { public List<OperationDto> getOperations(String searchOperationName, String searchStartDateStr, String searchEndDateStr, OperationSortingType operationSortType) {
String sql = generateGetOperationQuery(searchOperationName, searchStartDateStr, searchEndDateStr, reportTypeStr, null); String sql = generateGetOperationQuery(searchOperationName, searchStartDateStr, searchEndDateStr, operationSortType, null);
return rawQueryGetDtoList(sql, null, OperationDto.class); return rawQueryGetDtoList(sql, null, OperationDto.class);
} }
...@@ -266,10 +277,10 @@ public class OperationDao extends AbstractDao { ...@@ -266,10 +277,10 @@ public class OperationDao extends AbstractDao {
* @param searchOperationName * @param searchOperationName
* @param searchStartDateStr * @param searchStartDateStr
* @param searchEndDateStr * @param searchEndDateStr
* @param reportTypeStr * @param operationSortingType
* @return * @return
*/ */
private String generateGetOperationQuery(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr, Integer operationGroupMasterId) { private String generateGetOperationQuery(String searchOperationName, String searchStartDateStr, String searchEndDateStr, OperationSortingType operationSortingType, Integer operationGroupMasterId) {
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();
...@@ -337,11 +348,33 @@ public class OperationDao extends AbstractDao { ...@@ -337,11 +348,33 @@ public class OperationDao extends AbstractDao {
sql.append(" AND top.operation_start_date <= '" + DateTimeUtil.toString(endDate, DateTimeFormat.yyyyMMdd_hyphen) + "'"); sql.append(" AND top.operation_start_date <= '" + DateTimeUtil.toString(endDate, DateTimeFormat.yyyyMMdd_hyphen) + "'");
} }
if (reportTypeStr != null) { // 並び順
sql.append(" AND top.report_type in ("+ reportTypeStr +")"); if (operationSortingType != null) {
} switch (operationSortingType) {
case OperationName:
sql.append(" ORDER BY top.operation_start_date DESC, top.operation_id DESC"); sql.append(" ORDER BY top.operation_name ASC ");
break;
case OperationStartDateASC:
sql.append(" ORDER BY top.operation_start_date ASC ");
break;
case OperationStartDateDESC:
sql.append(" ORDER BY top.operation_start_date DESC ");
break;
case OperationType:
sql.append(" ORDER BY top.report_type ASC ");
break;
case ReadingDate:
sql.append(" ORDER BY top.operation_open_date DESC ");
break;
default:
sql.append(" ORDER BY top.operation_name DESC ");
break;
}
} else {
sql.append(" ORDER BY top.operation_name ASC ");
}
// 必ずORDER BYが存在する 2次ソート
sql.append(", top.operation_id DESC");
Logger.v(TAG, "sql=%s", sql); Logger.v(TAG, "sql=%s", sql);
......
...@@ -38,6 +38,7 @@ public class TOperation extends SQLiteTableScript { ...@@ -38,6 +38,7 @@ public class TOperation extends SQLiteTableScript {
sql.append(" , enable_report_history SMALLINT NOT NULL DEFAULT 0 "); sql.append(" , enable_report_history SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , enable_report_edit SMALLINT NOT NULL DEFAULT 0 "); sql.append(" , enable_report_edit SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , enable_add_report SMALLINT NOT NULL DEFAULT 0 "); sql.append(" , enable_add_report SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , operation_open_date DATETIME ");
sql.append(" , PRIMARY KEY (operation_id) "); sql.append(" , PRIMARY KEY (operation_id) ");
sql.append(" ) "); sql.append(" ) ");
ddl.add(sql.toString()); ddl.add(sql.toString());
...@@ -48,22 +49,12 @@ public class TOperation extends SQLiteTableScript { ...@@ -48,22 +49,12 @@ public class TOperation extends SQLiteTableScript {
@Override @Override
public List<String> getUpgradeScript(int oldVersion, int newVersion) { public List<String> getUpgradeScript(int oldVersion, int newVersion) {
// List<String> ddl = new ArrayList<String>(); List<String> ddl = new ArrayList<String>();
// if (oldVersion < DatabaseVersions.Plus_1_9_3) {
// ddl.addAll(getCreateScript(newVersion)); if (oldVersion < DatabaseVersions.Ver1_2_0) { // カラムの追加
// } ddl.add("ALTER TABLE t_operation ADD COLUMN operation_open_date DATETIME");
// }
// if (oldVersion < DatabaseVersions.Plus_1_9_3_5) { // カラムの追加 return ddl;
// ddl.add(" ALTER TABLE t_operation ADD COLUMN report_update_type INTEGER NOT NULL DEFAULT 0 ");
// }
//
// if (oldVersion < DatabaseVersions.Plus_1_9_4) { // カラムの追加
// ddl.add(" ALTER TABLE t_operation ADD COLUMN project_report_type INTEGER NOT NULL DEFAULT 0 ");
// ddl.add(" ALTER TABLE t_operation ADD COLUMN report_cycle INTEGER NOT NULL DEFAULT 0 ");
// ddl.add(" ALTER TABLE t_operation ADD COLUMN enable_report_update INTEGER NOT NULL DEFAULT 0 ");
// }
// return ddl;
return null;
} }
@Override @Override
......
...@@ -23,6 +23,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.SceneEntryJSON; ...@@ -23,6 +23,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.SceneEntryJSON;
import jp.agentec.abook.abv.bl.acms.client.json.WorkerGroupJSON; import jp.agentec.abook.abv.bl.acms.client.json.WorkerGroupJSON;
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.client.parameters.GetTaskFileParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.GetTaskFileParameters;
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; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.Callback; import jp.agentec.abook.abv.bl.common.Callback;
...@@ -1075,9 +1076,9 @@ public class OperationLogic extends AbstractLogic { ...@@ -1075,9 +1076,9 @@ public class OperationLogic extends AbstractLogic {
* @param searchEndDateStr * @param searchEndDateStr
* @return * @return
*/ */
public List<OperationDto> getRefreshOperation(String searchWord, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) { public List<OperationDto> getRefreshOperation(String searchWord, String searchStartDateStr, String searchEndDateStr, OperationSortingType operationSortingType) {
List<OperationDto> operationDtoList; List<OperationDto> operationDtoList;
operationDtoList = mOperationDao.getOperations(searchWord, searchStartDateStr, searchEndDateStr, reportTypeStr); operationDtoList = mOperationDao.getOperations(searchWord, searchStartDateStr, searchEndDateStr, operationSortingType);
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)) {
......
...@@ -109,27 +109,36 @@ ...@@ -109,27 +109,36 @@
android:textColor="@color/app_color" android:textColor="@color/app_color"
android:textSize="@dimen/app_normal_text_size" android:textSize="@dimen/app_normal_text_size"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout> </LinearLayout>
<ImageButton <ImageButton
android:id="@+id/btn_sort"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:layout_toLeftOf="@+id/btn_communication_menu"
android:background="@drawable/ic_communication_menu"
android:onClick="onClickSortMenuByTablet"/>
<ImageButton
android:id="@+id/btn_communication_menu" android:id="@+id/btn_communication_menu"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
android:layout_toLeftOf="@+id/btn_sub_menu" android:layout_toLeftOf="@+id/btn_setting"
android:background="@drawable/ic_communication_menu" /> android:background="@drawable/ic_communication_menu" />
<ImageButton <ImageButton
android:id="@+id/btn_sub_menu" android:id="@+id/btn_setting"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
android:layout_toLeftOf="@+id/btn_common_content" android:layout_toLeftOf="@+id/btn_common_content"
android:background="@drawable/ic_operation_setting" android:background="@drawable/ic_operation_setting"
android:onClick="onClickOperationSubMenu" /> android:onClick="onClickSetting" />
<ImageButton <ImageButton
android:id="@+id/btn_common_content" android:id="@+id/btn_common_content"
......
...@@ -78,6 +78,15 @@ ...@@ -78,6 +78,15 @@
android:src="@drawable/ic_batch_sync" /> android:src="@drawable/ic_batch_sync" />
<ImageButton <ImageButton
android:id="@+id/btn_sort"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_communication_menu"
android:layout_marginRight="15dp"
android:layout_toLeftOf="@+id/btn_common_content"
android:onClick="onClickSortMenuByNormalSize"/>
<ImageButton
android:id="@+id/btn_common_content" android:id="@+id/btn_common_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -150,14 +159,14 @@ ...@@ -150,14 +159,14 @@
android:contentDescription="@string/list" /> android:contentDescription="@string/list" />
<ImageButton <ImageButton
android:id="@+id/btn_sub_menu" android:id="@+id/btn_setting"
android:layout_width="wrap_content" android:layout_width="wrap_content"
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_alignParentRight="true" android:layout_alignParentRight="true"
android:background="@drawable/ic_operation_setting" android:background="@drawable/ic_operation_setting"
android:onClick="onClickOperationSubMenu" /> android:onClick="onClickSetting" />
</RelativeLayout> </RelativeLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="center_vertical"
android:checkMark="?android:attr/listChoiceIndicatorSingle"
android:padding="6dp"
/>
...@@ -2,74 +2,10 @@ ...@@ -2,74 +2,10 @@
<resources> <resources>
<string-array name="sort_names"> <string-array name="sort_names">
<item>コンテンツ名(あいうえお)順</item> <item>作業名(あいうえお)順</item>
<item>コンテンツ番号が小さい順</item> <item>作業期間が新しい順</item>
<item>公開日が新しい順</item> <item>作業期間が古い順</item>
<item>コンテンツサイズが大きい順</item> <item>報告タイプ順</item>
<item>ダウンロード日が新しい順</item>
<item>閲覧回数が多い順</item>
<item>閲覧日が新しい順</item> <item>閲覧日が新しい順</item>
</string-array> </string-array>
<string-array name="sort_names_cloud">
<item>コンテンツ名(あいうえお)順</item>
<item>コンテンツ番号が小さい順</item>
<item>公開日が最新順</item>
<item>コンテンツサイズが大きい順</item>
</string-array>
<string-array name="content_submenu_names">
<item>コンテンツ詳細</item>
<item>コンテンツを開く</item>
<item>コンテンツをWebで開く</item>
<item>コンテンツダウンロード</item>
<item>コンテンツダウンロードキャンセル</item>
<item>コンテンツアップデート</item>
<item>コンテンツ削除</item>
<item>マイデータコピー</item>
<item>マイデータ貼付</item>
<item>フォルダへ移動</item>
<item>お気に入りに追加</item>
<item>お気に入り削除</item>
<item>コンテンツ共有</item>
</string-array>
<string-array name="image_change_effect">
<item>スライド</item>
<item>フェード</item>
<item>リヴィール&amp;ムーブイン</item>
</string-array>
<string-array name="toolbar_submenu">
<item>プリント</item>
<item>お気に入り追加</item>
<item>テキストコピー</item>
</string-array>
<string-array name="avaliable_share_app">
<item>facebook</item>
<item>line</item>
<item>mail</item>
<item>mms</item><!-- SMS -->
<item>message</item><!-- SMS:Sharp端末 -->
<item>conversation</item><!-- SMS:sony端末 -->
<item>android.gm</item><!-- Gmail -->
<item>kakao.talk</item>
<item>twitter</item>
</string-array>
<string-array name="tap_action_on_update">
<item>都度選択</item>
<item>そのまま開く</item>
<item>自動アップデート</item>
</string-array>
<string-array name="tap_action_on_delivery_select">
<item>ダウンロード</item>
<item>Webを開く</item>
<item>都度選択</item>
</string-array>
<string-array name="fix_orientation">
<item>なし</item>
<item></item>
<item></item>
<item>縦(反転)</item>
</string-array>
</resources> </resources>
\ No newline at end of file
...@@ -10,68 +10,4 @@ ...@@ -10,68 +10,4 @@
        <item>많이 본 순서</item>         <item>많이 본 순서</item>
        <item>최근에 본 순서</item>         <item>최근에 본 순서</item>
</string-array> </string-array>
<string-array name="sort_names_cloud">
<item>콘텐츠명(가나다)순</item>
<item>콘텐츠 번호가 작은 순서</item>
<item>공개일이 최근인 순서</item>
<item>콘텐츠 용량이 큰 순서</item>
</string-array>
<string-array name="content_submenu_names">
<item>콘텐츠 상세</item>
<item>콘텐츠 열람</item>
<item>콘텐츠 열람 by Web</item>
<item>콘텐츠 다운로드</item>
<item>콘텐츠 다운로드 취소</item>
<item>콘텐츠 업데이트</item>
<item>콘텐츠 삭제</item>
<item>메모/마킹/북마크 복사</item>
<item>메모/마킹/북마크 붙여 넣기</item>
<item>폴더에 이동</item>
<item>즐겨 찾기에 추가</item>
<item>즐겨 찾기 제거</item>
<item>콘텐츠 공유</item>
</string-array>
<string-array name="image_change_effect">
<item>Slide</item>
<item>Fade</item>
<item>Reveal&amp;Move In</item>
</string-array>
<string-array name="toolbar_submenu">
<item>인쇄</item>
<item>즐겨찾기</item>
<item>본문 추출</item>
</string-array>
<string-array name="avaliable_share_app">
<item>facebook</item>
<item>line</item>
<item>mail</item>
<item>mms</item><!-- SMS -->
<item>message</item><!-- SMS:Sharp端末 -->
<item>conversation</item><!-- SMS:sony端末 -->
<item>daum.android.air</item><!-- mypeople -->
<item>android.gm</item>
<item>kakao.talk</item>
<item>twitter</item>
</string-array>
<string-array name="tap_action_on_update">
<item>매번 선택</item>
<item>열람</item>
<item>자동 업데이트</item>
</string-array>
<string-array name="tap_action_on_delivery_select">
<item>다운로드</item>
<item>Web으로 보기</item>
<item>매번 선택</item>
</string-array>
<string-array name="fix_orientation">
<item>미설정</item>
<item>가로</item>
<item>세로</item>
<item>세로(역방향)</item>
</string-array>
</resources> </resources>
...@@ -11,106 +11,4 @@ ...@@ -11,106 +11,4 @@
<item>Viewed count</item> <item>Viewed count</item>
<item>Viewed date</item> <item>Viewed date</item>
</string-array> </string-array>
<string-array name="sort_names_cloud">
<item>Content Name</item>
<item>Content ID</item>
<item>Release Date (Desc)</item>
<item>Content Size (Desc)</item>
</string-array>
<string-array name="content_submenu_names">
<item>Content Detail</item>
<item>Content Open</item>
<item>Content Open by Web</item>
<item>Content Download</item>
<item>Cancel Content Download</item>
<item>Update Content</item>
<item>Delete Content</item>
<item>Copy MyData</item>
<item>Paste MyData</item>
<item>Move To Folder</item>
<item>Add Favorite</item>
<item>Delete Favorite</item>
<item>Share Content</item>
</string-array>
<string-array name="image_change_effect">
<item>Slide</item>
<item>Fade</item>
<item>Reviel &amp; Move in</item>
</string-array>
<string-array name="toolbar_submenu">
<item>Print</item>
<item>Add Favorite</item>
<item>Copy Text</item>
</string-array>
<string-array name="reader_dashboard_preset">
<item>recent</item>
<item>most_viewed</item>
<item>favorite</item>
<item>myfolder</item>
</string-array>
<string-array name="avaliable_share_app">
<item>facebook</item>
<item>line</item>
<item>mail</item>
<item>mms</item><!-- SMS -->
<item>message</item><!-- SMS:Sharp端末 -->
<item>conversation</item><!-- SMS:sony端末 -->
<item>android.gm</item>
<item>kakao.talk</item>
<item>twitter</item>
</string-array>
<string-array name="tap_action_on_update">
<item>Select each time</item>
<item>Open</item>
<item>Auto update</item>
</string-array>
<string-array name="tap_action_on_update_values">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="tap_action_on_delivery_select">
<item>Download</item>
<item>Streaming</item>
<item>Select each time</item>
</string-array>
<string-array name="tap_action_on_delivery_select_values">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="pdf_image_size_values">
<item>1280x720</item>
<item>1280x1024</item>
<item>1366x768</item>
<item>1920x1080</item>
</string-array>
<string-array name="fix_orientation">
<item>None</item>
<item>Landscape</item>
<item>Portrait</item>
<item>Portrait(Reverse)</item>
</string-array>
<string-array name="fix_orientation_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
<string-array name="monitorTouchMode_values">
<item>0</item>
<item>1</item>
</string-array>
<string-array name="operation_report_types">
<item>Report</item>
<item>Routine</item>
<item>ReportReply</item>
</string-array>
</resources> </resources>
\ No newline at end of file
...@@ -114,6 +114,23 @@ public class ABVUIDataCache { ...@@ -114,6 +114,23 @@ public class ABVUIDataCache {
} }
/** /**
* ソート条件をセット
* @param sortCondition
*/
public void setSortCondition(int sortCondition) {
/* ロケーションタイプ毎にソート条件を保存する */
PreferenceUtil.putUserPref(context, UserPrefKey.OPERATION_SORT_CONDITION, sortCondition);
}
/**
* ソート条件を取得
* @return
*/
public int getSortCondition() {
return PreferenceUtil.getUserPref(context, UserPrefKey.OPERATION_SORT_CONDITION, 0);
}
/**
* xmlに書き込みされた作業種別IDを取得 * xmlに書き込みされた作業種別IDを取得
* @return * @return
*/ */
...@@ -160,41 +177,4 @@ public class ABVUIDataCache { ...@@ -160,41 +177,4 @@ public class ABVUIDataCache {
returnContentIdList.clear(); returnContentIdList.clear();
} }
} }
public void setOperationReportTypes(ArrayList<Integer> operationReportTypes) {
this.mReportTypes = operationReportTypes;
String val = null;
if (operationReportTypes.size() > 0) {
// カンマ区切りで保存
StringBuffer sb = new StringBuffer();
for (int contentType : operationReportTypes) {
sb.append(contentType);
sb.append(",");
}
val = sb.substring(0, sb.length() - 1);
}
PreferenceUtil.putUserPref(context, UserPrefKey.OPERATION_REPORT_TYPES, val);
}
public ArrayList<Integer> getOperationReportTypes() {
String operationReportTypesStr = PreferenceUtil.getUserPref(context, UserPrefKey.OPERATION_REPORT_TYPES, null);
if (operationReportTypesStr != null) {
ArrayList<Integer> operationReportTypes = new ArrayList<>();
String[] operationReportTypesStrList = operationReportTypesStr.split(",");
for (String contentType : operationReportTypesStrList) {
if (!StringUtil.isNullOrEmpty(contentType)) {
operationReportTypes.add(Integer.parseInt(contentType));
}
}
mReportTypes = operationReportTypes;
} else {
mReportTypes = new ArrayList<Integer>();
mReportTypes.add(ReportType.Report);
mReportTypes.add(ReportType.RoutineTask);
mReportTypes.add(ReportType.ReportReply);
}
return mReportTypes;
}
} }
...@@ -476,7 +476,7 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity { ...@@ -476,7 +476,7 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
} }
// 設定画面表示 // 設定画面表示
public void showSettingPopup() { public void showSetting() {
Intent intent = new Intent(); Intent intent = new Intent();
intent.setClassName(getApplicationContext().getPackageName(), ABookSettingActivity.class.getName()); intent.setClassName(getApplicationContext().getPackageName(), ABookSettingActivity.class.getName());
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
......
...@@ -59,34 +59,23 @@ public interface AppDefType { ...@@ -59,34 +59,23 @@ public interface AppDefType {
String SYNCED_OPERATION_ID = "syncedOperationId_%d";//一日一回情報更新が出来るように String SYNCED_OPERATION_ID = "syncedOperationId_%d";//一日一回情報更新が出来るように
String VIEW_MODE = "viewMode"; String VIEW_MODE = "viewMode";
String OPERATION_REPORT_TYPES = "operationReportTypes";
String RESOURCE_PATTERN_TYPE = "resourcePatternType"; // 文言リソースパターン String RESOURCE_PATTERN_TYPE = "resourcePatternType"; // 文言リソースパターン
String OPERATION_GROUP_MASERT_MODE = "operation_group_master"; // 通常・作業種別モード(画面) String OPERATION_GROUP_MASERT_MODE = "operation_group_master"; // 通常・作業種別モード(画面)
String OPERATION_GROUP_MASERT_ID = "operation_group_master_id"; // 作業種別のID String OPERATION_GROUP_MASERT_ID = "operation_group_master_id"; // 作業種別のID
String APERTURE_MASTER_DATA_FETCH_DATE = "apertureMasterDataFetchDate"; // 絞り検索マスタデータのFetchDate String OPERATION_SORT_CONDITION = "operation_sort_condition"; // 作業のソート
}
/** String APERTURE_MASTER_DATA_FETCH_DATE = "apertureMasterDataFetchDate"; // 絞り検索マスタデータのFetchDate
* 表示するデータタイプ
* 全て、クラウド、デバイス
*/
interface ContentLocationType{
int CLOUD = 1;
int DEVICE = 2;
int ALL = 9;
} }
interface SortType{ interface SortType {
int CONTENT_NAME = 0; //コンテンツ名 int OPERATION_NAME = 0; // 作業名
int CONTENT_ID = 1; //コンテンツ番号 int OPERATION_START_DATE_DESC = 1; // 作業時間が新しい順
int DELIVERY_STARTDATE = 2; //公開日 int OPERATION_START_DATE_ASC = 2; // 作業時間が古い順
int CONTENT_SIZE = 3; //コンテンツサイズ int OPERATION_TYPE = 3; // 報告タイプ
int DOWNLOAD_DATE = 4; //ダウンロード日 int READING_DATE = 4; // 閲覧日が新しい順
int READING_COUNT = 5; //閲覧回数
int READING_DATE = 6; //閲覧日
} }
interface SubMenuType { interface SubMenuType {
......
...@@ -11,7 +11,7 @@ import android.graphics.BitmapFactory; ...@@ -11,7 +11,7 @@ import android.graphics.BitmapFactory;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.util.SparseBooleanArray; import android.view.Gravity;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -19,8 +19,6 @@ import android.view.Window; ...@@ -19,8 +19,6 @@ import android.view.Window;
import android.widget.AbsListView; import android.widget.AbsListView;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckedTextView;
import android.widget.DatePicker; import android.widget.DatePicker;
import android.widget.EditText; import android.widget.EditText;
import android.widget.FrameLayout; import android.widget.FrameLayout;
...@@ -90,7 +88,6 @@ import jp.agentec.abook.abv.bl.dto.TaskDto; ...@@ -90,7 +88,6 @@ import jp.agentec.abook.abv.bl.dto.TaskDto;
import jp.agentec.abook.abv.bl.dto.TaskReportDto; 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.ApertureMasterDataLogic;
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.bl.logic.PushMessageLogic;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
...@@ -150,12 +147,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -150,12 +147,6 @@ public class OperationListActivity extends ABVUIActivity {
private TextView mEndDate; private TextView mEndDate;
private LinearLayout mSearchResultLayout; private LinearLayout mSearchResultLayout;
private LinearLayout mReportTypeLayoutLabel;
private LinearLayout mReportTypeLayoutButton;
private Button mReportTypeAllButton;
private Button mReportTypeDefaultButton;
private Button mReportTypeRoutineTaskButton;
private Dialog mSearchDialog; private Dialog mSearchDialog;
private Date mOperationLastEditDate; private Date mOperationLastEditDate;
...@@ -193,8 +184,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -193,8 +184,6 @@ public class OperationListActivity extends ABVUIActivity {
private OperationListHelper mListHelper = null; private OperationListHelper mListHelper = null;
private ArrayList<Integer> mAllOperationReportTypes;
private ABVListDialog mShowDialog; private ABVListDialog mShowDialog;
private Map<Integer, Integer> operationCountMap; private Map<Integer, Integer> operationCountMap;
...@@ -204,12 +193,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -204,12 +193,6 @@ public class OperationListActivity extends ABVUIActivity {
// 作業種別のサービスオプション値を保持用フラグ // 作業種別のサービスオプション値を保持用フラグ
private boolean mOperationGroupMasterServiceOperationFlg; private boolean mOperationGroupMasterServiceOperationFlg;
// 絞り検索マスタデータ
// private Date mApertureLastEditDate;
// 絞り検索マスタLogic
private ApertureMasterDataLogic mApertureMasterDataLogic = AbstractLogic.getLogic(ApertureMasterDataLogic.class);
// ビューの作成 // ビューの作成
private class ReloadHandler implements Runnable { private class ReloadHandler implements Runnable {
@Override @Override
...@@ -241,8 +224,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -241,8 +224,6 @@ public class OperationListActivity extends ABVUIActivity {
mViewModeButton = (ImageButton) findViewById(R.id.btn_view_mode); mViewModeButton = (ImageButton) findViewById(R.id.btn_view_mode);
// 検索ボタン // 検索ボタン
mSearchButton = (ImageButton) findViewById(R.id.btn_search); mSearchButton = (ImageButton) findViewById(R.id.btn_search);
// フィルターボタン
mFilterButton = (ImageButton) findViewById(R.id.icon_filter);
mSearchResultLayout = (LinearLayout) findViewById(R.id.search_result); mSearchResultLayout = (LinearLayout) findViewById(R.id.search_result);
mCommunicationButton = (ImageButton) findViewById(R.id.btn_communication_menu); mCommunicationButton = (ImageButton) findViewById(R.id.btn_communication_menu);
...@@ -387,8 +368,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -387,8 +368,6 @@ public class OperationListActivity extends ABVUIActivity {
alertDialog.show(); alertDialog.show();
} }
} }
mAllOperationReportTypes = getOperationReportTypeList(true);
// リスト更新 // リスト更新
setOperationListView(); setOperationListView();
} }
...@@ -425,8 +404,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -425,8 +404,6 @@ public class OperationListActivity extends ABVUIActivity {
mCommonContentButton.setImageDrawable(getRDrawable(R.drawable.ic_common_content_off)); mCommonContentButton.setImageDrawable(getRDrawable(R.drawable.ic_common_content_off));
mCommonContentButton.setEnabled(false); mCommonContentButton.setEnabled(false);
} }
// フィルター選択判定
checkSelectedFilterType();
// 作業種別表示・非表示 // 作業種別表示・非表示
if (mOperationGroupMasterServiceOperationFlg) { if (mOperationGroupMasterServiceOperationFlg) {
...@@ -436,12 +413,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -436,12 +413,6 @@ public class OperationListActivity extends ABVUIActivity {
if (getABVUIDataCache().getOperationGroupMasterMode() == OperationLocationType.GROUP) { if (getABVUIDataCache().getOperationGroupMasterMode() == OperationLocationType.GROUP) {
// 検索ワード削除 // 検索ワード削除
clearSearch(); clearSearch();
// フィルタのリセット
getABVUIDataCache().setOperationReportTypes(mAllOperationReportTypes);
// フィルターボタンを無効にする
mFilterButton.setImageDrawable(getRDrawable(R.drawable.ic_filter));
setEnabledImageButton(mFilterButton, false);
// 検索ボタンを無効にする // 検索ボタンを無効にする
mSearchButton.setImageDrawable(getRDrawable(R.drawable.ic_operation_search)); mSearchButton.setImageDrawable(getRDrawable(R.drawable.ic_operation_search));
setEnabledImageButton(mSearchButton, false); setEnabledImageButton(mSearchButton, false);
...@@ -450,7 +421,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -450,7 +421,6 @@ public class OperationListActivity extends ABVUIActivity {
} else { } else {
// 全て // 全て
// ボタンを活性化 // ボタンを活性化
setEnabledImageButton(mFilterButton, true);
setEnabledImageButton(mSearchButton, true); setEnabledImageButton(mSearchButton, true);
// 一括同期ボタン非表示 // 一括同期ボタン非表示
mOperationBatchSyncButton.setVisibility(View.GONE); mOperationBatchSyncButton.setVisibility(View.GONE);
...@@ -463,7 +433,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -463,7 +433,6 @@ public class OperationListActivity extends ABVUIActivity {
// 一括同期ボタンを非表示 // 一括同期ボタンを非表示
mOperationBatchSyncButton.setVisibility(View.GONE); mOperationBatchSyncButton.setVisibility(View.GONE);
// ボタンを活性化 // ボタンを活性化
setEnabledImageButton(mFilterButton, true);
setEnabledImageButton(mSearchButton, true); setEnabledImageButton(mSearchButton, true);
} }
...@@ -781,6 +750,8 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -781,6 +750,8 @@ public class OperationListActivity extends ABVUIActivity {
mOperationLogic.createJsonForOpenABookCheckPano(operationDto.operationId, operationDto.contentId, contentPath); mOperationLogic.createJsonForOpenABookCheckPano(operationDto.operationId, operationDto.contentId, contentPath);
mOperationLogic.createJsonForOperationContent(operationDto.operationId, contentPath, operationDto.reportType == ReportType.RoutineTask); mOperationLogic.createJsonForOperationContent(operationDto.operationId, contentPath, operationDto.reportType == ReportType.RoutineTask);
// 作業閲覧日付の更新
mOperationDao.updateReadingDate(operationDto.operationId);
// サーバ作業後、対応必要 // サーバ作業後、対応必要
StringBuffer path = new StringBuffer(); StringBuffer path = new StringBuffer();
...@@ -961,17 +932,12 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -961,17 +932,12 @@ public class OperationListActivity extends ABVUIActivity {
} }
// 設定画面へ遷移 // 設定画面へ遷移
public void onClickOperationSubMenu(View v) { public void onClickSetting(View v) {
showSettingPopup(); showSetting();
} }
public void onClickShowHelpView(View v) { public void onClickShowHelpView(View v) {
// if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
// showHelpViewDialog(Constant.HelpViewType.OperationListDirector);
// } else {
showHelpViewDialog(Constant.HelpViewType.OperationListReporter); showHelpViewDialog(Constant.HelpViewType.OperationListReporter);
// }
} }
/** /**
* 360編集画面表示 * 360編集画面表示
...@@ -1977,84 +1943,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1977,84 +1943,6 @@ public class OperationListActivity extends ABVUIActivity {
}); });
} }
/**
* 並べ替え画面表示
*
* @param anchor
*/
public void onClickOperationFilterList(final View anchor) {
Logger.d(TAG, "onClickShowContentContainerList start");
final ABVPopupListWindow popup = new ABVPopupListWindow(this, R.layout.popup_simple_list);
popup.setTitle(getRString(R.string.filter));
popup.setWidth(getRDimensionSize(R.dimen.popup_size_xlarge));
// 表示するコンテンツタイプのリストを作成
List<String> members = Arrays.asList(getRStringArray(R.array.operation_report_types));
for (int i = 0; i < members.size(); i++) {
int rId = getResources().getIdentifier(members.get(i), "string", getPackageName());
// リソースパターンの適用
members.set(i, PatternStringUtil.patternToString(getApplicationContext(),
rId,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
}
ArrayList<Integer> selectedOperationReportTypes = getOperationReportTypeList(false);
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, R.layout.item_checked_list, members);
popup.setListViewAdapter(adapter);
final ListView listView = popup.getListView();
listView.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
for (int i = 0; i < mAllOperationReportTypes.size(); i++) {
for (Integer id : selectedOperationReportTypes) {
if (id.equals(mAllOperationReportTypes.get(i))) {
listView.setItemChecked(i, true);
}
}
}
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long cid) {
// 並び替えの要素タップイベント
SparseBooleanArray checkedItemPositions = popup.getListView().getCheckedItemPositions();
ArrayList<Integer> selectedOperationReportTypeIds = new ArrayList<>();
for (int i = 0; i < checkedItemPositions.size(); i++) {
if (checkedItemPositions.valueAt(i)) {
selectedOperationReportTypeIds.add(mAllOperationReportTypes.get(checkedItemPositions.keyAt(i)));
}
}
if (selectedOperationReportTypeIds.size() > 0) {
getABVUIDataCache().setOperationReportTypes(selectedOperationReportTypeIds);
refreshOperationList();
} else {
((CheckedTextView)view).setChecked(true);
listView.getCheckedItemPositions().put(position, true);
}
}
});
listView.invalidate();
popup.showAsDropDown(anchor);
}
/**
* フィルター(報告タイプ)の項目取得
* @param isAll フィルターの全ての項目を取得するか、チェックのみ取得するか判定フラグ
* @return
*/
private ArrayList<Integer> getOperationReportTypeList(boolean isAll) {
ArrayList<Integer> operationReportTypes = new ArrayList<>();
if (isAll) {
operationReportTypes.add(ReportType.Report);
operationReportTypes.add(ReportType.RoutineTask);
operationReportTypes.add(ReportType.ReportReply);
} else {
operationReportTypes = getABVUIDataCache().getOperationReportTypes();
}
return operationReportTypes;
}
// ログイン成功した後、新着更新時の「ContentVersion」APIからリソースパターンを取得し、ローカルに保存する。 // ログイン成功した後、新着更新時の「ContentVersion」APIからリソースパターンを取得し、ローカルに保存する。
private void setResourcePattern() { private void setResourcePattern() {
Logger.d(TAG, "ABVEnvironment.getInstance().resourcePatternType : " + ABVEnvironment.getInstance().resourcePatternType); Logger.d(TAG, "ABVEnvironment.getInstance().resourcePatternType : " + ABVEnvironment.getInstance().resourcePatternType);
...@@ -2062,19 +1950,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -2062,19 +1950,6 @@ public class OperationListActivity extends ABVUIActivity {
} }
/** /**
* フィルターの選択があるか判定して、画像を変更
*/
private void checkSelectedFilterType() {
List<Integer> defaultTypeList = getOperationReportTypeList(true);
ArrayList<Integer> selectedOperationReportTypes = getOperationReportTypeList(false);
if (defaultTypeList.size() == selectedOperationReportTypes.size()) {
mFilterButton.setImageDrawable(getRDrawable(R.drawable.ic_filter));
} else {
mFilterButton.setImageDrawable(getRDrawable(R.drawable.ic_filter_selected));
}
}
/**
* 作業種別の選択のダイアログ画面表示 * 作業種別の選択のダイアログ画面表示
* @param isInit * @param isInit
* @param autoClose 直下階層が存在しない場合、ダイアログを自動で閉じる * @param autoClose 直下階層が存在しない場合、ダイアログを自動で閉じる
...@@ -2259,7 +2134,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -2259,7 +2134,6 @@ public class OperationListActivity extends ABVUIActivity {
putUserPref(AppDefType.UserPrefKey.APERTURE_MASTER_DATA_FETCH_DATE, ABVDataCache.getInstance().getTempApertureMasterDataFetchDate()); putUserPref(AppDefType.UserPrefKey.APERTURE_MASTER_DATA_FETCH_DATE, ABVDataCache.getInstance().getTempApertureMasterDataFetchDate());
} }
/** /**
* カテゴリの一括同期ダイアログ表示 * カテゴリの一括同期ダイアログ表示
*/ */
...@@ -2377,4 +2251,89 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -2377,4 +2251,89 @@ public class OperationListActivity extends ABVUIActivity {
batchSyncView.setActivityDestroy(); batchSyncView.setActivityDestroy();
super.onDestroy(); super.onDestroy();
} }
/**
* 並び替え設定メニュー(タブレット)
* @param anchor
*/
public void onClickSortMenuByTablet(View anchor) {
Logger.d(TAG, "onClickShowSortConditionList");
final ABVPopupListWindow popup = new ABVPopupListWindow(this, R.layout.popup_simple_list);
popup.setTitle(getRString(R.string.sort_title));
ListView listView = popup.getListView();
// ソート用のリストビューセット
ArrayAdapter<String> adapter = setSortListView(listView);
listView.setAdapter(adapter);
listView.setItemChecked(getABVUIDataCache().getSortCondition(), true);
// 横幅をフィットさせる
popup.setWidth((int)(ABVPopupListWindow.getWidestView(this, adapter) * 1.15));
popup.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Logger.d(TAG, "onClickShowSortConditionList.onItemClick:" + id);
getABVUIDataCache().setSortCondition((int)id);
// ビューア更新
refreshOperationList();
}
});
if (anchor == null) {
// 呼び出したViewが存在しない場合、真ん中に表示する
popup.showAtLocation(getWindow().getDecorView().findViewById(android.R.id.content), Gravity.CENTER, 0,0);
} else {
popup.showAsDropDown(anchor);
}
}
/**
* 並び替え設定メニュー(スマートフォン)
* @param view
*/
public void onClickSortMenuByNormalSize(View view) {
final ABVListDialog dialog = new ABVListDialog(this, getString(R.string.sort_title));
// ダイアログ表示時、ダイアログ以外の画面をタップしても閉じられないように設定
dialog.setCanceledOnTouchOutside(false);
// ソート用のリストビューセット
ListView listView = dialog.getListView();
dialog.setListViewAdapter(setSortListView(listView));
listView.setItemChecked(getABVUIDataCache().getSortCondition(), true);
mShowDialog = dialog;
// 閉じるボタン
dialog.setRightItemOnClickListener(R.drawable.ic_operation_close, new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// ポップアップ非表示
dialog.dismiss();
getABVUIDataCache().setSortCondition((int)id);
refreshOperationList();
}
});
if (isNormalSize()) {
dialog.showHalfSize();
} else {
dialog.show();
}
}
// 並び替えの表示するソートリスト
private ArrayAdapter<String> setSortListView(ListView listView) {
final List<String> sortMembers = Arrays.asList(getRStringArray(R.array.sort_names));
listView.setChoiceMode(AbsListView.CHOICE_MODE_SINGLE);
return new ArrayAdapter<>(this, R.layout.item_checked_list, sortMembers);
}
} }
...@@ -2,6 +2,7 @@ package jp.agentec.abook.abv.ui.home.helper; ...@@ -2,6 +2,7 @@ package jp.agentec.abook.abv.ui.home.helper;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.acms.type.OperationSortingType;
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.ContentDto; import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
...@@ -26,7 +27,9 @@ public class HomeOperationListHelper extends OperationListHelper { ...@@ -26,7 +27,9 @@ 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); int operationSortType = getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_SORT_CONDITION, 0);
return operationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, reportTypeStr);
OperationSortingType operationSortingType = convertSortType(operationSortType);
return operationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, operationSortingType);
} }
} }
...@@ -11,6 +11,7 @@ import com.handmark.pulltorefresh.library.PullToRefreshListView; ...@@ -11,6 +11,7 @@ import com.handmark.pulltorefresh.library.PullToRefreshListView;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.acms.type.OperationSortingType;
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.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
...@@ -59,6 +60,36 @@ public abstract class OperationListHelper { ...@@ -59,6 +60,36 @@ public abstract class OperationListHelper {
} }
/** /**
* ソートタイプをOperationSortingTypeに変換する
* @param sortType
* @return operationSortingType {@link OperationSortingType}
*/
public static OperationSortingType convertSortType(int sortType) {
OperationSortingType operationSortingType;
switch (sortType) {
case AppDefType.SortType.OPERATION_NAME:
operationSortingType = OperationSortingType.OperationName;
break;
case AppDefType.SortType.OPERATION_START_DATE_ASC:
operationSortingType = OperationSortingType.OperationStartDateASC;
break;
case AppDefType.SortType.OPERATION_START_DATE_DESC:
operationSortingType = OperationSortingType.OperationStartDateDESC;
break;
case AppDefType.SortType.OPERATION_TYPE:
operationSortingType = OperationSortingType.OperationType;
break;
case AppDefType.SortType.READING_DATE:
operationSortingType = OperationSortingType.ReadingDate;
break;
default:
operationSortingType = OperationSortingType.OperationName;
break;
}
return operationSortingType;
}
/**
* 作業を検索してListを返す * 作業を検索してListを返す
* *
* @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