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
9ac153e2
Commit
9ac153e2
authored
Mar 18, 2019
by
Jeong Gilmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#32926 作業報告画面改善(Android)
parent
94802da9
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
327 additions
and
191 deletions
+327
-191
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/ABVEnvironment.java
+54
-29
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/Constant.java
+8
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/OperationDto.java
+4
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/TaskReportDto.java
+10
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
+115
-91
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
+23
-8
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
+29
-10
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookCheckWebViewHelper.java
+55
-42
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ActivityHandlingHelper.java
+5
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/OzdFileHelper.java
+10
-4
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/CheckOZDViewActivity.java
+12
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/view/OperationTaskLayout.java
+2
-5
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/ABVEnvironment.java
View file @
9ac153e2
...
...
@@ -114,10 +114,10 @@ public class ABVEnvironment {
public
static
final
String
OperationDirFormat
=
"%s/ABook/projects/%d"
;
public
static
final
String
OperationTaskKeyDirFormat
=
"%s/ABook/projects/%d/%s"
;
public
static
final
String
OperationTaskKeyReportSendDirFormat
=
OperationTaskKeyDirFormat
+
"/reportSend/%d"
;
public
static
final
String
OperationTaskKeyRoutineTaskReportSendDirFormat
=
OperationTaskKeyDirFormat
+
"/reportSend/%d/%s/%d"
;
public
static
final
String
OperationTaskKeyRoutineTaskReportSendDirFormatForDelete
=
OperationTaskKeyDirFormat
+
"/reportSend/%d/%s"
;
public
static
final
String
OperationTaskKeyRoutineTaskReportDirFormat
=
OperationTaskKeyDirFormat
+
"/report/%d/%s"
;
//
public static final String OperationTaskKeyReportSendDirFormat = OperationTaskKeyDirFormat + "/reportSend/%d";
//
public static final String OperationTaskKeyRoutineTaskReportSendDirFormat = OperationTaskKeyDirFormat + "/reportSend/%d/%s/%d";
//
public static final String OperationTaskKeyRoutineTaskReportSendDirFormatForDelete = OperationTaskKeyDirFormat + "/reportSend/%d/%s";
//
public static final String OperationTaskKeyRoutineTaskReportDirFormat = OperationTaskKeyDirFormat + "/report/%d/%s";
public
static
final
String
PanoImageDirFormat
=
"%s/panoImage"
;
public
static
final
String
PanoImageFileFormat
=
"%s/panoImage.zip"
;
public
static
final
String
TaskPdfDirFormat
=
"%s/taskPdf"
;
...
...
@@ -135,8 +135,8 @@ public class ABVEnvironment {
// public static final String TempTaskKeyDirFormat = TempTaskDirFormat + "/%s/%s";
// #32926 end
public
static
final
String
SavedOzFileFormat
=
OperationDirectionOrReportDirFormat
+
"/%s"
;
public
static
final
String
RoutineTaskSavedOzFileFormat
=
OperationDirectionOrReportDirFormat
+
"/%d/%s/%s"
;
//
public static final String SavedOzFileFormat = OperationDirectionOrReportDirFormat + "/%s";
//
public static final String RoutineTaskSavedOzFileFormat = OperationDirectionOrReportDirFormat + "/%d/%s/%s";
public
static
final
String
DefaultOzFileFormat
=
ContentCacheDirectoryFormat
+
"/%s"
;
public
static
final
String
TempTaskFileFormat
=
TempTaskKeyDirFormat
+
"/%s"
;
public
static
final
String
AttachedMoviesDirFormat
=
"%s/%d/attachedMovie"
;
...
...
@@ -144,6 +144,18 @@ public class ABVEnvironment {
public
static
final
String
AttachedMoviesRoutineTaskTypeDir
=
AttachedMoviesDirFormat
+
"/%s/report/%d/%s"
;
public
static
final
String
CacheTempAttachedImageFormat
=
"%s/temp/attachedImage"
;
// #32926 start
// 作業報告レベル(taskReportLevel)によってディレクトリを追加する
public
static
final
String
TaskReportLevelDir
=
"/%s"
;
public
static
final
String
SavedOzFileFormat
=
OperationDirectionOrReportDirFormat
+
TaskReportLevelDir
+
"/%s"
;
public
static
final
String
RoutineTaskSavedOzFileFormat
=
OperationDirectionOrReportDirFormat
+
TaskReportLevelDir
+
"/%d/%s/%s"
;
public
static
final
String
OperationTaskKeyReportSendDirFormat
=
OperationTaskKeyDirFormat
+
TaskReportLevelDir
+
"/reportSend/%d"
;
public
static
final
String
OperationTaskKeyRoutineTaskReportSendDirFormat
=
OperationTaskKeyDirFormat
+
TaskReportLevelDir
+
"/reportSend/%d/%s/%d"
;
public
static
final
String
OperationTaskKeyRoutineTaskReportSendDirFormatForDelete
=
OperationTaskKeyDirFormat
+
TaskReportLevelDir
+
"/reportSend/%d/%s"
;
public
static
final
String
OperationTaskKeyRoutineTaskReportDirFormat
=
OperationTaskKeyDirFormat
+
TaskReportLevelDir
+
"/report/%d/%s"
;
// #32926 end
/**
* コンテンツのファイルを暗号化するときに、暗号化するサイズをバイト単位で指定します。
* @since 1.0.0
...
...
@@ -609,6 +621,20 @@ public class ABVEnvironment {
return
String
.
format
(
SavedOzFileFormat
,
rootDirectory
,
operationId
,
taskKey
,
"report"
,
fileName
);
}
// #32926 start
/**
* 保存されたOZファイルパス
* @param operationId
* @param taskKey
* @param fileName
* @param taskReportLevel
* @return ファイルパス
*/
public
String
getSavedOzFileTaskReportLevelPath
(
long
operationId
,
String
taskKey
,
String
fileName
,
String
taskReportLevel
)
{
return
String
.
format
(
SavedOzFileFormat
,
rootDirectory
,
operationId
,
taskKey
,
taskReportLevel
,
"report"
,
fileName
);
}
// #32926 end
/**
* 保存されたOZファイルパス、定期点検用
* @param operationId
...
...
@@ -618,8 +644,11 @@ public class ABVEnvironment {
* @param fileName
* @return
*/
public
String
getRoutineTaskSavedOzFilePath
(
long
operationId
,
String
taskKey
,
int
taskReportId
,
String
reportStartDate
,
String
fileName
)
{
return
String
.
format
(
RoutineTaskSavedOzFileFormat
,
rootDirectory
,
operationId
,
taskKey
,
"report"
,
taskReportId
,
reportStartDate
,
fileName
);
public
String
getRoutineTaskSavedOzFilePath
(
long
operationId
,
String
taskKey
,
int
taskReportId
,
String
reportStartDate
,
String
fileName
,
String
taskReportLevel
)
{
// #32926 start
// return String.format(RoutineTaskSavedOzFileFormat, rootDirectory, operationId, taskKey, "report", taskReportId, reportStartDate, fileName);
return
String
.
format
(
RoutineTaskSavedOzFileFormat
,
rootDirectory
,
operationId
,
taskKey
,
"report"
,
taskReportLevel
,
taskReportId
,
reportStartDate
,
fileName
);
// #32926 end
}
/**
...
...
@@ -644,19 +673,6 @@ public class ABVEnvironment {
return
String
.
format
(
TempTaskFileFormat
,
cacheDirectory
,
contentId
,
taskKey
,
fileName
);
}
// #32926 start
/**
* 臨時保存したファイルパス
* @param contentId
* @param taskKey
* @param fileName
* @return ファイルパス
*/
// public String getTempFilePath(long contentId, String taskKey, String taskReportLevel, String fileName) {
// return String.format(TempTaskFileFormat + "/%s", cacheDirectory, contentId, taskKey, taskReportLevel, fileName);
// }
// #32926 end
/**
* * 臨時保存したタスクキーのディレクトリファイルパス
* 例)../caches/[contentId]/temp/[task_key]
...
...
@@ -689,21 +705,23 @@ public class ABVEnvironment {
return
String
.
format
(
OperationTaskKeyDirFormat
,
rootDirectory
,
operationId
,
taskKey
);
}
public
String
getOperationTaskReportSendDirFilePath
(
long
operationId
,
String
taskKey
,
int
taskReportSendId
)
{
return
String
.
format
(
OperationTaskKeyReportSendDirFormat
,
rootDirectory
,
operationId
,
taskKey
,
taskReportSendId
);
// #32926 start
public
String
getOperationTaskReportSendDirFilePath
(
long
operationId
,
String
taskKey
,
int
taskReportSendId
,
int
taskReportLevel
)
{
return
String
.
format
(
OperationTaskKeyReportSendDirFormat
,
rootDirectory
,
operationId
,
taskKey
,
String
.
valueOf
(
taskReportLevel
),
taskReportSendId
);
}
public
String
getRoutineTaskReportSendDirFilePath
(
long
operationId
,
String
taskKey
,
int
taskReportId
,
String
reportStartDate
)
{
return
String
.
format
(
OperationTaskKeyRoutineTaskReportSendDirFormatForDelete
,
rootDirectory
,
operationId
,
taskKey
,
taskReportId
,
getReportDate
(
reportStartDate
));
public
String
getRoutineTaskReportSendDirFilePath
(
long
operationId
,
String
taskKey
,
int
taskReportId
,
String
reportStartDate
,
int
taskReportLevel
)
{
return
String
.
format
(
OperationTaskKeyRoutineTaskReportSendDirFormatForDelete
,
rootDirectory
,
operationId
,
taskKey
,
String
.
valueOf
(
taskReportLevel
),
taskReportId
,
getReportDate
(
reportStartDate
));
}
public
String
getRoutineTaskReportSendDirFilePath
(
long
operationId
,
String
taskKey
,
int
taskReportId
,
String
reportStartDate
,
int
taskReportSendId
)
{
return
String
.
format
(
OperationTaskKeyRoutineTaskReportSendDirFormat
,
rootDirectory
,
operationId
,
taskKey
,
taskReportId
,
getReportDate
(
reportStartDate
),
taskReportSendId
);
public
String
getRoutineTaskReportSendDirFilePath
(
long
operationId
,
String
taskKey
,
int
taskReportId
,
String
reportStartDate
,
int
taskReportSendId
,
int
taskReportLevel
)
{
return
String
.
format
(
OperationTaskKeyRoutineTaskReportSendDirFormat
,
rootDirectory
,
operationId
,
taskKey
,
String
.
valueOf
(
taskReportLevel
),
taskReportId
,
getReportDate
(
reportStartDate
),
taskReportSendId
);
}
public
String
getRoutineTaskReportDirFilePath
(
long
operationId
,
String
taskKey
,
int
taskReportId
,
String
reportStartDate
)
{
return
String
.
format
(
OperationTaskKeyRoutineTaskReportDirFormat
,
rootDirectory
,
operationId
,
taskKey
,
taskReportId
,
getReportDate
(
reportStartDate
));
public
String
getRoutineTaskReportDirFilePath
(
long
operationId
,
String
taskKey
,
int
taskReportId
,
String
reportStartDate
,
int
taskReportLevel
)
{
return
String
.
format
(
OperationTaskKeyRoutineTaskReportDirFormat
,
rootDirectory
,
operationId
,
taskKey
,
String
.
valueOf
(
taskReportLevel
),
taskReportId
,
getReportDate
(
reportStartDate
));
}
// #32926 end
public
String
getOperationDirectionOrReportDirPath
(
long
operationId
,
String
taskKey
,
boolean
directionFlg
)
{
if
(
directionFlg
)
{
...
...
@@ -712,6 +730,13 @@ public class ABVEnvironment {
return
String
.
format
(
OperationDirectionOrReportDirFormat
,
rootDirectory
,
operationId
,
taskKey
,
REPORT
);
}
// #32926 start
// taskReportLevelの値によってディレクトリを構成
public
String
getOperationTaskReportLevelDirPath
(
long
operationId
,
String
taskKey
,
String
taskReportLevel
)
{
return
String
.
format
(
OperationDirectionOrReportDirFormat
,
rootDirectory
,
operationId
,
taskKey
,
taskReportLevel
);
}
// #32926 end
public
String
getOperationReportSendDirPath
(
long
operationId
,
String
taskKey
)
{
return
String
.
format
(
OperationDirectionOrReportDirFormat
,
rootDirectory
,
operationId
,
taskKey
,
REPORT_SEND
);
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/Constant.java
View file @
9ac153e2
...
...
@@ -140,4 +140,12 @@ public class Constant {
int
Camera
=
2
;
int
Audio
=
3
;
}
// #32926 start
public
interface
ReportType
{
int
Report
=
0
;
// 報告
int
Routine
=
1
;
// 定期点検
int
Report_Answer
=
2
;
// 報告(回答)
}
// #32926 end
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/OperationDto.java
View file @
9ac153e2
...
...
@@ -30,6 +30,10 @@ public class OperationDto extends AbstractDto {
public
String
reportPeriod
;
//定期点検、2018/12/20 08:10:00 ~ 2018/12/21 18:10:00
public
int
reportCount
;
//定期点検、作業数
// #32926 start
public
int
reportType
;
// 作業報告タイプ 0:報告 1:定期点検 2:報告(回答)
// #32926 end
public
boolean
equalsLastEdit
(
OperationDto
dto
)
{
if
(
dto
!=
null
)
{
if
(
operationId
.
equals
(
dto
.
operationId
)
&&
lastEditDate
.
equals
(
dto
.
lastEditDate
))
{
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/TaskReportDto.java
View file @
9ac153e2
package
jp
.
agentec
.
abook
.
abv
.
bl
.
dto
;
import
java.util.Date
;
/**
* Created by leej on 2018/09/10.
*/
...
...
@@ -17,6 +19,14 @@ public class TaskReportDto extends AbstractDto {
// #32782 指示者テーブル関連削除 start
public
boolean
reporterFlag
;
public
int
taskReportLevel
;
// 作業報告レベル
public
int
taskHasAuthority
;
// 権限
public
int
taskReportId
;
// 作業報告ID
public
int
taskReportInfoId
;
// 作業報告情報ID
public
Date
reportStartDate
;
// 作業開始日
public
Date
reportEndDate
;
// 作業終了日
public
int
enableReport
;
// 報告可能区分
public
boolean
reportedFlag
;
//
// #32782 指示者テーブル関連削除 end
@Override
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
View file @
9ac153e2
...
...
@@ -86,7 +86,10 @@ public class OperationLogic extends AbstractLogic {
private
TaskReportDao
mTaskReportDao
=
AbstractDao
.
getDao
(
TaskReportDao
.
class
);
private
TaskReportSendDao
mTaskReportSendDao
=
AbstractDao
.
getDao
(
TaskReportSendDao
.
class
);
private
TaskReportItemsDao
mTaskReportItemsDao
=
AbstractDao
.
getDao
(
TaskReportItemsDao
.
class
);
// #32926 start
// TODO delete RoutineTaskReportDao
private
RoutineTaskReportDao
mRoutineTaskReportDao
=
AbstractDao
.
getDao
(
RoutineTaskReportDao
.
class
);
// #32926 end
private
PushMessageDao
mPushMessageDao
=
AbstractDao
.
getDao
(
PushMessageDao
.
class
);
...
...
@@ -274,14 +277,6 @@ public class OperationLogic extends AbstractLogic {
String
tempDirPath
=
ABVEnvironment
.
getInstance
().
getTempTaskDirPath
(
contentId
,
taskKey
);
// #32926 start
// TODO 一時的理療する削除対象
// test start
int
taskReportLevel
=
0
;
// test end
// tempDirPath = String.format(tempDirPath + "/%s", String.valueOf(taskReportLevel));
// #32926 end
//添付ファイル変更の場合、以下の処理を行う
JSONObject
attachedListJson
=
taskDirectionsJson
.
getJSONObject
(
"attached"
);
List
<
String
>
attachedFileNames
=
JSONObject
.
getValues
(
attachedListJson
);
...
...
@@ -362,13 +357,7 @@ public class OperationLogic extends AbstractLogic {
mTaskDirectionsDao
.
update
(
taskDirectionsDto
);
mTaskDao
.
update
(
taskDto
);
String
tempDirPath
=
ABVEnvironment
.
getInstance
().
getTempTaskDirPath
(
contentId
,
taskKey
);
// #32926 start
// TODO 一時的理療する削除対象
// test start
int
taskReportLevel
=
0
;
// test end
// tempDirPath = String.format(tempDirPath + "/%s", String.valueOf(taskReportLevel));
// #32926 end
String
operationDrectionOrReportDirPath
=
ABVEnvironment
.
getInstance
().
getOperationDirectionOrReportDirPath
(
operationId
,
taskKey
,
true
);
if
(
taskDirectionsDto
.
attachedFileSendFlg
)
{
//添付ファイル変更の場合、以下の処理を行う
...
...
@@ -574,12 +563,14 @@ public class OperationLogic extends AbstractLogic {
//添付ファイル変更の場合、以下の処理を行う
String
tempDirPath
=
ABVEnvironment
.
getInstance
().
getTempTaskDirPath
(
contentId
,
taskKey
);
// #32926 start
// test start
// test start
削除必要
taskReportLevel
=
0
;
// test end
// tempDirPath = String.format(tempDirPath + "/%s", String.valueOf(taskReportLevel));
// TODO 変更必要
// String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, false);
String
operationDrectionOrReportDirPath
=
ABVEnvironment
.
getInstance
().
getOperationTaskReportLevelDirPath
(
operationId
,
taskKey
,
String
.
valueOf
(
taskReportLevel
));
// #32926 end
String
operationDrectionOrReportDirPath
=
ABVEnvironment
.
getInstance
().
getOperationDirectionOrReportDirPath
(
operationId
,
taskKey
,
false
);
JSONObject
attachedListJson
=
taskReportJson
.
getJSONObject
(
"attached"
);
List
<
String
>
attachedFileNames
=
JSONObject
.
getValues
(
attachedListJson
);
...
...
@@ -631,13 +622,10 @@ public class OperationLogic extends AbstractLogic {
String
strReportStartDate
=
DateTimeUtil
.
toString_yyyyMMddHHmmss_none
(
routineTaskReportDto
.
reportStartDate
);
String
tempDirPath
=
ABVEnvironment
.
getInstance
().
getTempTaskDirPath
(
contentId
,
routineTaskReportDto
.
taskKey
);
// #32926 start
// TODO 一時的理療する削除対象
// test start
int
taskReportLevel
=
0
;
// test end
// tempDirPath = String.format(tempDirPath + "/%s", String.valueOf(taskReportLevel));
// TODO routineTaskReportDto -> taskReportDto
// String routineTaskReportDirPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, routineTaskReportDto.taskKey, routineTaskReportDto.taskReportId, strReportStartDate, taskReportDto.taskReportLevel);
String
routineTaskReportDirPath
=
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
routineTaskReportDto
.
taskKey
,
routineTaskReportDto
.
taskReportId
,
strReportStartDate
,
0
);
// #32926 end
String
routineTaskReportDirPath
=
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
routineTaskReportDto
.
taskKey
,
routineTaskReportDto
.
taskReportId
,
strReportStartDate
);
if
(!
StringUtil
.
isNullOrEmpty
(
routineTaskReportDto
.
jsonData
))
{
JSONObject
attachedListJson
=
(
new
JSONObject
(
routineTaskReportDto
.
jsonData
)).
getJSONObject
(
"attached"
);
...
...
@@ -803,10 +791,11 @@ public class OperationLogic extends AbstractLogic {
// test start
taskReportLevel
=
0
;
// test end
// tempDirPath = String.format(tempDirPath + "/%d", taskReportLevel);
// #32926 end
String
operationDrectionOrReportDirPath
=
ABVEnvironment
.
getInstance
().
getOperationDirectionOrReportDirPath
(
operationId
,
taskKey
,
false
);
// TODO 変更必要
// String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, false);
String
operationDrectionOrReportDirPath
=
ABVEnvironment
.
getInstance
().
getOperationTaskReportLevelDirPath
(
operationId
,
taskKey
,
String
.
valueOf
(
taskReportLevel
));
// #32926 end
if
(
taskReportDto
.
attachedFileSendFlg
)
{
//添付ファイル変更の場合、以下の処理を行う
JSONObject
attachedListJson
=
taskReport
.
getJSONObject
(
"attached"
);
...
...
@@ -885,9 +874,10 @@ public class OperationLogic extends AbstractLogic {
// test start
int
taskReportLevel
=
0
;
// test end
// tempDirPath = String.format(tempDirPath + "/%s", String.valueOf(taskReportLevel));
// TODO routineTaskReportDto -> taskReportDto
// String routineTaskReportDirPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, routineTaskReportDto.taskKey, routineTaskReportDto.taskReportId, strReportStartDate, taskReportDto.taskReportLevel);
String
routineTaskReportDirPath
=
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
routineTaskReportDto
.
taskKey
,
routineTaskReportDto
.
taskReportId
,
strReportStartDate
,
0
);
// #32926 end
String
routineTaskReportDirPath
=
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
routineTaskReportDto
.
taskKey
,
routineTaskReportDto
.
taskReportId
,
strReportStartDate
);
if
(
insertFlg
)
{
if
(!
StringUtil
.
isNullOrEmpty
(
routineTaskReportDto
.
jsonData
))
{
...
...
@@ -1045,7 +1035,7 @@ public class OperationLogic extends AbstractLogic {
}
*/
public
void
deleteTaskReport
(
long
operationId
,
long
contentId
,
String
taskKey
)
{
public
void
deleteTaskReport
(
long
operationId
,
long
contentId
,
String
taskKey
,
int
taskReportLevel
)
{
TaskReportDto
taskReportDto
=
mTaskReportDao
.
getTaskReport
(
taskKey
);
if
(
taskReportDto
!=
null
)
{
taskReportDto
.
dataSendFlg
=
true
;
...
...
@@ -1061,16 +1051,13 @@ public class OperationLogic extends AbstractLogic {
}
// 作業報告のディレクトリ削除
// #32926 start
// TODO 一時的理療する削除対象
// test start
int
taskReportLevel
=
0
;
// test end
// String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
// tempDirPath = String.format(tempDirPath + "/%s", String.valueOf(taskReportLevel));
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getTempTaskDirPath
(
contentId
,
taskKey
));
// #32926 start
// TODO 変更必要
// FileUtil.delete(ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, false));
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getOperationTaskReportLevelDirPath
(
operationId
,
taskKey
,
String
.
valueOf
(
taskReportLevel
)));
// #32926 end
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getOperationDirectionOrReportDirPath
(
operationId
,
taskKey
,
false
));
}
// #32782 指示者テーブル関連削除 end
...
...
@@ -1080,7 +1067,11 @@ public class OperationLogic extends AbstractLogic {
* @param contentId
* @param dto
*/
// #32926 start
// TODO RoutineTaskReportDto -> TaskReportDto
// public void deleteRoutineTaskReport(long operationId, long contentId, TaskReportDto dto) {
public
void
deleteRoutineTaskReport
(
long
operationId
,
long
contentId
,
RoutineTaskReportDto
dto
)
{
// #32926 end
mRoutineTaskReportDao
.
delete
(
dto
);
String
reportStartDate
=
DateTimeUtil
.
toString
(
dto
.
reportStartDate
,
DateTimeFormat
.
yyyyMMddHHmmss_hyphen
);
...
...
@@ -1089,19 +1080,17 @@ public class OperationLogic extends AbstractLogic {
reportStartDate
=
DateTimeUtil
.
toString_yyyyMMddHHmmss_none
(
dto
.
reportStartDate
);
// 作業報告のディレクトリ削除
// #32926 start
// TODO 一時的理療する削除対象
// test start
int
taskReportLevel
=
0
;
// test end
// String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, dto.taskKey);
// tempDirPath = String.format(tempDirPath + "/%s", String.valueOf(taskReportLevel));
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getTempTaskDirPath
(
contentId
,
dto
.
taskKey
));
// #32926 end
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
dto
.
taskKey
,
dto
.
taskReportId
,
reportStartDate
));
// #32926 start
// TODO routineTaskReportDto -> taskReportDto
// FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, dto.taskKey, dto.taskReportId, reportStartDate, dto.taskReportLevel));
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
dto
.
taskKey
,
dto
.
taskReportId
,
reportStartDate
,
0
));
// 作業報告送信のディレクトリ削除
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getRoutineTaskReportSendDirFilePath
(
operationId
,
dto
.
taskKey
,
dto
.
taskReportId
,
reportStartDate
));
// TODO routineTaskReportDto -> taskReportDto
// FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, dto.taskKey, dto.taskReportId, reportStartDate, dto.taskReportLevel));
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getRoutineTaskReportSendDirFilePath
(
operationId
,
dto
.
taskKey
,
dto
.
taskReportId
,
reportStartDate
,
0
));
// #32926 end
}
/**
...
...
@@ -1128,17 +1117,11 @@ public class OperationLogic extends AbstractLogic {
}
// 作業報告のディレクトリ削除
// 作業報告のディレクトリ削除
// #32926 start
// TODO 一時的理療する削除対象
// test start
int
taskReportLevel
=
0
;
// test end
// String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
// tempDirPath = String.format(tempDirPath + "/%s", String.valueOf(taskReportLevel));
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getTempTaskDirPath
(
contentId
,
taskKey
));
// #32926 start
// TODO routineTaskReportDto -> taskReportDto
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
reportStartDate
,
0
));
// #32926 end
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
reportStartDate
));
}
/**
...
...
@@ -1200,7 +1183,7 @@ public class OperationLogic extends AbstractLogic {
// #32782 指示者テーブル関連削除 start
// TODO change
/*
public void updateTaskHotspot(String taskKey, Map<String, String> param) {
public void updateTaskHotspot(String taskKey, Map<String, String> param
, int taskReportLevel
) {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
// #32782 指示者テーブル関連削除 start
TaskReportDto taskReportDao = mTaskReportDao.getTaskReport(taskKey);
...
...
@@ -1211,7 +1194,7 @@ public class OperationLogic extends AbstractLogic {
mTaskDao.update(taskDto);
}
*/
public
void
updateTaskHotspot
(
String
taskKey
,
Map
<
String
,
String
>
param
)
{
public
void
updateTaskHotspot
(
String
taskKey
,
Map
<
String
,
String
>
param
,
int
taskReportLevel
)
{
TaskDto
taskDto
=
mTaskDao
.
getTaskByTaskKey
(
taskKey
);
TaskDirectionsDto
taskDirectionsDto
=
mTaskDirectionsDao
.
getTaskDirections
(
taskKey
);
taskDirectionsDto
.
dataSendFlg
=
true
;
...
...
@@ -1406,13 +1389,13 @@ public class OperationLogic extends AbstractLogic {
// #32926 start
// TODO taskGroup -> taskGroup_%s に変更
// 報告と報告(回答)のデータの区分が必要なので、「taskGroup_0」と「taskGroup_1」で形式で作成
// if (taskReportLevel > 0) {
// taskGroupJson.append(String.format("taskGroup_%s", String.valueOf(taskReportLevel)), workerGroupJsonList);
// } else {
// taskGroupJson.put(String.format("taskGroup_%s", taskReportLevel), workerGroupJsonList);
// }
List
<
TaskReportDto
>
taskReportList
=
mTaskReportDao
.
getTaskReportByOperationId
(
operationId
);
for
(
TaskReportDto
dto
:
taskReportList
)
{
taskGroupJson
.
put
(
String
.
format
(
"taskGroup_%s"
,
String
.
valueOf
(
dto
.
taskReportLevel
)),
workerGroupJsonList
);
}
taskGroupJson
.
put
(
"taskGroup"
,
workerGroupJsonList
);
Logger
.
d
(
TAG
,
"createWorkerGroupJson : "
+
taskGroupJson
.
toString
());
Logger
.
d
(
TAG
,
contentPath
+
"/workerGroup.json"
);
// #32926 end
FileUtil
.
createFile
(
contentPath
+
"/workerGroup.json"
,
taskGroupJson
.
toString
());
}
...
...
@@ -1515,26 +1498,32 @@ public class OperationLogic extends AbstractLogic {
public
void
createTaskReportJson
(
Long
operationId
,
String
contentPath
)
throws
IOException
{
List
<
JSONObject
>
taskReportJsonList
=
new
ArrayList
<
JSONObject
>();
JSONObject
taskReportJson
=
new
JSONObject
();
JSONObject
taskReportJsonRow
;
List
<
TaskReportDto
>
taskReportDtoList
=
mTaskReportDao
.
getTaskReportByOperationId
(
operationId
);
// #32926 start
int
taskReportLevel
=
0
;
for
(
TaskReportDto
dto
:
taskReportDtoList
)
{
taskReportJson
.
put
(
ABookKeys
.
TASK_KEY
,
dto
.
taskKey
);
taskReportJsonRow
=
new
JSONObject
();
taskReportLevel
=
dto
.
taskReportLevel
;
// taskReportJson.put(ABookKeys.TASK_KEY, dto.taskKey);
if
(
dto
.
jsonData
!=
null
&&
dto
.
jsonData
.
length
()
>
0
)
{
taskReportJsonRow
.
put
(
ABookKeys
.
TASK_HAS_AUTHORITY
,
dto
.
taskHasAuthority
);
taskReportJsonList
.
add
(
new
JSONObject
(
dto
.
jsonData
));
taskReportJsonList
.
add
(
taskReportJsonRow
);
}
// TODO append taskHasAuthority が必要
// TaskDto taskDto = mTaskDao.getTaskByTaskKey(dto.taskKey);
// taskReportJson.put(ABookKeys.TASK_HAS_AUTHORITY, taskDto.taskHasAuthority);
// TODO delete commnet
// taskReportJsonRow.put(ABookKeys.TASK_HAS_AUTHORITY, dto.taskHasAuthority);
// taskReportJsonList.add(taskReportJson);
}
// TODO
taskReport -> taskReport_%s に変更
//
if (taskReportLevel > 0) {
// taskReportJson.append(String.format("taskReport_%s", String.valueOf(taskReportLevel)), taskReportJsonList
);
//
} else {
// taskReportJson.put(String.format("taskReport_%s
", taskReportLevel), taskReportJsonList);
//
}
taskReportJson
.
put
(
"taskReport"
,
taskReportJsonList
);
// TODO
delete comment
if
(
taskReportLevel
>
0
)
{
taskReportJson
.
append
(
String
.
format
(
"taskReport_%d"
,
String
.
valueOf
(
taskReportLevel
)),
taskReportLevel
);
}
else
{
taskReportJson
.
put
(
String
.
format
(
"taskReport_%d
"
,
taskReportLevel
),
taskReportJsonList
);
}
//
taskReportJson.put("taskReport", taskReportJsonList);
Logger
.
d
(
TAG
,
"createTaskReportJson : "
+
taskReportJson
.
toString
());
Logger
.
d
(
TAG
,
contentPath
+
"/"
+
ABookKeys
.
TASK_REPORT
+
".json"
);
// #32926 end
FileUtil
.
createFile
(
contentPath
+
"/"
+
ABookKeys
.
TASK_REPORT
+
".json"
,
taskReportJson
.
toString
());
...
...
@@ -1544,12 +1533,16 @@ public class OperationLogic extends AbstractLogic {
List
<
JSONObject
>
taskReportJsonList
=
new
ArrayList
<
JSONObject
>();
JSONObject
taskReportJsonRoot
=
new
JSONObject
();
JSONObject
taskReportJsonRow
;
List
<
RoutineTaskReportDto
>
routineTaskReportDtoList
=
mRoutineTaskReportDao
.
getRoutineTaskReportByOperationId
(
operationId
);
// #32926 start
int
taskReportLevel
=
0
;
int
taskReportId
=
0
;
// List<RoutineTaskReportDto> routineTaskReportDtoList = mRoutineTaskReportDao.getRoutineTaskReportByOperationId(operationId);
List
<
TaskReportDto
>
routineTaskReportDtoList
=
mTaskReportDao
.
getTaskReportByOperationId
(
operationId
);
// 現在の作業タイプは定期点検の場合
for
(
Routine
TaskReportDto
dto
:
routineTaskReportDtoList
)
{
for
(
TaskReportDto
dto
:
routineTaskReportDtoList
)
{
taskReportJsonRow
=
new
JSONObject
();
taskReportJsonRow
.
put
(
ABookKeys
.
TASK_REPORT_ID
,
dto
.
taskReportId
);
taskReportLevel
=
dto
.
taskReportLevel
;
taskReportId
=
dto
.
taskReportId
;
taskReportJsonRow
.
put
(
ABookKeys
.
TASK_REPORT_INFO_ID
,
dto
.
taskReportInfoId
);
taskReportJsonRow
.
put
(
ABookKeys
.
REPORT_START_DATE
,
DateTimeUtil
.
toStringInTimeZone
(
dto
.
reportStartDate
,
DateTimeFormat
.
yyyyMMddHHmmss_hyphen
,
DateTimeUtil
.
getLocalTimeZone
()));
taskReportJsonRow
.
put
(
ABookKeys
.
REPORT_END_DATE
,
DateTimeUtil
.
toStringInTimeZone
(
dto
.
reportEndDate
,
DateTimeFormat
.
yyyyMMddHHmmss_hyphen
,
DateTimeUtil
.
getLocalTimeZone
()));
...
...
@@ -1559,13 +1552,16 @@ public class OperationLogic extends AbstractLogic {
if
(!
StringUtil
.
isNullOrEmpty
(
dto
.
jsonData
)){
taskReportInfoList
.
add
(
new
JSONObject
(
dto
.
jsonData
));
}
taskReportJsonRow
.
put
(
ABookKeys
.
TASK_REPORT_INFO
,
taskReportInfoList
);
taskReportJsonList
.
add
(
taskReportJsonRow
);
}
// TODO taskReport -> taskReport_0 に変更
// taskReportJsonRoot.put("taskReport_0", taskReportJsonList);
taskReportJsonRoot
.
put
(
ABookKeys
.
ENABLE_REPORT_UPDATE
,
mOperationDao
.
getOperation
(
operationId
).
enableReportUpdate
);
// taskReportJsonRoot.put("taskReport_%s", taskReportLevel, taskReportJsonList);
taskReportJsonRoot
.
put
(
ABookKeys
.
TASK_REPORT_ID
,
taskReportId
);
taskReportJsonRoot
.
put
(
String
.
format
(
"taskReport_%d"
,
taskReportLevel
),
taskReportJsonList
);
Logger
.
d
(
TAG
,
"createRoutineTaskReportJson : "
+
taskReportJsonRoot
.
toString
());
Logger
.
d
(
TAG
,
contentPath
+
"/"
+
ABookKeys
.
TASK_REPORT
+
".json"
);
// #32926 end
FileUtil
.
createFile
(
contentPath
+
"/"
+
ABookKeys
.
TASK_REPORT
+
".json"
,
taskReportJsonRoot
.
toString
());
}
...
...
@@ -1594,7 +1590,16 @@ public class OperationLogic extends AbstractLogic {
itemJson
.
put
(
dto
.
itemKey
,
jsonArray
);
}
}
taskReportSuggestJson
.
put
(
ABookKeys
.
TASK_REPORT_SUGGEST
,
itemJson
);
// #32926 start
// TODO 確認
// taskReportSuggestJson.put(ABookKeys.TASK_REPORT_SUGGEST, itemJson);
List
<
TaskReportDto
>
taskReportList
=
mTaskReportDao
.
getTaskReportByOperationId
(
operationId
);
for
(
TaskReportDto
dto
:
taskReportList
)
{
taskReportSuggestJson
.
put
(
String
.
format
(
"%s_%s"
,
ABookKeys
.
TASK_REPORT_SUGGEST
,
String
.
valueOf
(
dto
.
taskReportLevel
)),
itemJson
);
}
Logger
.
d
(
TAG
,
"createTaskReportSuggestJson : "
+
taskReportSuggestJson
.
toString
());
Logger
.
d
(
TAG
,
contentPath
+
"/"
+
ABookKeys
.
TASK_REPORT_SUGGEST
+
".json"
);
// #32926 end
FileUtil
.
createFile
(
contentPath
+
"/"
+
ABookKeys
.
TASK_REPORT_SUGGEST
+
".json"
,
taskReportSuggestJson
.
toString
());
}
...
...
@@ -1824,7 +1829,7 @@ public class OperationLogic extends AbstractLogic {
File
zipFile
=
null
;
if
(
dto
.
attachedFileSendFlg
)
{
String
fileName
=
null
;
zipFile
=
createAttachedFile
(
operationId
,
dto
.
taskKey
,
true
);
zipFile
=
createAttachedFile
(
operationId
,
dto
.
taskKey
,
true
,
"0"
);
if
(
zipFile
!=
null
)
{
fileName
=
FileUtil
.
getFilenameWithoutExt
(
zipFile
.
getName
());
}
...
...
@@ -2008,7 +2013,7 @@ public class OperationLogic extends AbstractLogic {
if
(
taskReportDto
.
attachedFileSendFlg
)
{
String
fileName
=
null
;
zipFile
=
createAttachedFileForSend
(
operationId
,
taskReportDto
.
taskKey
,
taskReportSendDto
.
taskReportSendId
,
false
,
0
,
""
);
zipFile
=
createAttachedFileForSend
(
operationId
,
taskReportDto
.
taskKey
,
taskReportSendDto
.
taskReportSendId
,
false
,
0
,
""
,
taskReportDto
.
taskReportLevel
);
if
(
zipFile
!=
null
)
{
fileName
=
FileUtil
.
getFilenameWithoutExt
(
zipFile
.
getName
());
}
...
...
@@ -2029,7 +2034,9 @@ public class OperationLogic extends AbstractLogic {
);
progressCallback
.
callback
(
new
Integer
(
progress
));
mTaskReportSendDao
.
deleteBySendId
(
taskReportSendDto
.
taskReportSendId
);
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getOperationTaskReportSendDirFilePath
(
operationId
,
taskReportSendDto
.
taskKey
,
taskReportSendDto
.
taskReportSendId
));
// #32926 start
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getOperationTaskReportSendDirFilePath
(
operationId
,
taskReportSendDto
.
taskKey
,
taskReportSendDto
.
taskReportSendId
,
taskReportDto
.
taskReportLevel
));
// #32926 end
}
catch
(
Exception
ex
)
{
throw
ex
;
}
finally
{
...
...
@@ -2097,7 +2104,11 @@ public class OperationLogic extends AbstractLogic {
if
(
routineTaskReportDto
.
attachedFileSendFlag
)
{
String
fileName
=
null
;
zipFile
=
createAttachedFileForSend
(
operationId
,
routineTaskReportDto
.
taskKey
,
taskReportSendDto
.
taskReportSendId
,
true
,
routineTaskReportDto
.
taskReportId
,
strReportStartDate
);
// #32926 start
// TODO routineTaskReportDto -> taskReportDto
// zipFile = createAttachedFileForSend(operationId, routineTaskReportDto.taskKey, taskReportSendDto.taskReportSendId, true, routineTaskReportDto.taskReportId, strReportStartDate, taskReportDto.taskReportLevel);
zipFile
=
createAttachedFileForSend
(
operationId
,
routineTaskReportDto
.
taskKey
,
taskReportSendDto
.
taskReportSendId
,
true
,
routineTaskReportDto
.
taskReportId
,
strReportStartDate
,
0
);
// #32926 end
if
(
zipFile
!=
null
)
{
fileName
=
FileUtil
.
getFilenameWithoutExt
(
zipFile
.
getName
());
}
...
...
@@ -2118,11 +2129,19 @@ public class OperationLogic extends AbstractLogic {
);
progressCallback
.
callback
(
new
Integer
(
progress
));
mTaskReportSendDao
.
deleteBySendId
(
taskReportSendDto
.
taskReportSendId
);
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getRoutineTaskReportSendDirFilePath
(
operationId
,
taskReportSendDto
.
taskKey
,
routineTaskReportDto
.
taskReportId
,
strReportStartDate
,
taskReportSendDto
.
taskReportSendId
));
// #32926 start
// TODO routineTaskReportDto -> taskReportDto
// FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, routineTaskReportDto.taskReportId, strReportStartDate, taskReportSendDto.taskReportSendId, taskReportDto.taskReportLevel));
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getRoutineTaskReportSendDirFilePath
(
operationId
,
taskReportSendDto
.
taskKey
,
routineTaskReportDto
.
taskReportId
,
strReportStartDate
,
taskReportSendDto
.
taskReportSendId
,
0
));
// #33926 end
}
catch
(
ABVException
ex
)
{
if
(
ex
.
getCode
()
==
ABVExceptionCode
.
P_E_ACMS_P005
)
{
mTaskReportSendDao
.
deleteBySendId
(
taskReportSendDto
.
taskReportSendId
);
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getRoutineTaskReportSendDirFilePath
(
operationId
,
taskReportSendDto
.
taskKey
,
routineTaskReportDto
.
taskReportId
,
strReportStartDate
,
taskReportSendDto
.
taskReportSendId
));
// #32926 start
// TODO routineTaskReportDto -> taskReportDto
// FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, routineTaskReportDto.taskReportId, strReportStartDate, taskReportSendDto.taskReportSendId, taskReportDto.taskReportLevel));
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getRoutineTaskReportSendDirFilePath
(
operationId
,
taskReportSendDto
.
taskKey
,
routineTaskReportDto
.
taskReportId
,
strReportStartDate
,
taskReportSendDto
.
taskReportSendId
,
0
));
// #32926 end
sendErrorCnt
++;
}
}
catch
(
Exception
ex
)
{
...
...
@@ -2213,7 +2232,7 @@ public class OperationLogic extends AbstractLogic {
*/
public
String
getRoutineTaskReportFile
(
long
operationId
,
String
taskKey
,
long
taskId
,
int
taskReportId
,
int
taskReportInfoId
,
String
reportStartDate
,
String
attachedFileName
)
throws
ABVException
,
InterruptedException
{
GetTaskFileParameters
parameters
=
new
GetTaskFileParameters
(
cache
.
getMemberInfo
().
sid
,
taskId
,
1
,
taskReportInfoId
);
String
outputFilePath
=
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
reportStartDate
)
+
"/"
+
attachedFileName
+
".zip"
;
String
outputFilePath
=
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
reportStartDate
,
0
)
+
"/"
+
attachedFileName
+
".zip"
;
AcmsClient
.
getInstance
(
cache
.
getUrlPath
(),
networkAdapter
).
getTaskFile
(
parameters
,
operationId
,
outputFilePath
);
return
outputFilePath
;
}
...
...
@@ -2267,9 +2286,14 @@ public class OperationLogic extends AbstractLogic {
* @throws NoSuchAlgorithmException
* @throws IOException
*/
private
File
createAttachedFile
(
Long
operationId
,
String
taskKey
,
boolean
directionFlg
)
throws
ZipException
,
NoSuchAlgorithmException
,
IOException
{
private
File
createAttachedFile
(
Long
operationId
,
String
taskKey
,
boolean
directionFlg
,
String
taskReportLevel
)
throws
ZipException
,
NoSuchAlgorithmException
,
IOException
{
File
zipFile
;
String
filePath
=
ABVEnvironment
.
getInstance
().
getOperationDirectionOrReportDirPath
(
operationId
,
taskKey
,
directionFlg
);
// #32926 start
// TODO 変更必要
// String filePath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, directionFlg);
String
filePath
=
ABVEnvironment
.
getInstance
().
getOperationTaskReportLevelDirPath
(
operationId
,
taskKey
,
taskReportLevel
);
// #32926 end
File
fileDir
=
new
File
(
filePath
);
if
(!
fileDir
.
exists
())
{
return
null
;
...
...
@@ -2313,14 +2337,14 @@ public class OperationLogic extends AbstractLogic {
* @throws NoSuchAlgorithmException
* @throws IOException
*/
private
File
createAttachedFileForSend
(
Long
operationId
,
String
taskKey
,
int
taskReportSendId
,
boolean
routineFlag
,
int
reportId
,
String
reportStartDate
)
throws
ZipException
,
NoSuchAlgorithmException
,
IOException
{
private
File
createAttachedFileForSend
(
Long
operationId
,
String
taskKey
,
int
taskReportSendId
,
boolean
routineFlag
,
int
reportId
,
String
reportStartDate
,
int
taskReportLevel
)
throws
ZipException
,
NoSuchAlgorithmException
,
IOException
{
File
zipFile
;
String
filePath
;
if
(
routineFlag
)
{
filePath
=
ABVEnvironment
.
getInstance
().
getRoutineTaskReportSendDirFilePath
(
operationId
,
taskKey
,
reportId
,
reportStartDate
,
taskReportSendId
);
}
else
{
filePath
=
ABVEnvironment
.
getInstance
().
getOperationTaskReportSendDirFilePath
(
operationId
,
taskKey
,
taskReportSendId
);
filePath
=
ABVEnvironment
.
getInstance
().
getOperationTaskReportSendDirFilePath
(
operationId
,
taskKey
,
taskReportSendId
,
taskReportLevel
);
}
File
fileDir
=
new
File
(
filePath
);
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
View file @
9ac153e2
...
...
@@ -860,7 +860,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
mTaskKey
=
abookCheckParam
.
get
(
ABookKeys
.
TASK_KEY
);
// #32926 start
// mAttachedChageFlag = abookCheckParam.get(ABookKeys.ATTACHED_CHANGE_FLAG); // 0:変更なし 1:変更あり
if
(
abookCheckParam
.
containsKey
(
ABookKeys
.
TASK_REPORT_LEVEL
))
{
mTaskReportLevel
=
Integer
.
parseInt
(
abookCheckParam
.
get
(
ABookKeys
.
TASK_REPORT_LEVEL
));
// 作業報告レベル
}
else
{
...
...
@@ -940,7 +939,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this, mCmd, mTaskKey, reportUpdateType, abookCheckParam, mOperationId, mContentPath, getContentId(), operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK, finishCallback);
ABookCheckWebViewHelper
.
getInstance
().
doABookCheckParam
(
ABVContentViewActivity
.
this
,
mCmd
,
mTaskKey
,
reportUpdateType
,
abookCheckParam
,
mOperationId
,
mContentPath
,
getContentId
(),
operationDto
.
operationReportType
==
Constant
.
OperationReportType
.
ROUTINE_TASK
,
finishCallback
,
operationDto
.
reportType
==
Constant
.
ReportType
.
Routine
,
finishCallback
,
mTaskReportLevel
);
// #32926 end
}
catch
(
Exception
e
)
{
...
...
@@ -973,11 +972,15 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if
(
abookCheckParam
.
containsKey
(
ABookKeys
.
ADD_REPORT
))
{
mAddReport
=
Integer
.
parseInt
(
abookCheckParam
.
get
(
ABookKeys
.
ADD_REPORT
))
>
0
?
true
:
false
;
}
ActivityHandlingHelper
.
getInstance
().
startOZViewerActivity
(
this
,
mOperationId
,
getContentId
(),
mTaskKey
,
false
,
taskReportId
,
reportStartDate
,
mReportFileName
,
mLocalSave
,
mAddReport
);
// #32926 start
ActivityHandlingHelper
.
getInstance
().
startOZViewerActivity
(
this
,
mOperationId
,
getContentId
(),
mTaskKey
,
false
,
taskReportId
,
reportStartDate
,
mReportFileName
,
mLocalSave
,
mAddReport
,
mTaskReportLevel
);
// #32926 end
// #32861 作業情報追加 end
}
else
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_PREVIEW_REPORT_OZD
))
{
mReportFileName
=
abookCheckParam
.
get
(
ABookKeys
.
REPORT_FILE_NAME
);
ActivityHandlingHelper
.
getInstance
().
startOZViewerActivity
(
this
,
mOperationId
,
getContentId
(),
mTaskKey
,
true
,
taskReportId
,
reportStartDate
,
mReportFileName
,
false
,
false
);
// #32926 start
ActivityHandlingHelper
.
getInstance
().
startOZViewerActivity
(
this
,
mOperationId
,
getContentId
(),
mTaskKey
,
true
,
taskReportId
,
reportStartDate
,
mReportFileName
,
false
,
false
,
mTaskReportLevel
);
// #32926 end
}
else
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_CONTENT_EDIT_CLOSE
))
{
showProgressPopup
();
handler
.
postDelayed
(
new
Runnable
()
{
...
...
@@ -988,7 +991,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
},
5000
);
}
else
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_GET_GPS_INFO
))
{
setLocation
(
true
,
(
Integer
.
valueOf
(
abookCheckParam
.
get
(
ABookKeys
.
GPS_TYPE
))
!=
1
));
// #32926 start
setLocation
(
true
,
(
Integer
.
valueOf
(
abookCheckParam
.
get
(
ABookKeys
.
GPS_TYPE
))
!=
1
),
mTaskReportLevel
);
// #32926 end
}
else
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_SCENE_REGIST
))
{
String
successFlg
=
abookCheckParam
.
get
(
ABookKeys
.
SUCCESS_FLG
);
if
(
Integer
.
parseInt
(
successFlg
)
==
0
)
{
...
...
@@ -1128,7 +1133,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
* 位置情報取得
* @param isReport
*/
protected
void
setLocation
(
final
boolean
isReport
,
final
boolean
showPermissionDialogFlg
)
{
// #32926 start
protected
void
setLocation
(
final
boolean
isReport
,
final
boolean
showPermissionDialogFlg
,
final
int
taskReportLevel
)
{
// #32926 end
ABookPermissionHelper
helper
=
new
ABookPermissionHelper
(
this
,
Constant
.
ABookPermissionType
.
AccessFineLocation
,
null
);
if
(
helper
.
checkMultiPermissions
(
showPermissionDialogFlg
))
{
// 位置情報取得
...
...
@@ -1136,7 +1143,11 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override
public
void
onGetLocationFailed
()
{
Logger
.
w
(
TAG
,
"onGetLocationFailed"
);
if
(
isReport
)
{
// #32926 start
// if (isReport) {
// 報告(回答)の場合
if
(
taskReportLevel
>
0
)
{
// #32926 end
afterABookCheckApi
(
mCmd
,
""
,
1
,
getString
(
R
.
string
.
msg_location_search_fail
),
null
);
}
}
...
...
@@ -1149,7 +1160,11 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
CommonExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
isReport
)
{
// #32926 start
// if (isReport) {
// 報告(回答)の場合
if
(
taskReportLevel
>
0
)
{
// #32926 end
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"latitude"
,
latitude
);
json
.
put
(
"longitude"
,
longitude
);
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
View file @
9ac153e2
...
...
@@ -609,7 +609,13 @@ public class OperationListActivity extends ABVUIActivity {
long
operationId
=
operationDto
.
operationId
;
for
(
TaskReportDto
taskReportDto
:
listTaskReport
)
{
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getOperationDirectionOrReportDirPath
(
operationId
,
taskReportDto
.
taskKey
,
false
));
// #32926 start
// TODO taskReportLevel の値を求める必要がある
// FileUtil.delete(ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskReportDto.taskKey, false));
if
(
taskReportDto
.
reporterFlag
)
{
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getOperationTaskReportLevelDirPath
(
operationId
,
taskReportDto
.
taskKey
,
"1"
));
}
// #32926 end
}
mTaskReportDao
.
deleteAll
();
...
...
@@ -633,7 +639,7 @@ public class OperationListActivity extends ABVUIActivity {
// サーバ作業後、対応必要
StringBuffer
path
=
new
StringBuffer
();
path
.
append
(
contentPath
);
// #32926 start
// #32926
作業報告画面改善
start
// TODO change : view_mode -> delete , project_type -> content_type , full_screen_flg -> mobile_flg , project_report_type -> operation_type
path
.
append
(
"/index.html?app=android"
);
path
.
append
(
"&view_mode="
+
mOperationAuthLevel
);
...
...
@@ -646,7 +652,7 @@ public class OperationListActivity extends ABVUIActivity {
// path.append("&operation_type=" + (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK ? "1" : "0"));
Logger
.
d
(
TAG
,
"path : "
+
path
);
// #32926 end
// #32926
作業報告画面改善
end
Intent
intent
=
new
Intent
();
intent
.
putExtra
(
ABookKeys
.
CONTENT_ID
,
operationDto
.
contentId
);
intent
.
putExtra
(
ABookKeys
.
OPERATION_ID
,
operationDto
.
operationId
);
...
...
@@ -1007,7 +1013,7 @@ public class OperationListActivity extends ABVUIActivity {
if
(
localTaskIndex
>=
0
)
{
// 添付ファイルが存在する場合、取得して解凍する。
refreshTaskFile
(
operationId
,
operationContentDto
.
contentId
,
taskDto
.
taskId
,
taskDto
.
taskKey
,
directionsAttachedFileName
,
reportAttachedFileName
);
refreshTaskFile
(
operationId
,
operationContentDto
.
contentId
,
taskDto
.
taskId
,
taskDto
.
taskKey
,
directionsAttachedFileName
,
reportAttachedFileName
,
String
.
valueOf
(
taskReportLevel
)
);
if
(
isSyncGetTaskFileError
)
{
return
null
;
}
...
...
@@ -1023,7 +1029,7 @@ public class OperationListActivity extends ABVUIActivity {
}
}
else
{
// 添付ファイルが存在する場合、取得して解凍する。
refreshTaskFile
(
operationId
,
operationContentDto
.
contentId
,
taskDto
.
taskId
,
taskDto
.
taskKey
,
directionsAttachedFileName
,
reportAttachedFileName
);
refreshTaskFile
(
operationId
,
operationContentDto
.
contentId
,
taskDto
.
taskId
,
taskDto
.
taskKey
,
directionsAttachedFileName
,
reportAttachedFileName
,
String
.
valueOf
(
taskReportLevel
)
);
if
(
isSyncGetTaskFileError
)
{
return
null
;
}
...
...
@@ -1054,7 +1060,7 @@ public class OperationListActivity extends ABVUIActivity {
return
lastEditDate
;
}
public
void
refreshTaskFile
(
final
long
operationId
,
final
long
contentId
,
final
long
taskId
,
final
String
taskKey
,
final
String
directionsAttachedFileName
,
final
String
reportAttachedFileName
)
throws
ABVException
,
InterruptedException
,
ZipException
,
NoSuchAlgorithmException
,
IOException
{
public
void
refreshTaskFile
(
final
long
operationId
,
final
long
contentId
,
final
long
taskId
,
final
String
taskKey
,
final
String
directionsAttachedFileName
,
final
String
reportAttachedFileName
,
final
String
taskReportLevel
)
throws
ABVException
,
InterruptedException
,
ZipException
,
NoSuchAlgorithmException
,
IOException
{
// 既存の添付ディレクトリ削除
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getTempTaskDirPath
(
contentId
,
taskKey
));
...
...
@@ -1109,10 +1115,17 @@ public class OperationListActivity extends ABVUIActivity {
protected
Void
doInBackground
(
Void
...
params
)
{
try
{
Logger
.
i
(
TAG
,
"[Get Task Report Files] operationId=%s, taskKey=%s, taskId=%s, attachedFileName=%s"
,
operationId
,
taskKey
,
taskId
,
reportAttachedFileName
);
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getOperationDirectionOrReportDirPath
(
operationId
,
taskKey
,
false
));
// #32926 start
// FileUtil.delete(ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, false));
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getOperationTaskReportLevelDirPath
(
operationId
,
taskKey
,
taskReportLevel
));
// #32926 end
String
outputFilePath
=
mOperationLogic
.
getTaskFile
(
operationId
,
taskKey
,
taskId
,
reportAttachedFileName
,
1
);
ContentFileExtractor
.
getInstance
().
extractZipFile
(
contentId
,
outputFilePath
,
ABVEnvironment
.
getInstance
().
getOperationDirectionOrReportDirPath
(
operationId
,
taskKey
,
false
),
null
,
true
);
// #32926 start
// ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, false),
ABVEnvironment
.
getInstance
().
getOperationTaskReportLevelDirPath
(
operationId
,
taskKey
,
taskReportLevel
),
// #32926 end
null
,
true
);
}
catch
(
Exception
e
)
{
Logger
.
e
(
TAG
,
e
);
ABVToastUtil
.
showMakeText
(
getApplicationContext
(),
R
.
string
.
msg_error_task_report_receiving_failed
,
Toast
.
LENGTH_LONG
);
...
...
@@ -1169,10 +1182,16 @@ public class OperationListActivity extends ABVUIActivity {
protected
Void
doInBackground
(
Void
...
params
)
{
try
{
Logger
.
i
(
TAG
,
"[Get Task Report Files] operationId=%s, taskKey=%s, taskId=%s, attachedFileName=%s"
,
operationId
,
taskKey
,
taskId
,
reportAttachedFileName
);
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
reportStartDateNone
));
// #32926 start
// TODO routineTaskReportDto -> taskReportDto
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
reportStartDateNone
,
0
));
// #32926 end
String
outputFilePath
=
mOperationLogic
.
getRoutineTaskReportFile
(
operationId
,
taskKey
,
taskId
,
taskReportId
,
taskReportInfoId
,
reportStartDateNone
,
reportAttachedFileName
);
// #32926 start
// TODO routineTaskReportDto -> taskReportDto
ContentFileExtractor
.
getInstance
().
extractZipFile
(
contentId
,
outputFilePath
,
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
reportStartDateNone
),
null
,
true
);
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
reportStartDateNone
,
0
),
null
,
true
);
// #32926 end
}
catch
(
Exception
e
)
{
Logger
.
e
(
TAG
,
e
);
ABVToastUtil
.
showMakeText
(
getApplicationContext
(),
R
.
string
.
msg_error_task_report_receiving_failed
,
Toast
.
LENGTH_LONG
);
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookCheckWebViewHelper.java
View file @
9ac153e2
...
...
@@ -92,7 +92,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
case ABookKeys.CMD_INSERT_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, reportUpdateType, operationId, contentId, param, contentPath, true, routineTaskReportFlg);
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
copyTaskAttachedMovie(operationId, contentId, taskKey);
copyTaskAttachedMovie(operationId, contentId, taskKey
, String.valueOf(taskReportLevel)
);
sendTaskReportData(context, operationId, taskKey, -1, true);
} else {
sendTaskReportData(context, operationId, taskKey, reportUpdateType, false);
...
...
@@ -105,7 +105,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
insertOrUpdateTaskReport(taskKey, reportUpdateType, operationId, contentId, param, contentPath, false, routineTaskReportFlg);
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
copyTaskAttachedMovie(operationId, contentId, taskKey);
copyTaskAttachedMovie(operationId, contentId, taskKey
, String.valueOf(taskReportLevel)
);
sendTaskReportData(context, operationId, taskKey, -1, true);
} else {
sendTaskReportData(context, operationId, taskKey, reportUpdateType, false);
...
...
@@ -122,7 +122,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
mOperationLogic.deleteTaskReport(operationId, contentId, taskKey);
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey);
copyTaskAttachedMovie(operationId, contentId, taskKey
, String.valueOf(taskReportLevel)
);
sendTaskReportData(context, operationId, taskKey, -1, true);
} else {
if (routineTaskReportFlg) {
...
...
@@ -140,7 +140,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
} else {
mOperationLogic.deleteTaskReport(operationId, contentId, taskKey);
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey);
copyTaskAttachedMovie(operationId, contentId, taskKey
, String.valueOf(taskReportLevel)
);
TaskReportDto taskReportDto = mOperationLogic.getTaskReport(taskKey);
if (taskReportDto != null && reportUpdateType != Constant.OperationUpdateType.HISTORY_ADD) {
...
...
@@ -178,37 +178,39 @@ public class ABookCheckWebViewHelper extends ABookHelper {
switch
(
cmd
)
{
case
ABookKeys
.
CMD_INSERT_TASK_DIRECTIONS
:
insertOrUpdateTaskDirections
(
taskKey
,
operationId
,
contentId
,
param
,
contentPath
,
true
);
copyTaskAttachedMovie
(
operationId
,
contentId
,
taskKey
);
copyTaskAttachedMovie
(
operationId
,
contentId
,
taskKey
,
String
.
valueOf
(
taskReportLevel
)
);
sendTaskDirectionsData
(
context
,
operationId
,
taskKey
);
break
;
case
ABookKeys
.
CMD_UPDATE_TASK_DIRECTIONS
:
insertOrUpdateTaskDirections
(
taskKey
,
operationId
,
contentId
,
param
,
contentPath
,
false
);
copyTaskAttachedMovie
(
operationId
,
contentId
,
taskKey
);
copyTaskAttachedMovie
(
operationId
,
contentId
,
taskKey
,
String
.
valueOf
(
taskReportLevel
)
);
sendTaskDirectionsData
(
context
,
operationId
,
taskKey
);
break
;
case
ABookKeys
.
CMD_DELETE_TASK_DIRECTIONS
:
mOperationLogic
.
deleteTaskDirections
(
operationId
,
contentId
,
taskKey
);
mOperationLogic
.
createJsonForOperationContent
(
operationId
,
reportUpdateType
,
contentPath
,
true
);
copyTaskAttachedMovie
(
operationId
,
contentId
,
taskKey
);
copyTaskAttachedMovie
(
operationId
,
contentId
,
taskKey
,
String
.
valueOf
(
taskReportLevel
)
);
sendTaskDirectionsData
(
context
,
operationId
,
taskKey
);
break
;
case
ABookKeys
.
CMD_MOVE_HOT_SPOT
:
mOperationLogic
.
updateTaskHotspot
(
taskKey
,
param
);
// #32926 start
mOperationLogic
.
updateTaskHotspot
(
taskKey
,
param
,
taskReportLevel
);
// #32926 end
mOperationLogic
.
createHopSpotJson
(
operationId
,
contentPath
);
break
;
case
ABookKeys
.
CMD_INSERT_TASK_REPORT
:
insertOrUpdateTaskReport
(
taskKey
,
reportUpdateType
,
operationId
,
contentId
,
param
,
contentPath
,
true
,
routineTaskReportFlg
);
insertOrUpdateTaskReport
(
taskKey
,
reportUpdateType
,
operationId
,
contentId
,
param
,
contentPath
,
true
,
routineTaskReportFlg
,
taskReportLevel
);
sendTaskReportData
(
context
,
operationId
,
taskKey
,
reportUpdateType
);
break
;
case
ABookKeys
.
CMD_UPDATE_TASK_REPORT
:
insertOrUpdateTaskReport
(
taskKey
,
reportUpdateType
,
operationId
,
contentId
,
param
,
contentPath
,
false
,
routineTaskReportFlg
);
insertOrUpdateTaskReport
(
taskKey
,
reportUpdateType
,
operationId
,
contentId
,
param
,
contentPath
,
false
,
routineTaskReportFlg
,
taskReportLevel
);
sendTaskReportData
(
context
,
operationId
,
taskKey
,
reportUpdateType
);
break
;
// #32861 作業情報追加 start
// 一時保存処理
case
ABookKeys
.
CMD_LOCAL_SAVE_TASK_REPORT
:
insertOrUpdateTaskReport
(
taskKey
,
reportUpdateType
,
operationId
,
contentId
,
param
,
contentPath
,
false
,
routineTaskReportFlg
);
insertOrUpdateTaskReport
(
taskKey
,
reportUpdateType
,
operationId
,
contentId
,
param
,
contentPath
,
false
,
routineTaskReportFlg
,
taskReportLevel
);
context
.
handleErrorMessageToast
(
R
.
string
.
msg_temp_save_result
);
break
;
// #32861 作業情報追加 end
...
...
@@ -223,16 +225,16 @@ public class ABookCheckWebViewHelper extends ABookHelper {
reportStartDate
=
reportStartDate
.
replace
(
"T"
,
" "
);
mOperationLogic
.
deleteRoutineTaskReport
(
operationId
,
contentId
,
taskKey
,
taskReportId
,
reportStartDate
);
mOperationLogic
.
createJsonForOperationContent
(
operationId
,
reportUpdateType
,
contentPath
,
false
);
copyRoutineTaskReportAttachedMovie
(
operationId
,
contentId
,
taskKey
,
taskReportId
,
reportStartDate
);
copyRoutineTaskReportAttachedMovie
(
operationId
,
contentId
,
taskKey
,
taskReportId
,
reportStartDate
,
taskReportLevel
);
RoutineTaskReportDto
routineTaskTaskReportDto
=
mOperationLogic
.
getRoutineTaskReportUtc
(
taskKey
,
taskReportId
,
reportStartDate
);
if
(
routineTaskTaskReportDto
!=
null
&&
reportUpdateType
!=
Constant
.
OperationUpdateType
.
HISTORY_ADD
)
{
sendTaskReportDataFlg
=
true
;
}
}
else
{
mOperationLogic
.
deleteTaskReport
(
operationId
,
contentId
,
taskKey
);
mOperationLogic
.
deleteTaskReport
(
operationId
,
contentId
,
taskKey
,
taskReportLevel
);
mOperationLogic
.
createJsonForOperationContent
(
operationId
,
reportUpdateType
,
contentPath
,
false
);
copyTaskAttachedMovie
(
operationId
,
contentId
,
taskKey
);
copyTaskAttachedMovie
(
operationId
,
contentId
,
taskKey
,
String
.
valueOf
(
taskReportLevel
)
);
TaskReportDto
taskReportDto
=
mOperationLogic
.
getTaskReport
(
taskKey
);
if
(
taskReportDto
!=
null
&&
reportUpdateType
!=
Constant
.
OperationUpdateType
.
HISTORY_ADD
)
{
...
...
@@ -244,7 +246,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
if
(
reportUpdateType
==
Constant
.
OperationUpdateType
.
HISTORY_NO
)
{
taskReportSendId
=
mOperationLogic
.
getLastTaskReportSendId
(
taskKey
);
mOperationLogic
.
updateTaskReportSend
(
taskKey
,
taskReportId
,
reportStartDate
,
null
,
true
);
deleteReportTaskSendFiles
(
operationId
,
taskKey
,
taskReportSendId
);
deleteReportTaskSendFiles
(
operationId
,
taskKey
,
taskReportSendId
,
taskReportLevel
);
}
else
if
(
reportUpdateType
==
Constant
.
OperationUpdateType
.
HISTORY_UPDATE
)
{
mOperationLogic
.
insertTaskReportSend
(
taskKey
,
taskReportId
,
reportStartDate
,
null
,
true
);
}
...
...
@@ -539,7 +541,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate);
} else {
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey);
copyTaskAttachedMovie(operationId, contentId, taskKey
, String.valueOf(taskReportLevel)
);
}
if (reportUpdateType == Constant.OperationUpdateType.HISTORY_NO) {
...
...
@@ -569,7 +571,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
}
}
*/
private
void
insertOrUpdateTaskReport
(
String
taskKey
,
int
reportUpdateType
,
long
operationId
,
long
contentId
,
Map
<
String
,
String
>
param
,
String
contentPath
,
boolean
insertFlg
,
boolean
routineTaskReportFlg
)
throws
IOException
{
private
void
insertOrUpdateTaskReport
(
String
taskKey
,
int
reportUpdateType
,
long
operationId
,
long
contentId
,
Map
<
String
,
String
>
param
,
String
contentPath
,
boolean
insertFlg
,
boolean
routineTaskReportFlg
,
int
taskReportLevel
)
throws
IOException
{
int
taskReportSendId
=
0
;
boolean
attachedChangeFlag
=
param
.
get
(
ABookKeys
.
ATTACHED_CHANGE_FLAG
).
equals
(
"1"
)
?
true
:
false
;
String
taskReport
=
param
.
get
(
ABookKeys
.
TASK_REPORT
);
...
...
@@ -577,13 +579,6 @@ public class ABookCheckWebViewHelper extends ABookHelper {
int
taskReportId
=
0
;
String
reportStartDate
=
""
;
// #32926 start
int
taskReportLevel
=
0
;
if
(
param
.
containsKey
(
ABookKeys
.
TASK_REPORT_LEVEL
))
{
taskReportLevel
=
Integer
.
valueOf
(
param
.
get
(
ABookKeys
.
TASK_REPORT_LEVEL
));
}
// #32926 end
if
(
routineTaskReportFlg
)
{
taskReportId
=
Integer
.
valueOf
(
param
.
get
(
ABookKeys
.
TASK_REPORT_ID
));
reportStartDate
=
param
.
get
(
ABookKeys
.
REPORT_START_DATE
);
...
...
@@ -607,10 +602,10 @@ public class ABookCheckWebViewHelper extends ABookHelper {
if
(
routineTaskReportFlg
)
{
mOperationLogic
.
createJsonForOperationContent
(
operationId
,
reportUpdateType
,
contentPath
,
false
);
copyRoutineTaskReportAttachedMovie
(
operationId
,
contentId
,
taskKey
,
taskReportId
,
reportStartDate
);
copyRoutineTaskReportAttachedMovie
(
operationId
,
contentId
,
taskKey
,
taskReportId
,
reportStartDate
,
taskReportLevel
);
}
else
{
mOperationLogic
.
createJsonForOperationContent
(
operationId
,
reportUpdateType
,
contentPath
,
false
);
copyTaskAttachedMovie
(
operationId
,
contentId
,
taskKey
);
copyTaskAttachedMovie
(
operationId
,
contentId
,
taskKey
,
String
.
valueOf
(
taskReportLevel
)
);
}
if
(
reportUpdateType
==
Constant
.
OperationUpdateType
.
HISTORY_NO
)
{
...
...
@@ -630,7 +625,9 @@ public class ABookCheckWebViewHelper extends ABookHelper {
}
}
copyReportTaskSendFiles
(
operationId
,
taskKey
,
taskReportSendId
,
routineTaskReportFlg
,
taskReportId
,
reportStartDate
);
// #32926 start
copyReportTaskSendFiles
(
operationId
,
taskKey
,
taskReportSendId
,
routineTaskReportFlg
,
taskReportId
,
reportStartDate
,
taskReportLevel
);
// #32926 end
if
(
reportUpdateType
==
Constant
.
OperationUpdateType
.
HISTORY_ADD
)
{
// 作業報告のディレクトリ削除
...
...
@@ -639,8 +636,11 @@ public class ABookCheckWebViewHelper extends ABookHelper {
// String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
// tempDirPath = String.format(tempDirPath + "/%d", taskReportLevel);
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getTempTaskDirPath
(
contentId
,
taskKey
));
// #32926 start
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getOperationDirectionOrReportDirPath
(
operationId
,
taskKey
,
false
));
// TODO 変更必要
// FileUtil.delete(ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, false));
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getOperationTaskReportLevelDirPath
(
operationId
,
taskKey
,
String
.
valueOf
(
taskReportLevel
)));
// #32926 end
}
}
// #32782 指示者テーブル関連削除 end
...
...
@@ -653,10 +653,17 @@ public class ABookCheckWebViewHelper extends ABookHelper {
if
(
operationDto
.
operationReportType
==
Constant
.
OperationReportType
.
ROUTINE_TASK
)
{
List
<
RoutineTaskReportDto
>
listRoutineTaskReport
=
mOperationLogic
.
getRoutineTaskReportByTaskKey
(
taskDto
.
taskKey
);
for
(
RoutineTaskReportDto
routineTaskDto
:
listRoutineTaskReport
)
{
copyRoutineTaskReportAttachedMovie
(
operationId
,
contentId
,
routineTaskDto
.
taskKey
,
routineTaskDto
.
taskReportId
,
routineTaskDto
.
reportStartDate
);
copyRoutineTaskReportAttachedMovie
(
operationId
,
contentId
,
routineTaskDto
.
taskKey
,
routineTaskDto
.
taskReportId
,
routineTaskDto
.
reportStartDate
,
0
);
}
}
else
{
copyTaskAttachedMovie
(
operationId
,
contentId
,
taskDto
.
taskKey
);
// #32926 start
// TODO taskReportLevel の値を求める必要がある
// copyTaskAttachedMovie(operationId, contentId, taskDto.taskKey);
// copyTaskAttachedMovie(operationId, contentId, taskDto.taskKey, String.valueOf(operationDto.taskReportLevel));
// test start
copyTaskAttachedMovie
(
operationId
,
contentId
,
taskDto
.
taskKey
,
"0"
);
// test end
// #32926 end
}
}
}
catch
(
IOException
e
)
{
...
...
@@ -675,7 +682,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
* @param objReportStartDate
* @throws IOException
*/
public
void
copyRoutineTaskReportAttachedMovie
(
long
operationId
,
long
contentId
,
String
taskKey
,
int
taskReportId
,
Object
objReportStartDate
)
throws
IOException
{
public
void
copyRoutineTaskReportAttachedMovie
(
long
operationId
,
long
contentId
,
String
taskKey
,
int
taskReportId
,
Object
objReportStartDate
,
int
taskReportLevel
)
throws
IOException
{
String
reportStartDate
;
if
(
objReportStartDate
instanceof
String
)
{
reportStartDate
=
DateTimeUtil
.
toString_yyyyMMddHHmmss_none
(
DateTimeUtil
.
toDate
((
String
)
objReportStartDate
,
DateTimeFormat
.
yyyyMMddHHmmss_hyphen
));
...
...
@@ -685,7 +692,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
return
;
}
String
taskKeyPath
=
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
reportStartDate
);
String
taskKeyPath
=
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
reportStartDate
,
taskReportLevel
);
File
taskKeyFile
=
new
File
(
taskKeyPath
);
// 作業報告書の添付ファイル(mp4,mov拡張子のみ)コピー
...
...
@@ -708,9 +715,12 @@ public class ABookCheckWebViewHelper extends ABookHelper {
* @param operationId
* @param contentId
*/
public
void
copyTaskAttachedMovie
(
long
operationId
,
long
contentId
,
String
taskKey
)
throws
IOException
{
// #32926 start
public
void
copyTaskAttachedMovie
(
long
operationId
,
long
contentId
,
String
taskKey
,
String
taskReportLevel
)
throws
IOException
{
// 作業指示書の添付ファイル(mp4,mov拡張子のみ)コピー
String
taskKeyPath
=
ABVEnvironment
.
getInstance
().
getOperationDirectionOrReportDirPath
(
operationId
,
taskKey
,
true
);
// String taskKeyPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, true);
String
taskKeyPath
=
ABVEnvironment
.
getInstance
().
getOperationTaskReportLevelDirPath
(
operationId
,
taskKey
,
taskReportLevel
);
// #32926 end
File
taskKeyFile
=
new
File
(
taskKeyPath
);
if
(
taskKeyFile
.
exists
())
{
String
attachedMoviesFilePath
=
ABVEnvironment
.
getInstance
().
getAttachedDirectionOrReportDirPath
(
contentId
,
taskKey
,
true
);
...
...
@@ -751,7 +761,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
* @param reportStartDate
* @throws IOException
*/
public
void
copyReportTaskSendFiles
(
final
long
operationId
,
final
String
taskKey
,
final
int
taskReportSendId
,
boolean
routineTaskReportFlg
,
int
taskReportId
,
String
reportStartDate
)
throws
IOException
{
public
void
copyReportTaskSendFiles
(
final
long
operationId
,
final
String
taskKey
,
final
int
taskReportSendId
,
boolean
routineTaskReportFlg
,
int
taskReportId
,
String
reportStartDate
,
int
taskReportLevel
)
throws
IOException
{
String
taskAttachedPath
;
Date
dReportStartDate
;
String
sReportStartDate
=
""
;
...
...
@@ -759,18 +769,21 @@ public class ABookCheckWebViewHelper extends ABookHelper {
if
(
routineTaskReportFlg
)
{
dReportStartDate
=
DateTimeUtil
.
toDate
(
reportStartDate
,
DateTimeFormat
.
yyyyMMddHHmmss_hyphen
);
sReportStartDate
=
DateTimeUtil
.
toString_yyyyMMddHHmmss_none
(
dReportStartDate
);
taskAttachedPath
=
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
sReportStartDate
);
taskAttachedPath
=
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
sReportStartDate
,
taskReportLevel
);
}
else
{
taskAttachedPath
=
ABVEnvironment
.
getInstance
().
getOperationDirectionOrReportDirPath
(
operationId
,
taskKey
,
false
);
// #32926 start
// taskAttachedPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, false);
taskAttachedPath
=
ABVEnvironment
.
getInstance
().
getOperationTaskReportLevelDirPath
(
operationId
,
taskKey
,
String
.
valueOf
(
taskReportLevel
));
// #32926 end
}
File
taskAttachedFiles
=
new
File
(
taskAttachedPath
);
if
(
taskAttachedFiles
.
exists
())
{
String
taskReportSendPath
;
if
(
routineTaskReportFlg
)
{
taskReportSendPath
=
ABVEnvironment
.
getInstance
().
getRoutineTaskReportSendDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
sReportStartDate
,
taskReportSendId
);
taskReportSendPath
=
ABVEnvironment
.
getInstance
().
getRoutineTaskReportSendDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
sReportStartDate
,
taskReportSendId
,
taskReportLevel
);
}
else
{
taskReportSendPath
=
ABVEnvironment
.
getInstance
().
getOperationTaskReportSendDirFilePath
(
operationId
,
taskKey
,
taskReportSendId
);
taskReportSendPath
=
ABVEnvironment
.
getInstance
().
getOperationTaskReportSendDirFilePath
(
operationId
,
taskKey
,
taskReportSendId
,
taskReportLevel
);
}
FileUtil
.
delete
(
taskReportSendPath
);
FileUtil
.
createNewDirectory
(
taskReportSendPath
);
...
...
@@ -788,12 +801,12 @@ public class ABookCheckWebViewHelper extends ABookHelper {
* @param taskReportSendId
* @throws IOException
*/
public
void
deleteReportTaskSendFiles
(
final
long
operationId
,
final
String
taskKey
,
final
int
taskReportSendId
)
throws
IOException
{
public
void
deleteReportTaskSendFiles
(
final
long
operationId
,
final
String
taskKey
,
final
int
taskReportSendId
,
final
int
taskReportLevel
)
throws
IOException
{
new
AsyncTask
<
Void
,
Void
,
Void
>()
{
@Override
protected
Void
doInBackground
(
Void
...
params
)
{
try
{
String
taskReportSendPath
=
ABVEnvironment
.
getInstance
().
getOperationTaskReportSendDirFilePath
(
operationId
,
taskKey
,
taskReportSendId
);
String
taskReportSendPath
=
ABVEnvironment
.
getInstance
().
getOperationTaskReportSendDirFilePath
(
operationId
,
taskKey
,
taskReportSendId
,
taskReportLevel
);
FileUtil
.
delete
(
taskReportSendPath
);
}
catch
(
Exception
ex
)
{
Logger
.
e
(
String
.
format
(
"%s.deleteReportTaskSendFiles(%d, %s)"
,
TAG
,
operationId
,
taskKey
),
ex
);
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ActivityHandlingHelper.java
View file @
9ac153e2
...
...
@@ -1545,9 +1545,10 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
* @param reportFileName
* @param localSave
* @param addReport
* @param taskReportLevel
*/
// #32861 作業情報追加 start
public
void
startOZViewerActivity
(
Context
context
,
long
operationId
,
long
contentId
,
String
taskKey
,
boolean
isReadOnly
,
int
taskReportId
,
String
reportStartDate
,
String
reportFileName
,
boolean
localSave
,
boolean
addReport
)
{
public
void
startOZViewerActivity
(
Context
context
,
long
operationId
,
long
contentId
,
String
taskKey
,
boolean
isReadOnly
,
int
taskReportId
,
String
reportStartDate
,
String
reportFileName
,
boolean
localSave
,
boolean
addReport
,
int
taskReportLevel
)
{
reportStartDate
=
reportStartDate
.
replace
(
"T"
,
" "
);
String
strReportStartDate
=
DateTimeUtil
.
toString
(
DateTimeUtil
.
toDate
(
reportStartDate
,
DateTimeFormat
.
yyyyMMddHHmmss_hyphen
),
DateTimeFormat
.
yyyyMMddHHmm_none
);
...
...
@@ -1565,6 +1566,9 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
intent
.
putExtra
(
ABookKeys
.
LOCAL_SAVE
,
localSave
);
// 一時保存情報
intent
.
putExtra
(
ABookKeys
.
ADD_REPORT
,
addReport
);
// 作業追加区分
// #32861 作業情報追加 end
// #32926 start
intent
.
putExtra
(
ABookKeys
.
TASK_REPORT_LEVEL
,
taskReportLevel
);
// 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答))
// #32926 end
context
.
startActivity
(
intent
);
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/OzdFileHelper.java
View file @
9ac153e2
...
...
@@ -92,7 +92,7 @@ public class OzdFileHelper {
return
REPORT_OZD_FILE_NAME
;
}
public
static
final
String
getOzFilePath
(
long
operationId
,
long
contentId
,
String
taskKey
,
boolean
directionFlg
,
int
taskReportId
,
String
reportStartDate
,
String
reportFileName
)
{
public
static
final
String
getOzFilePath
(
long
operationId
,
long
contentId
,
String
taskKey
,
boolean
directionFlg
,
int
taskReportId
,
String
reportStartDate
,
String
reportFileName
,
int
taskReportLevel
)
{
String
ozdFileName
=
null
;
String
ozrFileName
=
null
;
...
...
@@ -100,13 +100,16 @@ public class OzdFileHelper {
ozdFileName
=
reportFileName
;
ozrFileName
=
reportFileName
;
}
else
{
if
(
directionFlg
)
{
// #32926 start
// if (directionFlg) {
if
(
taskReportLevel
==
0
)
{
ozdFileName
=
DIRECTION_OZD_FILE_NAME
;
ozrFileName
=
DIRECTION_OZR_FILE_NAME
;
}
else
{
ozdFileName
=
REPORT_OZD_FILE_NAME
;
ozrFileName
=
REPORT_OZR_FILE_NAME
;
}
// #32926 end
}
String
ozFilePath
=
ABVEnvironment
.
getInstance
().
getTempFilePath
(
contentId
,
taskKey
,
ozdFileName
);
...
...
@@ -115,9 +118,12 @@ public class OzdFileHelper {
}
if
(
taskReportId
>
0
&&
!
StringUtil
.
isNullOrEmpty
(
reportStartDate
))
{
ozFilePath
=
ABVEnvironment
.
getInstance
().
getRoutineTaskSavedOzFilePath
(
operationId
,
taskKey
,
taskReportId
,
reportStartDate
,
ozdFileName
);
ozFilePath
=
ABVEnvironment
.
getInstance
().
getRoutineTaskSavedOzFilePath
(
operationId
,
taskKey
,
taskReportId
,
reportStartDate
,
ozdFileName
,
String
.
valueOf
(
taskReportLevel
)
);
}
else
{
ozFilePath
=
ABVEnvironment
.
getInstance
().
getSavedOzFilePath
(
operationId
,
taskKey
,
ozdFileName
,
directionFlg
);
// #32926 start
// ozFilePath = ABVEnvironment.getInstance().getSavedOzFilePath(operationId, taskKey, ozdFileName, directionFlg);
ozFilePath
=
ABVEnvironment
.
getInstance
().
getSavedOzFileTaskReportLevelPath
(
operationId
,
taskKey
,
ozdFileName
,
String
.
valueOf
(
taskReportLevel
));
// #32926 end
}
if
(
FileUtil
.
exists
(
ozFilePath
))
{
return
ozFilePath
;
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/CheckOZDViewActivity.java
View file @
9ac153e2
...
...
@@ -74,6 +74,10 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
private
String
mSaveOzdTempFileName
;
private
String
mSaveOzdFileName
;
// #32926 start
private
int
mTaskReportLevel
;
// 作業報告レベル
// #32926 end
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
Logger
.
i
(
TAG
,
"onCreate"
);
...
...
@@ -92,6 +96,10 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
mReportStartDate
=
intent
.
getStringExtra
(
ABookKeys
.
REPORT_START_DATE
);
mReportFileName
=
intent
.
getStringExtra
(
ABookKeys
.
REPORT_FILE_NAME
);
// #32926 start
mTaskReportLevel
=
intent
.
getIntExtra
(
ABookKeys
.
TASK_REPORT_LEVEL
,
0
);
// 作業報告レベル
// #32926 end
String
frontTitle
=
""
;
String
rearTitle
=
""
;
...
...
@@ -163,7 +171,10 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
});
// #32861 作業情報追加 end
mOzFilePath
=
OzdFileHelper
.
getOzFilePath
(
mOperationId
,
contentId
,
mTaskKey
,
mDirectionFlg
,
mTaskReportId
,
mReportStartDate
,
mReportFileName
);
// #32926 start
// mOzFilePath = OzdFileHelper.getOzFilePath(mOperationId, contentId, mTaskKey, mDirectionFlg, mTaskReportId, mReportStartDate, mReportFileName);
mOzFilePath
=
OzdFileHelper
.
getOzFilePath
(
mOperationId
,
contentId
,
mTaskKey
,
mDirectionFlg
,
mTaskReportId
,
mReportStartDate
,
mReportFileName
,
mTaskReportLevel
);
// #32926 end
Logger
.
i
(
TAG
,
"********mOzFilePath = %s"
+
mOzFilePath
);
if
(
mOzFilePath
==
null
)
{
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/view/OperationTaskLayout.java
View file @
9ac153e2
...
...
@@ -380,14 +380,11 @@ public class OperationTaskLayout extends RelativeLayout {
}
else
{
DisplayMetrics
displayMetrics
=
getResources
().
getDisplayMetrics
();
// #32926 start
// #32926
作業報告画面改善
start
// 作業報告画面を全画面に表示する
// int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH);
// params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
int
screenWidth
=
displayMetrics
.
widthPixels
;
params
=
createParam
(
screenWidth
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
// #32926 end
// #32926
作業報告画面改善
end
if
(!
StringUtil
.
isNullOrEmpty
(
taskKey
))
{
TaskDto
taskDto
=
mTaskDao
.
getTaskByTaskKey
(
taskKey
);
...
...
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