Commit fc60ecba by Jeong Gilmo

Merge branch 'feature/1.0.1' into feature/1.0.1_33006

# Conflicts:
#	ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookCheckWebViewHelper.java
parents c751c115 4da293d2
...@@ -192,7 +192,6 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -192,7 +192,6 @@ public class AcmsClient implements AcmsClientResponseListener {
dto.memberName = json.userName; dto.memberName = json.userName;
dto.requiredPasswordChange = json.requirePasswordChange; dto.requiredPasswordChange = json.requirePasswordChange;
dto.userId = json.userId; dto.userId = json.userId;
dto.operationAuthLevel = json.operationAuthLevel;
dto.workerCode = json.workerCode; dto.workerCode = json.workerCode;
if (json.result) { if (json.result) {
...@@ -540,10 +539,10 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -540,10 +539,10 @@ public class AcmsClient implements AcmsClientResponseListener {
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_HOT_SPOT_INFO, taskReportDto.taskHotSpotInfo)); HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_HOT_SPOT_INFO, taskReportDto.taskHotSpotInfo));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO, taskReportDto.jsonData)); HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO, taskReportDto.jsonData));
HttpMultipartList.add(new HttpMultipart(ABookKeys.ATTACHED_CHANGE_FLAG, taskReportDto.attachedFileSendFlg ? "1" : "0")); HttpMultipartList.add(new HttpMultipart(ABookKeys.ATTACHED_CHANGE_FLAG, taskReportDto.attachedFileSendFlg ? "1" : "0"));
HttpMultipartList.add(new HttpMultipart(ABookKeys.ROUTINE_TASK_FLAG, reportType == Constant.ReportType.Routine ? "1" : "0")); HttpMultipartList.add(new HttpMultipart(ABookKeys.ROUTINE_TASK_FLAG, reportType == Constant.ReportType.RoutineTask ? "1" : "0"));
// 定期点検用 // 定期点検用
if (reportType == Constant.ReportType.Routine) { if (reportType == Constant.ReportType.RoutineTask) {
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_ID, StringUtil.toString(taskReportDto.taskReportId))); HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_ID, StringUtil.toString(taskReportDto.taskReportId)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO_ID, StringUtil.toString(taskReportDto.taskReportInfoId))); HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO_ID, StringUtil.toString(taskReportDto.taskReportInfoId)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.REPORT_START_DATE, DateTimeUtil.toStringForCmsGMT(taskReportDto.reportStartDate))); HttpMultipartList.add(new HttpMultipart(ABookKeys.REPORT_START_DATE, DateTimeUtil.toStringForCmsGMT(taskReportDto.reportStartDate)));
......
...@@ -11,14 +11,12 @@ public class NewAppStoreLoginJSON extends AcmsBooleanResultJSON { ...@@ -11,14 +11,12 @@ public class NewAppStoreLoginJSON extends AcmsBooleanResultJSON {
public static final String Sid = "sid"; public static final String Sid = "sid";
public static final String UserName = "userName"; public static final String UserName = "userName";
public static final String UserId = "userId"; public static final String UserId = "userId";
public static final String OperationAuthLevel = "projectAuthLevel";
public static final String WorkerCode = "workerCode"; public static final String WorkerCode = "workerCode";
public String sid; public String sid;
public RequirePasswordChangeCode requirePasswordChange; public RequirePasswordChangeCode requirePasswordChange;
public String userName; public String userName;
public int userId; public int userId;
public Integer operationAuthLevel;
public String workerCode; public String workerCode;
public NewAppStoreLoginJSON(String jsonString) throws AcmsException { public NewAppStoreLoginJSON(String jsonString) throws AcmsException {
...@@ -35,9 +33,6 @@ public class NewAppStoreLoginJSON extends AcmsBooleanResultJSON { ...@@ -35,9 +33,6 @@ public class NewAppStoreLoginJSON extends AcmsBooleanResultJSON {
if (json.has(UserId)) { if (json.has(UserId)) {
userId = getInt(json,UserId); userId = getInt(json,UserId);
} }
if (json.has(OperationAuthLevel)) {
operationAuthLevel = getInt(json, OperationAuthLevel);
}
if (json.has(WorkerCode)) { if (json.has(WorkerCode)) {
workerCode = getString(json, WorkerCode, StringUtil.Empty); workerCode = getString(json, WorkerCode, StringUtil.Empty);
} }
......
...@@ -59,8 +59,12 @@ public class OperationDataJSON extends AcmsCommonJSON { ...@@ -59,8 +59,12 @@ public class OperationDataJSON extends AcmsCommonJSON {
dto.operationId = taskJson.getLong(OperationId); dto.operationId = taskJson.getLong(OperationId);
dto.taskId = taskJson.getLong(TaskId); dto.taskId = taskJson.getLong(TaskId);
dto.taskKey = taskJson.getString(TaskKey); dto.taskKey = taskJson.getString(TaskKey);
dto.taskCode = taskJson.getString(TaskCode); if (taskJson.has(TaskCode)) {
dto.taskStatus = taskJson.getInt(TaskStatus); dto.taskCode = taskJson.getString(TaskCode);
}
if (taskJson.has(TaskStatus)) {
dto.taskStatus = taskJson.getInt(TaskStatus);
}
dto.taskHotSpotInfo = taskJson.getJSONObject(TaskHotspotInfo).toString(); dto.taskHotSpotInfo = taskJson.getJSONObject(TaskHotspotInfo).toString();
...@@ -73,7 +77,16 @@ public class OperationDataJSON extends AcmsCommonJSON { ...@@ -73,7 +77,16 @@ public class OperationDataJSON extends AcmsCommonJSON {
JSONObject taskReportJson = taskReportList.getJSONObject(j); JSONObject taskReportJson = taskReportList.getJSONObject(j);
taskReportDto.taskKey = dto.taskKey; taskReportDto.taskKey = dto.taskKey;
taskReportDto.taskReportLevel = taskReportJson.getInt(TaskReportLevel); taskReportDto.taskReportLevel = taskReportJson.getInt(TaskReportLevel);
taskReportDto.enableReport = taskReportJson.getInt(EnableReport);
// 報告可能区分
if (taskReportJson.has(EnableReport)) {
taskReportDto.enableReport = taskReportJson.getInt(EnableReport);
}
if (taskJson.has(TaskReportId)) {
// taskListの中にtaskReportIdキーが存在
taskReportDto.taskReportId = taskJson.getInt(TaskReportId);
}
if (taskReportJson.has(TaskReportInfoId)) { if (taskReportJson.has(TaskReportInfoId)) {
// 定期点検の場合 // 定期点検の場合
...@@ -93,10 +106,14 @@ public class OperationDataJSON extends AcmsCommonJSON { ...@@ -93,10 +106,14 @@ public class OperationDataJSON extends AcmsCommonJSON {
if (taskReportJson.has(TaskReportInfo)) { if (taskReportJson.has(TaskReportInfo)) {
Object object = taskReportJson.get(TaskReportInfo); Object object = taskReportJson.get(TaskReportInfo);
if (object instanceof String) { if (object instanceof String) {
taskReportDto.jsonData = null; taskReportDto.jsonData = (String)object;
} else if (object instanceof JSONObject) {
taskReportDto.jsonData = object.toString();
} else { } else {
taskReportDto.jsonData = taskReportJson.getJSONObject(TaskReportInfo).toString(); taskReportDto.jsonData = "";
} }
} else {
taskReportDto.jsonData = "";
} }
dto.taskReportDtoList.add(taskReportDto); dto.taskReportDtoList.add(taskReportDto);
} }
......
...@@ -36,7 +36,6 @@ public class TaskHotspotJSON extends AbstractJSON { ...@@ -36,7 +36,6 @@ public class TaskHotspotJSON extends AbstractJSON {
taskHotspot = new OperationTaskDto(); taskHotspot = new OperationTaskDto();
taskHotspot.pageNum = obj.getInt(PAGE_NUM); taskHotspot.pageNum = obj.getInt(PAGE_NUM);
taskHotspot.seqId = obj.getInt(SEQ_ID); taskHotspot.seqId = obj.getInt(SEQ_ID);
//taskHotspot.taskKey = obj.getLong(TASK_ID);
taskHotspot.taskKey = obj.getString(TASK_KEY); taskHotspot.taskKey = obj.getString(TASK_KEY);
taskHotspot.taskCode = obj.getString(TASK_CODE); taskHotspot.taskCode = obj.getString(TASK_CODE);
taskHotspot.pdfX = (float) obj.getDouble(VIEW_X); taskHotspot.pdfX = (float) obj.getDouble(VIEW_X);
......
...@@ -140,8 +140,6 @@ public class AcmsApis { ...@@ -140,8 +140,6 @@ public class AcmsApis {
public static final String ApiSendTaskData = "taskData"; public static final String ApiSendTaskData = "taskData";
// 作業データ取得 // 作業データ取得
public static final String ApiGetOperationData = "getOperationData"; public static final String ApiGetOperationData = "getOperationData";
// 定期点検データ取得
public static final String ApiGetRoutineTaskData = "getProjectInspectData";
// 作業ファイル取得 // 作業ファイル取得
public static final String ApiGetTaskFile = "getTaskFile"; public static final String ApiGetTaskFile = "getTaskFile";
// コンテンツ登録 // コンテンツ登録
...@@ -198,7 +196,7 @@ public class AcmsApis { ...@@ -198,7 +196,7 @@ public class AcmsApis {
apiValue = Constant.ApiValue.nuapi; apiValue = Constant.ApiValue.nuapi;
} else if (methodName.equals(ApiOperationList) || methodName.equals(ApiWorkingGroupList) || methodName.equals(ApiSendTaskData) || methodName.equals(ApiGetOperationData) || } else if (methodName.equals(ApiOperationList) || methodName.equals(ApiWorkingGroupList) || methodName.equals(ApiSendTaskData) || methodName.equals(ApiGetOperationData) ||
methodName.equals(ApiGetTaskFile) || methodName.equals(ApiSceneEntry) || methodName.equals(ApiTaskContentEntry) || methodName.equals(ApiGetTaskFile) || methodName.equals(ApiSceneEntry) || methodName.equals(ApiTaskContentEntry) ||
methodName.equals(ApiSendPushMessage) || methodName.equals(ApiGetPushMessages) || methodName.equals(ApiGetRoutineTaskData) || methodName.equals(ApiSendRoutineTaskData)) { methodName.equals(ApiSendPushMessage) || methodName.equals(ApiGetPushMessages) || methodName.equals(ApiSendRoutineTaskData)) {
apiValue = Constant.ApiValue.checkapi; apiValue = Constant.ApiValue.checkapi;
} }
......
...@@ -109,8 +109,8 @@ public class ABVEnvironment { ...@@ -109,8 +109,8 @@ public class ABVEnvironment {
public static final String CommonDirectoryFormat = "%s/ABook/common"; public static final String CommonDirectoryFormat = "%s/ABook/common";
public static final String OperationDirFormat = "%s/ABook/projects/%d"; public static final String OperationDirFormat = "%s/ABook/operation/%d";
public static final String OperationTaskKeyDirFormat = "%s/ABook/projects/%d/%s"; public static final String OperationTaskKeyDirFormat = "%s/ABook/operation/%d/%s";
public static final String PanoImageDirFormat = "%s/panoImage"; public static final String PanoImageDirFormat = "%s/panoImage";
public static final String PanoImageFileFormat = "%s/panoImage.zip"; public static final String PanoImageFileFormat = "%s/panoImage.zip";
public static final String TaskPdfDirFormat = "%s/taskPdf"; public static final String TaskPdfDirFormat = "%s/taskPdf";
...@@ -128,7 +128,7 @@ public class ABVEnvironment { ...@@ -128,7 +128,7 @@ public class ABVEnvironment {
public static final String TempTaskFileFormat = TempTaskKeyDirFormat + "/%s"; public static final String TempTaskFileFormat = TempTaskKeyDirFormat + "/%s";
public static final String AttachedMoviesDirFormat = "%s/%d/attachedMovie"; public static final String AttachedMoviesDirFormat = "%s/%d/attachedMovie";
public static final String AttachedMoviesTaskTypeDir = AttachedMoviesDirFormat + "/%s/%s"; public static final String AttachedMoviesTaskTypeDir = AttachedMoviesDirFormat + "/%s/%s";
public static final String AttachedMoviesRoutineTaskTypeDir = AttachedMoviesDirFormat + "/%s/report/%d/%s"; public static final String AttachedMoviesRoutineTaskTypeDir = AttachedMoviesDirFormat + "/%s/%s/%d/%s";
public static final String CacheTempAttachedImageFormat = "%s/temp/attachedImage"; public static final String CacheTempAttachedImageFormat = "%s/temp/attachedImage";
...@@ -137,10 +137,8 @@ public class ABVEnvironment { ...@@ -137,10 +137,8 @@ public class ABVEnvironment {
public static final String TaskReportLevelDir = "/%s"; public static final String TaskReportLevelDir = "/%s";
public static final String SavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir; public static final String SavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir;
public static final String RoutineTaskSavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir + "/%d/%s/%s"; public static final String RoutineTaskSavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir + "/%d/%s/%s";
public static final String OperationTaskKeyReportSendDirFormat = OperationTaskKeyDirFormat + TaskReportLevelDir + "/reportSend/%d"; public static final String OperationTaskKeyReportSendDirFormat = OperationTaskKeyDirFormat + "/reportSend/%d";
public static final String OperationTaskKeyRoutineTaskReportSendDirFormat = OperationTaskKeyDirFormat + "/reportSend/%d/%s/%d"; public static final String OperationTaskKeyRoutineTaskReportDirFormat = OperationTaskKeyDirFormat + "/%d/%s/%s";
public static final String OperationTaskKeyRoutineTaskReportSendDirFormatForDelete = OperationTaskKeyDirFormat + "/reportSend/%d/%s";
public static final String OperationTaskKeyRoutineTaskReportDirFormat = OperationTaskKeyDirFormat + "/report/%d/%s";
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
/** /**
...@@ -667,7 +665,7 @@ public class ABVEnvironment { ...@@ -667,7 +665,7 @@ public class ABVEnvironment {
/** /**
* プロジェクトの作業ディレクトリパス * プロジェクトの作業ディレクトリパス
* 例)root/files/ABook/projects/[project_id]/[task_key] * 例)root/files/ABook/operation/[operation_id]/[task_key]
* @param operationId * @param operationId
* @param taskKey * @param taskKey
* @return * @return
...@@ -677,30 +675,48 @@ public class ABVEnvironment { ...@@ -677,30 +675,48 @@ public class ABVEnvironment {
} }
/**
* 報告送信ディレクトリパス
* 例)root/files/ABook/operation/[operation_id]/[task_key]/reportSend/{taskReportSendId}
* @param operationId
* @param taskKey
* @param taskReportSendId
* @return
*/
// taskReportLevelの値によってディレクトリを構成 // taskReportLevelの値によってディレクトリを構成
public String getOperationTaskReportSendDirFilePath(long operationId, String taskKey, int taskReportLevel, int taskReportSendId) { public String getOperationTaskReportSendDirFilePath(long operationId, String taskKey, int taskReportSendId) {
return String.format(OperationTaskKeyReportSendDirFormat, rootDirectory, operationId, taskKey, taskReportLevel, taskReportSendId); return String.format(OperationTaskKeyReportSendDirFormat, rootDirectory, operationId, taskKey, 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 taskReportSendId) {
return String.format(OperationTaskKeyRoutineTaskReportSendDirFormat, rootDirectory, operationId, taskKey, taskReportId, getReportDate(reportStartDate), taskReportSendId);
}
/**
* 定期点検で添付ファイルのパス
* 例)root/files/ABook/operation/[operation_id]/[task_key]/0/{taskReportId}/{reportStartDate}
* @param operationId
* @param taskKey
* @param taskReportId
* @param reportStartDate
* @return
*/
public String getRoutineTaskReportDirFilePath(long operationId, String taskKey, int taskReportId, String reportStartDate) { public String getRoutineTaskReportDirFilePath(long operationId, String taskKey, int taskReportId, String reportStartDate) {
return String.format(OperationTaskKeyRoutineTaskReportDirFormat, rootDirectory, operationId, taskKey, taskReportId, getReportDate(reportStartDate)); return String.format(OperationTaskKeyRoutineTaskReportDirFormat, rootDirectory, operationId, taskKey, Constant.TaskReportLevel.ReportType, taskReportId, getReportDate(reportStartDate));
} }
/**
* 添付ファイル管理パス
* 例)root/files/ABook/operation/[operation_id]/[task_key]/{task_report_level}
* @param operationId
* @param taskKey
* @param taskReportLevel
* @return
*/
public String getOperationDirectionOrReportDirPath(long operationId, String taskKey, int taskReportLevel) { public String getOperationDirectionOrReportDirPath(long operationId, String taskKey, int taskReportLevel) {
return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel)); return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel));
} }
/** /**
* 作業報告レベルのディレクトリパス * 作業報告レベルのディレクトリパス
* 例)root/files/ABook/projects/[project_id]/[task_key]/[taskReportLevel] * 例)root/files/ABook/operation/[operation_id]/[task_key]/[taskReportLevel]
* @param operationId * @param operationId
* @param taskKey * @param taskKey
* @param taskReportLevel * @param taskReportLevel
...@@ -710,14 +726,12 @@ public class ABVEnvironment { ...@@ -710,14 +726,12 @@ public class ABVEnvironment {
return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel)); return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel));
} }
public String getOperationTaskReportDirPath(long operationId, String taskKey) { /**
return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey); * 添付動画の臨時保存パス
} * 例)root/cache/{contentId}/attachedMovie
* @param contentId
public String getOperationReportSendDirPath(long operationId, String taskKey) { * @return
return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey, REPORT_SEND); */
}
public String getAttachedMoviesFilePath(long contentId) { public String getAttachedMoviesFilePath(long contentId) {
Logger.d(TAG, "cacheDirectory : " + cacheDirectory); Logger.d(TAG, "cacheDirectory : " + cacheDirectory);
return String.format(AttachedMoviesDirFormat, cacheDirectory, contentId); return String.format(AttachedMoviesDirFormat, cacheDirectory, contentId);
...@@ -730,14 +744,18 @@ public class ABVEnvironment { ...@@ -730,14 +744,18 @@ public class ABVEnvironment {
} }
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
/**
* 例)root/cache/{contentId}/attachedMovie/[task_key]/{task_report_level}/{task_report_id}/{report_start_date}
* @param contentId
* @param taskKey
* @param taskReportId
* @param reportStartDate
* @return
*/
public String getAttachedRoutineTaskReportDirPath(long contentId, String taskKey, int taskReportId, String reportStartDate) { public String getAttachedRoutineTaskReportDirPath(long contentId, String taskKey, int taskReportId, String reportStartDate) {
return String.format(AttachedMoviesRoutineTaskTypeDir, cacheDirectory, contentId, taskKey, taskReportId, getReportDate(reportStartDate)); return String.format(AttachedMoviesRoutineTaskTypeDir, cacheDirectory, contentId, taskKey, Constant.TaskReportLevel.ReportType, taskReportId, getReportDate(reportStartDate));
} }
public String getCacheTempDirPath() {
return String.format(CacheTempFormat, cacheDirectory);
}
public String getCacheTempAttachedImageDirPath() { public String getCacheTempAttachedImageDirPath() {
return String.format(CacheTempAttachedImageFormat, cacheDirectory); return String.format(CacheTempAttachedImageFormat, cacheDirectory);
} }
......
...@@ -88,12 +88,6 @@ public class Constant { ...@@ -88,12 +88,6 @@ public class Constant {
String REPORT_GPS = "reportGps"; String REPORT_GPS = "reportGps";
} }
public interface OperationReportType {
int REPORT_TYPE = 0;
int ROUTINE_TASK = 1;
int REPORT_RESPONSE_TYPE = 2;
}
public interface PushMessageSendType { public interface PushMessageSendType {
int InGroup = 0; int InGroup = 0;
int AllOperation = 1; int AllOperation = 1;
...@@ -141,7 +135,7 @@ public class Constant { ...@@ -141,7 +135,7 @@ public class Constant {
public interface ReportType { public interface ReportType {
int Report = 0; // 報告 int Report = 0; // 報告
int Routine = 1; // 定期点検 int RoutineTask = 1; // 定期点検
int ReportReply = 2; // 報告(回答) int ReportReply = 2; // 報告(回答)
} }
......
...@@ -117,4 +117,5 @@ public class ABookKeys { ...@@ -117,4 +117,5 @@ public class ABookKeys {
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
public static final String HAS_AUTHORITY = "hasAuthority"; public static final String HAS_AUTHORITY = "hasAuthority";
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
public static final String CLOSE_TASK_REPORT = "closeTaskReport";
} }
...@@ -257,6 +257,36 @@ public class AbstractDao { ...@@ -257,6 +257,36 @@ public class AbstractDao {
} }
/** /**
* クエリを実行し、最初の行の最初の列の値をlong型で返します。
*
* stmt.simpleQueryForLong()と同じ
*
* @param sql
* @param bindArgs
* @return
* @throws Exception
*/
public long rawQueryGetLong(String sql, String[] bindArgs) {
SQLiteDatabase db = dbConn.getDatabase();
Cursor cursor = null;
try {
if (Logger.isVerboseEnabled()) {
Logger.v(TAG, "%s [%s]", sql, join(bindArgs));
}
cursor = db.rawQuery(sql, bindArgs);
if (cursor.moveToNext()) {
return cursor.getLong(0);
}
return 0;
}
finally {
if (cursor != null) {
cursor.close();
}
}
}
/**
* クエリを実行し、最初の行の最初の列の値をInteger型リストで返します。 * クエリを実行し、最初の行の最初の列の値をInteger型リストで返します。
* *
* @param sql * @param sql
......
...@@ -72,10 +72,6 @@ public class MemberInfoDao extends AbstractDao { ...@@ -72,10 +72,6 @@ public class MemberInfoDao extends AbstractDao {
if (column != -1) { if (column != -1) {
dto.lastUpdateInfor = cursor.getString(column); dto.lastUpdateInfor = cursor.getString(column);
} }
column = cursor.getColumnIndex("operation_auth_level");
if (column != -1) {
dto.operationAuthLevel = cursor.getInt(column);
}
column = cursor.getColumnIndex("worker_code"); column = cursor.getColumnIndex("worker_code");
if (column != -1) { if (column != -1) {
dto.workerCode = cursor.getString(column); dto.workerCode = cursor.getString(column);
...@@ -108,11 +104,11 @@ public class MemberInfoDao extends AbstractDao { ...@@ -108,11 +104,11 @@ public class MemberInfoDao extends AbstractDao {
} }
public void insertMemberInfo(MemberInfoDto dto) { public void insertMemberInfo(MemberInfoDto dto) {
insert("insert into m_member_info (login_id, password, member_name, sid, login_status, invalid_password_count, last_login_date, last_change_password_date, last_cms_access_date, user_id, last_update_infor, operation_auth_level, worker_code) values (?,?,?,?,?,?,?,?,?,?,?,?,?)", dto.getInsertValues()); insert("insert into m_member_info (login_id, password, member_name, sid, login_status, invalid_password_count, last_login_date, last_change_password_date, last_cms_access_date, user_id, last_update_infor, worker_code) values (?,?,?,?,?,?,?,?,?,?,?,?)", dto.getInsertValues());
} }
public boolean updateMemberInfo(MemberInfoDto dto) { public boolean updateMemberInfo(MemberInfoDto dto) {
long count = update("update m_member_info set password=?, member_name=?, sid=?, login_status=?, invalid_password_count=?, last_login_date=?, last_change_password_date=?, last_cms_access_date=?, last_update_infor = ?, operation_auth_level = ?, worker_code = ? where login_id=?", dto.getUpdateValues()); long count = update("update m_member_info set password=?, member_name=?, sid=?, login_status=?, invalid_password_count=?, last_login_date=?, last_change_password_date=?, last_cms_access_date=?, last_update_infor = ?, worker_code = ? where login_id=?", dto.getUpdateValues());
return count > 0; return count > 0;
} }
......
...@@ -243,6 +243,7 @@ public class OperationDao extends AbstractDao { ...@@ -243,6 +243,7 @@ public class OperationDao extends AbstractDao {
sql.append(" top.report_type, "); sql.append(" top.report_type, ");
sql.append(" top.report_cycle, "); sql.append(" top.report_cycle, ");
sql.append(" top.enable_report_update, "); sql.append(" top.enable_report_update, ");
sql.append(" top.enable_report_edit, ");
sql.append(" CASE "); sql.append(" CASE ");
sql.append(" WHEN report_type = 1 THEN ( "); sql.append(" WHEN report_type = 1 THEN ( ");
sql.append(" SELECT strftime('%Y/%m/%d %H:%M', datetime(ttr.report_start_date, 'localtime')) || ' ~ ' || strftime('%Y/%m/%d %H:%M', datetime(ttr.report_end_date, 'localtime')) "); sql.append(" SELECT strftime('%Y/%m/%d %H:%M', datetime(ttr.report_start_date, 'localtime')) || ' ~ ' || strftime('%Y/%m/%d %H:%M', datetime(ttr.report_end_date, 'localtime')) ");
......
...@@ -105,6 +105,7 @@ public class TaskDao extends AbstractDao { ...@@ -105,6 +105,7 @@ public class TaskDao extends AbstractDao {
delete("t_task", "task_key=?", keyValues); delete("t_task", "task_key=?", keyValues);
delete("t_task_report", "task_key=?", keyValues); delete("t_task_report", "task_key=?", keyValues);
delete("t_task_report_items", "task_key=?", keyValues); delete("t_task_report_items", "task_key=?", keyValues);
delete("t_task_report_send", "task_key=?", keyValues);
} }
/** /**
...@@ -115,5 +116,6 @@ public class TaskDao extends AbstractDao { ...@@ -115,5 +116,6 @@ public class TaskDao extends AbstractDao {
delete("t_task", "task_key=?", dto.getKeyValues()); delete("t_task", "task_key=?", dto.getKeyValues());
delete("t_task_report", "task_key=?", dto.getKeyValues()); delete("t_task_report", "task_key=?", dto.getKeyValues());
delete("t_task_report_items", "task_key=?", dto.getKeyValues()); delete("t_task_report_items", "task_key=?", dto.getKeyValues());
delete("t_task_report_send", "task_key=?", dto.getKeyValues());
} }
} }
\ No newline at end of file
...@@ -56,10 +56,6 @@ public class TaskReportDao extends AbstractDao { ...@@ -56,10 +56,6 @@ public class TaskReportDao extends AbstractDao {
if (column != -1) { if (column != -1) {
dto.delFlg = toBool(cursor.getInt(column)); dto.delFlg = toBool(cursor.getInt(column));
} }
column = cursor.getColumnIndex("reported_flag");
if (column != -1) {
dto.reportedFlag = toBool(cursor.getInt(column));
}
column = cursor.getColumnIndex("enable_report"); column = cursor.getColumnIndex("enable_report");
if (column != -1) { if (column != -1) {
...@@ -70,10 +66,39 @@ public class TaskReportDao extends AbstractDao { ...@@ -70,10 +66,39 @@ public class TaskReportDao extends AbstractDao {
if (column != -1) { if (column != -1) {
dto.taskReportLevel = cursor.getInt(column); dto.taskReportLevel = cursor.getInt(column);
} }
column = cursor.getColumnIndex("task_report_id");
if (column != -1) {
dto.taskReportId = cursor.getInt(column);
}
column = cursor.getColumnIndex("task_report_info_id");
if (column != -1) {
dto.taskReportInfoId = cursor.getInt(column);
}
column = cursor.getColumnIndex("report_start_date");
if (column != -1) {
dto.reportStartDate = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
column = cursor.getColumnIndex("report_end_date");
if (column != -1) {
dto.reportEndDate = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
column = cursor.getColumnIndex("local_saved_flg");
if (column != -1) {
dto.localSavedFlg = toBool(cursor.getInt(column));
}
return dto; return dto;
} }
/**
* 報告登録処理
* @param dto
*/
public void insert(TaskReportDto dto) { public void insert(TaskReportDto dto) {
insert("insert into t_task_report " insert("insert into t_task_report "
+ "(task_key, " + "(task_key, "
...@@ -87,14 +112,45 @@ public class TaskReportDao extends AbstractDao { ...@@ -87,14 +112,45 @@ public class TaskReportDao extends AbstractDao {
+ "report_start_date, " + "report_start_date, "
+ "report_end_date, " + "report_end_date, "
+ "enable_report, " + "enable_report, "
+ "reported_flg, " + "task_report_level, "
+ "task_report_level) " + "local_saved_flg ) "
+ "values " + "values "
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?)", + "(?,?,?,?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues()); dto.getInsertValues());
} }
/** /**
* 報告更新処理
* @param dto
* @return
*/
public boolean update(TaskReportDto dto) {
Object[] objects;
StringBuffer sql = new StringBuffer();
sql.append("UPDATE t_task_report SET ");
sql.append("json_data=?, ");
sql.append("attached_file_name=?, ");
sql.append("local_attached_file_name=?, ");
sql.append("attached_file_send_flg=?, ");
sql.append("data_send_flg=?, ");
sql.append("report_end_date=?, ");
sql.append("enable_report=?, ");
sql.append("task_report_level=?, ");
sql.append("local_saved_flg=? ");
sql.append("WHERE task_key=? AND task_report_level=?");
if (dto.reportStartDate != null) {
sql.append(" AND datetime(report_start_date)=datetime(?)");
objects = new Object[]{dto.jsonData, dto.attachedFileName, dto.localAttachedFileName, dto.attachedFileSendFlg, dto.dataSendFlg,
dto.reportEndDate, dto.enableReport, dto.taskReportLevel, dto.localSavedFlg, dto.taskKey, dto.taskReportLevel, dto.reportStartDate};
} else {
objects = new Object[]{dto.jsonData, dto.attachedFileName, dto.localAttachedFileName, dto.attachedFileSendFlg, dto.dataSendFlg,
dto.reportEndDate, dto.enableReport, dto.taskReportLevel, dto.localSavedFlg, dto.taskKey, dto.taskReportLevel};
}
return update(sql.toString(), objects) > 0;
}
/**
* 作業IDで報告取得 * 作業IDで報告取得
* (作業報告タイプ 昇順、作業報告ID 昇順、報告開始日 昇順) * (作業報告タイプ 昇順、作業報告ID 昇順、報告開始日 昇順)
* @param operationId * @param operationId
...@@ -113,7 +169,6 @@ public class TaskReportDao extends AbstractDao { ...@@ -113,7 +169,6 @@ public class TaskReportDao extends AbstractDao {
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class); return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class);
} }
/** /**
* 作業キーと作業報告タイプで作業報告データ取得 * 作業キーと作業報告タイプで作業報告データ取得
* @param taskKey * @param taskKey
...@@ -133,26 +188,6 @@ public class TaskReportDao extends AbstractDao { ...@@ -133,26 +188,6 @@ public class TaskReportDao extends AbstractDao {
return rawQueryGetDtoList("select * from t_task_report where task_key=? ORDER BY task_report_id, report_start_date", new String[]{ "" + taskKey }, TaskReportDto.class); return rawQueryGetDtoList("select * from t_task_report where task_key=? ORDER BY task_report_id, report_start_date", new String[]{ "" + taskKey }, TaskReportDto.class);
} }
public boolean update(TaskReportDto dto) {
long count = update("update t_task_report "
+ "set "
+ "json_data=?, "
+ "attached_file_name=?, "
+ "local_attached_file_name=?, "
+ "attached_file_send_flg=?, "
+ "data_send_flg=?, "
+ "task_report_id=?, "
+ "task_report_info_id=?, "
+ "report_start_date=?, "
+ "report_end_date=?, "
+ "enable_report=?, "
+ "reported_flg=?, "
+ "task_report_level=? "
+ "where task_key=? AND task_report_level=?",
dto.getUpdateValues());
return count > 0;
}
/** /**
* 送信フラグのあるデータが存在するか * 送信フラグのあるデータが存在するか
* *
...@@ -208,8 +243,14 @@ public class TaskReportDao extends AbstractDao { ...@@ -208,8 +243,14 @@ public class TaskReportDao extends AbstractDao {
return rawQueryGetString("select local_attached_file_name from t_task_report where task_key=? AND task_report_level=?", new String[]{"" + taskKey, "" + taskReportLevel}); return rawQueryGetString("select local_attached_file_name from t_task_report where task_key=? AND task_report_level=?", new String[]{"" + taskKey, "" + taskReportLevel});
} }
public List<TaskReportDto> selectByTaskKey(String taskKey, int taskReportLevel) { /**
return rawQueryGetDtoList("select * from t_task_report where task_key=? and task_report_level=?", new String[]{ "" + taskKey, "" + taskReportLevel }, TaskReportDto.class); * 報告キー、報告担当レベルでt_task_Reportデータ取得
* @param taskKey
* @param taskReportLevel
* @return
*/
public TaskReportDto selectByTaskKey(String taskKey, int taskReportLevel) {
return rawQueryGetDto("select * from t_task_report where task_key=? and task_report_level=?", new String[]{ "" + taskKey, "" + taskReportLevel }, TaskReportDto.class);
} }
public List<TaskReportDto> selectAll() { public List<TaskReportDto> selectAll() {
...@@ -227,26 +268,6 @@ public class TaskReportDao extends AbstractDao { ...@@ -227,26 +268,6 @@ public class TaskReportDao extends AbstractDao {
} }
/** /**
* 定期点検用の報告更新
* @param dto
* @return
*/
public boolean updateRoutineTask(TaskReportDto dto) {
long count = update("update t_task_report "
+ "set "
+ "report_end_date=?, "
+ "attached_file_name=?, "
+ "local_attached_file_name=?, "
+ "json_data=?, "
+ "data_send_flag=?, "
+ "attached_file_send_flag=? "
+ "reported_flag=? "
+ "where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)",
new Object[]{dto.reportEndDate, dto.attachedFileName, dto.localAttachedFileName, dto.jsonData, dto.dataSendFlg, dto.attachedFileSendFlg, dto.reportedFlag, dto.taskKey, dto.taskReportId, dto.reportStartDate});
return count > 0;
}
/**
* テーブル物理削除 * テーブル物理削除
* @param dto * @param dto
*/ */
...@@ -259,7 +280,7 @@ public class TaskReportDao extends AbstractDao { ...@@ -259,7 +280,7 @@ public class TaskReportDao extends AbstractDao {
* @param dto * @param dto
*/ */
public void deleteRoutineTaskReport(TaskReportDto dto) { public void deleteRoutineTaskReport(TaskReportDto dto) {
delete("t_task_report", "task_key=? and task_report_level=? task_report_id=? and datetime(report_start_date)=datetime(?, 'utc')", new String[] { dto.taskKey, "" + dto.taskReportLevel, "" + dto.taskReportId, DateTimeUtil.toString(dto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen) }); delete("t_task_report", "task_key=? AND task_report_level=? AND task_report_id=? AND datetime(report_start_date)=datetime(?, 'utc')", new String[] { dto.taskKey, "" + dto.taskReportLevel, "" + dto.taskReportId, DateTimeUtil.toString(dto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen) });
} }
/** /**
...@@ -329,11 +350,13 @@ public class TaskReportDao extends AbstractDao { ...@@ -329,11 +350,13 @@ public class TaskReportDao extends AbstractDao {
} }
/** /**
* 作業キーで作業時間が存在する作業報告データ取得(定期点検) * 定期点検報告のデータ取得
* @param taskKey * @param taskKey
* @param taskReportId
* @param reportStartDate
* @return * @return
*/ */
public List<TaskReportDto> getNotNullStartDateTaskReportByTaskKey(String taskKey) { public TaskReportDto getRoutineTaskReport(String taskKey, int taskReportId, String reportStartDate) {
return rawQueryGetDtoList("select * from t_task_report where task_key=? AND report_start_date IS NOT NULL", new String[]{ taskKey }, TaskReportDto.class); return rawQueryGetDto("select * from t_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)", new String[]{ taskKey, "" + taskReportId, reportStartDate }, TaskReportDto.class);
} }
} }
...@@ -48,6 +48,17 @@ public class TaskReportItemsDao extends AbstractDao { ...@@ -48,6 +48,17 @@ public class TaskReportItemsDao extends AbstractDao {
return rawQueryGetDtoList("select * from t_task_report_items where task_key=? and task_report_level=?", new String[]{"" + taskKey, "" + taskReportLevel}, TaskReportItemsDto.class); return rawQueryGetDtoList("select * from t_task_report_items where task_key=? and task_report_level=?", new String[]{"" + taskKey, "" + taskReportLevel}, TaskReportItemsDto.class);
} }
/**
* 報告キー、報告担当レベル、itemKeyでデータ取得
* @param taskKey
* @param taskReportLevel
* @param itemKey
* @return
*/
public TaskReportItemsDto getTaskReportItem(String taskKey, int taskReportLevel, String itemKey) {
return rawQueryGetDto("SELECT * FROM t_task_report_items WHERE task_key=? AND task_report_level=? AND item_key=?", new String[]{"" + taskKey, "" + taskReportLevel, "" + itemKey}, TaskReportItemsDto.class);
}
public List<TaskReportItemsDto> getTaskReportItemByOperationId(Long operationId) { public List<TaskReportItemsDto> getTaskReportItemByOperationId(Long operationId) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(" select distinct ttri.* "); sb.append(" select distinct ttri.* ");
......
...@@ -32,7 +32,6 @@ public class MMemberInfo extends SQLiteTableScript { ...@@ -32,7 +32,6 @@ public class MMemberInfo extends SQLiteTableScript {
sql.append(" , password_expiry_date DATETIME "); sql.append(" , password_expiry_date DATETIME ");
sql.append(" , user_id INTEGER"); sql.append(" , user_id INTEGER");
sql.append(" , last_update_infor VARCHAR(64)"); sql.append(" , last_update_infor VARCHAR(64)");
sql.append(" , operation_auth_level INTEGER");
sql.append(" , worker_code TEXT"); sql.append(" , worker_code TEXT");
sql.append(" , PRIMARY KEY (login_id) "); sql.append(" , PRIMARY KEY (login_id) ");
sql.append(" ) "); sql.append(" ) ");
......
...@@ -23,7 +23,7 @@ public class TTaskReport extends SQLiteTableScript { ...@@ -23,7 +23,7 @@ public class TTaskReport extends SQLiteTableScript {
sql.append(" CREATE TABLE t_task_report ( "); sql.append(" CREATE TABLE t_task_report ( ");
sql.append(" task_key TEXT NOT NULL "); sql.append(" task_key TEXT NOT NULL ");
sql.append(" , json_data TEXT NOT NULL "); sql.append(" , json_data TEXT NOT NULL");
sql.append(" , attached_file_name TEXT "); sql.append(" , attached_file_name TEXT ");
sql.append(" , local_attached_file_name TEXT "); sql.append(" , local_attached_file_name TEXT ");
sql.append(" , attached_file_send_flg BOOLEAN DEFAULT 0 "); sql.append(" , attached_file_send_flg BOOLEAN DEFAULT 0 ");
...@@ -34,7 +34,7 @@ public class TTaskReport extends SQLiteTableScript { ...@@ -34,7 +34,7 @@ public class TTaskReport extends SQLiteTableScript {
sql.append(" , task_report_info_id INTEGER NOT NULL DEFAULT 0 "); sql.append(" , task_report_info_id INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , enable_report SMALLINT NOT NULL DEFAULT 0 "); sql.append(" , enable_report SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , task_report_level SMALLINT NOT NULL DEFAULT 0 "); sql.append(" , task_report_level SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , reported_flg BOOLEAN DEFAULT 0 "); sql.append(" , local_saved_flg BOOLEAN DEFAULT 0 ");
sql.append(" ) "); sql.append(" ) ");
ddl.add(sql.toString()); ddl.add(sql.toString());
......
...@@ -24,6 +24,7 @@ public class TTaskReportItems extends SQLiteTableScript { ...@@ -24,6 +24,7 @@ public class TTaskReportItems extends SQLiteTableScript {
sql.append(" CREATE TABLE t_task_report_items ( "); sql.append(" CREATE TABLE t_task_report_items ( ");
sql.append(" task_key TEXT NOT NULL "); sql.append(" task_key TEXT NOT NULL ");
sql.append(" , task_report_level INTEGER default 0 "); sql.append(" , task_report_level INTEGER default 0 ");
sql.append(" , item_key VARCHAR(64) "); sql.append(" , item_key VARCHAR(64) ");
sql.append(" , input_value VARCHAR(64) "); sql.append(" , input_value VARCHAR(64) ");
sql.append(" ) "); sql.append(" ) ");
......
...@@ -25,19 +25,18 @@ public class MemberInfoDto extends AbstractDto { ...@@ -25,19 +25,18 @@ public class MemberInfoDto extends AbstractDto {
public Date lastCMSAccessDate; public Date lastCMSAccessDate;
public Date passwordExpiryDate; public Date passwordExpiryDate;
public String lastUpdateInfor; //ABookSee 1.8.1 public String lastUpdateInfor; //ABookSee 1.8.1
public Integer operationAuthLevel;
public String workerCode; public String workerCode;
public RequirePasswordChangeCode requiredPasswordChange; public RequirePasswordChangeCode requiredPasswordChange;
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
return new Object[]{loginId, password, memberName, sid, loginStatus, invalidPasswordCount, lastLoginDate, lastChangePasswordDate, lastCMSAccessDate, userId, lastUpdateInfor, operationAuthLevel, workerCode}; return new Object[]{loginId, password, memberName, sid, loginStatus, invalidPasswordCount, lastLoginDate, lastChangePasswordDate, lastCMSAccessDate, userId, lastUpdateInfor, workerCode};
} }
@Override @Override
public Object[] getUpdateValues() { public Object[] getUpdateValues() {
return new Object[]{password, memberName, sid, loginStatus, invalidPasswordCount, lastLoginDate, lastChangePasswordDate, lastCMSAccessDate, lastUpdateInfor, operationAuthLevel, workerCode, loginId}; return new Object[]{password, memberName, sid, loginStatus, invalidPasswordCount, lastLoginDate, lastChangePasswordDate, lastCMSAccessDate, lastUpdateInfor, workerCode, loginId};
} }
@Override @Override
......
...@@ -23,7 +23,7 @@ public class OperationDto extends AbstractDto { ...@@ -23,7 +23,7 @@ public class OperationDto extends AbstractDto {
public List<OperationContentDto> operationContentDtoList; public List<OperationContentDto> operationContentDtoList;
public List<TaskDto> taskDtoList; public List<TaskDto> taskDtoList;
public List<PushMessageDto> pushMessageList; public List<PushMessageDto> pushMessageList;
public int reportType; //0:通常 1:定期点検 public int reportType; // 報告タイプ 0 : 報告 1 : 定期点検 2 : 報告(回答)
public int reportCycle; //0:日次 1:月次 2:年次 public int reportCycle; //0:日次 1:月次 2:年次
public int enableReportUpdate; //0:不可 1:可 public int enableReportUpdate; //0:不可 1:可
public String reportPeriod; //定期点検、2018/12/20 08:10:00 ~ 2018/12/21 18:10:00 public String reportPeriod; //定期点検、2018/12/20 08:10:00 ~ 2018/12/21 18:10:00
......
...@@ -24,17 +24,16 @@ public class TaskReportDto extends AbstractDto { ...@@ -24,17 +24,16 @@ public class TaskReportDto extends AbstractDto {
public Date reportEndDate; // 作業終了日 public Date reportEndDate; // 作業終了日
public int enableReport; // 報告可能区分 public int enableReport; // 報告可能区分
public String attachedFileName; public String attachedFileName;
public String taskReportInfo; public boolean localSavedFlg; // 一時保存用
public boolean reportedFlag; // 定期点検用
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, enableReport, reportedFlag, taskReportLevel}; return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, enableReport, taskReportLevel, localSavedFlg};
} }
@Override @Override
public Object[] getUpdateValues() { public Object[] getUpdateValues() {
return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, enableReport, reportedFlag, taskReportLevel, taskKey, taskReportLevel }; return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reportEndDate, enableReport, taskReportLevel, localSavedFlg, taskKey, taskReportLevel , reportStartDate };
} }
@Override @Override
......
...@@ -244,78 +244,68 @@ public class OperationLogic extends AbstractLogic { ...@@ -244,78 +244,68 @@ public class OperationLogic extends AbstractLogic {
} }
/** /**
* 作業指示の登録 * 報告データ登録
*
* @param taskKey * @param taskKey
* @param operationId * @param operationId
* @param contentId * @param contentId
* @param taskDirectionsJson * @param reportLevel
* @param hotSpotInfo * @param enableReport
* @param taskReportJson
* @param localAttachedFileName
* @param attachedChangeFlag * @param attachedChangeFlag
* @param dataSendFlg * @param dataSendFlg
* @param localSavedFlg
* @throws IOException * @throws IOException
*/ */
public void insertTaskReport(String taskKey, long operationId, long contentId, int enableReport, JSONObject taskDirectionsJson, String hotSpotInfo, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException { public void insertTaskReport(String taskKey, long operationId, long contentId, int reportLevel, int enableReport, JSONObject taskReportJson, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg, boolean localSavedFlg) throws IOException {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
if (taskDto == null) {
//TODO error
return;
}
TaskDto taskDto = new TaskDto();
TaskReportDto taskReportDto = new TaskReportDto(); TaskReportDto taskReportDto = new TaskReportDto();
JSONObject taskJson = taskDirectionsJson.getJSONObject("task");
taskDto.taskKey = taskKey;
taskDto.operationId = operationId;
taskDto.taskHotSpotInfo = hotSpotInfo;
Iterator taskKeys = taskJson.keys();
while (taskKeys.hasNext()) {
TaskReportItemsDto taskReportItemsDto = new TaskReportItemsDto();
String itemKey = (String) taskKeys.next();
if (itemKey.startsWith("q_1_")) {
taskDto.taskCode = taskJson.getString(itemKey);
}
taskReportItemsDto.taskKey = taskKey;
taskReportItemsDto.itemKey = itemKey;
taskReportItemsDto.taskReportLevel = Constant.TaskReportLevel.ReportType;
try {
taskReportItemsDto.inputValue = taskJson.getString(itemKey);
} catch (JSONException e) {
// 値がStringではない場合、無視する
continue;
}
mTaskReportItemsDao.insertTaskReportItems(taskReportItemsDto);
}
taskReportDto.taskKey = taskKey; taskReportDto.taskKey = taskKey;
taskReportDto.jsonData = taskDirectionsJson.toString();
if (taskReportJson != null) {
// suggest登録・更新処理
registTaskReportItem(taskKey, reportLevel, taskReportJson.getJSONObject("suggest"));
taskReportDto.jsonData = taskReportJson.toString();
} else {
// taskJsonがnullの場合、jsonDataに空でセット
taskReportDto.jsonData = "";
}
// 一時保存のフラグ
taskReportDto.localSavedFlg = localSavedFlg;
// 送信フラグ
taskReportDto.dataSendFlg = dataSendFlg; taskReportDto.dataSendFlg = dataSendFlg;
taskReportDto.attachedFileSendFlg = attachedChangeFlag; taskReportDto.attachedFileSendFlg = attachedChangeFlag;
// 作業報告 // 作業報告
taskReportDto.taskReportLevel = Constant.TaskReportLevel.ReportType; taskReportDto.taskReportLevel = reportLevel;
// 報告可能区分 // 報告可能区分
taskReportDto.enableReport = enableReport; taskReportDto.enableReport = enableReport;
if (localAttachedFileName != null) { if (localAttachedFileName != null) {
taskReportDto.localAttachedFileName = localAttachedFileName; taskReportDto.localAttachedFileName = localAttachedFileName;
} }
if (taskDirectionsJson.has(ABookKeys.TASK_STATUS)) {
taskDto.taskStatus = taskDirectionsJson.getInt(ABookKeys.TASK_STATUS);
}
mTaskReportDao.insert(taskReportDto); mTaskReportDao.insert(taskReportDto);
mTaskDao.insert(taskDto);
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey); if (taskReportJson != null) {
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
//添付ファイル変更の場合、以下の処理を行う //添付ファイル変更の場合、以下の処理を行う
JSONObject attachedListJson = taskDirectionsJson.getJSONObject("attached"); JSONObject attachedListJson = taskReportJson.getJSONObject("attached");
List<String> attachedFileNames = JSONObject.getValues(attachedListJson); List<String> attachedFileNames = JSONObject.getValues(attachedListJson);
// コピー元のファイルで、添付ファイルとして使用しないファイル削除 // コピー元のファイルで、添付ファイルとして使用しないファイル削除
deleteDifferentialFile(tempDirPath, attachedFileNames); deleteDifferentialFile(tempDirPath, attachedFileNames);
String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, Constant.TaskReportLevel.ReportType); String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, reportLevel);
// 添付ディレクトリの移動 // 添付ディレクトリの移動
boolean result = FileUtil.copy(tempDirPath, operationDrectionOrReportDirPath, true); boolean result = FileUtil.copy(tempDirPath, operationDrectionOrReportDirPath, true);
if (result) { if (result) {
FileUtil.delete(tempDirPath); FileUtil.delete(tempDirPath);
}
} }
} }
...@@ -324,48 +314,35 @@ public class OperationLogic extends AbstractLogic { ...@@ -324,48 +314,35 @@ public class OperationLogic extends AbstractLogic {
* @param taskKey * @param taskKey
* @param operationId * @param operationId
* @param contentId * @param contentId
* @param taskReportLevel
* @param enableReport
* @param taskReportJson * @param taskReportJson
* @param hotSpotInfo
* @param localAttachedFileName * @param localAttachedFileName
* @param attachedChangeFlag * @param attachedChangeFlag
* @param dataSendFlg * @param dataSendFlg
* @param localSavedFlg
* @throws IOException * @throws IOException
*/ */
public void updateTaskReport(String taskKey, long operationId, long contentId, int enableReport, JSONObject taskReportJson, String hotSpotInfo, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException { public void updateTaskReport(String taskKey, long operationId, long contentId, int taskReportLevel, int enableReport, JSONObject taskReportJson, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg, boolean localSavedFlg) throws IOException {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey); TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey, taskReportLevel);
if (taskDto == null) { if (taskReportDto == null) {
// ignore //TODO error?
Logger.w(TAG, "taskDto is null");
return; return;
} }
TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey, Constant.TaskReportLevel.ReportType); if (taskReportJson != null) {
taskDto.operationId = operationId; // suggest登録・更新処理
taskDto.taskHotSpotInfo = hotSpotInfo; registTaskReportItem(taskKey, taskReportLevel, taskReportJson.getJSONObject("suggest"));
JSONObject taskJson = taskReportJson.getJSONObject("task");
taskReportDto.jsonData = taskReportJson.toString();
Iterator taskKeys = taskJson.keys(); } else {
List<TaskReportItemsDto> taskReportItemsDtoList = mTaskReportItemsDao.getTaskReportItemByTaskKey(taskKey, Constant.TaskReportLevel.ReportType); taskReportDto.jsonData = "";
for (TaskReportItemsDto taskReportItemsDto : taskReportItemsDtoList) {
try {
String newValue = taskJson.getString(taskReportItemsDto.itemKey);
if (!newValue.equals(taskReportItemsDto.inputValue)) {
// 値が異なる場合のみ、更新する
taskReportItemsDto.inputValue = newValue;
if (taskReportItemsDto.itemKey.startsWith("q_1_")) {
// 値が異なるため、作業コードの入力値を変更する
taskDto.taskCode = taskReportItemsDto.inputValue;
}
mTaskReportItemsDao.updateTaskReportItems(taskReportItemsDto);
}
} catch (JSONException e) {
// 値がStringではない場合、無視する
continue;
}
} }
taskReportDto.jsonData = taskReportJson.toString(); // 一時保存のフラグ
taskReportDto.localSavedFlg = localSavedFlg;
// 送信フラグ
taskReportDto.dataSendFlg = dataSendFlg; taskReportDto.dataSendFlg = dataSendFlg;
// 作業報告階層 // 作業報告階層
taskReportDto.taskReportLevel = Constant.TaskReportLevel.ReportType; taskReportDto.taskReportLevel = taskReportLevel;
// 報告可能区分 // 報告可能区分
taskReportDto.enableReport = enableReport; taskReportDto.enableReport = enableReport;
...@@ -377,15 +354,11 @@ public class OperationLogic extends AbstractLogic { ...@@ -377,15 +354,11 @@ public class OperationLogic extends AbstractLogic {
taskReportDto.localAttachedFileName = localAttachedFileName; taskReportDto.localAttachedFileName = localAttachedFileName;
} }
if (taskReportJson.has(ABookKeys.TASK_STATUS)) {
taskDto.taskStatus = taskReportJson.getInt(ABookKeys.TASK_STATUS);
}
mTaskReportDao.update(taskReportDto); mTaskReportDao.update(taskReportDto);
mTaskDao.update(taskDto);
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey); String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, Constant.TaskReportLevel.ReportType); String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, taskReportLevel);
if (taskReportDto.attachedFileSendFlg) { if (taskReportDto.attachedFileSendFlg) {
//添付ファイル変更の場合、以下の処理を行う //添付ファイル変更の場合、以下の処理を行う
JSONObject attachedListJson = taskReportJson.getJSONObject("attached"); JSONObject attachedListJson = taskReportJson.getJSONObject("attached");
...@@ -405,110 +378,40 @@ public class OperationLogic extends AbstractLogic { ...@@ -405,110 +378,40 @@ public class OperationLogic extends AbstractLogic {
} }
/** /**
* 作業報告の削除 * 作業報告/作業報告(回答)の削除
* *
* @param operationId * @param operationId
* @param contentId * @param contentId
* @param taskKey * @param taskKey
*/ */
public void deleteTaskReport(long operationId, long contentId, String taskKey) { public void deleteTaskReport(long operationId, long contentId, String taskKey, int taskReportLevel) {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey); TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
if (taskDto == null) { if (taskDto == null) {
return; return;
} }
TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey, taskReportLevel);
TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey, Constant.TaskReportLevel.ReportType); if (taskReportDto != null) {
taskReportDto.dataSendFlg = true; taskReportDto.dataSendFlg = true;
taskReportDto.attachedFileSendFlg = false; taskReportDto.attachedFileSendFlg = false;
taskDto.delFlg = true; if (taskReportDto.taskReportLevel == Constant.TaskReportLevel.ReportType) {
mTaskReportDao.update(taskReportDto); // 報告
mTaskDao.update(taskDto); taskDto.delFlg = true;
} else {
// プロジェクトの作業データディレクトリ削除 // 報告(回答)
deleteTaskFileData(operationId, contentId, taskKey); taskReportDto.jsonData = "";
} taskDto.taskStatus = 0;
/**
* 作業報告(回答)の登録
* @param taskKey
* @param operationId
* @param contentId
* @param taskReportJson
* @param localAttachedFileName
* @param attachedChangeFlag
* @param dataSendFlg
* @throws IOException
*/
public void insertTaskReportReply(String taskKey, long operationId, long contentId, int enableReport, JSONObject taskReportJson, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
if (taskDto == null) {
//TODO error
return;
}
TaskReportDto taskReportDto = new TaskReportDto();
// taskReportJsonがnullではない場合のみ以下の処理を行う
if (taskReportJson != null) {
JSONObject taskJson = taskReportJson.getJSONObject("task");
Iterator taskKeys = taskJson.keys();
while (taskKeys.hasNext()) {
TaskReportItemsDto taskReportItemsDto = new TaskReportItemsDto();
String itemKey = (String) taskKeys.next();
if (itemKey.startsWith("q_3_")) {
taskDto.taskStatus = taskJson.getInt(itemKey);
}
taskReportItemsDto.taskKey = taskKey;
taskReportItemsDto.itemKey = itemKey;
try {
taskReportItemsDto.inputValue = taskJson.getString(itemKey);
} catch (JSONException e) {
// 値がStringではない場合、無視する
continue;
}
mTaskReportItemsDao.insertTaskReportItems(taskReportItemsDto);
} }
taskReportDto.jsonData = taskReportJson.toString();
} else {
taskReportDto.jsonData = "";
}
taskReportDto.taskKey = taskKey;
taskReportDto.dataSendFlg = dataSendFlg;
taskReportDto.attachedFileSendFlg = attachedChangeFlag;
taskReportDto.taskReportLevel = Constant.TaskReportLevel.ReportReplyType;
taskReportDto.enableReport = enableReport;
// 削除の時、deleteではなく、jsonDataを空にして、データが残っているので、updateする
List<TaskReportDto> taskReport = mTaskReportDao.selectByTaskKey(taskReportDto.taskKey, Constant.TaskReportLevel.ReportReplyType);
if (taskReport.size() > 0) {
mTaskReportDao.update(taskReportDto); mTaskReportDao.update(taskReportDto);
} else { mTaskDao.update(taskDto);
mTaskReportDao.insert(taskReportDto); // プロジェクトの作業データディレクトリ削除
} deleteTaskFileData(operationId, contentId, taskKey, taskReportLevel);
mTaskDao.update(taskDto);
if (taskReportJson != null) {
//添付ファイル変更の場合、以下の処理を行う
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, Constant.TaskReportLevel.ReportReplyType);
JSONObject attachedListJson = taskReportJson.getJSONObject("attached");
List<String> attachedFileNames = JSONObject.getValues(attachedListJson);
// コピー元のファイルで、添付ファイルとして使用しないファイル削除
deleteDifferentialFile(tempDirPath, attachedFileNames);
// 添付ディレクトリの移動
boolean result = FileUtil.copy(tempDirPath, operationDrectionOrReportDirPath, true);
if (result) {
FileUtil.delete(tempDirPath);
}
} }
} }
/** /**
* 定期点検データ新規 * 定期点検データ新規
* @param operationId * @param operationId
* @param contentId
* @param taskReportDto * @param taskReportDto
* @param attachedChangeFlag * @param attachedChangeFlag
* @param dataSendFlg * @param dataSendFlg
...@@ -540,6 +443,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -540,6 +443,7 @@ public class OperationLogic extends AbstractLogic {
//添付ファイル変更の場合、以下の処理を行う //添付ファイル変更の場合、以下の処理を行う
String strReportStartDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(taskReportDto.reportStartDate); String strReportStartDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(taskReportDto.reportStartDate);
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskReportDto.taskKey); String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskReportDto.taskKey);
String routineTaskReportDirPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskReportDto.taskKey, taskReportDto.taskReportId, strReportStartDate); String routineTaskReportDirPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskReportDto.taskKey, taskReportDto.taskReportId, strReportStartDate);
...@@ -557,70 +461,6 @@ public class OperationLogic extends AbstractLogic { ...@@ -557,70 +461,6 @@ public class OperationLogic extends AbstractLogic {
} }
} }
public void updateTaskReportReply(String taskKey, long operationId, long contentId, int enableReport, JSONObject taskReport, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException {
TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey, Constant.TaskReportLevel.ReportReplyType);
if (taskReportDto == null) {
Logger.w(TAG, "taskReportDto is null");
// #32926 作業報告画面改善 start
insertTaskReportReply(taskKey, operationId, contentId, enableReport, taskReport, localAttachedFileName, attachedChangeFlag, dataSendFlg);
// #32926 作業報告画面改善 end
return;
}
JSONObject taskJson = taskReport.getJSONObject("task");
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
List<TaskReportItemsDto> taskReportItemsDaoList = mTaskReportItemsDao.getTaskReportItemByTaskKey(taskKey, Constant.TaskReportLevel.ReportReplyType);
for (TaskReportItemsDto taskReportItemsDto : taskReportItemsDaoList) {
try {
String newValue = taskJson.getString(taskReportItemsDto.itemKey);
if (!newValue.equals(taskReportItemsDto.inputValue)) {
// 値が異なる場合のみ、更新する
taskReportItemsDto.inputValue = newValue;
mTaskReportItemsDao.updateTaskReportItems(taskReportItemsDto);
}
if (taskReportItemsDto.itemKey.startsWith("q_3_")) {
// 値が異なるため、作業コードの入力値を変更する
taskDto.taskStatus = Integer.parseInt(taskReportItemsDto.inputValue);
}
} catch (JSONException e) {
// 値がStringではない場合、無視する
continue;
}
}
taskReportDto.jsonData = taskReport.toString();
taskReportDto.dataSendFlg = dataSendFlg;
// attachedFileSendFlgがtrueの場合は、更新しない
if (!taskReportDto.attachedFileSendFlg) {
taskReportDto.attachedFileSendFlg = attachedChangeFlag;
}
// 作業報告階層
taskReportDto.taskReportLevel = Constant.TaskReportLevel.ReportReplyType;
// 報告可能区分
taskReportDto.enableReport = enableReport;
mTaskReportDao.update(taskReportDto);
mTaskDao.update(taskDto);
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
// #32926 作業報告画面改善 start
String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, Constant.TaskReportLevel.ReportReplyType);
// #32926 作業報告画面改善 end
if (taskReportDto.attachedFileSendFlg) {
//添付ファイル変更の場合、以下の処理を行う
JSONObject attachedListJson = taskReport.getJSONObject("attached");
List<String> attachedFileNames = JSONObject.getValues(attachedListJson);
// コピー元のファイルで、添付ファイルとして使用しないファイル削除
deleteDifferentialFile(tempDirPath, attachedFileNames);
// 同じファイル名が存在すれば、コピー先ファイルを削除
deleteDifferentialFile(operationDrectionOrReportDirPath, attachedFileNames);
// 添付ディレクトリの移動
boolean result = FileUtil.copy(tempDirPath, operationDrectionOrReportDirPath, true);
if (result) {
FileUtil.delete(tempDirPath);
}
}
}
/** /**
* 定期点検データ更新 * 定期点検データ更新
* @param operationId * @param operationId
...@@ -628,21 +468,37 @@ public class OperationLogic extends AbstractLogic { ...@@ -628,21 +468,37 @@ public class OperationLogic extends AbstractLogic {
* @param taskReportDto * @param taskReportDto
* @param attachedChangeFlag * @param attachedChangeFlag
* @param dataSendFlg * @param dataSendFlg
* @param insertFlg * @param localSavedFlg
* @param reportedFlg
* @throws IOException * @throws IOException
*/ */
public void updateRoutineTaskReport(long operationId, long contentId, TaskReportDto taskReportDto, boolean attachedChangeFlag, boolean dataSendFlg, boolean insertFlg, boolean reportedFlg) throws IOException { public void updateRoutineTaskReport(long operationId, long contentId, TaskReportDto taskReportDto, boolean attachedChangeFlag, boolean dataSendFlg, boolean localSavedFlg) throws IOException {
taskReportDto.attachedFileSendFlg = attachedChangeFlag; taskReportDto.attachedFileSendFlg = attachedChangeFlag;
taskReportDto.dataSendFlg = dataSendFlg; taskReportDto.dataSendFlg = dataSendFlg;
taskReportDto.reportedFlag = reportedFlg; taskReportDto.localSavedFlg = localSavedFlg;
mTaskReportDao.updateRoutineTask(taskReportDto); mTaskReportDao.update(taskReportDto);
if (!StringUtil.isNullOrEmpty(taskReportDto.jsonData)) { if (!StringUtil.isNullOrEmpty(taskReportDto.jsonData)) {
JSONObject taskReportJson = new JSONObject(taskReportDto.jsonData); JSONObject taskReportJson = new JSONObject(taskReportDto.jsonData);
JSONObject taskJson = taskReportJson.getJSONObject("task"); JSONObject taskJson = taskReportJson.getJSONObject("task");
if (insertFlg) { List<TaskReportItemsDto> taskReportItemsDaoList = mTaskReportItemsDao.getTaskReportItemByTaskKey(taskReportDto.taskKey, Constant.TaskReportLevel.ReportType);
if (taskReportItemsDaoList.size() > 0) {
// 更新
for (TaskReportItemsDto taskReportItemsDto : taskReportItemsDaoList) {
try {
String newValue = taskJson.getString(taskReportItemsDto.itemKey);
if (!newValue.equals(taskReportItemsDto.inputValue)) {
// 値が異なる場合のみ、更新する
taskReportItemsDto.inputValue = newValue;
mTaskReportItemsDao.updateTaskReportItems(taskReportItemsDto);
}
} catch (JSONException e) {
// 値がStringではない場合、無視する
continue;
}
}
} else {
// 登録
Iterator taskKeys = taskJson.keys(); Iterator taskKeys = taskJson.keys();
while (taskKeys.hasNext()) { while (taskKeys.hasNext()) {
TaskReportItemsDto taskReportItemsDto = new TaskReportItemsDto(); TaskReportItemsDto taskReportItemsDto = new TaskReportItemsDto();
...@@ -658,47 +514,15 @@ public class OperationLogic extends AbstractLogic { ...@@ -658,47 +514,15 @@ public class OperationLogic extends AbstractLogic {
} }
mTaskReportItemsDao.insertTaskReportItems(taskReportItemsDto); mTaskReportItemsDao.insertTaskReportItems(taskReportItemsDto);
} }
} else {
List<TaskReportItemsDto> taskReportItemsDaoList = mTaskReportItemsDao.getTaskReportItemByTaskKey(taskReportDto.taskKey, Constant.TaskReportLevel.ReportType);
for (TaskReportItemsDto taskReportItemsDto : taskReportItemsDaoList) {
try {
String newValue = taskJson.getString(taskReportItemsDto.itemKey);
if (!newValue.equals(taskReportItemsDto.inputValue)) {
// 値が異なる場合のみ、更新する
taskReportItemsDto.inputValue = newValue;
mTaskReportItemsDao.updateTaskReportItems(taskReportItemsDto);
}
} catch (JSONException e) {
// 値がStringではない場合、無視する
continue;
}
}
} }
}
String strReportStartDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(taskReportDto.reportStartDate); String strReportStartDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(taskReportDto.reportStartDate);
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskReportDto.taskKey); String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskReportDto.taskKey);
String routineTaskReportDirPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskReportDto.taskKey, taskReportDto.taskReportId, strReportStartDate);
String routineTaskReportDirPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskReportDto.taskKey, taskReportDto.taskReportId, strReportStartDate);
if (insertFlg) {
if (!StringUtil.isNullOrEmpty(taskReportDto.jsonData)) {
JSONObject attachedListJson = (new JSONObject(taskReportDto.jsonData)).getJSONObject("attached");
List<String> attachedFileNames = JSONObject.getValues(attachedListJson);
// コピー元のファイルで、添付ファイルとして使用しないファイル削除
deleteDifferentialFile(tempDirPath, attachedFileNames);
}
// 添付ディレクトリの移動
boolean result = FileUtil.copy(tempDirPath, routineTaskReportDirPath, true);
if(result) {
FileUtil.delete(tempDirPath);
}
} else {
if (taskReportDto.attachedFileSendFlg) { if (taskReportDto.attachedFileSendFlg) {
if (!StringUtil.isNullOrEmpty(taskReportDto.jsonData)) {
if (StringUtil.isNullOrEmpty(taskReportDto.jsonData)) {
//添付ファイル変更の場合、以下の処理を行う //添付ファイル変更の場合、以下の処理を行う
JSONObject attachedListJson = (new JSONObject(taskReportDto.jsonData)).getJSONObject("attached"); JSONObject attachedListJson = (new JSONObject(taskReportDto.jsonData)).getJSONObject("attached");
List<String> attachedFileNames = JSONObject.getValues(attachedListJson); List<String> attachedFileNames = JSONObject.getValues(attachedListJson);
...@@ -707,12 +531,11 @@ public class OperationLogic extends AbstractLogic { ...@@ -707,12 +531,11 @@ public class OperationLogic extends AbstractLogic {
// 同じファイル名が存在すれば、コピー先ファイルを削除 // 同じファイル名が存在すれば、コピー先ファイルを削除
deleteDifferentialFile(routineTaskReportDirPath, attachedFileNames); deleteDifferentialFile(routineTaskReportDirPath, attachedFileNames);
} }
}
// 添付ディレクトリの移動 // 添付ディレクトリの移動
boolean result = FileUtil.copy(tempDirPath, routineTaskReportDirPath, true); boolean result = FileUtil.copy(tempDirPath, routineTaskReportDirPath, true);
if (result) { if (result) {
FileUtil.delete(tempDirPath); FileUtil.delete(tempDirPath);
}
} }
} }
} }
...@@ -793,31 +616,6 @@ public class OperationLogic extends AbstractLogic { ...@@ -793,31 +616,6 @@ public class OperationLogic extends AbstractLogic {
} }
/** /**
* 報告回答を削除
* @param operationId
* @param contentId
* @param taskKey
*/
public void deleteTaskReportReply(long operationId, long contentId, String taskKey) {
TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey, Constant.TaskReportLevel.ReportReplyType);
if(taskReportDto != null) {
taskReportDto.dataSendFlg = true;
taskReportDto.attachedFileSendFlg = false;
taskReportDto.jsonData = "";
mTaskReportDao.update(taskReportDto);
}
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
if (taskDto != null) {
taskDto.taskStatus = 0;
mTaskDao.update(taskDto);
}
// 作業報告のディレクトリ削除
deleteTaskReportReplyFileData(operationId, contentId, taskKey);
}
/**
* 定期点検用、作業削除 * 定期点検用、作業削除
* @param operationId * @param operationId
* @param contentId * @param contentId
...@@ -834,9 +632,6 @@ public class OperationLogic extends AbstractLogic { ...@@ -834,9 +632,6 @@ public class OperationLogic extends AbstractLogic {
// 作業報告のディレクトリ削除 // 作業報告のディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, dto.taskKey)); FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, dto.taskKey));
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, dto.taskKey, dto.taskReportId, reportStartDate)); FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, dto.taskKey, dto.taskReportId, reportStartDate));
// 作業報告送信のディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, dto.taskKey, dto.taskReportId, reportStartDate));
} }
/** /**
...@@ -853,8 +648,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -853,8 +648,7 @@ public class OperationLogic extends AbstractLogic {
taskReportDto.dataSendFlg = true; taskReportDto.dataSendFlg = true;
taskReportDto.attachedFileSendFlg = false; taskReportDto.attachedFileSendFlg = false;
taskReportDto.jsonData = ""; taskReportDto.jsonData = "";
taskReportDto.reportedFlag = false; mTaskReportDao.update(taskReportDto);
mTaskReportDao.updateRoutineTask(taskReportDto);
} }
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey); TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
...@@ -978,7 +772,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -978,7 +772,7 @@ public class OperationLogic extends AbstractLogic {
jsonObject.put("workerCode", ABVDataCache.getInstance().getMemberInfo().workerCode); jsonObject.put("workerCode", ABVDataCache.getInstance().getMemberInfo().workerCode);
// データディレクトリへの相対パス // データディレクトリへの相対パス
jsonObject.put("attachedPath", "../../../../files/ABook/projects/" + operationId); jsonObject.put("attachedPath", "../../../../files/ABook/operation/" + operationId);
jsonObject.put("attachedMoviePath", ABVEnvironment.getInstance().getAttachedMoviesFilePath(contentId)); jsonObject.put("attachedMoviePath", ABVEnvironment.getInstance().getAttachedMoviesFilePath(contentId));
FileUtil.createFile(contentPath + "/content.json", jsonObject.toString()); FileUtil.createFile(contentPath + "/content.json", jsonObject.toString());
...@@ -1058,6 +852,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1058,6 +852,7 @@ public class OperationLogic extends AbstractLogic {
public void createTaskReportJson(Long operationId, String contentPath) throws IOException { public void createTaskReportJson(Long operationId, String contentPath) throws IOException {
List<JSONObject> taskReportJsonList = new ArrayList<JSONObject>(); List<JSONObject> taskReportJsonList = new ArrayList<JSONObject>();
JSONObject taskReportJson = new JSONObject(); JSONObject taskReportJson = new JSONObject();
OperationDto operationDto = mOperationDao.getOperation(operationId);
List<TaskReportDto> taskReportDtoList = mTaskReportDao.getTaskReportByOperationId(operationId); List<TaskReportDto> taskReportDtoList = mTaskReportDao.getTaskReportByOperationId(operationId);
int level = 0; int level = 0;
...@@ -1071,11 +866,17 @@ public class OperationLogic extends AbstractLogic { ...@@ -1071,11 +866,17 @@ public class OperationLogic extends AbstractLogic {
} }
if(dto.jsonData != null && dto.jsonData.length() > 0) { if(dto.jsonData != null && dto.jsonData.length() > 0) {
taskReportJsonList.add(new JSONObject(dto.jsonData).put(ABookKeys.HAS_AUTHORITY, dto.enableReport)); if (operationDto.reportType == Constant.ReportType.ReportReply) {
taskReportJsonList.add(new JSONObject(dto.jsonData).put(ABookKeys.HAS_AUTHORITY, dto.enableReport));
} else {
taskReportJsonList.add(new JSONObject(dto.jsonData));
}
} else { } else {
JSONObject emptyTaskReportJson = new JSONObject(); JSONObject emptyTaskReportJson = new JSONObject();
emptyTaskReportJson.put(ABookKeys.TASK_KEY, dto.taskKey); emptyTaskReportJson.put(ABookKeys.TASK_KEY, dto.taskKey);
emptyTaskReportJson.put(ABookKeys.HAS_AUTHORITY, dto.enableReport); if (operationDto.reportType == Constant.ReportType.ReportReply) {
emptyTaskReportJson.put(ABookKeys.HAS_AUTHORITY, dto.enableReport);
}
taskReportJsonList.add(emptyTaskReportJson); taskReportJsonList.add(emptyTaskReportJson);
} }
...@@ -1096,33 +897,36 @@ public class OperationLogic extends AbstractLogic { ...@@ -1096,33 +897,36 @@ public class OperationLogic extends AbstractLogic {
FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJson.toString()); FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJson.toString());
} }
/**
* 定期点検用のJSON作成
* @param operationId
* @param contentPath
* @throws IOException
*/
public void createRoutineTaskReportJson(Long operationId, String contentPath) throws IOException { public void createRoutineTaskReportJson(Long operationId, String contentPath) throws IOException {
List<JSONObject> taskReportJsonList = new ArrayList<JSONObject>(); List<JSONObject> taskReportJsonList = new ArrayList<JSONObject>();
JSONObject taskReportJsonRoot = new JSONObject(); JSONObject taskReportJsonRoot = new JSONObject();
JSONObject taskReportJsonRow; JSONObject taskReportJsonRow;
int taskReportLevel = 0;
int taskReportId = 0;
List<TaskReportDto> routineTaskReportDtoList = mTaskReportDao.getTaskReportByOperationId(operationId); List<TaskReportDto> routineTaskReportDtoList = mTaskReportDao.getTaskReportByOperationId(operationId);
// 現在の作業タイプは定期点検の場合 // 現在の作業タイプは定期点検の場合
for (TaskReportDto dto : routineTaskReportDtoList) { for (TaskReportDto dto : routineTaskReportDtoList) {
taskReportJsonRow = new JSONObject(); taskReportJsonRow = new JSONObject();
taskReportLevel = dto.taskReportLevel;
taskReportId = dto.taskReportId;
taskReportJsonRow.put(ABookKeys.TASK_REPORT_INFO_ID, dto.taskReportInfoId); 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_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())); taskReportJsonRow.put(ABookKeys.REPORT_END_DATE, DateTimeUtil.toStringInTimeZone(dto.reportEndDate, DateTimeFormat.yyyyMMddHHmmss_hyphen, DateTimeUtil.getLocalTimeZone()));
taskReportJsonRow.put(ABookKeys.REPORTED, dto.reportedFlag ? 1 : 0);
List<JSONObject> taskReportInfoList = new ArrayList<JSONObject>(); List<JSONObject> taskReportInfoList = new ArrayList<JSONObject>();
if (!StringUtil.isNullOrEmpty(dto.jsonData)) { if (!StringUtil.isNullOrEmpty(dto.jsonData)) {
taskReportInfoList.add(new JSONObject(dto.jsonData).put(ABookKeys.HAS_AUTHORITY, dto.enableReport)); taskReportInfoList.add(new JSONObject(dto.jsonData));
} }
taskReportJsonRow.put(ABookKeys.TASK_REPORT_INFO, taskReportInfoList); taskReportJsonRow.put(ABookKeys.TASK_REPORT_INFO, taskReportInfoList);
taskReportJsonList.add(taskReportJsonRow); taskReportJsonList.add(taskReportJsonRow);
} }
taskReportJsonRoot.put(ABookKeys.ENABLE_REPORT_UPDATE, mOperationDao.getOperation(operationId).enableReportUpdate); taskReportJsonRoot.put(ABookKeys.ENABLE_REPORT_UPDATE, mOperationDao.getOperation(operationId).enableReportUpdate);
taskReportJsonRoot.put(ABookKeys.TASK_REPORT_ID, taskReportId); // 最後のtaskReportId
taskReportJsonRoot.put(String.format("taskReport_%d", taskReportLevel), taskReportJsonList); TaskReportDto lastRoutineTaskReportDto = mTaskReportDao.getLastRoutineTaskReportData(operationId);
taskReportJsonRoot.put(ABookKeys.TASK_REPORT_ID, lastRoutineTaskReportDto.taskReportId);
taskReportJsonRoot.put("taskReport_0", taskReportJsonList);
Logger.d(TAG, "createRoutineTaskReportJson : " + taskReportJsonRoot.toString()); Logger.d(TAG, "createRoutineTaskReportJson : " + taskReportJsonRoot.toString());
Logger.d(TAG,contentPath + "/" + ABookKeys.TASK_REPORT + ".json"); Logger.d(TAG,contentPath + "/" + ABookKeys.TASK_REPORT + ".json");
FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJsonRoot.toString()); FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJsonRoot.toString());
...@@ -1330,12 +1134,15 @@ public class OperationLogic extends AbstractLogic { ...@@ -1330,12 +1134,15 @@ public class OperationLogic extends AbstractLogic {
if (taskReportDtoList != null && taskReportDtoList.size() > 0) { if (taskReportDtoList != null && taskReportDtoList.size() > 0) {
int allSendCount = mTaskReportSendDao.getSendableTaskReportSendDataCount(operationId, taskKey); int allSendCount = mTaskReportSendDao.getSendableTaskReportSendDataCount(operationId, taskKey);
int progress = maxProgress / allSendCount; int progress = maxProgress / allSendCount == 0 ? 1 : allSendCount;
// 送信済みsendIdをまとめて削除するため、リストに追加して最後に削除
List<Integer> removeTaskReportSendIds = new ArrayList<Integer>();
for (TaskReportDto taskReportDto : taskReportDtoList) { for (TaskReportDto taskReportDto : taskReportDtoList) {
List<TaskReportSendDto> taskReportSendDtoList; List<TaskReportSendDto> taskReportSendDtoList;
int lastTaskReportSendId; int lastTaskReportSendId;
if (operationDto.reportType == Constant.ReportType.Routine) { if (operationDto.reportType == Constant.ReportType.RoutineTask) {
// 定期点検 // 定期点検
String reportStartDateStr = DateTimeUtil.toString(taskReportDto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen); String reportStartDateStr = DateTimeUtil.toString(taskReportDto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen);
taskReportSendDtoList = mTaskReportSendDao.getSendableTaskReportSendData(taskReportDto.taskKey, taskReportDto.taskReportId, reportStartDateStr); taskReportSendDtoList = mTaskReportSendDao.getSendableTaskReportSendData(taskReportDto.taskKey, taskReportDto.taskReportId, reportStartDateStr);
...@@ -1357,7 +1164,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1357,7 +1164,7 @@ public class OperationLogic extends AbstractLogic {
if (taskReportDto.attachedFileSendFlg) { if (taskReportDto.attachedFileSendFlg) {
String fileName = null; String fileName = null;
zipFile = createAttachedFileForSend(operationId, taskReportDto.taskKey, taskReportSendDto.taskReportSendId, operationDto.reportType == Constant.ReportType.Routine, taskReportDto.taskReportId, strReportStartDate, taskReportDto.taskReportLevel); zipFile = createAttachedFileForSend(operationId, taskReportDto.taskKey, taskReportSendDto.taskReportSendId, operationDto.reportType == Constant.ReportType.RoutineTask, taskReportDto.taskReportId, strReportStartDate, taskReportDto.taskReportLevel);
if (zipFile != null) { if (zipFile != null) {
fileName = FileUtil.getFilenameWithoutExt(zipFile.getName()); fileName = FileUtil.getFilenameWithoutExt(zipFile.getName());
} }
...@@ -1374,18 +1181,13 @@ public class OperationLogic extends AbstractLogic { ...@@ -1374,18 +1181,13 @@ public class OperationLogic extends AbstractLogic {
operationDto.reportType operationDto.reportType
); );
progressCallback.callback(new Integer(progress)); progressCallback.callback(new Integer(progress));
mTaskReportSendDao.deleteBySendId(taskReportSendDto.taskReportSendId); removeTaskReportSendIds.add(taskReportSendDto.taskReportSendId);
if (operationDto.reportType == Constant.ReportType.Routine) { FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportSendId));
// 定期点検
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportId, strReportStartDate, taskReportSendDto.taskReportSendId));
} else {
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportDto.taskReportLevel, taskReportSendDto.taskReportSendId));
}
} catch (ABVException ex) { } catch (ABVException ex) {
if (ex.getCode() == ABVExceptionCode.P_E_ACMS_P005) { if (ex.getCode() == ABVExceptionCode.P_E_ACMS_P005) {
mTaskReportSendDao.deleteBySendId(taskReportSendDto.taskReportSendId); mTaskReportSendDao.deleteBySendId(taskReportSendDto.taskReportSendId);
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportId, strReportStartDate, taskReportSendDto.taskReportSendId)); FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportSendId));
return true; return true;
} }
throw ex; throw ex;
...@@ -1405,6 +1207,10 @@ public class OperationLogic extends AbstractLogic { ...@@ -1405,6 +1207,10 @@ public class OperationLogic extends AbstractLogic {
taskReportDto.dataSendFlg = false; taskReportDto.dataSendFlg = false;
taskReportDto.attachedFileSendFlg = false; taskReportDto.attachedFileSendFlg = false;
mTaskReportDao.update(taskReportDto); mTaskReportDao.update(taskReportDto);
// 削除
for (Integer removeTaskReportSendId : removeTaskReportSendIds) {
mTaskReportSendDao.deleteBySendId(removeTaskReportSendId);
}
} }
} }
} }
...@@ -1418,20 +1224,15 @@ public class OperationLogic extends AbstractLogic { ...@@ -1418,20 +1224,15 @@ public class OperationLogic extends AbstractLogic {
* @param contentId * @param contentId
* @param taskKey * @param taskKey
*/ */
public void deleteTaskFileData(long operationId, long contentId, String taskKey) { public void deleteTaskFileData(long operationId, long contentId, String taskKey, int taskReportLevel) {
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey)); FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskDirFilePath(operationId, taskKey)); if (taskReportLevel == Constant.TaskReportLevel.ReportType) {
} // 報告
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskDirFilePath(operationId, taskKey));
/** } else {
* 作業報告(回答)関連ディレクトリ削除 // 報告(回答)
* @param operationId FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel));
* @param contentId }
* @param taskKey
*/
public void deleteTaskReportReplyFileData(long operationId, long contentId, String taskKey) {
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, Constant.TaskReportLevel.ReportReplyType));
} }
/** /**
...@@ -1487,7 +1288,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1487,7 +1288,7 @@ public class OperationLogic extends AbstractLogic {
* @throws InterruptedException * @throws InterruptedException
*/ */
public String getRoutineTaskReportFile(long operationId, String taskKey, long taskId, int taskReportId, int taskReportInfoId, String reportStartDate, String attachedFileName) throws ABVException, InterruptedException { 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); GetTaskFileParameters parameters = new GetTaskFileParameters(cache.getMemberInfo().sid, taskId, Constant.ReportType.Report, taskReportInfoId);
String outputFilePath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDate) + "/" + attachedFileName + ".zip"; String outputFilePath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDate) + "/" + attachedFileName + ".zip";
AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getTaskFile(parameters, operationId, outputFilePath); AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getTaskFile(parameters, operationId, outputFilePath);
return outputFilePath; return outputFilePath;
...@@ -1528,10 +1329,6 @@ public class OperationLogic extends AbstractLogic { ...@@ -1528,10 +1329,6 @@ public class OperationLogic extends AbstractLogic {
mOperationDao.updateContentCreatingFlg(operationId, true); mOperationDao.updateContentCreatingFlg(operationId, true);
} }
public TaskReportDto getLastRoutineTaskReportData(long operationId) {
return mTaskReportDao.getLastRoutineTaskReportData(operationId);
}
/** /**
* 作業の添付ファイルのzip生成 * 作業の添付ファイルのzip生成
* @param operationId * @param operationId
...@@ -1593,13 +1390,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1593,13 +1390,7 @@ public class OperationLogic extends AbstractLogic {
*/ */
private File createAttachedFileForSend(Long operationId, String taskKey, int taskReportSendId, boolean routineFlag, int reportId, String reportStartDate, int taskReportLevel) 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; File zipFile;
String filePath; String filePath = ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskKey, taskReportSendId);
if (routineFlag) {
filePath = ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskKey, reportId, reportStartDate, taskReportSendId);
} else {
filePath = ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskKey, taskReportLevel, taskReportSendId);
}
File fileDir = new File(filePath); File fileDir = new File(filePath);
if (!fileDir.exists()) { if (!fileDir.exists()) {
...@@ -1673,4 +1464,93 @@ public class OperationLogic extends AbstractLogic { ...@@ -1673,4 +1464,93 @@ public class OperationLogic extends AbstractLogic {
public TaskReportDto getTaskReport(String taskKey, int taskReportlevel) { public TaskReportDto getTaskReport(String taskKey, int taskReportlevel) {
return mTaskReportDao.getTaskReport(taskKey, taskReportlevel); return mTaskReportDao.getTaskReport(taskKey, taskReportlevel);
} }
/**
* suggestJsonデータをtaskReportItemテーブルに登録
* @param taskKey
* @param reportLevel
* @param suggestJson
*/
public void registTaskReportItem(String taskKey, int reportLevel, JSONObject suggestJson) {
if (suggestJson == null) {
// suggestJsonがnullの場合、return
return;
}
Iterator itemKeys = suggestJson.keys();
while (itemKeys.hasNext()) {
String itemKey = (String) itemKeys.next();
TaskReportItemsDto taskReportItemsDto = mTaskReportItemsDao.getTaskReportItem(taskKey, reportLevel, itemKey);
if (taskReportItemsDto != null) {
// 更新
String newValue = suggestJson.getString(taskReportItemsDto.itemKey);
if (!newValue.equals(taskReportItemsDto.inputValue)) {
// 値が異なる場合のみ、更新する
taskReportItemsDto.inputValue = newValue;
mTaskReportItemsDao.updateTaskReportItems(taskReportItemsDto);
}
} else {
// 登録
taskReportItemsDto = new TaskReportItemsDto();
taskReportItemsDto.taskKey = taskKey;
taskReportItemsDto.itemKey = itemKey;
taskReportItemsDto.taskReportLevel = reportLevel;
try {
taskReportItemsDto.inputValue = suggestJson.getString(itemKey);
} catch (JSONException e) {
// 値がStringではない場合、無視する
continue;
}
mTaskReportItemsDao.insertTaskReportItems(taskReportItemsDto);
}
}
}
/**
* t_taskテーブルに登録(報告データ)
* データが存在しないと登録する
* @param taskKey
* @param operationId
* @param hotSpotInfo
* @param taskStatus
*/
public void registTaskData(String taskKey, Long operationId, String hotSpotInfo, Integer taskStatus, JSONObject taskJson) {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
String taskCode = null;
if (taskJson != null) {
// 作業コード取得
Iterator taskKeys = taskJson.keys();
while (taskKeys.hasNext()) {
String itemKey = (String) taskKeys.next();
if (itemKey.startsWith("q_1_")) {
taskCode = taskJson.getString(itemKey);
}
}
}
if (taskDto != null) {
// 更新
taskDto.taskCode = taskCode;
if (hotSpotInfo != null) {
taskDto.taskHotSpotInfo = hotSpotInfo;
}
if (taskStatus != null) {
taskDto.taskStatus = taskStatus;
}
mTaskDao.update(taskDto);
} else {
// 登録
taskDto = new TaskDto();
taskDto.taskCode = taskCode;
taskDto.taskKey = taskKey;
taskDto.operationId = operationId;
if (hotSpotInfo != null) {
taskDto.taskHotSpotInfo = hotSpotInfo;
}
if (taskStatus != null) {
taskDto.taskStatus = taskStatus;
}
mTaskDao.insert(taskDto);
}
}
} }
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/icon_infomation_update_on" android:state_enabled="true" />
<item android:drawable="@drawable/icon_infomation_update_off" android:state_enabled="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/icon_pano_edit_on" android:state_enabled="true"/>
<item android:drawable="@drawable/icon_pano_edit_off" android:state_enabled="false" />
</selector>
\ No newline at end of file
...@@ -82,10 +82,10 @@ ...@@ -82,10 +82,10 @@
<color name="operation_date">#37648C</color> <color name="operation_date">#37648C</color>
<color name="operation_color">#095395</color> <color name="operation_color">#095395</color>
<color name="operation_disable_color">#CCCCCC</color> <color name="operation_disable_color">#CCCCCC</color>
<color name="operation_search_background">#FFFFFF</color>
<color name="operation_search_header">#CCCCCC</color> <color name="operation_search_header">#CCCCCC</color>
<color name="operation_search_button_color">#0068CB</color> <color name="operation_search_button_color">#0068CB</color>
<color name="operation_search_label_color">#555555</color> <color name="operation_search_label_color">#555555</color>
<color name="operation_related_content_new_mark">#ff0000</color> <color name="operation_related_content_new_mark">#ff0000</color>
<color name="operation_bg">#FFFFFF</color>
</resources> </resources>
\ No newline at end of file
...@@ -68,6 +68,9 @@ ...@@ -68,6 +68,9 @@
<style name="content_list_bg"> <style name="content_list_bg">
<item name="android:background">@color/background</item> <item name="android:background">@color/background</item>
</style> </style>
<style name="operation_list_bg">
<item name="android:background">@color/operation_bg</item>
</style>
<style name="Theme.MyTheme.ModalDialog" parent="@android:style/Theme.Dialog"> <style name="Theme.MyTheme.ModalDialog" parent="@android:style/Theme.Dialog">
<item name="android:windowCloseOnTouchOutside">false</item> <item name="android:windowCloseOnTouchOutside">false</item>
......
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
<FrameLayout <FrameLayout
android:id="@+id/operation_list_layout" android:id="@+id/operation_list_layout"
style="@style/content_list_bg" style="@style/operation_list_bg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
......
...@@ -4,111 +4,94 @@ ...@@ -4,111 +4,94 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/list_selector_holo_light" android:background="@drawable/list_selector_holo_light"
android:descendantFocusability="blocksDescendants" android:descendantFocusability="blocksDescendants"
android:orientation="vertical"> android:padding="10dp"
android:orientation="horizontal">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:orientation="horizontal">
android:layout_marginLeft="30dp"
android:orientation="vertical">
<TextView <LinearLayout
android:id="@+id/operation_date"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:ellipsize="end" android:gravity="left"
android:maxLines="1" android:orientation="horizontal">
android:text="@string/dummy_date"
android:textColor="@color/operation_date"
android:textSize="@dimen/operation_normal_text_size" />
<TextView <ImageView
android:id="@+id/operation_name" android:id="@+id/report_type"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="5dp" android:layout_marginRight="10dp"/>
android:ellipsize="end"
android:maxLines="1"
android:text="@string/dummy_str"
android:textColor="@color/operation_name"
android:textSize="@dimen/app_large_text_size"
android:textStyle="bold"
android:visibility="visible" />
</LinearLayout> <ImageView
android:id="@+id/operation_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent" </LinearLayout>
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginLeft="30dp"
android:orientation="horizontal">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_weight="1" android:layout_weight="1"
android:orientation="horizontal" android:orientation="vertical">
android:layout_gravity="bottom">
<TextView <TextView
android:id="@+id/description" android:id="@+id/operation_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/operation_description" android:ellipsize="end"
android:textSize="@dimen/operation_normal_text_size"/> android:maxLines="1"
android:text="@string/dummy_str"
android:textColor="@color/operation_name"
android:textSize="@dimen/app_large_text_size"
android:textStyle="bold"
android:visibility="visible" />
<TextView
android:id="@+id/operation_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:ellipsize="end"
android:maxLines="1"
android:text="@string/dummy_date"
android:textColor="@color/operation_date"
android:textSize="@dimen/operation_normal_text_size" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="right" android:layout_marginRight="10dp"
android:layout_margin="3dp"
android:orientation="horizontal"> android:orientation="horizontal">
<LinearLayout <ImageButton
android:id="@+id/layout_pano_edit" android:id="@+id/btn_pano_edit"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:background="@drawable/ic_edit_list"
android:orientation="vertical" android:visibility="invisible" />
android:visibility="invisible">
<ImageView <ImageButton
android:id="@+id/btn_pano_edit" android:id="@+id/btn_sync"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_pano_edit" />
<TextView
android:id="@+id/txt_pano_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/ProjectIconText"
android:text="@string/pano_edit" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_marginLeft="10dp"
android:orientation="vertical"> android:background="@drawable/ic_reload_list" />
<ImageButton
android:id="@+id/btn_information_update"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_information_update"/>
<TextView
android:id="@+id/txt_information_update"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/ProjectIconText"
android:text="@string/information_update" />
</LinearLayout>
</LinearLayout> </LinearLayout>
<ImageView
android:id="@+id/item_nextLevel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_alignParentRight="true"
android:src="@drawable/ic_navigation_next_item"
android:visibility="visible" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:background="@drawable/list_selector_holo_light" android:background="@drawable/list_selector_holo_light"
android:descendantFocusability="blocksDescendants" android:descendantFocusability="blocksDescendants"
android:orientation="vertical"> android:orientation="vertical">
...@@ -10,24 +10,34 @@ ...@@ -10,24 +10,34 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:orientation="vertical"> android:orientation="horizontal">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:orientation="vertical"> android:layout_marginTop="10dp"
android:gravity="left"
android:orientation="horizontal">
<TextView <ImageButton
android:id="@+id/operation_date" android:id="@+id/operation_type"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:layout_marginRight="10dp" />
android:maxLines="2"
android:text="@string/dummy_date" <ImageButton
android:textColor="@color/operation_date" android:id="@+id/report_type"
android:textSize="@dimen/operation_normal_text_size" /> android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<TextView <TextView
android:id="@+id/operation_name" android:id="@+id/operation_name"
...@@ -42,74 +52,46 @@ ...@@ -42,74 +52,46 @@
android:textStyle="bold" android:textStyle="bold"
android:visibility="visible" /> android:visibility="visible" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:layout_weight="1"
android:orientation="horizontal">
<TextView <TextView
android:id="@+id/description" android:id="@+id/operation_date"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="4" android:maxLines="2"
android:textColor="@color/operation_description" android:text="@string/dummy_date"
android:textColor="@color/operation_date"
android:textSize="@dimen/operation_normal_text_size" /> android:textSize="@dimen/operation_normal_text_size" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_margin="3dp" android:layout_margin="3dp"
android:orientation="horizontal"> android:orientation="horizontal">
<LinearLayout <ImageView
android:id="@+id/layout_pano_edit" android:id="@+id/btn_pano_edit"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_weight="1"
android:orientation="vertical" android:background="@drawable/ic_edit_list" />
android:visibility="invisible">
<ImageView
android:id="@+id/btn_pano_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_pano_edit" />
<TextView <ImageButton
android:id="@+id/txt_pano_edit" android:id="@+id/btn_sync"
style="@style/ProjectIconText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pano_edit" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_weight="1"
android:orientation="vertical"> android:background="@drawable/ic_reload_list" />
<ImageButton
android:id="@+id/btn_information_update"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_information_update" />
<TextView
android:id="@+id/txt_information_update"
style="@style/ProjectIconText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/information_update" />
</LinearLayout>
</LinearLayout> </LinearLayout>
<ImageView
android:id="@+id/item_nextLevel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_gravity="center"
android:src="@drawable/ic_navigation_next_item"
android:visibility="visible" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="300dp" android:layout_height="300dp"
android:minHeight="200dp" android:minHeight="200dp"
android:background="@color/operation_search_background" android:background="@color/operation_bg"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <RelativeLayout
......
...@@ -5,162 +5,97 @@ ...@@ -5,162 +5,97 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/list_selector_holo_light" android:background="@drawable/list_selector_holo_light"
android:descendantFocusability="blocksDescendants" android:descendantFocusability="blocksDescendants"
android:padding="10dp"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="200dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@drawable/panel_frame" android:background="@drawable/panel_frame"
android:orientation="vertical" android:orientation="vertical">
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/operation_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:ellipsize="end"
android:maxLines="1"
android:text="@string/dummy_str"
android:textColor="@color/operation_name"
android:textSize="@dimen/app_large_text_size"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="5dp"> android:padding="5dp">
<RelativeLayout
android:id="@+id/content_thumbnail_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:layout_gravity="center">
<ImageButton
android:id="@+id/btn_information_update1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:background="@drawable/btn_information_update" />
</RelativeLayout>
<LinearLayout <LinearLayout
android:id="@+id/operation_date_layout" android:layout_width="wrap_content"
android:layout_width="match_parent" android:layout_height="match_parent">
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:layout_weight="1"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:layout_toRightOf="@+id/content_thumbnail_layout"
android:background="#dce6e6"
android:orientation="vertical"
android:padding="3dp"
android:paddingBottom="10dp">
<TextView <ImageView
android:id="@+id/operation_date" android:id="@+id/report_type"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:layout_marginLeft="5dp"
android:maxLines="1" android:layout_marginRight="10dp" />
android:text="@string/dummy_date"
android:textColor="@color/operation_date"
android:textSize="@dimen/operation_normal_text_size" />
</LinearLayout> <ImageView
android:id="@+id/operation_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout </LinearLayout>
android:id="@+id/button_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/operation_border"
android:orientation="horizontal"
android:padding="5dp"
android:visibility="visible">
<LinearLayout <LinearLayout
android:id="@+id/edit_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:gravity="right"
android:gravity="center" android:orientation="horizontal">
android:orientation="horizontal"
android:padding="5dp"
android:visibility="visible">
<LinearLayout <ImageButton
android:id="@+id/layout_pano_edit" android:id="@+id/btn_pano_edit"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:background="@drawable/ic_edit_panel"
android:orientation="vertical" android:visibility="invisible" />
android:visibility="visible">
<ImageView
android:id="@+id/btn_pano_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_pano_edit" />
<TextView <ImageButton
android:id="@+id/txt_pano_edit" android:id="@+id/btn_sync"
style="@style/ProjectIconText" android:layout_width="wrap_content"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:layout_marginLeft="10dp"
android:text="@string/pano_edit" /> android:background="@drawable/ic_reload_panel" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout>
<LinearLayout <View
android:id="@+id/update_layout" android:id="@+id/view3"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="1dp"
android:layout_weight="1" android:background="@color/line_side" />
android:gravity="center"
android:orientation="horizontal"
android:padding="5dp"
android:visibility="visible">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:gravity="center_vertical"
android:orientation="vertical"> android:orientation="vertical">
<ImageButton <TextView
android:id="@+id/btn_information_update" android:id="@+id/operation_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/btn_information_update" /> android:layout_marginTop="5dp"
android:ellipsize="end"
android:maxLines="2"
android:text="@string/dummy_str"
android:textColor="@color/operation_name"
android:textSize="@dimen/app_large_text_size"
android:textStyle="bold" />
<TextView <TextView
android:id="@+id/txt_information_update" android:id="@+id/operation_date"
style="@style/ProjectIconText" android:layout_width="wrap_content"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:layout_marginTop="5dp"
android:text="@string/information_update" /> android:layout_weight="1"
</LinearLayout> android:ellipsize="end"
</LinearLayout> android:maxLines="1"
android:text="@string/dummy_date"
android:textColor="@color/operation_date"
android:textSize="@dimen/operation_normal_text_size" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
android:id="@+id/root_layout" android:id="@+id/root_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/operation_search_background" android:background="@color/operation_bg"
android:orientation="vertical" android:orientation="vertical"
android:weightSum="1"> android:weightSum="1">
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
android:id="@+id/root_layout" android:id="@+id/root_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/operation_search_background" android:background="@color/operation_bg"
android:minWidth="500dp" android:minWidth="500dp"
android:orientation="vertical"> android:orientation="vertical">
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="420dp" android:layout_height="420dp"
android:minHeight="300dp" android:minHeight="300dp"
android:background="@color/operation_search_background" android:background="@color/operation_bg"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <RelativeLayout
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="420dp" android:layout_height="420dp"
android:minHeight="300dp" android:minHeight="300dp"
android:background="@color/operation_search_background" android:background="@color/operation_bg"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <RelativeLayout
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
android:id="@+id/root_layout" android:id="@+id/root_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="420dp" android:layout_height="420dp"
android:background="@color/operation_search_background" android:background="@color/operation_bg"
android:minWidth="500dp" android:minWidth="500dp"
android:orientation="vertical"> android:orientation="vertical">
......
...@@ -2,7 +2,7 @@ package jp.agentec.abook.abv.launcher.android; ...@@ -2,7 +2,7 @@ package jp.agentec.abook.abv.launcher.android;
import java.util.ArrayList; import java.util.ArrayList;
import jp.agentec.abook.abv.bl.common.Constant.OperationReportType; import jp.agentec.abook.abv.bl.common.Constant.ReportType;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
...@@ -22,7 +22,7 @@ public class ABVUIDataCache { ...@@ -22,7 +22,7 @@ public class ABVUIDataCache {
// ホーム画面項目 // ホーム画面項目
private int viewMode; // パンネル、リスト形式 private int viewMode; // パンネル、リスト形式
private ArrayList<Integer> mOperationReportTypes; private ArrayList<Integer> mReportTypes;
public long lastUpdateTime = -1; public long lastUpdateTime = -1;
public String searchText; public String searchText;
...@@ -112,7 +112,7 @@ public class ABVUIDataCache { ...@@ -112,7 +112,7 @@ public class ABVUIDataCache {
} }
public void setOperationReportTypes(ArrayList<Integer> operationReportTypes) { public void setOperationReportTypes(ArrayList<Integer> operationReportTypes) {
this.mOperationReportTypes = operationReportTypes; this.mReportTypes = operationReportTypes;
String val = null; String val = null;
if (operationReportTypes.size() > 0) { if (operationReportTypes.size() > 0) {
// カンマ区切りで保存 // カンマ区切りで保存
...@@ -137,14 +137,14 @@ public class ABVUIDataCache { ...@@ -137,14 +137,14 @@ public class ABVUIDataCache {
operationReportTypes.add(Integer.parseInt(contentType)); operationReportTypes.add(Integer.parseInt(contentType));
} }
} }
mOperationReportTypes = operationReportTypes; mReportTypes = operationReportTypes;
} else { } else {
mOperationReportTypes = new ArrayList<Integer>(); mReportTypes = new ArrayList<Integer>();
mOperationReportTypes.add(OperationReportType.REPORT_TYPE); mReportTypes.add(ReportType.Report);
mOperationReportTypes.add(OperationReportType.ROUTINE_TASK); mReportTypes.add(ReportType.RoutineTask);
mOperationReportTypes.add(OperationReportType.REPORT_RESPONSE_TYPE); mReportTypes.add(ReportType.ReportReply);
} }
return mOperationReportTypes; return mReportTypes;
} }
} }
...@@ -137,7 +137,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -137,7 +137,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public int mButtonStatus; // 保存ボタンチェック public int mButtonStatus; // 保存ボタンチェック
protected boolean mAddReport; // 作業追加区分 protected boolean mAddReport; // 作業追加区分
protected int mTaskReportLevel; // 作業報告レベル
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -801,7 +800,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -801,7 +800,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
helpViewType = Constant.HelpViewType.ListOperationDirector; helpViewType = Constant.HelpViewType.ListOperationDirector;
break; break;
case Constant.XWalkOpenType.TASK_REPORT: case Constant.XWalkOpenType.TASK_REPORT:
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.ReportType.RoutineTask) {
helpViewType = Constant.HelpViewType.RoutineTaskOperation; helpViewType = Constant.HelpViewType.RoutineTaskOperation;
} else { } else {
helpViewType = Constant.HelpViewType.ListOperationReporter; helpViewType = Constant.HelpViewType.ListOperationReporter;
...@@ -838,7 +837,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -838,7 +837,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) {
helpViewType = Constant.HelpViewType.DirectorTask; helpViewType = Constant.HelpViewType.DirectorTask;
} else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) { } else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.ReportType.RoutineTask) {
helpViewType = Constant.HelpViewType.RoutineTaskOperationReport; helpViewType = Constant.HelpViewType.RoutineTaskOperationReport;
} else { } else {
helpViewType = Constant.HelpViewType.ReportTask; helpViewType = Constant.HelpViewType.ReportTask;
...@@ -869,25 +868,27 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -869,25 +868,27 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
mCmd = abookCheckParam.get(ABookKeys.CMD); mCmd = abookCheckParam.get(ABookKeys.CMD);
mTaskKey = abookCheckParam.get(ABookKeys.TASK_KEY); mTaskKey = abookCheckParam.get(ABookKeys.TASK_KEY);
mTaskReportLevel = 0; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答)) int taskReportLevel = 0; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答))
if (abookCheckParam.containsKey(ABookKeys.TASK_REPORT_LEVEL)) { if (abookCheckParam.containsKey(ABookKeys.TASK_REPORT_LEVEL)) {
mTaskReportLevel = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_LEVEL)); // 作業報告レベル taskReportLevel = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_LEVEL)); // 作業報告レベル
} }
int taskReportId = 0;
String reportStartDate = "";
// 作業追加区分の値を取得する // 作業追加区分の値を取得する
mAddReport = true; mAddReport = true;
if (abookCheckParam.containsKey(ABookKeys.ADD_REPORT)) {
// 定期点検の場合、以下のフラグを変更しない(mAddReport trueのみ)
if (abookCheckParam.containsKey(ABookKeys.ADD_REPORT) && operationDto.reportType != Constant.ReportType.RoutineTask) {
mAddReport = Integer.parseInt(abookCheckParam.get(ABookKeys.ADD_REPORT)) > 0 ? true : false; mAddReport = Integer.parseInt(abookCheckParam.get(ABookKeys.ADD_REPORT)) > 0 ? true : false;
} }
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK && abookCheckParam.get(ABookKeys.TASK_REPORT_ID) != null && abookCheckParam.get(ABookKeys.REPORT_START_DATE) != null) { int taskReportId = 0;
taskReportId = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_ID)); String reportStartDate = "";
reportStartDate = abookCheckParam.get(ABookKeys.REPORT_START_DATE);
}
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT, if (operationDto.reportType == Constant.ReportType.RoutineTask && abookCheckParam.get(ABookKeys.TASK_REPORT_ID) != null && abookCheckParam.get(ABookKeys.REPORT_START_DATE) != null) {
taskReportId = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = abookCheckParam.get(ABookKeys.REPORT_START_DATE);
}
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_DELETE_TASK_REPORT, ABookKeys.CMD_CANCEL_TASK_REPORT, ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) {
try { try {
...@@ -898,39 +899,39 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -898,39 +899,39 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
} }
if (isOperationPdf && operationTaskDto != null && StringUtil.equalsAny(mCmd, if (isOperationPdf && operationTaskDto != null && StringUtil.equalsAny(mCmd,
ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_INSERT_TASK_REPORT,
ABookKeys.CMD_UPDATE_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT,
ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_MOVE_HOT_SPOT,
ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) { ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) {
String taskCode = ""; String taskCode = "";
if (abookCheckParam.get(ABookKeys.TASK_REPORT) != null) { if (abookCheckParam.get(ABookKeys.TASK_REPORT) != null) {
JSONObject tastReportJson = new JSONObject(abookCheckParam.get(ABookKeys.TASK_REPORT)); JSONObject tastReportJson = new JSONObject(abookCheckParam.get(ABookKeys.TASK_REPORT));
JSONObject taskJson = tastReportJson.getJSONObject(ABookKeys.TASK); JSONObject taskJson = tastReportJson.getJSONObject(ABookKeys.TASK);
Iterator taskKeys = taskJson.keys(); Iterator taskKeys = taskJson.keys();
while (taskKeys.hasNext()) { while (taskKeys.hasNext()) {
String itemKey = (String) taskKeys.next(); String itemKey = (String) taskKeys.next();
if (itemKey.startsWith("q_1_")) { if (itemKey.startsWith("q_1_")) {
taskCode = taskJson.getString(itemKey); taskCode = taskJson.getString(itemKey);
} }
} }
} }
if (abookCheckParam.get(ABookKeys.HOT_SPOT) != null) { if (abookCheckParam.get(ABookKeys.HOT_SPOT) != null) {
JSONObject hotSpot = new JSONObject(abookCheckParam.get(ABookKeys.HOT_SPOT)); JSONObject hotSpot = new JSONObject(abookCheckParam.get(ABookKeys.HOT_SPOT));
hotSpot.put(ABookKeys.SCENE_ID, mCurrentPageNumber + 1); hotSpot.put(ABookKeys.SCENE_ID, mCurrentPageNumber + 1);
hotSpot.put(ABookKeys.PDF_X, operationTaskDto.pdfX); hotSpot.put(ABookKeys.PDF_X, operationTaskDto.pdfX);
hotSpot.put(ABookKeys.PDF_Y, operationTaskDto.pdfY); hotSpot.put(ABookKeys.PDF_Y, operationTaskDto.pdfY);
if (!StringUtil.isNullOrEmpty(taskCode)) { if (!StringUtil.isNullOrEmpty(taskCode)) {
hotSpot.put(ABookKeys.TASK_CODE, taskCode); hotSpot.put(ABookKeys.TASK_CODE, taskCode);
} }
abookCheckParam.put(ABookKeys.HOT_SPOT, hotSpot.toString()); abookCheckParam.put(ABookKeys.HOT_SPOT, hotSpot.toString());
} }
} }
final Callback finishCallback = new Callback() { final Callback finishCallback = new Callback() {
@Override @Override
...@@ -955,32 +956,30 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -955,32 +956,30 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// 画面遷移処理 // 画面遷移処理
closeCurrentScreen(mOperationType); closeCurrentScreen(mOperationType);
} }
return null; return null;
} }
}; };
ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this, ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this,
mCmd, mTaskKey, mEnableReportHistory, abookCheckParam, mOperationId, mContentPath, getContentId(), mCmd, mTaskKey, mEnableReportHistory, abookCheckParam, mOperationId, mContentPath, getContentId(),
operationDto.reportType, finishCallback, operationDto.reportType, finishCallback, taskReportLevel);
mTaskReportLevel);
} catch(Exception e) { } catch(Exception e) {
Logger.e(TAG, "doABookCheckParam error", e); Logger.e(TAG, "doABookCheckParam error", e);
} }
if(isOperationPdf) { if(isOperationPdf) {
onActionOperationPdfWebView(abookCheckParam, operationTaskDto); onActionOperationPdfWebView(abookCheckParam, operationTaskDto);
} }
} else if (mCmd.equals(ABookKeys.CMD_CHANGE_DISPLAY_STATUS)) { } else if (mCmd.equals(ABookKeys.CMD_CHANGE_DISPLAY_STATUS)) {
mStatusCode = Integer.valueOf(abookCheckParam.get(ABookKeys.STATUS_CODE)); mStatusCode = Integer.valueOf(abookCheckParam.get(ABookKeys.STATUS_CODE));
commonConfigureHeader(); commonConfigureHeader();
if(isOperationPdf) { if(isOperationPdf) {
onActionOperationPdfWebView(abookCheckParam, operationTaskDto); onActionOperationPdfWebView(abookCheckParam, operationTaskDto);
} }
} else if (mCmd.equals(ABookKeys.CMD_SAVE_ATTACHED)) { } else if (mCmd.equals(ABookKeys.CMD_SAVE_ATTACHED)) {
mAttachedFileName = abookCheckParam.get(ABookKeys.FILE_NAME); mAttachedFileName = abookCheckParam.get(ABookKeys.FILE_NAME);
getAttachedDataUrl(); getAttachedDataUrl();
} else if (mCmd.equals(ABookKeys.CMD_SHOW_DIRECTION_OZD)) { } else if (mCmd.equals(ABookKeys.CMD_SHOW_DIRECTION_OZD)) {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME); mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, false, true, mReportFileName); ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, false, true, mReportFileName);
} else if (mCmd.equals(ABookKeys.CMD_PREVIEW_DIRECTION_OZD)) { } else if (mCmd.equals(ABookKeys.CMD_PREVIEW_DIRECTION_OZD)) {
...@@ -988,18 +987,16 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -988,18 +987,16 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, true, mReportFileName); ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, true, mReportFileName);
} else if (mCmd.equals(ABookKeys.CMD_SHOW_REPORT_OZD)) { } else if (mCmd.equals(ABookKeys.CMD_SHOW_REPORT_OZD)) {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME); mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
// #32926 作業報告画面改善 start // 作業報告画面改善
boolean mLocalSave = false; // 一時保存情報 boolean mLocalSave = false; // 一時保存情報
if (abookCheckParam.containsKey(ABookKeys.LOCAL_SAVE)) { if (abookCheckParam.containsKey(ABookKeys.LOCAL_SAVE)) {
mLocalSave = Integer.parseInt(abookCheckParam.get(ABookKeys.LOCAL_SAVE)) > 0 ? true : false; mLocalSave = Integer.parseInt(abookCheckParam.get(ABookKeys.LOCAL_SAVE)) > 0 ? true : false;
} }
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, false, taskReportId, reportStartDate, mReportFileName, mLocalSave, mAddReport, mTaskReportLevel); ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, false, taskReportId, reportStartDate, mReportFileName, mLocalSave, mAddReport, taskReportLevel);
// #32926 作業報告画面改善 end
} else if (mCmd.equals(ABookKeys.CMD_PREVIEW_REPORT_OZD)) { } else if (mCmd.equals(ABookKeys.CMD_PREVIEW_REPORT_OZD)) {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME); mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
// #32926 作業報告画面改善 start // 作業報告画面改善
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, taskReportId, reportStartDate, mReportFileName, false, false, mTaskReportLevel); ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, taskReportId, reportStartDate, mReportFileName, false, false, taskReportLevel);
// #32926 作業報告画面改善 end
} else if (mCmd.equals(ABookKeys.CMD_CONTENT_EDIT_CLOSE)) { } else if (mCmd.equals(ABookKeys.CMD_CONTENT_EDIT_CLOSE)) {
showProgressPopup(); showProgressPopup();
handler.postDelayed(new Runnable() { handler.postDelayed(new Runnable() {
...@@ -1011,7 +1008,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1011,7 +1008,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}, 5000); }, 5000);
} else if (mCmd.equals(ABookKeys.CMD_GET_GPS_INFO)) { } else if (mCmd.equals(ABookKeys.CMD_GET_GPS_INFO)) {
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
setLocation((Integer.valueOf(abookCheckParam.get(ABookKeys.GPS_TYPE)) != 1), mTaskReportLevel); setLocation((Integer.valueOf(abookCheckParam.get(ABookKeys.GPS_TYPE)) != 1), taskReportLevel);
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
} else if (mCmd.equals(ABookKeys.CMD_SCENE_REGIST)) { } else if (mCmd.equals(ABookKeys.CMD_SCENE_REGIST)) {
String successFlg = abookCheckParam.get(ABookKeys.SUCCESS_FLG); String successFlg = abookCheckParam.get(ABookKeys.SUCCESS_FLG);
......
...@@ -331,7 +331,7 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity { ...@@ -331,7 +331,7 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
isNeedCheck = true; isNeedCheck = true;
} }
} }
if (isNeedCheck) { if (isNeedCheck) {
final ABVDataCache dataCache = ABVDataCache.getInstance(); final ABVDataCache dataCache = ABVDataCache.getInstance();
final ABVEnvironment abvEnvironment = ABVEnvironment.getInstance(); final ABVEnvironment abvEnvironment = ABVEnvironment.getInstance();
......
...@@ -133,9 +133,7 @@ public interface AppDefType { ...@@ -133,9 +133,7 @@ public interface AppDefType {
interface PushMessageKey { interface PushMessageKey {
String message = "message"; String message = "message";
String data = "data"; String data = "data";
// TODO String operationId = "operationId";
// サーバ作業後、対応必要「project」→「operation」
String operationId = "projectId";
} }
interface UrlPattern { interface UrlPattern {
......
...@@ -57,13 +57,14 @@ import jp.agentec.abook.abv.bl.acms.client.AcmsClient; ...@@ -57,13 +57,14 @@ import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON; import jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters; 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.acms.type.DownloadStatusType;
import jp.agentec.abook.abv.bl.acms.type.OperationAuthLevel;
import jp.agentec.abook.abv.bl.acms.type.OperationType; import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Callback; import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor; import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.Constant.OperationReportType; import jp.agentec.abook.abv.bl.common.Constant.ReportType;
import jp.agentec.abook.abv.bl.common.Constant.TaskReportLevel;
import jp.agentec.abook.abv.bl.common.Constant.PushMessageSendType;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys; import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ABVException; import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode; import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
...@@ -157,7 +158,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -157,7 +158,6 @@ public class OperationListActivity extends ABVUIActivity {
private TaskDao mTaskDao = AbstractDao.getDao(TaskDao.class); private TaskDao mTaskDao = AbstractDao.getDao(TaskDao.class);
private PushMessageLogic mPushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class); private PushMessageLogic mPushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class);
private Integer mOperationAuthLevel = ABVDataCache.getInstance().getMemberInfo().operationAuthLevel;
private ImageView mPanoCotnentImageView; private ImageView mPanoCotnentImageView;
private TextView mPanoContentNameTextView; private TextView mPanoContentNameTextView;
...@@ -637,21 +637,15 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -637,21 +637,15 @@ public class OperationListActivity extends ABVUIActivity {
// プロジェクトの指示/報告表示時、必要なJSONファイル作成 // プロジェクトの指示/報告表示時、必要なJSONファイル作成
mOperationLogic.createJsonForOpenABookCheckPano(operationDto.operationId, operationDto.contentId, contentPath); mOperationLogic.createJsonForOpenABookCheckPano(operationDto.operationId, operationDto.contentId, contentPath);
mOperationLogic.createJsonForOperationContent(operationDto.operationId, contentPath, operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK); mOperationLogic.createJsonForOperationContent(operationDto.operationId, contentPath, operationDto.reportType == ReportType.RoutineTask);
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
mOperationLogic.createJsonForRoutineTaskReport(operationDto.reportCycle, operationDto.enableReportUpdate, mOperationLogic.getLastRoutineTaskReportData(operationDto.operationId).taskReportId, contentPath);
}
// サーバ作業後、対応必要 // サーバ作業後、対応必要
StringBuffer path = new StringBuffer(); StringBuffer path = new StringBuffer();
path.append(contentPath); path.append(contentPath);
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
path.append("/index.html?app=android"); path.append("/index.html?app=android");
path.append("&view_mode=" + mOperationAuthLevel);
path.append("&report_type=" + operationDto.reportType); // 作業報告タイプ : 0:報告 1:定期点検 2:報告(回答) path.append("&report_type=" + operationDto.reportType); // 作業報告タイプ : 0:報告 1:定期点検 2:報告(回答)
path.append("&mobile_flg=" + (isNormalSize() ? "1" : "0")); // ScreenType path.append("&mobile_flg=" + (isNormalSize() ? "1" : "0")); // ScreenType
path.append("&operation_type=" + operationDto.operationType); // 作業タイプ : 0:リスト、1:図面、2:360°
Logger.d(TAG, "path : " + path); Logger.d(TAG, "path : " + path);
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
...@@ -748,7 +742,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -748,7 +742,7 @@ public class OperationListActivity extends ABVUIActivity {
// 報告受信 // 報告受信
mOperationLastEditDate = receptionTaskData(operationId, progressCallback, buttonEventFlag); mOperationLastEditDate = receptionTaskData(operationId, progressCallback, buttonEventFlag);
if (reportType == Constant.OperationReportType.ROUTINE_TASK) { if (reportType == ReportType.RoutineTask) {
if (buttonEventFlag) { if (buttonEventFlag) {
String dialogMsg = null; String dialogMsg = null;
// 定期点検プロジェクトの利用可能日付を取得 // 定期点検プロジェクトの利用可能日付を取得
...@@ -822,11 +816,11 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -822,11 +816,11 @@ public class OperationListActivity extends ABVUIActivity {
} }
public void onClickShowHelpView(View v) { public void onClickShowHelpView(View v) {
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) { // if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
showHelpViewDialog(Constant.HelpViewType.OperationListDirector); showHelpViewDialog(Constant.HelpViewType.OperationListDirector);
} else { // } else {
showHelpViewDialog(Constant.HelpViewType.OperationListReporter); showHelpViewDialog(Constant.HelpViewType.OperationListReporter);
} // }
} }
/** /**
...@@ -884,131 +878,100 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -884,131 +878,100 @@ public class OperationListActivity extends ABVUIActivity {
progress = 40 / json.taskDtoList.size(); progress = 40 / json.taskDtoList.size();
} }
boolean isRoutineTask = operationDto.reportType == Constant.ReportType.Routine; boolean isRoutineTask = operationDto.reportType == ReportType.RoutineTask;
JSONObject taskReportJson; JSONObject taskReportJson = null;
for (TaskDto serverTaskDto : json.taskDtoList) { for (TaskDto serverTaskDto : json.taskDtoList) {
List<TaskReportDto> localRemove = new ArrayList(); List<TaskReportDto> localRemove = new ArrayList();
List<TaskReportDto> localTaskReportList = mTaskReportDao.getTaskReportListByTaskKey(serverTaskDto.taskKey);
for (TaskReportDto localTaskReportDto : localTaskReportList) {
if (!isExistsTaskReportInList(serverTaskDto.taskReportDtoList, localTaskReportDto, isRoutineTask)) { // 定期点検のみ、時間が変更になった場合、差分の削除が必要なため、以下の処理を行う
if (isRoutineTask) { // 定期点検以外の場合は、taskが存在しないので、削除処理は必要なし
mOperationLogic.deleteRoutineTaskReport(operationId, operationContentDto.contentId, localTaskReportDto); if (operationDto.reportType == ReportType.RoutineTask) {
} else { List<TaskReportDto> localTaskReportList = mTaskReportDao.getTaskReportListByTaskKey(serverTaskDto.taskKey);
// taskDtoが存在するとtaskReportLevel 0 (作業報告)が存在しないことはないので、報告(回答)のみチェックして削除 for (TaskReportDto localTaskReportDto : localTaskReportList) {
if (localTaskReportDto.taskReportLevel == Constant.TaskReportLevel.ReportReplyType) { if (!isExistsTaskReportInList(serverTaskDto.taskReportDtoList, localTaskReportDto)) {
// 作業報告のディレクトリ削除 if (isRoutineTask) {
mOperationLogic.deleteTaskReportReplyFileData(operationId, operationContentDto.contentId, serverTaskDto.taskKey); mOperationLogic.deleteRoutineTaskReport(operationId, operationContentDto.contentId, localTaskReportDto);
mTaskReportDao.delete(localTaskReportDto);
} }
} }
localTaskReportList.remove(localTaskReportDto);
} }
} }
if (operationDto.reportType == Constant.ReportType.Routine) {
if (isExistsTaskInList(localTaskList, serverTaskDto)) { if (isExistsTaskInList(localTaskList, serverTaskDto)) {
// 作業の報告更新
mTaskDao.update(serverTaskDto); mTaskDao.update(serverTaskDto);
localTaskList.remove(serverTaskDto);
} else { } else {
// 作業の報告登録
mTaskDao.insert(serverTaskDto); mTaskDao.insert(serverTaskDto);
} }
// サーバーからの情報で更新
for (TaskReportDto taskReportDto : serverTaskDto.taskReportDtoList) {
String reportAttachedFileName = taskReportDto.attachedFileName;
taskReportDto.taskKey = serverTaskDto.taskKey;
// 添付ファイルが存在する場合、取得して解凍する。
refreshRoutineTaskFile(operationId, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, taskReportDto.taskReportId, taskReportDto.taskReportInfoId, taskReportDto.reportStartDate, reportAttachedFileName); // サーバーからの情報で更新
if (isSyncGetTaskFileError) { for (TaskReportDto serverTaskReportDto : serverTaskDto.taskReportDtoList) {
return null; String attachedFileName = serverTaskReportDto.attachedFileName;
} TaskReportDto localTaskReportDto;
if (isExistsTaskReportInList(localTaskReportList, taskReportDto, true)) { if (operationDto.reportType == ReportType.RoutineTask) {
// 報告データが存在すると作業報告を更新する localTaskReportDto = mTaskReportDao.getRoutineTaskReport(serverTaskReportDto.taskKey, serverTaskReportDto.taskReportId, DateTimeUtil.toString(serverTaskReportDto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen));
if (taskReportDto.jsonData != null) {
mOperationLogic.updateRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, taskReportDto, false, false, false, false);
}
} else { } else {
if (taskReportDto.jsonData != null) { localTaskReportDto = mTaskReportDao.selectByTaskKey(serverTaskReportDto.taskKey, serverTaskReportDto.taskReportLevel);
mOperationLogic.insertRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, taskReportDto, false, false);
}
} }
} if (localTaskReportDto != null && localTaskReportDto.localSavedFlg) {
// 一時保存フラグがtureだと何もしない
} else { continue;
if (isExistsTaskInList(localTaskList, serverTaskDto)) {
// 更新
for (TaskReportDto taskReportDto : serverTaskDto.taskReportDtoList) {
String attachedFileName = taskReportDto.attachedFileName;
// 添付ファイルが存在する場合、取得して解凍する。
try {
refreshTaskFile(operationId, taskReportDto.taskReportLevel, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, taskReportDto.attachedFileName);
} catch (Exception e) {
return null;
}
if (taskReportDto.taskReportLevel == Constant.TaskReportLevel.ReportType) {
taskReportJson = new JSONObject(taskReportDto.jsonData);
taskReportJson.put(ABookKeys.TASK_STATUS, serverTaskDto.taskStatus);
// 作業報告を更新
// update
mOperationLogic.updateTaskReport(serverTaskDto.taskKey, serverTaskDto.operationId, operationContentDto.contentId, taskReportDto.enableReport,
taskReportJson, serverTaskDto.taskHotSpotInfo, attachedFileName, false, false);
} else {
// 作業報告(回答)
if (taskReportDto.jsonData != null) {
// データの更新
mOperationLogic.updateTaskReportReply(serverTaskDto.taskKey, serverTaskDto.operationId, operationContentDto.contentId, taskReportDto.enableReport,
new JSONObject(taskReportDto.jsonData), attachedFileName, false, false);
} else {
// jsonDataがない場合
mOperationLogic.insertTaskReportReply(serverTaskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId, taskReportDto.enableReport,
null, attachedFileName, false, false);
}
}
// 更新済みの場合、localTaskListから削除
localTaskList.remove(serverTaskDto);
} }
} else {
// 登録
for (TaskReportDto taskReportDto : serverTaskDto.taskReportDtoList) {
String attachedFileName = taskReportDto.attachedFileName;
// 添付ファイルが存在する場合、取得して解凍する。
try {
refreshTaskFile(operationId, taskReportDto.taskReportLevel, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, taskReportDto.attachedFileName);
} catch (Exception e) {
return null;
}
if (taskReportDto.taskReportLevel == Constant.TaskReportLevel.ReportType) { if (operationDto.reportType == ReportType.RoutineTask) {
taskReportJson = new JSONObject(taskReportDto.jsonData);
taskReportJson.put(ABookKeys.TASK_STATUS, serverTaskDto.taskStatus);
mOperationLogic.insertTaskReport(serverTaskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId, taskReportDto.enableReport, serverTaskReportDto.taskKey = serverTaskDto.taskKey;
taskReportJson, serverTaskDto.taskHotSpotInfo, attachedFileName, false, false);
// 添付ファイルが存在する場合、取得して解凍する。
refreshRoutineTaskFile(operationId, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, serverTaskReportDto.taskReportId, serverTaskReportDto.taskReportInfoId, serverTaskReportDto.reportStartDate, attachedFileName);
if (isSyncGetTaskFileError) {
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 { } else {
if (taskReportDto.jsonData != null) {
mOperationLogic.insertTaskReportReply(serverTaskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId, taskReportDto.enableReport, // 添付ファイルが存在する場合、取得して解凍する。
new JSONObject(taskReportDto.jsonData), attachedFileName, false, false); try {
refreshTaskFile(operationId, serverTaskReportDto.taskReportLevel, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, serverTaskReportDto.attachedFileName);
} catch (Exception e) {
return null;
}
if (!serverTaskReportDto.jsonData.isEmpty()) {
taskReportJson = new JSONObject(serverTaskReportDto.jsonData);
if (serverTaskReportDto.taskReportLevel == 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);
} else { } else {
// jsonDataがない場合 // 更新
mOperationLogic.insertTaskReportReply(serverTaskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId, taskReportDto.enableReport, // jsonDataが空で入る場合、taskReportJsonをnullで登録
null, attachedFileName, false, false); mOperationLogic.updateTaskReport(serverTaskDto.taskKey, operationId, operationContentDto.contentId,
serverTaskReportDto.taskReportLevel, serverTaskReportDto.enableReport,
taskReportJson, attachedFileName, false, false, localTaskReportDto.localSavedFlg);
} }
} }
} }
}
}
progressCallback.callback(new Integer(progress)); progressCallback.callback(new Integer(progress));
} }
// サーバーから取得した作業情報がローカルに存在しないので削除する // サーバーから取得した作業情報がローカルに存在しないので削除する
for (TaskDto taskDto : localTaskList) { for (TaskDto taskDto : localTaskList) {
mOperationLogic.deleteTaskFileData(operationId, operationContentDto.contentId, taskDto.taskKey); mOperationLogic.deleteTaskFileData(operationId, operationContentDto.contentId, taskDto.taskKey, TaskReportLevel.ReportType);
mTaskDao.delete(taskDto); mTaskDao.delete(taskDto);
} }
lastEditDate = json.lastEditDate; lastEditDate = json.lastEditDate;
...@@ -1509,9 +1472,9 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1509,9 +1472,9 @@ public class OperationListActivity extends ABVUIActivity {
@Override @Override
public void onCheckedChanged(RadioGroup group, int checkedId) { public void onCheckedChanged(RadioGroup group, int checkedId) {
if (checkedId == R.id.in_gourp) { if (checkedId == R.id.in_gourp) {
mSendType = Constant.PushMessageSendType.InGroup; mSendType = PushMessageSendType.InGroup;
} else { } else {
mSendType = Constant.PushMessageSendType.AllOperation; mSendType = PushMessageSendType.AllOperation;
} }
} }
}); });
...@@ -1692,22 +1655,15 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1692,22 +1655,15 @@ public class OperationListActivity extends ABVUIActivity {
* @param rDto * @param rDto
* @return * @return
*/ */
private boolean isExistsTaskReportInList(List<TaskReportDto> listDto, TaskReportDto rDto, boolean isRoutineTask) { private boolean isExistsTaskReportInList(List<TaskReportDto> listDto, TaskReportDto rDto) {
for (TaskReportDto lDto : listDto) { for (TaskReportDto lDto : listDto) {
if (isRoutineTask) { // 定期点検の場合、taskKey,taskReportId,reportStartDateで判定
// 定期点検の場合、taskKey,taskReportId,reportStartDateで判定 if (lDto.taskKey.equals(rDto.taskKey) &&
if (lDto.taskKey.equals(rDto.taskKey) && lDto.taskReportId == rDto.taskReportId &&
lDto.taskReportId == rDto.taskReportId && lDto.reportStartDate.equals(rDto.reportStartDate)) {
lDto.reportStartDate.equals(rDto.reportStartDate)) { return true;
return true;
}
} else {
// taskKeyと作業報告階層で判定
if (lDto.taskKey.equals(rDto.taskKey) &&
lDto.taskReportLevel == rDto.taskReportLevel) {
return true;
}
} }
} }
return false; return false;
} }
...@@ -1926,9 +1882,9 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1926,9 +1882,9 @@ public class OperationListActivity extends ABVUIActivity {
private ArrayList<Integer> getOperationReportTypeList(boolean isAll) { private ArrayList<Integer> getOperationReportTypeList(boolean isAll) {
ArrayList<Integer> operationReportTypes = new ArrayList<>(); ArrayList<Integer> operationReportTypes = new ArrayList<>();
if (isAll) { if (isAll) {
operationReportTypes.add(OperationReportType.REPORT_TYPE); operationReportTypes.add(ReportType.Report);
operationReportTypes.add(OperationReportType.ROUTINE_TASK); operationReportTypes.add(ReportType.RoutineTask);
operationReportTypes.add(OperationReportType.REPORT_RESPONSE_TYPE); operationReportTypes.add(ReportType.ReportReply);
} else { } else {
operationReportTypes = getABVUIDataCache().getOperationReportTypes(); operationReportTypes = getABVUIDataCache().getOperationReportTypes();
} }
......
...@@ -21,7 +21,6 @@ import jp.agentec.abook.abv.launcher.android.R; ...@@ -21,7 +21,6 @@ import jp.agentec.abook.abv.launcher.android.R;
public abstract class AbstractOperationAdapter extends BaseAdapter { public abstract class AbstractOperationAdapter extends BaseAdapter {
protected AbstractOperationListAdapterListener listener; protected AbstractOperationListAdapterListener listener;
protected List<OperationDto> listItem = new ArrayList<>(); // NullPointException防止 protected List<OperationDto> listItem = new ArrayList<>(); // NullPointException防止
protected Integer mOperationAuthLevel = ABVDataCache.getInstance().getMemberInfo().operationAuthLevel;
protected ContentDao mContentDao = AbstractDao.getDao(ContentDao.class); protected ContentDao mContentDao = AbstractDao.getDao(ContentDao.class);
public interface AbstractOperationListAdapterListener { public interface AbstractOperationListAdapterListener {
......
...@@ -5,16 +5,14 @@ import android.view.LayoutInflater; ...@@ -5,16 +5,14 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.acms.type.OperationAuthLevel;
import jp.agentec.abook.abv.bl.acms.type.OperationButtonType;
import jp.agentec.abook.abv.bl.acms.type.OperationType; import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.Constant.ReportType;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
...@@ -35,31 +33,27 @@ public class OperationListAdapter extends AbstractOperationAdapter { ...@@ -35,31 +33,27 @@ public class OperationListAdapter extends AbstractOperationAdapter {
private static final String TAG = "OperationListAdapter"; private static final String TAG = "OperationListAdapter";
private Context mContext; private Context mContext;
private LayoutInflater mInflater; private LayoutInflater mInflater;
private List<OperationDto> mListItem = new ArrayList<>();
private boolean mNormalSizeFlg; private boolean mNormalSizeFlg;
public OperationListAdapter(Context context, List<OperationDto> listItem) { public OperationListAdapter(Context context, List<OperationDto> listItem) {
mContext = context; mContext = context;
mListItem = listItem; this.listItem = listItem;
mNormalSizeFlg = ((OperationListActivity)context).isNormalSize(); mNormalSizeFlg = ((OperationListActivity)context).isNormalSize();
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
} }
public List<OperationDto> getData() {
return mListItem;
}
@Override @Override
public int getCount() { public int getCount() {
return mListItem.size(); return listItem.size();
} }
@Override @Override
public OperationDto getItem(int position) { public OperationDto getItem(int position) {
return mListItem.get(position); return listItem.get(position);
} }
@Override @Override
public long getItemId(int position) { public long getItemId(int position) {
return mListItem.get(position).operationId; return listItem.get(position).operationId;
} }
@Override @Override
...@@ -68,18 +62,19 @@ public class OperationListAdapter extends AbstractOperationAdapter { ...@@ -68,18 +62,19 @@ public class OperationListAdapter extends AbstractOperationAdapter {
if (convertView == null) { if (convertView == null) {
convertView = mInflater.inflate(R.layout.item_operation_list, parent, false); convertView = mInflater.inflate(R.layout.item_operation_list, parent, false);
holder = new ViewHolder(); holder = new ViewHolder();
holder.tvOperationName = (TextView) convertView.findViewById(R.id.operation_name); holder.tvOperationName = convertView.findViewById(R.id.operation_name);
holder.tvDate = (TextView) convertView.findViewById(R.id.operation_date); holder.tvDate = convertView.findViewById(R.id.operation_date);
holder.tvDescription = (TextView) convertView.findViewById(R.id.description);
// 報告タイプ
holder.ivReportType = convertView.findViewById(R.id.report_type);
// 作業ベースタイプ
holder.ivOperationType = convertView.findViewById(R.id.operation_type);
// 360編集関連 // 360編集関連
holder.lyPanoEditLayout = (LinearLayout) convertView.findViewById(R.id.layout_pano_edit); holder.ivPanoEdit = convertView.findViewById(R.id.btn_pano_edit);
holder.ivPanoEdit = (ImageView) convertView.findViewById(R.id.btn_pano_edit);
holder.tvPanoEditText = (TextView) convertView.findViewById(R.id.txt_pano_edit);
// 情報更新関連 // 情報更新関連
holder.ivInformationUpdate = (ImageView) convertView.findViewById(R.id.btn_information_update); holder.ivSync = convertView.findViewById(R.id.btn_sync);
holder.tvInformationUpdateText = (TextView) convertView.findViewById(R.id.txt_information_update);
convertView.setTag(holder); convertView.setTag(holder);
} else { } else {
...@@ -89,9 +84,13 @@ public class OperationListAdapter extends AbstractOperationAdapter { ...@@ -89,9 +84,13 @@ public class OperationListAdapter extends AbstractOperationAdapter {
final OperationDto operationDto = getItem(position); final OperationDto operationDto = getItem(position);
if (operationDto != null) { if (operationDto != null) {
boolean noRoutineTaskAll = (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK && operationDto.reportCount == 0); // タイプによってイメージのセット
setImageReportType(holder, operationDto.reportType);
setImageOperationType(holder, operationDto.operationType);
boolean noRoutineTaskAll = (operationDto.reportType == ReportType.RoutineTask && operationDto.reportCount == 0);
holder.tvOperationName.setText(operationDto.operationName); holder.tvOperationName.setText(operationDto.operationName);
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == ReportType.RoutineTask) {
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) { if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) {
// リソースパターンの適用 // リソースパターンの適用
holder.tvDate.setText(PatternStringUtil.patternToString(mContext, holder.tvDate.setText(PatternStringUtil.patternToString(mContext,
...@@ -112,54 +111,55 @@ public class OperationListAdapter extends AbstractOperationAdapter { ...@@ -112,54 +111,55 @@ public class OperationListAdapter extends AbstractOperationAdapter {
R.string.date_label, R.string.date_label,
getUserPref(mContext, AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)) + " : " + DateTimeUtil.toString(operationDto.operationStartDate, DateTimeFormat.yyyyMMdd_slash) + " ~ " + DateTimeUtil.toString(operationDto.operationEndDate, DateTimeFormat.yyyyMMdd_slash)); getUserPref(mContext, AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)) + " : " + DateTimeUtil.toString(operationDto.operationStartDate, DateTimeFormat.yyyyMMdd_slash) + " ~ " + DateTimeUtil.toString(operationDto.operationEndDate, DateTimeFormat.yyyyMMdd_slash));
} }
holder.tvDescription.setText(operationDto.operationDescriptions);
// 同期ボタン表示・非表示 // 同期ボタン表示・非表示
if (operationDto.contentId != null && operationDto.contentId != 0) { if (operationDto.contentId != null && operationDto.contentId != 0) {
if ((operationDto.needSyncFlg)) { if ((operationDto.needSyncFlg)) {
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true); holder.ivSync.setVisibility(View.VISIBLE);
} else { } else {
// needSyncFlgがfalseの場合 // needSyncFlgがfalseの場合
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == ReportType.RoutineTask) {
// 定期点検プロジェクトの場合のみ、以下の処理を行う // 定期点検プロジェクトの場合のみ、以下の処理を行う
String syncedDate = getUserPref(mContext, String.format(AppDefType.UserPrefKey.SYNCED_OPERATION_ID, operationDto.operationId), ""); String syncedDate = getUserPref(mContext, String.format(AppDefType.UserPrefKey.SYNCED_OPERATION_ID, operationDto.operationId), "");
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod) && !syncedDate.equals(DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none))) { if (StringUtil.isNullOrEmpty(operationDto.reportPeriod) && !syncedDate.equals(DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none))) {
// 同期ボタンタップの日付と現在の日付が異なる且つ、作業するデータが存在しない場合 // 同期ボタンタップの日付と現在の日付が異なる且つ、作業するデータが存在しない場合
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true); holder.ivSync.setVisibility(View.VISIBLE);
} else { } else {
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, false); holder.ivSync.setVisibility(View.INVISIBLE);
} }
} else { } else {
// 定期点検プロジェクトではない場合、同期ボタンを非活性化する // 定期点検プロジェクトではない場合、同期ボタンを非活性化する
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, false); holder.ivSync.setVisibility(View.INVISIBLE);
} }
} }
} else { } else {
// プロジェクトのコンテンツが存在しない場合は、同期ボタンを非活性化する // プロジェクトのコンテンツが存在しない場合は、同期ボタンを非活性化する
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, false); holder.ivSync.setVisibility(View.INVISIBLE);
} }
if(operationDto.operationType == OperationType.PANO) { if(operationDto.operationType == OperationType.PANO) {
// 360タイプのみ360編集ボタン表示 if (operationDto.enableReportEdit == Constant.EnableReportEdit.NO) {
holder.lyPanoEditLayout.setVisibility(View.VISIBLE); holder.ivPanoEdit.setVisibility(View.INVISIBLE);
if (operationDto.contentCreatingFlg) { //Panoコンテンツ作成中の状態
setButtonEnabled(holder, OperationButtonType.PANO_EDIT, false);
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, false);
} else { } else {
if (operationDto.contentId == null || operationDto.contentId != 0) { // 360タイプのみ360編集ボタン表示
setButtonEnabled(holder, OperationButtonType.PANO_EDIT, true); holder.ivPanoEdit.setVisibility(View.VISIBLE);
if (operationDto.contentCreatingFlg) { //Panoコンテンツ作成中の状態
holder.ivPanoEdit.setVisibility(View.INVISIBLE);
holder.ivSync.setVisibility(View.INVISIBLE);
} else { } else {
setButtonEnabled(holder, OperationButtonType.PANO_EDIT, false); if (operationDto.contentId == null || operationDto.contentId != 0) {
holder.ivPanoEdit.setVisibility(View.VISIBLE);
} else {
holder.ivPanoEdit.setVisibility(View.INVISIBLE);
}
} }
} }
} else { } else {
holder.lyPanoEditLayout.setVisibility(View.INVISIBLE); holder.ivPanoEdit.setVisibility(View.INVISIBLE);
} }
if(operationDto.enableReportEdit == Constant.EnableReportEdit.NO) {
holder.lyPanoEditLayout.setVisibility(View.GONE);
}
holder.ivPanoEdit.setOnClickListener(new View.OnClickListener() { holder.ivPanoEdit.setOnClickListener(new View.OnClickListener() {
@Override @Override
...@@ -168,7 +168,7 @@ public class OperationListAdapter extends AbstractOperationAdapter { ...@@ -168,7 +168,7 @@ public class OperationListAdapter extends AbstractOperationAdapter {
} }
}); });
holder.ivInformationUpdate.setOnClickListener(new View.OnClickListener() { holder.ivSync.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
listener.onSyncOperation(operationDto); listener.onSyncOperation(operationDto);
...@@ -182,32 +182,49 @@ public class OperationListAdapter extends AbstractOperationAdapter { ...@@ -182,32 +182,49 @@ public class OperationListAdapter extends AbstractOperationAdapter {
private static class ViewHolder { private static class ViewHolder {
TextView tvOperationName; TextView tvOperationName;
TextView tvDate; TextView tvDate;
TextView tvDescription;
ImageView ivReportType;
ImageView ivOperationType;
// 360編集関連 // 360編集関連
LinearLayout lyPanoEditLayout;
ImageView ivPanoEdit; ImageView ivPanoEdit;
TextView tvPanoEditText;
// 情報更新関連 // 情報更新関連
ImageView ivInformationUpdate; ImageView ivSync;
TextView tvInformationUpdateText;
} }
/**
* 作業一覧の各ボタンの活性化、非活性化に変更する // ReportTypeで画像の設定
* @param holder private void setImageReportType(ViewHolder holder, int reportType) {
* @param buttonType switch (reportType) {
* @param isEnabled case Constant.ReportType.Report :
*/ // 報告タイプ
private void setButtonEnabled(ViewHolder holder, int buttonType, boolean isEnabled) { holder.ivReportType.setBackgroundResource(R.drawable.ic_list_type1);
switch (buttonType) { break;
case OperationButtonType.PANO_EDIT : case Constant.ReportType.RoutineTask :
holder.ivPanoEdit.setEnabled(isEnabled); // 定期点検タイプ
holder.tvPanoEditText.setTextColor(mContext.getResources().getColor(isEnabled ? R.color.operation_color : R.color.operation_disable_color)); holder.ivReportType.setBackgroundResource(R.drawable.ic_list_type2);
break;
case Constant.ReportType.ReportReply :
// 報告(回答)タイプ
holder.ivReportType.setBackgroundResource(R.drawable.ic_list_type3);
break;
}
}
// OperationTypeで画像の設定
private void setImageOperationType(ViewHolder holder, int operationType) {
switch (operationType) {
case OperationType.LIST :
// リスト
holder.ivOperationType.setBackgroundResource(R.drawable.ic_list);
break;
case OperationType.PANO :
// 360
holder.ivOperationType.setBackgroundResource(R.drawable.ic_list_360);
break; break;
case OperationButtonType.INFORMATION_UPDATE: case OperationType.PDF :
holder.ivInformationUpdate.setEnabled(isEnabled); // PDF
holder.tvInformationUpdateText.setTextColor(mContext.getResources().getColor(isEnabled ? R.color.operation_color : R.color.operation_disable_color)); holder.ivOperationType.setBackgroundResource(R.drawable.ic_list_draw);
break; break;
} }
} }
......
...@@ -5,15 +5,13 @@ import android.view.LayoutInflater; ...@@ -5,15 +5,13 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.acms.type.OperationAuthLevel;
import jp.agentec.abook.abv.bl.acms.type.OperationButtonType;
import jp.agentec.abook.abv.bl.acms.type.OperationType; import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.Constant.ReportType;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
...@@ -72,25 +70,21 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -72,25 +70,21 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
@Override @Override
public long getItemId(int position) { public long getItemId(int position) {
return listItem.get(position).contentId; return listItem.get(position).operationId;
}
public List<OperationDto> getListItem() {
return listItem;
} }
private static class ViewHolder { private static class ViewHolder {
TextView tvOperationName; TextView tvOperationName;
TextView tvDate; TextView tvDate;
TextView tvDescription;
ImageView ivReportType;
ImageView ivOperationType;
// 360編集関連 // 360編集関連
LinearLayout lyPanoEditLayout;
ImageView ivPanoEdit; ImageView ivPanoEdit;
TextView tvPanoEditText;
// 情報更新関連 // 同期関連
ImageView ivInformationUpdate; ImageView ivSync;
TextView tvInformationUpdateText;
} }
@Override @Override
...@@ -99,18 +93,19 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -99,18 +93,19 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
if (convertView == null) { if (convertView == null) {
convertView = mInflater.inflate(R.layout.item_operation_panel, parent, false); convertView = mInflater.inflate(R.layout.item_operation_panel, parent, false);
holder = new OperationPanelAdapter.ViewHolder(); holder = new OperationPanelAdapter.ViewHolder();
holder.tvOperationName = (TextView) convertView.findViewById(R.id.operation_name); holder.tvOperationName = convertView.findViewById(R.id.operation_name);
holder.tvDate = (TextView) convertView.findViewById(R.id.operation_date); holder.tvDate = convertView.findViewById(R.id.operation_date);
// holder.tvDescription = (TextView) convertView.findViewById(R.id.description);
// 報告タイプ
holder.ivReportType = convertView.findViewById(R.id.report_type);
// 作業ベースタイプ
holder.ivOperationType = convertView.findViewById(R.id.operation_type);
// 360編集関連 // 360編集関連
holder.lyPanoEditLayout = (LinearLayout) convertView.findViewById(R.id.layout_pano_edit); holder.ivPanoEdit = convertView.findViewById(R.id.btn_pano_edit);
holder.ivPanoEdit = (ImageView) convertView.findViewById(R.id.btn_pano_edit);
holder.tvPanoEditText = (TextView) convertView.findViewById(R.id.txt_pano_edit);
// 情報更新関連 // 同期関連
holder.ivInformationUpdate = (ImageView) convertView.findViewById(R.id.btn_information_update); holder.ivSync = convertView.findViewById(R.id.btn_sync);
holder.tvInformationUpdateText = (TextView) convertView.findViewById(R.id.txt_information_update);
convertView.setTag(holder); convertView.setTag(holder);
} else { } else {
...@@ -120,9 +115,13 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -120,9 +115,13 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
final OperationDto operationDto = getItem(position); final OperationDto operationDto = getItem(position);
if (operationDto != null) { if (operationDto != null) {
boolean noRoutineTaskAll = (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK && operationDto.reportCount == 0); setImageReportType(holder, operationDto.reportType);
setImageOperationType(holder, operationDto.operationType);
boolean noRoutineTaskAll = (operationDto.reportType == ReportType.RoutineTask && operationDto.reportCount == 0);
holder.tvOperationName.setText(operationDto.operationName); holder.tvOperationName.setText(operationDto.operationName);
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == ReportType.RoutineTask) {
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) { if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) {
// リソースパターンの適用 // リソースパターンの適用
holder.tvDate.setText(PatternStringUtil.patternToString(mContext, holder.tvDate.setText(PatternStringUtil.patternToString(mContext,
...@@ -143,50 +142,48 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -143,50 +142,48 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
// 同期ボタン表示・非表示 // 同期ボタン表示・非表示
if (operationDto.contentId != null && operationDto.contentId != 0) { if (operationDto.contentId != null && operationDto.contentId != 0) {
if ((operationDto.needSyncFlg)) { if ((operationDto.needSyncFlg)) {
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true); holder.ivSync.setVisibility(View.VISIBLE);
} else { } else {
// needSyncFlgがfalseの場合 // needSyncFlgがfalseの場合
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == ReportType.RoutineTask) {
// 定期点検プロジェクトの場合のみ、以下の処理を行う // 定期点検プロジェクトの場合のみ、以下の処理を行う
String syncedDate = getUserPref(mContext, String.format(AppDefType.UserPrefKey.SYNCED_OPERATION_ID, operationDto.operationId), ""); String syncedDate = getUserPref(mContext, String.format(AppDefType.UserPrefKey.SYNCED_OPERATION_ID, operationDto.operationId), "");
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod) && !syncedDate.equals(DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none))) { if (StringUtil.isNullOrEmpty(operationDto.reportPeriod) && !syncedDate.equals(DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none))) {
// 同期ボタンタップの日付と現在の日付が異なる且つ、作業するデータが存在しない場合 // 同期ボタンタップの日付と現在の日付が異なる且つ、作業するデータが存在しない場合
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true); holder.ivSync.setVisibility(View.VISIBLE);
} else { } else {
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, false); holder.ivSync.setVisibility(View.INVISIBLE);
} }
} else { } else {
// 定期点検プロジェクトではない場合、同期ボタンを非活性化する // 定期点検プロジェクトではない場合、同期ボタンを非活性化する
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, false); holder.ivSync.setVisibility(View.INVISIBLE);
} }
} }
} else { } else {
// プロジェクトのコンテンツが存在しない場合は、同期ボタンを非活性化する // プロジェクトのコンテンツが存在しない場合は、同期ボタンを非活性化する
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, false); holder.ivSync.setVisibility(View.INVISIBLE);
} }
if(operationDto.operationType == OperationType.PANO) { if(operationDto.operationType == OperationType.PANO) {
// 360タイプのみ360編集ボタン表示 if (operationDto.enableReportEdit == Constant.EnableReportEdit.NO) {
holder.lyPanoEditLayout.setVisibility(View.VISIBLE); holder.ivPanoEdit.setVisibility(View.INVISIBLE);
if (operationDto.contentCreatingFlg) { //Panoコンテンツ作成中の状態
setButtonEnabled(holder, OperationButtonType.PANO_EDIT, false);
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, false);
} else { } else {
if (operationDto.contentId != null && operationDto.contentId != 0) { if (operationDto.contentCreatingFlg) { //Panoコンテンツ作成中の状態
setButtonEnabled(holder, OperationButtonType.PANO_EDIT, true); holder.ivPanoEdit.setVisibility(View.INVISIBLE);
holder.ivSync.setVisibility(View.INVISIBLE);
} else { } else {
setButtonEnabled(holder, OperationButtonType.PANO_EDIT, false); if (operationDto.contentId != null && operationDto.contentId != 0) {
holder.ivPanoEdit.setVisibility(View.VISIBLE);
} else {
holder.ivPanoEdit.setVisibility(View.INVISIBLE);
}
} }
} }
} else { } else {
holder.lyPanoEditLayout.setVisibility(View.INVISIBLE); holder.ivPanoEdit.setVisibility(View.INVISIBLE);
} }
// if(mOperationAuthLevel.equals(OperationAuthLevel.WORKER)) {
holder.lyPanoEditLayout.setVisibility(View.GONE);
// }
holder.ivPanoEdit.setOnClickListener(new View.OnClickListener() { holder.ivPanoEdit.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
...@@ -194,7 +191,7 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -194,7 +191,7 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
} }
}); });
holder.ivInformationUpdate.setOnClickListener(new View.OnClickListener() { holder.ivSync.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
listener.onSyncOperation(operationDto); listener.onSyncOperation(operationDto);
...@@ -205,15 +202,38 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -205,15 +202,38 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
return convertView; return convertView;
} }
private void setButtonEnabled(OperationPanelAdapter.ViewHolder holder, int buttonType, boolean isEnabled) { // ReportTypeで画像の設定
switch (buttonType) { private void setImageReportType(ViewHolder holder, int reportType) {
case OperationButtonType.PANO_EDIT : switch (reportType) {
holder.ivPanoEdit.setEnabled(isEnabled); case ReportType.Report :
holder.tvPanoEditText.setTextColor(mContext.getResources().getColor(isEnabled ? R.color.operation_color : R.color.operation_disable_color)); // 報告タイプ
holder.ivReportType.setBackgroundResource(R.drawable.ic_panel_type1);
break;
case ReportType.RoutineTask :
// 定期点検タイプ
holder.ivReportType.setBackgroundResource(R.drawable.ic_panel_type2);
break;
case ReportType.ReportReply :
// 報告(回答)タイプ
holder.ivReportType.setBackgroundResource(R.drawable.ic_panel_type3);
break;
}
}
// OperationTypeで画像の設定
private void setImageOperationType(OperationPanelAdapter.ViewHolder holder, int operationType) {
switch (operationType) {
case OperationType.LIST :
// リスト
holder.ivOperationType.setBackgroundResource(R.drawable.ic_panel_list);
break;
case OperationType.PANO :
// 360
holder.ivOperationType.setBackgroundResource(R.drawable.ic_panel_360);
break; break;
case OperationButtonType.INFORMATION_UPDATE: case OperationType.PDF :
holder.ivInformationUpdate.setEnabled(isEnabled); // PDF
holder.tvInformationUpdateText.setTextColor(mContext.getResources().getColor(isEnabled ? R.color.operation_color : R.color.operation_disable_color)); holder.ivOperationType.setBackgroundResource(R.drawable.ic_panel_draw);
break; break;
} }
} }
......
...@@ -7,6 +7,7 @@ import android.graphics.Matrix; ...@@ -7,6 +7,7 @@ import android.graphics.Matrix;
import android.media.ExifInterface; import android.media.ExifInterface;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.util.Base64; import android.util.Base64;
import android.widget.Toast;
import org.json.adf.JSONObject; import org.json.adf.JSONObject;
...@@ -36,6 +37,7 @@ import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity; ...@@ -36,6 +37,7 @@ import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil; import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.viewer.activity.CheckOZDViewActivity; import jp.agentec.abook.abv.ui.viewer.activity.CheckOZDViewActivity;
import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
import jp.agentec.adf.util.DateTimeFormat; import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil; import jp.agentec.adf.util.FileUtil;
...@@ -86,32 +88,30 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -86,32 +88,30 @@ public class ABookCheckWebViewHelper extends ABookHelper {
switch (cmd) { switch (cmd) {
case ABookKeys.CMD_INSERT_TASK_REPORT: case ABookKeys.CMD_INSERT_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, true, reportType, taskReportLevel); case ABookKeys.CMD_UPDATE_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, reportType, taskReportLevel, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel); copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
sendTaskData(context, operationId, taskKey, taskReportLevel); sendTaskData(context, operationId, taskKey, taskReportLevel);
break; break;
case ABookKeys.CMD_UPDATE_TASK_REPORT: case ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT: // 一時保存
insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, false, reportType, taskReportLevel); insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, reportType, taskReportLevel, true);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel); copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
sendTaskData(context, operationId, taskKey, taskReportLevel); ABVToastUtil.showMakeText(context, R.string.msg_temp_save_result, Toast.LENGTH_SHORT);
mFinishCallback.callback(false);
break; break;
case ABookKeys.CMD_DELETE_TASK_REPORT: case ABookKeys.CMD_DELETE_TASK_REPORT:
int taskReportId = 0; int taskReportId = 0;
String reportStartDate = ""; String reportStartDate = "";
boolean sendTaskReportDataFlg = false; boolean sendTaskReportDataFlg = false;
if (reportType == Constant.ReportType.Routine) { if (reportType == Constant.ReportType.RoutineTask) {
taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID)); taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = param.get(ABookKeys.REPORT_START_DATE).replace("T", " "); reportStartDate = param.get(ABookKeys.REPORT_START_DATE).replace("T", " ");
mOperationLogic.deleteRoutineTaskReport(operationId, contentId, taskKey, taskReportId, reportStartDate); mOperationLogic.deleteRoutineTaskReport(operationId, contentId, taskKey, taskReportId, reportStartDate);
mOperationLogic.createJsonForOperationContent(operationId, contentPath, false); mOperationLogic.createJsonForOperationContent(operationId, contentPath, false);
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate); copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate);
} else { } else {
if (taskReportLevel == Constant.TaskReportLevel.ReportType) { mOperationLogic.deleteTaskReport(operationId, contentId, taskKey, taskReportLevel);
mOperationLogic.deleteTaskReport(operationId, contentId, taskKey);
} else {
mOperationLogic.deleteTaskReportReply(operationId, contentId, taskKey);
}
mOperationLogic.createJsonForOperationContent(operationId, contentPath, false); mOperationLogic.createJsonForOperationContent(operationId, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel); copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
} }
...@@ -136,7 +136,6 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -136,7 +136,6 @@ public class ABookCheckWebViewHelper extends ABookHelper {
mFinishCallback.callback(false); mFinishCallback.callback(false);
break; break;
} }
} }
/** /**
...@@ -300,12 +299,11 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -300,12 +299,11 @@ public class ABookCheckWebViewHelper extends ABookHelper {
* @param contentId * @param contentId
* @param param * @param param
* @param contentPath * @param contentPath
* @param insertFlg
* @param reportType * @param reportType
* @param taskReportLevel * @param taskReportLevel
* @throws IOException * @throws IOException
*/ */
private void insertOrUpdateTaskReport(String taskKey, int enableReportHistory, long operationId, long contentId, Map<String, String> param, String contentPath, boolean insertFlg, int reportType, int taskReportLevel) throws IOException { private void insertOrUpdateTaskReport(String taskKey, int enableReportHistory, long operationId, long contentId, Map<String, String> param, String contentPath, int reportType, int taskReportLevel, boolean localSavedFlg) throws IOException {
int taskReportSendId = 0; int taskReportSendId = 0;
boolean attachedChangeFlag = param.get(ABookKeys.ATTACHED_CHANGE_FLAG).equals("1") ? true : false; boolean attachedChangeFlag = param.get(ABookKeys.ATTACHED_CHANGE_FLAG).equals("1") ? true : false;
String taskReport = param.get(ABookKeys.TASK_REPORT); String taskReport = param.get(ABookKeys.TASK_REPORT);
...@@ -313,46 +311,52 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -313,46 +311,52 @@ public class ABookCheckWebViewHelper extends ABookHelper {
int taskReportId = 0; int taskReportId = 0;
String reportStartDate = ""; String reportStartDate = "";
if (reportType == Constant.ReportType.Routine) { if (reportType == Constant.ReportType.RoutineTask) {
taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID)); taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = param.get(ABookKeys.REPORT_START_DATE); reportStartDate = param.get(ABookKeys.REPORT_START_DATE);
reportStartDate = reportStartDate.replace("T", " "); reportStartDate = reportStartDate.replace("T", " ");
TaskReportDto taskReportDto = mOperationLogic.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate); TaskReportDto taskReportDto = mOperationLogic.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate);
taskReportDto.jsonData = taskReport; taskReportDto.jsonData = taskReport;
mOperationLogic.updateRoutineTaskReport(operationId, contentId, taskReportDto, attachedChangeFlag, true, localSavedFlg);
mOperationLogic.updateRoutineTaskReport(operationId, contentId, taskReportDto, attachedChangeFlag, true, insertFlg, true);
mOperationLogic.createJsonForOperationContent(operationId, contentPath, true); mOperationLogic.createJsonForOperationContent(operationId, contentPath, true);
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate); copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate);
} else { } else {
if (taskReportLevel == Constant.TaskReportLevel.ReportType) {
String hotSpotInfo = param.get(ABookKeys.HOT_SPOT); String hotSpotInfo = param.containsKey(ABookKeys.HOT_SPOT) ? param.get(ABookKeys.HOT_SPOT) : null;
if (insertFlg) { Integer taskStatus = taskReportJson.has(ABookKeys.TASK_STATUS) ? taskReportJson.getInt(ABookKeys.TASK_STATUS) : null;
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, Constant.EnableReport.YES, taskReportJson, hotSpotInfo, null, attachedChangeFlag, true); // 報告情報のjson取得後、登録・更新時に使用
} else { JSONObject taskJson = null;
mOperationLogic.updateTaskReport(taskKey, operationId, contentId, Constant.EnableReport.YES, taskReportJson, hotSpotInfo, null, attachedChangeFlag, true); if (taskReportJson.has("task")) {
} taskJson = taskReportJson.getJSONObject("task");
} else { }
if (insertFlg) { // task登録・更新処理
mOperationLogic.insertTaskReportReply(taskKey, operationId, contentId, Constant.EnableReport.YES, taskReportJson, null, attachedChangeFlag, true); mOperationLogic.registTaskData(taskKey, operationId, hotSpotInfo, taskStatus, taskJson);
} else {
mOperationLogic.updateTaskReportReply(taskKey, operationId, contentId, Constant.EnableReport.YES, taskReportJson, null, attachedChangeFlag, true); TaskReportDto taskReportDto = mOperationLogic.getTaskReport(taskKey, taskReportLevel);
} if (taskReportDto != null) {
} // 更新
mOperationLogic.updateTaskReport(taskReportDto.taskKey, operationId, contentId, taskReportLevel, Constant.EnableReport.YES, taskReportJson, null, attachedChangeFlag, localSavedFlg ? false : true, localSavedFlg);
} else {
// 登録
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportLevel, Constant.EnableReport.YES, taskReportJson, null, attachedChangeFlag, localSavedFlg ? false : true, localSavedFlg);
}
mOperationLogic.createJsonForOperationContent(operationId, contentPath, false); mOperationLogic.createJsonForOperationContent(operationId, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel); copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
} }
if (enableReportHistory == Constant.EnableReportHistory.Invalid) { if (!localSavedFlg) {
//データ無い場合は中でinsertされる if (enableReportHistory == Constant.EnableReportHistory.Invalid) {
taskReportSendId = mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false); //データ無い場合は中でinsertされる
} else { taskReportSendId = mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false);
taskReportSendId = mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false); } else {
taskReportSendId = mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false);
}
// #32926 作業報告画面改善 start
copyReportTaskSendFiles(operationId, taskKey, taskReportSendId, reportType == Constant.ReportType.RoutineTask, taskReportId, reportStartDate, taskReportLevel);
// #32926 作業報告画面改善 end
} }
// #32926 作業報告画面改善 start
copyReportTaskSendFiles(operationId, taskKey, taskReportSendId, reportType == Constant.ReportType.Routine, taskReportId, reportStartDate, taskReportLevel);
// #32926 作業報告画面改善 end
} }
// xwalkで動画ファイルにアクセスするため、../files/..の以下のパスのディレクトりを../cache/..以下のパスに変更 // xwalkで動画ファイルにアクセスするため、../files/..の以下のパスのディレクトりを../cache/..以下のパスに変更
...@@ -362,7 +366,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -362,7 +366,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
for (TaskDto taskDto : taskDtoList) { for (TaskDto taskDto : taskDtoList) {
List<TaskReportDto> taskReportDtoList = mOperationLogic.getTaskReportByTaskKey(taskDto.taskKey); List<TaskReportDto> taskReportDtoList = mOperationLogic.getTaskReportByTaskKey(taskDto.taskKey);
for (TaskReportDto taskReportDto : taskReportDtoList) { for (TaskReportDto taskReportDto : taskReportDtoList) {
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.ReportType.RoutineTask) {
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskReportDto.taskKey, taskReportDto.taskReportId, taskReportDto.reportStartDate); copyRoutineTaskReportAttachedMovie(operationId, contentId, taskReportDto.taskKey, taskReportDto.taskReportId, taskReportDto.reportStartDate);
} else { } else {
copyTaskAttachedMovie(operationId, contentId, taskDto.taskKey, taskReportDto.taskReportLevel); copyTaskAttachedMovie(operationId, contentId, taskDto.taskKey, taskReportDto.taskReportLevel);
...@@ -377,7 +381,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -377,7 +381,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
/** /**
* 定期点検 * 定期点検
* /.../files/ABook/project/{projectId}/{taskKey}/report/{taskReportId}/{reportStartDate}/*.(mov,mp4)を * /.../files/ABook/operation/{operationId}/{taskKey}/report/{taskReportId}/{reportStartDate}/*.(mov,mp4)を
* /.../cache/{contentId}/attachedMovie/{taskKey}/report/{taskReportId}/{reportStartDate}/*.(mov,mp4)にコピー * /.../cache/{contentId}/attachedMovie/{taskKey}/report/{taskReportId}/{reportStartDate}/*.(mov,mp4)にコピー
* @param operationId * @param operationId
* @param contentId * @param contentId
...@@ -413,7 +417,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -413,7 +417,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
} }
/** /**
* /.../files/ABook/project/{projectId}/{taskKey}/{taskType}/{taskReportLevel}/*.(mov,mp4)を * /.../files/ABook/operation/{operationId}/{taskKey}/{taskType}/{taskReportLevel}/*.(mov,mp4)を
* /.../cache/{contentId}/attachedMovie/{taskKey}/{taskType}/{taskReportLevel}/*.(mov,mp4)にコピー * /.../cache/{contentId}/attachedMovie/{taskKey}/{taskType}/{taskReportLevel}/*.(mov,mp4)にコピー
* *
* @param operationId * @param operationId
...@@ -464,12 +468,8 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -464,12 +468,8 @@ public class ABookCheckWebViewHelper extends ABookHelper {
File taskAttachedFiles = new File(taskAttachedPath); File taskAttachedFiles = new File(taskAttachedPath);
if (taskAttachedFiles.exists()) { if (taskAttachedFiles.exists()) {
String taskReportSendPath; String taskReportSendPath = ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskKey, taskReportSendId);
if (routineTaskReportFlg) {
taskReportSendPath = ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskKey, taskReportId, sReportStartDate, taskReportSendId);
} else {
taskReportSendPath = ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskKey, taskReportLevel, taskReportSendId);
}
FileUtil.delete(taskReportSendPath); FileUtil.delete(taskReportSendPath);
FileUtil.createNewDirectory(taskReportSendPath); FileUtil.createNewDirectory(taskReportSendPath);
...@@ -493,7 +493,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -493,7 +493,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
@Override @Override
protected Void doInBackground(Void... params) { protected Void doInBackground(Void... params) {
try { try {
String taskReportSendPath = ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskKey, taskReportLevel, taskReportSendId); String taskReportSendPath = ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskKey, taskReportSendId);
FileUtil.delete(taskReportSendPath); FileUtil.delete(taskReportSendPath);
} catch (Exception ex) { } catch (Exception ex) {
Logger.e(String.format("%s.deleteReportTaskSendFiles(%d, %s)", TAG, operationId, taskKey), ex); Logger.e(String.format("%s.deleteReportTaskSendFiles(%d, %s)", TAG, operationId, taskKey), ex);
......
...@@ -585,7 +585,7 @@ public class CheckOZDViewActivity extends ABVContentViewActivity { ...@@ -585,7 +585,7 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
param.append("export.mode=silent#"); param.append("export.mode=silent#");
param.append("export.filename=" + FileUtil.getFilenameWithoutExt(mSaveOzdTempFileName) + "#"); param.append("export.filename=" + FileUtil.getFilenameWithoutExt(mSaveOzdTempFileName) + "#");
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
param.append("export.path=" + OzdFileHelper.getTempTaskDirPath(contentId, mTaskKey) + "#"); //OzdFileHelper.getTempTaskDirPath(contentId, mTaskKey) + "/" + mTaskReportLevel + "#"); param.append("export.path=" + OzdFileHelper.getTempTaskDirPath(contentId, mTaskKey) + "#");
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
param.append("export.confirmsave=false#"); param.append("export.confirmsave=false#");
param.append("export.format=ozd"); param.append("export.format=ozd");
......
...@@ -4985,6 +4985,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -4985,6 +4985,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
case ABookKeys.CMD_INSERT_TASK_REPORT: // 作業報告の登録 case ABookKeys.CMD_INSERT_TASK_REPORT: // 作業報告の登録
case ABookKeys.CMD_UPDATE_TASK_REPORT: // 作業報告の更新 case ABookKeys.CMD_UPDATE_TASK_REPORT: // 作業報告の更新
case ABookKeys.CMD_DELETE_TASK_REPORT: // 作業報告の削除 case ABookKeys.CMD_DELETE_TASK_REPORT: // 作業報告の削除
case ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT: // 一時保存
getTaskHotspotJSON(); getTaskHotspotJSON();
case ABookKeys.CMD_CANCEL_TASK_REPORT: // 作業報告のキャンセル case ABookKeys.CMD_CANCEL_TASK_REPORT: // 作業報告のキャンセル
if(operationTaskDto != null) { if(operationTaskDto != null) {
...@@ -5212,6 +5213,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5212,6 +5213,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
// #32782 指示者テーブル関連削除 start // #32782 指示者テーブル関連削除 start
case ABookKeys.CMD_INSERT_TASK_REPORT: case ABookKeys.CMD_INSERT_TASK_REPORT:
case ABookKeys.CMD_UPDATE_TASK_REPORT: case ABookKeys.CMD_UPDATE_TASK_REPORT:
case ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT: // 一時保存
if (taskReportLevel == Constant.TaskReportLevel.ReportType) { if (taskReportLevel == Constant.TaskReportLevel.ReportType) {
JSONObject hotspot = new JSONObject(checkParam.get(ABookKeys.HOT_SPOT)); JSONObject hotspot = new JSONObject(checkParam.get(ABookKeys.HOT_SPOT));
......
...@@ -97,7 +97,7 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity { ...@@ -97,7 +97,7 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
boolean isUpdate = intent.getBooleanExtra("isUpdate", false); boolean isUpdate = intent.getBooleanExtra("isUpdate", false);
final String url = intent.getStringExtra("LINKURL"); // LinkURL final String url = intent.getStringExtra("LINKURL"); // LinkURL
mOperationId = intent.getLongExtra(ABookKeys.OPERATION_ID, -1); // ProjectId mOperationId = intent.getLongExtra(ABookKeys.OPERATION_ID, -1); // OperationId
// ***** WebViewセット // ***** WebViewセット
......
...@@ -260,7 +260,7 @@ public class ParentWebViewActivity extends ABVContentViewActivity { ...@@ -260,7 +260,7 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
progressDialog.setProgress(20); progressDialogHorizontal.setProgress(20);
webViewLoadUrl(String.format("javascript:CHK_E.checkResourceEntry('%s')", resourceId)); webViewLoadUrl(String.format("javascript:CHK_E.checkResourceEntry('%s')", resourceId));
} }
}); });
...@@ -268,21 +268,21 @@ public class ParentWebViewActivity extends ABVContentViewActivity { ...@@ -268,21 +268,21 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
handler.post(new Runnable() { handler.post(new Runnable() {
@Override @Override
public void run() { public void run() {
int progress = progressDialog.getProgress(); int progress = progressDialogHorizontal.getProgress();
if (progress == 0) { if (progress == 0) {
return; return;
} else if (progress == 100) { } else if (progress == 100) {
progressDialog.setProgress(0); progressDialogHorizontal.setProgress(0);
closeProgressPopup(); closeProgressPopup();
} else if (progress < 100 && progress > 80) { } else if (progress < 100 && progress > 80) {
progressDialog.setProgress(progress + 1); progressDialogHorizontal.setProgress(progress + 1);
handler.postDelayed(this, 2000); handler.postDelayed(this, 2000);
} else if (progress <= 80 && progress >= 60) { } else if (progress <= 80 && progress >= 60) {
progressDialog.setProgress(progress + 2); progressDialogHorizontal.setProgress(progress + 2);
handler.postDelayed(this, 1000); handler.postDelayed(this, 1000);
} else if (progress < 60) { } else if (progress < 60) {
progressDialog.setProgress(progress + 4); progressDialogHorizontal.setProgress(progress + 4);
handler.postDelayed(this, 1000); handler.postDelayed(this, 1000);
} }
} }
......
...@@ -44,8 +44,7 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -44,8 +44,7 @@ public class OperationTaskLayout extends RelativeLayout {
private static final String TAG = "OperationTaskLayout"; private static final String TAG = "OperationTaskLayout";
private static final String TEMP_TASK_KEY = "00000000-0000-0000-0000-000000000000"; private static final String TEMP_TASK_KEY = "00000000-0000-0000-0000-000000000000";
private static final String SCRIPT_SHOW_TASK_LIST = "javascript:CHK_P.updateTaskListForApp(%d)";//CHK.updateTaskListForApp(pageNum) private static final String SCRIPT_SHOW_TASK_LIST = "javascript:CHK_P.updateTaskListForApp(%d)";//CHK.updateTaskListForApp(pageNum)
private static final String SCRIPT_SHOW_TASK_DIRECT = "javascript:CHK.showTaskForm('%s')";//CHK.showTaskForm(taskKey) private static final String SCRIPT_SHOW_TASK_REPORT = "javascript:CHK.showReportForm('%s')";//CHK.showTaskReportForm(name, taskKey, lookto)
private static final String SCRIPT_SHOW_TASK_REPORT = "javascript:CHK.showTaskReportForm('%s')";//CHK.showTaskReportForm(name, taskKey, lookto)
private static final int ICON_WIDTH = 32; private static final int ICON_WIDTH = 32;
private static final int ICON_HEIGHT = 32; private static final int ICON_HEIGHT = 32;
...@@ -279,15 +278,15 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -279,15 +278,15 @@ public class OperationTaskLayout extends RelativeLayout {
final String script = String.format(SCRIPT_SHOW_TASK_LIST, pageNum + 1); final String script = String.format(SCRIPT_SHOW_TASK_LIST, pageNum + 1);
RelativeLayout.LayoutParams params; RelativeLayout.LayoutParams params;
if (isNormalSize) { // if (isNormalSize) {
params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
} else { // } else {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); // DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH); // int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH);
int screenWidth = displayMetrics.widthPixels; // int screenWidth = displayMetrics.widthPixels;
params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT); // params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); // params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
} // }
setLayoutParams(params); setLayoutParams(params);
...@@ -309,11 +308,7 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -309,11 +308,7 @@ public class OperationTaskLayout extends RelativeLayout {
final String script; final String script;
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) { script = String.format(SCRIPT_SHOW_TASK_REPORT, operationTaskDto.taskKey.equals(TEMP_TASK_KEY) ? "" : operationTaskDto.taskKey);
script = String.format(SCRIPT_SHOW_TASK_DIRECT, operationTaskDto.taskKey.equals(TEMP_TASK_KEY) ? "" : operationTaskDto.taskKey);
} else {
script = String.format(SCRIPT_SHOW_TASK_REPORT, operationTaskDto.taskKey.equals(TEMP_TASK_KEY) ? "" : operationTaskDto.taskKey);
}
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
...@@ -340,20 +335,20 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -340,20 +335,20 @@ public class OperationTaskLayout extends RelativeLayout {
public void setTaskFormPosition(float screenX, boolean isNormalSize) { public void setTaskFormPosition(float screenX, boolean isNormalSize) {
RelativeLayout.LayoutParams params; RelativeLayout.LayoutParams params;
if (isNormalSize) { // if (isNormalSize) {
params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
} else { // } else {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); // DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH); // int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH);
int screenWidth = displayMetrics.widthPixels; // int screenWidth = displayMetrics.widthPixels;
params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT); // params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
//
if (screenX < screenWidth / 2) { // if (screenX < screenWidth / 2) {
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); // params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
} else { // } else {
params.addRule(RelativeLayout.ALIGN_PARENT_LEFT); // params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
} // }
} // }
setLayoutParams(params); setLayoutParams(params);
} }
......
...@@ -51,13 +51,13 @@ public class PageView extends ImageView { ...@@ -51,13 +51,13 @@ public class PageView extends ImageView {
protected GestureDetector mGestureDetector; protected GestureDetector mGestureDetector;
protected ScaleGestureDetector mScaleDetector = null; protected ScaleGestureDetector mScaleDetector = null;
private boolean isProjectPdf; private boolean isOperationPdf;
public PageView(Context context) { public PageView(Context context) {
super(context); super(context);
} }
public PageView(Context context, Size pageSize, int pageNumber, int displayWidth, int displayHeight, RelativeLayout pageLayout, boolean isProjectPdf) { public PageView(Context context, Size pageSize, int pageNumber, int displayWidth, int displayHeight, RelativeLayout pageLayout, boolean isOperationPdf) {
super(context); super(context);
Logger.i(TAG, "[PageView]: page=" + pageNumber); Logger.i(TAG, "[PageView]: page=" + pageNumber);
...@@ -71,9 +71,9 @@ public class PageView extends ImageView { ...@@ -71,9 +71,9 @@ public class PageView extends ImageView {
mGestureDetector = new GestureDetector(context, mGestureListener); mGestureDetector = new GestureDetector(context, mGestureListener);
this.isProjectPdf = isProjectPdf; this.isOperationPdf = isOperationPdf;
// ABook Check : doubletap = 新作業指示 // ABook Check : doubletap = 新作業指示
if (!isProjectPdf) { if (!isOperationPdf) {
mGestureDetector.setOnDoubleTapListener(mDoubleTapListener); mGestureDetector.setOnDoubleTapListener(mDoubleTapListener);
} }
mScaleDetector = new ScaleGestureDetector(context, onScaleGestureListener); mScaleDetector = new ScaleGestureDetector(context, onScaleGestureListener);
......
...@@ -38,8 +38,8 @@ app_versioncode=1 ...@@ -38,8 +38,8 @@ app_versioncode=1
# abvEnvironments.xml # abvEnvironments.xml
#cms server #cms server
acms_address=https://abook188-1.abook.bz/acms acms_address=https://abook189.abook.bz/acms
download_server_address=https://abook188-1.abook.bz/acms download_server_address=https://abook189.abook.bz/acms
#syncview server #syncview server
websocket_server_http_url=https://abookplus.agentec.jp/v1 websocket_server_http_url=https://abookplus.agentec.jp/v1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment