Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_android
abook_check
Commits
136c8a58
Commit
136c8a58
authored
May 28, 2019
by
Kim Jinsung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#33772 定期点検の営業日更新対応
parent
7125dce7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
215 additions
and
168 deletions
+215
-168
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/type/ServiceOption.java
+7
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/ABVDataCache.java
+129
-124
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
+69
-12
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/adapter/OperationListAdapter.java
+3
-16
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/adapter/OperationPanelAdapter.java
+2
-16
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/OperationListHelper.java
+5
-0
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/type/ServiceOption.java
View file @
136c8a58
...
...
@@ -147,5 +147,11 @@ public interface ServiceOption {
* 報告タイプ:N(通常)、Y(定期点検)
*/
int
OperationReportType
=
171
;
/**
* 営業日変更時間
*/
int
OperationChangeTime
=
173
;
}
}
\ No newline at end of file
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/ABVDataCache.java
View file @
136c8a58
This diff is collapsed.
Click to expand it.
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
View file @
136c8a58
...
...
@@ -10,6 +10,7 @@ import java.io.File;
import
java.io.IOException
;
import
java.security.NoSuchAlgorithmException
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Iterator
;
import
java.util.List
;
...
...
@@ -1029,23 +1030,49 @@ public class OperationLogic extends AbstractLogic {
}
/**
*
プロジェクト一覧
取得
*
作業一覧に表示する作業情報
取得
*
* @param searchWord
* @param searchStartDateStr
* @param searchEndDateStr
* @return
* @param searchWord
検索キーワード
* @param searchStartDateStr
開始期間
* @param searchEndDateStr
終了期間
* @return
作業情報配列
*/
public
List
<
OperationDto
>
getRefreshOperation
(
String
searchWord
,
String
searchStartDateStr
,
String
searchEndDateStr
,
String
reportTypeStr
)
{
List
<
OperationDto
>
operationDtoList
;
operationDtoList
=
mOperationDao
.
getOperations
(
searchWord
,
searchStartDateStr
,
searchEndDateStr
,
reportTypeStr
);
for
(
OperationDto
operationDto
:
operationDtoList
)
{
// 作業送信フラグが存在する場合またはホットスポット更新フラグが存在する場合、needSyncFlgをtrueにセット
if
(
mTaskReportDao
.
isExistSendTaskData
(
operationDto
.
operationId
)
||
mTaskReportDao
.
isExistUpdateTargetHotSpotTaskData
(
operationDto
.
operationId
))
{
mOperationDao
.
updateNeedSyncFlg
(
operationDto
.
operationId
,
true
);
return
mOperationDao
.
getOperations
(
searchWord
,
searchStartDateStr
,
searchEndDateStr
,
reportTypeStr
);
}
/**
* 作業毎に情報更新ボタンを表示するため、NeedSyncFlgをセットする。
* @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 {
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
;
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/adapter/OperationListAdapter.java
View file @
136c8a58
...
...
@@ -9,7 +9,6 @@ import android.widget.ImageView;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
java.util.ArrayList
;
import
java.util.List
;
import
jp.agentec.abook.abv.bl.acms.type.OperationType
;
...
...
@@ -24,7 +23,6 @@ import jp.agentec.adf.util.DateTimeFormat;
import
jp.agentec.adf.util.DateTimeUtil
;
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
;
/**
...
...
@@ -118,21 +116,10 @@ public class OperationListAdapter extends AbstractOperationAdapter {
// 同期ボタン表示・非表示
if
(
operationDto
.
contentId
!=
null
&&
operationDto
.
contentId
!=
0
)
{
if
((
operationDto
.
needSyncFlg
))
{
holder
.
ivSync
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
// 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
);
}
if
(
holder
.
ivSync
.
getVisibility
()
==
View
.
INVISIBLE
)
{
if
((
operationDto
.
needSyncFlg
))
{
holder
.
ivSync
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
// 定期点検プロジェクトではない場合、同期ボタンを非活性化する
holder
.
ivSync
.
setVisibility
(
View
.
INVISIBLE
);
}
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/adapter/OperationPanelAdapter.java
View file @
136c8a58
package
jp
.
agentec
.
abook
.
abv
.
ui
.
home
.
adapter
;
import
android.content.Context
;
import
android.graphics.Color
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
...
...
@@ -14,7 +13,6 @@ import java.util.List;
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.ReportType
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
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
;
...
...
@@ -148,20 +146,8 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
if
((
operationDto
.
needSyncFlg
))
{
holder
.
ivSync
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
// 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
{
// 定期点検プロジェクトではない場合、同期ボタンを非活性化する
holder
.
ivSync
.
setVisibility
(
View
.
INVISIBLE
);
}
// 定期点検プロジェクトではない場合、同期ボタンを非活性化する
holder
.
ivSync
.
setVisibility
(
View
.
INVISIBLE
);
}
}
else
{
// プロジェクトのコンテンツが存在しない場合は、同期ボタンを非活性化する
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/OperationListHelper.java
View file @
136c8a58
...
...
@@ -65,6 +65,11 @@ public class OperationListHelper {
try
{
String
reportTypeStr
=
getUserPref
(
mAppActivity
,
AppDefType
.
UserPrefKey
.
OPERATION_REPORT_TYPES
,
null
);
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
)
{
Logger
.
e
(
TAG
,
"findOperationList"
,
e
);
ErrorMessage
.
showErrorMessageToast
(
mAppActivity
.
getApplicationContext
(),
ErrorCode
.
E107
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment