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
728ae416
Commit
728ae416
authored
Feb 02, 2023
by
Kazuyuki Hida
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
作業一覧にローカル保存しているデータ数が反映されるようにした。
parent
8d4e25d8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
109 additions
and
1 deletions
+109
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/WorkingReportDao.java
+60
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/WorkingReportDto.java
+31
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
+18
-1
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/WorkingReportDao.java
0 → 100644
View file @
728ae416
package
jp
.
agentec
.
abook
.
abv
.
bl
.
data
.
dao
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
jp.agentec.abook.abv.bl.common.db.Cursor
;
import
jp.agentec.abook.abv.bl.dto.WorkingReportDto
;
public
class
WorkingReportDao
extends
AbstractDao
{
@Override
protected
WorkingReportDto
convert
(
Cursor
cursor
)
{
return
new
WorkingReportDto
(
longOrNull
(
cursor
,
"operation_id"
),
intOrNull
(
cursor
,
"count"
)
);
}
private
Long
longOrNull
(
Cursor
cursor
,
String
name
)
{
int
column
=
cursor
.
getColumnIndex
(
name
);
if
(
column
<
0
)
{
return
null
;
}
else
{
return
cursor
.
getLong
(
column
);
}
}
private
Integer
intOrNull
(
Cursor
cursor
,
String
name
)
{
int
column
=
cursor
.
getColumnIndex
(
name
);
if
(
column
<
0
)
{
return
null
;
}
else
{
return
cursor
.
getInt
(
column
);
}
}
public
Map
<
Long
,
Integer
>
getWorkingTaskReportCounts
()
{
StringBuilder
sql
=
new
StringBuilder
();
sql
.
append
(
" SELECT t_operation.operation_id AS operation_id, count(*) AS count FROM t_task_report "
);
sql
.
append
(
" INNER JOIN t_task ON t_task_report.task_key = t_task.task_key "
);
sql
.
append
(
" INNER JOIN t_operation ON t_task.operation_id = t_operation.operation_id"
);
sql
.
append
(
" WHERE t_task_report.local_saved_flg > 0"
);
sql
.
append
(
" GROUP BY t_operation.operation_id"
);
List
<
WorkingReportDto
>
list
=
rawQueryGetDtoList
(
sql
.
toString
(),
null
,
WorkingReportDto
.
class
);
Map
<
Long
,
Integer
>
map
=
new
HashMap
<
Long
,
Integer
>();
for
(
WorkingReportDto
dto
:
list
)
{
Long
id
=
dto
.
getOperationId
();
Integer
cnt
=
dto
.
getCount
();
if
(
id
!=
null
&&
cnt
!=
null
)
{
map
.
put
(
id
,
cnt
);
}
}
return
map
;
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/WorkingReportDto.java
0 → 100644
View file @
728ae416
package
jp
.
agentec
.
abook
.
abv
.
bl
.
dto
;
public
class
WorkingReportDto
extends
AbstractDto
{
private
final
Long
operationId
;
private
final
Integer
count
;
public
WorkingReportDto
(
Long
operationId
,
Integer
count
)
{
super
();
this
.
operationId
=
operationId
;
this
.
count
=
count
;
}
@Override
public
String
[]
getKeyValues
()
{
return
new
String
[
0
];
}
@Override
public
Object
[]
getInsertValues
()
{
return
new
Object
[
0
];
}
public
Long
getOperationId
()
{
return
operationId
;
}
public
Integer
getCount
()
{
return
count
;
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
View file @
728ae416
...
...
@@ -47,6 +47,7 @@ import jp.agentec.abook.abv.bl.data.dao.TaskReportItemsDao;
import
jp.agentec.abook.abv.bl.data.dao.TaskReportSendDao
;
import
jp.agentec.abook.abv.bl.data.dao.TaskWorkerGroupDao
;
import
jp.agentec.abook.abv.bl.data.dao.WorkerGroupDao
;
import
jp.agentec.abook.abv.bl.data.dao.WorkingReportDao
;
import
jp.agentec.abook.abv.bl.dto.CategoryContentDto
;
import
jp.agentec.abook.abv.bl.dto.ContentDto
;
import
jp.agentec.abook.abv.bl.dto.OperationContentDto
;
...
...
@@ -1186,7 +1187,23 @@ public class OperationLogic extends AbstractLogic {
* @return 作業情報配列
*/
public
List
<
OperationDto
>
getRefreshOperation
(
String
searchWord
,
String
searchStartDateStr
,
String
searchEndDateStr
,
String
reportTypeStr
)
{
return
mOperationDao
.
getOperations
(
searchWord
,
searchStartDateStr
,
searchEndDateStr
,
reportTypeStr
);
List
<
OperationDto
>
list
=
mOperationDao
.
getOperations
(
searchWord
,
searchStartDateStr
,
searchEndDateStr
,
reportTypeStr
);
WorkingReportDao
dao
=
AbstractDao
.
getDao
(
WorkingReportDao
.
class
);
// ローカル保存している分を補正する
Map
<
Long
,
Integer
>
working
=
dao
.
getWorkingTaskReportCounts
();
for
(
OperationDto
dto
:
list
)
{
Integer
workingCount
=
working
.
get
(
dto
.
operationId
);
if
(
workingCount
!=
null
)
{
if
(
dto
.
reportType
==
1
)
{
// 定期点検の場合は、先にレポートが作られるので、その分を差し引く
dto
.
statusNotStartedCount
-=
workingCount
;
}
dto
.
statusWorkingCount
+=
workingCount
;
}
}
return
list
;
}
/**
...
...
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