Commit 04fde09d by Lee Jaebin

Merge branch 'feature/1.0.1' into feature/1.0.1_32825

# Conflicts:
#	ABVJE_BL/src/jp/agentec/abook/abv/bl/common/Constant.java
#	ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/TaskReportDao.java
#	ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
#	ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
parents be91422e 2cac1130
......@@ -54,6 +54,10 @@ public class OperationDataJSON extends AcmsCommonJSON {
public List<TaskDto> taskDtoList;
public Date lastEditDate;
// #32926 作業報告画面改善 start
public static final String TaskReportLevel = "taskReportLevel";
// #32926 作業報告画面改善 end
public OperationDataJSON(String jsonString) throws AcmsException {
super(jsonString);
}
......@@ -101,6 +105,7 @@ public class OperationDataJSON extends AcmsCommonJSON {
}
dto.taskReportDtoList.add(taskReportDto);
}
taskDtoList.add(dto);
}
}
......
......@@ -144,4 +144,10 @@ public class Constant {
int ReportType = 0; // 報告タイプ
int ReportResponseType = 1; // 報告(回答)タイプ
}
public interface ReportType {
int Report = 0; // 報告
int Routine = 1; // 定期点検
int ReportAnswer = 2; // 報告(回答)
}
}
......@@ -122,4 +122,8 @@ public class ABookKeys {
public static final String ADD_REPORT = "addReport"; // 作業追加区分
public static final String CMD_LOCAL_SAVE_TASK_REPORT = "localSaveTaskReport"; // 一時保存
// #32861 作業情報追加 end
// #32926 作業報告画面改善 start
public static final String TASK_REPORT_LEVEL = "taskReportLevel"; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答))
public static final String TASK_HAS_AUTHORITY = "taskHasAuthority";
// #32926 作業報告画面改善 end
}
......@@ -48,6 +48,12 @@ public class TaskDao extends AbstractDao {
if (column != -1) {
dto.delFlg = toBool(cursor.getInt(column));
}
// #32926 作業報告画面改善 start
column = cursor.getColumnIndex("task_has_Authority");
if (column != -1) {
dto.taskHasAuthority = toBool(cursor.getInt(column));
}
// #32926 作業報告画面改善 end
return dto;
}
......
......@@ -161,7 +161,8 @@ public class TaskReportDao extends AbstractDao {
}
/**
* 作業キー、作業
*
* taskReportLevel によって添付ファイル名を取得する
* @param taskKey
* @param taskReportLevel
* @return
......
......@@ -37,6 +37,10 @@ public class OperationDto extends AbstractDto {
// 作業担当グループリスト
public List<WorkingGroupDto> workingGroupDtoList;
// #32926 作業報告画面改善 start
public int reportType; // 作業報告タイプ 0:報告 1:定期点検 2:報告(回答)
// #32926 作業報告画面改善 end
public boolean equalsLastEdit(OperationDto dto) {
if (dto != null) {
if (operationId.equals(dto.operationId) && lastEditDate.equals(dto.lastEditDate)) {
......
......@@ -20,6 +20,10 @@ public class TaskDto extends AbstractDto {
public int taskReportId;
public List<RoutineTaskReportDto> RoutineTaskReportList;
// #32926 作業報告画面改善 start
public boolean taskHasAuthority; // タスク別の権限
public int taskReportLevel; // 作業報告階層
// #32926 作業報告画面改善 end
@Override
public Object[] getInsertValues() {
......
......@@ -27,6 +27,14 @@ public class TaskReportDto extends AbstractDto {
// #32782 指示者テーブル関連削除 start
public boolean reporterFlag;
public int taskReportLevel; // 作業報告レベル
public int taskHasAuthority; // 権限
public int taskReportId; // 作業報告ID
public int taskReportInfoId; // 作業報告情報ID
public Date reportStartDate; // 作業開始日
public Date reportEndDate; // 作業終了日
public int enableReport; // 報告可能区分
public boolean reportedFlag; //
// #32782 指示者テーブル関連削除 end
@Override
......
......@@ -855,6 +855,13 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
mCmd = abookCheckParam.get(ABookKeys.CMD);
mTaskKey = abookCheckParam.get(ABookKeys.TASK_KEY);
// #32926 作業報告画面改善 start
int taskReportLevel = 0; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答))
if (abookCheckParam.containsKey(ABookKeys.TASK_REPORT_LEVEL)) {
taskReportLevel = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_LEVEL)); // 作業報告レベル
}
// #32926 作業報告画面改善 end
int taskReportId = 0;
String reportStartDate = "";
......@@ -864,7 +871,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_INSERT_TASK_DIRECTIONS, ABookKeys.CMD_UPDATE_TASK_DIRECTIONS, ABookKeys.CMD_DELETE_TASK_DIRECTIONS, ABookKeys.CMD_CANCEL_TASK_DIRECTIONS,
ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT, ABookKeys.CMD_DELETE_TASK_REPORT, ABookKeys.CMD_CANCEL_TASK_REPORT)) {
ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT, ABookKeys.CMD_DELETE_TASK_REPORT, ABookKeys.CMD_CANCEL_TASK_REPORT,
ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) {
boolean isError = false;
try {
......@@ -877,9 +885,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
ABookKeys.CMD_UPDATE_TASK_DIRECTIONS,
ABookKeys.CMD_INSERT_TASK_REPORT,
ABookKeys.CMD_UPDATE_TASK_REPORT,
ABookKeys.CMD_MOVE_HOT_SPOT)) {
ABookKeys.CMD_MOVE_HOT_SPOT,
ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) {
String taskCode = "";
// #32781 start
// TODO TASK_DIRECTIONSの削除され、TASK_REPORTに変更する
if (abookCheckParam.get(ABookKeys.TASK_DIRECTIONS) != null) {
JSONObject direction = new JSONObject(abookCheckParam.get(ABookKeys.TASK_DIRECTIONS));
JSONObject taskJson = direction.getJSONObject(ABookKeys.TASK);
......@@ -891,6 +902,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
}
}
// #32781 end
if (abookCheckParam.get(ABookKeys.HOT_SPOT) != null) {
JSONObject hotSpot = new JSONObject(abookCheckParam.get(ABookKeys.HOT_SPOT));
......@@ -918,7 +930,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
return null;
}
};
ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this, mCmd, mTaskKey, reportUpdateType, abookCheckParam, mOperationId, mContentPath, getContentId(), operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK, finishCallback);
// #32926 作業報告画面改善 start
ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this,
mCmd, mTaskKey, reportUpdateType, abookCheckParam, mOperationId, mContentPath, getContentId(),
operationDto.reportType == Constant.ReportType.Routine, finishCallback,
taskReportLevel);
// #32926 作業報告画面改善 end
} catch(Exception e) {
Logger.e(TAG, "doABookCheckParam error", e);
}
......@@ -949,11 +966,15 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (abookCheckParam.containsKey(ABookKeys.ADD_REPORT)) {
mAddReport = Integer.parseInt(abookCheckParam.get(ABookKeys.ADD_REPORT)) > 0 ? true : false;
}
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, false, taskReportId, reportStartDate, mReportFileName, mLocalSave, mAddReport);
// #32926 作業報告画面改善 start
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, false, taskReportId, reportStartDate, mReportFileName, mLocalSave, mAddReport, taskReportLevel);
// #32926 作業報告画面改善 end
// #32861 作業情報追加 end
} else if (mCmd.equals(ABookKeys.CMD_PREVIEW_REPORT_OZD)) {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, taskReportId, reportStartDate, mReportFileName, false, false);
// #32926 作業報告画面改善 start
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, taskReportId, reportStartDate, mReportFileName, false, false, taskReportLevel);
// #32926 作業報告画面改善 end
} else if (mCmd.equals(ABookKeys.CMD_CONTENT_EDIT_CLOSE)) {
showProgressPopup();
handler.postDelayed(new Runnable() {
......@@ -964,7 +985,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
}, 5000);
} else if (mCmd.equals(ABookKeys.CMD_GET_GPS_INFO)) {
setLocation(true, (Integer.valueOf(abookCheckParam.get(ABookKeys.GPS_TYPE)) != 1));
// #32926 作業報告画面改善 start
setLocation((Integer.valueOf(abookCheckParam.get(ABookKeys.GPS_TYPE)) != 1), taskReportLevel);
// #32926 作業報告画面改善 end
} else if (mCmd.equals(ABookKeys.CMD_SCENE_REGIST)) {
String successFlg = abookCheckParam.get(ABookKeys.SUCCESS_FLG);
if(Integer.parseInt(successFlg) == 0) {
......@@ -1099,9 +1122,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
/**
* 位置情報取得
* @param isReport
* @param showPermissionDialogFlg
* @param taskReportLevel
*/
protected void setLocation(final boolean isReport, final boolean showPermissionDialogFlg) {
// #32926 作業報告画面改善 start
protected void setLocation(final boolean showPermissionDialogFlg, final int taskReportLevel) {
// #32926 作業報告画面改善 end
ABookPermissionHelper helper = new ABookPermissionHelper(this, Constant.ABookPermissionType.AccessFineLocation, null);
if (helper.checkMultiPermissions(showPermissionDialogFlg)) {
// 位置情報取得
......@@ -1109,7 +1135,10 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override
public void onGetLocationFailed() {
Logger.w(TAG, "onGetLocationFailed");
if (isReport) {
// #32926 作業報告画面改善 start
// 報告(回答)の場合
if (taskReportLevel > 0) {
// #32926 作業報告画面改善 end
afterABookCheckApi(mCmd, "", 1, getString(R.string.msg_location_search_fail), null);
}
}
......@@ -1122,7 +1151,10 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
CommonExecutor.execute(new Runnable() {
@Override
public void run() {
if (isReport) {
// #32926 作業報告画面改善 start
// 報告(回答)の場合
if (taskReportLevel > 0) {
// #32926 作業報告画面改善 end
JSONObject json = new JSONObject();
json.put("latitude", latitude);
json.put("longitude", longitude);
......@@ -1148,7 +1180,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
locationManagerUtil.startLocationService();
} else {
Logger.w(TAG,"onGetLocationFailed AccessFineLocation false");
if (isReport) {
if (taskReportLevel > 0) {
afterABookCheckApi(mCmd, "", 1, getString(R.string.msg_location_search_fail), null);
}
}
......
......@@ -1545,9 +1545,10 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
* @param reportFileName
* @param localSave
* @param addReport
* @param taskReportLevel
*/
// #32861 作業情報追加 start
public void startOZViewerActivity(Context context, long operationId, long contentId, String taskKey, boolean isReadOnly, int taskReportId, String reportStartDate, String reportFileName, boolean localSave, boolean addReport) {
public void startOZViewerActivity(Context context, long operationId, long contentId, String taskKey, boolean isReadOnly, int taskReportId, String reportStartDate, String reportFileName, boolean localSave, boolean addReport, int taskReportLevel) {
reportStartDate = reportStartDate.replace("T", " ");
String strReportStartDate = DateTimeUtil.toString(DateTimeUtil.toDate(reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen), DateTimeFormat.yyyyMMddHHmm_none);
......@@ -1565,6 +1566,9 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
intent.putExtra(ABookKeys.LOCAL_SAVE, localSave); // 一時保存情報
intent.putExtra(ABookKeys.ADD_REPORT, addReport); // 作業追加区分
// #32861 作業情報追加 end
// #32926 作業報告画面改善 start
intent.putExtra(ABookKeys.TASK_REPORT_LEVEL, taskReportLevel); // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答))
// #32926 作業報告画面改善 end
context.startActivity(intent);
}
......
......@@ -92,7 +92,7 @@ public class OzdFileHelper {
return REPORT_OZD_FILE_NAME;
}
public static final String getOzFilePath(long operationId, long contentId, String taskKey, boolean directionFlg, int taskReportId, String reportStartDate, String reportFileName) {
public static final String getOzFilePath(long operationId, long contentId, String taskKey, boolean directionFlg, int taskReportId, String reportStartDate, String reportFileName, int taskReportLevel) {
String ozdFileName = null;
String ozrFileName = null;
......@@ -100,13 +100,15 @@ public class OzdFileHelper {
ozdFileName = reportFileName;
ozrFileName = reportFileName;
} else {
if (directionFlg) {
// #32926 作業報告画面改善 start
if (taskReportLevel == 0) {
ozdFileName = DIRECTION_OZD_FILE_NAME;
ozrFileName = DIRECTION_OZR_FILE_NAME;
} else {
ozdFileName = REPORT_OZD_FILE_NAME;
ozrFileName = REPORT_OZR_FILE_NAME;
}
// #32926 作業報告画面改善 end
}
String ozFilePath = ABVEnvironment.getInstance().getTempFilePath(contentId, taskKey, ozdFileName);
......@@ -115,9 +117,11 @@ public class OzdFileHelper {
}
if (taskReportId > 0 && !StringUtil.isNullOrEmpty(reportStartDate)) {
ozFilePath = ABVEnvironment.getInstance().getRoutineTaskSavedOzFilePath(operationId, taskKey, taskReportId, reportStartDate, ozdFileName);
ozFilePath = ABVEnvironment.getInstance().getRoutineTaskSavedOzFilePath(operationId, taskKey, taskReportId, reportStartDate, ozdFileName, String.valueOf(taskReportLevel));
} else {
ozFilePath = ABVEnvironment.getInstance().getSavedOzFilePath(operationId, taskKey, ozdFileName, directionFlg);
// #32926 作業報告画面改善 start
ozFilePath = ABVEnvironment.getInstance().getSavedOzFileTaskReportLevelPath(operationId, taskKey, ozdFileName, String.valueOf(taskReportLevel));
// #32926 作業報告画面改善 end
}
if (FileUtil.exists(ozFilePath)) {
return ozFilePath;
......
......@@ -74,6 +74,10 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
private String mSaveOzdTempFileName;
private String mSaveOzdFileName;
// #32926 作業報告画面改善 start
private int mTaskReportLevel; // 作業報告レベル
// #32926 作業報告画面改善 end
@Override
public void onCreate(Bundle savedInstanceState) {
Logger.i(TAG, "onCreate");
......@@ -92,6 +96,10 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
mReportStartDate = intent.getStringExtra(ABookKeys.REPORT_START_DATE);
mReportFileName = intent.getStringExtra(ABookKeys.REPORT_FILE_NAME);
// #32926 作業報告画面改善 start
mTaskReportLevel = intent.getIntExtra(ABookKeys.TASK_REPORT_LEVEL, 0); // 作業報告レベル
// #32926 作業報告画面改善 end
String frontTitle = "";
String rearTitle = "";
......@@ -163,7 +171,9 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
});
// #32861 作業情報追加 end
mOzFilePath = OzdFileHelper.getOzFilePath(mOperationId, contentId, mTaskKey, mDirectionFlg, mTaskReportId, mReportStartDate, mReportFileName);
// #32926 作業報告画面改善 start
mOzFilePath = OzdFileHelper.getOzFilePath(mOperationId, contentId, mTaskKey, mDirectionFlg, mTaskReportId, mReportStartDate, mReportFileName, mTaskReportLevel);
// #32926 作業報告画面改善 end
Logger.i(TAG,"********mOzFilePath = %s" + mOzFilePath);
if (mOzFilePath == null) {
......@@ -526,7 +536,9 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
StringBuilder param = new StringBuilder();
param.append("export.mode=silent#");
param.append("export.filename=" + FileUtil.getFilenameWithoutExt(mSaveOzdTempFileName) + "#");
param.append("export.path=" + OzdFileHelper.getTempTaskDirPath(contentId, mTaskKey) + "#");
// #32926 作業報告画面改善 start
param.append("export.path=" + OzdFileHelper.getTempTaskDirPath(contentId, mTaskKey) + "/" + mTaskReportLevel + "#");
// #32926 作業報告画面改善 end
param.append("export.confirmsave=false#");
param.append("export.format=ozd");
int result = mOzReportViewer.ScriptEx("save", param.toString(), "#");
......
......@@ -369,8 +369,12 @@ public class OperationTaskLayout extends RelativeLayout {
setLayoutParams(params);
} else {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH);
params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
// #32926 作業報告画面改善 start
// 作業報告画面を全画面に表示する
int screenWidth = displayMetrics.widthPixels;
params = createParam(screenWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
// #32926 作業報告画面改善 end
if (!StringUtil.isNullOrEmpty(taskKey)) {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
......
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