Commit d7d33ed0 by Lee Jaebin

#32825 作業一覧画面改善

parent e110573d
......@@ -95,8 +95,10 @@ public class Constant {
}
public interface OperationReportType {
// TODO 変数名は仮実装、変更必要
int DEFAULT = 0;
int INSPECT_REPORT = 1;
int ROUTINE_TASK = 1;
int REPORT_TYPE = 2;
}
public interface PushMessageSendType {
......
package jp.agentec.abook.abv.bl.data.dao;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -216,12 +217,12 @@ public class OperationDao extends AbstractDao {
delete("m_worker_group", null, null);
}
public List<OperationDto> getOperations(String searchOperationName, String searchStartDateStr, String searchEndDateStr, int operationReportType) {
String sql = generateGetOperationQuery(searchOperationName, searchStartDateStr, searchEndDateStr, operationReportType);
public List<OperationDto> getOperations(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String operationReportTypeStr) {
String sql = generateGetOperationQuery(searchOperationName, searchStartDateStr, searchEndDateStr, operationReportTypeStr);
return rawQueryGetDtoList(sql, null, OperationDto.class);
}
private String generateGetOperationQuery(String searchOperationName, String searchStartDateStr, String searchEndDateStr, int operationReportType) {
private String generateGetOperationQuery(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String operationReportTypeStr) {
String curDate = DateTimeUtil.toStringInTimeZone(new Date(), DateTimeFormat.yyyyMMddHHmmss_hyphen, "UTC");
StringBuffer sql = new StringBuffer();
......@@ -280,8 +281,8 @@ public class OperationDao extends AbstractDao {
sql.append(" AND tp.operation_start_date <= '" + DateTimeUtil.toString(endDate, DateTimeFormat.yyyyMMdd_hyphen) + "'");
}
if (operationReportType > -1) {
sql.append(" AND tp.operation_report_type = " + operationReportType);
if (operationReportTypeStr != null) {
sql.append(" AND tp.operation_report_type in ("+ operationReportTypeStr +")");
}
sql.append(" ORDER BY tp.operation_report_type DESC, tp.operation_start_date DESC, tp.operation_id DESC");
......
......@@ -1503,9 +1503,9 @@ public class OperationLogic extends AbstractLogic {
* @param searchEndDateStr
* @return
*/
public List<OperationDto> getRefreshOperation(String searchWord, String searchStartDateStr, String searchEndDateStr, int operationReportType) {
public List<OperationDto> getRefreshOperation(String searchWord, String searchStartDateStr, String searchEndDateStr, String operationReportTypeStr) {
List<OperationDto> operationDtoList;
operationDtoList = mOperationDao.getOperations(searchWord, searchStartDateStr, searchEndDateStr, operationReportType);
operationDtoList = mOperationDao.getOperations(searchWord, searchStartDateStr, searchEndDateStr, operationReportTypeStr);
for (OperationDto operationDto : operationDtoList) {
if(ABVDataCache.getInstance().getMemberInfo() != null) {
// プロジェクト毎に作業の送信フラグがあるかチェックし、存在する場合プロジェクトのデータ同期必要区分をtrueにセット
......@@ -1520,7 +1520,7 @@ public class OperationLogic extends AbstractLogic {
}
} else {
boolean needSyncFlg = false;
if (operationDto.operationReportType == Constant.OperationReportType.INSPECT_REPORT) {
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) {
needSyncFlg = mRoutineTaskReportDao.isExistSendRoutineTaskData(operationDto.operationId);
} else {
needSyncFlg = mTaskReportDao.isExistSendTaskData(operationDto.operationId);
......
......@@ -41,6 +41,7 @@
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:theme="@style/ABook"
android:allowBackup="false"
android:largeHeap="true" >
<service android:name="jp.agentec.abook.abv.cl.push.ABVFcmListenerService">
<intent-filter>
......
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="true"
android:drawable="@drawable/ic_filter_on"/>
<item
android:drawable="@drawable/ic_filter_off"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="true"
android:drawable="@drawable/ic_sort_on"/>
<item
android:drawable="@drawable/ic_sort_off"/>
</selector>
\ No newline at end of file
......@@ -659,7 +659,7 @@
<!-- 1.9.3-->
<string name="date_label">期間</string>
<string name="operation_name">プロジェクト名</string>
<string name="operation_list">プロジェクト一覧</string>
<string name="operation_list">作業</string>
<string name="operation_search_count">%1$s件、検索されました。</string>
<string name="msg_date_validation">開始日は終了日の前に設定してください</string>
<string name="search_result">検索結果</string>
......
......@@ -20,7 +20,16 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:background="@drawable/ic_communication_menu" />
android:background="@drawable/icon_sort" />
<ImageButton
android:id="@+id/icon_filter"
style="@style/ToolBarIcon"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/btn_view_mode"
android:onClick="onClickOperationFilterList"
android:src="@drawable/ic_filter" />
<TextView
android:id="@+id/title"
......
......@@ -4,7 +4,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background"
android:descendantFocusability="blocksDescendants"
android:orientation="vertical">
<RelativeLayout
......@@ -21,7 +20,16 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:background="@drawable/ic_communication_menu" />
android:background="@drawable/icon_sort" />
<ImageButton
android:id="@+id/icon_filter"
style="@style/ToolBarIcon"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/btn_view_mode"
android:onClick="onClickOperationFilterList"
android:src="@drawable/ic_filter" />
<LinearLayout
android:layout_width="wrap_content"
......@@ -129,8 +137,8 @@
<FrameLayout
android:id="@+id/operation_list_layout"
style="@style/content_list_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"/>
android:layout_height="match_parent"/>
</LinearLayout>
\ No newline at end of file
......@@ -2,7 +2,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/operation_underline"
android:background="@drawable/list_selector_holo_light"
android:descendantFocusability="blocksDescendants"
android:orientation="vertical">
......@@ -109,24 +110,6 @@
android:text="@string/information_update" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:orientation="vertical">
<ImageView
android:id="@+id/btn_work"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_work" />
<TextView
android:id="@+id/txt_work"
style="@style/ProjectIconText"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="center_vertical"
android:checkMark="?android:attr/textCheckMark"
android:paddingLeft="6dip"
android:paddingRight="6dip"
android:textColor="@color/text_select"
android:text="@string/dummy_str"
/>
\ No newline at end of file
......@@ -19,7 +19,7 @@
android:textColor="@color/operation_search_button_color"
android:textSize="18sp" />
<jp.agentec.abook.abv.ui.common.view.ABVOpearationContentGridView
<jp.agentec.abook.abv.ui.common.view.ABVOperationContentGridView
android:id="@+id/gv_content_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
......
......@@ -153,44 +153,6 @@
android:textColor="@color/text_select"
android:textSize="@dimen/text_size_noraml" />
</LinearLayout>
<LinearLayout
android:id="@+id/report_type_layout_btn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:gravity="center"
android:orientation="horizontal"
android:visibility="gone">
<Button
android:id="@+id/btn_operation_type_all"
android:layout_width="0dp"
android:layout_weight=".3"
android:layout_height="40dp"
android:background="@color/operation_search_button_color"
android:text="@string/label_operation_report_type_all"
android:textColor="@color/text_color" />
<Button
android:id="@+id/btn_operation_type_default"
android:layout_width="0dp"
android:layout_weight=".3"
android:layout_height="40dp"
android:background="@color/operation_disable_color"
android:text="@string/label_operation_report_type_default"
android:textColor="@color/text_color" />
<Button
android:id="@+id/btn_operation_type_routineTask"
android:layout_width="0dp"
android:layout_weight=".3"
android:layout_height="40dp"
android:background="@color/operation_disable_color"
android:text="@string/label_operation_report_type_routineTask"
android:textColor="@color/text_color" />
</LinearLayout>
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/mydata_bg"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/toolbar_min_size">
<TextView
android:id="@+id/popup_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:gravity="center"
android:paddingTop="5dp"
android:text="@string/dummy_str"
android:textColor="@color/text_color"
android:textSize="@dimen/app_normal_text_size"
android:maxLines="1" />
<Button
android:id="@+id/popup_title_left"
style="@style/ButtonABookLight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingRight="10dp"
android:text="@string/dummy_str"
android:textSize="@dimen/app_normal_text_size"
android:visibility="gone"
android:maxLines="1" />
<Button
android:id="@+id/popup_right_title"
style="@style/ButtonABookLight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:text="@string/dummy_str"
android:textSize="@dimen/app_normal_text_size"
android:visibility="gone"
android:maxLines="1" />
</RelativeLayout>
<LinearLayout
android:id="@+id/listLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="5dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:layout_weight="1"
android:background="@drawable/radius_frame"
android:orientation="vertical" >
<ListView
android:id="@+id/popup_list_menu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="#cccccc"
android:dividerHeight="1px"
android:fadingEdge="none"
android:scrollingCache="false"
android:background="@color/list_background" >
</ListView>
<LinearLayout
android:id="@+id/empty_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" >
<TextView
android:id="@+id/empty_list_item"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:textColor="@color/text_select"
android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -72,4 +72,10 @@
<item></item>
<item>縦(反転)</item>
</string-array>
<string-array name="operation_report_types">
<item>タイプ1</item>
<item>タイプ2</item>
<item>タイプ3</item>
</string-array>
</resources>
\ No newline at end of file
......@@ -9,4 +9,6 @@
<string name="text_copy">テキストコピー</string>
<string name="content_share">共有</string>
<string name="filter">フィルター</string>
</resources>
\ No newline at end of file
......@@ -3,14 +3,16 @@ package jp.agentec.abook.abv.launcher.android;
import java.util.ArrayList;
import java.util.Stack;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.Constant.OperationReportType;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.CategoryDto;
import jp.agentec.abook.abv.bl.dto.GroupDto;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.DefPrefKey;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.StringUtil;
import android.content.Context;
import java.util.List;
......@@ -21,6 +23,8 @@ public class ABVUIDataCache {
// ホーム画面項目
private int viewMode; // パンネル、リスト形式
private ArrayList<Integer> mOperationReportTypes;
public long lastUpdateTime = -1;
public String searchText;
......@@ -107,4 +111,41 @@ public class ABVUIDataCache {
returnContentIdList.clear();
}
}
public void setOperationReportTypes(ArrayList<Integer> operationReportTypes) {
this.mOperationReportTypes = operationReportTypes;
String val = null;
if (operationReportTypes.size() > 0) {
// カンマ区切りで保存
StringBuffer sb = new StringBuffer();
for (int contentType : operationReportTypes) {
sb.append(contentType);
sb.append(",");
}
val = sb.substring(0, sb.length() - 1);
}
PreferenceUtil.putUserPref(context, UserPrefKey.OPERATION_REPORT_TYPES, val);
}
public ArrayList<Integer> getOperationReportTypes() {
String operationReportTypesStr = PreferenceUtil.getUserPref(context, UserPrefKey.OPERATION_REPORT_TYPES, null);
if (operationReportTypesStr != null) {
ArrayList<Integer> operationReportTypes = new ArrayList<>();
String[] operationReportTypesStrList = operationReportTypesStr.split(",");
for (String contentType : operationReportTypesStrList) {
if (!StringUtil.isNullOrEmpty(contentType)) {
operationReportTypes.add(Integer.parseInt(contentType));
}
}
mOperationReportTypes = operationReportTypes;
} else {
mOperationReportTypes = new ArrayList<Integer>();
mOperationReportTypes.add(OperationReportType.DEFAULT);
mOperationReportTypes.add(OperationReportType.ROUTINE_TASK);
mOperationReportTypes.add(OperationReportType.REPORT_TYPE);
}
return mOperationReportTypes;
}
}
......@@ -3,11 +3,8 @@ package jp.agentec.abook.abv.ui.common.activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.database.Cursor;
import android.graphics.Color;
import android.graphics.Point;
import android.location.Location;
import android.net.Uri;
import android.os.Bundle;
......@@ -18,15 +15,12 @@ import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
......@@ -50,7 +44,6 @@ import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.download.ContentDownloader;
import jp.agentec.abook.abv.bl.download.ContentFileExtractor;
import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.MydataDto;
......@@ -69,9 +62,7 @@ import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.DefPrefKey;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.PrefName;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey;
import jp.agentec.abook.abv.ui.common.appinfo.options.Options;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
......@@ -789,7 +780,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
helpViewType = Constant.HelpViewType.ListOperationDirector;
break;
case Constant.XWalkOpenType.TASK_REPORT:
if (operationDto.operationReportType == Constant.OperationReportType.INSPECT_REPORT) {
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) {
helpViewType = Constant.HelpViewType.RoutineTaskOperation;
} else {
helpViewType = Constant.HelpViewType.ListOperationReporter;
......@@ -826,7 +817,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) {
helpViewType = Constant.HelpViewType.DirectorTask;
} else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
if (operationDto.operationReportType == Constant.OperationReportType.INSPECT_REPORT) {
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) {
helpViewType = Constant.HelpViewType.RoutineTaskOperationReport;
} else {
helpViewType = Constant.HelpViewType.ReportTask;
......@@ -860,7 +851,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
int taskReportId = 0;
String reportStartDate = "";
if (operationDto.operationReportType == Constant.OperationReportType.INSPECT_REPORT && abookCheckParam.get(ABookKeys.TASK_REPORT_ID) != null && abookCheckParam.get(ABookKeys.REPORT_START_DATE) != null) {
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK && abookCheckParam.get(ABookKeys.TASK_REPORT_ID) != null && abookCheckParam.get(ABookKeys.REPORT_START_DATE) != null) {
taskReportId = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = abookCheckParam.get(ABookKeys.REPORT_START_DATE);
}
......@@ -918,7 +909,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
return null;
}
};
ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this, mCmd, mTaskKey, reportUpdateType, abookCheckParam, mOperationId, mContentPath, getContentId(), operationDto.operationReportType == Constant.OperationReportType.INSPECT_REPORT, finishCallback);
ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this, mCmd, mTaskKey, reportUpdateType, abookCheckParam, mOperationId, mContentPath, getContentId(), operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK, finishCallback);
} catch(Exception e) {
Logger.e(TAG, "doABookCheckParam error", e);
}
......
......@@ -53,6 +53,7 @@ public interface AppDefType {
String SYNCED_OPERATION_ID = "syncedOperationId_%d";//一日一回情報更新が出来るように
String VIEW_MODE = "viewMode";
String OPERATION_REPORT_TYPES = "operationReportTypes";
}
/**
......
......@@ -4,6 +4,7 @@ import android.app.DatePickerDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
......@@ -11,12 +12,16 @@ import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.SparseBooleanArray;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckedTextView;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.FrameLayout;
......@@ -30,6 +35,7 @@ import android.widget.TextView;
import android.widget.Toast;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
import com.handmark.pulltorefresh.library.PullToRefreshGridView;
import net.lingala.zip4j.exception.ZipException;
......@@ -42,6 +48,7 @@ import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
......@@ -58,6 +65,7 @@ import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.Constant.OperationReportType;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
......@@ -84,7 +92,6 @@ import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
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.activity.ABVUIActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
......@@ -95,6 +102,7 @@ import jp.agentec.abook.abv.ui.common.helper.ProgressDialogHelper;
import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.util.KeyboardUtils;
import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow;
import jp.agentec.abook.abv.ui.home.adapter.FixPushMessageAdapter;
import jp.agentec.abook.abv.ui.home.adapter.OperationSelectAdapter;
import jp.agentec.abook.abv.ui.home.adapter.PushMessageListAdapter;
......@@ -136,7 +144,6 @@ public class OperationListActivity extends ABVUIActivity {
private Button mReportTypeAllButton;
private Button mReportTypeDefaultButton;
private Button mReportTypeRoutineTaskButton;
public int mSearchOperationReportType = -1; //-1:All, 0:None, 1:RoutineTask
private Dialog mSearchDialog;
private Date mOperationLastEditDate;
......@@ -155,7 +162,7 @@ public class OperationListActivity extends ABVUIActivity {
private TaskDao mTaskDao = AbstractDao.getDao(TaskDao.class);
private PushMessageLogic mPushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class);
private int mOperationAuthLevel = ABVDataCache.getInstance().getMemberInfo().operationAuthLevel;
private Integer mOperationAuthLevel = ABVDataCache.getInstance().getMemberInfo().operationAuthLevel;
private ImageView mPanoCotnentImageView;
private TextView mPanoContentNameTextView;
......@@ -181,7 +188,9 @@ public class OperationListActivity extends ABVUIActivity {
// 新着更新処理の終了後、プルダウンを完了させるためのビュー
private PullToRefreshBase refreshBaseView;
private ArrayList<Integer> mAllOperationReportTypes;
// ビューの作成
private class ReloadHandler implements Runnable {
@Override
public void run() {
......@@ -193,6 +202,12 @@ public class OperationListActivity extends ABVUIActivity {
FrameLayout vg = (FrameLayout) findViewById(R.id.operation_list_layout);
vg.removeAllViews();
vg.addView(child);
// ツールバーのビューモードイメージ変更
if (child instanceof PullToRefreshGridView) {
mViewModeButton.setBackground(getRDrawable(R.drawable.icon_sort));
} else {
mViewModeButton.setBackground(getRDrawable(R.drawable.btn_view_sub_menu));
}
}
}
......@@ -217,13 +232,10 @@ public class OperationListActivity extends ABVUIActivity {
} else {
getABVUIDataCache().setViewMode(AppDefType.ViewMode.PANEL);
}
handler.post(new ReloadHandler());
setOperationListView();
}
});
// 画面リロード
refreshOperation();
// 検索アイコンのクリックイベント
mSearchButton.setOnClickListener(new View.OnClickListener() {
@Override
......@@ -256,8 +268,6 @@ public class OperationListActivity extends ABVUIActivity {
}
});
configurationToolbarIcon();
if (!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.PushMessageKey.operationId))) {
final long operationId = Long.parseLong(getIntent().getStringExtra(AppDefType.PushMessageKey.operationId));
String message = getIntent().getStringExtra(AppDefType.PushMessageKey.message);
......@@ -296,6 +306,7 @@ public class OperationListActivity extends ABVUIActivity {
alertDialog.show();
}
}
mAllOperationReportTypes = getOperationReportTypeList(true);
}
// 共通資料画面表示
......@@ -333,77 +344,20 @@ public class OperationListActivity extends ABVUIActivity {
}
public void refreshOperation() {
// Logger.d(TAG, "--refreshOperation start");
// mOperationList = mOperationLogic.getRefreshOperation(mSearchWord, mStartDateStr, mEndDateStr, mSearchOperationReportType);
// // ツールバーの検索結果レイアウトの表示・非表示
// checkShowSearchResult();
// if (mOperationListPanelAdapter == null) {
// mOperationListPanelAdapter = new OperationPanelAdapter(OperationListActivity.this, mOperationList);
// mListView.setAdapter(mOperationListPanelAdapter);
// mOperationListAdapter.setAdapterListener(new OperationListAdapter.OperationAdapterListener() {
// @Override
// public void onOpenDirectionsOrReportView(final OperationDto operationDto) {
// contentRefresher.stopRefresh();
// startTaskDirectionOrReportView(operationDto);
// }
//
// @Override
// public void onPanoEdit(OperationDto operationDto) {
// startPanoEdit(operationDto);
// }
//
// @Override
// public void onSyncOperation(final OperationDto operationDto) {
// //ネットワークチェック
// if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
// ABVToastUtil.showMakeText(OperationListActivity.this, R.string.request_network_connection, Toast.LENGTH_SHORT);
// return;
// }
// //新着更新中
// if (contentRefresher.isRefreshing()) {
// return;
// }
// showProgressView(getString(R.string.synchronizing));
// CommonExecutor.execute(new Runnable() {
// @Override
// public void run() {
// Logger.i(TAG, "[syncOperation] operationId=%s, contentId=%s", operationDto.operationId, operationDto.contentId);
// // コンテンツダウンロード
// ContentDto contentDto = contentDao.getContent(operationDto.contentId);
// if (contentDto == null || !contentDto.downloadedFlg || contentDto.updatedFlg) {
// contentDownload(operationDto.contentId, false);
// } else {
// syncOperation(operationDto.operationId, operationDto.operationReportType, true);
// }
// }
// });
// }
//
// @Override
// public void onOpenRelatedContentList(OperationDto operationDto) {
// if (operationDto.operationId != null) {
// Intent intent = new Intent();
// intent.putExtra(ABookKeys.OPERATION_ID, operationDto.operationId);
// intent.putExtra(ABookKeys.OPERATION_NAME, operationDto.operationName);
// intent.setClass(OperationListActivity.this, OperationRelatedContentActivity.class);
// startActivity(intent);
// }
// }
//
// @Override
// public void onShowEntryPanoContentDialog(OperationDto operationDto) {
// contentRefresher.stopRefresh();
// showPanoEntryDialog(operationDto);
// }
// });
// } else {
// mOperationListAdapter.setItem(mOperationList);
// }
mListHelper.refreshList();
/**
* ビューを作り直す。
*/
public void setOperationListView() {
handler.post(new ReloadHandler());
configurationToolbarIcon();
}
// ビューを作り直さずにリストだけ更新する
public void refreshOperationList() {
Logger.d(TAG, "refreshContentList");
mListHelper.refreshList();
configurationToolbarIcon();
}
@Override
......@@ -414,27 +368,35 @@ public class OperationListActivity extends ABVUIActivity {
public void run() {
if (!contentRefresher.isRefreshing()) {
// 新着処理が終わったら以下の処理が実行
refreshOperation();
stopUpdateAnimation();
// 新着更新時間の更新
getABVUIDataCache().saveLastUpdateTime();
// 新着更新の完了通知
// ヘッダーの新着更新処理を完了にさせる
if (refreshBaseView != null) {
refreshBaseView.onRefreshComplete();
}
refreshOperationList();
}
}
});
}
// 回転時、画面リロード
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
// 画面リロード
setOperationListView();
}
@Override
public void onResume() {
Logger.i(TAG, "onResume:start");
super.onResume();
setOperationListView();
// 作業指示・報告からプロジェクト一覧へ戻った時の同期処理
final long operationId = getUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, -1L);
if (operationId != -1) {
refreshOperation();
final OperationDto operationDto = mOperationLogic.getOperation(operationId);
showProgressView(getString(R.string.synchronizing));
CommonExecutor.execute(new Runnable() {
......@@ -453,7 +415,6 @@ public class OperationListActivity extends ABVUIActivity {
}
if (!activityResultFlg && operationId == -1) {
refreshOperation();
dataRefresh(true);
}
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, -1L);
......@@ -512,42 +473,6 @@ public class OperationListActivity extends ABVUIActivity {
}
});
if (mOperationAuthLevel == OperationAuthLevel.WORKER && ABVDataCache.getInstance().serviceOption.isRoutineTaskReport()) {
mReportTypeLayoutLabel = (LinearLayout) mSearchDialog.findViewById(R.id.report_type_layout_label);
mReportTypeLayoutButton = (LinearLayout) mSearchDialog.findViewById(R.id.report_type_layout_btn);
mReportTypeLayoutLabel.setVisibility(View.VISIBLE);
mReportTypeLayoutButton.setVisibility(View.VISIBLE);
mReportTypeAllButton = (Button) mSearchDialog.findViewById(R.id.btn_operation_type_all);
mReportTypeDefaultButton = (Button) mSearchDialog.findViewById(R.id.btn_operation_type_default);
mReportTypeRoutineTaskButton = (Button) mSearchDialog.findViewById(R.id.btn_operation_type_routineTask);
mReportTypeAllButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setSearchOperationReportTypeBtn(-1);
}
});
mReportTypeDefaultButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setSearchOperationReportTypeBtn(Constant.OperationReportType.DEFAULT);
}
});
mReportTypeRoutineTaskButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setSearchOperationReportTypeBtn(Constant.OperationReportType.INSPECT_REPORT);
}
});
setSearchOperationReportTypeBtn(mSearchOperationReportType);
} else {
mSearchOperationReportType = Constant.OperationReportType.DEFAULT;
}
// 検索ボタン
mSearchDialog.findViewById(R.id.btn_search).setOnClickListener(new View.OnClickListener() {
......@@ -557,7 +482,7 @@ public class OperationListActivity extends ABVUIActivity {
mStartDateStr = StringUtil.toString(mStartDate.getText());
mEndDateStr = StringUtil.toString(mEndDate.getText());
refreshOperation();
refreshOperationList();
mSearchDialog.dismiss();
ABVToastUtil.showMakeText(OperationListActivity.this, String.format(getString(R.string.operation_search_count), mListHelper.getOperationCount() + ""), Toast.LENGTH_SHORT);
......@@ -577,29 +502,6 @@ public class OperationListActivity extends ABVUIActivity {
}
}
private void setSearchOperationReportTypeBtn(int reportType) {
mSearchOperationReportType = reportType;
switch(mSearchOperationReportType) {
case Constant.OperationReportType.DEFAULT:
mReportTypeAllButton.setBackgroundColor(getResources().getColor(R.color.operation_disable_color));
mReportTypeDefaultButton.setBackgroundColor(getResources().getColor(R.color.operation_search_button_color));
mReportTypeRoutineTaskButton.setBackgroundColor(getResources().getColor(R.color.operation_disable_color));
break;
case Constant.OperationReportType.INSPECT_REPORT:
mReportTypeAllButton.setBackgroundColor(getResources().getColor(R.color.operation_disable_color));
mReportTypeDefaultButton.setBackgroundColor(getResources().getColor(R.color.operation_disable_color));
mReportTypeRoutineTaskButton.setBackgroundColor(getResources().getColor(R.color.operation_search_button_color));
break;
default:
mReportTypeAllButton.setBackgroundColor(getResources().getColor(R.color.operation_search_button_color));
mReportTypeDefaultButton.setBackgroundColor(getResources().getColor(R.color.operation_disable_color));
mReportTypeRoutineTaskButton.setBackgroundColor(getResources().getColor(R.color.operation_disable_color));
break;
}
}
private void showDatePicker(final TextView text) {
String textViewStr = text.getText().toString();
Calendar calendar = Calendar.getInstance();
......@@ -644,11 +546,6 @@ public class OperationListActivity extends ABVUIActivity {
// プロジェクト名の初期化
mSearchTextView.setText(StringUtil.Empty);
if (mOperationAuthLevel == OperationAuthLevel.WORKER && ABVDataCache.getInstance().serviceOption.isRoutineTaskReport()) {
// 種別の初期化
setSearchOperationReportTypeBtn(-1);
}
}
// 開始日と終了日のバリデーション
......@@ -722,9 +619,9 @@ public class OperationListActivity extends ABVUIActivity {
// プロジェクトの指示/報告表示時、必要なJSONファイル作成
mOperationLogic.createJsonForOpenABookCheckPano(operationDto.operationId, operationDto.contentId, contentPath);
mOperationLogic.createJsonForOperationContent(operationDto.operationId, 0, contentPath, mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR ? true : false, operationDto.operationReportType == Constant.OperationReportType.INSPECT_REPORT);
mOperationLogic.createJsonForOperationContent(operationDto.operationId, 0, contentPath, mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR ? true : false, operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK);
if (operationDto.operationReportType == Constant.OperationReportType.INSPECT_REPORT) {
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) {
mOperationLogic.createJsonForRoutineTaskReport(operationDto.reportCycle, operationDto.enableReportUpdate, mOperationLogic.getLastRoutineTaskReportData(operationDto.operationId).taskReportId, contentPath);
}
......@@ -736,7 +633,7 @@ public class OperationListActivity extends ABVUIActivity {
path.append("&view_mode=" + mOperationAuthLevel);
path.append("&project_type=" + operationDto.operationType);
path.append("&full_screen_flg=" + (isNormalSize() ? "1" : "0"));
path.append("&project_report_type=" + (operationDto.operationReportType == Constant.OperationReportType.INSPECT_REPORT ? "1" : "0"));
path.append("&project_report_type=" + (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK ? "1" : "0"));
Intent intent = new Intent();
intent.putExtra(ABookKeys.CONTENT_ID, operationDto.contentId);
intent.putExtra(ABookKeys.OPERATION_ID, operationDto.operationId);
......@@ -823,7 +720,7 @@ public class OperationListActivity extends ABVUIActivity {
mOperationLogic.sendTaskDirectionsData(operationId, null, progressCallback);
} else {
// 作業報告
if (operationReportType == Constant.OperationReportType.INSPECT_REPORT) {
if (operationReportType == Constant.OperationReportType.ROUTINE_TASK) {
if (mOperationLogic.sendRoutineTaskReportSendData(operationId, null, progressCallback) > 0) {
handleErrorMessageToast(R.string.P005);
}
......@@ -834,7 +731,7 @@ public class OperationListActivity extends ABVUIActivity {
progressDialogHorizontal.setProgress(60);
mOperationLastEditDate = receptionTaskData(operationId, progressCallback, buttonEventFlag);
if (operationReportType == Constant.OperationReportType.INSPECT_REPORT) {
if (operationReportType == Constant.OperationReportType.ROUTINE_TASK) {
if (buttonEventFlag) {
String dialogMsg = null;
// 定期点検プロジェクトの利用可能日付を取得
......@@ -889,7 +786,7 @@ public class OperationListActivity extends ABVUIActivity {
progressDialogHorizontal.setProgress(100);
}
mOperationLastEditDate = null;
refreshOperation();
refreshOperationList();
closeProgressPopup();
}
});
......@@ -957,7 +854,7 @@ public class OperationListActivity extends ABVUIActivity {
List<RoutineTaskReportDto> localRoutineTaskReportList;
Date lastEditDate;
if (operationDto.operationReportType == Constant.OperationReportType.INSPECT_REPORT) {
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) {
RoutineTaskDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getRoutineTaskData(param);
//プログレスを40%進行させるための計算
......@@ -1390,7 +1287,7 @@ public class OperationListActivity extends ABVUIActivity {
public void run() {
progressDialogHorizontal.setProgress(20);
mOperationLogic.setContentCreatingFlg(operationDto.operationId);
refreshOperation();
refreshOperationList();
}
});
......@@ -1847,6 +1744,8 @@ public class OperationListActivity extends ABVUIActivity {
* @param refreshView
*/
public void pullToListViewRefresh(PullToRefreshBase<ListView> refreshView) {
refreshBaseView = refreshView;
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
showDisConnectNetworkDialog();
return;
......@@ -1863,7 +1762,6 @@ public class OperationListActivity extends ABVUIActivity {
refreshView.getLoadingLayoutProxy().setLastUpdatedLabel(lastUpdateTimeLabel);
}
}
refreshBaseView = refreshView;
CommonExecutor.execute(new Runnable() {
@Override
public void run() {
......@@ -1880,6 +1778,8 @@ public class OperationListActivity extends ABVUIActivity {
* @param refreshView
*/
public void pullToGridViewRefresh(PullToRefreshBase<GridView> refreshView) {
// 完了通知のため、ビューをメンバー変数で管理する
refreshBaseView = refreshView;
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
showDisConnectNetworkDialog();
return;
......@@ -1896,7 +1796,6 @@ public class OperationListActivity extends ABVUIActivity {
refreshView.getLoadingLayoutProxy().setLastUpdatedLabel(lastUpdateTimeLabel);
}
}
refreshBaseView = refreshView;
CommonExecutor.execute(new Runnable() {
@Override
public void run() {
......@@ -1919,6 +1818,10 @@ public class OperationListActivity extends ABVUIActivity {
handler.post(new Runnable() {
@Override
public void run() {
// ヘッダーの新着更新処理を完了にさせる
if (refreshBaseView != null) {
refreshBaseView.onRefreshComplete();
}
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() {
......@@ -1931,4 +1834,75 @@ public class OperationListActivity extends ABVUIActivity {
}
});
}
/**
* 並べ替え画面表示
*
* @param anchor
*/
public void onClickOperationFilterList(final View anchor) {
Logger.d(TAG, "onClickShowContentContainerList start");
final ABVPopupListWindow popup = new ABVPopupListWindow(this, R.layout.popup_simple_list);
popup.setTitle(getRString(R.string.filter));
popup.setWidth(getRDimensionSize(R.dimen.popup_size_xlarge));
// 表示するコンテンツタイプのリストを作成
List<String> members = Arrays.asList(getRStringArray(R.array.operation_report_types));
ArrayList<Integer> selectedOperationReportTypes = getOperationReportTypeList(false);
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, R.layout.item_checked_list, members);
popup.setListViewAdapter(adapter);
final ListView listView = popup.getListView();
listView.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
for (int i = 0; i < mAllOperationReportTypes.size(); i++) {
for (Integer id : selectedOperationReportTypes) {
if (id.equals(mAllOperationReportTypes.get(i))) {
listView.setItemChecked(i, true);
}
}
}
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long cid) {
// 並び替えの要素タップイベント
SparseBooleanArray checkedItemPositions = popup.getListView().getCheckedItemPositions();
ArrayList<Integer> selectedOperationReportTypeIds = new ArrayList<>();
for (int i = 0; i < checkedItemPositions.size(); i++) {
if (checkedItemPositions.valueAt(i)) {
selectedOperationReportTypeIds.add(mAllOperationReportTypes.get(checkedItemPositions.keyAt(i)));
}
}
if (selectedOperationReportTypeIds.size() > 0) {
getABVUIDataCache().setOperationReportTypes(selectedOperationReportTypeIds);
setOperationListView();
} else {
((CheckedTextView)view).setChecked(true);
listView.getCheckedItemPositions().put(position, true);
}
}
});
listView.invalidate();
popup.showAsDropDown(anchor);
}
/**
* フィルター(報告タイプ)の項目取得
* @param isAll フィルターの全ての項目を取得するか、チェックのみ取得するか判定フラグ
* @return
*/
private ArrayList<Integer> getOperationReportTypeList(boolean isAll) {
ArrayList<Integer> operationReportTypes = new ArrayList<>();
if (isAll) {
operationReportTypes.add(OperationReportType.DEFAULT);
operationReportTypes.add(OperationReportType.ROUTINE_TASK);
operationReportTypes.add(OperationReportType.REPORT_TYPE);
} else {
operationReportTypes = getABVUIDataCache().getOperationReportTypes();
}
return operationReportTypes;
}
}
......@@ -21,7 +21,7 @@ import jp.agentec.abook.abv.launcher.android.R;
public abstract class AbstractOperationAdapter extends BaseAdapter {
protected AbstractOperationListAdapterListener listener;
protected List<OperationDto> listItem = new ArrayList<>(); // NullPointException防止
protected int mOperationAuthLevel = ABVDataCache.getInstance().getMemberInfo().operationAuthLevel;
protected Integer mOperationAuthLevel = ABVDataCache.getInstance().getMemberInfo().operationAuthLevel;
protected ContentDao mContentDao = AbstractDao.getDao(ContentDao.class);
public interface AbstractOperationListAdapterListener {
......
......@@ -15,10 +15,7 @@ import jp.agentec.abook.abv.bl.acms.type.OperationAuthLevel;
import jp.agentec.abook.abv.bl.acms.type.OperationButtonType;
import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.dto.CategoryContentDto;
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.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.home.activity.OperationListActivity;
......@@ -90,9 +87,9 @@ public class OperationListAdapter extends AbstractOperationAdapter {
final OperationDto operationDto = getItem(position);
if (operationDto != null) {
boolean noRoutineTaskAll = (operationDto.operationReportType == Constant.OperationReportType.INSPECT_REPORT && operationDto.reportCount == 0);
boolean noRoutineTaskAll = (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK && operationDto.reportCount == 0);
holder.tvOperationName.setText(operationDto.operationName);
if (operationDto.operationReportType == Constant.OperationReportType.INSPECT_REPORT) {
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) {
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) {
holder.tvDate.setText(mContext.getString(R.string.date_label_routineTask) + " : " + mContext.getString(R.string.msg_no_report_data));
} else {
......@@ -109,7 +106,7 @@ public class OperationListAdapter extends AbstractOperationAdapter {
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true);
} else {
// needSyncFlgがfalseの場合
if (operationDto.operationReportType == Constant.OperationReportType.INSPECT_REPORT) {
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) {
// 定期点検プロジェクトの場合のみ、以下の処理を行う
String syncedDate = getUserPref(mContext, String.format(AppDefType.UserPrefKey.SYNCED_OPERATION_ID, operationDto.operationId), "");
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod) && !syncedDate.equals(DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none))) {
......@@ -182,6 +179,12 @@ public class OperationListAdapter extends AbstractOperationAdapter {
TextView tvInformationUpdateText;
}
/**
* 作業一覧の各ボタンの活性化、非活性化に変更する
* @param holder
* @param buttonType
* @param isEnabled
*/
private void setButtonEnabled(ViewHolder holder, int buttonType, boolean isEnabled) {
switch (buttonType) {
case OperationButtonType.PANO_EDIT :
......
......@@ -14,7 +14,6 @@ import jp.agentec.abook.abv.bl.acms.type.OperationAuthLevel;
import jp.agentec.abook.abv.bl.acms.type.OperationButtonType;
import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
......@@ -120,9 +119,9 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
final OperationDto operationDto = getItem(position);
if (operationDto != null) {
boolean noRoutineTaskAll = (operationDto.operationReportType == Constant.OperationReportType.INSPECT_REPORT && operationDto.reportCount == 0);
boolean noRoutineTaskAll = (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK && operationDto.reportCount == 0);
holder.tvOperationName.setText(operationDto.operationName);
if (operationDto.operationReportType == Constant.OperationReportType.INSPECT_REPORT) {
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) {
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) {
holder.tvDate.setText(mContext.getString(R.string.date_label_routineTask) + " : " + mContext.getString(R.string.msg_no_report_data));
} else {
......@@ -138,7 +137,7 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true);
} else {
// needSyncFlgがfalseの場合
if (operationDto.operationReportType == Constant.OperationReportType.INSPECT_REPORT) {
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) {
// 定期点検プロジェクトの場合のみ、以下の処理を行う
String syncedDate = getUserPref(mContext, String.format(AppDefType.UserPrefKey.SYNCED_OPERATION_ID, operationDto.operationId), "");
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod) && !syncedDate.equals(DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none))) {
......
......@@ -18,9 +18,6 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters;
import jp.agentec.abook.abv.bl.acms.type.OperationAuthLevel;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Callback;
......@@ -28,7 +25,6 @@ import jp.agentec.abook.abv.bl.common.CommonExecutor;
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.ABVException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.dto.RoutineTaskReportDto;
......@@ -327,7 +323,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
mOperationLogic.updateSyncOperation(operationId, true);
} else {
OperationDto operationDto = mOperationLogic.getOperation(operationId);
if (operationDto.operationReportType == Constant.OperationReportType.INSPECT_REPORT) {
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) {
if (mOperationLogic.sendRoutineTaskReportSendData(operationId, taskKey, progressCallback) > 0){
context.handleErrorMessageToast(R.string.P005);
}
......@@ -613,7 +609,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
try {
List<TaskDto> taskDtoList = mOperationLogic.getOperationTask(operationId);
for (TaskDto taskDto : taskDtoList) {
if (operationDto.operationReportType == Constant.OperationReportType.INSPECT_REPORT) {
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) {
List<RoutineTaskReportDto> listRoutineTaskReport = mOperationLogic.getRoutineTaskReportByTaskKey(taskDto.taskKey);
for (RoutineTaskReportDto routineTaskDto : listRoutineTaskReport) {
copyRoutineTaskReportAttachedMovie(operationId, contentId, routineTaskDto.taskKey, routineTaskDto.taskReportId, routineTaskDto.reportStartDate);
......
......@@ -19,8 +19,10 @@ 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;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.ViewMode;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
......@@ -43,7 +45,15 @@ public class OperationListHelper {
private PullToRefreshListView mPullToRefreshListView;
private PullToRefreshGridView mPullToRefreshGridView;
private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class);
private List<OperationDto> operationDtoList = new ArrayList<>();;
private List<OperationDto> operationDtoList = new ArrayList<>();
// スマートフォンの1行のパンネル数
private static final int NORMAL_SIZE_COLUMN = 1;
// タブレット縦で1行のパンネル数
private static final int LARGE_ORIENTATION_PORTRAIT_SIZE_COLUMN = 2;
// タブレット横で1行のパンネル数
private static final int LARGE_ORIENTATION_LANDSCAPE_SIZE_COLUMN = 3;
public OperationListHelper(OperationListActivity activity) {
mAppActivity = activity;
......@@ -53,7 +63,8 @@ public class OperationListHelper {
private List<OperationDto> filterOperationList() {
try {
operationDtoList = mOperationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, mAppActivity.mSearchOperationReportType);
String operationReportTypeStr = PreferenceUtil.getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null);
operationDtoList = mOperationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, operationReportTypeStr);
} catch (Exception e) {
Logger.e(TAG, "findOperationList", e);
ErrorMessage.showErrorMessageToast(mAppActivity.getApplicationContext(), ErrorCode.E107);
......@@ -61,6 +72,7 @@ public class OperationListHelper {
return operationDtoList;
}
// リスト・パンネルビューの取得
public ViewGroup getOperationView() {
int checkedViewModeId = ABVApplication.getABVUIDataCache(mAppActivity).getViewMode();
ViewGroup child;
......@@ -96,7 +108,20 @@ public class OperationListHelper {
child.setSelector(mAppActivity.getResources().getDrawable(R.drawable.grid_selecter));
child.setNumColumns(3);
if (mAppActivity.isNormalSize()) {
// スマートフォンの場合、1行当たりのパンネル数
child.setNumColumns(NORMAL_SIZE_COLUMN);
} else {
// タブレットの場合、1行当たりのパンネル数
if (mAppActivity.isOrientationPortrait()) {
// 縦
child.setNumColumns(LARGE_ORIENTATION_PORTRAIT_SIZE_COLUMN);
} else {
// 横
child.setNumColumns(LARGE_ORIENTATION_LANDSCAPE_SIZE_COLUMN);
}
}
OperationPanelAdapter adapter = new OperationPanelAdapter(mAppActivity, filterOperationList());
child.setAdapter(adapter);
......@@ -123,7 +148,7 @@ public class OperationListHelper {
}
});
// リスト以外のクリック処理
// リストの要素であるボタンクリック処理
adapter.setAdapterListener(new AbstractOperationAdapter.AbstractOperationListAdapterListener() {
@Override
public void onPanoEdit(OperationDto operationDto) {
......@@ -210,6 +235,9 @@ public class OperationListHelper {
return mPullToRefreshListView;
}
/**
* 作業の画面更新
*/
public void refreshList() {
if (mAdapter != null) {
mAdapter.setItem(filterOperationList());
......
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