Commit 4920ba2e by Lee Jaebin

新着更新時、エラー処理追加(プルダウンが閉じられない問題)

PDFで報告・報告回答の表示修正
parent 2df041c8
......@@ -308,7 +308,7 @@ public class TaskReportDao extends AbstractDao {
}
/**
* 定期点検の報告データ取得
* 定期点検の報告データ取得(時間はutcで検索)
* @param taskKey
* @param taskReportId
* @param reportStartDate
......@@ -346,17 +346,6 @@ public class TaskReportDao extends AbstractDao {
* @return
*/
public String getRoutineTaskReportAttachedFileName(String taskKey, int taskReportId, String reportStartDate) {
return rawQueryGetString("select local_attached_file_name from t_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)", new String[]{ taskKey, "" + taskReportId, reportStartDate });
}
/**
* 定期点検報告のデータ取得
* @param taskKey
* @param taskReportId
* @param reportStartDate
* @return
*/
public TaskReportDto getRoutineTaskReport(String taskKey, int taskReportId, String reportStartDate) {
return rawQueryGetDto("select * from t_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)", new String[]{ taskKey, "" + taskReportId, reportStartDate }, TaskReportDto.class);
return rawQueryGetString("select local_attached_file_name from t_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?, 'utc')", new String[]{ taskKey, "" + taskReportId, reportStartDate });
}
}
......@@ -18,5 +18,7 @@
<dimen name="operation_pin_icon_width">35dp</dimen>
<dimen name="operation_pin_icon_height">60dp</dimen>
<dimen name="operation_name_size">24sp</dimen>
<dimen name="operation_name_size">26sp</dimen>
<dimen name="operation_normal_text_size">16sp</dimen>
</resources>
......@@ -876,7 +876,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
mAddReport = true;
// 定期点検の場合、以下のフラグを変更しない(mAddReport trueのみ)
if (abookCheckParam.containsKey(ABookKeys.ADD_REPORT) && operationDto.reportType != Constant.ReportType.RoutineTask) {
if (abookCheckParam.containsKey(ABookKeys.ADD_REPORT)) {
mAddReport = Integer.parseInt(abookCheckParam.get(ABookKeys.ADD_REPORT)) > 0 ? true : false;
}
......
......@@ -37,6 +37,8 @@ import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
private final static String TAG = "ABVUIActivity";
......@@ -45,6 +47,9 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
protected TextView mUpdatedDate; // add by jang
protected TextView mLoadingText; // add by jang;
// 新着更新処理の終了後、プルダウンを完了させるためのビュー
protected PullToRefreshBase refreshBaseView;
protected String urlPassword; // Reader用
//Gettisの場合:プッシュ―メッセージを経由してコンテンツダウンロード場合対応
private String mPushMessage = ""; //コンテンツ追加の機能をの引数が増えないようにこの変数を追加
......@@ -185,10 +190,10 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
case S_E_ACMS_0500:
handleErrorMessageToast(ABVExceptionCode.S_E_ACMS_0500);
break;
case S_E_ACMS_INVALID_RESPONSE:
// サーバー通信エラー時、エラーメッセージ表示
handleErrorMessageToast(ABVExceptionCode.S_E_ACMS_INVALID_RESPONSE);
break;
default:
Logger.e(TAG, "Exception DataRefresh", e);
handleErrorMessageToast(ErrorCode.E107);
......@@ -393,6 +398,11 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
Logger.w(TAG, "you need to set mRefreshImage.");
}
// ヘッダーの新着更新処理を完了にさせる
if (refreshBaseView != null) {
refreshBaseView.onRefreshComplete();
}
// 自動ダウンロード対象がある場合、新着更新が完了したあとに開始するように修正(jang)
ContentDownloader.getInstance().autoDownload();
}
......
......@@ -180,8 +180,6 @@ public class OperationListActivity extends ABVUIActivity {
private int mSendType;
private OperationListHelper mListHelper = null;
// 新着更新処理の終了後、プルダウンを完了させるためのビュー
private PullToRefreshBase refreshBaseView;
private ArrayList<Integer> mAllOperationReportTypes;
......@@ -382,10 +380,6 @@ public class OperationListActivity extends ABVUIActivity {
stopUpdateAnimation();
// 新着更新時間の更新
getABVUIDataCache().saveLastUpdateTime();
// ヘッダーの新着更新処理を完了にさせる
if (refreshBaseView != null) {
refreshBaseView.onRefreshComplete();
}
// リソースパターンを取得し、ローカルに保存する。
setResourcePattern();
refreshOperationList();
......@@ -896,14 +890,12 @@ public class OperationListActivity extends ABVUIActivity {
mTaskDao.insert(serverTaskDto);
}
// サーバーからの情報で更新
for (TaskReportDto serverTaskReportDto : serverTaskDto.taskReportDtoList) {
String attachedFileName = serverTaskReportDto.attachedFileName;
TaskReportDto localTaskReportDto;
if (operationDto.reportType == ReportType.RoutineTask) {
localTaskReportDto = mTaskReportDao.getRoutineTaskReport(serverTaskReportDto.taskKey, serverTaskReportDto.taskReportId, DateTimeUtil.toString(serverTaskReportDto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen));
localTaskReportDto = mTaskReportDao.getRoutineTaskReportUtc(serverTaskReportDto.taskKey, serverTaskReportDto.taskReportId, DateTimeUtil.toString(serverTaskReportDto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen));
} else {
localTaskReportDto = mTaskReportDao.selectByTaskKey(serverTaskReportDto.taskKey, serverTaskReportDto.taskReportLevel);
}
......@@ -1769,9 +1761,7 @@ public class OperationListActivity extends ABVUIActivity {
@Override
public void run() {
// ヘッダーの新着更新処理を完了にさせる
if (refreshBaseView != null) {
refreshBaseView.onRefreshComplete();
}
stopUpdateAnimation();
final ABookAlertDialog messageDialog = AlertDialogUtil.createAlertDialog(OperationListActivity.this, R.string.app_name);
messageDialog.setMessage(getString(R.string.msg_network_offline));
messageDialog.setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
......
......@@ -5000,6 +5000,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
setToolbarVisableForTask(false);
break;
case Constant.XWalkWebViewDisplayStatus.TaskView:
case Constant.XWalkWebViewDisplayStatus.ReportPreView:
setOperationCurrentLayout(mCurrentPageNumber);
String taskKey = checkParam.get(ABookKeys.TASK_KEY);
operationTaskLayout.setTaskFormPosition(taskKey, isNormalSize());
......@@ -5009,8 +5010,6 @@ public class ContentViewActivity extends ABVContentViewActivity {
setToolbarVisableForTask(true);
}
break;
case Constant.XWalkWebViewDisplayStatus.ReportPreView:
break;
case Constant.XWalkWebViewDisplayStatus.TaskListView:
operationTaskLayout.showOperationTaskLayout();
if (isNormalSize()) {
......
......@@ -355,40 +355,40 @@ public class OperationTaskLayout extends RelativeLayout {
public void setTaskFormPosition(String taskKey, boolean isNormalSize) {
RelativeLayout.LayoutParams params;
if (isNormalSize) {
// if (isNormalSize) {
params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
setLayoutParams(params);
} else {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
// #32926 作業報告画面改善 start
// 作業報告画面を全画面に表示する
int screenWidth = displayMetrics.widthPixels;
params = createParam(screenWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
// #32926 作業報告画面改善 end
if (!StringUtil.isNullOrEmpty(taskKey)) {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
if (taskDto != null) {
OperationTaskDto operationTaskDto = new OperationTaskDto();
operationTaskDto.taskKey = taskDto.taskKey;
operationTaskDto.taskCode = taskDto.taskCode;
JSONObject hotSpot = new JSONObject(taskDto.taskHotSpotInfo);
operationTaskDto.pdfX = hotSpot.getInt(ABookKeys.PDF_X);
operationTaskDto.pdfY = hotSpot.getInt(ABookKeys.PDF_Y);
currentTaskDto = operationTaskDto;
if (currentLayout.isLeftSideOfPdf((int)operationTaskDto.pdfX)) {
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
} else {
params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
}
setLayoutParams(params);
}
}
}
// } else {
// DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
//
// // #32926 作業報告画面改善 start
// // 作業報告画面を全画面に表示する
// int screenWidth = displayMetrics.widthPixels;
// params = createParam(screenWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
// // #32926 作業報告画面改善 end
//
// if (!StringUtil.isNullOrEmpty(taskKey)) {
// TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
// if (taskDto != null) {
// OperationTaskDto operationTaskDto = new OperationTaskDto();
// operationTaskDto.taskKey = taskDto.taskKey;
// operationTaskDto.taskCode = taskDto.taskCode;
//
// JSONObject hotSpot = new JSONObject(taskDto.taskHotSpotInfo);
// operationTaskDto.pdfX = hotSpot.getInt(ABookKeys.PDF_X);
// operationTaskDto.pdfY = hotSpot.getInt(ABookKeys.PDF_Y);
//
// currentTaskDto = operationTaskDto;
//
// if (currentLayout.isLeftSideOfPdf((int)operationTaskDto.pdfX)) {
// params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
// } else {
// params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
// }
// setLayoutParams(params);
// }
// }
// }
}
public int getAlignOfTaskLayer() {
......
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