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
2044e9c0
Commit
2044e9c0
authored
Oct 15, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'features/1.4.100_develop_mk' into 'features/1.4.201'
課題票75,110対応 See merge request
!238
parents
47084337
1e9de99e
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
920 additions
and
602 deletions
+920
-602
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/OperationDao.java
+1
-1
ABVJE_Launcher_Android/assets/check
+1
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVAuthenticatedActivity.java
+436
-29
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
+447
-445
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVUIActivity.java
+29
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/constant/ErrorCode.java
+1
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
+4
-125
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/ContentViewActivity.java
+1
-1
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/OperationDao.java
View file @
2044e9c0
...
...
@@ -130,7 +130,7 @@ public class OperationDao extends AbstractDao {
dto
.
permitCodeRequiredFlg
=
cursor
.
getInt
(
column
);
}
column
=
cursor
.
getColumnIndex
(
"display_permission_flg
"
);
column
=
cursor
.
getColumnIndex
(
"display_permission_flg"
);
if
(
column
!=
-
1
)
{
dto
.
displayPermissionFlg
=
cursor
.
getInt
(
column
);
}
...
...
check
@
4b07d503
Subproject commit
89f7f804a54cf4890189864d9384f6b3de21ccb4
Subproject commit
4b07d503bb21575b86ecea757fd8ca4323806371
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVAuthenticatedActivity.java
View file @
2044e9c0
...
...
@@ -2,6 +2,7 @@ package jp.agentec.abook.abv.ui.common.activity;
import
android.app.Activity
;
import
android.app.Dialog
;
import
android.app.ProgressDialog
;
import
android.content.ActivityNotFoundException
;
import
android.content.Context
;
import
android.content.DialogInterface
;
...
...
@@ -28,17 +29,28 @@ import android.widget.Toast;
import
com.google.firebase.iid.FirebaseInstanceId
;
import
net.lingala.zip4j.exception.ZipException
;
import
org.json.adf.JSONObject
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.nio.charset.StandardCharsets
;
import
java.security.NoSuchAlgorithmException
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
jp.agentec.abook.abv.bl.acms.client.AcmsClient
;
import
jp.agentec.abook.abv.bl.acms.client.json.DownloadedContentInfoJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters
;
import
jp.agentec.abook.abv.bl.acms.type.DownloadStatusType
;
import
jp.agentec.abook.abv.bl.common.ABVEnvironment
;
import
jp.agentec.abook.abv.bl.common.Callback
;
import
jp.agentec.abook.abv.bl.common.CommonExecutor
;
import
jp.agentec.abook.abv.bl.common.Constant
;
import
jp.agentec.abook.abv.bl.common.Constant.AlertMessageLevel
;
...
...
@@ -54,20 +66,29 @@ import jp.agentec.abook.abv.bl.common.util.ContentFileUtil;
import
jp.agentec.abook.abv.bl.data.ABVDataCache
;
import
jp.agentec.abook.abv.bl.data.dao.AbstractDao
;
import
jp.agentec.abook.abv.bl.data.dao.ContentDao
;
import
jp.agentec.abook.abv.bl.data.dao.OperationContentDao
;
import
jp.agentec.abook.abv.bl.data.dao.OperationDao
;
import
jp.agentec.abook.abv.bl.data.dao.TaskDao
;
import
jp.agentec.abook.abv.bl.data.dao.TaskReportDao
;
import
jp.agentec.abook.abv.bl.download.ContentDownloadListener
;
import
jp.agentec.abook.abv.bl.download.ContentDownloader
;
import
jp.agentec.abook.abv.bl.download.ContentFileExtractor
;
import
jp.agentec.abook.abv.bl.download.ContentRefresher
;
import
jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification
;
import
jp.agentec.abook.abv.bl.dto.ContentDto
;
import
jp.agentec.abook.abv.bl.dto.FixPushMessageDto
;
import
jp.agentec.abook.abv.bl.dto.OperationContentDto
;
import
jp.agentec.abook.abv.bl.dto.OperationDto
;
import
jp.agentec.abook.abv.bl.dto.PushMessageDto
;
import
jp.agentec.abook.abv.bl.dto.TaskDto
;
import
jp.agentec.abook.abv.bl.dto.TaskReportDto
;
import
jp.agentec.abook.abv.bl.logic.AbstractLogic
;
import
jp.agentec.abook.abv.bl.logic.BookmarkLogic
;
import
jp.agentec.abook.abv.bl.logic.CommunicationLogic
;
import
jp.agentec.abook.abv.bl.logic.ContractLogic
;
import
jp.agentec.abook.abv.bl.logic.MemoLogic
;
import
jp.agentec.abook.abv.bl.logic.OperationGroupMasterLogic
;
import
jp.agentec.abook.abv.bl.logic.OperationLogic
;
import
jp.agentec.abook.abv.bl.logic.PushMessageLogic
;
import
jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic
;
import
jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler
;
...
...
@@ -105,13 +126,13 @@ import jp.agentec.abook.abv.ui.home.helper.ContentViewHelper;
import
jp.agentec.adf.net.http.HttpDownloadSimpleNotification
;
import
jp.agentec.adf.util.DateTimeFormat
;
import
jp.agentec.adf.util.DateTimeUtil
;
import
jp.agentec.adf.util.FileUtil
;
import
jp.agentec.adf.util.StringUtil
;
public
abstract
class
ABVAuthenticatedActivity
extends
ABVActivity
implements
ContentDownloadListener
{
private
final
static
String
TAG
=
"ABVAuthenticatedActivity"
;
public
static
final
String
FILEPATH
=
"FILEPATH"
;
//連続タップ防止用のボタン活性化するタイム
protected
static
final
int
BUTTON_ENABLE_DELAY_MILLIS
=
500
;
...
...
@@ -143,11 +164,19 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
protected
PushMessageListAdapter
mPushMessageListAdapter
;
protected
ListView
mFixPushMessageListView
;
protected
Dialog
mPushMessageSendDialog
;
protected
ImageButton
communicationButton
;
// コミュニケーションボタン
protected
ImageButton
communicationButton
;
// コミュニケーションボタン
protected
int
mSelectedFixPuchMessagePosition
;
protected
int
mSendType
;
protected
PushMessageLogic
pushMessageLogic
=
AbstractLogic
.
getLogic
(
PushMessageLogic
.
class
);
protected
TaskReportDao
mTaskReportDao
=
AbstractDao
.
getDao
(
TaskReportDao
.
class
);
protected
OperationLogic
mOperationLogic
=
AbstractLogic
.
getLogic
(
OperationLogic
.
class
);
protected
OperationGroupMasterLogic
mOperationGroupMasterLogic
=
AbstractLogic
.
getLogic
(
OperationGroupMasterLogic
.
class
);
protected
PushMessageLogic
mPushMessageLogic
=
AbstractLogic
.
getLogic
(
PushMessageLogic
.
class
);
protected
Date
mOperationLastEditDate
;
protected
OperationDao
mOperationDao
=
AbstractDao
.
getDao
(
OperationDao
.
class
);
protected
OperationContentDao
mOperationContentDao
=
AbstractDao
.
getDao
(
OperationContentDao
.
class
);
protected
TaskDao
mTaskDao
=
AbstractDao
.
getDao
(
TaskDao
.
class
);
/**
* メッセージ表示タイプ
*/
...
...
@@ -165,6 +194,8 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
int
CHANGED_META_INFO
=
2
;
int
PAYMENT
=
3
;
}
private
int
DEFAULT_VALUE_ZERO
=
0
;
private
boolean
DEFAULT_VALUE_FALSE
=
false
;
// 遷移元のアクティビティ名
// PushMessage受信時に直接ChatRoomへ行かずに、ひとつまえのActivityに戻る為に使用する。
...
...
@@ -180,7 +211,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
private
void
sendRegistrationIdToCMS
()
{
// Tokenが更新されたか確認
if
(!
PreferenceUtil
.
getUserPref
(
this
,
UserPrefKey
.
NEED_SEND_TOKEN
,
false
)){
if
(!
PreferenceUtil
.
getUserPref
(
this
,
UserPrefKey
.
NEED_SEND_TOKEN
,
DEFAULT_VALUE_FALSE
)){
// 更新されてない
return
;
}
...
...
@@ -940,7 +971,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
TextView
operationSelect
=
(
TextView
)
mOperationSelectDialog
.
findViewById
(
R
.
id
.
tv_toolbar_title
);
operationSelect
.
setText
(
PatternStringUtil
.
patternToInt
(
getApplicationContext
(),
R
.
string
.
operation_select
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
)));
mOperationSelectDialog
.
findViewById
(
R
.
id
.
close_btn
).
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
...
...
@@ -1039,7 +1070,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用
titleTextView
.
setText
(
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
push_message_list
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
)));
}
else
{
mPushMessageListView
.
setVisibility
(
View
.
GONE
);
mPushMessageListDialog
.
findViewById
(
R
.
id
.
close_btn
).
setVisibility
(
View
.
VISIBLE
);
...
...
@@ -1048,7 +1079,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用
titleTextView
.
setText
(
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
title_message_detail
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
)));
}
}
...
...
@@ -1112,7 +1143,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用
messageTitleTextView
.
setText
(
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
free_input
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
))
+
" > "
);
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
))
+
" > "
);
TextView
tvOperationName
=
(
TextView
)
mPushMessageSendDialog
.
findViewById
(
R
.
id
.
operation_name
);
tvOperationName
.
setText
(
operationDto
.
operationName
);
...
...
@@ -1157,7 +1188,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用
ABVToastUtil
.
showMakeText
(
this
,
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
push_message_input_null
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)),
Toast
.
LENGTH_SHORT
);
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
)),
Toast
.
LENGTH_SHORT
);
return
;
}
byte
[]
messageByte
=
message
.
getBytes
(
StandardCharsets
.
UTF_8
);
...
...
@@ -1165,14 +1196,14 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用
ABVToastUtil
.
showMakeText
(
this
,
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
push_message_input_over
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)),
Toast
.
LENGTH_SHORT
);
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
)),
Toast
.
LENGTH_SHORT
);
return
;
}
// リソースパターンの適用
ProgressDialogHelper
.
showProgressPopup
(
this
,
true
,
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
file_initialization
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
)));
try
{
boolean
result
=
pushMessageLogic
.
sendPushMessageRequest
(
mSendType
,
message
,
operationId
);
if
(
result
)
{
...
...
@@ -1180,19 +1211,19 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用
ABVToastUtil
.
showMakeText
(
this
,
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
push_message_send_success
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)),
Toast
.
LENGTH_SHORT
);
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
)),
Toast
.
LENGTH_SHORT
);
}
else
{
// リソースパターンの適用
ABVToastUtil
.
showMakeText
(
this
,
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
push_message_send_fail
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)),
Toast
.
LENGTH_SHORT
);
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
)),
Toast
.
LENGTH_SHORT
);
}
}
catch
(
Exception
e
)
{
Logger
.
e
(
TAG
,
e
);
// リソースパターンの適用
ABVToastUtil
.
showMakeText
(
this
,
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
push_message_send_fail
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)),
Toast
.
LENGTH_SHORT
);
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
)),
Toast
.
LENGTH_SHORT
);
}
finally
{
ProgressDialogHelper
.
closeProgressPopup
();
}
...
...
@@ -1209,14 +1240,14 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用
ProgressDialogHelper
.
showProgressPopup
(
this
,
true
,
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
file_initialization
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
)));
try
{
List
<
FixPushMessageDto
>
fixPushMessageList
=
pushMessageLogic
.
getFixPushMessage
();
FixPushMessageDto
dto
=
new
FixPushMessageDto
();
// リソースパターンの適用
dto
.
name
=
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
free_input
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
));
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
));
fixPushMessageList
.
add
(
0
,
dto
);
mFixPushMessageListView
.
setAdapter
(
new
FixPushMessageAdapter
(
this
,
fixPushMessageList
,
mSelectedFixPuchMessagePosition
));
mFixPushMessageListView
.
invalidate
();
...
...
@@ -1243,7 +1274,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用
ABVToastUtil
.
showMakeText
(
this
,
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
respons_fix_push_message_fail
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)),
Toast
.
LENGTH_SHORT
);
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
)),
Toast
.
LENGTH_SHORT
);
}
finally
{
ProgressDialogHelper
.
closeProgressPopup
();
}
...
...
@@ -1273,6 +1304,292 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
}
/**
* 作業データ更新処理
* @param operationId 作業ID
* @param reportType 作業タイプ
* @param buttonEventFlag ボタンイベントフラグ
* @return エラー文言
*/
public
String
syncOperation
(
final
long
operationId
,
int
reportType
,
boolean
buttonEventFlag
)
{
final
StringBuilder
errorMsg
=
new
StringBuilder
();
try
{
//コンテンツダウンロード関連プログレスバー値設定
progressDialogHorizontal
.
setProgress
(
20
);
final
Callback
progressCallback
=
new
Callback
()
{
@Override
public
Object
callback
(
Object
ret
)
{
final
int
progress
=
(
int
)
ret
;
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
progressDialogHorizontal
.
setProgress
(
progressDialogHorizontal
.
getProgress
()
+
progress
);
}
});
return
null
;
}
};
// 報告送信
mOperationLogic
.
sendTaskReportSendData
(
operationId
,
progressCallback
);
//工程全削除の送信(連続作業)
if
(
reportType
==
Constant
.
ReportType
.
ReportContinuous
)
{
if
(!
mOperationLogic
.
deleteProcess
(
operationId
))
{
//工程全削除送信失敗時
return
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
msg_error_all_process_delete
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
));
}
}
progressDialogHorizontal
.
setProgress
(
60
);
// 報告受信
mOperationLastEditDate
=
receptionTaskData
(
operationId
,
progressCallback
,
errorMsg
);
//連続作業のみ承認データ取得
if
(
reportType
==
Constant
.
ReportType
.
ReportContinuous
)
{
mOperationLogic
.
getProcessData
(
operationId
);
}
// mOperationLastEditDateがnullの場合、エラーと見做す
if
(
mOperationLastEditDate
!=
null
&&
reportType
==
Constant
.
ReportType
.
RoutineTask
)
{
if
(
buttonEventFlag
)
{
String
dialogMsg
=
null
;
// 定期点検の利用可能日付を取得
String
avilableDateStr
=
mOperationLogic
.
getRoutineTaskOperationAvailableDateStr
(
operationId
);
if
(!
StringUtil
.
isNullOrEmpty
(
avilableDateStr
))
{
// 利用可能メッセージ
// リソースパターンの適用
dialogMsg
=
String
.
format
(
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
msg_routineTask_report_available_from
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
)),
avilableDateStr
);
}
else
if
(!
mTaskReportDao
.
existsToDoRoutineTaskReportData
(
operationId
))
{
// 作業データが存在しないメッセージ
dialogMsg
=
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
msg_no_report_data
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
));
}
if
(!
StringUtil
.
isNullOrEmpty
(
dialogMsg
))
{
errorMsg
.
append
(
dialogMsg
);
}
}
putUserPref
(
String
.
format
(
AppDefType
.
UserPrefKey
.
SYNCED_OPERATION_ID
,
operationId
),
DateTimeUtil
.
toString
(
DateTimeUtil
.
getCurrentSqlDate
(),
DateTimeFormat
.
yyyyMMdd_none
));
}
}
catch
(
AcmsException
e
)
{
//noinspection EnumSwitchStatementWhichMissesCases
switch
(
e
.
getCode
())
{
case
P_E_ACMS_P003:
// リソースパターンを適用
errorMsg
.
append
(
getString
(
PatternStringUtil
.
patternToInt
(
getApplicationContext
(),
R
.
string
.
P003
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
))));
break
;
case
P_E_ACMS_P004:
errorMsg
.
append
(
getString
(
PatternStringUtil
.
patternToInt
(
getApplicationContext
(),
R
.
string
.
P004
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
))));
break
;
case
P_E_ACMS_P005:
errorMsg
.
append
(
getString
(
PatternStringUtil
.
patternToInt
(
getApplicationContext
(),
R
.
string
.
P005
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
))));
break
;
case
P_E_ACMS_P006:
errorMsg
.
append
(
getString
(
PatternStringUtil
.
patternToInt
(
getApplicationContext
(),
R
.
string
.
P006
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
))));
break
;
default
:
Logger
.
e
(
TAG
,
"syncOperation"
,
e
);
errorMsg
.
append
(
ErrorMessage
.
getErrorMessage
(
this
,
ErrorMessage
.
getErrorCode
(
e
)));
break
;
}
mOperationLastEditDate
=
null
;
}
catch
(
Exception
e
)
{
Logger
.
e
(
TAG
,
e
);
errorMsg
.
append
(
ErrorMessage
.
getErrorMessage
(
this
,
ABVExceptionCode
.
C_E_SYSTEM_0001
));
mOperationLastEditDate
=
null
;
}
finally
{
handler
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
mOperationLastEditDate
!=
null
)
{
mOperationLogic
.
finishedSyncOperation
(
operationId
,
mOperationLastEditDate
);
progressDialogHorizontal
.
setProgress
(
100
);
}
mOperationLastEditDate
=
null
;
//screenRefresh();
closeProgressPopup
();
}
});
}
return
errorMsg
.
length
()
>
0
?
errorMsg
.
toString
()
:
null
;
}
/**
* 作業データ受信
* @param operationId
* @param progressCallback
* @return
* @throws NetworkDisconnectedException
* @throws ABVException
* @throws IOException
* @throws InterruptedException
* @throws NoSuchAlgorithmException
* @throws ZipException
*/
public
Date
receptionTaskData
(
long
operationId
,
Callback
progressCallback
,
StringBuilder
errorMsg
)
throws
NetworkDisconnectedException
,
ABVException
,
IOException
,
InterruptedException
,
NoSuchAlgorithmException
,
ZipException
{
GetOperationDataParameters
param
=
new
GetOperationDataParameters
(
ABVDataCache
.
getInstance
().
getMemberInfo
().
sid
,
operationId
);
OperationDto
operationDto
=
mOperationLogic
.
getOperation
(
operationId
);
OperationContentDto
operationContentDto
=
mOperationContentDao
.
getOperationMainContent
(
operationId
);
List
<
TaskDto
>
localTaskList
=
mTaskDao
.
selectAllTaskByOperationId
(
operationId
);
Date
lastEditDate
;
OperationDataJSON
json
=
AcmsClient
.
getInstance
(
ABVDataCache
.
getInstance
().
getUrlPath
(),
ABVEnvironment
.
getInstance
().
networkAdapter
).
getOpereationData
(
param
);
//プログレスを40%進行させるための計算
int
progress
=
0
;
if
(
json
.
taskDtoList
.
size
()
!=
0
)
{
progress
=
40
/
json
.
taskDtoList
.
size
();
}
boolean
isRoutineTask
=
operationDto
.
reportType
==
Constant
.
ReportType
.
RoutineTask
;
for
(
TaskDto
serverTaskDto
:
json
.
taskDtoList
)
{
List
<
TaskReportDto
>
localTaskReportList
=
mTaskReportDao
.
getTaskReportListByTaskKey
(
serverTaskDto
.
taskKey
);
for
(
TaskReportDto
localTaskReportDto
:
localTaskReportList
)
{
if
(!
isExistsTaskReportInList
(
serverTaskDto
.
taskReportDtoList
,
localTaskReportDto
,
isRoutineTask
))
{
if
(
isRoutineTask
)
{
mOperationLogic
.
deleteRoutineTaskReport
(
operationId
,
operationContentDto
.
contentId
,
localTaskReportDto
);
}
else
{
// taskDtoが存在するとtaskReportLevel 0 (作業報告)が存在しないことはないので、報告(回答)のみチェックして削除
if
(
localTaskReportDto
.
taskReportLevel
!=
Constant
.
TaskReportLevel
.
ReportType
)
{
// 作業報告のディレクトリ削除
mOperationLogic
.
deleteTaskFileData
(
operationId
,
operationContentDto
.
contentId
,
serverTaskDto
.
taskKey
,
localTaskReportDto
.
taskReportLevel
);
mTaskReportDao
.
delete
(
localTaskReportDto
);
}
}
}
}
if
(
isExistsTaskInList
(
localTaskList
,
serverTaskDto
))
{
// 作業の報告更新
mTaskDao
.
update
(
serverTaskDto
);
localTaskList
.
remove
(
serverTaskDto
);
}
else
{
// 作業の報告登録
mTaskDao
.
insert
(
serverTaskDto
);
}
// サーバーからの情報で更新
for
(
TaskReportDto
serverTaskReportDto
:
serverTaskDto
.
taskReportDtoList
)
{
String
attachedFileName
=
serverTaskReportDto
.
attachedFileName
;
TaskReportDto
localTaskReportDto
;
if
(
operationDto
.
reportType
==
Constant
.
ReportType
.
RoutineTask
)
{
localTaskReportDto
=
mTaskReportDao
.
getRoutineTaskReportUtc
(
serverTaskReportDto
.
taskKey
,
serverTaskReportDto
.
taskReportId
,
DateTimeUtil
.
toString
(
serverTaskReportDto
.
reportStartDate
,
DateTimeFormat
.
yyyyMMddHHmmss_hyphen
));
}
else
{
localTaskReportDto
=
mTaskReportDao
.
selectByTaskKey
(
serverTaskReportDto
.
taskKey
,
serverTaskReportDto
.
taskReportLevel
);
}
if
(
localTaskReportDto
!=
null
&&
localTaskReportDto
.
localSavedFlg
)
{
// 一時保存フラグがtrueで定期点検且つ点検後修正不可の場合、添付ファイル(作業報告のディレクトリ)を削除して、localSavedFlgをfalseに変更
if
(
operationDto
.
reportType
==
Constant
.
ReportType
.
RoutineTask
&&
operationDto
.
enableReportUpdate
==
Constant
.
EnableReportUpdate
.
NO
)
{
// 作業報告のディレクトリ削除
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getTempTaskDirPath
(
operationContentDto
.
contentId
,
localTaskReportDto
.
taskKey
));
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
localTaskReportDto
.
taskKey
,
localTaskReportDto
.
taskReportId
,
DateTimeUtil
.
toString_yyyyMMddHHmmss_none
(
localTaskReportDto
.
reportStartDate
)));
localTaskReportDto
.
localSavedFlg
=
false
;
}
else
{
// 一時保存フラグがtureだと何もしない
continue
;
}
}
if
(
operationDto
.
reportType
==
Constant
.
ReportType
.
RoutineTask
)
{
serverTaskReportDto
.
taskKey
=
serverTaskDto
.
taskKey
;
// 添付ファイルが存在する場合、取得して解凍する。
try
{
refreshRoutineTaskFile
(
operationId
,
operationContentDto
.
contentId
,
serverTaskDto
.
taskId
,
serverTaskDto
.
taskKey
,
serverTaskReportDto
.
taskReportId
,
serverTaskReportDto
.
taskReportInfoId
,
serverTaskReportDto
.
reportStartDate
,
attachedFileName
);
}
catch
(
Exception
e
)
{
Logger
.
e
(
TAG
,
e
);
// リソースパターンの適用
errorMsg
.
append
(
getString
(
PatternStringUtil
.
patternToInt
(
getApplicationContext
(),
R
.
string
.
msg_error_task_report_receiving_failed
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
))));
return
null
;
}
if
(
localTaskReportDto
!=
null
)
{
// 報告データが存在すると作業報告を更新する
mOperationLogic
.
updateRoutineTaskReport
(
serverTaskDto
.
operationId
,
operationContentDto
.
contentId
,
serverTaskReportDto
,
false
,
false
,
localTaskReportDto
.
localSavedFlg
);
}
else
{
mOperationLogic
.
insertRoutineTaskReport
(
serverTaskDto
.
operationId
,
operationContentDto
.
contentId
,
serverTaskReportDto
,
false
,
false
);
}
}
else
{
JSONObject
taskReportJson
=
null
;
// 添付ファイルが存在する場合、取得して解凍する。
try
{
refreshTaskFile
(
operationId
,
serverTaskReportDto
.
taskReportLevel
,
operationContentDto
.
contentId
,
serverTaskDto
.
taskId
,
serverTaskDto
.
taskKey
,
serverTaskReportDto
.
attachedFileName
,
serverTaskDto
.
processKey
,
serverTaskDto
.
phaseNo
);
}
catch
(
Exception
e
)
{
Logger
.
e
(
TAG
,
e
);
// リソースパターンの適用
errorMsg
.
append
(
getString
(
PatternStringUtil
.
patternToInt
(
getApplicationContext
(),
R
.
string
.
msg_error_task_report_receiving_failed
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
))));
return
null
;
}
if
(!
serverTaskReportDto
.
jsonData
.
isEmpty
())
{
taskReportJson
=
new
JSONObject
(
serverTaskReportDto
.
jsonData
);
if
(
serverTaskReportDto
.
taskReportLevel
==
Constant
.
TaskReportLevel
.
ReportType
)
{
taskReportJson
.
put
(
ABookKeys
.
TASK_STATUS
,
serverTaskDto
.
taskStatus
);
}
}
if
(
localTaskReportDto
==
null
)
{
// 登録
mOperationLogic
.
insertTaskReport
(
serverTaskDto
.
taskKey
,
operationId
,
operationContentDto
.
contentId
,
serverTaskReportDto
.
taskReportLevel
,
serverTaskReportDto
.
enableReport
,
taskReportJson
,
attachedFileName
,
false
,
false
,
false
,
serverTaskDto
.
processKey
,
serverTaskDto
.
phaseNo
);
}
else
{
// 更新
// jsonDataが空で入る場合、taskReportJsonをnullで登録
mOperationLogic
.
updateTaskReport
(
serverTaskDto
.
taskKey
,
operationId
,
operationContentDto
.
contentId
,
serverTaskReportDto
.
taskReportLevel
,
serverTaskReportDto
.
enableReport
,
taskReportJson
,
attachedFileName
,
false
,
false
,
localTaskReportDto
.
localSavedFlg
,
serverTaskDto
.
processKey
,
serverTaskDto
.
phaseNo
);
}
}
}
if
(
progressCallback
!=
null
)
{
progressCallback
.
callback
(
new
Integer
(
progress
));
}
}
// サーバーから取得した作業情報がローカルに存在しないので削除する
for
(
TaskDto
taskDto
:
localTaskList
)
{
mOperationLogic
.
deleteTaskFileData
(
operationId
,
operationContentDto
.
contentId
,
taskDto
.
taskKey
,
Constant
.
TaskReportLevel
.
ReportType
);
mTaskDao
.
delete
(
taskDto
);
}
lastEditDate
=
json
.
lastEditDate
;
if
(
progressCallback
!=
null
)
{
progressCallback
.
callback
(
new
Integer
(
40
));
}
return
lastEditDate
;
}
/**
* 報告存在チェック
* @param listDto
* @param rDto
* @return
*/
protected
boolean
isExistsTaskReportInList
(
List
<
TaskReportDto
>
listDto
,
TaskReportDto
rDto
,
boolean
isRoutineTask
)
{
for
(
TaskReportDto
lDto
:
listDto
)
{
if
(
isRoutineTask
)
{
// 定期点検の場合、taskKey,taskReportId,reportStartDateで判定
if
(
lDto
.
taskKey
.
equals
(
rDto
.
taskKey
)
&&
lDto
.
taskReportId
==
rDto
.
taskReportId
&&
lDto
.
reportStartDate
.
equals
(
rDto
.
reportStartDate
))
{
return
true
;
}
}
else
{
// taskKeyと作業報告階層で判定
if
(
lDto
.
taskKey
.
equals
(
rDto
.
taskKey
)
&&
lDto
.
taskReportLevel
==
rDto
.
taskReportLevel
)
{
return
true
;
}
}
}
return
false
;
}
/**
* プッシュメッセージがあるので、チャットルームに遷移する。
*/
public
boolean
goChatRoom
(
final
Intent
intent
,
final
String
targetActivityName
,
final
String
baseActivityName
)
{
...
...
@@ -1283,20 +1600,20 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
@Override
public
void
run
()
{
if
(
StringUtil
.
isNullOrEmpty
(
intent
.
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
collaborationType
)))
{
ActivityHandlingHelper
.
getInstance
().
startChatWebViewActivity
(
intent
.
getLongExtra
(
AppDefType
.
ChatPushMessageKey
.
roomId
,
'0'
),
intent
.
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
roomName
),
targetActivityName
,
baseActivityName
);
ActivityHandlingHelper
.
getInstance
().
startChatWebViewActivity
(
intent
.
getLongExtra
(
AppDefType
.
ChatPushMessageKey
.
roomId
,
'0'
),
intent
.
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
roomName
),
targetActivityName
,
baseActivityName
);
}
else
{
// roomTypeと、collaborationType が存在する場合は、協業を開始する。
ActivityHandlingHelper
.
getInstance
().
startChatWebViewActivityWithCollaboration
(
intent
.
getLongExtra
(
AppDefType
.
ChatPushMessageKey
.
roomId
,
'0'
),
intent
.
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
roomName
),
intent
.
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
collaborationType
),
intent
.
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
roomType
),
targetActivityName
,
baseActivityName
);
// roomTypeと、collaborationType が存在する場合は、協業を開始する。
ActivityHandlingHelper
.
getInstance
().
startChatWebViewActivityWithCollaboration
(
intent
.
getLongExtra
(
AppDefType
.
ChatPushMessageKey
.
roomId
,
'0'
),
intent
.
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
roomName
),
intent
.
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
collaborationType
),
intent
.
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
roomType
),
targetActivityName
,
baseActivityName
);
}
}
},
500
);
...
...
@@ -1307,6 +1624,96 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
}
/**
* listDtoの中に第2引数のdtoが存在するかチェックメソッド
* @param listDto リストDto
* @param dto ターゲットDto
* @return
*/
protected
boolean
isExistsTaskInList
(
List
<
TaskDto
>
listDto
,
TaskDto
dto
)
{
for
(
TaskDto
lDto
:
listDto
)
{
if
(
lDto
.
taskKey
.
equals
(
dto
.
taskKey
))
{
return
true
;
}
}
return
false
;
}
/**
* 定期点検用ファイル更新
* @param operationId
* @param contentId
* @param taskId
* @param taskKey
* @param taskReportId
* @param reportStartDate
* @param reportAttachedFileName
* @throws ABVException
* @throws InterruptedException
* @throws ZipException
* @throws NoSuchAlgorithmException
* @throws IOException
*/
public
void
refreshRoutineTaskFile
(
final
long
operationId
,
final
long
contentId
,
final
long
taskId
,
final
String
taskKey
,
final
int
taskReportId
,
final
int
taskReportInfoId
,
final
Date
reportStartDate
,
final
String
reportAttachedFileName
)
throws
Exception
{
String
reportStartDateHypn
=
DateTimeUtil
.
toString
(
reportStartDate
,
DateTimeFormat
.
yyyyMMddHHmmss_hyphen
);
final
String
reportStartDateNone
=
DateTimeUtil
.
toString_yyyyMMddHHmmss_none
(
reportStartDate
);
// 既存の添付ディレクトリ削除
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getTempTaskDirPath
(
contentId
,
taskKey
));
String
reportLocalAttachedFileName
=
mTaskReportDao
.
getRoutineTaskReportAttachedFileName
(
taskKey
,
taskReportId
,
reportStartDateHypn
);
boolean
getReportFileFlg
=
!
StringUtil
.
isNullOrEmpty
(
reportAttachedFileName
)
&&
!
reportAttachedFileName
.
equals
(
reportLocalAttachedFileName
);
if
(
getReportFileFlg
)
{
Logger
.
i
(
TAG
,
"[Get Task Report Files] operationId=%s, taskKey=%s, taskId=%s, attachedFileName=%s"
,
operationId
,
taskKey
,
taskId
,
reportAttachedFileName
);
// #32926 start
int
taskReportLevel
=
0
;
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
reportStartDateNone
));
// #32926 end
String
outputFilePath
=
mOperationLogic
.
getRoutineTaskReportFile
(
operationId
,
taskKey
,
taskId
,
taskReportId
,
taskReportInfoId
,
reportStartDateNone
,
reportAttachedFileName
);
// #32926 start
ContentFileExtractor
.
getInstance
().
extractZipFile
(
contentId
,
outputFilePath
,
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
reportStartDateNone
),
null
,
true
);
// #32926 end
}
}
/**
* 添付ファイルが存在する場合、取得して解凍する。
* @param operationId
* @param taskReportLevel
* @param contentId
* @param taskId
* @param taskKey
* @param attachedFileName
* @param processKey 固定キー
* @param phaseNo 固定NO
* @throws ABVException
* @throws InterruptedException
* @throws ZipException
* @throws NoSuchAlgorithmException
* @throws IOException
*/
protected
void
refreshTaskFile
(
final
long
operationId
,
final
int
taskReportLevel
,
long
contentId
,
final
long
taskId
,
final
String
taskKey
,
final
String
attachedFileName
,
final
String
processKey
,
final
Integer
phaseNo
)
throws
Exception
{
// 既存の添付ディレクトリ削除
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getTempTaskDirPath
(
contentId
,
taskKey
));
String
reportLocalAttachedFileName
=
mTaskReportDao
.
getTaskReportAttachedFileName
(
taskKey
,
taskReportLevel
);
if
(
attachedFileName
!=
null
&&
!
attachedFileName
.
equals
(
reportLocalAttachedFileName
))
{
Logger
.
i
(
TAG
,
"[Get Task Report Files] operationId=%s, taskKey=%s, taskId=%s, attachedFileName=%s"
,
operationId
,
taskKey
,
taskId
,
attachedFileName
);
// #32926 start
String
saveAttacedFilePath
=
ABVEnvironment
.
getInstance
().
getOperationTaskReportLevelDirPath
(
operationId
,
taskKey
,
taskReportLevel
);
if
(
processKey
!=
null
&&
phaseNo
!=
0
)
{
saveAttacedFilePath
=
ABVEnvironment
.
getInstance
().
getOperationDirectionOrContinuousReportDirPath
(
operationId
,
taskKey
,
taskReportLevel
,
processKey
,
phaseNo
);
}
FileUtil
.
delete
(
saveAttacedFilePath
);
// #32926 end
String
outputFilePath
=
mOperationLogic
.
getTaskFile
(
operationId
,
taskKey
,
taskId
,
attachedFileName
,
taskReportLevel
);
ContentFileExtractor
.
getInstance
().
extractZipFile
(
contentId
,
outputFilePath
,
saveAttacedFilePath
,
null
,
true
);
}
}
/**
* プッシュメッセージ受信後のダイアログを表示する。
* @param context コンテキスト
* @param messageMap プッシュメッセージ
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
View file @
2044e9c0
...
...
@@ -100,46 +100,46 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected
String
contentType
;
protected
ABVPopupListWindow
mShowedPopupWindow
=
null
;
protected
int
readingLogId
;
protected
String
path
;
// PanoViewController
protected
String
path
;
// PanoViewController
protected
boolean
readingLogFlg
=
true
;
// HTMLWebViewActivity,PreviewActivityがPDFのアクションとして呼び出されることがあるので、その場合ログは記録しない
protected
ImageButton
subMenuBtn
;
protected
ImageButton
exitMeetingBtn
;
protected
ConcurrentHashMap
<
Long
,
Object
>
objectIdPopupMap
=
new
ConcurrentHashMap
<>();
protected
int
mCurrentPageNumber
=
0
;
// 表示中のページ番号(0からスタート)
protected
int
mCurrentPageNumber
=
0
;
// 表示中のページ番号(0からスタート)
public
Long
mOperationId
;
protected
int
mXWalkOpenType
=
-
1
;
protected
int
mOperationType
;
private
int
mReportType
;
protected
int
mEnableReportHistory
;
//0:履歴無し 1:履歴可
protected
int
mEnableReportHistory
;
//0:履歴無し 1:履歴可
// 報告可能区分
protected
int
mEnableReportEdit
;
//0:報告無し 1:報告可
protected
String
mContentPath
;
protected
int
mStatusCode
;
protected
boolean
isOperationPdf
=
false
;
protected
OperationDto
operationDto
=
null
;
protected
String
linkUrl
;
protected
OperationDto
operationDto
=
null
;
protected
String
linkUrl
;
private
String
mReportFileName
;
protected
TextView
operationNameTitle
;
protected
ImageButton
operationHomeButton
;
protected
ImageButton
taskListButton
;
protected
ImageButton
quickReportPrintButton
;
//
protected ImageButton helpButton;
protected
ImageButton
quickReportPrintButton
;
//
protected ImageButton helpButton;
protected
boolean
isPageFinished
;
protected
Double
latitude
;
protected
Double
longitude
;
protected
boolean
isPageFinished
;
protected
Double
latitude
;
protected
Double
longitude
;
protected
String
mCmd
;
protected
String
mTaskKey
;
protected
String
mAttachedFileName
;
protected
File
mLocalFile
;
protected
String
mCmd
;
protected
String
mTaskKey
;
protected
String
mAttachedFileName
;
protected
File
mLocalFile
;
public
boolean
isLinkedContent
;
public
int
pageNo
;
public
int
mButtonStatus
;
// 保存ボタンチェック
public
int
mButtonStatus
;
// 保存ボタンチェック
protected
boolean
mAddReport
;
// 作業追加区分
// 編集
...
...
@@ -154,68 +154,68 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
super
.
onCreate
(
savedInstanceState
);
Intent
intent
=
getIntent
();
contentId
=
intent
.
getLongExtra
(
ABookKeys
.
CONTENT_ID
,
0
);
contentType
=
intent
.
getStringExtra
(
ABookKeys
.
CONTENT_TYPE
);
objectId
=
intent
.
getLongExtra
(
"objectId"
,
-
1
);
objectPageNumber
=
intent
.
getIntExtra
(
"pageNumber"
,
-
1
);
readingLogId
=
intent
.
getIntExtra
(
"readingLogId"
,
-
1
);
path
=
intent
.
getStringExtra
(
"path"
);
contentId
=
intent
.
getLongExtra
(
ABookKeys
.
CONTENT_ID
,
0
);
contentType
=
intent
.
getStringExtra
(
ABookKeys
.
CONTENT_TYPE
);
objectId
=
intent
.
getLongExtra
(
"objectId"
,
-
1
);
objectPageNumber
=
intent
.
getIntExtra
(
"pageNumber"
,
-
1
);
readingLogId
=
intent
.
getIntExtra
(
"readingLogId"
,
-
1
);
path
=
intent
.
getStringExtra
(
"path"
);
isLinkedContent
=
intent
.
getBooleanExtra
(
"isLinkedContent"
,
false
);
mOperationId
=
intent
.
getLongExtra
(
ABookKeys
.
OPERATION_ID
,
-
1
);
// 戻り先のActivity名を保存しておく
baseActivityName
=
getIntent
().
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
baseActivityName
);
if
(!
isLinkedContent
)
{
if
(!
isLinkedContent
)
{
operationDto
=
AbstractLogic
.
getLogic
(
OperationLogic
.
class
).
getOperation
(
mOperationId
);
mXWalkOpenType
=
intent
.
getIntExtra
(
Constant
.
ABookCheck
.
XWALK_OPEN_TYPE
,
Constant
.
XWalkOpenType
.
DEFAULT
);
if
(
mXWalkOpenType
==
Constant
.
XWalkOpenType
.
TASK_REPORT
||
mXWalkOpenType
==
Constant
.
XWalkOpenType
.
PANO_EDIT
)
{
if
(
mXWalkOpenType
==
Constant
.
XWalkOpenType
.
TASK_REPORT
)
{
mOperationType
=
operationDto
.
operationType
;
mReportType
=
operationDto
.
reportType
;
if
(
mOperationType
!=
OperationType
.
PDF
&&
isNormalSize
())
{
// 縦画面固定
setRequestedOrientation
(
ActivityInfo
.
SCREEN_ORIENTATION_PORTRAIT
);
}
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
// 添付ファイル表示のため、キャッシュディレクトリにコピーする
ABookCheckWebViewHelper
.
getInstance
().
allCopyTaskAttachedMovieFileToCache
(
mOperationId
,
getContentId
(),
operationDto
);
}
}).
start
();
mStatusCode
=
0
;
}
mXWalkOpenType
=
intent
.
getIntExtra
(
Constant
.
ABookCheck
.
XWALK_OPEN_TYPE
,
Constant
.
XWalkOpenType
.
DEFAULT
);
if
(
mXWalkOpenType
==
Constant
.
XWalkOpenType
.
TASK_REPORT
||
mXWalkOpenType
==
Constant
.
XWalkOpenType
.
PANO_EDIT
)
{
if
(
mXWalkOpenType
==
Constant
.
XWalkOpenType
.
TASK_REPORT
)
{
mOperationType
=
operationDto
.
operationType
;
mReportType
=
operationDto
.
reportType
;
if
(
mOperationType
!=
OperationType
.
PDF
&&
isNormalSize
())
{
// 縦画面固定
setRequestedOrientation
(
ActivityInfo
.
SCREEN_ORIENTATION_PORTRAIT
);
}
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
// 添付ファイル表示のため、キャッシュディレクトリにコピーする
ABookCheckWebViewHelper
.
getInstance
().
allCopyTaskAttachedMovieFileToCache
(
mOperationId
,
getContentId
(),
operationDto
);
}
}).
start
();
mStatusCode
=
0
;
}
mEnableReportEdit
=
operationDto
.
enableReportEdit
;
mEnableReportHistory
=
operationDto
.
enableReportHistory
;
mEnableReportHistory
=
operationDto
.
enableReportHistory
;
linkUrl
=
intent
.
getStringExtra
(
"LINKURL"
);
// LinkURL
linkUrl
=
intent
.
getStringExtra
(
"LINKURL"
);
// LinkURL
if
(
operationDto
!=
null
&&
operationDto
.
operationType
==
OperationType
.
PDF
)
{
isOperationPdf
=
true
;
}
}
}
if
(
operationDto
!=
null
&&
operationDto
.
operationType
==
OperationType
.
PDF
)
{
isOperationPdf
=
true
;
}
}
}
// 遠隔連動
meetingManager
=
MeetingManager
.
getInstance
();
// 遠隔連動
meetingManager
=
MeetingManager
.
getInstance
();
isCollaboration
=
meetingManager
.
isCollaboration
();
mContentDir
=
getIntent
().
getStringExtra
(
FILEPATH
);
mContentDir
=
getIntent
().
getStringExtra
(
FILEPATH
);
// Activity登録
if
(
objectId
==
-
1
)
{
ActivityHandlingHelper
.
getInstance
().
setContentViewActivity
(
this
);
// Activity登録
if
(
objectId
==
-
1
)
{
ActivityHandlingHelper
.
getInstance
().
setContentViewActivity
(
this
);
ContentDto
dto
=
contentDao
.
getContent
(
contentId
);
if
(
dto
!=
null
)
{
// 閲覧履歴保存
contentDao
.
updateContentReadingDate
(
DateTimeUtil
.
getCurrentTimestamp
(),
getContentId
());
}
}
else
{
ActivityHandlingHelper
.
getInstance
().
setObjectViewActivity
(
this
);
}
}
else
{
ActivityHandlingHelper
.
getInstance
().
setObjectViewActivity
(
this
);
}
contentDownloader
.
pauseAll
();
showUpdateContentAlert
(
contentId
);
...
...
@@ -233,7 +233,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
confirmDialog
.
setMessage
(
R
.
string
.
msg_content_to_be_updated
);
confirmDialog
.
setPositiveButton
(
R
.
string
.
ok
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
confirmDialog
.
dismiss
();
}
});
...
...
@@ -246,11 +246,11 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override
protected
void
onResume
()
{
super
.
onResume
();
super
.
onResume
();
try
{
if
(
readingLogFlg
)
{
readingLogId
=
ContentLogUtil
.
getInstance
().
startContentReadLog
(
this
,
contentId
,
getABVUIDataCache
().
getPermissionAccessLocation
());
}
}
}
catch
(
Exception
e
)
{
Logger
.
e
(
"Exception"
,
e
);
handleErrorMessageToast
(
ErrorCode
.
E107
);
...
...
@@ -271,27 +271,27 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
@Override
protected
void
onStart
()
{
super
.
onStart
();
}
protected
void
onStart
()
{
super
.
onStart
();
}
@Override
protected
void
onPause
()
{
super
.
onPause
();
protected
void
onPause
()
{
super
.
onPause
();
}
@Override
protected
void
onStop
()
{
super
.
onStop
();
if
(!
DeviceInfo
.
isForegrdound
(
getApplicationContext
())
&&
readingLogFlg
)
{
ContentReadingLogLogic
logic
=
AbstractLogic
.
getLogic
(
ContentReadingLogLogic
.
class
);
logic
.
pauseContentReadLog
(
contentId
);
}
}
protected
void
onStop
()
{
super
.
onStop
();
if
(!
DeviceInfo
.
isForegrdound
(
getApplicationContext
())
&&
readingLogFlg
)
{
ContentReadingLogLogic
logic
=
AbstractLogic
.
getLogic
(
ContentReadingLogLogic
.
class
);
logic
.
pauseContentReadLog
(
contentId
);
}
}
@Override
protected
void
onDestroy
()
{
protected
void
onDestroy
()
{
Logger
.
d
(
TAG
,
"onDestroy"
);
if
(
readingLogFlg
)
{
ContentReadingLogLogic
logic
=
AbstractLogic
.
getLogic
(
ContentReadingLogLogic
.
class
);
...
...
@@ -304,14 +304,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
meetingManager
.
sendWs
(
MeetingManager
.
CMD_CLOSEPOPUP
,
contentId
,
objectPageNumber
,
objectId
,
null
);
}
if
(
meetingManager
.
isSubscribed
())
{
ActivityHandlingHelper
.
getInstance
().
refreshMeetingListActivity
();
}
if
(
objectId
==
-
1
)
{
ActivityHandlingHelper
.
getInstance
().
removeContentViewActivity
(
this
);
}
else
{
ActivityHandlingHelper
.
getInstance
().
removeObjectViewActivity
(
this
);
}
if
(
meetingManager
.
isSubscribed
())
{
ActivityHandlingHelper
.
getInstance
().
refreshMeetingListActivity
();
}
if
(
objectId
==
-
1
)
{
ActivityHandlingHelper
.
getInstance
().
removeContentViewActivity
(
this
);
}
else
{
ActivityHandlingHelper
.
getInstance
().
removeObjectViewActivity
(
this
);
}
//キャッシュを使用しない場合、ディレクトリが残っていれば削除
if
(!
getRBoolean
(
R
.
bool
.
use_cache
)
&&
objectId
==
-
1
)
{
...
...
@@ -331,11 +331,11 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
protected
boolean
isCursorModeEnable
()
{
if
(
isOperationPdf
())
{
return
false
;
}
else
{
return
PreferenceUtil
.
get
(
this
,
DefPrefKey
.
CURSOR_ENABLE
,
false
);
}
if
(
isOperationPdf
())
{
return
false
;
}
else
{
return
PreferenceUtil
.
get
(
this
,
DefPrefKey
.
CURSOR_ENABLE
,
false
);
}
}
protected
void
initError
()
{
...
...
@@ -365,7 +365,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
alert
.
setView
(
layout
);
alert
.
setNegativeButton
(
R
.
string
.
cancel
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
dialog
.
dismiss
();
}
});
...
...
@@ -374,7 +374,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// 指定ページへのジャンプ
@Override
public
void
startContentViewActivity
(
long
contentId
,
int
pageNum
)
{
public
void
startContentViewActivity
(
long
contentId
,
int
pageNum
)
{
Logger
.
d
(
TAG
,
"startContentViewActivity:%s, pageNum=%s"
,
contentId
,
pageNum
);
releaseInit
();
Intent
intent
=
new
Intent
();
...
...
@@ -444,15 +444,15 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
@Override
public
void
finish
()
{
public
void
finish
()
{
// ホームをリロードさせる
ActivityHandlingHelper
.
getInstance
().
setRequireHomeReload
(
true
);
super
.
finish
();
Logger
.
d
(
TAG
,
"finish"
);
}
protected
void
commonConfigureRemote
()
{
}
protected
void
commonConfigureRemote
()
{
}
public
void
configureRemote
()
{
}
...
...
@@ -475,8 +475,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// if (helpButton != null && helpButton.getVisibility() == View.VISIBLE) {
//
helpButton.setLayoutParams(params);
//
}
//
helpButton.setLayoutParams(params);
//
}
}
else
{
// 会議室退室ボタン非表示
if
(
exitMeetingBtn
!=
null
)
{
...
...
@@ -487,9 +487,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
params
.
rightMargin
=
(
int
)
(
getResources
().
getDisplayMetrics
().
density
*
5
);
subMenuBtn
.
setLayoutParams
(
params
);
}
//
if (helpButton != null && helpButton.getVisibility() == View.VISIBLE) {
//
helpButton.setLayoutParams(params);
//
}
//
if (helpButton != null && helpButton.getVisibility() == View.VISIBLE) {
//
helpButton.setLayoutParams(params);
//
}
}
}
});
...
...
@@ -505,22 +505,22 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
alert
.
setPositiveButton
(
R
.
string
.
yes
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
// 遠隔連動中に保存したマーキングファイルを削除
ContentMarkingFileHelper
contentMarkingFileHelper
=
new
ContentMarkingFileHelper
();
contentMarkingFileHelper
.
deleteRemoteMarkingFile
(
contentId
);
setMeetingEnteredFlg
();
if
(
meetingManager
.
isOwner
())
{
try
{
if
(
meetingManager
.
isOwner
())
{
try
{
meetingManager
.
deleteMeeting
();
}
catch
(
Exception
e
)
{
Logger
.
e
(
TAG
,
"showMeetingExitDialog deleteMeeting error"
,
e
);
ABVToastUtil
.
showMakeText
(
ABVContentViewActivity
.
this
,
getString
(
R
.
string
.
E126
),
Toast
.
LENGTH_SHORT
);
}
}
}
//会議室に参加する前のonCloseと識別するため
meetingManager
.
close
();
meetingManager
.
close
();
configureRemote
();
ActivityHandlingHelper
handlingHelper
=
ActivityHandlingHelper
.
getInstance
();
...
...
@@ -530,7 +530,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
});
alert
.
setNegativeButton
(
R
.
string
.
no
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
dialog
.
cancel
();
}
});
...
...
@@ -569,22 +569,22 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if
(
textView
==
null
)
{
return
;
}
textView
.
setVisibility
(
View
.
GONE
);
textView
.
setVisibility
(
View
.
GONE
);
if
(
isVisible
&&
!
isCollaboration
)
{
if
(
meetingManager
.
isConnected
()
&&
meetingManager
.
isOwner
())
{
textView
.
setVisibility
(
View
.
VISIBLE
);
CommonExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
final
int
count
=
meetingManager
.
getParticipantCount
();
handler
.
post
(
new
Runnable
()
{
textView
.
setVisibility
(
View
.
VISIBLE
);
CommonExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
final
int
count
=
meetingManager
.
getParticipantCount
();
handler
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
textView
.
setText
(
getRString
(
R
.
string
.
meeting_participant_count
)
+
":"
+
count
);
}
});
}
});
}
});
}
}
...
...
@@ -609,14 +609,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
}
public
int
getCurrentPageNumber
()
{
return
mCurrentPageNumber
;
}
public
int
getCurrentPageNumber
()
{
return
mCurrentPageNumber
;
}
/**
* 戻る用コンテンツIDリストをリセット
*/
public
void
resetReturnContentIdList
()
{
/**
* 戻る用コンテンツIDリストをリセット
*/
public
void
resetReturnContentIdList
()
{
getABVUIDataCache
().
resetReturnContentIdList
();
}
...
...
@@ -630,25 +630,25 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
/**
* コンテンツビューから戻るボタンタップ時の処理
*/
public
void
moveToBack
()
{
public
void
moveToBack
()
{
//戻る用コンテンツIDの数
int
listSize
=
getReturnContentIdList
().
size
();
if
(
listSize
==
0
)
{
finish
();
}
else
{
long
[]
contentInfo
=
getReturnContentIdList
().
get
(
listSize
-
1
);
// 直前のコンテンツが360コンテンツか確認⇒画面遷移ではなくfinish()で廃棄することで戻る
if
(
ActivityHandlingHelper
.
getInstance
().
hasPreviousPanoContentId
(
contentInfo
[
0
]))
{
finish
();
}
else
{
if
(
listSize
==
0
)
{
finish
();
}
else
{
long
[]
contentInfo
=
getReturnContentIdList
().
get
(
listSize
-
1
);
// 直前のコンテンツが360コンテンツか確認⇒画面遷移ではなくfinish()で廃棄することで戻る
if
(
ActivityHandlingHelper
.
getInstance
().
hasPreviousPanoContentId
(
contentInfo
[
0
]))
{
finish
();
}
else
{
ActivityHandlingHelper
.
getInstance
().
startContentActivity
(
contentInfo
[
0
],
(
int
)
contentInfo
[
1
]);
}
if
(
this
instanceof
HTMLXWalkWebViewActivity
)
{
}
if
(
this
instanceof
HTMLXWalkWebViewActivity
)
{
return
;
}
}
getReturnContentIdList
().
remove
(
listSize
-
1
);
}
}
}
}
/**
* コンテンツビューから戻るボタンタップ時の処理(ABookCheck専用)
...
...
@@ -658,29 +658,29 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
finish
();
}
protected
void
createCheckToolbar
()
{
protected
void
createCheckToolbar
()
{
final
RelativeLayout
fl
;
if
(
operationDto
!=
null
&&
operationDto
.
operationType
==
OperationType
.
PDF
&&
mXWalkOpenType
==
Constant
.
XWalkOpenType
.
TASK_REPORT
)
{
fl
=
(
RelativeLayout
)
findViewById
(
R
.
id
.
RelativeLayout2
);
}
else
{
fl
=
(
RelativeLayout
)
findViewById
(
R
.
id
.
frameTopbar
);
}
fl
.
setBackgroundColor
(
getResources
().
getColor
(
R
.
color
.
operation_color
));
operationHomeButton
=
(
ImageButton
)
findViewById
(
R
.
id
.
btn_operation_home
);
quickReportPrintButton
=
(
ImageButton
)
findViewById
(
R
.
id
.
btn_operation_print
);
operationHomeButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
mXWalkOpenType
==
Constant
.
XWalkOpenType
.
PANO_EDIT
)
{
fl
.
setBackgroundColor
(
getResources
().
getColor
(
R
.
color
.
operation_color
));
operationHomeButton
=
(
ImageButton
)
findViewById
(
R
.
id
.
btn_operation_home
);
quickReportPrintButton
=
(
ImageButton
)
findViewById
(
R
.
id
.
btn_operation_print
);
operationHomeButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
mXWalkOpenType
==
Constant
.
XWalkOpenType
.
PANO_EDIT
)
{
showConfirmSavePanoEdit
();
}
else
{
}
else
{
// 作業終了する時、作業ID設定して作業一覧で使用するメソットを行う。
putUserPref
(
AppDefType
.
UserPrefKey
.
SYNC_TARGET_OPERATION_ID
,
mOperationId
);
finishActivity
();
// 開いてる画面を閉じる
}
}
});
operationHomeButton
.
setVisibility
(
View
.
VISIBLE
);
}
});
operationHomeButton
.
setVisibility
(
View
.
VISIBLE
);
if
(
operationDto
!=
null
&&
operationDto
.
operationType
==
OperationType
.
PDF
){
// 簡易帳票印刷ボタン
...
...
@@ -701,58 +701,58 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
}
taskListButton
=
(
ImageButton
)
findViewById
(
R
.
id
.
btn_show_task_list
);
taskListButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
// 作業一覧表示
showTaskList
();
}
});
if
(
mXWalkOpenType
==
Constant
.
XWalkOpenType
.
TASK_REPORT
||
mXWalkOpenType
==
Constant
.
XWalkOpenType
.
PANO_EDIT
)
{
if
(
mXWalkOpenType
==
Constant
.
XWalkOpenType
.
TASK_REPORT
)
{
if
(
mOperationType
!=
OperationType
.
PDF
&&
isNormalSize
())
{
// 縦画面固定
setRequestedOrientation
(
ActivityInfo
.
SCREEN_ORIENTATION_PORTRAIT
);
}
mOperationType
=
operationDto
.
operationType
;
String
cacheDirPath
=
ABVEnvironment
.
getInstance
().
getContentCacheDirectoryPath
(
getContentId
());
if
(
operationDto
.
operationType
==
OperationType
.
LIST
)
{
mContentPath
=
ABVEnvironment
.
getInstance
().
getTaskListDirName
(
cacheDirPath
);
if
(
operationDto
.
reportType
==
Constant
.
ReportType
.
ReportContinuous
)
{
taskListButton
=
(
ImageButton
)
findViewById
(
R
.
id
.
btn_show_task_list
);
taskListButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
// 作業一覧表示
showTaskList
();
}
});
if
(
mXWalkOpenType
==
Constant
.
XWalkOpenType
.
TASK_REPORT
||
mXWalkOpenType
==
Constant
.
XWalkOpenType
.
PANO_EDIT
)
{
if
(
mXWalkOpenType
==
Constant
.
XWalkOpenType
.
TASK_REPORT
)
{
if
(
mOperationType
!=
OperationType
.
PDF
&&
isNormalSize
())
{
// 縦画面固定
setRequestedOrientation
(
ActivityInfo
.
SCREEN_ORIENTATION_PORTRAIT
);
}
mOperationType
=
operationDto
.
operationType
;
String
cacheDirPath
=
ABVEnvironment
.
getInstance
().
getContentCacheDirectoryPath
(
getContentId
());
if
(
operationDto
.
operationType
==
OperationType
.
LIST
)
{
mContentPath
=
ABVEnvironment
.
getInstance
().
getTaskListDirName
(
cacheDirPath
);
if
(
operationDto
.
reportType
==
Constant
.
ReportType
.
ReportContinuous
)
{
mContentPath
=
ABVEnvironment
.
getInstance
().
getProcessListDirName
(
cacheDirPath
);
}
}
else
if
(
operationDto
.
operationType
==
OperationType
.
PDF
)
{
mContentPath
=
ABVEnvironment
.
getInstance
().
getTaskPdfDirName
(
cacheDirPath
);
}
else
{
mContentPath
=
ABVEnvironment
.
getInstance
().
getPanoImageDirName
(
cacheDirPath
);
}
mStatusCode
=
0
;
}
operationNameTitle
=
(
TextView
)
findViewById
(
R
.
id
.
title
);
operationNameTitle
.
setText
(
operationDto
.
operationName
);
if
(
isNormalSize
())
{
operationNameTitle
.
setWidth
(
getRDimensionSize
(
R
.
dimen
.
operation_title_normal_width
));
}
else
{
operationNameTitle
.
setWidth
(
getRDimensionSize
(
R
.
dimen
.
operation_title_large_width
));
}
operationNameTitle
.
setVisibility
(
View
.
VISIBLE
);
}
}
/**
* 簡易帳票印刷対象選択画面表示
*/
private
void
showPrintTargetSelect
(
OperationDto
operationDto
)
{
Intent
intent
=
new
Intent
();
intent
.
setClass
(
ABVContentViewActivity
.
this
,
OnlineHTMLWebViewActivity
.
class
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_SINGLE_TOP
);
intent
.
putExtra
(
"LINKURL"
,
AcmsApis
.
getApiUrl
(
ABVEnvironment
.
getInstance
().
acmsAddress
,
ABVDataCache
.
getInstance
().
getUrlPath
(),
AcmsApis
.
ApiQuickReportRevision
)
+
"?isNative=1"
);
intent
.
putExtra
(
"operationId"
,
mOperationId
);
startActivity
(
intent
,
NaviConsts
.
Right
);
}
}
else
if
(
operationDto
.
operationType
==
OperationType
.
PDF
)
{
mContentPath
=
ABVEnvironment
.
getInstance
().
getTaskPdfDirName
(
cacheDirPath
);
}
else
{
mContentPath
=
ABVEnvironment
.
getInstance
().
getPanoImageDirName
(
cacheDirPath
);
}
mStatusCode
=
0
;
}
operationNameTitle
=
(
TextView
)
findViewById
(
R
.
id
.
title
);
operationNameTitle
.
setText
(
operationDto
.
operationName
);
if
(
isNormalSize
())
{
operationNameTitle
.
setWidth
(
getRDimensionSize
(
R
.
dimen
.
operation_title_normal_width
));
}
else
{
operationNameTitle
.
setWidth
(
getRDimensionSize
(
R
.
dimen
.
operation_title_large_width
));
}
operationNameTitle
.
setVisibility
(
View
.
VISIBLE
);
}
}
/**
* 簡易帳票印刷対象選択画面表示
*/
private
void
showPrintTargetSelect
(
OperationDto
operationDto
)
{
Intent
intent
=
new
Intent
();
intent
.
setClass
(
ABVContentViewActivity
.
this
,
OnlineHTMLWebViewActivity
.
class
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_SINGLE_TOP
);
intent
.
putExtra
(
"LINKURL"
,
AcmsApis
.
getApiUrl
(
ABVEnvironment
.
getInstance
().
acmsAddress
,
ABVDataCache
.
getInstance
().
getUrlPath
(),
AcmsApis
.
ApiQuickReportRevision
)
+
"?isNative=1"
);
intent
.
putExtra
(
"operationId"
,
mOperationId
);
startActivity
(
intent
,
NaviConsts
.
Right
);
}
/**
...
...
@@ -808,124 +808,124 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected
void
finishActivity
()
{}
protected
void
webViewLoadUrl
(
String
url
){}
public
void
onClickOperationHome
(
View
v
)
{
if
(
mXWalkOpenType
==
Constant
.
XWalkOpenType
.
PANO_EDIT
)
{
public
void
onClickOperationHome
(
View
v
)
{
if
(
mXWalkOpenType
==
Constant
.
XWalkOpenType
.
PANO_EDIT
)
{
// リソースパターンの適用
ABookAlertDialog
alertDialog
=
AlertDialogUtil
.
createAlertDialog
(
ABVContentViewActivity
.
this
,
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
ABookAlertDialog
alertDialog
=
AlertDialogUtil
.
createAlertDialog
(
ABVContentViewActivity
.
this
,
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
pano_edit
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
// リソースパターンの適用
alertDialog
.
setMessage
(
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
alertDialog
.
setMessage
(
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
msg_confirm_save_pano_edit
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
alertDialog
.
setNegativeButton
(
R
.
string
.
cancel
,
null
);
alertDialog
.
setPositiveButton
(
R
.
string
.
ok
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
callUnloadAuth
();
dialog
.
dismiss
();
finish
();
}
});
alertDialog
.
show
();
}
else
{
alertDialog
.
setNegativeButton
(
R
.
string
.
cancel
,
null
);
alertDialog
.
setPositiveButton
(
R
.
string
.
ok
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
callUnloadAuth
();
dialog
.
dismiss
();
finish
();
}
});
alertDialog
.
show
();
}
else
{
// 作業終了する時、作業ID設定して作業一覧で使用するメソットを行う。
putUserPref
(
AppDefType
.
UserPrefKey
.
SYNC_TARGET_OPERATION_ID
,
mOperationId
);
// 作業IDの設定
finishActivity
();
// 開いてる画面を閉じる
}
}
/**
* Be override
*/
protected
void
onActionOperationPdfWebView
(
Map
<
String
,
String
>
checkParam
,
OperationTaskDto
operationTaskDto
)
{}
//
public void onClickShowHelpView(View v) {
//
int helpViewType = 0;
//
switch (mStatusCode) {
//
case Constant.XWalkWebViewDisplayStatus.InitView:
//
if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
//
helpViewType = Constant.HelpViewType.PanoContentEdit;
//
} else {
//
switch (mOperationType) {
//
case OperationType.LIST:
//
switch (mXWalkOpenType) {
//
case Constant.XWalkOpenType.TASK_DERECTION:
//
helpViewType = Constant.HelpViewType.ListOperationDirector;
//
break;
//
case Constant.XWalkOpenType.TASK_REPORT:
//
if (operationDto.reportType == Constant.ReportType.RoutineTask) {
//
helpViewType = Constant.HelpViewType.RoutineTaskOperation;
//
} else {
//
helpViewType = Constant.HelpViewType.ListOperationReporter;
//
}
//
break;
//
}
//
break;
//
case OperationType.DRAWING:
//
case OperationType.PDF:
//
switch (mXWalkOpenType) {
//
case Constant.XWalkOpenType.TASK_DERECTION:
//
helpViewType = Constant.HelpViewType.DrawingOperationDirector;
//
break;
//
case Constant.XWalkOpenType.TASK_REPORT:
//
helpViewType = Constant.HelpViewType.DrawingOperationReporter;
//
break;
//
}
//
break;
//
case OperationType.PANO:
//
switch (mXWalkOpenType) {
//
case Constant.XWalkOpenType.TASK_DERECTION:
//
helpViewType = Constant.HelpViewType.PanoOperationDirector;
//
break;
//
case Constant.XWalkOpenType.TASK_REPORT:
//
helpViewType = Constant.HelpViewType.PanoOperationReporter;
//
break;
//
}
}
}
/**
* Be override
*/
protected
void
onActionOperationPdfWebView
(
Map
<
String
,
String
>
checkParam
,
OperationTaskDto
operationTaskDto
)
{}
//
public void onClickShowHelpView(View v) {
//
int helpViewType = 0;
//
switch (mStatusCode) {
//
case Constant.XWalkWebViewDisplayStatus.InitView:
//
if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
//
helpViewType = Constant.HelpViewType.PanoContentEdit;
//
} else {
//
switch (mOperationType) {
//
case OperationType.LIST:
//
switch (mXWalkOpenType) {
//
case Constant.XWalkOpenType.TASK_DERECTION:
//
helpViewType = Constant.HelpViewType.ListOperationDirector;
//
break;
//
case Constant.XWalkOpenType.TASK_REPORT:
//
if (operationDto.reportType == Constant.ReportType.RoutineTask) {
//
helpViewType = Constant.HelpViewType.RoutineTaskOperation;
//
} else {
//
helpViewType = Constant.HelpViewType.ListOperationReporter;
//
}
//
break;
//
}
//
break;
//
case OperationType.DRAWING:
//
case OperationType.PDF:
//
switch (mXWalkOpenType) {
//
case Constant.XWalkOpenType.TASK_DERECTION:
//
helpViewType = Constant.HelpViewType.DrawingOperationDirector;
//
break;
//
case Constant.XWalkOpenType.TASK_REPORT:
//
helpViewType = Constant.HelpViewType.DrawingOperationReporter;
//
break;
//
}
//
break;
//
case OperationType.PANO:
//
switch (mXWalkOpenType) {
//
case Constant.XWalkOpenType.TASK_DERECTION:
//
helpViewType = Constant.HelpViewType.PanoOperationDirector;
//
break;
//
case Constant.XWalkOpenType.TASK_REPORT:
//
helpViewType = Constant.HelpViewType.PanoOperationReporter;
//
break;
//
}
//
//
break;
//
}
//
}
//
break;
//
case Constant.XWalkWebViewDisplayStatus.TaskView:
//
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) {
//
helpViewType = Constant.HelpViewType.DirectorTask;
//
} else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
//
if (operationDto.reportType == Constant.ReportType.RoutineTask) {
//
helpViewType = Constant.HelpViewType.RoutineTaskOperationReport;
//
} else {
//
helpViewType = Constant.HelpViewType.ReportTask;
//
}
//
}
//
break;
//
case Constant.XWalkWebViewDisplayStatus.ReportPreView:
//
helpViewType = Constant.HelpViewType.ReportPreview;
//
break;
//
case Constant.XWalkWebViewDisplayStatus.TaskListView:
//
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) {
//
helpViewType = Constant.HelpViewType.DirectorTaskList;
//
} else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
//
helpViewType = Constant.HelpViewType.ReportTaskList;
//
}
//
break;
//
}
//
break;
//
}
//
}
//
break;
//
case Constant.XWalkWebViewDisplayStatus.TaskView:
//
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) {
//
helpViewType = Constant.HelpViewType.DirectorTask;
//
} else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
//
if (operationDto.reportType == Constant.ReportType.RoutineTask) {
//
helpViewType = Constant.HelpViewType.RoutineTaskOperationReport;
//
} else {
//
helpViewType = Constant.HelpViewType.ReportTask;
//
}
//
}
//
break;
//
case Constant.XWalkWebViewDisplayStatus.ReportPreView:
//
helpViewType = Constant.HelpViewType.ReportPreview;
//
break;
//
case Constant.XWalkWebViewDisplayStatus.TaskListView:
//
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) {
//
helpViewType = Constant.HelpViewType.DirectorTaskList;
//
} else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
//
helpViewType = Constant.HelpViewType.ReportTaskList;
//
}
//
break;
//
}
//
//
showHelpViewDialog(helpViewType);
//
}
//
showHelpViewDialog(helpViewType);
//
}
public
void
commonShouldOverrideUrlLoading
(
Uri
uri
,
OperationTaskDto
operationTaskDto
)
{
public
void
commonShouldOverrideUrlLoading
(
Uri
uri
,
OperationTaskDto
operationTaskDto
)
{
Logger
.
d
(
TAG
,
"Uri : %s"
,
uri
);
//parent method
Map
<
String
,
String
>
abookCheckParam
=
new
HashMap
<
String
,
String
>();
for
(
String
key
:
uri
.
getQueryParameterNames
())
{
abookCheckParam
.
put
(
key
,
uri
.
getQueryParameter
(
key
));
}
mCmd
=
abookCheckParam
.
get
(
ABookKeys
.
CMD
);
if
(
abookCheckParam
.
containsKey
(
ABookKeys
.
TASK_KEY
))
{
//parent method
Map
<
String
,
String
>
abookCheckParam
=
new
HashMap
<
String
,
String
>();
for
(
String
key
:
uri
.
getQueryParameterNames
())
{
abookCheckParam
.
put
(
key
,
uri
.
getQueryParameter
(
key
));
}
mCmd
=
abookCheckParam
.
get
(
ABookKeys
.
CMD
);
if
(
abookCheckParam
.
containsKey
(
ABookKeys
.
TASK_KEY
))
{
mTaskKey
=
abookCheckParam
.
get
(
ABookKeys
.
TASK_KEY
);
}
int
taskReportLevel
=
0
;
// 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答))
if
(
abookCheckParam
.
containsKey
(
ABookKeys
.
TASK_REPORT_LEVEL
))
{
taskReportLevel
=
Integer
.
parseInt
(
abookCheckParam
.
get
(
ABookKeys
.
TASK_REPORT_LEVEL
));
// 作業報告レベル
...
...
@@ -959,24 +959,25 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if
(
StringUtil
.
equalsAny
(
mCmd
,
ABookKeys
.
CMD_MOVE_HOT_SPOT
,
ABookKeys
.
CMD_INSERT_TASK_REPORT
,
ABookKeys
.
CMD_UPDATE_TASK_REPORT
,
ABookKeys
.
CMD_DELETE_TASK_REPORT
,
ABookKeys
.
CMD_CANCEL_TASK_REPORT
,
ABookKeys
.
CMD_LOCAL_SAVE_TASK_REPORT
,
ABookKeys
.
CMD_CHANGE_TASK_REPORT
,
ABookKeys
.
CMD_DELETE_PROCESS
))
{
try
{
if
(
StringUtil
.
equalsAny
(
mCmd
,
ABookKeys
.
CMD_INSERT_TASK_REPORT
,
ABookKeys
.
CMD_UPDATE_TASK_REPORT
))
{
if
(
StringUtil
.
equalsAny
(
mCmd
,
ABookKeys
.
CMD_INSERT_TASK_REPORT
,
ABookKeys
.
CMD_UPDATE_TASK_REPORT
))
{
// リソースパターンの適用
showProgressPopup
(
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
file_initialization
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
}
//連続作業の全削除ボタンタップ時のインジケーター表示
if
(
StringUtil
.
equalsAny
(
mCmd
,
ABookKeys
.
CMD_DELETE_PROCESS
))
{
showProgressPopup
(
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
msg_common_processing
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
}
}
//連続作業の全削除ボタンタップ時のインジケーター表示
if
(
StringUtil
.
equalsAny
(
mCmd
,
ABookKeys
.
CMD_DELETE_PROCESS
))
{
showProgressPopup
(
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
msg_common_processing
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
}
if
(
isOperationPdf
&&
operationTaskDto
!=
null
&&
StringUtil
.
equalsAny
(
mCmd
,
ABookKeys
.
CMD_INSERT_TASK_REPORT
,
ABookKeys
.
CMD_UPDATE_TASK_REPORT
,
ABookKeys
.
CMD_MOVE_HOT_SPOT
,
ABookKeys
.
CMD_INSERT_TASK_REPORT
,
ABookKeys
.
CMD_UPDATE_TASK_REPORT
,
ABookKeys
.
CMD_MOVE_HOT_SPOT
,
ABookKeys
.
CMD_LOCAL_SAVE_TASK_REPORT
))
{
String
taskCode
=
""
;
...
...
@@ -1012,6 +1013,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public
Object
callback
(
Object
ret
)
{
final
boolean
isError
=
(
boolean
)
ret
;
closeProgressPopup
();
syncOperation
(
mOperationId
,
mOperationType
,
false
);
// 報告・報告(回答)の切り替えボタンタップ、連続作業の全削除ボタンタップ
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_CHANGE_TASK_REPORT
)
||
mCmd
.
equals
(
ABookKeys
.
CMD_DELETE_PROCESS
))
{
afterABookCheckApi
(
mCmd
,
mTaskKey
,
0
,
""
,
null
,
isOperationPdf
());
...
...
@@ -1100,47 +1102,47 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
mReportFileName
=
abookCheckParam
.
get
(
ABookKeys
.
REPORT_FILE_NAME
);
// 作業報告画面改善
ActivityHandlingHelper
.
getInstance
().
startOZViewerActivity
(
this
,
mOperationId
,
getContentId
(),
mTaskKey
,
true
,
taskReportId
,
reportStartDate
,
mReportFileName
,
false
,
true
,
taskReportLevel
,
processKey
,
phaseNo
);
}
else
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_CONTENT_EDIT_CLOSE
))
{
showProgressPopup
();
handler
.
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
closeProgressPopup
();
finish
();
}
},
5000
);
}
else
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_GET_GPS_INFO
))
{
// #32926 作業報告画面改善 start
setLocation
((
Integer
.
valueOf
(
abookCheckParam
.
get
(
ABookKeys
.
GPS_TYPE
))
!=
1
));
// #32926 作業報告画面改善 end
}
else
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_SCENE_REGIST
))
{
String
successFlg
=
abookCheckParam
.
get
(
ABookKeys
.
SUCCESS_FLG
);
if
(
Integer
.
parseInt
(
successFlg
)
==
0
)
{
}
else
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_CONTENT_EDIT_CLOSE
))
{
showProgressPopup
();
handler
.
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
closeProgressPopup
();
finish
();
}
},
5000
);
}
else
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_GET_GPS_INFO
))
{
// #32926 作業報告画面改善 start
setLocation
((
Integer
.
valueOf
(
abookCheckParam
.
get
(
ABookKeys
.
GPS_TYPE
))
!=
1
));
// #32926 作業報告画面改善 end
}
else
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_SCENE_REGIST
))
{
String
successFlg
=
abookCheckParam
.
get
(
ABookKeys
.
SUCCESS_FLG
);
if
(
Integer
.
parseInt
(
successFlg
)
==
0
)
{
// リソースパターンの適用
ABookAlertDialog
alertDialog
=
AlertDialogUtil
.
createAlertDialog
(
this
,
PatternStringUtil
.
patternToInt
(
getApplicationContext
(),
ABookAlertDialog
alertDialog
=
AlertDialogUtil
.
createAlertDialog
(
this
,
PatternStringUtil
.
patternToInt
(
getApplicationContext
(),
R
.
string
.
pano_edit
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
alertDialog
.
setMessage
(
PatternStringUtil
.
patternToInt
(
getApplicationContext
(),
alertDialog
.
setMessage
(
PatternStringUtil
.
patternToInt
(
getApplicationContext
(),
R
.
string
.
msg_sence_regist_failed
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
alertDialog
.
setPositiveButton
(
R
.
string
.
ok
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
dialog
.
dismiss
();
}
});
alertDialog
.
show
();
}
else
{
alertDialog
.
setPositiveButton
(
R
.
string
.
ok
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
dialog
.
dismiss
();
}
});
alertDialog
.
show
();
}
else
{
progressDialog
.
setProgress
(
100
);
// 成功
Logger
.
i
(
TAG
,
ABookKeys
.
CMD_SCENE_REGIST
+
"is success"
);
// 成功
Logger
.
i
(
TAG
,
ABookKeys
.
CMD_SCENE_REGIST
+
"is success"
);
progressDialog
.
setProgress
(
0
);
}
closeProgressPopup
();
}
else
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_MOVE_PAGE
))
{
onActionOperationPdfWebView
(
abookCheckParam
,
operationTaskDto
);
closeProgressPopup
();
}
else
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_MOVE_PAGE
))
{
onActionOperationPdfWebView
(
abookCheckParam
,
operationTaskDto
);
}
else
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_SHOW_RELATED_CONTENT
))
{
try
{
long
linkedContentId
=
Long
.
valueOf
(
abookCheckParam
.
get
(
ABookKeys
.
CONTENT_ID
));
...
...
@@ -1169,40 +1171,40 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
finishActivity
();
// 開いてる画面を閉じる
}
}
}
}
public
void
commonAttachedDataUrl
(
String
taskKey
,
String
data
)
{
boolean
isError
=
false
;
if
(
data
!=
null
)
{
try
{
public
void
commonAttachedDataUrl
(
String
taskKey
,
String
data
)
{
boolean
isError
=
false
;
if
(
data
!=
null
)
{
try
{
String
imagePath
=
ABVEnvironment
.
getInstance
().
getTempFilePath
(
getContentId
(),
taskKey
,
mAttachedFileName
);
ABookCheckWebViewHelper
.
getInstance
().
decodeToImage
(
data
,
imagePath
);
//アプリ内のファイルのみ削除(Galleryファイルは削除しない)
if
(
mLocalFile
!=
null
&&
mLocalFile
.
getPath
().
contains
(
getPackageName
()))
{
FileUtil
.
delete
(
mLocalFile
);
}
mLocalFile
=
null
;
ABookCheckWebViewHelper
.
getInstance
().
decodeToImage
(
data
,
imagePath
);
//アプリ内のファイルのみ削除(Galleryファイルは削除しない)
if
(
mLocalFile
!=
null
&&
mLocalFile
.
getPath
().
contains
(
getPackageName
()))
{
FileUtil
.
delete
(
mLocalFile
);
}
mLocalFile
=
null
;
//編集可能可否をチェックする。
if
(
mEnablePhotoEdit
.
equals
(
"1"
))
{
//編集の場合、編集画面を開ける。
commonOpenEditPage
();
}
}
catch
(
Exception
e
)
{
isError
=
true
;
Logger
.
e
(
TAG
,
e
);
}
}
afterABookCheckApi
(
mCmd
,
taskKey
,
isError
?
1
:
0
,
""
,
null
);
}
protected
Uri
attachmentImageProcessing
(
Uri
uri
)
throws
Exception
{
if
(
uri
==
null
)
{
return
null
;
}
String
[]
operationion
=
{
MediaStore
.
MediaColumns
.
DATA
};
Cursor
cursor
=
getContentResolver
().
query
(
uri
,
operationion
,
null
,
null
,
null
);
String
photoFilePath
=
ABookCheckWebViewHelper
.
getInstance
().
contentSchemeUriToFilePath
(
cursor
);
try
{
}
catch
(
Exception
e
)
{
isError
=
true
;
Logger
.
e
(
TAG
,
e
);
}
}
afterABookCheckApi
(
mCmd
,
taskKey
,
isError
?
1
:
0
,
""
,
null
);
}
protected
Uri
attachmentImageProcessing
(
Uri
uri
)
throws
Exception
{
if
(
uri
==
null
)
{
return
null
;
}
String
[]
operationion
=
{
MediaStore
.
MediaColumns
.
DATA
};
Cursor
cursor
=
getContentResolver
().
query
(
uri
,
operationion
,
null
,
null
,
null
);
String
photoFilePath
=
ABookCheckWebViewHelper
.
getInstance
().
contentSchemeUriToFilePath
(
cursor
);
try
{
int
rotationAngle
=
ABookCheckWebViewHelper
.
getInstance
().
rotateBitmapOrientation
(
photoFilePath
);
if
(
rotationAngle
==
0
)
{
mLocalFile
=
new
File
(
photoFilePath
);
...
...
@@ -1215,106 +1217,106 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
catch
(
FileNotFoundException
e
)
{
Logger
.
e
(
TAG
,
"image file is not found"
,
e
);
}
return
null
;
}
public
void
afterABookCheckApi
(
final
String
cmd
,
final
String
taskKey
,
final
int
result
,
final
String
message
,
final
String
extParam
)
{
afterABookCheckApi
(
cmd
,
taskKey
,
result
,
message
,
extParam
,
false
);
}
public
void
afterABookCheckApi
(
final
String
cmd
,
final
String
taskKey
,
final
int
result
,
final
String
message
,
final
String
extParam
,
final
boolean
isParent
)
{
Logger
.
v
(
TAG
,
"run javaScript for ABookCheck : cmd=%s, taskKey=%s, result=%s, message=%s"
,
cmd
,
taskKey
,
result
,
message
);
final
String
finalParent
=
isParent
?
"window.parent."
:
""
;
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
extParam
!=
null
)
{
Logger
.
i
(
TAG
,
String
.
format
(
"javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s', %s)"
,
finalParent
,
cmd
,
taskKey
,
result
,
message
,
extParam
));
webViewLoadUrl
(
String
.
format
(
"javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s', %s)"
,
finalParent
,
cmd
,
taskKey
,
result
,
message
,
extParam
));
}
else
{
Logger
.
i
(
TAG
,
String
.
format
(
"javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')"
,
finalParent
,
cmd
,
taskKey
,
result
,
message
));
webViewLoadUrl
(
String
.
format
(
"javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')"
,
finalParent
,
cmd
,
taskKey
,
result
,
message
));
}
return
null
;
}
public
void
afterABookCheckApi
(
final
String
cmd
,
final
String
taskKey
,
final
int
result
,
final
String
message
,
final
String
extParam
)
{
afterABookCheckApi
(
cmd
,
taskKey
,
result
,
message
,
extParam
,
false
);
}
public
void
afterABookCheckApi
(
final
String
cmd
,
final
String
taskKey
,
final
int
result
,
final
String
message
,
final
String
extParam
,
final
boolean
isParent
)
{
Logger
.
v
(
TAG
,
"run javaScript for ABookCheck : cmd=%s, taskKey=%s, result=%s, message=%s"
,
cmd
,
taskKey
,
result
,
message
);
final
String
finalParent
=
isParent
?
"window.parent."
:
""
;
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
extParam
!=
null
)
{
Logger
.
i
(
TAG
,
String
.
format
(
"javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s', %s)"
,
finalParent
,
cmd
,
taskKey
,
result
,
message
,
extParam
));
webViewLoadUrl
(
String
.
format
(
"javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s', %s)"
,
finalParent
,
cmd
,
taskKey
,
result
,
message
,
extParam
));
}
else
{
Logger
.
i
(
TAG
,
String
.
format
(
"javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')"
,
finalParent
,
cmd
,
taskKey
,
result
,
message
));
webViewLoadUrl
(
String
.
format
(
"javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')"
,
finalParent
,
cmd
,
taskKey
,
result
,
message
));
}
}
});
}
protected
void
commonConfigureHeader
()
{
}
/**
* 添付ファイルのBase64文字列取得
*/
public
void
getAttachedDataUrl
(
final
String
taskKey
)
{
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
webViewLoadUrl
(
"javascript:android.getAttachedDataUrl('"
+
taskKey
+
"', CHK.getAttachedDataUrl())"
);
}
});
}
});
}
protected
void
commonConfigureHeader
()
{
}
/**
* 添付ファイルのBase64文字列取得
*/
public
void
getAttachedDataUrl
(
final
String
taskKey
)
{
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
webViewLoadUrl
(
"javascript:android.getAttachedDataUrl('"
+
taskKey
+
"', CHK.getAttachedDataUrl())"
);
}
});
}
public
void
openEditPage
(){
webViewLoadUrl
(
"javascript:android.openEditPage()"
);
}
/**
* 位置情報取得
* @param showPermissionDialogFlg
*/
// #32926 作業報告画面改善 start
protected
void
setLocation
(
final
boolean
showPermissionDialogFlg
)
{
// #32926 作業報告画面改善 end
ABookPermissionHelper
helper
=
new
ABookPermissionHelper
(
this
,
Constant
.
ABookPermissionType
.
AccessFineLocation
,
null
);
if
(
helper
.
checkMultiPermissions
(
showPermissionDialogFlg
))
{
// 位置情報取得
LocationManagerUtil
locationManagerUtil
=
new
LocationManagerUtil
(
this
,
new
LocationManagerUtil
.
LocationManagerUtilListener
()
{
@Override
public
void
onGetLocationFailed
()
{
Logger
.
w
(
TAG
,
"onGetLocationFailed"
);
// #32926 作業報告画面改善 end
afterABookCheckApi
(
mCmd
,
""
,
1
,
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
/**
* 位置情報取得
* @param showPermissionDialogFlg
*/
// #32926 作業報告画面改善 start
protected
void
setLocation
(
final
boolean
showPermissionDialogFlg
)
{
// #32926 作業報告画面改善 end
ABookPermissionHelper
helper
=
new
ABookPermissionHelper
(
this
,
Constant
.
ABookPermissionType
.
AccessFineLocation
,
null
);
if
(
helper
.
checkMultiPermissions
(
showPermissionDialogFlg
))
{
// 位置情報取得
LocationManagerUtil
locationManagerUtil
=
new
LocationManagerUtil
(
this
,
new
LocationManagerUtil
.
LocationManagerUtilListener
()
{
@Override
public
void
onGetLocationFailed
()
{
Logger
.
w
(
TAG
,
"onGetLocationFailed"
);
// #32926 作業報告画面改善 end
afterABookCheckApi
(
mCmd
,
""
,
1
,
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
msg_location_search_fail
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)),
null
);
}
@Override
public
void
onGetLocation
(
final
Location
location
)
{
latitude
=
location
.
getLatitude
();
longitude
=
location
.
getLongitude
();
Logger
.
v
(
TAG
,
"location latitude(%s), longitude(%s)"
,
latitude
,
longitude
);
CommonExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
}
@Override
public
void
onGetLocation
(
final
Location
location
)
{
latitude
=
location
.
getLatitude
();
longitude
=
location
.
getLongitude
();
Logger
.
v
(
TAG
,
"location latitude(%s), longitude(%s)"
,
latitude
,
longitude
);
CommonExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"latitude"
,
latitude
);
json
.
put
(
"longitude"
,
longitude
);
afterABookCheckApi
(
mCmd
,
""
,
0
,
""
,
json
.
toString
());
};
});
}
});
locationManagerUtil
.
startLocationService
();
}
else
{
Logger
.
w
(
TAG
,
"onGetLocationFailed AccessFineLocation false"
);
});
}
});
locationManagerUtil
.
startLocationService
();
}
else
{
Logger
.
w
(
TAG
,
"onGetLocationFailed AccessFineLocation false"
);
// リソースパターンの適用
afterABookCheckApi
(
mCmd
,
""
,
1
,
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
msg_location_search_fail
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)),
null
);
}
}
}
protected
boolean
isOperationPdf
()
{
return
isOperationPdf
;
}
protected
boolean
isOperationPdf
()
{
return
isOperationPdf
;
}
/**
* 報告可能フラグ
* @return
*/
public
boolean
isReportEdit
()
{
return
mEnableReportEdit
==
Constant
.
EnableReportEdit
.
YES
;
}
return
mEnableReportEdit
==
Constant
.
EnableReportEdit
.
YES
;
}
/**
* PDF操作インスタンスを作成
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVUIActivity.java
View file @
2044e9c0
...
...
@@ -240,6 +240,35 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
// ログ送信可否を確認
LogUtil
.
checkSendLogFlag
();
}
}
catch
(
ABVException
e
)
{
stopUpdateAnimation
();
switch
(
e
.
getCode
())
{
case
C_I_CONTENT_0001:
handleErrorMessageToast
(
ABVExceptionCode
.
C_I_CONTENT_0001
);
break
;
case
S_E_ACMS_1403:
// 再ログイン
onAuthenticationFailed
();
break
;
case
C_I_CONTENT_0002:
// コンテンツダウンロード中は自動更新を行わない。
if
(!
isAutoRefresh
)
{
handleErrorMessageToast
(
ABVExceptionCode
.
C_I_CONTENT_0002
);
}
break
;
case
S_E_ACMS_0500:
handleErrorMessageToast
(
ABVExceptionCode
.
S_E_ACMS_0500
);
break
;
case
S_E_ACMS_INVALID_RESPONSE:
// サーバー通信エラー時、エラーメッセージ表示
handleErrorMessageToast
(
ABVExceptionCode
.
S_E_ACMS_INVALID_RESPONSE
);
break
;
default
:
Logger
.
e
(
TAG
,
"Exception DataRefresh"
,
e
);
handleErrorMessageToast
(
ErrorCode
.
E107
);
break
;
}
throw
e
;
}
catch
(
Exception
e
)
{
stopUpdateAnimation
();
if
(
startRefresh
)
{
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/constant/ErrorCode.java
View file @
2044e9c0
...
...
@@ -54,6 +54,7 @@ public enum ErrorCode {
L121
(
R
.
string
.
L121
),
L122
(
R
.
string
.
L122
),
L124
(
R
.
string
.
L124
),
L125
(
R
.
string
.
L125
),
C_E_SYSTEM_0001
(
R
.
string
.
C_E_SYSTEM_0001
),
C_E_SYSTEM_0002
(
R
.
string
.
C_E_SYSTEM_0002
),
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
View file @
2044e9c0
...
...
@@ -133,17 +133,6 @@ public class OperationListActivity extends ABVUIActivity {
private
TextView
mEndDate
;
// 検索画面の作業終了日
private
Dialog
mSearchDialog
;
private
Date
mOperationLastEditDate
;
private
OperationDao
mOperationDao
=
AbstractDao
.
getDao
(
OperationDao
.
class
);
private
OperationContentDao
mOperationContentDao
=
AbstractDao
.
getDao
(
OperationContentDao
.
class
);
private
TaskReportDao
mTaskReportDao
=
AbstractDao
.
getDao
(
TaskReportDao
.
class
);
private
OperationLogic
mOperationLogic
=
AbstractLogic
.
getLogic
(
OperationLogic
.
class
);
private
OperationGroupMasterLogic
mOperationGroupMasterLogic
=
AbstractLogic
.
getLogic
(
OperationGroupMasterLogic
.
class
);
private
PushMessageLogic
mPushMessageLogic
=
AbstractLogic
.
getLogic
(
PushMessageLogic
.
class
);
private
TaskDao
mTaskDao
=
AbstractDao
.
getDao
(
TaskDao
.
class
);
private
boolean
activityResultFlg
;
...
...
@@ -922,6 +911,7 @@ public class OperationListActivity extends ABVUIActivity {
* @param buttonEventFlag
* @return result errorMessage
*/
@Override
public
String
syncOperation
(
final
long
operationId
,
int
reportType
,
boolean
buttonEventFlag
)
{
final
StringBuilder
errorMsg
=
new
StringBuilder
();
Logger
.
i
(
TAG
,
"---sync start"
);
...
...
@@ -1082,6 +1072,7 @@ public class OperationListActivity extends ABVUIActivity {
* @throws NoSuchAlgorithmException
* @throws ZipException
*/
@Override
public
Date
receptionTaskData
(
long
operationId
,
Callback
progressCallback
,
StringBuilder
errorMsg
)
throws
NetworkDisconnectedException
,
ABVException
,
IOException
,
InterruptedException
,
NoSuchAlgorithmException
,
ZipException
{
GetOperationDataParameters
param
=
new
GetOperationDataParameters
(
ABVDataCache
.
getInstance
().
getMemberInfo
().
sid
,
operationId
);
OperationDto
operationDto
=
mOperationLogic
.
getOperation
(
operationId
);
...
...
@@ -1216,80 +1207,9 @@ public class OperationListActivity extends ABVUIActivity {
return
lastEditDate
;
}
/**
* 添付ファイルが存在する場合、取得して解凍する。
* @param operationId
* @param taskReportLevel
* @param contentId
* @param taskId
* @param taskKey
* @param attachedFileName
* @param processKey 固定キー
* @param phaseNo 固定NO
* @throws ABVException
* @throws InterruptedException
* @throws ZipException
* @throws NoSuchAlgorithmException
* @throws IOException
*/
public
void
refreshTaskFile
(
final
long
operationId
,
final
int
taskReportLevel
,
long
contentId
,
final
long
taskId
,
final
String
taskKey
,
final
String
attachedFileName
,
final
String
processKey
,
final
Integer
phaseNo
)
throws
Exception
{
// 既存の添付ディレクトリ削除
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getTempTaskDirPath
(
contentId
,
taskKey
));
String
reportLocalAttachedFileName
=
mTaskReportDao
.
getTaskReportAttachedFileName
(
taskKey
,
taskReportLevel
);
if
(
attachedFileName
!=
null
&&
!
attachedFileName
.
equals
(
reportLocalAttachedFileName
))
{
Logger
.
i
(
TAG
,
"[Get Task Report Files] operationId=%s, taskKey=%s, taskId=%s, attachedFileName=%s"
,
operationId
,
taskKey
,
taskId
,
attachedFileName
);
// #32926 start
String
saveAttacedFilePath
=
ABVEnvironment
.
getInstance
().
getOperationTaskReportLevelDirPath
(
operationId
,
taskKey
,
taskReportLevel
);
if
(
processKey
!=
null
&&
phaseNo
!=
0
)
{
saveAttacedFilePath
=
ABVEnvironment
.
getInstance
().
getOperationDirectionOrContinuousReportDirPath
(
operationId
,
taskKey
,
taskReportLevel
,
processKey
,
phaseNo
);
}
FileUtil
.
delete
(
saveAttacedFilePath
);
// #32926 end
String
outputFilePath
=
mOperationLogic
.
getTaskFile
(
operationId
,
taskKey
,
taskId
,
attachedFileName
,
taskReportLevel
);
ContentFileExtractor
.
getInstance
().
extractZipFile
(
contentId
,
outputFilePath
,
saveAttacedFilePath
,
null
,
true
);
}
}
/**
* 定期点検用ファイル更新
* @param operationId
* @param contentId
* @param taskId
* @param taskKey
* @param taskReportId
* @param reportStartDate
* @param reportAttachedFileName
* @throws ABVException
* @throws InterruptedException
* @throws ZipException
* @throws NoSuchAlgorithmException
* @throws IOException
*/
public
void
refreshRoutineTaskFile
(
final
long
operationId
,
final
long
contentId
,
final
long
taskId
,
final
String
taskKey
,
final
int
taskReportId
,
final
int
taskReportInfoId
,
final
Date
reportStartDate
,
final
String
reportAttachedFileName
)
throws
Exception
{
String
reportStartDateHypn
=
DateTimeUtil
.
toString
(
reportStartDate
,
DateTimeFormat
.
yyyyMMddHHmmss_hyphen
);
final
String
reportStartDateNone
=
DateTimeUtil
.
toString_yyyyMMddHHmmss_none
(
reportStartDate
);
// 既存の添付ディレクトリ削除
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getTempTaskDirPath
(
contentId
,
taskKey
));
String
reportLocalAttachedFileName
=
mTaskReportDao
.
getRoutineTaskReportAttachedFileName
(
taskKey
,
taskReportId
,
reportStartDateHypn
);
boolean
getReportFileFlg
=
!
StringUtil
.
isNullOrEmpty
(
reportAttachedFileName
)
&&
!
reportAttachedFileName
.
equals
(
reportLocalAttachedFileName
);
if
(
getReportFileFlg
)
{
Logger
.
i
(
TAG
,
"[Get Task Report Files] operationId=%s, taskKey=%s, taskId=%s, attachedFileName=%s"
,
operationId
,
taskKey
,
taskId
,
reportAttachedFileName
);
// #32926 start
int
taskReportLevel
=
0
;
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
reportStartDateNone
));
// #32926 end
String
outputFilePath
=
mOperationLogic
.
getRoutineTaskReportFile
(
operationId
,
taskKey
,
taskId
,
taskReportId
,
taskReportInfoId
,
reportStartDateNone
,
reportAttachedFileName
);
// #32926 start
ContentFileExtractor
.
getInstance
().
extractZipFile
(
contentId
,
outputFilePath
,
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
reportStartDateNone
),
null
,
true
);
// #32926 end
}
}
/**
* 360コンテンツ登録ダイアログ
...
...
@@ -1373,47 +1293,6 @@ public class OperationListActivity extends ABVUIActivity {
}
/**
* listDtoの中に第2引数のdtoが存在するかチェックメソッド
* @param listDto リストDto
* @param dto ターゲットDto
* @return
*/
private
boolean
isExistsTaskInList
(
List
<
TaskDto
>
listDto
,
TaskDto
dto
)
{
for
(
TaskDto
lDto
:
listDto
)
{
if
(
lDto
.
taskKey
.
equals
(
dto
.
taskKey
))
{
return
true
;
}
}
return
false
;
}
/**
* 報告存在チェック
* @param listDto
* @param rDto
* @return
*/
private
boolean
isExistsTaskReportInList
(
List
<
TaskReportDto
>
listDto
,
TaskReportDto
rDto
,
boolean
isRoutineTask
)
{
for
(
TaskReportDto
lDto
:
listDto
)
{
if
(
isRoutineTask
)
{
// 定期点検の場合、taskKey,taskReportId,reportStartDateで判定
if
(
lDto
.
taskKey
.
equals
(
rDto
.
taskKey
)
&&
lDto
.
taskReportId
==
rDto
.
taskReportId
&&
lDto
.
reportStartDate
.
equals
(
rDto
.
reportStartDate
))
{
return
true
;
}
}
else
{
// taskKeyと作業報告階層で判定
if
(
lDto
.
taskKey
.
equals
(
rDto
.
taskKey
)
&&
lDto
.
taskReportLevel
==
rDto
.
taskReportLevel
)
{
return
true
;
}
}
}
return
false
;
}
/**
* 作業報告画面に移動
* @param operationDto
*/
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/ContentViewActivity.java
View file @
2044e9c0
...
...
@@ -4957,7 +4957,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
// 空き容量が足りない
handleErrorMessageToast
(
ErrorCode
.
STORAGE_ERROR
);
}
else
{
handleErrorMessageToast
(
ErrorCode
.
L12
0
);
handleErrorMessageToast
(
ErrorCode
.
L12
5
);
}
}
});
...
...
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