Commit 136c8a58 by Kim Jinsung

#33772 定期点検の営業日更新対応

parent 7125dce7
...@@ -147,5 +147,11 @@ public interface ServiceOption { ...@@ -147,5 +147,11 @@ public interface ServiceOption {
* 報告タイプ:N(通常)、Y(定期点検) * 報告タイプ:N(通常)、Y(定期点検)
*/ */
int OperationReportType = 171; int OperationReportType = 171;
/**
* 営業日変更時間
*/
int OperationChangeTime = 173;
} }
} }
\ No newline at end of file
...@@ -25,14 +25,14 @@ import jp.agentec.adf.util.StringUtil; ...@@ -25,14 +25,14 @@ import jp.agentec.adf.util.StringUtil;
// TODO: clone()使っているところは不要なので次のバージョンアップのタイミングで取る // TODO: clone()使っているところは不要なので次のバージョンアップのタイミングで取る
public class ABVDataCache { public class ABVDataCache {
private static final String TAG = "Cache"; private static final String TAG = "Cache";
private static ABVDataCache instance = null; private static ABVDataCache instance = null;
public ServiceOption serviceOption = null; public ServiceOption serviceOption = null;
private MemberInfoDto memberInfoDto = null; private MemberInfoDto memberInfoDto = null;
private List<ServiceOptionDto> serviceOptionDtoList = null; private List<ServiceOptionDto> serviceOptionDtoList = null;
private String urlPath; private String urlPath;
private Integer diffMinFromUTC; // ACMSサーバ時間におけるUTCから差分 deliveryStartDateUTCを含まない旧コンテンツ用に必要 private Integer diffMinFromUTC; // ACMSサーバ時間におけるUTCから差分 deliveryStartDateUTCを含まない旧コンテンツ用に必要
...@@ -53,15 +53,15 @@ public class ABVDataCache { ...@@ -53,15 +53,15 @@ public class ABVDataCache {
* @since 1.0.0 * @since 1.0.0
*/ */
private int defaultGroupId = -1; private int defaultGroupId = -1;
public static synchronized ABVDataCache getInstance() { public static synchronized ABVDataCache getInstance() {
if (instance == null) { if (instance == null) {
instance = new ABVDataCache(); instance = new ABVDataCache();
} }
return instance; return instance;
} }
private ABVDataCache() { private ABVDataCache() {
serviceOption = new ServiceOption(); serviceOption = new ServiceOption();
} }
...@@ -80,10 +80,10 @@ public class ABVDataCache { ...@@ -80,10 +80,10 @@ public class ABVDataCache {
} }
} }
} }
return null; return null;
} }
/** /**
* キャッシュに格納されているユーザ情報を返します。 * キャッシュに格納されているユーザ情報を返します。
* @return ユーザ情報を格納した {@link MemberInfoDto} のインスタンスを返します。 * @return ユーザ情報を格納した {@link MemberInfoDto} のインスタンスを返します。
...@@ -99,11 +99,11 @@ public class ABVDataCache { ...@@ -99,11 +99,11 @@ public class ABVDataCache {
public int getDefaultCategoryId() { public int getDefaultCategoryId() {
return defaultCategoryId; return defaultCategoryId;
} }
public int getDefaultGroupId() { public int getDefaultGroupId() {
return defaultGroupId; return defaultGroupId;
} }
/** /**
* キャッシュのサービスオプション情報をキャッシュに追加します。既に同じサービスオプション情報が存在する場合は更新します。 * キャッシュのサービスオプション情報をキャッシュに追加します。既に同じサービスオプション情報が存在する場合は更新します。
* @param serviceOptionDto サービスオプション情報です。 * @param serviceOptionDto サービスオプション情報です。
...@@ -129,7 +129,7 @@ public class ABVDataCache { ...@@ -129,7 +129,7 @@ public class ABVDataCache {
serviceOptionDtoList.add((ServiceOptionDto)serviceOptionDto.clone()); serviceOptionDtoList.add((ServiceOptionDto)serviceOptionDto.clone());
} }
} }
public void addServiceOptions(List<ServiceOptionDto> list) { public void addServiceOptions(List<ServiceOptionDto> list) {
if (list != null) { if (list != null) {
for (ServiceOptionDto dto : list) { for (ServiceOptionDto dto : list) {
...@@ -137,32 +137,32 @@ public class ABVDataCache { ...@@ -137,32 +137,32 @@ public class ABVDataCache {
} }
} }
} }
/** /**
* キャッシュのユーザ情報を更新します。 * キャッシュのユーザ情報を更新します。
* @param dto 更新するユーザ情報です。 * @param dto 更新するユーザ情報です。
* @since 1.0.0 * @since 1.0.0
*/ */
public void refreshMemberInfo(MemberInfoDto dto) { public void refreshMemberInfo(MemberInfoDto dto) {
memberInfoDto = dto; memberInfoDto = dto;
} }
private void refreshMemberInfo() { private void refreshMemberInfo() {
MemberInfoDao dao = AbstractDao.getDao(MemberInfoDao.class); MemberInfoDao dao = AbstractDao.getDao(MemberInfoDao.class);
memberInfoDto = dao.getMemberInfo(LoginStatus.LoggedIn.statusCode()); memberInfoDto = dao.getMemberInfo(LoginStatus.LoggedIn.statusCode());
} }
public void refreshDefaultCategoryId(int categoryId) { public void refreshDefaultCategoryId(int categoryId) {
defaultCategoryId = categoryId; defaultCategoryId = categoryId;
} }
public void refreshDefaultGroupId(int groupId) { public void refreshDefaultGroupId(int groupId) {
defaultGroupId = groupId; defaultGroupId = groupId;
} }
public boolean refreshServiceOptions() { public boolean refreshServiceOptions() {
boolean refreshed = false; boolean refreshed = false;
try { try {
ServiceOptionDao dao = AbstractDao.getDao(ServiceOptionDao.class); ServiceOptionDao dao = AbstractDao.getDao(ServiceOptionDao.class);
List<ServiceOptionDto> list = dao.getServiceOptions(); List<ServiceOptionDto> list = dao.getServiceOptions();
...@@ -177,22 +177,22 @@ public class ABVDataCache { ...@@ -177,22 +177,22 @@ public class ABVDataCache {
} catch (Exception e) { } catch (Exception e) {
Logger.e(TAG, "refreshServiceOptions failed.", e); Logger.e(TAG, "refreshServiceOptions failed.", e);
} }
return refreshed; return refreshed;
} }
public void setUrlPath(String urlPath) { public void setUrlPath(String urlPath) {
this.urlPath = urlPath; this.urlPath = urlPath;
} }
public String getUrlPath() { public String getUrlPath() {
boolean firstLogin = false; boolean firstLogin = false;
if (memberInfoDto == null) { if (memberInfoDto == null) {
try { try {
MemberInfoDao dao = AbstractDao.getDao(MemberInfoDao.class); MemberInfoDao dao = AbstractDao.getDao(MemberInfoDao.class);
MemberInfoDto dto = dao.getMemberInfo(LoginStatus.LoggedIn.statusCode()); MemberInfoDto dto = dao.getMemberInfo(LoginStatus.LoggedIn.statusCode());
if (dto == null) { if (dto == null) {
firstLogin = true; firstLogin = true;
} }
...@@ -200,7 +200,7 @@ public class ABVDataCache { ...@@ -200,7 +200,7 @@ public class ABVDataCache {
// 何もしない // 何もしない
} }
} }
if (firstLogin) { if (firstLogin) {
urlPath = null; urlPath = null;
} else { } else {
...@@ -208,14 +208,14 @@ public class ABVDataCache { ...@@ -208,14 +208,14 @@ public class ABVDataCache {
refreshUrlPath(); refreshUrlPath();
} }
} }
return urlPath; return urlPath;
} }
public boolean refreshUrlPath() { public boolean refreshUrlPath() {
boolean refreshed = false; boolean refreshed = false;
try { try {
AcmsDao dao = AbstractDao.getDao(AcmsDao.class); AcmsDao dao = AbstractDao.getDao(AcmsDao.class);
urlPath = dao.getUrlPath(); urlPath = dao.getUrlPath();
...@@ -223,10 +223,10 @@ public class ABVDataCache { ...@@ -223,10 +223,10 @@ public class ABVDataCache {
} catch (Exception e) { } catch (Exception e) {
Logger.e(TAG, "refreshUrlPath failed.", e); Logger.e(TAG, "refreshUrlPath failed.", e);
} }
return refreshed; return refreshed;
} }
/** /**
* キャッシュのデータを全て削除します。 * キャッシュのデータを全て削除します。
* @since 1.0.0 * @since 1.0.0
...@@ -246,107 +246,112 @@ public class ABVDataCache { ...@@ -246,107 +246,112 @@ public class ABVDataCache {
} }
} }
public class ServiceOption { public class ServiceOption {
public boolean isUndelivarableDelete() { public boolean isUndelivarableDelete() {
return isServiceOptionEnable(ServiceOptionId.UndeliverableDelete); return isServiceOptionEnable(ServiceOptionId.UndeliverableDelete);
} }
public boolean isNoAuthDelete() {
return isServiceOptionEnable(ServiceOptionId.NoauthDelete);
}
public SecurityPolicyType getForcePwChangeOnLogin() { public boolean isNoAuthDelete() {
SecurityPolicyType code = SecurityPolicyType.None; return isServiceOptionEnable(ServiceOptionId.NoauthDelete);
}
ServiceOptionDto dto = getServiceOption(ServiceOptionId.ForcePwChangeOnLogin);
if (dto != null) {
code = SecurityPolicyType.parse(NumericUtil.parseInt(dto.val));
}
return code;
}
public SecurityPolicyType getForcePwChangePeriodically() {
SecurityPolicyType code = SecurityPolicyType.None;
ServiceOptionDto dto = getServiceOption(ServiceOptionId.ForcePwChangePeriodically);
if (dto != null) {
code = SecurityPolicyType.parse(NumericUtil.parseInt(dto.val));
}
return code;
}
public boolean isForceLoginPeriodically() {
return isServiceOptionEnable(ServiceOptionId.ForceLoginPeriodically);
}
public boolean isUseridUdidOverwrite() {
return isServiceOptionEnable(ServiceOptionId.UseridUdidOverwrite);
}
public boolean isMarking() {
return isServiceOptionEnable(ServiceOptionId.Marking);
}
public boolean isPdfLinkDisp() { public SecurityPolicyType getForcePwChangeOnLogin() {
return isServiceOptionEnable(ServiceOptionId.PdfLinkDisp); SecurityPolicyType code = SecurityPolicyType.None;
}
public boolean isCatalogEdition() { ServiceOptionDto dto = getServiceOption(ServiceOptionId.ForcePwChangeOnLogin);
return isServiceOptionEnable(ServiceOptionId.CatalogEdition);
}
public boolean isBizEdition() { if (dto != null) {
return !isServiceOptionEnable(ServiceOptionId.CatalogEdition) && !isServiceOptionEnable(ServiceOptionId.Publisher); code = SecurityPolicyType.parse(NumericUtil.parseInt(dto.val));
} }
public boolean isReportGPS() { return code;
return isServiceOptionEnable(ServiceOptionId.REPORT_GPS); }
}
public boolean isRoutineTaskReport() { public SecurityPolicyType getForcePwChangePeriodically() {
return isServiceOptionEnable(ServiceOptionId.OperationReportType); SecurityPolicyType code = SecurityPolicyType.None;
}
public boolean isEnquete() { ServiceOptionDto dto = getServiceOption(ServiceOptionId.ForcePwChangePeriodically);
return isServiceOptionEnable(ServiceOptionId.Enquete);
}
public boolean isExam() { if (dto != null) {
return isServiceOptionEnable(ServiceOptionId.Exam); code = SecurityPolicyType.parse(NumericUtil.parseInt(dto.val));
} }
public boolean isQuiz() { return code;
return isServiceOptionEnable(ServiceOptionId.Quiz); }
}
public boolean isTransmitExamAtOffline() { public boolean isForceLoginPeriodically() {
return isServiceOptionEnable(ServiceOptionId.TransmitExamAtOfflLine); return isServiceOptionEnable(ServiceOptionId.ForceLoginPeriodically);
} }
public boolean isUseGroup() { public boolean isUseridUdidOverwrite() {
return isServiceOptionEnable(ServiceOptionId.UseGroup); return isServiceOptionEnable(ServiceOptionId.UseridUdidOverwrite);
} }
public boolean isUseGenre() { public boolean isMarking() {
return isServiceOptionEnable(ServiceOptionId.UseGenre); return isServiceOptionEnable(ServiceOptionId.Marking);
} }
public boolean isPanoImage() { public boolean isPdfLinkDisp() {
return isServiceOptionEnable(ServiceOptionId.PanoImage); return isServiceOptionEnable(ServiceOptionId.PdfLinkDisp);
} }
public boolean isServiceOptionEnable(int serviceOptionId) { public boolean isCatalogEdition() {
ServiceOptionDto dto = getServiceOption(serviceOptionId); return isServiceOptionEnable(ServiceOptionId.CatalogEdition);
if (dto != null) { }
return ContractLogic.getBooleanValue(dto.val);
} public boolean isBizEdition() {
return false; return !isServiceOptionEnable(ServiceOptionId.CatalogEdition) && !isServiceOptionEnable(ServiceOptionId.Publisher);
}
public boolean isReportGPS() {
return isServiceOptionEnable(ServiceOptionId.REPORT_GPS);
}
public boolean isRoutineTaskReport() {
return isServiceOptionEnable(ServiceOptionId.OperationReportType);
}
public boolean isEnquete() {
return isServiceOptionEnable(ServiceOptionId.Enquete);
}
public boolean isExam() {
return isServiceOptionEnable(ServiceOptionId.Exam);
}
public boolean isQuiz() {
return isServiceOptionEnable(ServiceOptionId.Quiz);
}
public boolean isTransmitExamAtOffline() {
return isServiceOptionEnable(ServiceOptionId.TransmitExamAtOfflLine);
}
public boolean isUseGroup() {
return isServiceOptionEnable(ServiceOptionId.UseGroup);
}
public boolean isUseGenre() {
return isServiceOptionEnable(ServiceOptionId.UseGenre);
}
public boolean isPanoImage() {
return isServiceOptionEnable(ServiceOptionId.PanoImage);
}
public boolean isServiceOptionEnable(int serviceOptionId) {
ServiceOptionDto dto = getServiceOption(serviceOptionId);
if (dto != null) {
return ContractLogic.getBooleanValue(dto.val);
} }
} return false;
}
public String operationChangeTime() {
ServiceOptionDto dto = getServiceOption(ServiceOptionId.OperationChangeTime);
return dto.val;
}
}
public void setDiffMinFromUTC(String timeZone) { public void setDiffMinFromUTC(String timeZone) {
// UserAuthenticateLogic.getServerTimeから移行 // UserAuthenticateLogic.getServerTimeから移行
...@@ -362,14 +367,14 @@ public class ABVDataCache { ...@@ -362,14 +367,14 @@ public class ABVDataCache {
return diffMinFromUTC; return diffMinFromUTC;
} }
/** /**
* APIのURLにユーザ情報付与の特定キー作成 * APIのURLにユーザ情報付与の特定キー作成
* @return 「事業者文字列」+「ログインID」文字列をMD5変換を返します。nullの場合もあります。 * @return 「事業者文字列」+「ログインID」文字列をMD5変換を返します。nullの場合もあります。
*/ */
public String getAdummyKey() { public String getAdummyKey() {
if (getUrlPath() != null && getMemberInfo().loginId != null) { if (getUrlPath() != null && getMemberInfo().loginId != null) {
return SecurityUtil.getMd5Hash(getUrlPath() + getMemberInfo().loginId); return SecurityUtil.getMd5Hash(getUrlPath() + getMemberInfo().loginId);
} }
return null; return null;
} }
} }
...@@ -10,6 +10,7 @@ import java.io.File; ...@@ -10,6 +10,7 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
...@@ -1029,23 +1030,49 @@ public class OperationLogic extends AbstractLogic { ...@@ -1029,23 +1030,49 @@ public class OperationLogic extends AbstractLogic {
} }
/** /**
* プロジェクト一覧取得 * 作業一覧に表示する作業情報取得
* *
* @param searchWord * @param searchWord 検索キーワード
* @param searchStartDateStr * @param searchStartDateStr 開始期間
* @param searchEndDateStr * @param searchEndDateStr 終了期間
* @return * @return 作業情報配列
*/ */
public List<OperationDto> getRefreshOperation(String searchWord, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) { public List<OperationDto> getRefreshOperation(String searchWord, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) {
List<OperationDto> operationDtoList; return mOperationDao.getOperations(searchWord, searchStartDateStr, searchEndDateStr, reportTypeStr);
operationDtoList = mOperationDao.getOperations(searchWord, searchStartDateStr, searchEndDateStr, reportTypeStr); }
for (OperationDto operationDto : operationDtoList) {
// 作業送信フラグが存在する場合またはホットスポット更新フラグが存在する場合、needSyncFlgをtrueにセット /**
if (mTaskReportDao.isExistSendTaskData(operationDto.operationId) || mTaskReportDao.isExistUpdateTargetHotSpotTaskData(operationDto.operationId)) { * 作業毎に情報更新ボタンを表示するため、NeedSyncFlgをセットする。
mOperationDao.updateNeedSyncFlg(operationDto.operationId, true); * @param operationDto 作業情報
* @param syncedDate 定期点検のみ利用で、最後に情報更新した日付
*/
public void updateOperationNeedSyncFlg(OperationDto operationDto, String syncedDate) {
//情報更新が既に表示状態は何もしない
if (operationDto.needSyncFlg) {
return;
}
boolean updateFlg = false;
// 作業送信フラグが存在する場合またはホットスポット更新フラグが存在する場合、needSyncFlgをtrueにセット
if (mTaskReportDao.isExistSendTaskData(operationDto.operationId) ||
mTaskReportDao.isExistUpdateTargetHotSpotTaskData(operationDto.operationId)) {
updateFlg = true;
}
//定期点検のみ同期ボタンタップの日付と現在の日付が異なる且つ、作業するデータが存在しない場合
if (operationDto.reportType == Constant.ReportType.RoutineTask) {
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod) && !syncedDate.equals(DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none))) {
//営業時間以後、情報更新可能とする。
if (checkServiceOptionOperaionChangeTime()) {
updateFlg = true;
}
} }
} }
return operationDtoList;
if (updateFlg) {
operationDto.needSyncFlg = true;
mOperationDao.updateNeedSyncFlg(operationDto.operationId, operationDto.needSyncFlg);
}
} }
/** /**
...@@ -1600,4 +1627,34 @@ public class OperationLogic extends AbstractLogic { ...@@ -1600,4 +1627,34 @@ public class OperationLogic extends AbstractLogic {
mTaskDao.insert(taskDto); mTaskDao.insert(taskDto);
} }
} }
/**
* サービスオプション「営業日変更時間」をチェックして、情報更新可否を判断
* @return true : 情報更新可能、false:情報更新不可
*/
public boolean checkServiceOptionOperaionChangeTime() {
String operationChangeTime = ABVDataCache.getInstance().serviceOption.operationChangeTime();
String[] timeArray = operationChangeTime.split(":", 0);
if (timeArray.length != 2) { //データ形式が異常
return false;
}
int hour = Integer.valueOf(timeArray[0]); //時間
int minute = Integer.valueOf(timeArray[1]); //分
Calendar calender = Calendar.getInstance();
Date nowDate = calender.getTime();
calender.set(Calendar.MINUTE, minute);
calender.set(Calendar.HOUR_OF_DAY, hour);
calender.set(Calendar.SECOND, 0);
Date operationChageDate = calender.getTime();
//現在の時間が営業時間より未来の場合、情報更新状態にする。
if (nowDate.after(operationChageDate)) {
return true;
}
return false;
}
} }
...@@ -9,7 +9,6 @@ import android.widget.ImageView; ...@@ -9,7 +9,6 @@ import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.acms.type.OperationType; import jp.agentec.abook.abv.bl.acms.type.OperationType;
...@@ -24,7 +23,6 @@ import jp.agentec.adf.util.DateTimeFormat; ...@@ -24,7 +23,6 @@ import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
import static jp.agentec.abook.abv.cl.util.PreferenceUtil.getPref;
import static jp.agentec.abook.abv.cl.util.PreferenceUtil.getUserPref; import static jp.agentec.abook.abv.cl.util.PreferenceUtil.getUserPref;
/** /**
...@@ -118,21 +116,10 @@ public class OperationListAdapter extends AbstractOperationAdapter { ...@@ -118,21 +116,10 @@ public class OperationListAdapter extends AbstractOperationAdapter {
// 同期ボタン表示・非表示 // 同期ボタン表示・非表示
if (operationDto.contentId != null && operationDto.contentId != 0) { if (operationDto.contentId != null && operationDto.contentId != 0) {
if ((operationDto.needSyncFlg)) { if (holder.ivSync.getVisibility() == View.INVISIBLE) {
holder.ivSync.setVisibility(View.VISIBLE); if ((operationDto.needSyncFlg)) {
} else { holder.ivSync.setVisibility(View.VISIBLE);
// needSyncFlgがfalseの場合
if (operationDto.reportType == ReportType.RoutineTask) {
// 定期点検プロジェクトの場合のみ、以下の処理を行う
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))) {
// 同期ボタンタップの日付と現在の日付が異なる且つ、作業するデータが存在しない場合
holder.ivSync.setVisibility(View.VISIBLE);
} else {
holder.ivSync.setVisibility(View.INVISIBLE);
}
} else { } else {
// 定期点検プロジェクトではない場合、同期ボタンを非活性化する
holder.ivSync.setVisibility(View.INVISIBLE); holder.ivSync.setVisibility(View.INVISIBLE);
} }
} }
......
package jp.agentec.abook.abv.ui.home.adapter; package jp.agentec.abook.abv.ui.home.adapter;
import android.content.Context; import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -14,7 +13,6 @@ import java.util.List; ...@@ -14,7 +13,6 @@ import java.util.List;
import jp.agentec.abook.abv.bl.acms.type.OperationType; import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.Constant.ReportType; import jp.agentec.abook.abv.bl.common.Constant.ReportType;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.launcher.android.R; 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;
...@@ -148,20 +146,8 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -148,20 +146,8 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
if ((operationDto.needSyncFlg)) { if ((operationDto.needSyncFlg)) {
holder.ivSync.setVisibility(View.VISIBLE); holder.ivSync.setVisibility(View.VISIBLE);
} else { } else {
// needSyncFlgがfalseの場合 // 定期点検プロジェクトではない場合、同期ボタンを非活性化する
if (operationDto.reportType == ReportType.RoutineTask) { holder.ivSync.setVisibility(View.INVISIBLE);
// 定期点検プロジェクトの場合のみ、以下の処理を行う
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))) {
// 同期ボタンタップの日付と現在の日付が異なる且つ、作業するデータが存在しない場合
holder.ivSync.setVisibility(View.VISIBLE);
} else {
holder.ivSync.setVisibility(View.INVISIBLE);
}
} else {
// 定期点検プロジェクトではない場合、同期ボタンを非活性化する
holder.ivSync.setVisibility(View.INVISIBLE);
}
} }
} else { } else {
// プロジェクトのコンテンツが存在しない場合は、同期ボタンを非活性化する // プロジェクトのコンテンツが存在しない場合は、同期ボタンを非活性化する
......
...@@ -65,6 +65,11 @@ public class OperationListHelper { ...@@ -65,6 +65,11 @@ public class OperationListHelper {
try { try {
String reportTypeStr = getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null); String reportTypeStr = getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null);
operationDtoList = mOperationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, reportTypeStr); operationDtoList = mOperationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, reportTypeStr);
for (OperationDto operationDto : operationDtoList) {
String syncedDate = getUserPref(mAppActivity, String.format(AppDefType.UserPrefKey.SYNCED_OPERATION_ID, operationDto.operationId), "");
mOperationLogic.updateOperationNeedSyncFlg(operationDto, syncedDate);
}
} catch (Exception e) { } catch (Exception e) {
Logger.e(TAG, "findOperationList", e); Logger.e(TAG, "findOperationList", e);
ErrorMessage.showErrorMessageToast(mAppActivity.getApplicationContext(), ErrorCode.E107); ErrorMessage.showErrorMessageToast(mAppActivity.getApplicationContext(), ErrorCode.E107);
......
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