Commit 768a103d by Kazuyuki Hida

報告送信時に一覧の状況毎の件数表示が更新されるようにした。

parent dc23f949
......@@ -65,6 +65,9 @@ import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil;
import jp.agentec.adf.util.StringUtil;
import static jp.agentec.abook.abv.bl.acms.client.json.OperationListJSON.OperationEndDate;
import static jp.agentec.abook.abv.bl.acms.client.json.OperationListJSON.OperationStartDate;
/**
* Created by leej on 2018/08/17.
*/
......@@ -976,9 +979,14 @@ public class OperationLogic extends AbstractLogic {
if (operationDto.reportType == Constant.ReportType.ReportReply) {
editJson.put(ABookKeys.HAS_AUTHORITY, dto.enableReport);
editJson.put(ABookKeys.LOCAL_SAVE_FLG, dto.localSavedFlg);
// ロックと差戻情報の追加
addLockSendBackInfo(editJson, dto);
taskReportJsonList.add(editJson);
} else {
taskReportJsonList.add(new JSONObject(dto.jsonData));
editJson = new JSONObject(dto.jsonData);
// ロックと差戻情報の追加
addLockSendBackInfo(editJson, dto);
taskReportJsonList.add(editJson);
}
} else {
JSONObject emptyTaskReportJson = new JSONObject();
......@@ -987,6 +995,8 @@ public class OperationLogic extends AbstractLogic {
emptyTaskReportJson.put(ABookKeys.HAS_AUTHORITY, dto.enableReport);
emptyTaskReportJson.put(ABookKeys.LOCAL_SAVE_FLG, dto.localSavedFlg);
}
// ロックと差戻情報の追加
addLockSendBackInfo(emptyTaskReportJson, dto);
taskReportJsonList.add(emptyTaskReportJson);
}
// 最後の時、taskReport_{level}でセット
......@@ -994,7 +1004,8 @@ public class OperationLogic extends AbstractLogic {
taskReportJson.put(String.format("taskReport_%s", String.valueOf(level)), taskReportJsonList);
}
}
taskReportJson.put(OperationStartDate, DateTimeUtil.toString(operationDto.operationStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen));
taskReportJson.put(OperationEndDate, DateTimeUtil.toString(operationDto.operationEndDate, DateTimeFormat.yyyyMMddHHmmss_hyphen));
// データが存在しない場合、
if (taskReportDtoList.size() <= 0 || taskReportJson.length() == 0) {
......@@ -1008,6 +1019,24 @@ public class OperationLogic extends AbstractLogic {
}
/**
* ロックと差戻情報の追加
*
* @param json 格納するJSON
* @param dto もとになる報告書
* @return
*/
private void addLockSendBackInfo(JSONObject json, TaskReportDto dto) {
json.put(OperationDataJSON.TaskStatus, dto.taskStatus);
json.put(OperationDataJSON.ReportLockUserId, dto.reportLockUserId);
json.put(OperationDataJSON.ReportLockUserName, dto.reportLockUserName);
json.put(OperationDataJSON.ReportLockTime, dto.reportLockTime);
json.put(OperationDataJSON.SendBackUserId, dto.sendBackUserId);
json.put(OperationDataJSON.SendBackUserName, dto.sendBackUserName);
json.put(OperationDataJSON.SendBackComment, dto.sendBackComment);
}
/**
* 営業日変更時間と報告日時をチェックし、営業日変更時間が過ぎた場合、報告表示しないように処理
* @param jsonObject 報告回答のJson文字列
* @return true: 報告非表示、false:報告表示
......@@ -1101,9 +1130,15 @@ public class OperationLogic extends AbstractLogic {
taskReportInfoList.add(new JSONObject(dto.jsonData));
}
taskReportJsonRow.put(ABookKeys.TASK_REPORT_INFO, taskReportInfoList);
// ロックと差戻の情報を追加
addLockSendBackInfo(taskReportJsonRow, dto);
taskReportJsonList.add(taskReportJsonRow);
}
taskReportJsonRoot.put(ABookKeys.ENABLE_REPORT_UPDATE, mOperationDao.getOperation(operationId).enableReportUpdate);
OperationDto operationDto = mOperationDao.getOperation(operationId);
taskReportJsonRoot.put(ABookKeys.ENABLE_REPORT_UPDATE, operationDto.enableReportUpdate);
taskReportJsonRoot.put(OperationStartDate, DateTimeUtil.toString(operationDto.operationStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen));
taskReportJsonRoot.put(OperationEndDate, DateTimeUtil.toString(operationDto.operationEndDate, DateTimeFormat.yyyyMMddHHmmss_hyphen));
// 最後のtaskReportId
TaskReportDto lastRoutineTaskReportDto = mTaskReportDao.getLastRoutineTaskReportData(operationId);
taskReportJsonRoot.put(ABookKeys.TASK_REPORT_ID, lastRoutineTaskReportDto.taskReportId);
......
......@@ -29,6 +29,7 @@ import org.json.adf.JSONObject;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
......@@ -36,7 +37,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import java.util.concurrent.ConcurrentHashMap;
import jp.agentec.abook.abv.bl.acms.type.OperationType;
......@@ -88,7 +88,6 @@ import jp.agentec.adf.util.FileUtil;
import jp.agentec.adf.util.StringUtil;
import static jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON.Message;
import static jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON.ReportStartDate;
import static jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON.ReportStatus;
import static jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON.TaskKey;
......@@ -873,7 +872,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
showHelpViewDialog(helpViewType);
}
public void commonShouldOverrideUrlLoading (Uri uri, OperationTaskDto operationTaskDto) {
public void commonShouldOverrideUrlLoading (Uri uri, final OperationTaskDto operationTaskDto) {
//parent method
Map<String, String> abookCheckParam = new HashMap<String, String>();
for (String key : uri.getQueryParameterNames()) {
......@@ -982,6 +981,17 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
return null;
}
if (mCmd.equals(ABookKeys.CMD_INSERT_TASK_REPORT) || mCmd.equals(ABookKeys.CMD_UPDATE_TASK_REPORT)) {
// データを同期する fixme かなり邪道なことをしているので、非同期処理全体を整理する必要がある
ActivityHandlingHelper helper = ActivityHandlingHelper.getInstance();
helper.getPreviousOperationListActivity().syncOperation(operationDto.operationId, operationDto.reportType, false);
ABVEnvironment env = ABVEnvironment.getInstance();
OperationLogic logic = AbstractLogic.getLogic(OperationLogic.class);
try {
logic.createJsonForOperationContent(operationDto.operationId, mContentPath, operationDto.reportType == Constant.ReportType.RoutineTask);
} catch (IOException e) {
e.printStackTrace();
}
// コールバック
ReportStatusLogic.TaskReportExtParam extParam = ReportStatusLogic.TaskReportExtParam.pick();
JSONObject extJson = new JSONObject();
if (extParam != null) {
......
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