Commit 4309bdca by Lee Jaebin

#32825 作業一覧画面改善(Android)

parent 42f9b507
......@@ -33,15 +33,24 @@ public class OperationDataJSON extends AcmsCommonJSON {
// public static final String TaskDirectionsInfo = "taskReportInfo";
public static final String TaskDirectionsInfo = "taskDirectionsInfo";
// #32782 指示者テーブル関連削除 end
public static final String TaskReportInfo = "taskReportInfo";
// #32782 指示者テーブル関連削除 start
// TODO change&Delete TaskDirections
// public static final String TaskDirectionsKey = "taskReportKey";
public static final String TaskDirectionsKey = "taskDirectionsKey";
// #32782 指示者テーブル関連削除 end
public static final String TaskReportKey = "taskReportKey";
public static final String Task = "task";
// 1.0.1で追加
public static final String TaskReportId = "taskReportId"; // 作業報告書ID ※定期点検のみ
public static final String TaskReportList = "taskReportList"; // 作業報告詳細リスト
public static final String TaskReportLevel = "taskReportLevel"; // 作業報告階層
public static final String EnableReport = "enableReport"; // 報告可能区分
public static final String TaskReportInfoId = "taskReportInfoId"; // 作業報告書情報ID ※定期点検のみ
public static final String ReportStartDate = "reportStartDate"; // 点検開始日時   ※定期点検のみ
public static final String ReportEndDate = "reportEndDate"; // 点検終了日時   ※定期点検のみ
public static final String TaskReportKey = "taskReportKey"; // 作業報告キー
public static final String TaskReportInfo = "taskReportInfo"; // 作業報告データ
public List<TaskDto> taskDtoList;
public Date lastEditDate;
......@@ -72,23 +81,51 @@ public class OperationDataJSON extends AcmsCommonJSON {
dto.taskStatus = taskJson.getInt(TaskStatus);
dto.taskHotSpotInfo = taskJson.getJSONObject(TaskHotspotInfo).toString();
if(taskJson.has(TaskDirectionsInfo)) {
dto.taskDirectionsDto.jsonData = taskJson.getJSONObject(TaskDirectionsInfo).toString();
}
if(taskJson.has(TaskDirectionsKey)) {
dto.taskDirectionsDto.attachedFileName = taskJson.getString(TaskDirectionsKey);
}
if (taskJson.has(TaskReportInfo)) {
Object object = taskJson.get(TaskReportInfo);
if (object instanceof String) {
dto.taskReportDto.jsonData = null;
} else {
dto.taskReportDto.jsonData = taskJson.getJSONObject(TaskReportInfo).toString();
// if(taskJson.has(TaskDirectionsInfo)) {
// dto.taskDirectionsDto.jsonData = taskJson.getJSONObject(TaskDirectionsInfo).toString();
// }
// if(taskJson.has(TaskDirectionsKey)) {
// dto.taskDirectionsDto.attachedFileName = taskJson.getString(TaskDirectionsKey);
// }
//
// if (taskJson.has(TaskReportInfo)) {
// Object object = taskJson.get(TaskReportInfo);
// if (object instanceof String) {
// dto.taskReportDto.jsonData = null;
// } else {
// dto.taskReportDto.jsonData = taskJson.getJSONObject(TaskReportInfo).toString();
// }
// }
// if (taskJson.has(TaskReportKey)) {
// dto.taskReportDto.attachedFileName = taskJson.getString(TaskReportKey);
// }
// 作業報告詳細リスト
JSONArray taskReportList = taskJson.getJSONArray(TaskReportList);
for (int j = 0; j < taskReportList.length(); j++) {
TaskReportDto taskReportDto = new TaskReportDto();
JSONObject taskReportJson = taskReportList.getJSONObject(j);
taskReportDto.taskReportLevel = taskReportJson.getInt(TaskReportLevel);
taskReportDto.enableReport = taskReportJson.getInt(EnableReport);
taskReportDto.taskReportInfoId = taskReportJson.getLong(TaskReportInfoId);
taskReportDto.reportStartDate = DateTimeUtil.toDate(taskReportJson.getString(ReportStartDate), DateTimeFormat.yyyyMMddHHmmss_hyphen);
taskReportDto.reportEndDate = DateTimeUtil.toDate(taskReportJson.getString(ReportEndDate), DateTimeFormat.yyyyMMddHHmmss_hyphen);
if (taskReportJson.has(TaskReportKey)) {
taskReportDto.attachedFileName = taskReportJson.getString(TaskReportKey);
}
}
if (taskJson.has(TaskReportKey)) {
dto.taskReportDto.attachedFileName = taskJson.getString(TaskReportKey);
if (taskReportJson.has(TaskReportInfo)) {
Object object = taskJson.get(TaskReportInfo);
if (object instanceof String) {
dto.taskReportDto.jsonData = null;
} else {
dto.taskReportDto.jsonData = taskJson.getJSONObject(TaskReportInfo).toString();
}
}
dto.taskReportDtoList.add(taskReportDto);
}
taskDtoList.add(dto);
}
......
......@@ -11,6 +11,7 @@ import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.dto.OperationContentDto;
import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.dto.WorkingGroupDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
......@@ -24,30 +25,40 @@ public class OperationListJSON extends AcmsCommonJSON {
// サーバ作業後、対応必要「project」→「operation」
public static final String OperationList = "projectList";
public static final String OperationId = "projectId";
public static final String OperationType = "projectType";
public static final String OperationName = "projectName";
public static final String OperationDescriptions = "projectDescriptions";
public static final String OperationStartDate = "projectStartDate";
public static final String OperationEndDate = "projectEndDate";
public static final String OperationType = "projectType";
public static final String ReportUpdateType = "reportUpdateType";
public static final String OperationLastEditDate = "projectLastEditDate";
public static final String OperationStatus = "projectStatus";
public static final String DecisionStatus = "decisionStatus";
public static final String DecisionType = "decisionType";
public static final String OperationLastEditDate = "projectLastEditDate";
public static final String ContentId = "contentId";
public static final String RelatedContentList = "relatedContentList";
public static final String PushMessageList = "pushMessageList";
public static final String PushMessageId = "pushMessageId";
public static final String PushSendLoginId = "pushSendLoginId";
public static final String PushSendDate = "pushSendDate";
public static final String PushMessage = "pushMessage";
//定期点検用
// TODO 削除予定
public static final String OperationReportType = "projectReportType";
public static final String ReportUpdateType = "reportUpdateType";
//定期点検用
public static final String ReportCycle = "reportCycle";
public static final String EnableReportUpdate = "enableReportUpdate";
public static final String EnableReportHistory = "enableReportHistory";
// 作業担当グループリスト
public static final String WorkingGroupList = "workingGroupList";
public static final String ReportLevel = "reportLevel"; // 報告階層
public static final String GroupList = "groupList"; // グループリスト
public static final String GroupId = "groupId"; // グループID
public static final String ReportType = "reportType";
public List<OperationDto> operationList;
public OperationListJSON(String jsonString) throws AcmsException {
......@@ -64,13 +75,19 @@ public class OperationListJSON extends AcmsCommonJSON {
JSONObject operationJson = operations.getJSONObject(i);
OperationDto dto = new OperationDto();
dto.operationContentDtoList = new ArrayList<OperationContentDto>();
dto.workingGroupDtoList = new ArrayList<WorkingGroupDto>();
dto.operationId = operationJson.getLong(OperationId);
dto.operationType = operationJson.getInt(OperationType);
dto.operationName = operationJson.getString(OperationName);
dto.operationDescriptions = operationJson.getString(OperationDescriptions);
dto.operationStartDate = DateTimeUtil.toDate(operationJson.getString(OperationStartDate), "UTC", DateTimeFormat.yyyyMMdd_hyphen);
dto.operationEndDate = DateTimeUtil.toDate(operationJson.getString(OperationEndDate), "UTC", DateTimeFormat.yyyyMMdd_hyphen);
dto.operationType = operationJson.getInt(OperationType);
dto.reportUpdateType = operationJson.has(ReportUpdateType) ? operationJson.getInt(ReportUpdateType) : 0;
// 1.0.1で追加
dto.operationStatus = operationJson.getInt(OperationStatus); // 作業状況
dto.reportType = operationJson.getInt(ReportType); // 作業報告タイプ
dto.enableReportHistory = operationJson.getInt(EnableReportHistory); // 報告履歴管理
if (operationJson.has(OperationLastEditDate)) {
dto.lastEditDate = DateTimeUtil.toDate(operationJson.getString(OperationLastEditDate), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
......@@ -124,6 +141,26 @@ public class OperationListJSON extends AcmsCommonJSON {
dto.pushMessageList.add(pushMessageDto);
}
}
JSONArray workingGroupJsonArray = operationJson.getJSONArray(WorkingGroupList);
if (operationJson.has(WorkingGroupList)) {
for (int k = 0; k < workingGroupJsonArray.length(); k++) {
if (workingGroupJsonArray.getJSONObject(k).length() == 0) {
// リストの情報が空の場合、以下の処理を行わないようにする
break;
}
// 作業担当グループリストセット
WorkingGroupDto workingGroupDto = new WorkingGroupDto();
workingGroupDto.reportLevel = workingGroupJsonArray.getJSONObject(k).getInt(ReportLevel);
workingGroupDto.groupList = new ArrayList<Integer>();
JSONArray workingGroupListArray = workingGroupJsonArray.getJSONObject(k).getJSONArray(GroupList);
for (int j = 0; j < workingGroupListArray.length(); j++) {
workingGroupDto.groupList.add(workingGroupListArray.getJSONObject(j).getInt(GroupId));
}
dto.workingGroupDtoList.add(workingGroupDto);
}
}
operationList.add(dto);
}
}
......
......@@ -95,10 +95,9 @@ public class Constant {
}
public interface OperationReportType {
// TODO 変数名は仮実装、変更必要
int DEFAULT = 0;
int REPORT_TYPE = 0;
int ROUTINE_TASK = 1;
int REPORT_TYPE = 2;
int REPORT_RESPONSE_TYPE = 2;
}
public interface PushMessageSendType {
......@@ -140,4 +139,9 @@ public class Constant {
int Camera = 2;
int Audio =3;
}
public interface TaskReportLevel {
int ReportType = 0; // 報告タイプ
int ReportResponseType = 1; // 報告(回答)タイプ
}
}
......@@ -19,6 +19,7 @@ import jp.agentec.abook.abv.bl.data.tables.MWorkerGroup;
import jp.agentec.abook.abv.bl.data.tables.ROperationContent;
import jp.agentec.abook.abv.bl.data.tables.RContentCategory;
import jp.agentec.abook.abv.bl.data.tables.RContentGroup;
import jp.agentec.abook.abv.bl.data.tables.RTaskWorkerGroup;
import jp.agentec.abook.abv.bl.data.tables.SQLiteTableScript;
import jp.agentec.abook.abv.bl.data.tables.TContent;
import jp.agentec.abook.abv.bl.data.tables.TContentBookmark;
......@@ -89,6 +90,7 @@ public class ABVDataOpenHelper {
iTableScripts.add(new MWorkerGroup());
iTableScripts.add(new TOperation());
iTableScripts.add(new RTaskWorkerGroup());
iTableScripts.add(new ROperationContent());
iTableScripts.add(new TTask());
// #32782 指示者テーブル関連削除 start
......
......@@ -94,10 +94,10 @@ public class PushMessageDao extends AbstractDao {
public List<PushMessageDto> selectAll() {
StringBuffer sql = new StringBuffer();
sql.append(" SELECT tpm.push_message_id, tpm.operation_id, tpm.push_send_login_id, tpm.push_send_date, tpm.push_message, tpm.reading_flg, tp.operation_name ");
sql.append(" SELECT tpm.push_message_id, tpm.operation_id, tpm.push_send_login_id, tpm.push_send_date, tpm.push_message, tpm.reading_flg, top.operation_name ");
sql.append(" FROM t_push_message AS tpm ");
sql.append(" INNER JOIN t_project AS tp ");
sql.append(" ON tpm.operation_id = tp.operation_id ");
sql.append(" INNER JOIN t_operation AS top ");
sql.append(" ON tpm.operation_id = top.operation_id ");
sql.append(" ORDER BY tpm.push_message_id DESC ");
Logger.v(TAG, "sql=%s", sql);
return rawQueryGetDtoList(sql.toString(), null, PushMessageDto.class);
......@@ -106,10 +106,10 @@ public class PushMessageDao extends AbstractDao {
public PushMessageDto select(long pushMessageId) {
String[] args = new String[] { "" + pushMessageId };
StringBuffer sql = new StringBuffer();
sql.append(" SELECT tpm.push_message_id, tpm.operation_id, tpm.push_send_login_id, tpm.push_send_date, tpm.push_message, tpm.reading_flg, tp.operation_name ");
sql.append(" SELECT tpm.push_message_id, tpm.operation_id, tpm.push_send_login_id, tpm.push_send_date, tpm.push_message, tpm.reading_flg, top.operation_name ");
sql.append(" FROM t_push_message AS tpm ");
sql.append(" INNER JOIN t_project AS tp ");
sql.append(" ON tpm.operation_id = tp.operation_id ");
sql.append(" INNER JOIN t_operation AS top ");
sql.append(" ON tpm.operation_id = top.operation_id ");
sql.append(" WHERE tpm.push_message_id = ? ");
Logger.v(TAG, "sql=%s", sql);
return rawQueryGetDto(sql.toString(), args, PushMessageDto.class);
......
package jp.agentec.abook.abv.bl.data.dao;
import java.util.Date;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.Cursor;
......@@ -174,4 +175,16 @@ public class TaskReportDao extends AbstractDao {
public void deleteAll() {
delete("t_task_report", null, null);
}
/**
*
* @param taskKey
* @param taskReportLevel
* @param taskReportId
* @param reportStartDate
* @return
*/
public boolean isExistTaskReport(String taskKey, Integer taskReportLevel, String taskReportId, String reportStartDate) {
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;
}
}
......@@ -23,7 +23,7 @@ public class LContentPageReadingLog extends SQLiteTableScript {
sql.append(" , reading_log_id INTEGER NOT NULL ");
sql.append(" , content_id BIGINT NOT NULL ");
sql.append(" , page_num INTEGER NOT NULL ");
sql.append(" , status CHAR(1) NOT NULL DEFAULT '1' ");
sql.append(" , status CHAR(1) NOT NULL REPORT_TYPE '1' ");
sql.append(" , start_date DATETIME NOT NULL ");
sql.append(" , resume_date DATETIME ");
sql.append(" , end_date DATETIME ");
......
......@@ -21,7 +21,7 @@ public class LContentReadingLog extends SQLiteTableScript {
sql.append(" CREATE TABLE l_content_reading_log ( ");
sql.append(" reading_log_id INTEGER NOT NULL ");
sql.append(" , content_id BIGINT NOT NULL ");
sql.append(" , status CHAR(1) NOT NULL DEFAULT '1' ");
sql.append(" , status CHAR(1) NOT NULL REPORT_TYPE '1' ");
sql.append(" , start_date DATETIME NOT NULL ");
sql.append(" , resume_date DATETIME ");
sql.append(" , end_date DATETIME ");
......
......@@ -33,7 +33,7 @@ public class MGroup extends SQLiteTableScript {
sql.append(" , group_level INTEGER NOT NULL ");
sql.append(" , group_name VARCHAR(64) NOT NULL ");
sql.append(" , group_path TEXT NOT NULL "); // path enumaerationパターンを適用する。since DatabaseVersions.Ver1_5_0
sql.append(" , user_group_flg BOOLEAN NOT NULL DEFAULT 0 "); // since DatabaseVersions.Plus_1_1_0
sql.append(" , user_group_flg BOOLEAN NOT NULL REPORT_TYPE 0 "); // since DatabaseVersions.Plus_1_1_0
sql.append(" , PRIMARY KEY (group_relation_id) ");
sql.append(" ) ");
......
......@@ -25,7 +25,7 @@ public class MMemberInfo extends SQLiteTableScript {
sql.append(" , sid VARCHAR(64) ");
//sql.append(" , contract_id INTEGER "); // 1.5.0から削除
sql.append(" , login_status INTEGER ");
sql.append(" , invalid_password_count SMALLINT DEFAULT 0 ");
sql.append(" , invalid_password_count SMALLINT REPORT_TYPE 0 ");
sql.append(" , last_login_date DATETIME ");
sql.append(" , last_change_password_date DATETIME ");
sql.append(" , last_cms_access_date DATETIME ");
......
......@@ -20,7 +20,7 @@ public class MPasswordLockInfo extends SQLiteTableScript {
// since 1.5.0
sql.append(" CREATE TABLE m_password_lock_info ( ");
sql.append(" id INTEGER NOT NULL ");
sql.append(" , invalid_password_count SMALLINT DEFAULT 0 ");
sql.append(" , invalid_password_count SMALLINT REPORT_TYPE 0 ");
sql.append(" , password_lock_date DATETIME ");
sql.append(" , PRIMARY KEY (id) ");
sql.append(" ) ");
......
......@@ -23,9 +23,9 @@ public class ROperationContent extends SQLiteTableScript {
sql.append(" CREATE TABLE r_operation_content ( ");
sql.append(" operation_id BIGINT NOT NULL ");
sql.append(" , content_id BIGINT NOT NULL ");
sql.append(" , operation_content_flg BOOLEAN NOT NULL DEFAULT 0 ");
sql.append(" , operation_content_flg BOOLEAN NOT NULL REPORT_TYPE 0 ");
sql.append(" , PRIMARY KEY (operation_id, content_id) ");
sql.append(" , FOREIGN KEY (operation_id) REFERENCES t_project (operation_id) ");
sql.append(" , FOREIGN KEY (operation_id) REFERENCES t_operation (operation_id) ");
sql.append(" , FOREIGN KEY (content_id) REFERENCES t_content (content_id)");
sql.append(" ) ");
......
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;
/**
* Created by leej on 2019/03/18.
*/
public class RTaskWorkerGroup extends SQLiteTableScript {
public RTaskWorkerGroup() {
super();
}
@Override
public List<String> getCreateScript(int version) {
List<String> ddl = new ArrayList<String>();
StringBuffer sql = new StringBuffer();
sql.append(" CREATE TABLE t_task_worker_group ( ");
sql.append(" task_report_level INTEGER default 0 ");
sql.append(" , operation_id BIGINT NOT NULL ");
sql.append(" , group_id INTEGER NOT NULL ");
sql.append(" , PRIMARY KEY (task_report_level, operation_id, group_id) ");
sql.append(" , FOREIGN KEY (operation_id) REFERENCES t_operation (operation_id) ");
sql.append(" , FOREIGN KEY (group_id) REFERENCES m_worker_group (group_id)");
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;
}
}
\ No newline at end of file
......@@ -24,8 +24,8 @@ public class TContentMemo extends SQLiteTableScript {
sql.append(" , axis_x SMALLINT NOT NULL ");
sql.append(" , axis_y SMALLINT NOT NULL ");
sql.append(" , memo TEXT NOT NULL ");
sql.append(" , copy_flg BOOLEAN DEFAULT false "); // since 1.5.2.01
sql.append(" , del_flg BOOLEAN DEFAULT false "); // since 1.5.2.01
sql.append(" , copy_flg BOOLEAN REPORT_TYPE false "); // since 1.5.2.01
sql.append(" , del_flg BOOLEAN REPORT_TYPE false "); // since 1.5.2.01
sql.append(" , insert_date DATETIME NOT NULL ");
sql.append(" , update_date DATETIME NOT NULL "); // since ABook Plus 1.2(1.2以前のアプリはUNIQUE INDEXのみ作成)
sql.append(" , PRIMARY KEY (memo_id) ");
......
......@@ -21,7 +21,7 @@ public class TOperation extends SQLiteTableScript {
List<String> ddl = new ArrayList<String>();
StringBuffer sql = new StringBuffer();
sql.append(" CREATE TABLE t_project ( ");
sql.append(" CREATE TABLE t_operation ( ");
sql.append(" operation_id BIGINT NOT NULL ");
sql.append(" , operation_name VARCHAR(128) ");
sql.append(" , operation_type INTEGER NOT NULL ");
......@@ -30,12 +30,14 @@ public class TOperation extends SQLiteTableScript {
sql.append(" , operation_end_date DATE NOT NULL ");
sql.append(" , last_edit_date DATE NOT NULL ");
sql.append(" , content_creating_flg INTEGER NOT NULL ");
sql.append(" , edit_lock_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(" , operation_report_type INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , report_cycle INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , enable_report_update INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , edit_lock_flg BOOLEAN NOT NULL REPORT_TYPE 0 ");
sql.append(" , need_sync_flg BOOLEAN NOT NULL REPORT_TYPE 0 ");
sql.append(" , report_update_type INTEGER NOT NULL REPORT_TYPE 0 ");
sql.append(" , report_type INTEGER NOT NULL REPORT_TYPE 0 ");
sql.append(" , report_cycle INTEGER NOT NULL REPORT_TYPE 0 ");
sql.append(" , enable_report_update INTEGER NOT NULL REPORT_TYPE 0 ");
sql.append(" , enable_report_history SMALLINT NOT NULL REPORT_TYPE 0 ");
sql.append(" , PRIMARY KEY (operation_id) ");
sql.append(" ) ");
ddl.add(sql.toString());
......@@ -52,13 +54,13 @@ public class TOperation extends SQLiteTableScript {
// }
//
// if (oldVersion < DatabaseVersions.Plus_1_9_3_5) { // カラムの追加
// ddl.add(" ALTER TABLE t_project ADD COLUMN report_update_type INTEGER NOT NULL DEFAULT 0 ");
// ddl.add(" ALTER TABLE t_operation ADD COLUMN report_update_type INTEGER NOT NULL REPORT_TYPE 0 ");
// }
//
// if (oldVersion < DatabaseVersions.Plus_1_9_4) { // カラムの追加
// ddl.add(" ALTER TABLE t_project ADD COLUMN project_report_type INTEGER NOT NULL DEFAULT 0 ");
// ddl.add(" ALTER TABLE t_project ADD COLUMN report_cycle INTEGER NOT NULL DEFAULT 0 ");
// ddl.add(" ALTER TABLE t_project ADD COLUMN enable_report_update INTEGER NOT NULL DEFAULT 0 ");
// ddl.add(" ALTER TABLE t_operation ADD COLUMN project_report_type INTEGER NOT NULL REPORT_TYPE 0 ");
// ddl.add(" ALTER TABLE t_operation ADD COLUMN report_cycle INTEGER NOT NULL REPORT_TYPE 0 ");
// ddl.add(" ALTER TABLE t_operation ADD COLUMN enable_report_update INTEGER NOT NULL REPORT_TYPE 0 ");
// }
// return ddl;
return null;
......
......@@ -25,9 +25,9 @@ public class TPushMessage extends SQLiteTableScript {
sql.append(" , push_send_login_id VARCHAR(128) ");
sql.append(" , push_send_date DATE NOT NULL ");
sql.append(" , push_message TEXT ");
sql.append(" , reading_flg BOOLEAN NOT NULL DEFAULT 0 ");
sql.append(" , reading_flg BOOLEAN NOT NULL REPORT_TYPE 0 ");
sql.append(" , PRIMARY KEY (push_message_id) ");
sql.append(" , FOREIGN KEY (operation_id) REFERENCES t_project (operation_id) ");
sql.append(" , FOREIGN KEY (operation_id) REFERENCES t_operation (operation_id) ");
sql.append(" ) ");
ddl.add(sql.toString());
......
......@@ -23,16 +23,16 @@ public class TRoutineTaskReport extends SQLiteTableScript {
sql.append(" CREATE TABLE IF NOT EXISTS t_inspect_task_report ( ");
sql.append(" task_key TEXT NOT NULL ");
sql.append(" , task_report_id INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , task_report_info_id INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , task_report_id INTEGER NOT NULL REPORT_TYPE 0 ");
sql.append(" , task_report_info_id INTEGER NOT NULL REPORT_TYPE 0 ");
sql.append(" , report_start_date DATETIME NOT NULL ");
sql.append(" , report_end_date DATETIME ");
sql.append(" , attached_file_name TEXT ");
sql.append(" , local_attached_file_name TEXT ");
sql.append(" , json_data TEXT ");
sql.append(" , data_send_flag BOOLEAN DEFAULT 0 ");
sql.append(" , attached_file_send_flag BOOLEAN DEFAULT 0 ");
sql.append(" , reported_flag BOOLEAN DEFAULT 0 ");
sql.append(" , data_send_flag BOOLEAN REPORT_TYPE 0 ");
sql.append(" , attached_file_send_flag BOOLEAN REPORT_TYPE 0 ");
sql.append(" , reported_flag BOOLEAN REPORT_TYPE 0 ");
sql.append(" ) ");
ddl.add(sql.toString());
......
......@@ -28,7 +28,7 @@ public class TTask extends SQLiteTableScript {
sql.append(" , task_code VARCHAR(64) ");
sql.append(" , task_status INTEGER ");
sql.append(" , task_hotspot_info TEXT ");
sql.append(" , del_flg BOOLEAN DEFAULT 0 ");
sql.append(" , del_flg BOOLEAN REPORT_TYPE 0 ");
sql.append(" , PRIMARY KEY (task_key) ");
sql.append(" ) ");
ddl.add(sql.toString());
......
......@@ -26,8 +26,8 @@ public class TTaskDirections extends SQLiteTableScript {
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(" , attached_file_send_flg BOOLEAN REPORT_TYPE 0 ");
sql.append(" , data_send_flg BOOLEAN REPORT_TYPE 0 ");
sql.append(" ) ");
ddl.add(sql.toString());
......
......@@ -26,12 +26,19 @@ public class TTaskReport extends SQLiteTableScript {
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(" , attached_file_send_flg BOOLEAN REPORT_TYPE 0 ");
sql.append(" , data_send_flg BOOLEAN REPORT_TYPE 0 ");
// #32782 指示者テーブル関連削除 start
// TODO append
// sql.append(" , reporter_flag BOOLEAN DEFAULT 0 ");
// sql.append(" , reporter_flag BOOLEAN REPORT_TYPE 0 ");
// #32782 指示者テーブル関連削除 end
sql.append(" , report_start_date DATETIME ");
sql.append(" , report_end_date DATETIME ");
sql.append(" , task_report_id INTEGER NOT NULL REPORT_TYPE 0 ");
sql.append(" , task_report_info_id INTEGER NOT NULL REPORT_TYPE 0 ");
sql.append(" , enable_report SMALLINT NOT NULL REPORT_TYPE 0 ");
sql.append(" , task_report_level SMALLINT NOT NULL REPORT_TYPE 0 ");
sql.append(" ) ");
ddl.add(sql.toString());
......
......@@ -31,11 +31,11 @@ public class TTaskReportSend extends SQLiteTableScript {
sql.append(" CREATE TABLE t_task_report_send ( ");
sql.append(" task_report_send_id INTEGER NOT NULL ");
sql.append(" , task_key TEXT NOT NULL ");
sql.append(" , task_report_id INTEGER DEFAULT 0 ");
sql.append(" , task_report_id INTEGER REPORT_TYPE 0 ");
sql.append(" , report_start_date DATETIME ");
sql.append(" , json_data TEXT NOT NULL ");
sql.append(" , save_date DATE NOT NULL ");
sql.append(" , delete_flg BOOLEAN NOT NULL DEFAULT 0 ");
sql.append(" , delete_flg BOOLEAN NOT NULL REPORT_TYPE 0 ");
sql.append(" ) ");
ddl.add(sql.toString());
......
......@@ -29,6 +29,13 @@ public class OperationDto extends AbstractDto {
public int enableReportUpdate; //0:不可 1:可
public String reportPeriod; //定期点検、2018/12/20 08:10:00 ~ 2018/12/21 18:10:00
public int reportCount; //定期点検、作業数
public int operationStatus; // 作業状況 0: 準備中, 1: 作業中, 2: 完了
public int reportType; // 0:報告 1:定期点検 2:報告(回答)
public int enableReportHistory; // 0: 不可, 1: 可
// 作業担当グループリスト
public List<WorkingGroupDto> workingGroupDtoList;
public boolean equalsLastEdit(OperationDto dto) {
if (dto != null) {
......
......@@ -14,6 +14,7 @@ public class TaskDto extends AbstractDto {
public String taskCode;
public Integer taskStatus;
public String taskHotSpotInfo;
public List<TaskReportDto> taskReportDtoList;
public boolean delFlg;
// #32782 指示者テーブル関連削除 start
......
package jp.agentec.abook.abv.bl.dto;
import java.util.Date;
/**
* Created by leej on 2018/09/10.
*/
......@@ -8,13 +10,21 @@ public class TaskReportDto 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;
//  作業報告詳細リスト
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;
// #32782 指示者テーブル関連削除 end
......
package jp.agentec.abook.abv.bl.dto;
import java.util.List;
/**
* Created by leej on 2019/03/18.
*/
public class WorkingGroupDto {
public int reportLevel;
public List<Integer> groupList;
}
package jp.agentec.abook.abv.launcher.android;
import java.util.ArrayList;
import java.util.Stack;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.Constant.OperationReportType;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
......@@ -141,9 +139,9 @@ public class ABVUIDataCache {
mOperationReportTypes = operationReportTypes;
} else {
mOperationReportTypes = new ArrayList<Integer>();
mOperationReportTypes.add(OperationReportType.DEFAULT);
mOperationReportTypes.add(OperationReportType.ROUTINE_TASK);
mOperationReportTypes.add(OperationReportType.REPORT_TYPE);
mOperationReportTypes.add(OperationReportType.ROUTINE_TASK);
mOperationReportTypes.add(OperationReportType.REPORT_RESPONSE_TYPE);
}
return mOperationReportTypes;
......
......@@ -728,6 +728,8 @@ public class OperationListActivity extends ABVUIActivity {
mOperationLogic.sendTaskReportSendData(operationId, null, progressCallback);
}
}
mOperationLogic.
progressDialogHorizontal.setProgress(60);
mOperationLastEditDate = receptionTaskData(operationId, progressCallback, buttonEventFlag);
......@@ -1032,6 +1034,33 @@ public class OperationListActivity extends ABVUIActivity {
lastEditDate = json.lastEditDate;
}
OperationDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getOpereationData(param);
// プログレスを40%進行させるための計算
int progress = 0;
if (json.taskDtoList.size() != 0) {
progress = 40 / json.taskDtoList.size();
}
for (TaskDto serverTaskDto : json.taskDtoList) {
if (isExistsTaskInList(localTaskList, serverTaskDto)) {
mTaskDao.update(serverTaskDto);
localTaskList.remove(serverTaskDto);
} else {
mTaskDao.insert(serverTaskDto);
}
// サーバーから取得した作業情報がローカルに存在しないので削除する
for (TaskDto taskDto : localTaskList) {
mOperationLogic.deleteTaskFileData(operationId, operationContentDto.contentId, taskDto.taskKey);
mTaskDao.delete(taskDto);
}
String reportAttachedFileName = serverTaskDto.taskReportDto.attachedFileName;
}
progressCallback.callback(new Integer(40));
return lastEditDate;
......@@ -1688,6 +1717,12 @@ public class OperationListActivity extends ABVUIActivity {
return false;
}
/**
* 定期点検の報告存在チェック
* @param listDto
* @param rDto
* @return
*/
private boolean isExistsRoutineTaskReportInList(List<RoutineTaskReportDto> listDto, RoutineTaskReportDto rDto) {
for(RoutineTaskReportDto lDto:listDto) {
if (lDto.taskKey.equals(rDto.taskKey) &&
......@@ -1897,9 +1932,9 @@ public class OperationListActivity extends ABVUIActivity {
private ArrayList<Integer> getOperationReportTypeList(boolean isAll) {
ArrayList<Integer> operationReportTypes = new ArrayList<>();
if (isAll) {
operationReportTypes.add(OperationReportType.DEFAULT);
operationReportTypes.add(OperationReportType.ROUTINE_TASK);
operationReportTypes.add(OperationReportType.REPORT_TYPE);
operationReportTypes.add(OperationReportType.ROUTINE_TASK);
operationReportTypes.add(OperationReportType.REPORT_RESPONSE_TYPE);
} else {
operationReportTypes = getABVUIDataCache().getOperationReportTypes();
}
......
......@@ -191,7 +191,7 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
public void showOperationRelatedContentList() {
mOperationContentList = mOperationLogic.getOperationRelatedContent(operationId);
mOperationContentList = mOperationLogic.getOperationRelatedContent();
Logger.i(TAG, "count of content=" + mOperationContentList.size());
// Gridビュー
......
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