Commit 3a339c8a by Lee Jaebin

バグ修正

parent 13df0a46
...@@ -136,7 +136,7 @@ public class ABVEnvironment { ...@@ -136,7 +136,7 @@ public class ABVEnvironment {
// 作業報告レベル(taskReportLevel)によってディレクトリを追加する // 作業報告レベル(taskReportLevel)によってディレクトリを追加する
public static final String TaskReportLevelDir = "/%s"; public static final String TaskReportLevelDir = "/%s";
public static final String SavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir; public static final String SavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir;
public static final String RoutineTaskSavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir + "/%d/%s/%s"; public static final String RoutineTaskSavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir + "/%s/%s";
public static final String OperationTaskKeyReportSendDirFormat = OperationTaskKeyDirFormat + "/reportSend/%d"; public static final String OperationTaskKeyReportSendDirFormat = OperationTaskKeyDirFormat + "/reportSend/%d";
public static final String OperationTaskKeyRoutineTaskReportDirFormat = OperationTaskKeyDirFormat + "/%d/%s/%s"; public static final String OperationTaskKeyRoutineTaskReportDirFormat = OperationTaskKeyDirFormat + "/%d/%s/%s";
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
...@@ -607,6 +607,7 @@ public class ABVEnvironment { ...@@ -607,6 +607,7 @@ public class ABVEnvironment {
/** /**
* 保存されたOZファイルパス、定期点検用 * 保存されたOZファイルパス、定期点検用
* 例)root/files/ABook/operation/[operation_id]/[task_key]/{taskReportLevel}/{taskReportId}/{reportStartDate}
* @param operationId * @param operationId
* @param taskKey * @param taskKey
* @param taskReportId * @param taskReportId
...@@ -615,9 +616,7 @@ public class ABVEnvironment { ...@@ -615,9 +616,7 @@ public class ABVEnvironment {
* @return * @return
*/ */
public String getRoutineTaskSavedOzFilePath(long operationId, String taskKey, int taskReportId, String reportStartDate, String fileName, String taskReportLevel) { public String getRoutineTaskSavedOzFilePath(long operationId, String taskKey, int taskReportId, String reportStartDate, String fileName, String taskReportLevel) {
// #32926 作業報告画面改善 start return String.format(RoutineTaskSavedOzFileFormat, rootDirectory, operationId, taskKey, taskReportLevel, taskReportId, reportStartDate, fileName);
return String.format(RoutineTaskSavedOzFileFormat, rootDirectory, operationId, taskKey, taskReportLevel, "report", taskReportId, reportStartDate, fileName);
// #32926 作業報告画面改善 end
} }
/** /**
......
...@@ -48,12 +48,15 @@ public class TaskDao extends AbstractDao { ...@@ -48,12 +48,15 @@ public class TaskDao extends AbstractDao {
if (column != -1) { if (column != -1) {
dto.delFlg = toBool(cursor.getInt(column)); dto.delFlg = toBool(cursor.getInt(column));
} }
// #32926 作業報告画面改善 start
column = cursor.getColumnIndex("task_has_Authority"); column = cursor.getColumnIndex("task_has_Authority");
if (column != -1) { if (column != -1) {
dto.taskHasAuthority = toBool(cursor.getInt(column)); dto.taskHasAuthority = toBool(cursor.getInt(column));
} }
// #32926 作業報告画面改善 end column = cursor.getColumnIndex("hotspot_changed_flg");
if (column != -1) {
dto.hotspotChangeFlg = toBool(cursor.getInt(column));
}
return dto; return dto;
} }
...@@ -76,9 +79,10 @@ public class TaskDao extends AbstractDao { ...@@ -76,9 +79,10 @@ public class TaskDao extends AbstractDao {
+ "operation_id, " + "operation_id, "
+ "task_code, " + "task_code, "
+ "task_status, " + "task_status, "
+ "task_hotspot_info) " + "task_hotspot_info, "
+ "hotspot_changed_flg) "
+ "values " + "values "
+ "(?,?,?,?,?,?)", + "(?,?,?,?,?,?,?)",
dto.getInsertValues()); dto.getInsertValues());
} }
...@@ -90,7 +94,8 @@ public class TaskDao extends AbstractDao { ...@@ -90,7 +94,8 @@ public class TaskDao extends AbstractDao {
+ "task_code=?, " + "task_code=?, "
+ "task_status=?, " + "task_status=?, "
+ "task_hotspot_info=?, " + "task_hotspot_info=?, "
+ "del_flg=?" + "del_flg=?, "
+ "hotspot_changed_flg=?"
+ "where task_key=?", + "where task_key=?",
dto.getUpdateValues()); dto.getUpdateValues());
return count > 0; return count > 0;
......
...@@ -210,6 +210,28 @@ public class TaskReportDao extends AbstractDao { ...@@ -210,6 +210,28 @@ public class TaskReportDao extends AbstractDao {
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class); return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class);
} }
/**
*
* @param operationId
* @param taskKey
* @return
*/
public List<TaskReportDto> getUpdateTargetHotSpotTaskData(Long operationId, String taskKey) {
StringBuilder sb = new StringBuilder();
sb.append(" select * ");
sb.append(" from t_task_report ttr ");
sb.append(" inner join ");
sb.append(" t_task tt ");
sb.append(" ON tt.task_key == ttr.task_key ");
sb.append(" WHERE tt.hotspot_changed_flg = 1");
sb.append(" AND tt.task_report_level = 0");
sb.append(" AND tt.operation_id = ?");
if (taskKey == null) {
sb.append(" AND ttr.task_key = ?");
}
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class);
}
/** /**
* 送信フラグがtrueのデータを取得 * 送信フラグがtrueのデータを取得
......
...@@ -128,6 +128,20 @@ public class TaskReportSendDao extends AbstractDao { ...@@ -128,6 +128,20 @@ public class TaskReportSendDao extends AbstractDao {
return rawQueryGetDtoList(sb.toString(), new String[]{ taskKey }, TaskReportSendDto.class); return rawQueryGetDtoList(sb.toString(), new String[]{ taskKey }, TaskReportSendDto.class);
} }
/**
* 送信可能なデータが存在するかチェック
* @param taskKey
* @return
*/
public boolean isNotExistSendableData(String taskKey) {
StringBuilder sb = new StringBuilder();
sb.append(" select count(task_report_send_id) ");
sb.append(" from t_task_report_send ");
sb.append(" where task_key = ? ");
sb.append(" order by task_report_send_id asc");
return rawQueryGetInt(sb.toString(), new String[]{ taskKey }) == 0;
}
public List<TaskReportSendDto> getSendableTaskReportSendData(String taskKey, int taskReportId, String reportStartDate) { public List<TaskReportSendDto> getSendableTaskReportSendData(String taskKey, int taskReportId, String reportStartDate) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(" select * "); sb.append(" select * ");
......
...@@ -29,6 +29,7 @@ public class TTask extends SQLiteTableScript { ...@@ -29,6 +29,7 @@ public class TTask extends SQLiteTableScript {
sql.append(" , task_status INTEGER "); sql.append(" , task_status INTEGER ");
sql.append(" , task_hotspot_info TEXT "); sql.append(" , task_hotspot_info TEXT ");
sql.append(" , del_flg BOOLEAN DEFAULT 0 "); sql.append(" , del_flg BOOLEAN DEFAULT 0 ");
sql.append(" , hotspot_changed_flg BOOLEAN DEFAULT 0 ");
sql.append(" , PRIMARY KEY (task_key) "); sql.append(" , PRIMARY KEY (task_key) ");
sql.append(" ) "); sql.append(" ) ");
ddl.add(sql.toString()); ddl.add(sql.toString());
......
...@@ -21,14 +21,16 @@ public class TaskDto extends AbstractDto { ...@@ -21,14 +21,16 @@ public class TaskDto extends AbstractDto {
public boolean taskHasAuthority; // タスク別の権限 public boolean taskHasAuthority; // タスク別の権限
public boolean hotspotChangeFlg;
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
return new Object[] { taskKey, taskId, operationId, taskCode, taskStatus, taskHotSpotInfo }; return new Object[] { taskKey, taskId, operationId, taskCode, taskStatus, taskHotSpotInfo, hotspotChangeFlg };
} }
@Override @Override
public Object[] getUpdateValues() { public Object[] getUpdateValues() {
return new Object[] { taskId, operationId, taskCode, taskStatus, taskHotSpotInfo, delFlg, taskKey }; return new Object[] { taskId, operationId, taskCode, taskStatus, taskHotSpotInfo, delFlg, hotspotChangeFlg, taskKey };
} }
@Override @Override
......
...@@ -694,11 +694,11 @@ public class OperationLogic extends AbstractLogic { ...@@ -694,11 +694,11 @@ public class OperationLogic extends AbstractLogic {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey); TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
// #32782 指示者テーブル関連削除 start // #32782 指示者テーブル関連削除 start
TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey, taskReportLevel); TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey, taskReportLevel);
taskReportDto.dataSendFlg = true;
JSONObject hotSpot = new JSONObject(taskDto.taskHotSpotInfo); JSONObject hotSpot = new JSONObject(taskDto.taskHotSpotInfo);
hotSpot.put("x", newX); hotSpot.put("x", newX);
hotSpot.put("y", newY); hotSpot.put("y", newY);
taskDto.taskHotSpotInfo = hotSpot.toString(); taskDto.taskHotSpotInfo = hotSpot.toString();
taskDto.hotspotChangeFlg = true;
mTaskReportDao.update(taskReportDto); mTaskReportDao.update(taskReportDto);
// #32782 指示者テーブル関連削除 end // #32782 指示者テーブル関連削除 end
mTaskDao.update(taskDto); mTaskDao.update(taskDto);
...@@ -1123,6 +1123,9 @@ public class OperationLogic extends AbstractLogic { ...@@ -1123,6 +1123,9 @@ public class OperationLogic extends AbstractLogic {
OperationDto operationDto = mOperationDao.getOperation(operationId); OperationDto operationDto = mOperationDao.getOperation(operationId);
List<TaskReportDto> taskReportDtoList = null; List<TaskReportDto> taskReportDtoList = null;
int maxProgress = 0; int maxProgress = 0;
// 作業担当レベルが0且つ、t_task_report_sendテーブルのデータが存在しない場合、
// ホットスポット変更フラグがtrueであれば、t_task_report_sendデータを登録する
updateHotspotChanged(operationId, taskKey);
if (taskKey == null) { if (taskKey == null) {
taskReportDtoList = mTaskReportDao.getSendableTaskData(operationId); taskReportDtoList = mTaskReportDao.getSendableTaskData(operationId);
maxProgress = 40; maxProgress = 40;
...@@ -1141,6 +1144,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1141,6 +1144,7 @@ public class OperationLogic extends AbstractLogic {
List<Integer> removeTaskReportSendIds = new ArrayList<Integer>(); List<Integer> removeTaskReportSendIds = new ArrayList<Integer>();
for (TaskReportDto taskReportDto : taskReportDtoList) { for (TaskReportDto taskReportDto : taskReportDtoList) {
List<TaskReportSendDto> taskReportSendDtoList; List<TaskReportSendDto> taskReportSendDtoList;
int lastTaskReportSendId; int lastTaskReportSendId;
if (operationDto.reportType == Constant.ReportType.RoutineTask) { if (operationDto.reportType == Constant.ReportType.RoutineTask) {
...@@ -1331,6 +1335,25 @@ public class OperationLogic extends AbstractLogic { ...@@ -1331,6 +1335,25 @@ public class OperationLogic extends AbstractLogic {
} }
/** /**
* ホットスポットのアップデートがあるが、sendテーブルに存在しない場合、登録
* @param operationId
* @param taskKey
* @throws IOException
*/
public void updateHotspotChanged(long operationId, String taskKey) throws IOException {
List<TaskReportDto> taskReportDtoList = mTaskReportDao.getUpdateTargetHotSpotTaskData(operationId, taskKey);
for (TaskReportDto taskReportDto : taskReportDtoList) {
if (mTaskReportSendDao.isNotExistSendableData(taskReportDto.taskKey)) {
insertTaskReportSend(taskReportDto.taskKey, taskReportDto.taskReportId, DateTimeUtil.toString(taskReportDto.reportStartDate,
DateTimeFormat.yyyyMMddHHmmss_hyphen), new JSONObject(taskReportDto.jsonData), false);
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskReportDto.taskKey);
taskDto.hotspotChangeFlg = false;
mTaskDao.update(taskDto);
}
}
}
/**
* 作業の添付ファイルのzip生成 * 作業の添付ファイルのzip生成
* @param operationId * @param operationId
* @param taskKey * @param taskKey
...@@ -1512,11 +1535,11 @@ public class OperationLogic extends AbstractLogic { ...@@ -1512,11 +1535,11 @@ public class OperationLogic extends AbstractLogic {
* @param taskKey * @param taskKey
* @param operationId * @param operationId
* @param hotSpotInfo * @param hotSpotInfo
* @param taskStatus
*/ */
public void registTaskData(String taskKey, Long operationId, String hotSpotInfo, Integer taskStatus, JSONObject taskJson) { public void registTaskData(String taskKey, Long operationId, String hotSpotInfo, JSONObject taskJson) {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey); TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
String taskCode = null; String taskCode = null;
Integer taskStatus = null;
if (taskJson != null) { if (taskJson != null) {
// 作業コード取得 // 作業コード取得
Iterator taskKeys = taskJson.keys(); Iterator taskKeys = taskJson.keys();
......

607 Bytes | W: | H:

488 Bytes | W: | H:

ABVJE_Res_Default_Android/res/drawable-xhdpi/ic_delete.png
ABVJE_Res_Default_Android/res/drawable-xhdpi/ic_delete.png
ABVJE_Res_Default_Android/res/drawable-xhdpi/ic_delete.png
ABVJE_Res_Default_Android/res/drawable-xhdpi/ic_delete.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:background="@drawable/ic_delete" /> android:background="@drawable/ic_ozd_delete" />
<Button <Button
android:id="@+id/btn_temp_save" android:id="@+id/btn_temp_save"
android:layout_width="30dp" android:layout_width="30dp"
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<TextView <TextView
android:id="@+id/operation_name" android:id="@+id/operation_name"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="2" android:maxLines="2"
...@@ -87,16 +87,14 @@ ...@@ -87,16 +87,14 @@
<TextView <TextView
android:id="@+id/operation_date" android:id="@+id/operation_date"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_weight="1"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="2"
android:text="@string/dummy_date" android:text="@string/dummy_date"
android:textColor="@color/operation_date" android:textColor="@color/operation_date"
android:textSize="@dimen/operation_normal_text_size" /> android:textSize="16sp" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -983,12 +983,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -983,12 +983,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} else if (mCmd.equals(ABookKeys.CMD_SAVE_ATTACHED)) { } else if (mCmd.equals(ABookKeys.CMD_SAVE_ATTACHED)) {
mAttachedFileName = abookCheckParam.get(ABookKeys.FILE_NAME); mAttachedFileName = abookCheckParam.get(ABookKeys.FILE_NAME);
getAttachedDataUrl(); getAttachedDataUrl();
} else if (mCmd.equals(ABookKeys.CMD_SHOW_DIRECTION_OZD)) {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, false, true, mReportFileName);
} else if (mCmd.equals(ABookKeys.CMD_PREVIEW_DIRECTION_OZD)) {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, true, mReportFileName);
} else if (mCmd.equals(ABookKeys.CMD_SHOW_REPORT_OZD)) { } else if (mCmd.equals(ABookKeys.CMD_SHOW_REPORT_OZD)) {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME); mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
// 作業報告画面改善 // 作業報告画面改善
......
...@@ -316,6 +316,8 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -316,6 +316,8 @@ public class OperationListActivity extends ABVUIActivity {
} }
} }
mAllOperationReportTypes = getOperationReportTypeList(true); mAllOperationReportTypes = getOperationReportTypeList(true);
// リスト更新
setOperationListView();
} }
// 共通資料画面表示 // 共通資料画面表示
...@@ -400,7 +402,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -400,7 +402,7 @@ public class OperationListActivity extends ABVUIActivity {
public void onResume() { public void onResume() {
Logger.i(TAG, "onResume:start"); Logger.i(TAG, "onResume:start");
super.onResume(); super.onResume();
setOperationListView(); refreshOperationList();
// 作業指示・報告からプロジェクト一覧へ戻った時の同期処理 // 作業指示・報告からプロジェクト一覧へ戻った時の同期処理
final long operationId = getUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, -1L); final long operationId = getUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, -1L);
if (operationId != -1) { if (operationId != -1) {
...@@ -807,7 +809,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -807,7 +809,7 @@ public class OperationListActivity extends ABVUIActivity {
public void onClickShowHelpView(View v) { public void onClickShowHelpView(View v) {
// if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) { // if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
showHelpViewDialog(Constant.HelpViewType.OperationListDirector); // showHelpViewDialog(Constant.HelpViewType.OperationListDirector);
// } else { // } else {
showHelpViewDialog(Constant.HelpViewType.OperationListReporter); showHelpViewDialog(Constant.HelpViewType.OperationListReporter);
// } // }
......
...@@ -16,6 +16,7 @@ import jp.agentec.abook.abv.bl.dto.OperationDto; ...@@ -16,6 +16,7 @@ import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil; import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.home.activity.OperationListActivity;
import jp.agentec.adf.util.DateTimeFormat; import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
...@@ -30,8 +31,8 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -30,8 +31,8 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
final private String TAG = "OperationPanelAdapter"; final private String TAG = "OperationPanelAdapter";
private Context mContext; private Context mContext;
private LayoutInflater mInflater; private LayoutInflater mInflater;
private final int padding;
private int categoryId; private int categoryId;
private boolean mNormalSizeFlg;
private OperationPanelAdapter.OperationListPanelAdapterListener mListener; private OperationPanelAdapter.OperationListPanelAdapterListener mListener;
...@@ -50,7 +51,7 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -50,7 +51,7 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
public OperationPanelAdapter(Context context, List<OperationDto> listItem) { public OperationPanelAdapter(Context context, List<OperationDto> listItem) {
this.mContext = context; this.mContext = context;
this.listItem = listItem; this.listItem = listItem;
padding = (int) (4f * mContext.getResources().getDisplayMetrics().density + 0.5f); mNormalSizeFlg = ((OperationListActivity)context).isNormalSize();
mInflater = (LayoutInflater) mContext.getSystemService(mContext.LAYOUT_INFLATER_SERVICE); mInflater = (LayoutInflater) mContext.getSystemService(mContext.LAYOUT_INFLATER_SERVICE);
} }
...@@ -130,7 +131,10 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -130,7 +131,10 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
R.string.msg_no_report_data, R.string.msg_no_report_data,
getUserPref(mContext, AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(mContext, AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
} else { } else {
holder.tvDate.setText(mContext.getString(R.string.date_label_routineTask) + " : " + operationDto.reportPeriod); // リソースパターンの適用
holder.tvDate.setText(PatternStringUtil.patternToString(mContext,
R.string.date_label_routineTask,
getUserPref(mContext, AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)) + " : " + (mNormalSizeFlg ? "\n" : "") + operationDto.reportPeriod);
} }
} else { } else {
// リソースパターンの適用 // リソースパターンの適用
......
...@@ -225,6 +225,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -225,6 +225,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
try { try {
mOperationLogic.updateTaskHotspot(operationTaskDto.taskKey, operationTaskDto.pdfX, operationTaskDto.pdfY, Constant.TaskReportLevel.ReportType); mOperationLogic.updateTaskHotspot(operationTaskDto.taskKey, operationTaskDto.pdfX, operationTaskDto.pdfY, Constant.TaskReportLevel.ReportType);
mOperationLogic.createHopSpotJson(operationId, contentPath); mOperationLogic.createHopSpotJson(operationId, contentPath);
} catch(IOException e){ } catch(IOException e){
e.printStackTrace(); e.printStackTrace();
} }
...@@ -325,14 +326,13 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -325,14 +326,13 @@ public class ABookCheckWebViewHelper extends ABookHelper {
} else { } else {
String hotSpotInfo = param.containsKey(ABookKeys.HOT_SPOT) ? param.get(ABookKeys.HOT_SPOT) : null; String hotSpotInfo = param.containsKey(ABookKeys.HOT_SPOT) ? param.get(ABookKeys.HOT_SPOT) : null;
Integer taskStatus = taskReportJson.has(ABookKeys.TASK_STATUS) ? taskReportJson.getInt(ABookKeys.TASK_STATUS) : null;
// 報告情報のjson取得後、登録・更新時に使用 // 報告情報のjson取得後、登録・更新時に使用
JSONObject taskJson = null; JSONObject taskJson = null;
if (taskReportJson.has("task")) { if (taskReportJson.has("task")) {
taskJson = taskReportJson.getJSONObject("task"); taskJson = taskReportJson.getJSONObject("task");
} }
// task登録・更新処理 // task登録・更新処理
mOperationLogic.registTaskData(taskKey, operationId, hotSpotInfo, taskStatus, taskJson); mOperationLogic.registTaskData(taskKey, operationId, hotSpotInfo, taskJson);
TaskReportDto taskReportDto = mOperationLogic.getTaskReport(taskKey, taskReportLevel); TaskReportDto taskReportDto = mOperationLogic.getTaskReport(taskKey, taskReportLevel);
if (taskReportDto != null) { if (taskReportDto != null) {
......
...@@ -1558,7 +1558,6 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -1558,7 +1558,6 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
intent.putExtra(ABookKeys.CONTENT_ID, contentId); intent.putExtra(ABookKeys.CONTENT_ID, contentId);
intent.putExtra(ABookKeys.TASK_KEY, taskKey); intent.putExtra(ABookKeys.TASK_KEY, taskKey);
intent.putExtra(ABookKeys.READ_ONLY_FLG, isReadOnly); intent.putExtra(ABookKeys.READ_ONLY_FLG, isReadOnly);
intent.putExtra(ABookKeys.DIRECTION_FLG, false);
intent.putExtra(ABookKeys.TASK_REPORT_ID, taskReportId); intent.putExtra(ABookKeys.TASK_REPORT_ID, taskReportId);
intent.putExtra(ABookKeys.REPORT_START_DATE, strReportStartDate); intent.putExtra(ABookKeys.REPORT_START_DATE, strReportStartDate);
intent.putExtra(ABookKeys.REPORT_FILE_NAME, reportFileName); intent.putExtra(ABookKeys.REPORT_FILE_NAME, reportFileName);
......
...@@ -143,8 +143,6 @@ public class OperationListHelper { ...@@ -143,8 +143,6 @@ public class OperationListHelper {
public void onItemClick(AdapterView<?> parent, View view, int position, long operationId) { public void onItemClick(AdapterView<?> parent, View view, int position, long operationId) {
OperationDto operationDto = (OperationDto) parent.getAdapter().getItem(position); OperationDto operationDto = (OperationDto) parent.getAdapter().getItem(position);
if (operationDto.contentId != null && operationDto.contentId != 0) { if (operationDto.contentId != null && operationDto.contentId != 0) {
//TODO テスト用のため、削除
ABVToastUtil.showMakeText(mAppActivity, "open operationId : " + operationId, Toast.LENGTH_LONG);
// 作業画面 // 作業画面
mAppActivity.openDirectionsOrReportView(operationDto); mAppActivity.openDirectionsOrReportView(operationDto);
} else { } else {
...@@ -153,8 +151,7 @@ public class OperationListHelper { ...@@ -153,8 +151,7 @@ public class OperationListHelper {
mAppActivity.showPanoEntryDialog(operationDto); mAppActivity.showPanoEntryDialog(operationDto);
} else { } else {
// 何もしない // 何もしない
//TODO テスト用のため、削除 Logger.e("not open target");
ABVToastUtil.showMakeText(mAppActivity, "何もしない", Toast.LENGTH_LONG);
} }
} }
} }
......
...@@ -85,18 +85,15 @@ public class OzdFileHelper { ...@@ -85,18 +85,15 @@ public class OzdFileHelper {
// AcmsClient.getInstance(URL_PATH, ABVEnvironment.getInstance().networkAdapter).downloadOzdFile(parameters, outputFilePath); // AcmsClient.getInstance(URL_PATH, ABVEnvironment.getInstance().networkAdapter).downloadOzdFile(parameters, outputFilePath);
} }
public static final String getSaveOzFileName(boolean directionFlg, String reportFileName) { public static final String getSaveOzFileName(String reportFileName) {
if (reportFileName != null) { if (reportFileName != null) {
String replacedFileName = replaceFileName(reportFileName); String replacedFileName = replaceFileName(reportFileName);
return replacedFileName; return replacedFileName;
} }
if (directionFlg) {
return DIRECTION_OZD_FILE_NAME;
}
return REPORT_OZD_FILE_NAME; return REPORT_OZD_FILE_NAME;
} }
public static final String getOzFilePath(long operationId, long contentId, String taskKey, boolean directionFlg, int taskReportId, String reportStartDate, String reportFileName, int taskReportLevel) { public static final String getOzFilePath(long operationId, long contentId, String taskKey, int taskReportId, String reportStartDate, String reportFileName, int taskReportLevel) {
String ozdFileName = null; String ozdFileName = null;
String ozrFileName = null; String ozrFileName = null;
...@@ -104,16 +101,9 @@ public class OzdFileHelper { ...@@ -104,16 +101,9 @@ public class OzdFileHelper {
ozdFileName = reportFileName; ozdFileName = reportFileName;
ozrFileName = reportFileName; ozrFileName = reportFileName;
} else { } else {
// #32926 作業報告画面改善 start
if (taskReportLevel == 0) {
ozdFileName = DIRECTION_OZD_FILE_NAME;
ozrFileName = DIRECTION_OZR_FILE_NAME;
} else {
ozdFileName = REPORT_OZD_FILE_NAME; ozdFileName = REPORT_OZD_FILE_NAME;
ozrFileName = REPORT_OZR_FILE_NAME; ozrFileName = REPORT_OZR_FILE_NAME;
} }
// #32926 作業報告画面改善 end
}
String ozFilePath = ABVEnvironment.getInstance().getTempFilePath(contentId, taskKey, ozdFileName); String ozFilePath = ABVEnvironment.getInstance().getTempFilePath(contentId, taskKey, ozdFileName);
if (FileUtil.exists(ozFilePath)) { if (FileUtil.exists(ozFilePath)) {
......
...@@ -73,7 +73,6 @@ public class CheckOZDViewActivity extends ABVContentViewActivity { ...@@ -73,7 +73,6 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
private String mReportStartDate; private String mReportStartDate;
private String mReportFileName; private String mReportFileName;
private boolean mReadOnlyFlg; private boolean mReadOnlyFlg;
private boolean mDirectionFlg;
private String mOzFilePath; private String mOzFilePath;
private String mOzFileName; private String mOzFileName;
private String mSaveOzdTempFileName; private String mSaveOzdTempFileName;
...@@ -98,7 +97,6 @@ public class CheckOZDViewActivity extends ABVContentViewActivity { ...@@ -98,7 +97,6 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
mOperationId = intent.getLongExtra(ABookKeys.OPERATION_ID, -1); mOperationId = intent.getLongExtra(ABookKeys.OPERATION_ID, -1);
mTaskKey = intent.getStringExtra(ABookKeys.TASK_KEY); mTaskKey = intent.getStringExtra(ABookKeys.TASK_KEY);
mReadOnlyFlg = intent.getBooleanExtra(ABookKeys.READ_ONLY_FLG, false); mReadOnlyFlg = intent.getBooleanExtra(ABookKeys.READ_ONLY_FLG, false);
mDirectionFlg = intent.getBooleanExtra(ABookKeys.DIRECTION_FLG, false);
mTaskReportId = intent.getIntExtra(ABookKeys.TASK_REPORT_ID, 0); mTaskReportId = intent.getIntExtra(ABookKeys.TASK_REPORT_ID, 0);
mReportStartDate = intent.getStringExtra(ABookKeys.REPORT_START_DATE); mReportStartDate = intent.getStringExtra(ABookKeys.REPORT_START_DATE);
mReportFileName = intent.getStringExtra(ABookKeys.REPORT_FILE_NAME); mReportFileName = intent.getStringExtra(ABookKeys.REPORT_FILE_NAME);
...@@ -110,16 +108,17 @@ public class CheckOZDViewActivity extends ABVContentViewActivity { ...@@ -110,16 +108,17 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
String frontTitle = ""; String frontTitle = "";
String rearTitle = ""; String rearTitle = "";
if (mDirectionFlg) { // TODO リソース変更
// if (mDirectionFlg) {
// リソースパターンの適用 // リソースパターンの適用
frontTitle = PatternStringUtil.patternToString(getApplicationContext(), // frontTitle = PatternStringUtil.patternToString(getApplicationContext(),
R.string.title_operation_direction_form, // R.string.title_operation_direction_form,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)); // getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
} else { // } else {
frontTitle = PatternStringUtil.patternToString(getApplicationContext(), frontTitle = PatternStringUtil.patternToString(getApplicationContext(),
R.string.title_operation_report_form, R.string.title_operation_report_form,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
} // }
if (mReadOnlyFlg) { if (mReadOnlyFlg) {
// リソースパターンの適用 // リソースパターンの適用
...@@ -218,9 +217,7 @@ public class CheckOZDViewActivity extends ABVContentViewActivity { ...@@ -218,9 +217,7 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
} }
}); });
// #32926 作業報告画面改善 start mOzFilePath = OzdFileHelper.getOzFilePath(mOperationId, contentId, mTaskKey, mTaskReportId, mReportStartDate, mReportFileName, mTaskReportLevel);
mOzFilePath = OzdFileHelper.getOzFilePath(mOperationId, contentId, mTaskKey, mDirectionFlg, mTaskReportId, mReportStartDate, mReportFileName, mTaskReportLevel);
// #32926 作業報告画面改善 end
Logger.i(TAG,"********mOzFilePath = %s" + mOzFilePath); Logger.i(TAG,"********mOzFilePath = %s" + mOzFilePath);
if (mOzFilePath == null) { if (mOzFilePath == null) {
...@@ -230,7 +227,7 @@ public class CheckOZDViewActivity extends ABVContentViewActivity { ...@@ -230,7 +227,7 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
File file = new File(mOzFilePath); File file = new File(mOzFilePath);
mOzFileName = file.getName(); mOzFileName = file.getName();
mSaveOzdFileName = OzdFileHelper.getSaveOzFileName(mDirectionFlg, mReportFileName); mSaveOzdFileName = OzdFileHelper.getSaveOzFileName(mReportFileName);
mSaveOzdTempFileName = FileUtil.getFilenameWithoutExt(mSaveOzdFileName) + "_tmp.ozd"; mSaveOzdTempFileName = FileUtil.getFilenameWithoutExt(mSaveOzdFileName) + "_tmp.ozd";
if (!loadOzdDocument(file)) { if (!loadOzdDocument(file)) {
ABVToastUtil.showMakeText(this, "OZD Load Fail", Toast.LENGTH_LONG); ABVToastUtil.showMakeText(this, "OZD Load Fail", Toast.LENGTH_LONG);
......
...@@ -270,7 +270,15 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -270,7 +270,15 @@ public class OperationTaskLayout extends RelativeLayout {
} }
} }
private boolean isTaskFinished(String taskKey) { /**
* 作業キーでステータスを取得
* @param taskKey
* @return
*/
public boolean isTaskFinished(String taskKey) {
if (mTaskDao.getTaskByTaskKey(taskKey) == null) {
return false;
}
return mTaskDao.getTaskByTaskKey(taskKey).taskStatus == FINISHED_STATUS; return mTaskDao.getTaskByTaskKey(taskKey).taskStatus == FINISHED_STATUS;
} }
......
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