Commit 1b821011 by onuma

カテゴリ絞込時にも、フィルターが使用可にした。

parent 1cf43e09
......@@ -343,12 +343,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);
}
/**
* ユーザ情報でグループが変更した時のみ使用
......@@ -398,21 +398,28 @@ public class OperationDao extends AbstractDao {
* @param operationSortingType ソートタイプ
* @return カテゴリに紐づく作業リスト
*/
public List<OperationDto> getOperationsByGroupMasterId(Integer operationGroupMasterId, OperationSortingType operationSortingType) {
String sql = generateGetOperationQuery(null, null, null, operationSortingType, operationGroupMasterId);
public List<OperationDto> getOperationsByGroupMasterId(Integer operationGroupMasterId, String reportTypeStr, OperationSortingType operationSortingType) {
String sql = generateGetOperationQuery(null, null, null, operationGroupMasterId, reportTypeStr, operationSortingType);
return rawQueryGetDtoList(sql, null, OperationDto.class);
}
/**
* 引数の検索条件で作業情報リストを
* 取得用のsql文作成
* @param searchOperationName
* @param searchStartDateStr
* @param searchEndDateStr
* @param operationSortingType
* @return
* @param searchOperationName ホーム画面入力した検索キーワード
* @param searchStartDateStr 開始期間
* @param searchEndDateStr 終了期間
* @param operationGroupMasterId 作業ID
* @param reportTypeStr 点検 or 報告
* @param operationSortingType ソート方向
* @return SQL文
*/
private String generateGetOperationQuery(String searchOperationName, String searchStartDateStr, String searchEndDateStr, OperationSortingType operationSortingType, Integer operationGroupMasterId) {
private String generateGetOperationQuery(String searchOperationName,
String searchStartDateStr,
String searchEndDateStr,
Integer operationGroupMasterId,
String reportTypeStr,
OperationSortingType operationSortingType) {
String curDate = DateTimeUtil.toStringInTimeZone(new Date(), DateTimeFormat.yyyyMMddHHmmss_hyphen, "UTC");
StringBuffer sql = new StringBuffer();
......@@ -479,6 +486,9 @@ public class OperationDao extends AbstractDao {
Date endDate = DateTimeUtil.toDate(searchEndDateStr, "UTC", 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) {
......@@ -512,17 +522,4 @@ public class OperationDao extends AbstractDao {
return sql.toString();
}
/**
* 引数の検索条件で作業情報リストを取得(作業一覧表示用)
* @param searchOperationName
* @param searchStartDateStr
* @param searchEndDateStr
* @param operationSortType
* @return
*/
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);
}
}
\ No newline at end of file
......@@ -165,8 +165,8 @@ public class OperationGroupMasterLogic extends AbstractLogic {
* @param operationSortingType ソートタイプ
* @return
*/
public List<OperationDto> getOperationByOperationGroupMasterId(Integer operationGroupMasterId, OperationSortingType operationSortingType) {
return mOperationDao.getOperationsByGroupMasterId(operationGroupMasterId, operationSortingType);
public List<OperationDto> getOperationByOperationGroupMasterId(Integer operationGroupMasterId, String reportTypeStr, OperationSortingType operationSortingType) {
return mOperationDao.getOperationsByGroupMasterId(operationGroupMasterId, reportTypeStr, operationSortingType);
}
}
......@@ -1794,25 +1794,4 @@ public class OperationLogic extends AbstractLogic {
}
return result;
}
/**
* 作業一覧取得
*
* @param searchWord 検索条件:作業名
* @param searchStartDateStr 検索条件:作業日範囲(開始)
* @param searchEndDateStr  検索条件:作業日範囲(終了)
* @param operationSortingType ソート順
* @return 作業リスト
*/
public List<OperationDto> getRefreshOperation(String searchWord, String searchStartDateStr, String searchEndDateStr, OperationSortingType operationSortingType) {
List<OperationDto> operationDtoList;
operationDtoList = mOperationDao.getOperations(searchWord, searchStartDateStr, searchEndDateStr, operationSortingType);
for (OperationDto operationDto : operationDtoList) {
// 作業送信フラグが存在する場合またはホットスポット更新フラグが存在する場合、needSyncFlgをtrueにセット
if (mTaskReportDao.isExistSendTaskData(operationDto.operationId) || mTaskReportDao.isExistUpdateTargetHotSpotTaskData(operationDto.operationId)) {
mOperationDao.updateNeedSyncFlg(operationDto.operationId, true);
}
}
return operationDtoList;
}
}
......@@ -56,9 +56,6 @@ public class ABVUIDataCache {
private void init() {
viewMode = loadViewMode();
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能
///////////////////////////////////////////////////////////////////////////////////////////////////////
operationGroupMasterStack = new Stack<>();
}
......@@ -271,9 +268,6 @@ public class ABVUIDataCache {
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能
///////////////////////////////////////////////////////////////////////////////////////////////////////
// 作業種別絞り込み用のスタック
public Stack<OperationGroupMasterDto> operationGroupMasterStack;
/**
......
......@@ -12,9 +12,12 @@ import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationGroupMasterLogic;
import jp.agentec.abook.abv.launcher.android.ABVApplication;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.home.activity.OperationListActivity;
import jp.agentec.adf.util.CollectionUtil;
import static jp.agentec.abook.abv.cl.util.PreferenceUtil.getUserPref;
public class OperationGroupMasterListHelper extends CategoryOperationListHelper<OperationGroupMasterDto> {
private static final String TAG = "OperationGroupMasterListHelper";
......@@ -72,10 +75,13 @@ public class OperationGroupMasterListHelper extends CategoryOperationListHelper<
}
OperationGroupMasterDto peekOperationGroupMasterDto = stack.peek();
// ソート方向
int operationSortType = mAppActivity.getSortCondition();
OperationSortingType operationSortingType = OperationSortingType.parse(operationSortType);
// 作業種別IDで紐づく作業リストを取得
return mOperationGroupMasterLogic.getOperationByOperationGroupMasterId(peekOperationGroupMasterDto.operationGroupMasterId, operationSortingType);
// 報告 or 定期点検
String reportTypeStr = getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null);
return mOperationGroupMasterLogic.getOperationByOperationGroupMasterId(peekOperationGroupMasterDto.operationGroupMasterId, reportTypeStr, operationSortingType);
}
/**
......
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