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
c524f49f
Commit
c524f49f
authored
Jan 16, 2023
by
Kazuyuki Hida
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extParamに、taskReportIdとreportStartDateを追加
parent
a4f62104
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
27 deletions
+71
-27
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/LockReportLogic.java
+46
-15
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/UnlockReportLogic.java
+25
-12
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/LockReportLogic.java
View file @
c524f49f
...
...
@@ -21,10 +21,13 @@ public class LockReportLogic extends AbstractLogic {
}
public
Result
lock
(
Map
<
String
,
String
>
param
)
{
Long
taskReportId
=
longOrNull
(
param
.
get
(
"taskReportId"
));
Date
reportStartDate
=
dateOrNull
(
param
.
get
(
"reportStartDate"
));
return
sendLockReport
(
param
.
get
(
"taskKey"
),
longOrNull
(
param
.
get
(
"taskReportId"
))
,
dateOrNull
(
param
.
get
(
"reportStartDate"
))
taskReportId
,
reportStartDate
);
}
...
...
@@ -46,19 +49,17 @@ public class LockReportLogic extends AbstractLogic {
if
(!
networkAdapter
.
isNetworkConnected
())
{
// オフラインだったら、ロック成功扱い
return
Result
.
offLine
();
return
Result
.
offLine
(
taskReportId
,
reportStartDate
);
}
try
{
LockReportJSON
reportJSON
=
client
.
sendLockReport
(
param
);
return
Result
.
succsess
(
reportJSON
);
return
Result
.
succsess
(
reportJSON
,
taskReportId
,
reportStartDate
);
}
catch
(
Throwable
e
)
{
return
Result
.
failure
(
e
);
return
Result
.
failure
(
e
,
taskReportId
,
reportStartDate
);
}
}
private
Long
longOrNull
(
String
s
)
{
try
{
return
Long
.
valueOf
(
s
);
...
...
@@ -81,7 +82,7 @@ public class LockReportLogic extends AbstractLogic {
String
message
;
ExtParam
extParam
;
static
Result
succsess
(
LockReportJSON
reportJSON
)
{
static
Result
succsess
(
LockReportJSON
reportJSON
,
Long
taskReportId
,
Date
reportStartDate
)
{
// 成功したとき
Result
result
=
new
Result
();
result
.
result
=
reportJSON
.
httpStatus
==
HTTP_OK
?
0
:
1
;
...
...
@@ -90,26 +91,43 @@ public class LockReportLogic extends AbstractLogic {
reportJSON
.
getReportStatus
(),
reportJSON
.
getReportLockUserId
(),
reportJSON
.
getReportLockUserName
(),
reportJSON
.
getReportLockTime
()
reportJSON
.
getReportLockTime
(),
taskReportId
,
reportStartDate
);
return
result
;
}
static
Result
failure
(
Throwable
e
)
{
@SuppressWarnings
(
"magic_number"
)
static
Result
failure
(
Throwable
e
,
Long
taskReportId
,
Date
reportStartDate
)
{
// 例外がでたとき
Result
result
=
new
Result
();
result
.
result
=
1
;
result
.
message
=
e
.
getLocalizedMessage
();
result
.
extParam
=
new
ExtParam
(
999
,
null
,
null
,
null
);
result
.
extParam
=
new
ExtParam
(
999
,
null
,
null
,
null
,
taskReportId
,
reportStartDate
);
return
result
;
}
static
Result
offLine
()
{
static
Result
offLine
(
Long
taskReportId
,
Date
reportStartDate
)
{
// オフラインは成功扱い
Result
result
=
new
Result
();
result
.
result
=
0
;
result
.
message
=
""
;
result
.
extParam
=
new
ExtParam
(
3
,
null
,
null
,
null
);
result
.
extParam
=
new
ExtParam
(
3
,
null
,
null
,
null
,
taskReportId
,
reportStartDate
);
return
result
;
}
...
...
@@ -131,17 +149,23 @@ public class LockReportLogic extends AbstractLogic {
String
reportLockUserId
;
String
reportLockUserName
;
Date
reportLockTime
;
Long
taskReportId
;
Date
reportStartDate
;
ExtParam
(
int
reportStatus
,
String
reportLockUserId
,
String
reportLockUserName
,
Date
reportLockTime
Date
reportLockTime
,
Long
taskReportId
,
Date
reportStartDate
)
{
this
.
reportStatus
=
reportStatus
;
this
.
reportLockUserId
=
reportLockUserId
;
this
.
reportLockUserName
=
reportLockUserName
;
this
.
reportLockTime
=
reportLockTime
;
this
.
taskReportId
=
taskReportId
;
this
.
reportStartDate
=
reportStartDate
;
}
...
...
@@ -166,7 +190,14 @@ public class LockReportLogic extends AbstractLogic {
extParam
.
put
(
"reportStatus"
,
String
.
valueOf
(
reportStatus
));
extParam
.
put
(
"reportLockUserId"
,
reportLockUserId
);
extParam
.
put
(
"reportLockUserName"
,
reportLockUserName
);
extParam
.
put
(
"reportLockTime"
,
reportLockTime
);
extParam
.
put
(
"reportLockTime"
,
DateTimeUtil
.
formatDate
(
reportLockTime
,
DateTimeFormat
.
yyyyMMddHHmmssSSS_hyphen
));
if
(
taskReportId
!=
null
&&
taskReportId
!=
0
)
{
extParam
.
put
(
"taskReportId"
,
taskReportId
);
}
if
(
reportStartDate
!=
null
)
{
extParam
.
put
(
"reportStartDate"
,
DateTimeUtil
.
formatDate
(
reportStartDate
,
DateTimeFormat
.
yyyyMMddHHmmssSSS_hyphen
));
}
return
extParam
.
toString
();
}
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/UnlockReportLogic.java
View file @
c524f49f
...
...
@@ -22,10 +22,13 @@ public class UnlockReportLogic extends AbstractLogic {
}
public
Result
unlock
(
Map
<
String
,
String
>
param
)
{
Long
taskReportId
=
longOrNull
(
param
.
get
(
"taskReportId"
));
Date
reportStartDate
=
dateOrNull
(
param
.
get
(
"reportStartDate"
));
return
sendUnlockReport
(
param
.
get
(
"taskKey"
),
longOrNull
(
param
.
get
(
"taskReportId"
))
,
dateOrNull
(
param
.
get
(
"reportStartDate"
))
taskReportId
,
reportStartDate
);
}
...
...
@@ -45,14 +48,14 @@ public class UnlockReportLogic extends AbstractLogic {
if
(!
networkAdapter
.
isNetworkConnected
())
{
// オフラインだったら、ロック成功扱い
return
Result
.
offLine
();
return
Result
.
offLine
(
taskReportId
,
reportStartDate
);
}
try
{
UnlockReportJSON
reportJSON
=
client
.
sendUnlockReport
(
param
);
return
Result
.
succsess
(
reportJSON
);
return
Result
.
succsess
(
reportJSON
,
taskReportId
,
reportStartDate
);
}
catch
(
Exception
e
)
{
return
Result
.
failure
(
e
);
return
Result
.
failure
(
e
,
taskReportId
,
reportStartDate
);
}
}
...
...
@@ -78,30 +81,30 @@ public class UnlockReportLogic extends AbstractLogic {
String
message
;
ExtParam
extParam
;
static
Result
succsess
(
UnlockReportJSON
reportJSON
)
{
static
Result
succsess
(
UnlockReportJSON
reportJSON
,
Long
taskReportId
,
Date
reportStartDate
)
{
// 成功したとき
Result
result
=
new
Result
();
result
.
result
=
reportJSON
.
httpStatus
==
HTTP_OK
?
0
:
1
;
result
.
message
=
""
;
result
.
extParam
=
new
ExtParam
(
reportJSON
.
getReportStatus
());
result
.
extParam
=
new
ExtParam
(
reportJSON
.
getReportStatus
()
,
taskReportId
,
reportStartDate
);
return
result
;
}
static
Result
failure
(
Throwable
e
)
{
static
Result
failure
(
Throwable
e
,
Long
taskReportId
,
Date
reportStartDate
)
{
// 例外がでたとき
Result
result
=
new
Result
();
result
.
result
=
1
;
result
.
message
=
e
.
getLocalizedMessage
();
result
.
extParam
=
new
ExtParam
(
999
);
result
.
extParam
=
new
ExtParam
(
999
,
taskReportId
,
reportStartDate
);
return
result
;
}
static
Result
offLine
()
{
static
Result
offLine
(
Long
taskReportId
,
Date
reportStartDate
)
{
// オフラインは成功扱い
Result
result
=
new
Result
();
result
.
result
=
0
;
result
.
message
=
""
;
result
.
extParam
=
new
ExtParam
(
3
);
result
.
extParam
=
new
ExtParam
(
3
,
taskReportId
,
reportStartDate
);
return
result
;
}
...
...
@@ -120,9 +123,13 @@ public class UnlockReportLogic extends AbstractLogic {
public
static
class
ExtParam
{
int
reportStatus
;
Long
taskReportId
;
Date
reportStartDate
;
ExtParam
(
int
reportStatus
)
{
ExtParam
(
int
reportStatus
,
Long
taskReportId
,
Date
reportStartDate
)
{
this
.
reportStatus
=
reportStatus
;
this
.
taskReportId
=
taskReportId
;
this
.
reportStartDate
=
reportStartDate
;
}
public
int
getReportStatus
()
{
...
...
@@ -132,6 +139,12 @@ public class UnlockReportLogic extends AbstractLogic {
public
String
json
()
{
JSONObject
extParam
=
new
JSONObject
();
extParam
.
put
(
"reportStatus"
,
String
.
valueOf
(
reportStatus
));
if
(
taskReportId
!=
null
&&
taskReportId
!=
0
)
{
extParam
.
put
(
"taskReportId"
,
taskReportId
);
}
if
(
reportStartDate
!=
null
)
{
extParam
.
put
(
"reportStartDate"
,
DateTimeUtil
.
formatDate
(
reportStartDate
,
DateTimeFormat
.
yyyyMMddHHmmssSSS_hyphen
));
}
return
extParam
.
toString
();
}
}
...
...
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