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
55c7a54f
Commit
55c7a54f
authored
Jul 08, 2019
by
Lee Jaebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#34190 作業種別毎に作業を絞り込み機能修正
parent
8d3866b7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
63 deletions
+31
-63
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/OperationDao.java
+20
-24
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/OperationGroupMasterDao.java
+1
-21
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationGroupMasterLogic.java
+4
-8
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
+2
-2
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/OperationGroupMasterListHelper.java
+4
-8
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/OperationDao.java
View file @
55c7a54f
...
...
@@ -246,7 +246,17 @@ public class OperationDao extends AbstractDao {
* @return
*/
public
List
<
OperationDto
>
getOperations
(
String
searchOperationName
,
String
searchStartDateStr
,
String
searchEndDateStr
,
String
reportTypeStr
)
{
String
sql
=
generateGetOperationQuery
(
searchOperationName
,
searchStartDateStr
,
searchEndDateStr
,
reportTypeStr
);
String
sql
=
generateGetOperationQuery
(
searchOperationName
,
searchStartDateStr
,
searchEndDateStr
,
reportTypeStr
,
null
);
return
rawQueryGetDtoList
(
sql
,
null
,
OperationDto
.
class
);
}
/**
* カテゴリの作業一覧検索用
* @param operationGroupMasterId
* @return
*/
public
List
<
OperationDto
>
getOperationsByGroupMasterId
(
Integer
operationGroupMasterId
)
{
String
sql
=
generateGetOperationQuery
(
null
,
null
,
null
,
null
,
operationGroupMasterId
);
return
rawQueryGetDtoList
(
sql
,
null
,
OperationDto
.
class
);
}
...
...
@@ -259,7 +269,7 @@ public class OperationDao extends AbstractDao {
* @param reportTypeStr
* @return
*/
private
String
generateGetOperationQuery
(
String
searchOperationName
,
String
searchStartDateStr
,
String
searchEndDateStr
,
String
reportTypeStr
)
{
private
String
generateGetOperationQuery
(
String
searchOperationName
,
String
searchStartDateStr
,
String
searchEndDateStr
,
String
reportTypeStr
,
Integer
operationGroupMasterId
)
{
String
curDate
=
DateTimeUtil
.
toStringInTimeZone
(
new
Date
(),
DateTimeFormat
.
yyyyMMddHHmmss_hyphen
,
"UTC"
);
StringBuffer
sql
=
new
StringBuffer
();
...
...
@@ -304,6 +314,14 @@ public class OperationDao extends AbstractDao {
sql
.
append
(
" LEFT OUTER JOIN r_operation_content AS rpc "
);
sql
.
append
(
" ON top.operation_id = rpc.operation_id "
);
sql
.
append
(
" AND rpc.operation_content_flg = 1 "
);
// 作業種別IDに紐づく作業のみ検索するため、INNER JOINする
if
(
operationGroupMasterId
!=
null
)
{
sql
.
append
(
" INNER JOIN r_operation_group_master_relation AS rogmo "
);
sql
.
append
(
" ON rogmo.operation_id = top.operation_id "
);
sql
.
append
(
" AND rogmo.operation_group_master_id ="
+
operationGroupMasterId
);
}
sql
.
append
(
" WHERE top.operation_id IS NOT NULL "
);
if
(!
StringUtil
.
isNullOrEmpty
(
searchOperationName
))
{
sql
.
append
(
" AND top.operation_name GLOB "
+
"'*"
+
searchOperationName
+
"*'"
);
...
...
@@ -362,25 +380,4 @@ public class OperationDao extends AbstractDao {
updateNeedSyncFlg
(
operationDto
.
operationId
,
true
);
}
}
/**
* 作業種別IDで関連する作業リストを取得
* @param operationGroupMasterId
* @return
*/
public
List
<
OperationDto
>
getOperationByOperationGroupMasterId
(
Integer
operationGroupMasterId
)
{
StringBuffer
sql
=
new
StringBuffer
();
sql
.
append
(
" SELECT * "
);
sql
.
append
(
" FROM t_operation AS top"
);
// INNER JOIN r_operation_group_master_relation
sql
.
append
(
" INNER JOIN r_operation_group_master_relation AS rog"
);
sql
.
append
(
" ON rog.operation_id = top.operation_id"
);
// LEFT OUTER JOIN r_operation_content
sql
.
append
(
" LEFT OUTER JOIN r_operation_content AS rpc "
);
sql
.
append
(
" ON top.operation_id = rpc.operation_id "
);
sql
.
append
(
" AND rpc.operation_content_flg = 1 "
);
sql
.
append
(
" WHERE rog.operation_group_master_id = ?"
);
sql
.
append
(
" ORDER BY top.operation_start_date DESC, top.operation_id DESC"
);
return
rawQueryGetDtoList
(
sql
.
toString
(),
new
String
[]
{
""
+
operationGroupMasterId
},
OperationDto
.
class
);
}
}
\ No newline at end of file
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/OperationGroupMasterDao.java
View file @
55c7a54f
...
...
@@ -157,14 +157,10 @@ public class OperationGroupMasterDao extends AbstractDao {
/**
* 階層の作業種別情報取得(検索結果を元にデータ取得)
* @param searchOperationName
* @param searchStartDateStr
* @param searchEndDateStr
* @param reportTypeStr
* @param level
* @return
*/
public
List
<
OperationGroupMasterDto
>
getOperationGroupMasterListBylevel
(
String
searchOperationName
,
String
searchStartDateStr
,
String
searchEndDateStr
,
String
reportTypeStr
,
Integer
level
)
{
public
List
<
OperationGroupMasterDto
>
getOperationGroupMasterListBylevel
(
Integer
level
)
{
StringBuffer
sql
=
new
StringBuffer
();
sql
.
append
(
" SELECT M1.*, count(R1.operation_id) AS operation_count FROM m_operation_group_master AS M1"
);
sql
.
append
(
" LEFT OUTER JOIN r_operation_group_master_relation R1"
);
...
...
@@ -172,23 +168,7 @@ public class OperationGroupMasterDao extends AbstractDao {
sql
.
append
(
" AND R1.operation_id IN("
);
sql
.
append
(
" SELECT operation_id FROM t_operation top"
);
sql
.
append
(
" WHERE top.operation_id IS NOT NULL"
);
if
(!
StringUtil
.
isNullOrEmpty
(
searchOperationName
))
{
sql
.
append
(
" AND top.operation_name GLOB "
+
"'*"
+
searchOperationName
+
"*'"
);
}
if
(!
StringUtil
.
isNullOrEmpty
(
searchStartDateStr
))
{
Date
startDate
=
DateTimeUtil
.
toDate
(
searchStartDateStr
,
"UTC"
,
DateTimeFormat
.
yyyyMMdd_hyphen
);
sql
.
append
(
" AND top.operation_end_date >= '"
+
DateTimeUtil
.
toString
(
startDate
,
DateTimeFormat
.
yyyyMMdd_hyphen
)
+
"'"
);
}
if
(!
StringUtil
.
isNullOrEmpty
(
searchEndDateStr
))
{
Date
endDate
=
DateTimeUtil
.
toDate
(
searchEndDateStr
,
"UTC"
,
DateTimeFormat
.
yyyyMMdd_hyphen
);
sql
.
append
(
" AND top.operation_start_date <= '"
+
DateTimeUtil
.
toString
(
endDate
,
DateTimeFormat
.
yyyyMMdd_hyphen
)
+
"'"
);
}
if
(
reportTypeStr
!=
null
)
{
sql
.
append
(
" AND top.report_type in ("
+
reportTypeStr
+
")"
);
}
sql
.
append
(
" )"
);
sql
.
append
(
" WHERE M1.operation_group_master_level =? "
);
sql
.
append
(
" GROUP BY M1.operation_group_master_id"
);
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationGroupMasterLogic.java
View file @
55c7a54f
...
...
@@ -99,16 +99,12 @@ public class OperationGroupMasterLogic extends AbstractLogic {
/**
* 作業種別毎に作業数(子グループの作業も含む)を
* operationCountMapにセットする
* @param searchOperationName
* @param searchStartDateStr
* @param searchEndDateStr
* @param reportTypeStr
* @param level
* @param operationCountMap
*/
public
void
getAllOperationCount
(
String
searchOperationName
,
String
searchStartDateStr
,
String
searchEndDateStr
,
String
reportTypeStr
,
int
level
,
Map
<
Integer
,
Integer
>
operationCountMap
)
{
public
void
getAllOperationCount
(
int
level
,
Map
<
Integer
,
Integer
>
operationCountMap
)
{
List
<
OperationGroupMasterDto
>
operationGroupMasterDtoList
;
operationGroupMasterDtoList
=
mOperationGroupMasterDao
.
getOperationGroupMasterListBylevel
(
searchOperationName
,
searchStartDateStr
,
searchEndDateStr
,
reportTypeStr
,
level
);
operationGroupMasterDtoList
=
mOperationGroupMasterDao
.
getOperationGroupMasterListBylevel
(
level
);
// ルート階層の場合は以下の処理しない
if
(
level
>
0
&&
operationGroupMasterDtoList
!=
null
)
{
...
...
@@ -131,7 +127,7 @@ public class OperationGroupMasterLogic extends AbstractLogic {
}
}
level
--;
getAllOperationCount
(
searchOperationName
,
searchStartDateStr
,
searchEndDateStr
,
reportTypeStr
,
level
,
operationCountMap
);
// 再帰呼び出し
getAllOperationCount
(
level
,
operationCountMap
);
// 再帰呼び出し
}
}
...
...
@@ -170,6 +166,6 @@ public class OperationGroupMasterLogic extends AbstractLogic {
* @return
*/
public
List
<
OperationDto
>
getOperationByOperationGroupMasterId
(
Integer
operationGroupMasterId
)
{
return
mOperationDao
.
getOperation
ByOperation
GroupMasterId
(
operationGroupMasterId
);
return
mOperationDao
.
getOperation
sBy
GroupMasterId
(
operationGroupMasterId
);
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
View file @
55c7a54f
...
...
@@ -411,6 +411,7 @@ public class OperationListActivity extends ABVUIActivity {
mSearchButton
.
setImageDrawable
(
getRDrawable
(
R
.
drawable
.
ic_operation_search
));
setEnabledImageButton
(
mSearchButton
);
}
else
{
// 全て
cancelToolbarEnabledIcon
();
}
}
else
{
...
...
@@ -2020,8 +2021,7 @@ public class OperationListActivity extends ABVUIActivity {
Integer
lastLevel
=
mOperationGroupMasterLogic
.
getLastGroupLevel
();
operationCountMap
=
new
HashMap
<
Integer
,
Integer
>();
// 作業種別毎に作業数をMapにセット
String
reportTypeStr
=
getUserPref
(
AppDefType
.
UserPrefKey
.
OPERATION_REPORT_TYPES
,
null
);
mOperationGroupMasterLogic
.
getAllOperationCount
(
mSearchWord
,
mStartDateStr
,
mEndDateStr
,
reportTypeStr
,
lastLevel
,
operationCountMap
);
mOperationGroupMasterLogic
.
getAllOperationCount
(
lastLevel
,
operationCountMap
);
}
// 既にダイアログが存在するか、開いた状態である場合は何もしない
if
(
mShowDialog
!=
null
&&
mShowDialog
.
isShowing
())
{
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/OperationGroupMasterListHelper.java
View file @
55c7a54f
...
...
@@ -64,13 +64,8 @@ public class OperationGroupMasterListHelper extends HierarchyOperationListHelper
*/
@Override
protected
List
<
OperationDto
>
findOperationList
()
throws
Exception
{
OperationGroupMasterDto
peekOperationGroupMasterDto
=
stack
.
peek
();
String
reportTypeStr
=
getUserPref
(
mAppActivity
,
AppDefType
.
UserPrefKey
.
OPERATION_REPORT_TYPES
,
null
);
Integer
operationGroupMasterId
=
null
;
// operationGroupMasterIdのデータが存在、且つクリアフラグがfalseの場合
if
(
mOperationGroupMasterDao
.
isExistOperationGroupMaster
(
peekOperationGroupMasterDto
.
operationGroupMasterId
)
&&
!
ABVEnvironment
.
getInstance
().
getOperationGroupMasterClearFlg
())
{
operationGroupMasterId
=
peekOperationGroupMasterDto
.
operationGroupMasterId
;
}
else
{
// クリアフラグがfalseの場合
if
(
ABVEnvironment
.
getInstance
().
getOperationGroupMasterClearFlg
())
{
// 表示する作業種別が既に削除された場合、最上位階層に戻る(リセット)
popList
(
breadCrumbList
.
size
()
-
1
,
false
);
// クリアフラグをfalseにセット
...
...
@@ -78,8 +73,9 @@ public class OperationGroupMasterListHelper extends HierarchyOperationListHelper
// 作業種別の選択画面を閉じる
mAppActivity
.
closeOperationGroupMasterDialog
();
}
OperationGroupMasterDto
peekOperationGroupMasterDto
=
stack
.
peek
();
// 作業種別IDで紐づく作業リストを取得
return
mOperationGroupMasterLogic
.
getOperationByOperationGroupMasterId
(
operationGroupMasterId
);
return
mOperationGroupMasterLogic
.
getOperationByOperationGroupMasterId
(
peekOperationGroupMasterDto
.
operationGroupMasterId
);
}
/**
...
...
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