Commit 82f49995 by Kazuyuki Hida

作業一覧でのAPIの動作を実装した。

parent b4d08cbc
......@@ -60,6 +60,10 @@ public class OperationListJSON extends AcmsCommonJSON {
public static final String OperationGroupMasterIdList = "operationGroupMasterIdList";
public static final String QuickReport = "quickReport";
public static final String statusNotStartedCount = "statusNotStartedCount"; //「未実施」数
public static final String statusWorkingCount = "statusWorkingCount"; //「作業中」数
public static final String statusCompletedCount = "statusCompletedCount"; // 「作業完了」数
public List<OperationDto> operationList;
public OperationListJSON(String jsonString) throws AcmsException {
......@@ -90,6 +94,9 @@ public class OperationListJSON extends AcmsCommonJSON {
dto.enableReportEdit = operationJson.has(EnableReportEdit) ? operationJson.getInt(EnableReportEdit) : 0; // 作業編集区分
dto.enableAddReport = operationJson.has(EnableAddReport) ? operationJson.getInt(EnableAddReport) : 0; // 作業追加区分
dto.quickReport = operationJson.has(QuickReport) ? operationJson.getInt(QuickReport) : 0;
dto.statusNotStartedCount = operationJson.has(statusNotStartedCount) ? operationJson.getInt(statusNotStartedCount) : 1; //「未実施」数
dto.statusWorkingCount = operationJson.has(statusWorkingCount) ? operationJson.getInt(statusWorkingCount) : 2; //「未実施」数 //「作業中」数
dto.statusCompletedCount = operationJson.has(statusCompletedCount) ? operationJson.getInt(statusCompletedCount) : 3; //「未実施」数 // 「作業完了」数
// 作業終了更新日
if (operationJson.has(OperationLastEditDate)) {
......
......@@ -19,7 +19,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
public class DBConnector {
private static volatile DBConnector dbConnector = null;
public static final String DatabaseName = "ABVJE";
public static final int DatabaseVersion = DatabaseVersions.Ver1_0_3;
public static final int DatabaseVersion = DatabaseVersions.Ver1_0_5;
protected SQLiteDatabase db = null;
......
......@@ -5,5 +5,7 @@ public class DatabaseVersions {
public static final int Ver1_0_0 = 1;
public static final int Ver1_0_2 = 11; // SATO HACCP 1.0.2
public static final int Ver1_0_3 = 21; // @From カテゴリ選択機能追加
public static final int Ver1_0_4 = 31; // @From 作業の進捗状況を追加
public static final int Ver1_0_5 = 41; // @From 作業のロック、差し戻し対応
}
......@@ -117,6 +117,21 @@ public class OperationDao extends AbstractDao {
dto.quickReport = cursor.getInt(column);
}
column = cursor.getColumnIndex("status_not_started_count");
if (column != -1) {
dto.statusNotStartedCount = cursor.getInt(column);
}
column = cursor.getColumnIndex("status_working_count");
if (column != -1) {
dto.statusWorkingCount = cursor.getInt(column);
}
column = cursor.getColumnIndex("status_completed_count");
if (column != -1) {
dto.statusCompletedCount = cursor.getInt(column);
}
return dto;
}
......@@ -188,9 +203,12 @@ public class OperationDao extends AbstractDao {
+ "enable_report_history, "
+ "enable_report_edit,"
+ "enable_add_report,"
+ "status_not_started_count, "
+ "status_working_count, "
+ "status_completed_count, "
+ "quick_report) "
+ "values "
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues());
}
......@@ -212,6 +230,9 @@ public class OperationDao extends AbstractDao {
+ "enable_report_history=?, "
+ "enable_report_edit=?, "
+ "enable_add_report=?, "
+ "status_not_started_count=?, "
+ "status_working_count=?, "
+ "status_completed_count=?, "
+ "quick_report=? "
+ "where operation_id=?",
dto.getUpdateValues());
......
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;
......@@ -92,6 +91,40 @@ public class TaskReportDao extends AbstractDao {
dto.localSavedFlg = toBool(cursor.getInt(column));
}
column = cursor.getColumnIndex("report_lock_user_id");
if (column != -1) {
dto.reportLockUserId = cursor.getString(column);
}
column = cursor.getColumnIndex("report_lock_user_name");
if (column != -1) {
dto.reportLockUserName = cursor.getString(column);
}
column = cursor.getColumnIndex("report_lock_time");
if (column != -1) {
dto.reportLockTime = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
column = cursor.getColumnIndex("send_back_user_id");
if (column != -1) {
dto.sendBackUserId = cursor.getString(column);
}
column = cursor.getColumnIndex("send_back_user_name");
if (column != -1) {
dto.sendBackUserName = cursor.getString(column);
}
column = cursor.getColumnIndex("send_back_comment");
if (column != -1) {
dto.sendBackComment = cursor.getString(column);
}
column = cursor.getColumnIndex("task_status");
if (column != -1) {
dto.taskStatus = cursor.getString(column);
}
return dto;
}
......@@ -113,9 +146,16 @@ public class TaskReportDao extends AbstractDao {
+ "report_end_date, "
+ "enable_report, "
+ "task_report_level, "
+ "report_lock_user_id, "
+ "report_lock_user_name, "
+ "report_lock_time, "
+ "send_back_user_id, "
+ "send_back_user_name, "
+ "send_back_comment, "
+ "task_status, "
+ "local_saved_flg ) "
+ "values "
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?)",
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues());
}
......@@ -137,6 +177,13 @@ public class TaskReportDao extends AbstractDao {
sql.append("enable_report=?, ");
sql.append("task_report_level=?, ");
sql.append("local_saved_flg=?, ");
sql.append("report_lock_user_id=?, ");
sql.append("report_lock_user_name=?, ");
sql.append("report_lock_time=?, ");
sql.append("send_back_user_id=?, ");
sql.append("send_back_user_name=?, ");
sql.append("send_back_comment=?, ");
sql.append("task_status=?, ");
sql.append("task_report_info_id=? ");
sql.append("WHERE task_key=? AND task_report_level=?");
if (dto.reportStartDate != null) {
......
......@@ -44,6 +44,9 @@ public class TOperation extends SQLiteTableScript {
sql.append(" , enable_add_report SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , operation_open_date DATETIME ");
sql.append(" , quick_report SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , status_not_started_count INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , status_working_count INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , status_completed_count INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , PRIMARY KEY (operation_id) ");
sql.append(" ) ");
ddl.add(sql.toString());
......@@ -59,6 +62,11 @@ public class TOperation extends SQLiteTableScript {
ddl.add(" ALTER TABLE t_operation ADD COLUMN operation_open_date DATETIME ");
ddl.add(" ALTER TABLE t_operation ADD COLUMN quick_report SMALLINT NOT NULL DEFAULT 0 ");
}
if (oldVersion < DatabaseVersions.Ver1_0_4) {
ddl.add(" ALTER TABLE t_operation ADD COLUMN status_not_started_count INTEGER NOT NULL DEFAULT 0 ");
ddl.add(" ALTER TABLE t_operation ADD COLUMN status_working_count INTEGER NOT NULL DEFAULT 0 ");
ddl.add(" ALTER TABLE t_operation ADD COLUMN status_completed_count INTEGER NOT NULL DEFAULT 0 ");
}
return ddl;
}
......
......@@ -35,6 +35,13 @@ public class TTaskReport extends SQLiteTableScript {
sql.append(" , enable_report SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , task_report_level SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , local_saved_flg BOOLEAN DEFAULT 0 ");
sql.append(" , report_lock_user_id TEXT "); // 報告ロックユーザId
sql.append(" , report_lock_user_name TEXT "); //報告ロックユーザ名
sql.append(" , report_lock_time DATETIME "); // 報告ロック日時
sql.append(" , send_back_user_id TEXT "); // 差し戻しユーザId 差し戻された場合のみ" +
sql.append(" , send_back_user_name TEXT "); // 差し戻しユーザ名 差し戻された場合のみ
sql.append(" , send_back_comment TEXT "); // 確認コメント 差し戻された場合のみ
sql.append(" , task_status TEXT "); // 状況 0:未実施、1:作業中、999:作業完了
sql.append(" ) ");
ddl.add(sql.toString());
......@@ -44,7 +51,17 @@ public class TTaskReport extends SQLiteTableScript {
@Override
public List<String> getUpgradeScript(int oldVersion, int newVersion) {
return null;
List<String> ddl = new ArrayList<String>();
if (oldVersion < DatabaseVersions.Ver1_0_5) {
ddl.add(" ALTER TABLE t_task_report ADD COLUMN report_lock_user_id TEXT"); // 報告ロックユーザId
ddl.add(" ALTER TABLE t_task_report ADD COLUMN report_lock_user_name TEXT"); //報告ロックユーザ名
ddl.add(" ALTER TABLE t_task_report ADD COLUMN report_lock_time DATETIME"); // 報告ロック日時
ddl.add(" ALTER TABLE t_task_report ADD COLUMN send_back_user_id TEXT"); // 差し戻しユーザId 差し戻された場合のみ" +
ddl.add(" ALTER TABLE t_task_report ADD COLUMN send_back_user_name TEXT"); // 差し戻しユーザ名 差し戻された場合のみ
ddl.add(" ALTER TABLE t_task_report ADD COLUMN send_back_comment TEXT"); // 確認コメント 差し戻された場合のみ
ddl.add(" ALTER TABLE t_task_report ADD COLUMN task_status TEXT"); // 状況 0:未実施、1:作業中、999:作業完了
}
return ddl;
}
@Override
......
......@@ -33,6 +33,10 @@ public class OperationDto extends AbstractDto {
public int enableAddReport; // 作業追加区分
public int quickReport; // 簡易帳票区分
public int statusNotStartedCount; //「未実施」数
public int statusWorkingCount; //「作業中」数
public int statusCompletedCount; // 「作業完了」数
// 作業担当グループリスト
public List<TaskWorkerGroupDto> taskWorkerGroupDtoList;
// 作業種別に紐づく作業Dto
......@@ -49,12 +53,12 @@ public class OperationDto extends AbstractDto {
@Override
public Object[] getInsertValues() {
return new Object[] { operationId, operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, quickReport };
return new Object[] { operationId, operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, statusNotStartedCount, statusWorkingCount, statusCompletedCount, quickReport };
}
@Override
public Object[] getUpdateValues() {
return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, quickReport, operationId };
return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, statusNotStartedCount, statusWorkingCount, statusCompletedCount, quickReport, operationId };
}
@Override
......
......@@ -26,14 +26,22 @@ public class TaskReportDto extends AbstractDto {
public String attachedFileName;
public boolean localSavedFlg; // 一時保存用
public String reportLockUserId = "報告ユーザID"; // 報告ロックユーザId
public String reportLockUserName = "報告ユーザ名"; // 報告ロックユーザ名
public Date reportLockTime = new Date(); // 報告ロック日時
public String sendBackUserId = "差戻ユーザID"; // 差し戻しユーザId 差し戻された場合のみ
public String sendBackUserName = "差戻ユーザ名"; // 差し戻しユーザ名 差し戻された場合のみ
public String sendBackComment = "確認コメント"; // 確認コメント 差し戻された場合のみ
public String taskStatus = "状況:0"; // 状況 0:未実施、1:作業中、999:作業完了
@Override
public Object[] getInsertValues() {
return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, enableReport, taskReportLevel, localSavedFlg};
return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, enableReport, taskReportLevel, reportLockUserId, reportLockUserName, reportLockTime, sendBackUserId, sendBackUserName, sendBackComment, taskStatus, localSavedFlg};
}
@Override
public Object[] getUpdateValues() {
return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reportEndDate, enableReport, taskReportLevel, localSavedFlg, taskKey, taskReportLevel , reportStartDate };
return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reportEndDate, enableReport, taskReportLevel, localSavedFlg, taskKey, taskReportLevel , reportLockUserId, reportLockUserName, reportLockTime, sendBackUserId, sendBackUserName, sendBackComment, taskStatus, reportStartDate };
}
@Override
......
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