Commit c7d8013b by Kazuyuki Hida

一時保存の場合はロックしないようにした。

parent 768a103d
......@@ -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,10 +1107,16 @@ 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"));
// ロック
LockReportLogic.Result r = LockReportLogic.newInstance().lock(taskKey, taskReportId, startDate);
// JSコールバック
afterABookCheckApi(mCmd, mTaskKey, r.getResult(), r.getMessage(), r.getExtParam().json());
TaskReportDao dao = AbstractDao.getDao(TaskReportDao.class);
if (dao.isLocalSaved(mTaskKey, taskReportId, DateTimeUtil.toString(startDate, DateTimeFormat.yyyyMMddHHmmss_hyphen))) {
// ローカルにしかない場合はロックしない
afterABookCheckApi(mCmd, mTaskKey, 0, "", null);
} 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"));
......
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