Commit 4920ba2e by Lee Jaebin

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

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