Commit 82568d82 by Kim Jinsung

Merge branch 'contract/sato/1.0.500_son' into 'contract/sato/1.0.500'

implement operation auto sync

See merge request !320
parents e46de6fd 0c39bacd
......@@ -606,4 +606,8 @@ public class OperationDao extends AbstractDao {
Logger.e(TAG, e);
}
}
public List<OperationDto> getNeedSyncAllOperation() {
return rawQueryGetDtoList("select tp.*, rpc.content_id from t_operation AS tp left outer join r_operation_content AS rpc on tp.operation_id = rpc.operation_id where tp.need_sync_flg = 1", null, OperationDto.class);
}
}
......@@ -1468,4 +1468,9 @@
<string name="msg_qrcode_not_operation_format">作業QRコードではありません。</string>
<string name="msg_qrcode_operation_not_found">作業が存在しません。</string>
<string name="msg_qrcode_disconnect_content_download">インターネットに接続されてないので同期できません。インターネットに接続してください。</string>
<string name="auto_sync">自動同期</string>
<string name="auto_sync_setting_title">自動同期する</string>
<string name="auto_sync_setting_subtitle">作業一覧で作業の自動同期を可能にします。</string>
</resources>
......@@ -1482,4 +1482,8 @@
<string name="msg_qrcode_operation_not_found">Working does not exist.</string>
<string name="msg_qrcode_disconnect_content_download">Synchronization process was failed because there are not connected to the internet. Please connect the internet.</string>
<string name="auto_sync">Auto Sync</string>
<string name="auto_sync_setting_title">Automatically sync</string>
<string name="auto_sync_setting_subtitle">Enables automatic synchronization of operations in the operation list.</string>
</resources>
\ No newline at end of file
......@@ -68,4 +68,11 @@
android:title="@string/spp_machine" >
</PreferenceScreen>
</PreferenceCategory>
<PreferenceCategory android:title="@string/auto_sync" android:key="auto_sync">
<CheckBoxPreference
android:defaultValue="false"
android:key="operationAutoSync"
android:title="@string/auto_sync_setting_title"
android:summary="@string/auto_sync_setting_subtitle"/>
</PreferenceCategory>
</PreferenceScreen>
\ No newline at end of file
......@@ -55,21 +55,26 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
ErrorMessage.showErrorMessageToast(ShowPushMessageDailogActivity.this, PatternStringUtil.patternToInt(getApplicationContext(),
R.string.msg_routineTask_report_disable_no_operation,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
} else if (operationDto.needSyncFlg) {
// リソースパターンの適用
ErrorMessage.showErrorMessageToast(ShowPushMessageDailogActivity.this, PatternStringUtil.patternToInt(getApplicationContext(),
R.string.msg_routineTask_report_disable_not_updated,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
} else {
OperationListActivity operationListActivity = ActivityHandlingHelper.getInstance().getPreviousOperationListActivity();
if (operationListActivity != null) {
operationListActivity.startTaskDirectionOrReportView(operationDto);
} else {
if (operationListActivity != null && operationListActivity.needAutoSync()) {
operationListActivity.autoSyncOperationId(operationId);
return;
}
if (operationDto.needSyncFlg) {
// リソースパターンの適用
ErrorMessage.showErrorMessageToast(ShowPushMessageDailogActivity.this, PatternStringUtil.patternToInt(getApplicationContext(),
R.string.msg_routineTask_report_disable_not_list,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
R.string.msg_routineTask_report_disable_not_updated,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
} else {
if (operationListActivity != null) {
operationListActivity.startTaskDirectionOrReportView(operationDto);
} else {
// リソースパターンの適用
ErrorMessage.showErrorMessageToast(ShowPushMessageDailogActivity.this, PatternStringUtil.patternToInt(getApplicationContext(),
R.string.msg_routineTask_report_disable_not_list,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
}
}
}
}
......
......@@ -76,6 +76,7 @@ public interface AppDefType {
String OPERATION_GROUP_MASERT_MODE = "operation_group_master"; // 通常・作業種別モード(画面)
String OPERATION_GROUP_MASERT_ID = "operation_group_master_id"; // 作業種別のID
String OPERATION_SORT_CONDITION = "operation_sort_condition"; // 作業のソート
String OPERATION_AUTO_SYNC = "operationAutoSync";
}
/**
......
......@@ -82,6 +82,9 @@ public class ABVBatchSyncView extends ProgressDialog {
// Activity破棄フラグがtrue、またはスタックが存在しなければ、全て完了と見做す
closeProgressDialog();
Logger.d(TAG, "---batchSync is end");
if (mOperationListActivity != null && mOperationListActivity.mAutoSyncingFlg) {
mOperationListActivity.autoSyncOperationDone(true);
}
return;
}
// ベース資料のダウンロードチェック
......@@ -97,6 +100,9 @@ public class ABVBatchSyncView extends ProgressDialog {
// error
showBatchSyncErrorAlert(peekOperationDto, mOperationListActivity.getString(R.string.msg_batch_sync_content_download_fail));
}
if (mOperationListActivity != null && mOperationListActivity.mAutoSyncingFlg) {
mOperationListActivity.autoSyncOperationDone(false);
}
return;
}
// 同期処理
......
......@@ -148,18 +148,7 @@ public abstract class OperationListHelper {
adapter.setAdapterListener(new AbstractOperationAdapter.AbstractOperationListAdapterListener() {
@Override
public void openReport(OperationDto operationDto) {
if (operationDto.contentId != null && operationDto.contentId != 0) {
// 作業画面
mAppActivity.openReportView(operationDto);
} else {
if (operationDto.operationType == PANO) {
// パノラマ登録画面
mAppActivity.showPanoEntryDialog(operationDto);
} else {
// 何もしない
Logger.e("not open target");
}
}
onClickReport(operationDto);
}
@Override
......@@ -211,18 +200,7 @@ public abstract class OperationListHelper {
adapter.setAdapterListener(new AbstractOperationAdapter.AbstractOperationListAdapterListener() {
@Override
public void openReport(OperationDto operationDto) {
if (operationDto.contentId != null && operationDto.contentId != 0) {
// 作業画面
mAppActivity.openReportView(operationDto);
} else {
if (operationDto.operationType == PANO) {
// パノラマ登録画面
mAppActivity.showPanoEntryDialog(operationDto);
} else {
// 何もしない
Logger.e("not open target");
}
}
onClickReport(operationDto);
}
@Override
......@@ -285,4 +263,23 @@ public abstract class OperationListHelper {
*/
abstract protected List<OperationDto> findOperationList() throws Exception;
public void onClickReport(OperationDto operationDto) {
if (mAppActivity.needAutoSync()) {
mAppActivity.autoSyncOperationId(operationDto.operationId);
return;
}
if (operationDto.contentId != null && operationDto.contentId != 0) {
// 作業画面
mAppActivity.openReportView(operationDto);
} else {
if (operationDto.operationType == PANO) {
// パノラマ登録画面
mAppActivity.showPanoEntryDialog(operationDto);
} else {
// 何もしない
Logger.e("not open target");
}
}
}
}
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