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";
}
/**
......
......@@ -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