Commit 3b6a2e99 by Kazuyuki Hida

文字列リテラルを文字列定数に置き換えた

parent 9638c11e
...@@ -45,6 +45,30 @@ public class OperationDataJSON extends AcmsCommonJSON { ...@@ -45,6 +45,30 @@ public class OperationDataJSON extends AcmsCommonJSON {
public static final String SendBackUserName = "sendBackUserName"; // 差し戻しユーザ名 差し戻された場合のみ public static final String SendBackUserName = "sendBackUserName"; // 差し戻しユーザ名 差し戻された場合のみ
public static final String SendBackComment = "sendBackComment"; // 確認コメント 差し戻された場合のみ public static final String SendBackComment = "sendBackComment"; // 確認コメント 差し戻された場合のみ
public static final String ReportStatus = "reportStatus";
/*
public String json() {
JSONObject extParam = new JSONObject();
extParam.put("", String.valueOf(reportStatus));
extParam.put("", reportLockUserId);
extParam.put("reportLockUserName", reportLockUserName);
extParam.put("reportLockTime", DateTimeUtil.formatDate(reportLockTime, DateTimeFormat.yyyyMMddHHmmssSSS_hyphen));
if (taskReportId != null && taskReportId != 0) {
extParam.put("taskReportId", taskReportId);
}
if (reportStartDate != null) {
extParam.put("reportStartDate", DateTimeUtil.formatDate(reportStartDate, DateTimeFormat.yyyyMMddHHmmssSSS_hyphen));
}
return extParam.toString();
}
*/
public List<TaskDto> taskDtoList; public List<TaskDto> taskDtoList;
public Date lastEditDate; public Date lastEditDate;
......
...@@ -13,6 +13,13 @@ import jp.agentec.adf.util.DateTimeFormat; ...@@ -13,6 +13,13 @@ import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
import static java.net.HttpURLConnection.HTTP_OK; import static java.net.HttpURLConnection.HTTP_OK;
import static jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON.ReportLockTime;
import static jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON.ReportLockUserId;
import static jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON.ReportLockUserName;
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.TaskReportId;
import static jp.agentec.abook.abv.bl.common.constant.ABookKeys.TASK_KEY;
public class LockReportLogic extends AbstractLogic { public class LockReportLogic extends AbstractLogic {
...@@ -21,11 +28,11 @@ public class LockReportLogic extends AbstractLogic { ...@@ -21,11 +28,11 @@ public class LockReportLogic extends AbstractLogic {
} }
public Result lock(Map<String, String> param) { public Result lock(Map<String, String> param) {
Long taskReportId = longOrNull(param.get("taskReportId")); Long taskReportId = longOrNull(param.get(TaskReportId));
Date reportStartDate = dateOrNull(param.get("reportStartDate")); Date reportStartDate = dateOrNull(param.get(ReportStartDate));
return sendLockReport( return sendLockReport(
param.get("taskKey"), param.get(TASK_KEY),
taskReportId, taskReportId,
reportStartDate reportStartDate
); );
...@@ -78,6 +85,7 @@ public class LockReportLogic extends AbstractLogic { ...@@ -78,6 +85,7 @@ public class LockReportLogic extends AbstractLogic {
// コールバック用のパラメータ // コールバック用のパラメータ
public static class Result { public static class Result {
public static final int BAD_STATUS = 999;
int result; int result;
String message; String message;
ExtParam extParam; ExtParam extParam;
...@@ -105,7 +113,7 @@ public class LockReportLogic extends AbstractLogic { ...@@ -105,7 +113,7 @@ public class LockReportLogic extends AbstractLogic {
result.result = 1; result.result = 1;
result.message = e.getLocalizedMessage(); result.message = e.getLocalizedMessage();
result.extParam = new ExtParam( result.extParam = new ExtParam(
999, BAD_STATUS,
null, null,
null, null,
null, null,
...@@ -187,16 +195,16 @@ public class LockReportLogic extends AbstractLogic { ...@@ -187,16 +195,16 @@ public class LockReportLogic extends AbstractLogic {
public String json() { public String json() {
JSONObject extParam = new JSONObject(); JSONObject extParam = new JSONObject();
extParam.put("reportStatus", String.valueOf(reportStatus)); extParam.put(ReportStatus, String.valueOf(reportStatus));
extParam.put("reportLockUserId", reportLockUserId); extParam.put(ReportLockUserId, reportLockUserId);
extParam.put("reportLockUserName", reportLockUserName); extParam.put(ReportLockUserName, reportLockUserName);
extParam.put("reportLockTime", DateTimeUtil.formatDate(reportLockTime, DateTimeFormat.yyyyMMddHHmmssSSS_hyphen)); extParam.put(ReportLockTime, DateTimeUtil.formatDate(reportLockTime, DateTimeFormat.yyyyMMddHHmmssSSS_hyphen));
if (taskReportId != null && taskReportId != 0) { if (taskReportId != null && taskReportId != 0) {
extParam.put("taskReportId", taskReportId); extParam.put(TaskReportId, taskReportId);
} }
if (reportStartDate != null) { if (reportStartDate != null) {
extParam.put("reportStartDate", DateTimeUtil.formatDate(reportStartDate, DateTimeFormat.yyyyMMddHHmmssSSS_hyphen)); extParam.put(ReportStartDate, DateTimeUtil.formatDate(reportStartDate, DateTimeFormat.yyyyMMddHHmmssSSS_hyphen));
} }
return extParam.toString(); return extParam.toString();
} }
......
...@@ -14,6 +14,10 @@ import jp.agentec.adf.util.DateTimeFormat; ...@@ -14,6 +14,10 @@ import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
import static java.net.HttpURLConnection.HTTP_OK; import static java.net.HttpURLConnection.HTTP_OK;
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;
import static jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON.TaskReportId;
public class UnlockReportLogic extends AbstractLogic { public class UnlockReportLogic extends AbstractLogic {
...@@ -22,11 +26,11 @@ public class UnlockReportLogic extends AbstractLogic { ...@@ -22,11 +26,11 @@ public class UnlockReportLogic extends AbstractLogic {
} }
public Result unlock(Map<String, String> param) { public Result unlock(Map<String, String> param) {
Long taskReportId = longOrNull(param.get("taskReportId")); Long taskReportId = longOrNull(param.get(TaskReportId));
Date reportStartDate = dateOrNull(param.get("reportStartDate")); Date reportStartDate = dateOrNull(param.get(ReportStartDate));
return sendUnlockReport( return sendUnlockReport(
param.get("taskKey"), param.get(TaskKey),
taskReportId, taskReportId,
reportStartDate reportStartDate
); );
...@@ -77,6 +81,7 @@ public class UnlockReportLogic extends AbstractLogic { ...@@ -77,6 +81,7 @@ public class UnlockReportLogic extends AbstractLogic {
// コールバック用のパラメータ // コールバック用のパラメータ
public static class Result { public static class Result {
public static final int BAD_STATUS = 999;
int result; int result;
String message; String message;
ExtParam extParam; ExtParam extParam;
...@@ -95,7 +100,7 @@ public class UnlockReportLogic extends AbstractLogic { ...@@ -95,7 +100,7 @@ public class UnlockReportLogic extends AbstractLogic {
Result result = new Result(); Result result = new Result();
result.result = 1; result.result = 1;
result.message = e.getLocalizedMessage(); result.message = e.getLocalizedMessage();
result.extParam = new ExtParam(999, taskReportId, reportStartDate); result.extParam = new ExtParam(BAD_STATUS, taskReportId, reportStartDate);
return result; return result;
} }
...@@ -138,12 +143,12 @@ public class UnlockReportLogic extends AbstractLogic { ...@@ -138,12 +143,12 @@ public class UnlockReportLogic extends AbstractLogic {
public String json() { public String json() {
JSONObject extParam = new JSONObject(); JSONObject extParam = new JSONObject();
extParam.put("reportStatus", String.valueOf(reportStatus)); extParam.put(ReportStatus, String.valueOf(reportStatus));
if (taskReportId != null && taskReportId != 0) { if (taskReportId != null && taskReportId != 0) {
extParam.put("taskReportId", taskReportId); extParam.put(TaskReportId, taskReportId);
} }
if (reportStartDate != null) { if (reportStartDate != null) {
extParam.put("reportStartDate", DateTimeUtil.formatDate(reportStartDate, DateTimeFormat.yyyyMMddHHmmssSSS_hyphen)); extParam.put(ReportStartDate, DateTimeUtil.formatDate(reportStartDate, DateTimeFormat.yyyyMMddHHmmssSSS_hyphen));
} }
return extParam.toString(); return extParam.toString();
} }
......
...@@ -85,6 +85,8 @@ import jp.agentec.adf.util.DateTimeUtil; ...@@ -85,6 +85,8 @@ import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil; import jp.agentec.adf.util.FileUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
import static jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON.ReportStartDate;
public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
private static final String TAG ="ABVContentViewActivity"; private static final String TAG ="ABVContentViewActivity";
...@@ -1082,7 +1084,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1082,7 +1084,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
TaskReportDao dao = AbstractDao.getDao(TaskReportDao.class); TaskReportDao dao = AbstractDao.getDao(TaskReportDao.class);
dao.updateReportLock( dao.updateReportLock(
mTaskKey, mTaskKey,
dateOrNull(abookCheckParam.get("reportStartDate")), dateOrNull(abookCheckParam.get(ReportStartDate)),
r.getExtParam().getReportStatus(), r.getExtParam().getReportStatus(),
r.getExtParam().getReportLockUserId(), r.getExtParam().getReportLockUserId(),
r.getExtParam().getReportLockUserName(), r.getExtParam().getReportLockUserName(),
...@@ -1102,7 +1104,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1102,7 +1104,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
TaskReportDao dao = AbstractDao.getDao(TaskReportDao.class); TaskReportDao dao = AbstractDao.getDao(TaskReportDao.class);
dao.updateReportLock( dao.updateReportLock(
mTaskKey, mTaskKey,
dateOrNull(abookCheckParam.get("reportStartDate")), dateOrNull(abookCheckParam.get(ReportStartDate)),
r.getExtParam().getReportStatus(), r.getExtParam().getReportStatus(),
null, null,
null, 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