Commit c3c89a45 by Yujin Seo

Merge branch 'feature/contract/sato/1.0.300_52488_lock' into 'contract/sato/1.0.300'

一時保存の作業を再度開いたときに、DBの内容をロックが成功した状態にしてしまっていたのを修正。

See merge request !306
parents 66104d4f 247309b2
......@@ -31,7 +31,7 @@ public class LockReportLogic extends AbstractLogic {
public Result lock(String taskKey, Long taskReportId, Date reportStartDate) {
Result r = sendLockReport(taskKey, taskReportId, reportStartDate);
if (r.result == 0) {
updateLocalDB(taskKey, taskReportId, reportStartDate, r.getExtParam().reportStatus);
updateLocalDB(taskKey, taskReportId, reportStartDate, r.getExtParam());
}
return r;
}
......@@ -69,18 +69,17 @@ public class LockReportLogic extends AbstractLogic {
String taskKey,
Long taskReportId,
Date reportStartDate,
int reportStatus
ExtParam extParam
) {
MemberInfoDto member = cache.getMemberInfo();
TaskReportDao dao = AbstractDao.getDao(TaskReportDao.class);
dao.updateReportLock(
taskKey,
taskReportId,
reportStartDate,
reportStatus,
member.loginId,
member.memberName,
new Date()
extParam.reportStatus,
extParam.reportLockUserId,
extParam.reportLockUserName,
extParam.reportLockTime
);
}
......@@ -94,16 +93,40 @@ public class LockReportLogic extends AbstractLogic {
static Result succsess(LockReportJSON reportJSON, Long taskReportId, Date reportStartDate) {
// 成功したとき
Result result = new Result();
result.result = reportJSON.httpStatus == HTTP_OK || reportJSON.httpStatus == HTTP_NOT_FOUND ? 0 : 1;
result.message = "";
result.extParam = new ExtParam(
reportJSON.httpStatus == HTTP_OK ? reportJSON.getReportStatus() : 0,
reportJSON.getReportLockUserId(),
reportJSON.getReportLockUserName(),
reportJSON.getReportLockTime(),
taskReportId,
reportStartDate
);
if (reportJSON.httpStatus == HTTP_OK) {
result.result = 0;
result.message = "";
result.extParam = new ExtParam(
reportJSON.getReportStatus(),
reportJSON.getReportLockUserId(),
reportJSON.getReportLockUserName(),
reportJSON.getReportLockTime(),
taskReportId,
reportStartDate
);
} else if (reportJSON.httpStatus == HTTP_NOT_FOUND) {
result.result = 0;
result.message = "";
result.extParam = new ExtParam(
0,
null,
null,
null,
taskReportId,
reportStartDate
);
} else {
result.result = 1;
result.message = "";
result.extParam = new ExtParam(
0,
null,
null,
null,
taskReportId,
reportStartDate
);
}
return result;
}
......
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