Commit 1d2780ad by Lee Jaebin

#32825 作業一覧画面改善

parent 04fde09d
...@@ -7,9 +7,7 @@ import java.util.ArrayList; ...@@ -7,9 +7,7 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.acms.client.json.AcmsCommonJSON;
import jp.agentec.abook.abv.bl.common.exception.AcmsException; import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.dto.TaskDirectionsDto;
import jp.agentec.abook.abv.bl.dto.TaskDto; import jp.agentec.abook.abv.bl.dto.TaskDto;
import jp.agentec.abook.abv.bl.dto.TaskReportDto; import jp.agentec.abook.abv.bl.dto.TaskReportDto;
import jp.agentec.adf.util.DateTimeFormat; import jp.agentec.adf.util.DateTimeFormat;
...@@ -20,24 +18,14 @@ import jp.agentec.adf.util.DateTimeUtil; ...@@ -20,24 +18,14 @@ import jp.agentec.adf.util.DateTimeUtil;
*/ */
public class OperationDataJSON extends AcmsCommonJSON { public class OperationDataJSON extends AcmsCommonJSON {
public static final String OperationLastEditDate = "projectLastEditDate"; public static final String OperationLastEditDate = "operationLastEditDate";
public static final String TaskList = "taskList"; public static final String TaskList = "taskList";
public static final String OperationId = "projectId"; public static final String OperationId = "operationId";
public static final String TaskId = "taskId"; public static final String TaskId = "taskId";
public static final String TaskKey = "taskKey"; public static final String TaskKey = "taskKey";
public static final String TaskCode = "taskCode"; public static final String TaskCode = "taskCode";
public static final String TaskStatus = "taskStatus"; public static final String TaskStatus = "taskStatus";
public static final String TaskHotspotInfo = "taskHotspotInfo"; public static final String TaskHotspotInfo = "taskHotspotInfo";
// #32782 指示者テーブル関連削除 start
// TODO change&delete TaskDirections
// public static final String TaskDirectionsInfo = "taskReportInfo";
public static final String TaskDirectionsInfo = "taskDirectionsInfo";
// #32782 指示者テーブル関連削除 end
// #32782 指示者テーブル関連削除 start
// TODO change&Delete TaskDirections
// public static final String TaskDirectionsKey = "taskReportKey";
public static final String TaskDirectionsKey = "taskDirectionsKey";
// #32782 指示者テーブル関連削除 end
public static final String Task = "task"; public static final String Task = "task";
// 1.0.1で追加 // 1.0.1で追加
...@@ -54,10 +42,6 @@ public class OperationDataJSON extends AcmsCommonJSON { ...@@ -54,10 +42,6 @@ public class OperationDataJSON extends AcmsCommonJSON {
public List<TaskDto> taskDtoList; public List<TaskDto> taskDtoList;
public Date lastEditDate; public Date lastEditDate;
// #32926 作業報告画面改善 start
public static final String TaskReportLevel = "taskReportLevel";
// #32926 作業報告画面改善 end
public OperationDataJSON(String jsonString) throws AcmsException { public OperationDataJSON(String jsonString) throws AcmsException {
super(jsonString); super(jsonString);
} }
...@@ -82,30 +66,39 @@ public class OperationDataJSON extends AcmsCommonJSON { ...@@ -82,30 +66,39 @@ public class OperationDataJSON extends AcmsCommonJSON {
// 作業報告詳細リスト // 作業報告詳細リスト
JSONArray taskReportList = taskJson.getJSONArray(TaskReportList); JSONArray taskReportList = taskJson.getJSONArray(TaskReportList);
dto.taskReportDtoList = new ArrayList<TaskReportDto>();
for (int j = 0; j < taskReportList.length(); j++) { for (int j = 0; j < taskReportList.length(); j++) {
TaskReportDto taskReportDto = new TaskReportDto(); TaskReportDto taskReportDto = new TaskReportDto();
JSONObject taskReportJson = taskReportList.getJSONObject(j); JSONObject taskReportJson = taskReportList.getJSONObject(j);
taskReportDto.taskReportLevel = taskReportJson.getInt(TaskReportLevel); taskReportDto.taskReportLevel = taskReportJson.getInt(TaskReportLevel);
taskReportDto.enableReport = taskReportJson.getInt(EnableReport); taskReportDto.enableReport = taskReportJson.getInt(EnableReport);
taskReportDto.taskReportInfoId = taskReportJson.getLong(TaskReportInfoId); if (taskReportJson.has(TaskReportInfoId)) {
taskReportDto.reportStartDate = DateTimeUtil.toDate(taskReportJson.getString(ReportStartDate), DateTimeFormat.yyyyMMddHHmmss_hyphen); // 定期点検の場合
taskReportDto.reportEndDate = DateTimeUtil.toDate(taskReportJson.getString(ReportEndDate), DateTimeFormat.yyyyMMddHHmmss_hyphen); taskReportDto.taskReportInfoId = taskReportJson.getLong(TaskReportInfoId);
}
if (taskReportJson.has(ReportStartDate)) {
taskReportDto.reportStartDate = DateTimeUtil.toDate(taskReportJson.getString(ReportStartDate), DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
if (taskReportJson.has(ReportEndDate)) {
taskReportDto.reportEndDate = DateTimeUtil.toDate(taskReportJson.getString(ReportEndDate), DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
if (taskReportJson.has(TaskReportKey)) { if (taskReportJson.has(TaskReportKey)) {
taskReportDto.attachedFileName = taskReportJson.getString(TaskReportKey); taskReportDto.attachedFileName = taskReportJson.getString(TaskReportKey);
} }
if (taskReportJson.has(TaskReportInfo)) { if (taskReportJson.has(TaskReportInfo)) {
Object object = taskJson.get(TaskReportInfo); Object object = taskReportJson.get(TaskReportInfo);
if (object instanceof String) { if (object instanceof String) {
taskReportDto.jsonData = null; taskReportDto.jsonData = null;
} else { } else {
taskReportDto.jsonData = taskJson.getJSONObject(TaskReportInfo).toString(); taskReportDto.jsonData = taskReportJson.getJSONObject(TaskReportInfo).toString();
} }
} }
dto.taskReportDtoList.add(taskReportDto); dto.taskReportDtoList.add(taskReportDto);
} }
taskDtoList.add(dto); taskDtoList.add(dto);
} }
} }
......
...@@ -29,7 +29,6 @@ public class OperationListJSON extends AcmsCommonJSON { ...@@ -29,7 +29,6 @@ public class OperationListJSON extends AcmsCommonJSON {
public static final String OperationDescriptions = "operationDescriptions"; public static final String OperationDescriptions = "operationDescriptions";
public static final String OperationStartDate = "operationStartDate"; public static final String OperationStartDate = "operationStartDate";
public static final String OperationEndDate = "operationEndDate"; public static final String OperationEndDate = "operationEndDate";
public static final String OperationStatus = "operationStatus";
public static final String OperationLastEditDate = "operationLastEditDate"; public static final String OperationLastEditDate = "operationLastEditDate";
public static final String ContentId = "contentId"; public static final String ContentId = "contentId";
//定期点検用 //定期点検用
...@@ -76,8 +75,6 @@ public class OperationListJSON extends AcmsCommonJSON { ...@@ -76,8 +75,6 @@ public class OperationListJSON extends AcmsCommonJSON {
dto.operationDescriptions = operationJson.getString(OperationDescriptions); dto.operationDescriptions = operationJson.getString(OperationDescriptions);
dto.operationStartDate = DateTimeUtil.toDate(operationJson.getString(OperationStartDate), "UTC", DateTimeFormat.yyyyMMdd_hyphen); dto.operationStartDate = DateTimeUtil.toDate(operationJson.getString(OperationStartDate), "UTC", DateTimeFormat.yyyyMMdd_hyphen);
dto.operationEndDate = DateTimeUtil.toDate(operationJson.getString(OperationEndDate), "UTC", DateTimeFormat.yyyyMMdd_hyphen); dto.operationEndDate = DateTimeUtil.toDate(operationJson.getString(OperationEndDate), "UTC", DateTimeFormat.yyyyMMdd_hyphen);
// 1.0.1で追加
dto.operationStatus = operationJson.getInt(OperationStatus); // 作業状況
dto.reportType = operationJson.getInt(ReportType); // 作業報告タイプ dto.reportType = operationJson.getInt(ReportType); // 作業報告タイプ
dto.enableReportHistory = operationJson.getInt(EnableReportHistory); // 報告履歴管理 dto.enableReportHistory = operationJson.getInt(EnableReportHistory); // 報告履歴管理
...@@ -133,8 +130,8 @@ public class OperationListJSON extends AcmsCommonJSON { ...@@ -133,8 +130,8 @@ public class OperationListJSON extends AcmsCommonJSON {
} }
} }
JSONArray workingGroupJsonArray = operationJson.getJSONArray(WorkingGroupList);
if (operationJson.has(WorkingGroupList)) { if (operationJson.has(WorkingGroupList)) {
JSONArray workingGroupJsonArray = operationJson.getJSONArray(WorkingGroupList);
for (int k = 0; k < workingGroupJsonArray.length(); k++) { for (int k = 0; k < workingGroupJsonArray.length(); k++) {
if (workingGroupJsonArray.getJSONObject(k).length() == 0) { if (workingGroupJsonArray.getJSONObject(k).length() == 0) {
// リストの情報が空の場合、以下の処理を行わないようにする // リストの情報が空の場合、以下の処理を行わないようにする
......
...@@ -8,9 +8,7 @@ import java.util.List; ...@@ -8,9 +8,7 @@ import java.util.List;
import jp.agentec.abook.abv.bl.common.exception.AcmsException; import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.dto.RoutineTaskReportDto; import jp.agentec.abook.abv.bl.dto.RoutineTaskReportDto;
import jp.agentec.abook.abv.bl.dto.TaskDirectionsDto;
import jp.agentec.abook.abv.bl.dto.TaskDto; import jp.agentec.abook.abv.bl.dto.TaskDto;
import jp.agentec.abook.abv.bl.dto.TaskReportDto;
import jp.agentec.adf.util.DateTimeFormat; import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
......
...@@ -13,9 +13,7 @@ public class GetOperationDataParameters extends AcmsParameters { ...@@ -13,9 +13,7 @@ public class GetOperationDataParameters extends AcmsParameters {
this.operationId = operationId; this.operationId = operationId;
} }
// TODO public long getOperationId() {
// サーバ作業後、対応必要「project」→「operation」
public long getProjectId() {
return operationId; return operationId;
} }
......
...@@ -139,7 +139,7 @@ public class AcmsApis { ...@@ -139,7 +139,7 @@ public class AcmsApis {
// 作業データ送信 // 作業データ送信
public static final String ApiSendTaskData = "taskData"; public static final String ApiSendTaskData = "taskData";
// 作業データ取得 // 作業データ取得
public static final String ApiGetOperationData = "getProjectData"; public static final String ApiGetOperationData = "getOperationData";
// 定期点検データ取得 // 定期点検データ取得
public static final String ApiGetRoutineTaskData = "getProjectInspectData"; public static final String ApiGetRoutineTaskData = "getProjectInspectData";
// 作業ファイル取得 // 作業ファイル取得
......
...@@ -711,8 +711,8 @@ public class ABVEnvironment { ...@@ -711,8 +711,8 @@ public class ABVEnvironment {
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
// taskReportLevelの値によってディレクトリを構成 // taskReportLevelの値によってディレクトリを構成
public String getAttachedDirectionOrReportDirPath(long contentId, String taskKey, String taskReportLevel) { public String getAttachedDirectionOrReportDirPath(long contentId, String taskKey, int taskReportLevel) {
return String.format(AttachedMoviesTaskTypeDir, cacheDirectory, contentId, taskKey, taskReportLevel); return String.format(AttachedMoviesTaskTypeDir, cacheDirectory, contentId, taskKey, String.valueOf(taskReportLevel));
} }
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
......
...@@ -88,12 +88,6 @@ public class Constant { ...@@ -88,12 +88,6 @@ public class Constant {
String REPORT_GPS = "reportGps"; String REPORT_GPS = "reportGps";
} }
public interface OperationUpdateType {
int HISTORY_NO = 0;
int HISTORY_ADD = 1;
int HISTORY_UPDATE = 2;
}
public interface OperationReportType { public interface OperationReportType {
int REPORT_TYPE = 0; int REPORT_TYPE = 0;
int ROUTINE_TASK = 1; int ROUTINE_TASK = 1;
...@@ -142,12 +136,18 @@ public class Constant { ...@@ -142,12 +136,18 @@ public class Constant {
public interface TaskReportLevel { public interface TaskReportLevel {
int ReportType = 0; // 報告タイプ int ReportType = 0; // 報告タイプ
int ReportResponseType = 1; // 報告(回答)タイプ int ReportReplyType = 1; // 報告(回答)タイプ
} }
public interface ReportType { public interface ReportType {
int Report = 0; // 報告 int Report = 0; // 報告
int Routine = 1; // 定期点検 int Routine = 1; // 定期点検
int ReportAnswer = 2; // 報告(回答) int ReportReply = 2; // 報告(回答)
}
// 報告履歴管理
public interface EnableReportHistory {
int Invalid = 0; // 無効
int Enable = 1; // 有効
} }
} }
...@@ -19,17 +19,17 @@ public class ABookKeys { ...@@ -19,17 +19,17 @@ public class ABookKeys {
public static final String ABOOK_CHECK_API = "abookcheck-api"; public static final String ABOOK_CHECK_API = "abookcheck-api";
// #32782 指示者テーブル関連削除 start // #32782 指示者テーブル関連削除 start
// TODO TaskDirections 削除処理が必要 // TODO TaskDirections 削除処理が必要
public static final String CMD_INSERT_TASK_DIRECTIONS = "insertTaskDirections"; public static final String CMD_INSERT_TASK_DIRECTIONS = "insertTaskReportLevel";
public static final String CMD_UPDATE_TASK_DIRECTIONS = "updateTaskDirections"; public static final String CMD_UPDATE_TASK_DIRECTIONS = "updateTaskReportLevel";
public static final String CMD_DELETE_TASK_DIRECTIONS = "deleteTaskDirections"; public static final String CMD_DELETE_TASK_DIRECTIONS = "deleteTaskReport";
public static final String CMD_CANCEL_TASK_DIRECTIONS = "cancelTaskDirections"; public static final String CMD_CANCEL_TASK_DIRECTIONS = "cancelTaskDirections";
// #32782 指示者テーブル関連削除 end // #32782 指示者テーブル関連削除 end
public static final String CMD_MOVE_HOT_SPOT = "moveHotspot"; public static final String CMD_MOVE_HOT_SPOT = "moveHotspot";
public static final String CMD_SHOW_DIRECTION_OZD = "showDirectionOzd"; public static final String CMD_SHOW_DIRECTION_OZD = "showDirectionOzd";
public static final String CMD_PREVIEW_DIRECTION_OZD = "previewDirectionOzd"; public static final String CMD_PREVIEW_DIRECTION_OZD = "previewDirectionOzd";
public static final String CMD_INSERT_TASK_REPORT = "insertTaskReport"; public static final String CMD_INSERT_TASK_REPORT = "insertTaskReportReplyLevel";
public static final String CMD_UPDATE_TASK_REPORT = "updateTaskReport"; public static final String CMD_UPDATE_TASK_REPORT = "updateTaskReportReplyLevel";
public static final String CMD_DELETE_TASK_REPORT = "deleteTaskReport"; public static final String CMD_DELETE_TASK_REPORT = "deleteTaskReportReply";
public static final String CMD_CANCEL_TASK_REPORT = "cancelTaskReport"; public static final String CMD_CANCEL_TASK_REPORT = "cancelTaskReport";
public static final String CMD_SHOW_REPORT_OZD = "showReportOzd"; public static final String CMD_SHOW_REPORT_OZD = "showReportOzd";
public static final String CMD_PREVIEW_REPORT_OZD = "previewReportOzd"; public static final String CMD_PREVIEW_REPORT_OZD = "previewReportOzd";
...@@ -123,7 +123,6 @@ public class ABookKeys { ...@@ -123,7 +123,6 @@ public class ABookKeys {
public static final String CMD_LOCAL_SAVE_TASK_REPORT = "localSaveTaskReport"; // 一時保存 public static final String CMD_LOCAL_SAVE_TASK_REPORT = "localSaveTaskReport"; // 一時保存
// #32861 作業情報追加 end // #32861 作業情報追加 end
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
public static final String TASK_REPORT_LEVEL = "taskReportLevel"; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答)) public static final String HAS_AUTHORITY = "hasAuthority";
public static final String TASK_HAS_AUTHORITY = "taskHasAuthority";
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
} }
...@@ -37,8 +37,6 @@ import jp.agentec.abook.abv.bl.data.tables.TMarkingSetting; ...@@ -37,8 +37,6 @@ import jp.agentec.abook.abv.bl.data.tables.TMarkingSetting;
import jp.agentec.abook.abv.bl.data.tables.TOperation; import jp.agentec.abook.abv.bl.data.tables.TOperation;
import jp.agentec.abook.abv.bl.data.tables.TPushMessage; import jp.agentec.abook.abv.bl.data.tables.TPushMessage;
import jp.agentec.abook.abv.bl.data.tables.TTask; import jp.agentec.abook.abv.bl.data.tables.TTask;
import jp.agentec.abook.abv.bl.data.tables.TTaskDirections;
import jp.agentec.abook.abv.bl.data.tables.TTaskDirectionsItems;
import jp.agentec.abook.abv.bl.data.tables.TTaskReport; import jp.agentec.abook.abv.bl.data.tables.TTaskReport;
import jp.agentec.abook.abv.bl.data.tables.TTaskReportItems; import jp.agentec.abook.abv.bl.data.tables.TTaskReportItems;
import jp.agentec.abook.abv.bl.data.tables.TTaskReportSend; import jp.agentec.abook.abv.bl.data.tables.TTaskReportSend;
...@@ -93,11 +91,6 @@ public class ABVDataOpenHelper { ...@@ -93,11 +91,6 @@ public class ABVDataOpenHelper {
iTableScripts.add(new RTaskWorkerGroup()); iTableScripts.add(new RTaskWorkerGroup());
iTableScripts.add(new ROperationContent()); iTableScripts.add(new ROperationContent());
iTableScripts.add(new TTask()); iTableScripts.add(new TTask());
// #32782 指示者テーブル関連削除 start
// TODO delete
iTableScripts.add(new TTaskDirections());
iTableScripts.add(new TTaskDirectionsItems());
// #32782 指示者テーブル関連削除 end
iTableScripts.add(new TTaskReport()); iTableScripts.add(new TTaskReport());
iTableScripts.add(new TTaskReportSend()); iTableScripts.add(new TTaskReportSend());
iTableScripts.add(new TTaskReportItems()); iTableScripts.add(new TTaskReportItems());
......
...@@ -70,11 +70,6 @@ public class OperationDao extends AbstractDao { ...@@ -70,11 +70,6 @@ public class OperationDao extends AbstractDao {
dto.contentCreatingFlg = toBool(cursor.getInt(column)); dto.contentCreatingFlg = toBool(cursor.getInt(column));
} }
column = cursor.getColumnIndex("report_update_type");
if (column != -1) {
dto.reportUpdateType = cursor.getInt(column);
}
column = cursor.getColumnIndex("report_cycle"); column = cursor.getColumnIndex("report_cycle");
if (column != -1) { if (column != -1) {
dto.reportCycle = cursor.getInt(column); dto.reportCycle = cursor.getInt(column);
...@@ -156,13 +151,14 @@ public class OperationDao extends AbstractDao { ...@@ -156,13 +151,14 @@ public class OperationDao extends AbstractDao {
+ "operation_start_date, " + "operation_start_date, "
+ "operation_end_date, " + "operation_end_date, "
+ "operation_type, " + "operation_type, "
+ "report_type, "
+ "last_edit_date, " + "last_edit_date, "
+ "content_creating_flg, " + "content_creating_flg, "
+ "edit_lock_flg, " + "edit_lock_flg, "
+ "need_sync_flg, " + "need_sync_flg, "
+ "report_update_type, "
+ "report_cycle, " + "report_cycle, "
+ "enable_report_update) " + "enable_report_update, "
+ "enable_report_history) "
+ "values " + "values "
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?)", + "(?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues()); dto.getInsertValues());
...@@ -176,13 +172,14 @@ public class OperationDao extends AbstractDao { ...@@ -176,13 +172,14 @@ public class OperationDao extends AbstractDao {
+ "operation_start_date=?, " + "operation_start_date=?, "
+ "operation_end_date=?, " + "operation_end_date=?, "
+ "operation_type=?, " + "operation_type=?, "
+ "report_type=?, "
+ "last_edit_date=?, " + "last_edit_date=?, "
+ "content_creating_flg=?, " + "content_creating_flg=?, "
+ "edit_lock_flg=?, " + "edit_lock_flg=?, "
+ "need_sync_flg=?, " + "need_sync_flg=?, "
+ "report_update_type=?, "
+ "report_cycle=?, " + "report_cycle=?, "
+ "enable_report_update=? " + "enable_report_update=?, "
+ "enable_report_history=? "
+ "where operation_id=?", + "where operation_id=?",
dto.getUpdateValues()); dto.getUpdateValues());
return count > 0; return count > 0;
...@@ -198,11 +195,6 @@ public class OperationDao extends AbstractDao { ...@@ -198,11 +195,6 @@ public class OperationDao extends AbstractDao {
delete("r_operation_content", null, null); delete("r_operation_content", null, null);
delete("t_operation", null, null); delete("t_operation", null, null);
delete("t_task", null, null); delete("t_task", null, null);
// #32782 指示者テーブル関連削除 start
// TODO delete
delete("t_task_directions", null, null);
delete("t_task_directions_items", null, null);
// #32782 指示者テーブル関連削除 end
delete("t_task_report", null, null); delete("t_task_report", null, null);
delete("t_task_report_send", null, null); delete("t_task_report_send", null, null);
delete("t_task_report_items", null, null); delete("t_task_report_items", null, null);
...@@ -210,12 +202,12 @@ public class OperationDao extends AbstractDao { ...@@ -210,12 +202,12 @@ public class OperationDao extends AbstractDao {
delete("m_worker_group", null, null); delete("m_worker_group", null, null);
} }
public List<OperationDto> getOperations(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String operationReportTypeStr) { public List<OperationDto> getOperations(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) {
String sql = generateGetOperationQuery(searchOperationName, searchStartDateStr, searchEndDateStr, operationReportTypeStr); String sql = generateGetOperationQuery(searchOperationName, searchStartDateStr, searchEndDateStr, reportTypeStr);
return rawQueryGetDtoList(sql, null, OperationDto.class); return rawQueryGetDtoList(sql, null, OperationDto.class);
} }
private String generateGetOperationQuery(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String operationReportTypeStr) { private String generateGetOperationQuery(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) {
String curDate = DateTimeUtil.toStringInTimeZone(new Date(), DateTimeFormat.yyyyMMddHHmmss_hyphen, "UTC"); String curDate = DateTimeUtil.toStringInTimeZone(new Date(), DateTimeFormat.yyyyMMddHHmmss_hyphen, "UTC");
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
...@@ -230,7 +222,6 @@ public class OperationDao extends AbstractDao { ...@@ -230,7 +222,6 @@ public class OperationDao extends AbstractDao {
sql.append(" top.edit_lock_flg, "); sql.append(" top.edit_lock_flg, ");
sql.append(" top.need_sync_flg, "); sql.append(" top.need_sync_flg, ");
sql.append(" top.content_creating_flg, "); sql.append(" top.content_creating_flg, ");
sql.append(" top.report_update_type, ");
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, ");
...@@ -274,20 +265,18 @@ public class OperationDao extends AbstractDao { ...@@ -274,20 +265,18 @@ public class OperationDao extends AbstractDao {
sql.append(" AND top.operation_start_date <= '" + DateTimeUtil.toString(endDate, DateTimeFormat.yyyyMMdd_hyphen) + "'"); sql.append(" AND top.operation_start_date <= '" + DateTimeUtil.toString(endDate, DateTimeFormat.yyyyMMdd_hyphen) + "'");
} }
if (operationReportTypeStr != null) { if (reportTypeStr != null) {
// sql.append(" AND top.operation_report_type in ("+ operationReportTypeStr +")"); sql.append(" AND top.report_type in ("+ reportTypeStr +")");
sql.append(" AND top.report_type in ("+ operationReportTypeStr +")");
} }
// sql.append(" ORDER BY top.operation_report_type DESC, top.operation_start_date DESC, top.operation_id DESC"); sql.append(" ORDER BY top.operation_start_date DESC, top.operation_name ASC");
sql.append(" ORDER BY top.report_type DESC, top.operation_start_date DESC, top.operation_id DESC");
Logger.v(TAG, "sql=%s", sql); Logger.v(TAG, "sql=%s", sql);
return sql.toString(); return sql.toString();
} }
public boolean updateContentCreatingFlg(long operationId, boolean content_creating_flg){ public boolean updateContentCreatingFlg(long operationId, boolean content_creating_flg) {
OperationDto dto = getOperation(operationId); OperationDto dto = getOperation(operationId);
if (dto != null) { if (dto != null) {
dto.contentCreatingFlg = content_creating_flg; dto.contentCreatingFlg = content_creating_flg;
......
package jp.agentec.abook.abv.bl.data.dao;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.dto.TaskDirectionsDto;
/**
* Created by leej on 2018/08/31.
*/
public class TaskDirectionsDao extends AbstractDao {
private static final String TAG = "TaskDirectionsDao";
/*package*/ TaskDirectionsDao() {
}
@Override
protected TaskDirectionsDto convert(Cursor cursor) {
TaskDirectionsDto dto = new TaskDirectionsDto();
int column = cursor.getColumnIndex("task_key");
if (column != -1) {
dto.taskKey = cursor.getString(column);
}
column = cursor.getColumnIndex("json_data");
if (column != -1) {
dto.jsonData = cursor.getString(column);
}
column = cursor.getColumnIndex("attached_file_name");
if (column != -1) {
dto.attachedFileName = cursor.getString(column);
}
column = cursor.getColumnIndex("local_attached_file_name");
if (column != -1) {
dto.localAttachedFileName = cursor.getString(column);
}
column = cursor.getColumnIndex("attached_file_send_flg");
if (column != -1) {
dto.attachedFileSendFlg = toBool(cursor.getInt(column));
}
column = cursor.getColumnIndex("data_send_flg");
if (column != -1) {
dto.dataSendFlg = toBool(cursor.getInt(column));
}
// t_taskテーブルへINNER JOINで取得したカラム取得
column = cursor.getColumnIndex("task_hotspot_info");
if (column != -1) {
dto.taskHotSpotInfo = cursor.getString(column);
}
column = cursor.getColumnIndex("del_flg");
if (column != -1) {
dto.delFlg = toBool(cursor.getInt(column));
}
return dto;
}
public void insert(TaskDirectionsDto dto) {
insert("insert into t_task_directions "
+ "(task_key, "
+ "json_data, "
+ "attached_file_name, "
+ "local_attached_file_name, "
+ "attached_file_send_flg, "
+ "data_send_flg) "
+ "values "
+ "(?,?,?,?,?,?)",
dto.getInsertValues());
}
public List<TaskDirectionsDto> getTaskDirectionsByOperationId(Long operationId) {
StringBuilder sb = new StringBuilder();
sb.append(" select ttd.* ");
sb.append(" from t_task_directions ttd ");
sb.append(" inner join ");
sb.append(" t_task tt ");
sb.append(" ON tt.task_key == ttd.task_key ");
sb.append(" WHERE tt.del_flg = 0");
sb.append(" AND tt.operation_id = ?");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskDirectionsDto.class);
}
public TaskDirectionsDto getTaskDirections(String taskKey) {
return rawQueryGetDto("select * from t_task_directions where task_key=?", new String[]{"" + taskKey}, TaskDirectionsDto.class);
}
public String getTaskDirectionsAttachedFileName(String taskKey) {
return rawQueryGetString("select local_attached_file_name from t_task_directions where task_key=?", new String[]{"" + taskKey});
}
public boolean update(TaskDirectionsDto dto) {
long count = update("update t_task_directions "
+ "set "
+ "json_data=?, "
+ "attached_file_name=?, "
+ "local_attached_file_name=?, "
+ "attached_file_send_flg=?, "
+ "data_send_flg=? "
+ "where task_key=?",
dto.getUpdateValues());
return count > 0;
}
public boolean isExistSendTaskData(Long operationId) {
return getSendableTaskData(operationId).size() > 0;
}
public List<TaskDirectionsDto> getSendableTaskData(Long operationId) {
StringBuilder sb = new StringBuilder();
sb.append(" select * ");
sb.append(" from t_task_directions ttd ");
sb.append(" inner join ");
sb.append(" t_task tt ");
sb.append(" ON tt.task_key == ttd.task_key ");
sb.append(" WHERE ttd.data_send_flg = 1");
sb.append(" AND tt.operation_id = ?");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskDirectionsDto.class);
}
public List<TaskDirectionsDto> getSendableTaskData(Long operationId, String taskKey) {
StringBuilder sb = new StringBuilder();
sb.append(" select * ");
sb.append(" from t_task_directions ttd ");
sb.append(" inner join ");
sb.append(" t_task tt ");
sb.append(" ON tt.task_key == ttd.task_key ");
sb.append(" WHERE ttd.data_send_flg = 1");
sb.append(" AND tt.operation_id = ?");
sb.append(" AND tt.task_key = ?");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId, "" + taskKey}, TaskDirectionsDto.class);
}
}
package jp.agentec.abook.abv.bl.data.dao;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.dto.TaskDirectionsItemsDto;
/**
* Created by leej on 2018/08/31.
*/
public class TaskDirectionsItemsDao extends AbstractDao {
/*package*/ TaskDirectionsItemsDao() {
}
@Override
protected TaskDirectionsItemsDto convert(Cursor cursor) {
TaskDirectionsItemsDto dto = new TaskDirectionsItemsDto();
int column = cursor.getColumnIndex("task_key");
if (column != -1) {
dto.taskKey = cursor.getString(column);
}
column = cursor.getColumnIndex("item_key");
if (column != -1) {
dto.itemKey = cursor.getString(column);
}
column = cursor.getColumnIndex("input_value");
if (column != -1) {
dto.inputValue = cursor.getString(column);
}
return dto;
}
public void insertTaskDirectionsItems(TaskDirectionsItemsDto dto) {
insert("insert into t_task_directions_items (task_key, item_key, input_value) values (?,?,?)", dto.getInsertValues());
}
public List<TaskDirectionsItemsDto> getTaskDirectionsItemByTaskKey(String taskKey) {
return rawQueryGetDtoList("select * from t_task_directions_items where task_key=?", new String[]{"" + taskKey}, TaskDirectionsItemsDto.class);
}
public List<TaskDirectionsItemsDto> getTaskDirectionsItemByOperationId(Long operationId) {
StringBuilder sb = new StringBuilder();
sb.append(" select distinct ttdi.* ");
sb.append(" from t_task_directions_items ttdi ");
sb.append(" inner join ");
sb.append(" t_task tt ");
sb.append(" ON tt.task_key == ttdi.task_key ");
sb.append(" WHERE tt.del_flg = 0");
sb.append(" AND tt.operation_id = ?");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskDirectionsItemsDto.class);
}
public boolean updateTaskDirectionsItems(TaskDirectionsItemsDto dto) {
long count = update("update t_task_directions_items set input_value=? where item_key=? and task_key=? ", dto.getUpdateValues());
return (count > 0);
}
}
\ No newline at end of file
...@@ -54,13 +54,10 @@ public class TaskReportDao extends AbstractDao { ...@@ -54,13 +54,10 @@ public class TaskReportDao extends AbstractDao {
if (column != -1) { if (column != -1) {
dto.delFlg = toBool(cursor.getInt(column)); dto.delFlg = toBool(cursor.getInt(column));
} }
// #32782 指示者テーブル関連削除 start column = cursor.getColumnIndex("reported_flag");
// TODO append if (column != -1) {
// column = cursor.getColumnIndex("reportor_flag"); dto.reportedFlag = toBool(cursor.getInt(column));
// if (column != -1) { }
// dto.reporterFlag = toBool(cursor.getInt(column));
// }
// #32782 指示者テーブル関連削除 end
return dto; return dto;
} }
...@@ -72,14 +69,14 @@ public class TaskReportDao extends AbstractDao { ...@@ -72,14 +69,14 @@ public class TaskReportDao extends AbstractDao {
+ "attached_file_name, " + "attached_file_name, "
+ "local_attached_file_name, " + "local_attached_file_name, "
+ "attached_file_send_flg, " + "attached_file_send_flg, "
+ "data_send_flg) " + "data_send_flg, "
// #32782 指示者テーブル関連削除 start + "task_report_id, "
// TODO append + "task_report_info_id, "
// + "reporter_flag) " + "report_start_date, "
+ "report_end_date, "
+ "reported_flag) "
+ "values " + "values "
// + "(?,?,?,?,?,?,?)", + "(?,?,?,?,?,?,?,?,?,?,?)",
+ "(?,?,?,?,?,?)",
// #32782 指示者テーブル関連削除 end
dto.getInsertValues()); dto.getInsertValues());
} }
...@@ -95,8 +92,14 @@ public class TaskReportDao extends AbstractDao { ...@@ -95,8 +92,14 @@ public class TaskReportDao extends AbstractDao {
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class); return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class);
} }
public TaskReportDto getTaskReport(String taskKey) { /**
return rawQueryGetDto("select * from t_task_report where task_key=?", new String[]{"" + taskKey}, TaskReportDto.class); * 作業キーと作業報告タイプで作業報告データ取得
* @param taskKey
* @param taskReportLevel
* @return
*/
public TaskReportDto getTaskReport(String taskKey, Integer taskReportLevel) {
return rawQueryGetDto("select * from t_task_report where task_key=? AND task_report_level", new String[]{ "" + taskKey, "" + taskReportLevel }, TaskReportDto.class);
} }
public boolean update(TaskReportDto dto) { public boolean update(TaskReportDto dto) {
...@@ -106,16 +109,50 @@ public class TaskReportDao extends AbstractDao { ...@@ -106,16 +109,50 @@ public class TaskReportDao extends AbstractDao {
+ "attached_file_name=?, " + "attached_file_name=?, "
+ "local_attached_file_name=?, " + "local_attached_file_name=?, "
+ "attached_file_send_flg=?, " + "attached_file_send_flg=?, "
+ "data_send_flg=? " + "data_send_flg=?, "
// #32782 指示者テーブル関連削除 start + "task_report_id=?, "
// TODO append + "task_report_info_id=?, "
// + "reporter_flag=? " + "report_start_date=?, "
// #32782 指示者テーブル関連削除 end + "report_end_date=?, "
+ "reported_flag=?, "
+ "where task_key=?", + "where task_key=?",
dto.getUpdateValues()); dto.getUpdateValues());
return count > 0; return count > 0;
} }
public boolean updateRoutinTask(TaskReportDto dto, boolean reportedFlg) {
long count;
if (reportedFlg) {
dto.reportedFlag = true;
count = update("update t_inspect_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(?)",
dto.getUpdateValues());
} else {
count = update("update t_inspect_task_report "
+ "set "
+ "report_end_date=?, "
+ "attached_file_name=?, "
+ "local_attached_file_name=?, "
+ "json_data=?, "
+ "data_send_flag=?, "
+ "attached_file_send_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.dataSendFlag, dto.attachedFileSendFlag, dto.taskKey, dto.taskReportId, dto.reportStartDate });
}
return count > 0;
}
}
/** /**
* 送信フラグのあるデータが存在するか * 送信フラグのあるデータが存在するか
* *
...@@ -138,11 +175,8 @@ public class TaskReportDao extends AbstractDao { ...@@ -138,11 +175,8 @@ public class TaskReportDao extends AbstractDao {
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class); return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class);
} }
// #32782 指示者テーブル関連削除 start
// TODO append
// public List<TaskReportDto> getSendableTaskData(Long operationId, String taskKey, boolean reporterFlag) {
public List<TaskReportDto> getSendableTaskData(Long operationId, String taskKey) { public List<TaskReportDto> getSendableTaskData(Long operationId, String taskKey) {
// #32782 指示者テーブル関連削除 end
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(" select * "); sb.append(" select * ");
sb.append(" from t_task_report ttr "); sb.append(" from t_task_report ttr ");
...@@ -152,10 +186,6 @@ public class TaskReportDao extends AbstractDao { ...@@ -152,10 +186,6 @@ public class TaskReportDao extends AbstractDao {
sb.append(" WHERE ttr.data_send_flg = 1"); sb.append(" WHERE ttr.data_send_flg = 1");
sb.append(" AND tt.operation_id = ?"); sb.append(" AND tt.operation_id = ?");
sb.append(" AND tt.task_key = ?"); sb.append(" AND tt.task_key = ?");
// #32782 指示者テーブル関連削除 start
// TODO append
// sb.append(" AND ttr.repertor_flag = ?");
// return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId, "" + taskKey, "" + reporterFlag}, TaskReportDto.class);
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId, "" + taskKey}, TaskReportDto.class); return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId, "" + taskKey}, TaskReportDto.class);
// #32782 指示者テーブル関連削除 end // #32782 指示者テーブル関連削除 end
} }
...@@ -187,11 +217,9 @@ public class TaskReportDao extends AbstractDao { ...@@ -187,11 +217,9 @@ public class TaskReportDao extends AbstractDao {
* *
* @param taskKey * @param taskKey
* @param taskReportLevel * @param taskReportLevel
* @param taskReportId
* @param reportStartDate
* @return * @return
*/ */
public boolean isExistTaskReport(String taskKey, Integer taskReportLevel, String taskReportId, String reportStartDate) { public boolean isExistTaskReport(String taskKey, Integer taskReportLevel) {
return rawQueryGetInt("select COUNT(*) from t_task_report where task_key=? AND task_report_level=? AND task_report_id=? AND report_start_date=?", new String[]{"" + taskKey, "" + taskReportLevel, "" + taskReportId, "" + reportStartDate }) > 0; return rawQueryGetInt("select COUNT(*) from t_task_report where task_key=? AND task_report_level=?", new String[]{"" + taskKey, "" + taskReportLevel }) > 0;
} }
} }
...@@ -22,6 +22,12 @@ public class TaskReportItemsDao extends AbstractDao { ...@@ -22,6 +22,12 @@ public class TaskReportItemsDao extends AbstractDao {
if (column != -1) { if (column != -1) {
dto.taskKey = cursor.getString(column); dto.taskKey = cursor.getString(column);
} }
column = cursor.getColumnIndex("task_report_level");
if (column != -1) {
dto.taskReportLevel = cursor.getInt(column);
}
column = cursor.getColumnIndex("item_key"); column = cursor.getColumnIndex("item_key");
if (column != -1) { if (column != -1) {
dto.itemKey = cursor.getString(column); dto.itemKey = cursor.getString(column);
...@@ -35,11 +41,11 @@ public class TaskReportItemsDao extends AbstractDao { ...@@ -35,11 +41,11 @@ public class TaskReportItemsDao extends AbstractDao {
} }
public void insertTaskReportItems(TaskReportItemsDto dto) { public void insertTaskReportItems(TaskReportItemsDto dto) {
insert("insert into t_task_report_items (task_key, item_key, input_value) values (?,?,?)", dto.getInsertValues()); insert("insert into t_task_report_items (task_key, task_report_level, item_key, input_value) values (?,?,?,?)", dto.getInsertValues());
} }
public List<TaskReportItemsDto> getTaskReportItemByTaskKey(String taskKey) { public List<TaskReportItemsDto> getTaskReportItemByTaskKey(String taskKey, int taskReportLevel) {
return rawQueryGetDtoList("select * from t_task_report_items where task_key=?", new String[]{"" + taskKey}, TaskReportItemsDto.class); return rawQueryGetDtoList("select * from t_task_report_items where task_key=? and task_report_level=?", new String[]{"" + taskKey, "" + taskReportLevel}, TaskReportItemsDto.class);
} }
public List<TaskReportItemsDto> getTaskReportItemByOperationId(Long operationId) { public List<TaskReportItemsDto> getTaskReportItemByOperationId(Long operationId) {
...@@ -55,7 +61,7 @@ public class TaskReportItemsDao extends AbstractDao { ...@@ -55,7 +61,7 @@ public class TaskReportItemsDao extends AbstractDao {
} }
public boolean updateTaskReportItems(TaskReportItemsDto dto) { public boolean updateTaskReportItems(TaskReportItemsDto dto) {
long count = update("update t_task_report_items set input_value=? where item_key=? and task_key=? ", dto.getUpdateValues()); long count = update("update t_task_report_items set input_value=? where task_report_level=? and item_key=? and task_key=? ", dto.getUpdateValues());
return (count > 0); return (count > 0);
} }
} }
\ No newline at end of file
...@@ -32,7 +32,6 @@ public class TOperation extends SQLiteTableScript { ...@@ -32,7 +32,6 @@ public class TOperation extends SQLiteTableScript {
sql.append(" , content_creating_flg INTEGER NOT NULL "); sql.append(" , content_creating_flg INTEGER NOT NULL ");
sql.append(" , edit_lock_flg BOOLEAN NOT NULL DEFAULT 0 "); sql.append(" , edit_lock_flg BOOLEAN NOT NULL DEFAULT 0 ");
sql.append(" , need_sync_flg BOOLEAN NOT NULL DEFAULT 0 "); sql.append(" , need_sync_flg BOOLEAN NOT NULL DEFAULT 0 ");
sql.append(" , report_update_type INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , report_type INTEGER NOT NULL DEFAULT 0 "); sql.append(" , report_type INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , report_cycle INTEGER NOT NULL DEFAULT 0 "); sql.append(" , report_cycle INTEGER NOT NULL DEFAULT 0 ");
......
package jp.agentec.abook.abv.bl.data.tables;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
import jp.agentec.abook.abv.bl.data.DatabaseVersions;
/**
* Created by leej on 2018/08/31.
*/
public class TTaskDirections extends SQLiteTableScript {
public TTaskDirections() {
super();
}
@Override
public List<String> getCreateScript(int version) {
List<String> ddl = new ArrayList<String>();
StringBuffer sql = new StringBuffer();
sql.append(" CREATE TABLE t_task_directions ( ");
sql.append(" task_key TEXT NOT NULL ");
sql.append(" , json_data TEXT NOT NULL ");
sql.append(" , attached_file_name TEXT ");
sql.append(" , local_attached_file_name TEXT ");
sql.append(" , attached_file_send_flg BOOLEAN DEFAULT 0 ");
sql.append(" , data_send_flg BOOLEAN DEFAULT 0 ");
sql.append(" ) ");
ddl.add(sql.toString());
return ddl;
}
@Override
public List<String> getUpgradeScript(int oldVersion, int newVersion) {
return null;
}
@Override
public List<String> getMigrationScript(SQLiteDatabase databaseConnection, int oldVersion, int newVersion, Object[] params) {
return null;
}
}
package jp.agentec.abook.abv.bl.data.tables;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
import jp.agentec.abook.abv.bl.data.DatabaseVersions;
/**
* Created by leej on 2018/08/31.
*/
public class TTaskDirectionsItems extends SQLiteTableScript {
public TTaskDirectionsItems() {
super();
}
@Override
public List<String> getCreateScript(int version) {
List<String> ddl = new ArrayList<String>();
StringBuffer sql = new StringBuffer();
sql.append(" CREATE TABLE t_task_directions_items ( ");
sql.append(" task_key TEXT NOT NULL ");
sql.append(" , item_key VARCHAR(64) ");
sql.append(" , input_value VARCHAR(64) ");
sql.append(" ) ");
ddl.add(sql.toString());
return ddl;
}
@Override
public List<String> getUpgradeScript(int oldVersion, int newVersion) {
return null;
}
@Override
public List<String> getMigrationScript(SQLiteDatabase databaseConnection, int oldVersion, int newVersion, Object[] params) {
return null;
}
}
...@@ -23,6 +23,7 @@ public class TTaskReportItems extends SQLiteTableScript { ...@@ -23,6 +23,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(" , 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(" ) ");
......
...@@ -23,24 +23,17 @@ public class OperationDto extends AbstractDto { ...@@ -23,24 +23,17 @@ 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 reportUpdateType; //0:履歴無し 1:新規追加 2:更新 public int reportType; //0:通常 1:定期点検
public int operationReportType; //0:通常 1:定期点検
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
public int reportCount; //定期点検、作業数 public int reportCount; //定期点検、作業数
public int operationStatus; // 作業状況 0: 準備中, 1: 作業中, 2: 完了
public int reportType; // 0:報告 1:定期点検 2:報告(回答) public int enableReportHistory; // 0: 履歴無し, 1: 履歴可
public int enableReportHistory; // 0: 不可, 1: 可
// 作業担当グループリスト // 作業担当グループリスト
public List<WorkingGroupDto> workingGroupDtoList; public List<WorkingGroupDto> workingGroupDtoList;
// #32926 作業報告画面改善 start
public int reportType; // 作業報告タイプ 0:報告 1:定期点検 2:報告(回答)
// #32926 作業報告画面改善 end
public boolean equalsLastEdit(OperationDto dto) { public boolean equalsLastEdit(OperationDto dto) {
if (dto != null) { if (dto != null) {
if (operationId.equals(dto.operationId) && lastEditDate.equals(dto.lastEditDate)) { if (operationId.equals(dto.operationId) && lastEditDate.equals(dto.lastEditDate)) {
...@@ -52,12 +45,12 @@ public class OperationDto extends AbstractDto { ...@@ -52,12 +45,12 @@ public class OperationDto extends AbstractDto {
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
return new Object[] { operationId, operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportUpdateType, operationReportType, reportCycle, enableReportUpdate }; return new Object[] { operationId, operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory };
} }
@Override @Override
public Object[] getUpdateValues() { public Object[] getUpdateValues() {
return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportUpdateType, operationReportType, reportCycle, enableReportUpdate, operationId }; return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, operationId };
} }
@Override @Override
......
package jp.agentec.abook.abv.bl.dto;
/**
* Created by leej on 2018/08/31.
*/
public class TaskDirectionsDto extends AbstractDto {
public String taskKey;
public String jsonData;
public String attachedFileName;
public String localAttachedFileName;
public boolean attachedFileSendFlg;
public boolean dataSendFlg;
public String taskHotSpotInfo;
public boolean delFlg;
@Override
public Object[] getInsertValues() {
return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg };
}
@Override
public Object[] getUpdateValues() {
return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskKey };
}
@Override
public String[] getKeyValues() {
return new String[] { "" + taskKey };
}
}
package jp.agentec.abook.abv.bl.dto;
/**
* Created by leej on 2018/09/03.
*/
public class TaskDirectionsItemsDto extends AbstractDto {
public String taskKey;
public String itemKey;
public String inputValue;
@Override
public String[] getKeyValues() {
return new String[] {""+taskKey};
}
@Override
public Object[] getInsertValues() {
return new Object[] {taskKey, itemKey, inputValue};
}
@Override
public Object[] getUpdateValues() {
return new Object[] { inputValue, itemKey, taskKey };
}
}
\ No newline at end of file
...@@ -17,42 +17,24 @@ public class TaskReportDto extends AbstractDto { ...@@ -17,42 +17,24 @@ public class TaskReportDto extends AbstractDto {
public boolean delFlg; public boolean delFlg;
//  作業報告詳細リスト //  作業報告詳細リスト
public int taskReportLevel;
public int enableReport;
public long taskReportInfoId;
public String attachedFileName;
public Date reportStartDate;
public Date reportEndDate;
public String taskReportInfo;
// #32782 指示者テーブル関連削除 start
public boolean reporterFlag;
public int taskReportLevel; // 作業報告レベル public int taskReportLevel; // 作業報告レベル
public int taskHasAuthority; // 権限
public int taskReportId; // 作業報告ID public int taskReportId; // 作業報告ID
public int taskReportInfoId; // 作業報告情報ID public long taskReportInfoId; // 作業報告情報ID
public Date reportStartDate; // 作業開始日 public Date reportStartDate; // 作業開始日
public Date reportEndDate; // 作業終了日 public Date reportEndDate; // 作業終了日
public int enableReport; // 報告可能区分 public int enableReport; // 報告可能区分
public boolean reportedFlag; // public String attachedFileName;
// #32782 指示者テーブル関連削除 end public String taskReportInfo;
public boolean reportedFlag; // 定期点検用
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
// #32782 指示者テーブル関連削除 start return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, reportedFlag};
// TODO change
// return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reporterFlag };
return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg};
// #32782 指示者テーブル関連削除 end
} }
@Override @Override
public Object[] getUpdateValues() { public Object[] getUpdateValues() {
// #32782 指示者テーブル関連削除 start return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, reportedFlag, taskKey };
// TODO change
// return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reporterFlag, taskKey };
return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskKey };
// #32782 指示者テーブル関連削除 end
} }
@Override @Override
......
...@@ -7,6 +7,7 @@ package jp.agentec.abook.abv.bl.dto; ...@@ -7,6 +7,7 @@ package jp.agentec.abook.abv.bl.dto;
public class TaskReportItemsDto extends AbstractDto { public class TaskReportItemsDto extends AbstractDto {
public String taskKey; public String taskKey;
public int taskReportLevel;
public String itemKey; public String itemKey;
public String inputValue; public String inputValue;
...@@ -17,11 +18,11 @@ public class TaskReportItemsDto extends AbstractDto { ...@@ -17,11 +18,11 @@ public class TaskReportItemsDto extends AbstractDto {
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
return new Object[] {taskKey, itemKey, inputValue}; return new Object[] {taskKey, taskReportLevel, itemKey, inputValue};
} }
@Override @Override
public Object[] getUpdateValues() { public Object[] getUpdateValues() {
return new Object[] { inputValue, itemKey, taskKey }; return new Object[] { inputValue, taskReportLevel, itemKey, taskKey };
} }
} }
\ No newline at end of file
...@@ -107,7 +107,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -107,7 +107,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public Long mOperationId; public Long mOperationId;
protected int mXWalkOpenType = -1; protected int mXWalkOpenType = -1;
protected int mOperationType; protected int mOperationType;
protected int reportUpdateType; //0:履歴無し 1:新規追加 2:更新 protected int enableReportHistory; //0:履歴無し 1:履歴可
protected String mContentPath; protected String mContentPath;
protected int mStatusCode; protected int mStatusCode;
protected boolean isOperationPdf = false; protected boolean isOperationPdf = false;
...@@ -172,7 +172,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -172,7 +172,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
mStatusCode = 0; mStatusCode = 0;
} }
reportUpdateType = operationDto.reportUpdateType; enableReportHistory = operationDto.enableReportHistory;
linkUrl = intent.getStringExtra("LINKURL"); // LinkURL linkUrl = intent.getStringExtra("LINKURL"); // LinkURL
...@@ -787,7 +787,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -787,7 +787,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.operationReportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
helpViewType = Constant.HelpViewType.RoutineTaskOperation; helpViewType = Constant.HelpViewType.RoutineTaskOperation;
} else { } else {
helpViewType = Constant.HelpViewType.ListOperationReporter; helpViewType = Constant.HelpViewType.ListOperationReporter;
...@@ -824,7 +824,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -824,7 +824,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.operationReportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
helpViewType = Constant.HelpViewType.RoutineTaskOperationReport; helpViewType = Constant.HelpViewType.RoutineTaskOperationReport;
} else { } else {
helpViewType = Constant.HelpViewType.ReportTask; helpViewType = Constant.HelpViewType.ReportTask;
...@@ -865,7 +865,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -865,7 +865,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
int taskReportId = 0; int taskReportId = 0;
String reportStartDate = ""; String reportStartDate = "";
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK && abookCheckParam.get(ABookKeys.TASK_REPORT_ID) != null && abookCheckParam.get(ABookKeys.REPORT_START_DATE) != null) { if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK && abookCheckParam.get(ABookKeys.TASK_REPORT_ID) != null && abookCheckParam.get(ABookKeys.REPORT_START_DATE) != null) {
taskReportId = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_ID)); taskReportId = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = abookCheckParam.get(ABookKeys.REPORT_START_DATE); reportStartDate = abookCheckParam.get(ABookKeys.REPORT_START_DATE);
} }
...@@ -932,7 +932,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -932,7 +932,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}; };
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this, ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this,
mCmd, mTaskKey, reportUpdateType, abookCheckParam, mOperationId, mContentPath, getContentId(), mCmd, mTaskKey, enableReportHistory, abookCheckParam, mOperationId, mContentPath, getContentId(),
operationDto.reportType == Constant.ReportType.Routine, finishCallback, operationDto.reportType == Constant.ReportType.Routine, finishCallback,
taskReportLevel); taskReportLevel);
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
......
...@@ -87,9 +87,9 @@ public class OperationListAdapter extends AbstractOperationAdapter { ...@@ -87,9 +87,9 @@ public class OperationListAdapter extends AbstractOperationAdapter {
final OperationDto operationDto = getItem(position); final OperationDto operationDto = getItem(position);
if (operationDto != null) { if (operationDto != null) {
boolean noRoutineTaskAll = (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK && operationDto.reportCount == 0); boolean noRoutineTaskAll = (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK && operationDto.reportCount == 0);
holder.tvOperationName.setText(operationDto.operationName); holder.tvOperationName.setText(operationDto.operationName);
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) { if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) {
holder.tvDate.setText(mContext.getString(R.string.date_label_routineTask) + " : " + mContext.getString(R.string.msg_no_report_data)); holder.tvDate.setText(mContext.getString(R.string.date_label_routineTask) + " : " + mContext.getString(R.string.msg_no_report_data));
} else { } else {
...@@ -106,7 +106,7 @@ public class OperationListAdapter extends AbstractOperationAdapter { ...@@ -106,7 +106,7 @@ public class OperationListAdapter extends AbstractOperationAdapter {
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true); setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true);
} else { } else {
// needSyncFlgがfalseの場合 // needSyncFlgがfalseの場合
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
// 定期点検プロジェクトの場合のみ、以下の処理を行う // 定期点検プロジェクトの場合のみ、以下の処理を行う
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))) {
......
...@@ -119,9 +119,9 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -119,9 +119,9 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
final OperationDto operationDto = getItem(position); final OperationDto operationDto = getItem(position);
if (operationDto != null) { if (operationDto != null) {
boolean noRoutineTaskAll = (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK && operationDto.reportCount == 0); boolean noRoutineTaskAll = (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK && operationDto.reportCount == 0);
holder.tvOperationName.setText(operationDto.operationName); holder.tvOperationName.setText(operationDto.operationName);
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) { if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) {
holder.tvDate.setText(mContext.getString(R.string.date_label_routineTask) + " : " + mContext.getString(R.string.msg_no_report_data)); holder.tvDate.setText(mContext.getString(R.string.date_label_routineTask) + " : " + mContext.getString(R.string.msg_no_report_data));
} else { } else {
...@@ -137,7 +137,7 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -137,7 +137,7 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true); setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true);
} else { } else {
// needSyncFlgがfalseの場合 // needSyncFlgがfalseの場合
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
// 定期点検プロジェクトの場合のみ、以下の処理を行う // 定期点検プロジェクトの場合のみ、以下の処理を行う
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))) {
...@@ -174,9 +174,9 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -174,9 +174,9 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
holder.lyPanoEditLayout.setVisibility(View.INVISIBLE); holder.lyPanoEditLayout.setVisibility(View.INVISIBLE);
} }
if(mOperationAuthLevel == OperationAuthLevel.WORKER) { // if(mOperationAuthLevel.equals(OperationAuthLevel.WORKER)) {
holder.lyPanoEditLayout.setVisibility(View.GONE); holder.lyPanoEditLayout.setVisibility(View.GONE);
} // }
holder.ivPanoEdit.setOnClickListener(new View.OnClickListener() { holder.ivPanoEdit.setOnClickListener(new View.OnClickListener() {
@Override @Override
......
...@@ -63,8 +63,8 @@ public class OperationListHelper { ...@@ -63,8 +63,8 @@ public class OperationListHelper {
private List<OperationDto> filterOperationList() { private List<OperationDto> filterOperationList() {
try { try {
String operationReportTypeStr = PreferenceUtil.getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null); String reportTypeStr = PreferenceUtil.getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null);
operationDtoList = mOperationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, operationReportTypeStr); operationDtoList = mOperationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, reportTypeStr);
} catch (Exception e) { } catch (Exception e) {
Logger.e(TAG, "findOperationList", e); Logger.e(TAG, "findOperationList", e);
ErrorMessage.showErrorMessageToast(mAppActivity.getApplicationContext(), ErrorCode.E107); ErrorMessage.showErrorMessageToast(mAppActivity.getApplicationContext(), ErrorCode.E107);
......
...@@ -5245,7 +5245,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5245,7 +5245,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
} }
public int getOperationReportUpdateType() { public int getOperationReportUpdateType() {
return reportUpdateType; return enableReportHistory;
} }
/** /**
......
...@@ -272,11 +272,7 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -272,11 +272,7 @@ public class OperationTaskLayout extends RelativeLayout {
} }
private boolean isTaskFinished(String taskKey) { private boolean isTaskFinished(String taskKey) {
if(mContext.getOperationReportUpdateType() == Constant.OperationUpdateType.HISTORY_ADD) { return mTaskDao.getTaskByTaskKey(taskKey).taskStatus == FINISHED_STATUS;
return false;
} else {
return mTaskDao.getTaskByTaskKey(taskKey).taskStatus == FINISHED_STATUS;
}
} }
public void showTaskList(int pageNum, boolean isNormalSize) { public void showTaskList(int pageNum, boolean isNormalSize) {
......
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