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;
public class DBConnector {
private static volatile DBConnector dbConnector = null;
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;
......
......@@ -4,5 +4,6 @@ package jp.agentec.abook.abv.bl.data;
public class DatabaseVersions {
public static final int Ver1_0_0 = 1;
public static final int Ver1_1_0 = 11;
public static final int Ver1_2_0 = 21;
}
......@@ -4,9 +4,11 @@ import java.util.ArrayList;
import java.util.Date;
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.db.Cursor;
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.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
......@@ -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
*/
......@@ -242,11 +253,11 @@ public class OperationDao extends AbstractDao {
* @param searchOperationName
* @param searchStartDateStr
* @param searchEndDateStr
* @param reportTypeStr
* @param operationSortType
* @return
*/
public List<OperationDto> getOperations(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) {
String sql = generateGetOperationQuery(searchOperationName, searchStartDateStr, searchEndDateStr, reportTypeStr, null);
public List<OperationDto> getOperations(String searchOperationName, String searchStartDateStr, String searchEndDateStr, OperationSortingType operationSortType) {
String sql = generateGetOperationQuery(searchOperationName, searchStartDateStr, searchEndDateStr, operationSortType, null);
return rawQueryGetDtoList(sql, null, OperationDto.class);
}
......@@ -266,10 +277,10 @@ public class OperationDao extends AbstractDao {
* @param searchOperationName
* @param searchStartDateStr
* @param searchEndDateStr
* @param reportTypeStr
* @param operationSortingType
* @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");
StringBuffer sql = new StringBuffer();
......@@ -337,11 +348,33 @@ public class OperationDao extends AbstractDao {
sql.append(" AND top.operation_start_date <= '" + DateTimeUtil.toString(endDate, DateTimeFormat.yyyyMMdd_hyphen) + "'");
}
if (reportTypeStr != null) {
sql.append(" AND top.report_type in ("+ reportTypeStr +")");
}
sql.append(" ORDER BY top.operation_start_date DESC, top.operation_id DESC");
// 並び順
if (operationSortingType != null) {
switch (operationSortingType) {
case OperationName:
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);
......
......@@ -38,6 +38,7 @@ public class TOperation extends SQLiteTableScript {
sql.append(" , enable_report_history 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(" , operation_open_date DATETIME ");
sql.append(" , PRIMARY KEY (operation_id) ");
sql.append(" ) ");
ddl.add(sql.toString());
......@@ -48,22 +49,12 @@ public class TOperation extends SQLiteTableScript {
@Override
public List<String> getUpgradeScript(int oldVersion, int newVersion) {
// List<String> ddl = new ArrayList<String>();
// if (oldVersion < DatabaseVersions.Plus_1_9_3) {
// ddl.addAll(getCreateScript(newVersion));
// }
//
// if (oldVersion < DatabaseVersions.Plus_1_9_3_5) { // カラムの追加
// 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;
List<String> ddl = new ArrayList<String>();
if (oldVersion < DatabaseVersions.Ver1_2_0) { // カラムの追加
ddl.add("ALTER TABLE t_operation ADD COLUMN operation_open_date DATETIME");
}
return ddl;
}
@Override
......
......@@ -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.parameters.AcmsParameters;
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.Constant;
import jp.agentec.abook.abv.bl.common.Callback;
......@@ -1075,9 +1076,9 @@ public class OperationLogic extends AbstractLogic {
* @param searchEndDateStr
* @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;
operationDtoList = mOperationDao.getOperations(searchWord, searchStartDateStr, searchEndDateStr, reportTypeStr);
operationDtoList = mOperationDao.getOperations(searchWord, searchStartDateStr, searchEndDateStr, operationSortingType);
for (OperationDto operationDto : operationDtoList) {
// 作業送信フラグが存在する場合またはホットスポット更新フラグが存在する場合、needSyncFlgをtrueにセット
if (mTaskReportDao.isExistSendTaskData(operationDto.operationId) || mTaskReportDao.isExistUpdateTargetHotSpotTaskData(operationDto.operationId)) {
......
......@@ -109,27 +109,36 @@
android:textColor="@color/app_color"
android:textSize="@dimen/app_normal_text_size"
android:textStyle="bold" />
</LinearLayout>
<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:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:layout_toLeftOf="@+id/btn_sub_menu"
android:layout_toLeftOf="@+id/btn_setting"
android:background="@drawable/ic_communication_menu" />
<ImageButton
android:id="@+id/btn_sub_menu"
android:id="@+id/btn_setting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:layout_toLeftOf="@+id/btn_common_content"
android:background="@drawable/ic_operation_setting"
android:onClick="onClickOperationSubMenu" />
android:onClick="onClickSetting" />
<ImageButton
android:id="@+id/btn_common_content"
......
......@@ -78,6 +78,15 @@
android:src="@drawable/ic_batch_sync" />
<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:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -150,14 +159,14 @@
android:contentDescription="@string/list" />
<ImageButton
android:id="@+id/btn_sub_menu"
android:id="@+id/btn_setting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:layout_alignParentRight="true"
android:background="@drawable/ic_operation_setting"
android:onClick="onClickOperationSubMenu" />
android:onClick="onClickSetting" />
</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 @@
<resources>
<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>
</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>
\ No newline at end of file
......@@ -10,68 +10,4 @@
        <item>많이 본 순서</item>
        <item>최근에 본 순서</item>
</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>
......@@ -11,106 +11,4 @@
<item>Viewed count</item>
<item>Viewed date</item>
</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>
\ No newline at end of file
......@@ -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を取得
* @return
*/
......@@ -160,41 +177,4 @@ public class ABVUIDataCache {
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 {
}
// 設定画面表示
public void showSettingPopup() {
public void showSetting() {
Intent intent = new Intent();
intent.setClassName(getApplicationContext().getPackageName(), ABookSettingActivity.class.getName());
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
......
......@@ -59,34 +59,23 @@ public interface AppDefType {
String SYNCED_OPERATION_ID = "syncedOperationId_%d";//一日一回情報更新が出来るように
String VIEW_MODE = "viewMode";
String OPERATION_REPORT_TYPES = "operationReportTypes";
String RESOURCE_PATTERN_TYPE = "resourcePatternType"; // 文言リソースパターン
String OPERATION_GROUP_MASERT_MODE = "operation_group_master"; // 通常・作業種別モード(画面)
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"; // 作業のソート
/**
* 表示するデータタイプ
* 全て、クラウド、デバイス
*/
interface ContentLocationType{
int CLOUD = 1;
int DEVICE = 2;
int ALL = 9;
String APERTURE_MASTER_DATA_FETCH_DATE = "apertureMasterDataFetchDate"; // 絞り検索マスタデータのFetchDate
}
interface SortType{
int CONTENT_NAME = 0; //コンテンツ名
int CONTENT_ID = 1; //コンテンツ番号
int DELIVERY_STARTDATE = 2; //公開日
int CONTENT_SIZE = 3; //コンテンツサイズ
int DOWNLOAD_DATE = 4; //ダウンロード日
int READING_COUNT = 5; //閲覧回数
int READING_DATE = 6; //閲覧日
interface SortType {
int OPERATION_NAME = 0; // 作業名
int OPERATION_START_DATE_DESC = 1; // 作業時間が新しい順
int OPERATION_START_DATE_ASC = 2; // 作業時間が古い順
int OPERATION_TYPE = 3; // 報告タイプ
int READING_DATE = 4; // 閲覧日が新しい順
}
interface SubMenuType {
......
......@@ -2,6 +2,7 @@ package jp.agentec.abook.abv.ui.home.helper;
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.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.OperationDto;
......@@ -26,7 +27,9 @@ 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);
int operationSortType = getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_SORT_CONDITION, 0);
OperationSortingType operationSortingType = convertSortType(operationSortType);
return operationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, operationSortingType);
}
}
......@@ -11,6 +11,7 @@ import com.handmark.pulltorefresh.library.PullToRefreshListView;
import java.util.ArrayList;
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.log.Logger;
import jp.agentec.abook.abv.bl.dto.OperationDto;
......@@ -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を返す
*
* @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