Commit 84b77147 by Lee Jaebin

Merge branch 'feature/1.0.1' into feature/1.0.1_pdf

parents 5ef3cb6e 29296538
......@@ -136,12 +136,13 @@ public class TaskReportDao extends AbstractDao {
sql.append("report_end_date=?, ");
sql.append("enable_report=?, ");
sql.append("task_report_level=?, ");
sql.append("local_saved_flg=? ");
sql.append("local_saved_flg=?, ");
sql.append("task_report_info_id=? ");
sql.append("WHERE task_key=? AND task_report_level=?");
if (dto.reportStartDate != null) {
sql.append(" AND datetime(report_start_date)=datetime(?)");
objects = new Object[]{dto.jsonData, dto.attachedFileName, dto.localAttachedFileName, dto.attachedFileSendFlg, dto.dataSendFlg,
dto.reportEndDate, dto.enableReport, dto.taskReportLevel, dto.localSavedFlg, dto.taskKey, dto.taskReportLevel, dto.reportStartDate};
dto.reportEndDate, dto.enableReport, dto.taskReportLevel, dto.localSavedFlg, dto.taskReportInfoId, dto.taskKey, dto.taskReportLevel, dto.reportStartDate};
} else {
objects = new Object[]{dto.jsonData, dto.attachedFileName, dto.localAttachedFileName, dto.attachedFileSendFlg, dto.dataSendFlg,
dto.reportEndDate, dto.enableReport, dto.taskReportLevel, dto.localSavedFlg, dto.taskKey, dto.taskReportLevel};
......
......@@ -495,6 +495,8 @@
<string name="Report">Report</string>
<string name="Routine">Routine</string>
<string name="ReportReply">ReportReply</string>
<string name="content_link_update">The document name [%1$s] will be updated. \nDo you want to update it?</string>
<string name="msg_non_target_meeting_content">It is the document that can not be read during distance support connection.</string>
<!-- 1.0.1 Resource Pattern 1 -->
<!-- 1.9.0.0-->
......
......@@ -71,7 +71,6 @@
android:layout_alignParentRight="true"
android:layout_gravity="center"
android:layout_margin="3dp"
android:gravity="right"
android:orientation="horizontal">
<ImageView
......@@ -79,6 +78,7 @@
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_weight="1"
android:layout_marginRight="3dp"
android:background="@drawable/ic_edit_list" />
<ImageButton
......
......@@ -185,9 +185,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// 遠隔連動
meetingManager = MeetingManager.getInstance();
if (meetingManager.isSendable() && objectId == -1 && !StringUtil.contains(contentType, new String[]{ContentJSON.KEY_PDF_TYPE, ContentJSON.KEY_NONE_TYPE})) {
meetingManager.sendWs(MeetingManager.CMD_OPEN, contentId, objectPageNumber, objectId, null);
}
mContentDir = getIntent().getStringExtra(FILEPATH);
......@@ -954,8 +951,10 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// コールバック処理のみ行う。
afterABookCheckApi(mCmd, mTaskKey, 0, "", null, isOperationPdf());
}
// 画面遷移処理
closeCurrentScreen(mOperationType);
// 画面遷移処理(一時保存以外)
if (!mCmd.equals(ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) {
closeCurrentScreen(mOperationType);
}
}
} else {
// ozd画面ではない一時保存処理時、コールバックを呼び出す
......@@ -1052,11 +1051,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
long linkedContentId = Long.valueOf(abookCheckParam.get(ABookKeys.CONTENT_ID));
int pageNum = Integer.valueOf(abookCheckParam.get(ABookKeys.CMD_PAGE_NUM));
if (!ActivityHandlingHelper.getInstance().isExistRelatedContent(linkedContentId, mOperationId)) {
ABVToastUtil.showMakeText(getApplicationContext(), R.string.msg_not_related_content, Toast.LENGTH_SHORT);
return;
}
//ダウンロード完了後、開く時に必要
isLinkedContent = true;
pageNo = pageNum -1 ;
......
......@@ -357,7 +357,8 @@ public class OperationListActivity extends ABVUIActivity {
mCommonContentButton.setImageDrawable(getRDrawable(R.drawable.ic_common_content_off));
mCommonContentButton.setEnabled(false);
}
// フィルター選択判定
checkSelectedFilterType();
}
/**
......@@ -879,19 +880,21 @@ public class OperationListActivity extends ABVUIActivity {
for (TaskDto serverTaskDto : json.taskDtoList) {
List<TaskReportDto> localRemove = new ArrayList();
// 定期点検のみ、時間が変更になった場合、差分の削除が必要なため、以下の処理を行う
// 定期点検以外の場合は、taskが存在しないので、削除処理は必要なし
if (operationDto.reportType == ReportType.RoutineTask) {
List<TaskReportDto> localTaskReportList = mTaskReportDao.getTaskReportListByTaskKey(serverTaskDto.taskKey);
for (TaskReportDto localTaskReportDto : localTaskReportList) {
if (!isExistsTaskReportInList(serverTaskDto.taskReportDtoList, localTaskReportDto)) {
if (isRoutineTask) {
mOperationLogic.deleteRoutineTaskReport(operationId, operationContentDto.contentId, localTaskReportDto);
List<TaskReportDto> localTaskReportList = mTaskReportDao.getTaskReportListByTaskKey(serverTaskDto.taskKey);
for (TaskReportDto localTaskReportDto : localTaskReportList) {
if (!isExistsTaskReportInList(serverTaskDto.taskReportDtoList, localTaskReportDto, isRoutineTask)) {
if (isRoutineTask) {
mOperationLogic.deleteRoutineTaskReport(operationId, operationContentDto.contentId, localTaskReportDto);
} else {
// taskDtoが存在するとtaskReportLevel 0 (作業報告)が存在しないことはないので、報告(回答)のみチェックして削除
if (localTaskReportDto.taskReportLevel != TaskReportLevel.ReportType) {
// 作業報告のディレクトリ削除
mOperationLogic.deleteTaskFileData(operationId, operationContentDto.contentId, serverTaskDto.taskKey, localTaskReportDto.taskReportLevel);
mTaskReportDao.delete(localTaskReportDto);
}
}
localTaskReportList.remove(localTaskReportDto);
}
}
......@@ -1639,24 +1642,34 @@ public class OperationListActivity extends ABVUIActivity {
* @param rDto
* @return
*/
private boolean isExistsTaskReportInList(List<TaskReportDto> listDto, TaskReportDto rDto) {
private boolean isExistsTaskReportInList(List<TaskReportDto> listDto, TaskReportDto rDto, boolean isRoutineTask) {
for (TaskReportDto lDto : listDto) {
// 定期点検の場合、taskKey,taskReportId,reportStartDateで判定
if (lDto.taskKey.equals(rDto.taskKey) &&
lDto.taskReportId == rDto.taskReportId &&
lDto.reportStartDate.equals(rDto.reportStartDate)) {
return true;
if (isRoutineTask) {
// 定期点検の場合、taskKey,taskReportId,reportStartDateで判定
if (lDto.taskKey.equals(rDto.taskKey) &&
lDto.taskReportId == rDto.taskReportId &&
lDto.reportStartDate.equals(rDto.reportStartDate)) {
return true;
}
} else {
// taskKeyと作業報告階層で判定
if (lDto.taskKey.equals(rDto.taskKey) &&
lDto.taskReportLevel == rDto.taskReportLevel) {
return true;
}
}
}
return false;
}
/**
* 作業指示または、報告画面に移動
* 作業報告画面に移動
* @param operationDto
*/
public void openDirectionsOrReportView(OperationDto operationDto) {
public void openReportView(OperationDto operationDto) {
if (ActivityHandlingHelper.getInstance().isMeetingConnected()) {
return;
}
// 新着更新を止める
contentRefresher.stopRefresh();
startTaskDirectionOrReportView(operationDto);
......@@ -1878,4 +1891,18 @@ public class OperationListActivity extends ABVUIActivity {
Logger.d(TAG, "ABVEnvironment.getInstance().resourcePatternType : " + ABVEnvironment.getInstance().resourcePatternType);
putUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, ABVEnvironment.getInstance().resourcePatternType);
}
/**
* フィルターの選択があるか判定して、画像を変更
*/
private void checkSelectedFilterType() {
List<Integer> defaultTypeList = getOperationReportTypeList(true);
ArrayList<Integer> selectedOperationReportTypes = getOperationReportTypeList(false);
ImageButton imgBtn = (ImageButton) findViewById(R.id.icon_filter);
if (defaultTypeList.size() == selectedOperationReportTypes.size()) {
imgBtn.setImageDrawable(getRDrawable(R.drawable.ic_filter));
} else {
imgBtn.setImageDrawable(getRDrawable(R.drawable.ic_filter_selected));
}
}
}
......@@ -16,6 +16,7 @@ import android.widget.Toast;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ExceptionHandler;
......@@ -25,6 +26,7 @@ import jp.agentec.abook.abv.bl.dto.CategoryContentDto;
import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.bl.websocket.MeetingManager;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
......@@ -36,6 +38,7 @@ import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.home.adapter.OperationRelatedContentSectionAdapter;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.adf.util.StringUtil;
/**
* Created by kim, changgyun on 2018/09/10.
......@@ -238,6 +241,13 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
try {
ContentDto content = contentDao.getContent(contentId);
if (!content.downloadingFlg && content.downloadedFlg) {
// 遠隔連動 PDFとオリジナル以外の資料は対象外アラート表示
MeetingManager meetingManager = MeetingManager.getInstance();
if (meetingManager.isSendable() && !StringUtil.contains(content.contentType, new String[]{ContentJSON.KEY_PDF_TYPE, ContentJSON.KEY_NONE_TYPE})) {
showNonTargetMeetingContent();
return;
}
Intent intent = new Intent();
intent.putExtra(ABookKeys.OPERATION_ID, operationId);
ActivityHandlingHelper.getInstance().checkContentActivity(contentId, 0, intent);
......@@ -253,6 +263,27 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
updateViewSaveAll();
}
/**
* 遠隔支援中には対象外の資料のアラート表示
*/
private void showNonTargetMeetingContent() {
handler.post(new Runnable() {
@Override
public void run() {
final ABookAlertDialog nonTargetMeetingContentDialog = AlertDialogUtil.createAlertDialog(OperationRelatedContentActivity.this, R.string.app_name);
nonTargetMeetingContentDialog.setCancelable(false);
nonTargetMeetingContentDialog.setMessage(R.string.msg_non_target_meeting_content);
nonTargetMeetingContentDialog.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
nonTargetMeetingContentDialog.dismiss();
}
});
nonTargetMeetingContentDialog.show();
}
});
}
/** 
* ボタンイベント設定
*/
......
......@@ -111,6 +111,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
private volatile ABVContentViewActivity objectViewActivity;
private MeetingManager meetingManager;
private ABookAlertDialog downloadConfirmDialog;
private ABookAlertDialog updateConfirmDialog;
private boolean requireHomeReload;
private ABookAlertDialog promotionRequestAlertDialog;
private long lastDisconnect;
......@@ -1032,8 +1033,6 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
public void run() {
if (meetingManager.isConnected()) { // 会議室参加の場合
meetingManager.setPaused(false);
} else { // カスタムURIの場合
startContentActivity(data.contentId, 0);
}
contentDownloader.removeContentDownloadListener(ActivityHandlingHelper.this);
}
......@@ -1075,7 +1074,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
return false;
}
if (contentDto.downloadedFlg) { // DLの場合はOK
if (contentDto.downloadedFlg && !contentDto.updatedFlg) { // DL && Update済みの場合はOK
return true;
}
......@@ -1113,12 +1112,23 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
}
}
} else {
handler.post(new Runnable() {
@Override
public void run() {
showDownloadConfirm(contentId, contentDto.contentName);
}
});
if (contentDto.downloadedFlg && contentDto.updatedFlg) {
// 更新処理
handler.post(new Runnable() {
@Override
public void run() {
showUpdateConfirm(contentId, contentDto.contentName);
}
});
} else {
// ダウンロード処理
handler.post(new Runnable() {
@Override
public void run() {
showDownloadConfirm(contentId, contentDto.contentName);
}
});
}
}
}
......@@ -1229,6 +1239,39 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
}
});
}
/**
* 資料の更新ダイアログ生成処理
* @param contentId
*/
private void createUpdateConfirm(final long contentId, final String contentName) {
if (updateConfirmDialog != null && updateConfirmDialog.isShowing()) { // すでにダイアログがある場合は閉じる
updateConfirmDialog.dismiss();
}
updateConfirmDialog = AlertDialogUtil.createAlertDialog(getCurrentActivity(), R.string.confirm);
updateConfirmDialog.setCancelable(false);
updateConfirmDialog.setMessage(String.format(mContext.getString(R.string.content_link_update), contentName));
updateConfirmDialog.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
updateConfirmDialog.dismiss();
downloadContent(contentId);
updateConfirmDialog = null;
}
});
updateConfirmDialog.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
updateConfirmDialog.dismiss();
startContentActivity(contentId, 0);
updateConfirmDialog = null;
}
});
}
/**
* DL確認ダイアローグ表示
*
......@@ -1240,6 +1283,17 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
downloadConfirmDialog.show();
}
// 資料更新画面表示
private void showUpdateConfirm(final long contentId, final String contentName) {
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
// インターネットが繋がってない場合は、更新前の関連資料を開く
startContentActivity(contentId, 0);
} else {
createUpdateConfirm(contentId, contentName);
updateConfirmDialog.show();
}
}
public void finishContentObjectActivity() {
if (objectViewActivity != null) {
objectViewActivity.finish();
......
package jp.agentec.abook.abv.ui.home.helper;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
......@@ -19,7 +18,6 @@ import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.ABVApplication;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
......@@ -144,7 +142,7 @@ public class OperationListHelper {
OperationDto operationDto = (OperationDto) parent.getAdapter().getItem(position);
if (operationDto.contentId != null && operationDto.contentId != 0) {
// 作業画面
mAppActivity.openDirectionsOrReportView(operationDto);
mAppActivity.openReportView(operationDto);
} else {
if (operationDto.operationType == PANO) {
// パノラマ登録画面
......@@ -215,10 +213,8 @@ public class OperationListHelper {
public void onItemClick(AdapterView<?> parent, View view, int position, long operationId) {
OperationDto operationDto = (OperationDto) parent.getAdapter().getItem(position);
if (operationDto.contentId != null && operationDto.contentId != 0) {
//TODO テスト用のため、削除
ABVToastUtil.showMakeText(mAppActivity, "open operationId : " + operationId, Toast.LENGTH_LONG);
// 作業画面
mAppActivity.openDirectionsOrReportView(operationDto);
mAppActivity.openReportView(operationDto);
} else {
if (operationDto.operationType == PANO) {
// パノラマ登録画面
......
......@@ -167,13 +167,7 @@ public class OzdFileHelper {
String ozdFileName = null;
if (reportFileName != null) {
ozdFileName = reportFileName;
} else {
if (taskReportLevel == 0) {
ozdFileName = DIRECTION_OZD_FILE_NAME;
} else {
ozdFileName = REPORT_OZD_FILE_NAME;
}
ozdFileName = reportFileName.replace("ozr", "ozd");
}
String ozFilePath = null;
......
......@@ -638,7 +638,6 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
runOnUiThread(new Runnable() {
@Override
public void run() {
Logger.d(TAG, "onDownloadingContentZip ...........................................>");
if (notification.getDownloadStatus() == DownloadStatusType.Downloading) {
Logger.d(TAG, "onDownloadingContentZip .....................Downloading......................>");
ABVToastUtil.showMakeText(getApplicationContext(), R.string.reader_downloading, Toast.LENGTH_SHORT);
......
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