Commit 3224b543 by Yujin Seo

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

一時保存時した報告のロック処理を修正

See merge request !278
parents dd279d72 c203b456
......@@ -495,7 +495,7 @@ public class TaskReportDao extends AbstractDao {
return rawQueryGetString("select local_attached_file_name from t_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?, 'utc')", new String[]{ taskKey, "" + taskReportId, reportStartDate });
}
public boolean isLocalSaved(String taskKey, int taskReportId, String reportStartDate) {
public boolean isLocalSaved(String taskKey, long taskReportId, String reportStartDate) {
int count;
StringBuilder sql = new StringBuilder();
sql.append("SELECT count(*) FROM t_task_report");
......
......@@ -47,6 +47,8 @@ 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.data.ABVDataCache;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
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.MydataDto;
......@@ -1105,19 +1107,30 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} else if (mCmd.equals(ABookKeys.CMD_LOCK_REPORT)) {
String taskKey = abookCheckParam.get(TaskKey);
Date startDate = dateOrNull(abookCheckParam.get("reportStartDate"));
TaskReportDao dao = AbstractDao.getDao(TaskReportDao.class);
if (dao.isLocalSaved(mTaskKey, taskReportId, DateTimeUtil.toString(startDate, DateTimeFormat.yyyyMMddHHmmss_hyphen))) {
// ローカルにしかない場合はロックしない
afterABookCheckApi(mCmd, mTaskKey, 0, "", "{'reportStatus':0}");
} else {
// ロック
LockReportLogic.Result r = LockReportLogic.newInstance().lock(taskKey, taskReportId, startDate);
// JSコールバック
afterABookCheckApi(mCmd, mTaskKey, r.getResult(), r.getMessage(), r.getExtParam().json());
}
} else if (mCmd.equals(ABookKeys.CMD_UNLOCK_REPORT)) {
String taskKey = abookCheckParam.get(TaskKey);
Date startDate = dateOrNull(abookCheckParam.get("reportStartDate"));
// アンロック
UnlockReportLogic.Result r = UnlockReportLogic.newInstance().unlock(taskKey, taskReportId, startDate);
// JSコールバック
if (r.getMessage().length() > 0) {
// アンロックの失敗は無視
afterABookCheckApi(mCmd, mTaskKey, 0, "", "{'reportStatus':0}");
} else {
afterABookCheckApi(mCmd, mTaskKey, r.getResult(), r.getMessage(), r.getExtParam().json());
}
}
}
/**
* 帳票コンポーネントが削除されたので、OZが使えなくなったので、エラーダイアログを表示する。
......
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