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