Commit 7e9d731c by Yujin Seo

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

報告で差戻が反映されない不具合を修正

See merge request !286
parents 612a724b 7e53583d
...@@ -79,7 +79,7 @@ public class ReportStatusDao extends AbstractDao { ...@@ -79,7 +79,7 @@ public class ReportStatusDao extends AbstractDao {
return sql; return sql;
} }
public List<ReportStatusDto> getUntouchedReport() { public List<ReportStatusDto> getNotStartedReport() {
StringBuilder sql = reportStatusSql(); StringBuilder sql = reportStatusSql();
sql.append("WHERE t_task_report_status.untouched_flg <> 0"); sql.append("WHERE t_task_report_status.untouched_flg <> 0");
return rawQueryGetDtoList(sql.toString(), new String[] {}, ReportStatusDto.class); return rawQueryGetDtoList(sql.toString(), new String[] {}, ReportStatusDto.class);
...@@ -238,7 +238,7 @@ public class ReportStatusDao extends AbstractDao { ...@@ -238,7 +238,7 @@ public class ReportStatusDao extends AbstractDao {
4:期限切れ、5:アラート、 4:期限切れ、5:アラート、
6:差し戻し、7:一時保存 6:差し戻し、7:一時保存
*/ */
list.add(makeDto(0, getUntouchedReport().size())); list.add(makeDto(0, getNotStartedReport().size()));
list.add(makeDto(1, getWorkingReport().size())); list.add(makeDto(1, getWorkingReport().size()));
list.add(makeDto(2, getCompleteOkReport().size())); list.add(makeDto(2, getCompleteOkReport().size()));
list.add(makeDto(3, getCompleteNgReport().size())); list.add(makeDto(3, getCompleteNgReport().size()));
......
...@@ -49,4 +49,53 @@ public class TaskReportDto extends AbstractDto { ...@@ -49,4 +49,53 @@ public class TaskReportDto extends AbstractDto {
public String[] getKeyValues() { public String[] getKeyValues() {
return new String[] { "" + taskKey }; return new String[] { "" + taskKey };
} }
public LockInfo getLockInfo() {
return new LockInfo(
reportLockUserId,
reportLockUserName,
reportLockTime
);
}
public static class LockInfo {
public final String reportLockUserId;
public final String reportLockUserName;
public final Date reportLockTime;
public LockInfo(
String reportLockUserId,
String reportLockUserName,
Date reportLockTime
) {
this.reportLockUserId = reportLockUserId;
this.reportLockUserName = reportLockUserName;
this.reportLockTime = reportLockTime == null ? null : new Date(reportLockTime.getTime());
}
}
public SendBackInfo getSendBackInfo() {
return new SendBackInfo(
sendBackUserId,
sendBackUserName,
sendBackComment
);
}
public static class SendBackInfo {
public final String sendBackUserId;
public final String sendBackUserName;
public final String sendBackComment;
public SendBackInfo(
String sendBackUserId,
String sendBackUserName,
String sendBackComment
) {
this.sendBackUserId = sendBackUserId;
this.sendBackUserName = sendBackComment;
this.sendBackComment = sendBackComment;
}
}
} }
...@@ -367,7 +367,21 @@ public class OperationLogic extends AbstractLogic { ...@@ -367,7 +367,21 @@ public class OperationLogic extends AbstractLogic {
* @param localSavedFlg * @param localSavedFlg
* @throws IOException * @throws IOException
*/ */
public void updateTaskReport(String taskKey, long operationId, long contentId, int taskReportLevel, int enableReport, JSONObject taskReportJson, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg, boolean localSavedFlg) throws IOException { public void updateTaskReport(
String taskKey,
long operationId,
long contentId,
int taskReportLevel,
int enableReport,
JSONObject taskReportJson,
String localAttachedFileName,
boolean attachedChangeFlag,
boolean dataSendFlg,
boolean localSavedFlg,
TaskReportDto.SendBackInfo sendBackInfo,
TaskReportDto.LockInfo lockInfo,
int taskStatus
) throws IOException {
TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey, taskReportLevel); TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey, taskReportLevel);
if (taskReportDto == null) { if (taskReportDto == null) {
//TODO error? //TODO error?
...@@ -398,6 +412,18 @@ public class OperationLogic extends AbstractLogic { ...@@ -398,6 +412,18 @@ public class OperationLogic extends AbstractLogic {
taskReportDto.localAttachedFileName = localAttachedFileName; taskReportDto.localAttachedFileName = localAttachedFileName;
} }
if (sendBackInfo != null) {
taskReportDto.sendBackUserId = sendBackInfo.sendBackUserId;
taskReportDto.sendBackUserName = sendBackInfo.sendBackUserName;
taskReportDto.sendBackComment = sendBackInfo.sendBackComment;
}
if (lockInfo != null) {
taskReportDto.reportLockUserId = lockInfo.reportLockUserId;
taskReportDto.reportLockUserName = lockInfo.reportLockUserName;
taskReportDto.reportLockTime = lockInfo.reportLockTime;
}
taskReportDto.taskStatus = taskStatus;
mTaskReportDao.update(taskReportDto); mTaskReportDao.update(taskReportDto);
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey); String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
......
...@@ -986,7 +986,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -986,7 +986,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// データを同期する fixme かなり邪道なことをしているので、非同期処理全体を整理する必要がある // データを同期する fixme かなり邪道なことをしているので、非同期処理全体を整理する必要がある
ActivityHandlingHelper helper = ActivityHandlingHelper.getInstance(); ActivityHandlingHelper helper = ActivityHandlingHelper.getInstance();
helper.getPreviousOperationListActivity().syncOperation(operationDto.operationId, operationDto.reportType, false); helper.getPreviousOperationListActivity().syncOperation(operationDto.operationId, operationDto.reportType, false);
ABVEnvironment env = ABVEnvironment.getInstance();
OperationLogic logic = AbstractLogic.getLogic(OperationLogic.class); OperationLogic logic = AbstractLogic.getLogic(OperationLogic.class);
try { try {
logic.createJsonForOperationContent(operationDto.operationId, mContentPath, operationDto.reportType == Constant.ReportType.RoutineTask); logic.createJsonForOperationContent(operationDto.operationId, mContentPath, operationDto.reportType == Constant.ReportType.RoutineTask);
......
...@@ -334,7 +334,7 @@ public class DashboardActivity extends OperationActivity { ...@@ -334,7 +334,7 @@ public class DashboardActivity extends OperationActivity {
List<ReportStatusDto> reports = null; List<ReportStatusDto> reports = null;
switch (reportStatusId) { switch (reportStatusId) {
case 0: { case 0: {
reports = dao.getUntouchedReport(); reports = dao.getNotStartedReport();
break; break;
} }
case 1: { case 1: {
......
...@@ -1056,9 +1056,21 @@ public class OperationListActivity extends OperationActivity { ...@@ -1056,9 +1056,21 @@ public class OperationListActivity extends OperationActivity {
} else { } else {
// 更新 // 更新
// jsonDataが空で入る場合、taskReportJsonをnullで登録 // jsonDataが空で入る場合、taskReportJsonをnullで登録
mOperationLogic.updateTaskReport(serverTaskDto.taskKey, operationId, operationContentDto.contentId, mOperationLogic.updateTaskReport(
serverTaskReportDto.taskReportLevel, serverTaskReportDto.enableReport, serverTaskDto.taskKey,
taskReportJson, attachedFileName, false, false, localTaskReportDto.localSavedFlg); operationId,
operationContentDto.contentId,
serverTaskReportDto.taskReportLevel,
serverTaskReportDto.enableReport,
taskReportJson,
attachedFileName,
false,
false,
localTaskReportDto.localSavedFlg,
serverTaskReportDto.getSendBackInfo(),
serverTaskReportDto.getLockInfo(),
serverTaskReportDto.taskStatus
);
} }
} }
} }
......
...@@ -370,10 +370,35 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -370,10 +370,35 @@ public class ABookCheckWebViewHelper extends ABookHelper {
TaskReportDto taskReportDto = mOperationLogic.getTaskReport(taskKey, taskReportLevel); TaskReportDto taskReportDto = mOperationLogic.getTaskReport(taskKey, taskReportLevel);
if (taskReportDto != null) { if (taskReportDto != null) {
// 更新 // 更新
mOperationLogic.updateTaskReport(taskReportDto.taskKey, operationId, contentId, taskReportLevel, Constant.EnableEditReport.YES, taskReportJson, null, attachedChangeFlag, localSavedFlg ? false : true, localSavedFlg); mOperationLogic.updateTaskReport(
taskReportDto.taskKey,
operationId,
contentId,
taskReportLevel,
Constant.EnableEditReport.YES,
taskReportJson,
null,
attachedChangeFlag,
localSavedFlg ? false : true,
localSavedFlg,
taskReportDto.getSendBackInfo(),
taskReportDto.getLockInfo(),
taskReportDto.taskStatus
);
} else { } else {
// 登録 // 登録
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportLevel, Constant.EnableEditReport.YES, taskReportJson, null, attachedChangeFlag, localSavedFlg ? false : true, localSavedFlg); mOperationLogic.insertTaskReport(
taskKey,
operationId,
contentId,
taskReportLevel,
Constant.EnableEditReport.YES,
taskReportJson,
null,
attachedChangeFlag,
localSavedFlg ? false : true,
localSavedFlg
);
} }
mOperationLogic.createJsonForOperationContent(operationId, contentPath, false); mOperationLogic.createJsonForOperationContent(operationId, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel); copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
......
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