Commit aa4ea1b4 by onuma

古いDBからパージョンアップ用関数追加

parent 9d297936
...@@ -57,11 +57,7 @@ public class OperationListJSON extends AcmsCommonJSON { ...@@ -57,11 +57,7 @@ public class OperationListJSON extends AcmsCommonJSON {
public static final String EnableAddReport = "enableAddReport"; public static final String EnableAddReport = "enableAddReport";
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能
///////////////////////////////////////////////////////////////////////////////////////////////////////
public static final String OperationGroupMasterIdList = "operationGroupMasterIdList"; public static final String OperationGroupMasterIdList = "operationGroupMasterIdList";
public static final String QuickReport = "quickReport"; public static final String QuickReport = "quickReport";
public List<OperationDto> operationList; public List<OperationDto> operationList;
......
...@@ -61,6 +61,7 @@ public class ABVEnvironment { ...@@ -61,6 +61,7 @@ public class ABVEnvironment {
// Serverから取得したcontentVersion時のリソースパターンを一時的に保存するための変数 // Serverから取得したcontentVersion時のリソースパターンを一時的に保存するための変数
public int resourcePatternType; public int resourcePatternType;
public boolean operationGroupMasterClearFlg;
////////////////////////////// 定数 ////////////////////////////////// ////////////////////////////// 定数 //////////////////////////////////
...@@ -776,11 +777,6 @@ public class ABVEnvironment { ...@@ -776,11 +777,6 @@ public class ABVEnvironment {
return String.format(OperationMasterDataDirFormat, rootDirectory); return String.format(OperationMasterDataDirFormat, rootDirectory);
} }
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能
///////////////////////////////////////////////////////////////////////////////////////////////////////
public boolean operationGroupMasterClearFlg;
/** /**
* 作業種別のクリア判定フラグをセット * 作業種別のクリア判定フラグをセット
......
...@@ -19,9 +19,6 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase; ...@@ -19,9 +19,6 @@ 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_0_3; public static final int DatabaseVersion = DatabaseVersions.Ver1_0_3;
protected SQLiteDatabase db = null; protected SQLiteDatabase db = null;
......
...@@ -236,82 +236,6 @@ public class OperationDao extends AbstractDao { ...@@ -236,82 +236,6 @@ public class OperationDao extends AbstractDao {
delete("m_worker_group", null, null); delete("m_worker_group", null, null);
} }
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);
}
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();
sql.append(" SELECT top.operation_id, ");
sql.append(" top.operation_name, ");
sql.append(" top.operation_type, ");
sql.append(" top.operation_descriptions, ");
sql.append(" top.operation_start_date, ");
sql.append(" top.operation_end_date, ");
sql.append(" top.last_edit_date, ");
sql.append(" top.edit_lock_flg, ");
sql.append(" top.need_sync_flg, ");
sql.append(" top.content_creating_flg, ");
sql.append(" top.report_type, ");
sql.append(" top.report_cycle, ");
sql.append(" top.enable_report_update, ");
sql.append(" top.enable_report_edit, ");
sql.append(" top.enable_add_report, ");
sql.append(" CASE ");
sql.append(" WHEN report_type = 1 THEN ( ");
sql.append(" SELECT strftime('%Y/%m/%d %H:%M', datetime(ttr.report_start_date, 'localtime')) || ' ~ ' || strftime('%Y/%m/%d %H:%M', datetime(ttr.report_end_date, 'localtime')) ");
sql.append(" FROM t_task tt ");
sql.append(" INNER JOIN t_task_report ttr ");
sql.append(" ON tt.task_key = ttr.task_key ");
sql.append(" AND tt.del_flg = 0 ");
//sql.append(" AND datetime(ttr.report_start_date) <= datetime('" + curDate + "') ");
sql.append(" AND datetime(ttr.report_end_date) >= datetime('" + curDate + "') ");
sql.append(" WHERE tt.operation_id = top.operation_id ");
sql.append(" ORDER BY ttr.report_start_date ASC LIMIT 1 ) ");
sql.append(" ELSE '' ");
sql.append(" END AS report_period, ");
sql.append(" CASE ");
sql.append(" WHEN report_type = 1 THEN ( ");
sql.append(" SELECT count(*) ");
sql.append(" FROM t_task_report ");
sql.append(" WHERE task_key = (SELECT task_key FROM t_task WHERE operation_id = top.operation_id LIMIT 1) ) ");
sql.append(" ELSE 0 ");
sql.append(" END AS report_count, ");
sql.append(" rpc.content_id ");
sql.append(" FROM t_operation AS top ");
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 ");
sql.append(" WHERE top.operation_id IS NOT NULL ");
if (!StringUtil.isNullOrEmpty(searchOperationName)) {
sql.append(" AND top.operation_name GLOB " + "'*" + searchOperationName + "*'");
}
if (!StringUtil.isNullOrEmpty(searchStartDateStr)) {
Date startDate = DateTimeUtil.toDate(searchStartDateStr, "UTC", DateTimeFormat.yyyyMMdd_hyphen);
sql.append(" AND top.operation_end_date >= '" + DateTimeUtil.toString(startDate, DateTimeFormat.yyyyMMdd_hyphen) + "'");
}
if (!StringUtil.isNullOrEmpty(searchEndDateStr)) {
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 +")");
}
sql.append(" ORDER BY top.operation_start_date DESC, top.operation_id DESC");
Logger.v(TAG, "sql=%s", sql);
return sql.toString();
}
public boolean updateContentCreatingFlg(long operationId, boolean contentCreatingFlg) { public boolean updateContentCreatingFlg(long operationId, boolean contentCreatingFlg) {
OperationDto dto = getOperation(operationId); OperationDto dto = getOperation(operationId);
if (dto != null) { if (dto != null) {
...@@ -344,9 +268,6 @@ public class OperationDao extends AbstractDao { ...@@ -344,9 +268,6 @@ public class OperationDao extends AbstractDao {
updateNeedSyncFlg(operationDto.operationId, true); updateNeedSyncFlg(operationDto.operationId, true);
} }
} }
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能
///////////////////////////////////////////////////////////////////////////////////////////////////////
// quick_report フィールドを追加 // quick_report フィールドを追加
...@@ -390,8 +311,6 @@ public class OperationDao extends AbstractDao { ...@@ -390,8 +311,6 @@ public class OperationDao extends AbstractDao {
return rawQueryGetDtoList(sql, null, OperationDto.class); return rawQueryGetDtoList(sql, null, OperationDto.class);
} }
// ABookCheckでは、同名の関数があるが、引数の数がちがったのでコピーした
/** /**
* 引数の検索条件で作業情報リストを * 引数の検索条件で作業情報リストを
* 取得用のsql文作成 * 取得用のsql文作成
......
...@@ -9,8 +9,9 @@ import jp.agentec.adf.util.StringUtil; ...@@ -9,8 +9,9 @@ import jp.agentec.adf.util.StringUtil;
/** /**
* Created by leej on 2019/06/24. * Created by leej on 2019/06/24.
*
* カテゴリ選択機能で追加されたテーブル
*/ */
public class MOperationGroupMaster extends SQLiteTableScript { public class MOperationGroupMaster extends SQLiteTableScript {
public MOperationGroupMaster() { public MOperationGroupMaster() {
...@@ -44,7 +45,11 @@ public class MOperationGroupMaster extends SQLiteTableScript { ...@@ -44,7 +45,11 @@ public class MOperationGroupMaster extends SQLiteTableScript {
@Override @Override
public List<String> getUpgradeScript(int oldVersion, int newVersion) { public List<String> getUpgradeScript(int oldVersion, int newVersion) {
return null; List<String> ddl = new ArrayList<String>();
if (oldVersion < DatabaseVersions.Ver1_0_3) {
ddl.addAll(getCreateScript(newVersion));
}
return ddl;
} }
@Override @Override
......
...@@ -8,8 +8,10 @@ import jp.agentec.abook.abv.bl.data.DatabaseVersions; ...@@ -8,8 +8,10 @@ import jp.agentec.abook.abv.bl.data.DatabaseVersions;
/** /**
* Created by leej on 2019/06/25. * Created by leej on 2019/06/25.
*
* カテゴリ選択機能で追加されたテーブル
*
*/ */
public class ROperationGroupMasterOperation extends SQLiteTableScript { public class ROperationGroupMasterOperation extends SQLiteTableScript {
public ROperationGroupMasterOperation() { public ROperationGroupMasterOperation() {
...@@ -36,7 +38,12 @@ public class ROperationGroupMasterOperation extends SQLiteTableScript { ...@@ -36,7 +38,12 @@ public class ROperationGroupMasterOperation extends SQLiteTableScript {
@Override @Override
public List<String> getUpgradeScript(int oldVersion, int newVersion) { public List<String> getUpgradeScript(int oldVersion, int newVersion) {
return null; // 「カテゴリ選択機能」アップデートで追加されたテーブル
List<String> ddl = new ArrayList<String>();
if (oldVersion < DatabaseVersions.Ver1_0_3) {
ddl.addAll(getCreateScript(newVersion));
}
return ddl;
} }
@Override @Override
......
...@@ -8,6 +8,10 @@ import jp.agentec.abook.abv.bl.data.DatabaseVersions; ...@@ -8,6 +8,10 @@ import jp.agentec.abook.abv.bl.data.DatabaseVersions;
/** /**
* Created by leej on 2018/08/17. * Created by leej on 2018/08/17.
*
* カテゴリ選択機能で2つ列追加
* operation_open_date
* quick_report
*/ */
public class TOperation extends SQLiteTableScript { public class TOperation extends SQLiteTableScript {
...@@ -38,9 +42,6 @@ public class TOperation extends SQLiteTableScript { ...@@ -38,9 +42,6 @@ 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(" , operation_open_date DATETIME ");
sql.append(" , quick_report SMALLINT NOT NULL DEFAULT 0 "); sql.append(" , quick_report SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , PRIMARY KEY (operation_id) "); sql.append(" , PRIMARY KEY (operation_id) ");
...@@ -53,22 +54,12 @@ public class TOperation extends SQLiteTableScript { ...@@ -53,22 +54,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) { if (oldVersion < DatabaseVersions.Ver1_0_3) {
// ddl.addAll(getCreateScript(newVersion)); ddl.add(" ALTER TABLE t_operation ADD COLUMN operation_open_date DATETIME ");
// } ddl.add(" ALTER TABLE t_operation ADD COLUMN quick_report SMALLINT NOT NULL DEFAULT 0 ");
// }
// 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
......
...@@ -53,8 +53,8 @@ import jp.agentec.adf.util.DateTimeUtil; ...@@ -53,8 +53,8 @@ import jp.agentec.adf.util.DateTimeUtil;
private ContentLogic contentLogic = AbstractLogic.getLogic(ContentLogic.class); private ContentLogic contentLogic = AbstractLogic.getLogic(ContentLogic.class);
private OperationLogic operationLogic = AbstractLogic.getLogic(OperationLogic.class); private OperationLogic operationLogic = AbstractLogic.getLogic(OperationLogic.class);
private ContentDao contentDao = AbstractDao.getDao(ContentDao.class); private ContentDao contentDao = AbstractDao.getDao(ContentDao.class);
private SppDeviceDao sppDeviceDao = AbstractDao.getDao(SppDeviceDao.class); private SppDeviceDao sppDeviceDao = AbstractDao.getDao(SppDeviceDao.class);
private OperationGroupMasterLogic operationGroupMasterLogic = AbstractLogic.getLogic(OperationGroupMasterLogic.class);
private ABVDataCache cache = ABVDataCache.getInstance(); private ABVDataCache cache = ABVDataCache.getInstance();
private ContentDownloader contentDownloader = ContentDownloader.getInstance(); private ContentDownloader contentDownloader = ContentDownloader.getInstance();
...@@ -176,9 +176,7 @@ import jp.agentec.adf.util.DateTimeUtil; ...@@ -176,9 +176,7 @@ import jp.agentec.adf.util.DateTimeUtil;
// マスタデータの最新更新された時のFetchDateを一時に保存する。 // マスタデータの最新更新された時のFetchDateを一時に保存する。
ABVDataCache.getInstance().tempMasterDataFetchDate = fetchDate; ABVDataCache.getInstance().tempMasterDataFetchDate = fetchDate;
} }
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能
///////////////////////////////////////////////////////////////////////////////////////////////////////
// 作業種別情報を取得 // 作業種別情報を取得
operationGroupMasterLogic.setOperationGroupMaster(); operationGroupMasterLogic.setOperationGroupMaster();
...@@ -470,8 +468,4 @@ import jp.agentec.adf.util.DateTimeUtil; ...@@ -470,8 +468,4 @@ import jp.agentec.adf.util.DateTimeUtil;
Logger.e("batchSendDownloadLog failed.", e); // 例外は上にあげない。失敗したら次送られるはず(要確認) Logger.e("batchSendDownloadLog failed.", e); // 例外は上にあげない。失敗したら次送られるはず(要確認)
} }
} }
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能
///////////////////////////////////////////////////////////////////////////////////////////////////////
private OperationGroupMasterLogic operationGroupMasterLogic = AbstractLogic.getLogic(OperationGroupMasterLogic.class);
} }
...@@ -31,9 +31,12 @@ public class OperationDto extends AbstractDto { ...@@ -31,9 +31,12 @@ public class OperationDto extends AbstractDto {
public int enableReportHistory; // 0: 履歴無し, 1: 履歴可 public int enableReportHistory; // 0: 履歴無し, 1: 履歴可
public int enableReportEdit; // 作業編集可能区分 public int enableReportEdit; // 作業編集可能区分
public int enableAddReport; // 作業追加区分 public int enableAddReport; // 作業追加区分
public int quickReport; // 簡易帳票区分
// 作業担当グループリスト // 作業担当グループリスト
public List<TaskWorkerGroupDto> taskWorkerGroupDtoList; public List<TaskWorkerGroupDto> taskWorkerGroupDtoList;
// 作業種別に紐づく作業Dto
public List<OperationGroupMasterRelationDto> operationGroupMasterRelationDtoList;
public boolean equalsLastEdit(OperationDto dto) { public boolean equalsLastEdit(OperationDto dto) {
if (dto != null) { if (dto != null) {
...@@ -59,13 +62,4 @@ public class OperationDto extends AbstractDto { ...@@ -59,13 +62,4 @@ public class OperationDto extends AbstractDto {
return new String[] { "" + operationId }; return new String[] { "" + operationId };
} }
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能
///////////////////////////////////////////////////////////////////////////////////////////////////////
// getInsertValues() getUpdateValues() も更新した
public int quickReport; // 簡易帳票区分
public List<OperationGroupMasterRelationDto> operationGroupMasterRelationDtoList; // 作業種別に紐づく作業Dto
} }
...@@ -81,9 +81,6 @@ public class OperationLogic extends AbstractLogic { ...@@ -81,9 +81,6 @@ public class OperationLogic extends AbstractLogic {
private TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class); private TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class);
private TaskReportSendDao mTaskReportSendDao = AbstractDao.getDao(TaskReportSendDao.class); private TaskReportSendDao mTaskReportSendDao = AbstractDao.getDao(TaskReportSendDao.class);
private TaskReportItemsDao mTaskReportItemsDao = AbstractDao.getDao(TaskReportItemsDao.class); private TaskReportItemsDao mTaskReportItemsDao = AbstractDao.getDao(TaskReportItemsDao.class);
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能 追加
///////////////////////////////////////////////////////////////////////////////////////////////////////
private OperationGroupMasterOperationDao mOperationGroupMasterOperationDao = AbstractDao.getDao(OperationGroupMasterOperationDao.class); private OperationGroupMasterOperationDao mOperationGroupMasterOperationDao = AbstractDao.getDao(OperationGroupMasterOperationDao.class);
private ContentLogic mContentLogic = AbstractLogic.getLogic(ContentLogic.class); private ContentLogic mContentLogic = AbstractLogic.getLogic(ContentLogic.class);
...@@ -145,9 +142,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -145,9 +142,7 @@ public class OperationLogic extends AbstractLogic {
if (mOperationContentDao.isExistMainOperationContent(serverOperationDto.operationId)) { if (mOperationContentDao.isExistMainOperationContent(serverOperationDto.operationId)) {
serverOperationDto.contentCreatingFlg = false; serverOperationDto.contentCreatingFlg = false;
} }
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能 追加
///////////////////////////////////////////////////////////////////////////////////////////////////////
// ローカルにある作業情報に紐づく全作業IDを取得 // ローカルにある作業情報に紐づく全作業IDを取得
List<Integer> localOperationGroupMasterIds = mOperationGroupMasterOperationDao.getOperationGroupMasterIds(serverOperationDto.operationId); List<Integer> localOperationGroupMasterIds = mOperationGroupMasterOperationDao.getOperationGroupMasterIds(serverOperationDto.operationId);
for (OperationGroupMasterRelationDto operationGroupMasterRelationDto : serverOperationDto.operationGroupMasterRelationDtoList) { for (OperationGroupMasterRelationDto operationGroupMasterRelationDto : serverOperationDto.operationGroupMasterRelationDtoList) {
...@@ -172,9 +167,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -172,9 +167,7 @@ public class OperationLogic extends AbstractLogic {
mOperationGroupMasterOperationDao.deleteOperationGroupMasterOperation(deleteOperationGroupMasterId, serverOperationDto.operationId); mOperationGroupMasterOperationDao.deleteOperationGroupMasterOperation(deleteOperationGroupMasterId, serverOperationDto.operationId);
} }
} }
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能 追加ここまで
///////////////////////////////////////////////////////////////////////////////////////////////////////
mOperationDao.update(serverOperationDto); mOperationDao.update(serverOperationDto);
// 更新することで登録フラグをfalseにセット // 更新することで登録フラグをfalseにセット
insertFlg = false; insertFlg = false;
...@@ -202,16 +195,11 @@ public class OperationLogic extends AbstractLogic { ...@@ -202,16 +195,11 @@ public class OperationLogic extends AbstractLogic {
for (OperationContentDto operationContentDto : serverOperationDto.operationContentDtoList) { for (OperationContentDto operationContentDto : serverOperationDto.operationContentDtoList) {
mOperationContentDao.insertOperationContent(operationContentDto); mOperationContentDao.insertOperationContent(operationContentDto);
} }
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能
///////////////////////////////////////////////////////////////////////////////////////////////////////
// 作業種別・作業のリレーションテーブルにデータ登録 // 作業種別・作業のリレーションテーブルにデータ登録
for (OperationGroupMasterRelationDto operationGroupMasterRelationDto : serverOperationDto.operationGroupMasterRelationDtoList) { for (OperationGroupMasterRelationDto operationGroupMasterRelationDto : serverOperationDto.operationGroupMasterRelationDtoList) {
mOperationGroupMasterOperationDao.insertOperationGroupMasterOperation(operationGroupMasterRelationDto); mOperationGroupMasterOperationDao.insertOperationGroupMasterOperation(operationGroupMasterRelationDto);
} }
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能 追加ここまで
///////////////////////////////////////////////////////////////////////////////////////////////////////
} }
// 作業担当グループ登録 // 作業担当グループ登録
...@@ -1807,13 +1795,6 @@ public class OperationLogic extends AbstractLogic { ...@@ -1807,13 +1795,6 @@ public class OperationLogic extends AbstractLogic {
return result; return result;
} }
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能
///////////////////////////////////////////////////////////////////////////////////////////////////////
// ABookCheckでは、同名の関数があるが、引数の数がちがったのでコピーした
/** /**
* 作業一覧取得 * 作業一覧取得
* *
......
...@@ -131,6 +131,7 @@ public class OperationListActivity extends OperationActivity { ...@@ -131,6 +131,7 @@ public class OperationListActivity extends OperationActivity {
private ImageButton mViewModeButton; // 左上 private ImageButton mViewModeButton; // 左上
private ImageButton mSearchButton; // 検索ボタン private ImageButton mSearchButton; // 検索ボタン
private ImageButton mCategoryLocationButton; // カテゴリ選択ボタン
private List<OperationDto> mOperationList; private List<OperationDto> mOperationList;
...@@ -187,6 +188,14 @@ public class OperationListActivity extends OperationActivity { ...@@ -187,6 +188,14 @@ public class OperationListActivity extends OperationActivity {
private ArrayList<Integer> mAllOperationReportTypes; private ArrayList<Integer> mAllOperationReportTypes;
private Map<Integer, Integer> operationCountMap;
private OperationGroupMasterLogic mOperationGroupMasterLogic = AbstractLogic.getLogic(OperationGroupMasterLogic.class);
private ABVListDialog mShowDialog;
private OperationDao mOperationDao = AbstractDao.getDao(OperationDao.class);
// 作業種別のサービスオプション値を保持用フラグ
private boolean mOperationGroupMasterServiceOperationFlg;
// ビューの作成 // ビューの作成
private class ReloadHandler implements Runnable { private class ReloadHandler implements Runnable {
@Override @Override
...@@ -322,9 +331,6 @@ public class OperationListActivity extends OperationActivity { ...@@ -322,9 +331,6 @@ public class OperationListActivity extends OperationActivity {
// フィルター選択判定 // フィルター選択判定
checkSelectedFilterType(); checkSelectedFilterType();
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能
///////////////////////////////////////////////////////////////////////////////////////////////////////
// 作業種別表示・非表示 // 作業種別表示・非表示
if (mOperationGroupMasterServiceOperationFlg) { if (mOperationGroupMasterServiceOperationFlg) {
// サービスオプションON // サービスオプションON
...@@ -368,9 +374,6 @@ public class OperationListActivity extends OperationActivity { ...@@ -368,9 +374,6 @@ public class OperationListActivity extends OperationActivity {
* ビューを作り直す。 * ビューを作り直す。
*/ */
public void setOperationListView() { public void setOperationListView() {
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能
///////////////////////////////////////////////////////////////////////////////////////////////////////
mListHelper = getListHelper(); mListHelper = getListHelper();
handler.post(new ReloadHandler()); handler.post(new ReloadHandler());
configurationToolbarIcon(); configurationToolbarIcon();
...@@ -400,10 +403,6 @@ public class OperationListActivity extends OperationActivity { ...@@ -400,10 +403,6 @@ public class OperationListActivity extends OperationActivity {
// マスタデータ最新更新する時fetchDateをローカルに保存する。 // マスタデータ最新更新する時fetchDateをローカルに保存する。
setMasterDataFetchDate(); setMasterDataFetchDate();
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能
///////////////////////////////////////////////////////////////////////////////////////////////////////
//refreshOperationList();
if (mOperationGroupMasterServiceOperationFlg == ABVDataCache.getInstance().serviceOption.isOperationGroupMaster()) { if (mOperationGroupMasterServiceOperationFlg == ABVDataCache.getInstance().serviceOption.isOperationGroupMaster()) {
// サービスオプションが変わってない場合は、ビューは作らずにデータのみ更新 // サービスオプションが変わってない場合は、ビューは作らずにデータのみ更新
refreshOperationList(); refreshOperationList();
...@@ -413,7 +412,6 @@ public class OperationListActivity extends OperationActivity { ...@@ -413,7 +412,6 @@ public class OperationListActivity extends OperationActivity {
mOperationGroupMasterServiceOperationFlg = ABVDataCache.getInstance().serviceOption.isOperationGroupMaster(); mOperationGroupMasterServiceOperationFlg = ABVDataCache.getInstance().serviceOption.isOperationGroupMaster();
// 作業種別の選択画面を閉じる // 作業種別の選択画面を閉じる
closeOperationGroupMasterDialog(); closeOperationGroupMasterDialog();
// ビューを作り直す // ビューを作り直す
setOperationListView(); setOperationListView();
} }
...@@ -586,9 +584,6 @@ public class OperationListActivity extends OperationActivity { ...@@ -586,9 +584,6 @@ public class OperationListActivity extends OperationActivity {
} }
private void clearData() { private void clearData() {
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能
///////////////////////////////////////////////////////////////////////////////////////////////////////
// 開始日の初期化 // 開始日の初期化
if (mStartDate != null) { if (mStartDate != null) {
mStartDate.setText(StringUtil.Empty); mStartDate.setText(StringUtil.Empty);
...@@ -635,19 +630,6 @@ public class OperationListActivity extends OperationActivity { ...@@ -635,19 +630,6 @@ public class OperationListActivity extends OperationActivity {
return result; return result;
} }
// ツールバーの検索結果レイアウトの表示・非表示
private void checkShowSearchResult() {
if (StringUtil.isNullOrEmpty(mSearchWord) && StringUtil.isNullOrEmpty(mStartDateStr) && StringUtil.isNullOrEmpty(mEndDateStr)) {
// 検索ワードが存在しない場合、検索結果ではないので非表示
//mSearchResultLayout.setVisibility(View.GONE);
mTitleView.setVisibility(View.VISIBLE);
} else {
// 検索ワードが存在するため、検索結果と見做し、表示
//mSearchResultLayout.setVisibility(View.VISIBLE);
mTitleView.setVisibility(View.GONE);
}
}
public void startTaskDirectionOrReportView(OperationDto operationDto) { public void startTaskDirectionOrReportView(OperationDto operationDto) {
ContentDto contentDto = contentDao.getContent(operationDto.contentId); ContentDto contentDto = contentDao.getContent(operationDto.contentId);
try { try {
...@@ -1858,18 +1840,6 @@ public class OperationListActivity extends OperationActivity { ...@@ -1858,18 +1840,6 @@ public class OperationListActivity extends OperationActivity {
putUserPref(AppDefType.UserPrefKey.MASTER_DATA_FETCH_DATE, ABVDataCache.getInstance().tempMasterDataFetchDate); putUserPref(AppDefType.UserPrefKey.MASTER_DATA_FETCH_DATE, ABVDataCache.getInstance().tempMasterDataFetchDate);
} }
///////////////////////////////////////////////////////////////////////////////////////////////////////
// カテゴリ選択機能
///////////////////////////////////////////////////////////////////////////////////////////////////////
private ImageButton mCategoryLocationButton; // カテゴリ選択ボタン
private Map<Integer, Integer> operationCountMap;
private OperationGroupMasterLogic mOperationGroupMasterLogic = AbstractLogic.getLogic(OperationGroupMasterLogic.class);
private ABVListDialog mShowDialog;
private OperationDao mOperationDao = AbstractDao.getDao(OperationDao.class);
// 作業種別のサービスオプション値を保持用フラグ
private boolean mOperationGroupMasterServiceOperationFlg;
// 全て・カテゴリ選択画面(スマートフォン) // 全て・カテゴリ選択画面(スマートフォン)
public void onClickGroupLocationByNormalSize(View view) { public void onClickGroupLocationByNormalSize(View view) {
final ABVListDialog dialog = new ABVListDialog(this); final ABVListDialog dialog = new ABVListDialog(this);
...@@ -2039,19 +2009,6 @@ public class OperationListActivity extends OperationActivity { ...@@ -2039,19 +2009,6 @@ public class OperationListActivity extends OperationActivity {
} }
/** /**
* 一括同期の活性化・非活性化チェック
*/
public void checkBatchNeedSyncButton(Integer operationGroupMasterId) {
if (mOperationDao.hasNeedSyncOperationByGroupMasterId(operationGroupMasterId)) {
// 選択したカテゴリ一覧でneedSyncFlgがtrueの作業が存在すれば、活性化する
//mOperationBatchSyncButton.setEnabled(true);
} else {
// 一括同期ボタンを非活性化する
//mOperationBatchSyncButton.setEnabled(false);
}
}
/**
* ソート順取得(デフォルト:1(作業期間が新しい順)) * ソート順取得(デフォルト:1(作業期間が新しい順))
* @return * @return
*/ */
...@@ -2127,5 +2084,4 @@ public class OperationListActivity extends OperationActivity { ...@@ -2127,5 +2084,4 @@ public class OperationListActivity extends OperationActivity {
popup.showAsDropDown(anchor); popup.showAsDropDown(anchor);
} }
} }
} }
...@@ -116,7 +116,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter { ...@@ -116,7 +116,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
public View getView(int position, View convertView, final ViewGroup parent) { public View getView(int position, View convertView, final ViewGroup parent) {
ViewHolder holder = null; ViewHolder holder = null;
Logger.i(TAG, "OperationRelatedContentPanelAdapter getView ......"); Logger.d(TAG, "OperationRelatedContentPanelAdapter getView ......");
if (null == convertView) { if (null == convertView) {
holder = new ViewHolder(); holder = new ViewHolder();
...@@ -190,7 +190,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter { ...@@ -190,7 +190,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
public void configureOperationButton(final ViewHolder holder, final ContentDto contentDto) { public void configureOperationButton(final ViewHolder holder, final ContentDto contentDto) {
Logger.i(TAG, "configureOperationButton ......"); Logger.d(TAG, "configureOperationButton ......");
holder.tvNewContentMark.setVisibility(View.GONE); holder.tvNewContentMark.setVisibility(View.GONE);
holder.operationLayout.setVisibility(View.VISIBLE); holder.operationLayout.setVisibility(View.VISIBLE);
...@@ -205,18 +205,18 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter { ...@@ -205,18 +205,18 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
setNewRibbon(holder, contentDto); setNewRibbon(holder, contentDto);
if (contentDto.downloadingFlg && !contentDto.isDownloadPaused()) { if (contentDto.downloadingFlg && !contentDto.isDownloadPaused()) {
Logger.i(TAG, "isPauseDownloading ......"); Logger.d(TAG, "isPauseDownloading ......");
// ダウンロード中 // ダウンロード中
holder.btnPauseSave.setVisibility(View.VISIBLE); holder.btnPauseSave.setVisibility(View.VISIBLE);
holder.btnPauseSave.setOnClickListener(new OnDownloadPauseButtonClickListener(contentDto)); holder.btnPauseSave.setOnClickListener(new OnDownloadPauseButtonClickListener(contentDto));
} else if (!contentDto.downloadedFlg && !contentDto.isDownloadPaused() ) { } else if (!contentDto.downloadedFlg && !contentDto.isDownloadPaused() ) {
Logger.i(TAG, "isDownloadable ......"); Logger.d(TAG, "isDownloadable ......");
holder.btnSaveContent.setVisibility(View.VISIBLE); holder.btnSaveContent.setVisibility(View.VISIBLE);
holder.btnSaveContent.setOnClickListener(new OnDownloadButtonClickListener(contentDto)); holder.btnSaveContent.setOnClickListener(new OnDownloadButtonClickListener(contentDto));
} else if (contentDto.downloadedFlg && contentDto.updatedFlg && !contentDto.isDownloadPaused() ) { } else if (contentDto.downloadedFlg && contentDto.updatedFlg && !contentDto.isDownloadPaused() ) {
Logger.i(TAG, "isOpenable & isDeletable & isUpdatable......"); Logger.d(TAG, "isOpenable & isDeletable & isUpdatable......");
holder.btnOpenContent.setVisibility(View.VISIBLE); holder.btnOpenContent.setVisibility(View.VISIBLE);
holder.btnOpenContent.setOnClickListener(new View.OnClickListener() { holder.btnOpenContent.setOnClickListener(new View.OnClickListener() {
@Override @Override
...@@ -237,7 +237,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter { ...@@ -237,7 +237,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
holder.btnUpdateContent.setOnClickListener(new OnDownloadButtonClickListener(contentDto)); holder.btnUpdateContent.setOnClickListener(new OnDownloadButtonClickListener(contentDto));
} else if (contentDto.downloadedFlg && !contentDto.updatedFlg) { } else if (contentDto.downloadedFlg && !contentDto.updatedFlg) {
Logger.i(TAG, "isOpenable & isDeletable......"); Logger.d(TAG, "isOpenable & isDeletable......");
holder.btnOpenContent.setVisibility(View.VISIBLE); holder.btnOpenContent.setVisibility(View.VISIBLE);
holder.btnOpenContent.setOnClickListener(new View.OnClickListener() { holder.btnOpenContent.setOnClickListener(new View.OnClickListener() {
@Override @Override
...@@ -256,7 +256,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter { ...@@ -256,7 +256,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
}else if (contentDto.isDownloadPaused()) { }else if (contentDto.isDownloadPaused()) {
// ダウンロード一時停止中 // ダウンロード一時停止中
Logger.i(TAG, "isDownloadPaused & isCancelable......"); Logger.d(TAG, "isDownloadPaused & isCancelable......");
holder.btnRestartSave.setVisibility(View.VISIBLE); holder.btnRestartSave.setVisibility(View.VISIBLE);
holder.btnRestartSave.setOnClickListener(new OnDownloadResumeButtonClickListener(contentDto)); holder.btnRestartSave.setOnClickListener(new OnDownloadResumeButtonClickListener(contentDto));
...@@ -284,7 +284,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter { ...@@ -284,7 +284,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
} }
public void updateDownloadView(ContentDto contentDto) { public void updateDownloadView(ContentDto contentDto) {
Logger.i(TAG, "updateDownloadView ......"); Logger.d(TAG, "updateDownloadView ......");
ViewHolder holder = viewHolderMap.get(contentDto.contentId); ViewHolder holder = viewHolderMap.get(contentDto.contentId);
if (holder != null && holder.contentId == contentDto.contentId) { if (holder != null && holder.contentId == contentDto.contentId) {
createDownloadView(holder, contentDto); createDownloadView(holder, contentDto);
...@@ -301,7 +301,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter { ...@@ -301,7 +301,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
* @param contentDto * @param contentDto
*/ */
private void createDownloadView(ViewHolder holder, final ContentDto contentDto) { private void createDownloadView(ViewHolder holder, final ContentDto contentDto) {
Logger.i(TAG, "createDownloadView ......"); Logger.d(TAG, "createDownloadView ......");
ProgressBar downloadProgressBar = holder.downloadProgressBar; ProgressBar downloadProgressBar = holder.downloadProgressBar;
ImageView thumbnail = holder.ivThumbnail; ImageView thumbnail = holder.ivThumbnail;
...@@ -347,7 +347,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter { ...@@ -347,7 +347,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
AsyncTask<Params, Void, Result> task = new AsyncTask<Params, Void, Result>() { AsyncTask<Params, Void, Result> task = new AsyncTask<Params, Void, Result>() {
@Override @Override
protected Result doInBackground(Params... params) { protected Result doInBackground(Params... params) {
Logger.i(TAG, "onContentDownload start ......"); Logger.d(TAG, "onContentDownload start ......");
Result result = new Result(); Result result = new Result();
result.result = mListener.onContentDownload(params[0].contentId); result.result = mListener.onContentDownload(params[0].contentId);
return result; return result;
...@@ -355,7 +355,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter { ...@@ -355,7 +355,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
@Override @Override
protected void onPostExecute(Result result) { protected void onPostExecute(Result result) {
Logger.i(TAG, "onContentDownload after ......"); Logger.d(TAG, "onContentDownload after ......");
if (!result.result) { if (!result.result) {
contentDto.downloadingFlg = false; contentDto.downloadingFlg = false;
} }
...@@ -379,7 +379,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter { ...@@ -379,7 +379,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
AsyncTask<Params, Void, Void> task = new AsyncTask<Params, Void, Void>() { AsyncTask<Params, Void, Void> task = new AsyncTask<Params, Void, Void>() {
@Override @Override
protected Void doInBackground(Params... params) { protected Void doInBackground(Params... params) {
Logger.i(TAG, "onContentDownloadPause start ......"); Logger.d(TAG, "onContentDownloadPause start ......");
mListener.onContentDownloadPause(contentDto); mListener.onContentDownloadPause(contentDto);
return null; return null;
} }
...@@ -405,7 +405,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter { ...@@ -405,7 +405,7 @@ public class OperationRelatedContentPanelAdapter extends BaseAdapter {
AsyncTask<Params, Void, Void> task = new AsyncTask<Params, Void, Void>() { AsyncTask<Params, Void, Void> task = new AsyncTask<Params, Void, Void>() {
@Override @Override
protected Void doInBackground(Params... params) { protected Void doInBackground(Params... params) {
Logger.i(TAG, "onContentDownloadResume start ......"); Logger.d(TAG, "onContentDownloadResume start ......");
mListener.onContentDownloadResume(contentDto); mListener.onContentDownloadResume(contentDto);
return null; return null;
} }
......
...@@ -72,7 +72,6 @@ public class OperationGroupMasterListHelper extends CategoryOperationListHelper< ...@@ -72,7 +72,6 @@ public class OperationGroupMasterListHelper extends CategoryOperationListHelper<
} }
OperationGroupMasterDto peekOperationGroupMasterDto = stack.peek(); OperationGroupMasterDto peekOperationGroupMasterDto = stack.peek();
mAppActivity.checkBatchNeedSyncButton(peekOperationGroupMasterDto.operationGroupMasterId);
int operationSortType = mAppActivity.getSortCondition(); int operationSortType = mAppActivity.getSortCondition();
OperationSortingType operationSortingType = OperationSortingType.parse(operationSortType); OperationSortingType operationSortingType = OperationSortingType.parse(operationSortType);
// 作業種別IDで紐づく作業リストを取得 // 作業種別IDで紐づく作業リストを取得
......
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