Commit 737a1a48 by Kazuyuki Hida

ロック関係の実装を変更する前にいったんコミット

parent 1bb6e002
...@@ -37,6 +37,8 @@ public class ABookKeys { ...@@ -37,6 +37,8 @@ public class ABookKeys {
public static final String CMD_LOCK_REPORT = "lockReport"; public static final String CMD_LOCK_REPORT = "lockReport";
public static final String CMD_UNLOCK_REPORT = "unlockReport"; public static final String CMD_UNLOCK_REPORT = "unlockReport";
public static final String CMD_GET_REPORT_LIST = "getReportList"; public static final String CMD_GET_REPORT_LIST = "getReportList";
public static final String CMD_GET_REPORT_STATUS_COUNT = "getReportStatusCount";
public static final String CMD_GO_REPORT_DETAIL = "goReportDetail";
public static final String GPS_TYPE = "gpsType"; public static final String GPS_TYPE = "gpsType";
public static final String STATUS_CODE = "statusCode"; public static final String STATUS_CODE = "statusCode";
......
...@@ -27,12 +27,17 @@ import jp.agentec.abook.abv.bl.common.constant.ABookKeys; ...@@ -27,12 +27,17 @@ 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.log.Logger;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao; import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ReportStatusDao; import jp.agentec.abook.abv.bl.data.dao.ReportStatusDao;
import jp.agentec.abook.abv.bl.data.dao.TaskReportDao;
import jp.agentec.abook.abv.bl.dto.ReportStatusDto; import jp.agentec.abook.abv.bl.dto.ReportStatusDto;
import jp.agentec.abook.abv.bl.logic.LockReportLogic;
import jp.agentec.abook.abv.bl.logic.UnlockReportLogic;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.viewer.view.CheckFormWebview; import jp.agentec.abook.abv.ui.viewer.view.CheckFormWebview;
import static jp.agentec.abook.abv.bl.common.constant.ABookCommConstants.DASHBOARD_URL; import static jp.agentec.abook.abv.bl.common.constant.ABookCommConstants.DASHBOARD_URL;
import static jp.agentec.abook.abv.bl.common.constant.ABookKeys.CMD_GET_REPORT_LIST; import static jp.agentec.abook.abv.bl.common.constant.ABookKeys.CMD_GET_REPORT_LIST;
import static jp.agentec.abook.abv.bl.common.constant.ABookKeys.CMD_GET_REPORT_STATUS_COUNT;
import static jp.agentec.abook.abv.bl.common.constant.ABookKeys.CMD_GO_REPORT_DETAIL;
import static jp.agentec.abook.abv.bl.common.constant.ABookKeys.CMD_LOCK_REPORT; import static jp.agentec.abook.abv.bl.common.constant.ABookKeys.CMD_LOCK_REPORT;
import static jp.agentec.abook.abv.bl.common.constant.ABookKeys.CMD_UNLOCK_REPORT; import static jp.agentec.abook.abv.bl.common.constant.ABookKeys.CMD_UNLOCK_REPORT;
...@@ -52,7 +57,7 @@ public class DashboardActivity extends OperationActivity { ...@@ -52,7 +57,7 @@ public class DashboardActivity extends OperationActivity {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Logger.d(TAG, "ReloadUrl"); Logger.d(TAG, "ReloadUrl");
webView.loadUrl(DASHBOARD_URL + "&reload=true"); webView.loadUrl(DASHBOARD_URL);
} }
}); });
...@@ -210,20 +215,23 @@ public class DashboardActivity extends OperationActivity { ...@@ -210,20 +215,23 @@ public class DashboardActivity extends OperationActivity {
} }
private boolean checkApiLoding(Uri uri) { private boolean checkApiLoding(Uri uri) {
Map<String, String> abookCheckParam = new HashMap<>(); Map<String, String> param = new HashMap<>();
for (String key : uri.getQueryParameterNames()) { for (String key : uri.getQueryParameterNames()) {
abookCheckParam.put(key, uri.getQueryParameter(key)); param.put(key, uri.getQueryParameter(key));
} }
String cmd = abookCheckParam.get(ABookKeys.CMD); String cmd = param.get(ABookKeys.CMD);
if (cmd == null) { if (cmd == null) {
return false; return false;
} }
switch (cmd) { switch (cmd) {
case CMD_GET_REPORT_STATUS_COUNT: {
return getReportStatusCount();
}
case CMD_GET_REPORT_LIST: { case CMD_GET_REPORT_LIST: {
try { try {
String reportStatusId = abookCheckParam.get("reportStatusId"); String reportStatusId = param.get("reportStatusId");
if (reportStatusId != null) { if (reportStatusId != null) {
return getReportList(Integer.parseInt(reportStatusId)); return getReportList(Integer.parseInt(reportStatusId));
} else { } else {
...@@ -234,16 +242,25 @@ public class DashboardActivity extends OperationActivity { ...@@ -234,16 +242,25 @@ public class DashboardActivity extends OperationActivity {
return false; return false;
} }
} }
case CMD_GO_REPORT_DETAIL: {
break;
}
case CMD_LOCK_REPORT: { case CMD_LOCK_REPORT: {
return lockReport(); return lockReport(param);
} }
case CMD_UNLOCK_REPORT: { case CMD_UNLOCK_REPORT: {
return unlockReport(); return unlockReport(param);
} }
} }
return false; return false;
} }
private boolean getReportStatusCount() {
//todo
return false;
}
private boolean getReportList(int reportStatusId) { private boolean getReportList(int reportStatusId) {
ReportStatusDao dao = AbstractDao.getDao(ReportStatusDao.class); ReportStatusDao dao = AbstractDao.getDao(ReportStatusDao.class);
List<ReportStatusDto> reports = null; List<ReportStatusDto> reports = null;
...@@ -282,9 +299,8 @@ public class DashboardActivity extends OperationActivity { ...@@ -282,9 +299,8 @@ public class DashboardActivity extends OperationActivity {
} }
if (reports != null) { if (reports != null) {
JSONObject param = makeReportTree(reportStatusId, reports); JSONObject param = makeReportTree(reportStatusId, reports);
String response = "javascript:CHK_Dashboard.reportListCallback(" + reportStatusId + "," + param.toString() + ")";
webView.loadUrl(response);
return true; return true;
} else { } else {
return false; return false;
...@@ -342,13 +358,54 @@ public class DashboardActivity extends OperationActivity { ...@@ -342,13 +358,54 @@ public class DashboardActivity extends OperationActivity {
} }
} }
private boolean lockReport() { private boolean goReportDetail() {
//todo //todo
return false;
}
private boolean lockReport(Map<String, String> param) {
// LockReportLogic.Result r = LockReportLogic.newInstance().lock(param);
// ローカルDBに反映
// TaskReportDao dao = AbstractDao.getDao(TaskReportDao.class);
// dao.updateReportLock(
// mTaskKey,
// dateOrNull(param.get("reportStartDate")),
// r.getExtParam().getReportStatus(),
// r.getExtParam().getReportLockUserId(),
// r.getExtParam().getReportLockUserName(),
// r.getExtParam().getReportLockTime()
// );
// JSコールバック
// afterABookCheckApi(
// mCmd,
// mTaskKey,
// r.getResult(),
// r.getMessage(),
// r.getExtParam().json()
// );
return true; return true;
} }
private boolean unlockReport() { private boolean unlockReport(Map<String, String> param) {
//todo // UnlockReportLogic.Result r = UnlockReportLogic.newInstance().unlock(param);
// // ローカルDBに反映
// TaskReportDao dao = AbstractDao.getDao(TaskReportDao.class);
// dao.updateReportLock(
// mTaskKey,
// dateOrNull(param.get("reportStartDate")),
// r.getExtParam().getReportStatus(),
// null,
// null,
// null
// );
// // JSコールバック
// afterABookCheckApi(
// mCmd,
// mTaskKey,
// r.getResult(),
// r.getMessage(),
// r.getExtParam().json()
// );
return true; return true;
} }
} }
...@@ -96,7 +96,7 @@ hope_page=http://www.sato.co.jp ...@@ -96,7 +96,7 @@ hope_page=http://www.sato.co.jp
contact_email=grp-atform_support@sato-global.com contact_email=grp-atform_support@sato-global.com
#Log Settings #Log Settings
log_level=2 log_level=1
default_log_name=abvje default_log_name=abvje
#エラーレポート/Exportログ送信方法 1:acms 2:平文メール(開発・テスト時のみ) 3:暗号化添付メール #エラーレポート/Exportログ送信方法 1:acms 2:平文メール(開発・テスト時のみ) 3:暗号化添付メール
error_report_flg=1 error_report_flg=1
......
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