Commit 1237a499 by Kazuyuki Hida

ダッシュボードのロックが表示されない不具合に対応。

parent 980f4d72
......@@ -25,20 +25,28 @@ import java.util.Collections;
import java.util.Date;
import java.util.List;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters;
import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.common.nw.NetworkAdapter;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.OperationContentDao;
import jp.agentec.abook.abv.bl.data.dao.OperationDao;
import jp.agentec.abook.abv.bl.data.dao.ReportStatusDao;
import jp.agentec.abook.abv.bl.data.dao.TaskReportDao;
import jp.agentec.abook.abv.bl.download.ContentFileExtractor;
import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.OperationContentDto;
import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.ReportStatusDto;
import jp.agentec.abook.abv.bl.dto.TaskDto;
import jp.agentec.abook.abv.bl.dto.TaskReportDto;
import jp.agentec.abook.abv.bl.dto.comparator.ReportStatusCompalator;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.LockReportLogic;
......@@ -120,6 +128,7 @@ public class DashboardActivity extends OperationActivity {
protected void onResume() {
super.onResume();
try {
loadAllOperationTask();
ReportStatusLogic logic = new ReportStatusLogic();
logic.loadReportStatus();
getReportStatusCount();
......@@ -142,6 +151,36 @@ public class DashboardActivity extends OperationActivity {
mDashboardButton.setEnabled(false);
}
private void loadAllOperationTask() {
try {
String path = ABVDataCache.getInstance().getUrlPath();
NetworkAdapter networkAdapter = ABVEnvironment.getInstance().networkAdapter;
OperationDao operationDao = AbstractDao.getDao(OperationDao.class);
TaskReportDao taskReportDao = AbstractDao.getDao(TaskReportDao.class);
String sid = ABVDataCache.getInstance().getMemberInfo().sid;
for (OperationDto operation: operationDao.getAllOperation()) {
GetOperationDataParameters param = new GetOperationDataParameters(sid, operation.operationId);
OperationDataJSON json = AcmsClient.getInstance(path, networkAdapter).getOpereationData(param);
for (TaskDto task : json.taskDtoList) {
for (TaskReportDto report : task.taskReportDtoList) {
taskReportDao.updateReportLock(
report.taskKey,
(long) report.taskReportId,
report.reportStartDate,
report.reportStatus,
report.reportLockUserId,
report.reportLockUserName,
report.reportLockTime
);
}
}
}
} catch(Exception e) {
e.printStackTrace();
}
}
@SuppressLint("SetJavaScriptEnabled")
private void createWebView() {
webView = new CheckFormWebview(this, new CheckFormWebview.KeyActionCallback() {
......@@ -314,9 +353,9 @@ public class DashboardActivity extends OperationActivity {
break;
}
case CMD_UNLOCK_REPORT: {
String taskKey = json.getString(TaskKey);
long taskReportId = json.getLong(TaskReportId);
Date reportStartDate = getDateOrNull(json.getString(ReportStartDate));
String taskKey = json.has(TaskKey) ? json.getString(TaskKey) : "";
long taskReportId = json.has(TaskReportId) ? json.getLong(TaskReportId) : 0;
Date reportStartDate = json.has(ReportStartDate) ? getDateOrNull(json.getString(ReportStartDate)) : null;
unlockReport(taskKey, taskReportId, reportStartDate);
break;
}
......
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