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
bae657e9
Commit
bae657e9
authored
Nov 28, 2024
by
Kim Jinsung
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'contract/sato/1.0.612_62460' into 'contract/sato/1.0.612'
62460:アプリ自動同期仕様変更 See merge request
!328
parents
5b70622b
36d31460
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
9 deletions
+52
-9
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/OperationDao.java
+12
-3
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/tables/TOperation.java
+4
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/OperationDto.java
+4
-2
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
+27
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
+5
-3
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/OperationDao.java
View file @
bae657e9
...
@@ -131,6 +131,11 @@ public class OperationDao extends AbstractDao {
...
@@ -131,6 +131,11 @@ public class OperationDao extends AbstractDao {
dto
.
statusCompletedCount
=
cursor
.
getInt
(
column
);
dto
.
statusCompletedCount
=
cursor
.
getInt
(
column
);
}
}
column
=
cursor
.
getColumnIndex
(
"operation_last_sync_date"
);
if
(
column
!=
-
1
)
{
dto
.
operationLastSyncDate
=
DateTimeUtil
.
toDate
(
cursor
.
getString
(
column
),
"UTC"
,
DateTimeFormat
.
yyyyMMddHHmmss_hyphen
);
}
return
dto
;
return
dto
;
}
}
...
@@ -205,9 +210,10 @@ public class OperationDao extends AbstractDao {
...
@@ -205,9 +210,10 @@ public class OperationDao extends AbstractDao {
+
"status_not_started_count, "
+
"status_not_started_count, "
+
"status_working_count, "
+
"status_working_count, "
+
"status_completed_count, "
+
"status_completed_count, "
+
"quick_report) "
+
"quick_report, "
+
"operation_last_sync_date) "
+
"values "
+
"values "
+
"(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
,
+
"(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?
,?
)"
,
dto
.
getInsertValues
());
dto
.
getInsertValues
());
}
}
...
@@ -232,7 +238,8 @@ public class OperationDao extends AbstractDao {
...
@@ -232,7 +238,8 @@ public class OperationDao extends AbstractDao {
+
"status_not_started_count=?, "
+
"status_not_started_count=?, "
+
"status_working_count=?, "
+
"status_working_count=?, "
+
"status_completed_count=?, "
+
"status_completed_count=?, "
+
"quick_report=? "
+
"quick_report=?, "
+
"operation_last_sync_date=? "
+
"where operation_id=?"
,
+
"where operation_id=?"
,
dto
.
getUpdateValues
());
dto
.
getUpdateValues
());
return
count
>
0
;
return
count
>
0
;
...
@@ -301,6 +308,7 @@ public class OperationDao extends AbstractDao {
...
@@ -301,6 +308,7 @@ public class OperationDao extends AbstractDao {
sql
.
append
(
" top.status_not_started_count, "
);
sql
.
append
(
" top.status_not_started_count, "
);
sql
.
append
(
" top.status_working_count, "
);
sql
.
append
(
" top.status_working_count, "
);
sql
.
append
(
" top.status_completed_count, "
);
sql
.
append
(
" top.status_completed_count, "
);
sql
.
append
(
" top.operation_last_sync_date, "
);
sql
.
append
(
" CASE "
);
sql
.
append
(
" CASE "
);
sql
.
append
(
" WHEN report_type = 1 THEN ( "
);
sql
.
append
(
" WHEN report_type = 1 THEN ( "
);
sql
.
append
(
" SELECT strftime('%Y/%m/%d %H:%M', datetime(ttr.report_start_date, 'localtime')) || ' ~ ' || strftime('%Y/%m/%d %H:%M', datetime(ttr.report_end_date, 'localtime')) "
);
sql
.
append
(
" SELECT strftime('%Y/%m/%d %H:%M', datetime(ttr.report_start_date, 'localtime')) || ' ~ ' || strftime('%Y/%m/%d %H:%M', datetime(ttr.report_end_date, 'localtime')) "
);
...
@@ -466,6 +474,7 @@ public class OperationDao extends AbstractDao {
...
@@ -466,6 +474,7 @@ public class OperationDao extends AbstractDao {
sql
.
append
(
" top.status_not_started_count, "
);
sql
.
append
(
" top.status_not_started_count, "
);
sql
.
append
(
" top.status_working_count, "
);
sql
.
append
(
" top.status_working_count, "
);
sql
.
append
(
" top.status_completed_count, "
);
sql
.
append
(
" top.status_completed_count, "
);
sql
.
append
(
" top.operation_last_sync_date, "
);
sql
.
append
(
" CASE "
);
sql
.
append
(
" CASE "
);
sql
.
append
(
" WHEN report_type = 1 THEN ( "
);
sql
.
append
(
" WHEN report_type = 1 THEN ( "
);
sql
.
append
(
" SELECT strftime('%Y/%m/%d %H:%M', datetime(ttr.report_start_date, 'localtime')) || ' ~ ' || strftime('%Y/%m/%d %H:%M', datetime(ttr.report_end_date, 'localtime')) "
);
sql
.
append
(
" SELECT strftime('%Y/%m/%d %H:%M', datetime(ttr.report_start_date, 'localtime')) || ' ~ ' || strftime('%Y/%m/%d %H:%M', datetime(ttr.report_end_date, 'localtime')) "
);
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/tables/TOperation.java
View file @
bae657e9
...
@@ -47,6 +47,7 @@ public class TOperation extends SQLiteTableScript {
...
@@ -47,6 +47,7 @@ public class TOperation extends SQLiteTableScript {
sql
.
append
(
" , status_not_started_count INTEGER NOT NULL DEFAULT 0 "
);
sql
.
append
(
" , status_not_started_count INTEGER NOT NULL DEFAULT 0 "
);
sql
.
append
(
" , status_working_count INTEGER NOT NULL DEFAULT 0 "
);
sql
.
append
(
" , status_working_count INTEGER NOT NULL DEFAULT 0 "
);
sql
.
append
(
" , status_completed_count INTEGER NOT NULL DEFAULT 0 "
);
sql
.
append
(
" , status_completed_count INTEGER NOT NULL DEFAULT 0 "
);
sql
.
append
(
" , operation_last_sync_date DATETIME "
);
sql
.
append
(
" , PRIMARY KEY (operation_id) "
);
sql
.
append
(
" , PRIMARY KEY (operation_id) "
);
sql
.
append
(
" ) "
);
sql
.
append
(
" ) "
);
ddl
.
add
(
sql
.
toString
());
ddl
.
add
(
sql
.
toString
());
...
@@ -67,6 +68,9 @@ public class TOperation extends SQLiteTableScript {
...
@@ -67,6 +68,9 @@ public class TOperation extends SQLiteTableScript {
ddl
.
add
(
" ALTER TABLE t_operation ADD COLUMN status_working_count INTEGER NOT NULL DEFAULT 0 "
);
ddl
.
add
(
" ALTER TABLE t_operation ADD COLUMN status_working_count INTEGER NOT NULL DEFAULT 0 "
);
ddl
.
add
(
" ALTER TABLE t_operation ADD COLUMN status_completed_count INTEGER NOT NULL DEFAULT 0 "
);
ddl
.
add
(
" ALTER TABLE t_operation ADD COLUMN status_completed_count INTEGER NOT NULL DEFAULT 0 "
);
}
}
if
(
oldVersion
<
DatabaseVersions
.
Ver1_0_612
)
{
ddl
.
add
(
" ALTER TABLE t_operation ADD COLUMN operation_last_sync_date DATETIME "
);
}
return
ddl
;
return
ddl
;
}
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/OperationDto.java
View file @
bae657e9
...
@@ -37,6 +37,8 @@ public class OperationDto extends AbstractDto {
...
@@ -37,6 +37,8 @@ public class OperationDto extends AbstractDto {
public
int
statusWorkingCount
;
//「作業中」数
public
int
statusWorkingCount
;
//「作業中」数
public
int
statusCompletedCount
;
// 「作業完了」数
public
int
statusCompletedCount
;
// 「作業完了」数
public
Date
operationLastSyncDate
;
// 作業担当グループリスト
// 作業担当グループリスト
public
List
<
TaskWorkerGroupDto
>
taskWorkerGroupDtoList
;
public
List
<
TaskWorkerGroupDto
>
taskWorkerGroupDtoList
;
// 作業種別に紐づく作業Dto
// 作業種別に紐づく作業Dto
...
@@ -53,12 +55,12 @@ public class OperationDto extends AbstractDto {
...
@@ -53,12 +55,12 @@ public class OperationDto extends AbstractDto {
@Override
@Override
public
Object
[]
getInsertValues
()
{
public
Object
[]
getInsertValues
()
{
return
new
Object
[]
{
operationId
,
operationName
,
operationDescriptions
,
operationStartDate
,
operationEndDate
,
operationType
,
reportType
,
lastEditDate
,
contentCreatingFlg
,
editLockFlg
,
needSyncFlg
,
reportCycle
,
enableReportUpdate
,
enableReportHistory
,
enableReportEdit
,
enableAddReport
,
statusNotStartedCount
,
statusWorkingCount
,
statusCompletedCount
,
quickReport
};
return
new
Object
[]
{
operationId
,
operationName
,
operationDescriptions
,
operationStartDate
,
operationEndDate
,
operationType
,
reportType
,
lastEditDate
,
contentCreatingFlg
,
editLockFlg
,
needSyncFlg
,
reportCycle
,
enableReportUpdate
,
enableReportHistory
,
enableReportEdit
,
enableAddReport
,
statusNotStartedCount
,
statusWorkingCount
,
statusCompletedCount
,
quickReport
,
operationLastSyncDate
};
}
}
@Override
@Override
public
Object
[]
getUpdateValues
()
{
public
Object
[]
getUpdateValues
()
{
return
new
Object
[]
{
operationName
,
operationDescriptions
,
operationStartDate
,
operationEndDate
,
operationType
,
reportType
,
lastEditDate
,
contentCreatingFlg
,
editLockFlg
,
needSyncFlg
,
reportCycle
,
enableReportUpdate
,
enableReportHistory
,
enableReportEdit
,
enableAddReport
,
statusNotStartedCount
,
statusWorkingCount
,
statusCompletedCount
,
quickReport
,
operationId
};
return
new
Object
[]
{
operationName
,
operationDescriptions
,
operationStartDate
,
operationEndDate
,
operationType
,
reportType
,
lastEditDate
,
contentCreatingFlg
,
editLockFlg
,
needSyncFlg
,
reportCycle
,
enableReportUpdate
,
enableReportHistory
,
enableReportEdit
,
enableAddReport
,
statusNotStartedCount
,
statusWorkingCount
,
statusCompletedCount
,
quickReport
,
operation
LastSyncDate
,
operation
Id
};
}
}
@Override
@Override
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
View file @
bae657e9
...
@@ -90,6 +90,7 @@ public class OperationLogic extends AbstractLogic {
...
@@ -90,6 +90,7 @@ public class OperationLogic extends AbstractLogic {
private
TaskWorkerGroupDao
mTaskWorkerGroupDao
=
AbstractDao
.
getDao
(
TaskWorkerGroupDao
.
class
);
private
TaskWorkerGroupDao
mTaskWorkerGroupDao
=
AbstractDao
.
getDao
(
TaskWorkerGroupDao
.
class
);
private
static
final
int
FINISHED_STATUS
=
999
;
private
static
final
int
FINISHED_STATUS
=
999
;
private
final
static
int
INTERVAL_LAST_EDIT_TIME_MS
=
1800000
;
public
void
initializeOperations
()
throws
AcmsException
,
NetworkDisconnectedException
{
public
void
initializeOperations
()
throws
AcmsException
,
NetworkDisconnectedException
{
// 作業グループリスト取得
// 作業グループリスト取得
setWorkingGroupList
();
setWorkingGroupList
();
...
@@ -117,6 +118,7 @@ public class OperationLogic extends AbstractLogic {
...
@@ -117,6 +118,7 @@ public class OperationLogic extends AbstractLogic {
if
(
serverOperationDto
.
operationId
.
equals
(
localProjcetDto
.
operationId
))
{
if
(
serverOperationDto
.
operationId
.
equals
(
localProjcetDto
.
operationId
))
{
//update
//update
serverOperationDto
.
needSyncFlg
=
serverOperationDto
.
equalsLastEdit
(
localProjcetDto
)
?
localProjcetDto
.
needSyncFlg
:
true
;
serverOperationDto
.
needSyncFlg
=
serverOperationDto
.
equalsLastEdit
(
localProjcetDto
)
?
localProjcetDto
.
needSyncFlg
:
true
;
serverOperationDto
.
operationLastSyncDate
=
localProjcetDto
.
operationLastSyncDate
;
List
<
Long
>
localOperationContentIds
=
mOperationContentDao
.
getContentIds
(
serverOperationDto
.
operationId
);
List
<
Long
>
localOperationContentIds
=
mOperationContentDao
.
getContentIds
(
serverOperationDto
.
operationId
);
boolean
operationContentFlg
=
false
;
boolean
operationContentFlg
=
false
;
for
(
OperationContentDto
operationContentDto
:
serverOperationDto
.
operationContentDtoList
)
{
for
(
OperationContentDto
operationContentDto
:
serverOperationDto
.
operationContentDtoList
)
{
...
@@ -1573,9 +1575,10 @@ public class OperationLogic extends AbstractLogic {
...
@@ -1573,9 +1575,10 @@ public class OperationLogic extends AbstractLogic {
* @param operationId
* @param operationId
* @param lastEditDate
* @param lastEditDate
*/
*/
public
void
finishedSyncOperation
(
Long
operationId
,
Date
lastEditDate
)
{
public
void
finishedSyncOperation
(
Long
operationId
,
Date
lastEditDate
,
Date
lastSyncDate
)
{
OperationDto
operationDto
=
mOperationDao
.
getOperationJoinContent
(
operationId
);
OperationDto
operationDto
=
mOperationDao
.
getOperationJoinContent
(
operationId
);
operationDto
.
lastEditDate
=
lastEditDate
;
operationDto
.
lastEditDate
=
lastEditDate
;
operationDto
.
operationLastSyncDate
=
lastSyncDate
;
operationDto
.
needSyncFlg
=
false
;
operationDto
.
needSyncFlg
=
false
;
mOperationDao
.
update
(
operationDto
);
mOperationDao
.
update
(
operationDto
);
}
}
...
@@ -1931,4 +1934,27 @@ public class OperationLogic extends AbstractLogic {
...
@@ -1931,4 +1934,27 @@ public class OperationLogic extends AbstractLogic {
}
}
return
result
;
return
result
;
}
}
private
Boolean
isEnableTimeForAutoSync
(
Date
lastEditDateTime
)
{
Date
currentDateTime
=
DateTimeUtil
.
getCurrentDate
();
if
(
lastEditDateTime
==
null
)
{
return
true
;
}
else
{
long
diffInMillis
=
currentDateTime
.
getTime
()
-
lastEditDateTime
.
getTime
();
if
(
diffInMillis
>=
INTERVAL_LAST_EDIT_TIME_MS
)
{
return
true
;
}
}
return
false
;
}
public
List
<
OperationDto
>
needSyncCheckArray
(
List
<
OperationDto
>
needSyncOperationInfoArray
)
{
List
<
OperationDto
>
needSyncCheckArray
=
new
ArrayList
<>();
for
(
OperationDto
operationDto
:
needSyncOperationInfoArray
)
{
if
(
isEnableTimeForAutoSync
(
operationDto
.
operationLastSyncDate
))
{
needSyncCheckArray
.
add
(
operationDto
);
}
}
return
needSyncCheckArray
;
}
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
View file @
bae657e9
...
@@ -505,8 +505,9 @@ public class OperationListActivity extends OperationActivity {
...
@@ -505,8 +505,9 @@ public class OperationListActivity extends OperationActivity {
}
else
{
}
else
{
needSyncOperationList
.
addAll
(
mOperationDao
.
getNeedSyncAllOperation
());
needSyncOperationList
.
addAll
(
mOperationDao
.
getNeedSyncAllOperation
());
}
}
if
(
needSyncOperationList
.
size
()
>
0
)
{
List
<
OperationDto
>
needSyncCheckArray
=
mOperationLogic
.
needSyncCheckArray
(
needSyncOperationList
);
categoryBatchSync
(
needSyncOperationList
);
if
(
needSyncCheckArray
.
size
()
>
0
)
{
categoryBatchSync
(
needSyncCheckArray
);
}
else
{
}
else
{
// donot need sync
// donot need sync
autoSyncOperationDone
(
true
);
autoSyncOperationDone
(
true
);
...
@@ -966,7 +967,8 @@ public class OperationListActivity extends OperationActivity {
...
@@ -966,7 +967,8 @@ public class OperationListActivity extends OperationActivity {
// データの受信時、エラーキャッチのための変数を初期化
// データの受信時、エラーキャッチのための変数を初期化
isSyncGetTaskFileError
=
false
;
isSyncGetTaskFileError
=
false
;
if
(
mOperationLastEditDate
!=
null
)
{
if
(
mOperationLastEditDate
!=
null
)
{
mOperationLogic
.
finishedSyncOperation
(
operationId
,
mOperationLastEditDate
);
Date
operationLastSyncDate
=
DateTimeUtil
.
getCurrentDate
();
mOperationLogic
.
finishedSyncOperation
(
operationId
,
mOperationLastEditDate
,
operationLastSyncDate
);
progressDialogHorizontal
.
setProgress
(
100
);
progressDialogHorizontal
.
setProgress
(
100
);
}
}
mOperationLastEditDate
=
null
;
mOperationLastEditDate
=
null
;
...
...
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