Commit 89ebc857 by yuichiro ogawa

#38369 t_operationへのカラム追加対応

parent b2c82cf4
...@@ -60,6 +60,8 @@ public class OperationListJSON extends AcmsCommonJSON { ...@@ -60,6 +60,8 @@ public class OperationListJSON extends AcmsCommonJSON {
public static final String OperationGroupMasterIdList = "operationGroupMasterIdList"; public static final String OperationGroupMasterIdList = "operationGroupMasterIdList";
public static final String QuickReport = "quickReport";
public List<OperationDto> operationList; public List<OperationDto> operationList;
public OperationListJSON(String jsonString) throws AcmsException { public OperationListJSON(String jsonString) throws AcmsException {
...@@ -89,6 +91,7 @@ public class OperationListJSON extends AcmsCommonJSON { ...@@ -89,6 +91,7 @@ public class OperationListJSON extends AcmsCommonJSON {
dto.enableReportHistory = operationJson.getInt(EnableReportHistory); // 報告履歴管理 dto.enableReportHistory = operationJson.getInt(EnableReportHistory); // 報告履歴管理
dto.enableReportEdit = operationJson.has(EnableReportEdit) ? operationJson.getInt(EnableReportEdit) : 0; // 作業編集区分 dto.enableReportEdit = operationJson.has(EnableReportEdit) ? operationJson.getInt(EnableReportEdit) : 0; // 作業編集区分
dto.enableAddReport = operationJson.has(EnableAddReport) ? operationJson.getInt(EnableAddReport) : 0; // 作業追加区分 dto.enableAddReport = operationJson.has(EnableAddReport) ? operationJson.getInt(EnableAddReport) : 0; // 作業追加区分
dto.quickReport = operationJson.getInt(QuickReport);
// 作業終了更新日 // 作業終了更新日
if (operationJson.has(OperationLastEditDate)) { if (operationJson.has(OperationLastEditDate)) {
......
...@@ -19,7 +19,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase; ...@@ -19,7 +19,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
public class DBConnector { public class DBConnector {
private static volatile DBConnector dbConnector = null; private static volatile DBConnector dbConnector = null;
public static final String DatabaseName = "ABVJE"; public static final String DatabaseName = "ABVJE";
public static final int DatabaseVersion = DatabaseVersions.Ver1_2_0; public static final int DatabaseVersion = DatabaseVersions.Ver1_2_3;
protected SQLiteDatabase db = null; protected SQLiteDatabase db = null;
......
...@@ -5,5 +5,6 @@ public class DatabaseVersions { ...@@ -5,5 +5,6 @@ public class DatabaseVersions {
public static final int Ver1_0_0 = 1; public static final int Ver1_0_0 = 1;
public static final int Ver1_1_0 = 11; public static final int Ver1_1_0 = 11;
public static final int Ver1_2_0 = 21; public static final int Ver1_2_0 = 21;
public static final int Ver1_2_3 = 22;
} }
package jp.agentec.abook.abv.bl.data.dao; package jp.agentec.abook.abv.bl.data.dao;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -8,7 +7,6 @@ import jp.agentec.abook.abv.bl.acms.type.OperationSortingType; ...@@ -8,7 +7,6 @@ import jp.agentec.abook.abv.bl.acms.type.OperationSortingType;
import jp.agentec.abook.abv.bl.common.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.db.Cursor; import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.SortDirection;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.adf.util.DateTimeFormat; import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
...@@ -113,6 +111,11 @@ public class OperationDao extends AbstractDao { ...@@ -113,6 +111,11 @@ public class OperationDao extends AbstractDao {
dto.enableAddReport = cursor.getInt(column); dto.enableAddReport = cursor.getInt(column);
} }
column = cursor.getColumnIndex("quick_report");
if (column != -1) {
dto.quickReport = cursor.getInt(column);
}
return dto; return dto;
} }
...@@ -187,9 +190,10 @@ public class OperationDao extends AbstractDao { ...@@ -187,9 +190,10 @@ public class OperationDao extends AbstractDao {
+ "enable_report_update, " + "enable_report_update, "
+ "enable_report_history, " + "enable_report_history, "
+ "enable_report_edit," + "enable_report_edit,"
+ "enable_add_report) " + "enable_add_report,"
+ "quick_report) "
+ "values " + "values "
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", + "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues()); dto.getInsertValues());
} }
...@@ -210,7 +214,8 @@ public class OperationDao extends AbstractDao { ...@@ -210,7 +214,8 @@ public class OperationDao extends AbstractDao {
+ "enable_report_update=?, " + "enable_report_update=?, "
+ "enable_report_history=?, " + "enable_report_history=?, "
+ "enable_report_edit=?, " + "enable_report_edit=?, "
+ "enable_add_report=? " + "enable_add_report=?, "
+ "quick_report=? "
+ "where operation_id=?", + "where operation_id=?",
dto.getUpdateValues()); dto.getUpdateValues());
return count > 0; return count > 0;
......
...@@ -39,6 +39,7 @@ public class TOperation extends SQLiteTableScript { ...@@ -39,6 +39,7 @@ public class TOperation extends SQLiteTableScript {
sql.append(" , enable_report_edit SMALLINT NOT NULL DEFAULT 0 "); sql.append(" , enable_report_edit SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , enable_add_report SMALLINT NOT NULL DEFAULT 0 "); sql.append(" , enable_add_report SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , operation_open_date DATETIME "); sql.append(" , operation_open_date DATETIME ");
sql.append(" , quick_report SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , PRIMARY KEY (operation_id) "); sql.append(" , PRIMARY KEY (operation_id) ");
sql.append(" ) "); sql.append(" ) ");
ddl.add(sql.toString()); ddl.add(sql.toString());
...@@ -54,6 +55,9 @@ public class TOperation extends SQLiteTableScript { ...@@ -54,6 +55,9 @@ public class TOperation extends SQLiteTableScript {
if (oldVersion < DatabaseVersions.Ver1_2_0) { // カラムの追加 if (oldVersion < DatabaseVersions.Ver1_2_0) { // カラムの追加
ddl.add("ALTER TABLE t_operation ADD COLUMN operation_open_date DATETIME"); ddl.add("ALTER TABLE t_operation ADD COLUMN operation_open_date DATETIME");
} }
if (oldVersion < DatabaseVersions.Ver1_2_3) {
ddl.add("ALTER TABLE t_operation ADD COLUMN quick_report SMALLINT NOT NULL DEFAULT 0 ");
}
return ddl; return ddl;
} }
......
...@@ -31,6 +31,7 @@ public class OperationDto extends AbstractDto { ...@@ -31,6 +31,7 @@ public class OperationDto extends AbstractDto {
public int enableReportHistory; // 0: 履歴無し, 1: 履歴可 public int enableReportHistory; // 0: 履歴無し, 1: 履歴可
public int enableReportEdit; // 作業編集可能区分 public int enableReportEdit; // 作業編集可能区分
public int enableAddReport; // 作業追加区分 public int enableAddReport; // 作業追加区分
public int quickReport; // 簡易帳票区分
public List<OperationGroupMasterRelationDto> operationGroupMasterRelationDtoList; // 作業種別に紐づく作業Dto public List<OperationGroupMasterRelationDto> operationGroupMasterRelationDtoList; // 作業種別に紐づく作業Dto
...@@ -48,12 +49,12 @@ public class OperationDto extends AbstractDto { ...@@ -48,12 +49,12 @@ public class OperationDto extends AbstractDto {
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
return new Object[] { operationId, operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport }; return new Object[] { operationId, operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, quickReport };
} }
@Override @Override
public Object[] getUpdateValues() { public Object[] getUpdateValues() {
return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, operationId }; return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, quickReport, operationId };
} }
@Override @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