Commit 709e3352 by Lee Jaebin

Merge branch 'features/1.2.0_34867' into features/1.2.0_34869

# Conflicts:
#	ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/OperationGroupMasterListHelper.java
parents 5028b985 79c908ce
......@@ -36,27 +36,25 @@ public enum OperationSortingType {
OperationSortingType sortingType;
switch (operationSorting) {
case 0:
case 0: // 作業名
sortingType = OperationSortingType.OperationName;
break;
case 1:
case 1: // 作業期間が新しい順
sortingType = OperationSortingType.OperationStartDateDESC;
break;
case 2:
case 2: // 作業時間が古い順
sortingType = OperationSortingType.OperationStartDateASC;
break;
case 3:
case 3: // 報告タイプ
sortingType = OperationSortingType.OperationType;
break;
case 4:
case 4: // 閲覧日が新しい順
sortingType = OperationSortingType.ReadingDate;
break;
default:
default: // 作業名(デフォルト)
sortingType = OperationSortingType.OperationName;
break;
}
return sortingType;
}
}
package jp.agentec.abook.abv.bl.data;
// バージョンが上がるごとに+10すること
// バージョンが上がるごとに+10すること(途中でバージョン追加になる恐れがあるため)
public class DatabaseVersions {
public static final int Ver1_0_0 = 1;
public static final int Ver1_1_0 = 11;
......
......@@ -219,7 +219,7 @@ public class OperationDao extends AbstractDao {
/**
* 作業閲覧日付
* @param operationId
* @return
* @return 正常:true 異常:false
*/
public boolean updateReadingDate(Long operationId) {
return update("update t_operation set operation_open_date=? WHERE operation_id=?", new Object[]{DateTimeUtil.getCurrentTimestamp(), operationId}) > 0;
......@@ -267,8 +267,9 @@ public class OperationDao extends AbstractDao {
/**
* カテゴリの作業一覧検索用
* @param operationGroupMasterId
* @return
* @param operationGroupMasterId カテゴリID
* @param operationSortingType ソートタイプ
* @return カテゴリに紐づく作業リスト
*/
public List<OperationDto> getOperationsByGroupMasterId(Integer operationGroupMasterId, OperationSortingType operationSortingType) {
String sql = generateGetOperationQuery(null, null, null, operationSortingType, operationGroupMasterId);
......@@ -371,7 +372,7 @@ public class OperationDao extends AbstractDao {
sql.append(" ORDER BY top.operation_open_date DESC ");
break;
default:
sql.append(" ORDER BY top.operation_name DESC ");
sql.append(" ORDER BY top.operation_name ASC ");
break;
}
} else {
......
......@@ -142,7 +142,7 @@ public class OperationGroupMasterLogic extends AbstractLogic {
/**
* 親の階層パスをリストでセット
* @param operationGroupMasterId
* @param operationGroupMasterId カテゴリID
* @return
*/
public List<OperationGroupMasterDto> getParentOperationGroupMasterForPath (Integer operationGroupMasterId) {
......@@ -163,7 +163,8 @@ public class OperationGroupMasterLogic extends AbstractLogic {
/**
* 作業種別IDで関連する作業リストを取得
* @param operationGroupMasterId
* @param operationGroupMasterId カテゴリID
* @param operationSortingType ソートタイプ
* @return
*/
public List<OperationDto> getOperationByOperationGroupMasterId(Integer operationGroupMasterId, OperationSortingType operationSortingType) {
......
......@@ -1069,12 +1069,13 @@ public class OperationLogic extends AbstractLogic {
}
/**
* プロジェクト一覧取得
* 作業一覧取得
*
* @param searchWord
* @param searchStartDateStr
* @param searchEndDateStr
* @return
* @param searchWord 検索条件:作業名
* @param searchStartDateStr 検索条件:作業日範囲(開始)
* @param searchEndDateStr  検索条件:作業日範囲(終了)
* @param operationSortingType ソート順
* @return 作業リスト
*/
public List<OperationDto> getRefreshOperation(String searchWord, String searchStartDateStr, String searchEndDateStr, OperationSortingType operationSortingType) {
List<OperationDto> operationDtoList;
......@@ -1089,9 +1090,9 @@ public class OperationLogic extends AbstractLogic {
}
/**
* プロジェクト関連資料または共通資料一覧取得
* 作業関連資料または共通資料一覧取得
*
* @return
* @return ジャンル毎の共通資料
*/
public List<CategoryContentDto> getOperationRelatedContent() {
List<ContentDto> contentDtoList;
......
......@@ -2,11 +2,11 @@
<resources>
<string-array name="sort_names">
        <item>작업명(가나다)</item>
        <item>작업개시일 최신</item>
        <item>작업개시일 오래된</item>
        <item>작업명(가나다)</item>
        <item>최신 작업</item>
        <item>오래된 작업</item>
        <item>보고타입</item>
        <item>열람최신</item>
        <item>최신 열람</item>
</string-array>
<string-array name="category_types">
......
......@@ -115,7 +115,7 @@ public class ABVUIDataCache {
/**
* ソート条件をセット
* @param sortCondition
* @param sortCondition ソートタイプ
*/
public void setSortCondition(int sortCondition) {
/* ロケーションタイプ毎にソート条件を保存する */
......@@ -124,7 +124,7 @@ public class ABVUIDataCache {
/**
* ソート条件を取得
* @return
* @return ソートタイプ(デフォルト : 0)
*/
public int getSortCondition() {
return PreferenceUtil.getUserPref(context, UserPrefKey.OPERATION_SORT_CONDITION, 0);
......
......@@ -70,14 +70,6 @@ public interface AppDefType {
String APERTURE_MASTER_DATA_FETCH_DATE = "apertureMasterDataFetchDate"; // 絞り検索マスタデータのFetchDate
}
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 {
int CONTENT_DETAIL_OPEN = 0; // コンテンツ詳細画面
int CONTENT_OPEN = 1; // コンテンツ閲覧
......
......@@ -1882,6 +1882,12 @@ public class OperationListActivity extends ABVUIActivity {
}
// 並び替えの表示するソートリスト
/**
* 並び替えの表示するソートリスト
* @param listView
* @return ArrayAdapter ソート名をセットしたアダプタ
*/
private ArrayAdapter<String> setSortListView(ListView listView) {
listView.setChoiceMode(AbsListView.CHOICE_MODE_SINGLE);
return new ArrayAdapter<>(this, R.layout.item_checked_list, Arrays.asList(getRStringArray(R.array.sort_names)));
......
......@@ -24,7 +24,7 @@ import static jp.agentec.abook.abv.cl.util.PreferenceUtil.getUserPref;
* @author jang
*
*/
public abstract class HierarchyOperationListHelper<StackObject> extends OperationListHelper implements OnClickListener {
public abstract class CategoryOperationListHelper<StackObject> extends OperationListHelper implements OnClickListener {
private final int MP = LayoutParams.MATCH_PARENT;
private final int WP = LayoutParams.WRAP_CONTENT;
protected Stack<StackObject> stack;
......@@ -39,7 +39,7 @@ public abstract class HierarchyOperationListHelper<StackObject> extends Operatio
* 階層構造を持つ親クラス
* @param appActivity
*/
public HierarchyOperationListHelper(OperationListActivity appActivity) {
public CategoryOperationListHelper(OperationListActivity appActivity) {
super(appActivity);
mHierarchyContentLayout = new LinearLayout(appActivity);
......
......@@ -28,8 +28,7 @@ public class HomeOperationListHelper extends OperationListHelper {
@Override
protected List<OperationDto> findOperationList() throws Exception {
int operationSortType = getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_SORT_CONDITION, 0);
OperationSortingType operationSortingType = convertSortType(operationSortType);
OperationSortingType operationSortingType = OperationSortingType.parse(operationSortType);
return operationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, operationSortingType);
}
}
package jp.agentec.abook.abv.ui.home.helper;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.acms.type.OperationSortingType;
......@@ -19,7 +18,7 @@ import jp.agentec.adf.util.CollectionUtil;
import static jp.agentec.abook.abv.cl.util.PreferenceUtil.getUserPref;
public class OperationGroupMasterListHelper extends HierarchyOperationListHelper<OperationGroupMasterDto> {
public class OperationGroupMasterListHelper extends CategoryOperationListHelper<OperationGroupMasterDto> {
private static final String TAG = "OperationGroupMasterListHelper";
private OperationGroupMasterDao mOperationGroupMasterDao = AbstractDao.getDao(OperationGroupMasterDao.class);
......@@ -78,7 +77,7 @@ public class OperationGroupMasterListHelper extends HierarchyOperationListHelper
mAppActivity.checkBatchNeedSyncButton(peekOperationGroupMasterDto.operationGroupMasterId);
int operationSortType = getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_SORT_CONDITION, 0);
OperationSortingType operationSortingType = convertSortType(operationSortType);
OperationSortingType operationSortingType = OperationSortingType.parse(operationSortType);
// 作業種別IDで紐づく作業リストを取得
return mOperationGroupMasterLogic.getOperationByOperationGroupMasterId(peekOperationGroupMasterDto.operationGroupMasterId, operationSortingType);
}
......
......@@ -11,7 +11,6 @@ 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,35 +58,6 @@ public abstract class OperationListHelper {
mPullToRefreshGridView = new PullToRefreshGridView(activity);
}
/**
* ソートタイプを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を返す
......
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