Commit e1a7811a by NGUYEN HOANG SON

implent dabase operation table: new_report_flg (small int)

parent 2ed7df67
......@@ -65,6 +65,7 @@ public class OperationListJSON extends AcmsCommonJSON {
public static final String PermitCodeRequiredFlg = "permitCodeRequiredFlg";
public static final String DisplayPermissionFlg = "displayPermissionFlg";
public static final String NewReportFlg = "newReportFlg";
public static final String ProcessList = "processList";
public static final String WarningReportList = "warningReportList";
......@@ -184,6 +185,7 @@ public class OperationListJSON extends AcmsCommonJSON {
}
}
// check pickup tab
dto.newReportFlg = operationJson.has(NewReportFlg) ? operationJson.getInt(NewReportFlg) : 0;
if (operationJson.has(ProcessList)) {
dto.processJsonArray = operationJson.getJSONArray(ProcessList);
}
......
......@@ -30,6 +30,7 @@ public class ABookKeys {
public static final String PERMIT_CODE_REQUIRED_FLG = "permitCodeRequiredFlg";
public static final String PERMIT_CODE = "permitCode";
public static final String DISPLAY_PERMISSION_FLG = "displayPermissionFlg";
public static final String NEW_REPORT_FLG = "newReportFlg";
public static final String OPERATION_GROUPMASTER_LIST = "operationGroupMasterList";
public static final String OPERATION_GROUPMASTER_ID = "operationGroupMasterId";
......
......@@ -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_4_0;
public static final int DatabaseVersion = DatabaseVersions.Ver1_4_4;
protected SQLiteDatabase db = null;
......
......@@ -7,6 +7,7 @@ public class DatabaseVersions {
public static final int Ver1_2_0 = 21;
public static final int Ver1_2_3 = 22;
public static final int Ver1_4_0 = 42;
public static final int Ver1_4_4 = 43;//dashboard,pickup
//連続作業機能追加
public static final int Ver1_2_360 = 23;
//チャット機能追加(1.2.360障害対応。)
......
......@@ -135,6 +135,11 @@ public class OperationDao extends AbstractDao {
dto.displayPermissionFlg = cursor.getInt(column);
}
column = cursor.getColumnIndex("new_report_flg");
if (column != -1) {
dto.newReportFlg = cursor.getInt(column);
}
return dto;
}
......@@ -213,9 +218,10 @@ public class OperationDao extends AbstractDao {
+ "quick_report,"
+ "permit_code,"
+ "permit_code_required_flg, "
+ "display_permission_flg) "
+ "display_permission_flg, "
+ "new_report_flg) "
+ "values "
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues());
}
......@@ -240,7 +246,8 @@ public class OperationDao extends AbstractDao {
+ "quick_report=?, "
+ "permit_code=?, "
+ "permit_code_required_flg=?, "
+ "display_permission_flg=? "
+ "display_permission_flg=?, "
+ "new_report_flg=? "
+ "WHERE operation_id=?",
dto.getUpdateValues());
return count > 0;
......@@ -338,6 +345,7 @@ public class OperationDao extends AbstractDao {
sql.append(" top.enable_add_report, ");
sql.append(" top.permit_code, ");
sql.append(" top.permit_code_required_flg, ");
sql.append(" top.new_report_flg, ");
sql.append(" CASE ");
sql.append(" WHEN report_type = 1 THEN ( ");
sql.append(" SELECT strftime('%Y/%m/%d %H:%M', datetime(ttr.report_start_date, 'localtime')) || ' ~ ' || strftime('%Y/%m/%d %H:%M', datetime(ttr.report_end_date, 'localtime')) ");
......
......@@ -43,6 +43,7 @@ public class TOperation extends SQLiteTableScript {
sql.append(" , permit_code TEXT ");
sql.append(" , display_permission_flg SMALLINT");
sql.append(" , permit_code_required_flg SMALLINT");
sql.append(" , new_report_flg SMALLINT");
sql.append(" , PRIMARY KEY (operation_id) ");
sql.append(" ) ");
ddl.add(sql.toString());
......@@ -66,6 +67,9 @@ public class TOperation extends SQLiteTableScript {
ddl.add("ALTER TABLE t_operation ADD COLUMN permit_code_required_flg SMALLINT ");
ddl.add("ALTER TABLE t_operation ADD COLUMN display_permission_flg SMALLINT ");
}
if (oldVersion < DatabaseVersions.Ver1_4_4) {
ddl.add("ALTER TABLE t_operation ADD COLUMN new_report_flg SMALLINT ");
}
return ddl;
}
......
......@@ -44,6 +44,8 @@ public class OperationDto extends AbstractDto {
// 作業担当グループリスト
public List<TaskWorkerGroupDto> taskWorkerGroupDtoList;
//pickup
public int newReportFlg;
public JSONArray processJsonArray;
public JSONArray warningReportJsonArray;
......@@ -58,12 +60,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, permitCode, permitCodeRequiredFlg, displayPermissionFlg};
return new Object[] { operationId, operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, quickReport, permitCode, permitCodeRequiredFlg, displayPermissionFlg, newReportFlg};
}
@Override
public Object[] getUpdateValues() {
return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, quickReport, permitCode, permitCodeRequiredFlg, displayPermissionFlg, operationId };
return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, quickReport, permitCode, permitCodeRequiredFlg, displayPermissionFlg, newReportFlg, operationId };
}
@Override
......
......@@ -2306,7 +2306,8 @@ public class OperationLogic extends AbstractLogic {
operationJson.put(ABookKeys.OPERATION_OPEN_DATE, DateTimeUtil.toString(operationList.get(i).operationOpenDate, DateTimeFormat.yyyyMMddHHmmss_hyphen));
operationJson.put(ABookKeys.DISPLAY_PERMISSION_FLG, operationList.get(i).displayPermissionFlg);
operationJson.put(ABookKeys.CONTENT_ID, operationList.get(i).contentId);
//load processList and warning json file
//pickup newReportFlg, load processList and warning json file
operationJson.put(ABookKeys.NEW_REPORT_FLG, operationList.get(i).newReportFlg);
String processListJsonPath = ABVEnvironment.getInstance().getPickupProcessListOperationFilePath(operationList.get(i).operationId);
String processListString = FileUtil.readTextFile(processListJsonPath);
if (!StringUtil.isNullOrEmpty(processListString)) {
......
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