Commit dd279d72 by Yujin Seo

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

点検一覧の件数をリアルタイムで更新するようにした

See merge request !277
parents a334ecc8 768a103d
...@@ -65,6 +65,9 @@ import jp.agentec.adf.util.DateTimeUtil; ...@@ -65,6 +65,9 @@ import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil; import jp.agentec.adf.util.FileUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
import static jp.agentec.abook.abv.bl.acms.client.json.OperationListJSON.OperationEndDate;
import static jp.agentec.abook.abv.bl.acms.client.json.OperationListJSON.OperationStartDate;
/** /**
* Created by leej on 2018/08/17. * Created by leej on 2018/08/17.
*/ */
...@@ -976,9 +979,14 @@ public class OperationLogic extends AbstractLogic { ...@@ -976,9 +979,14 @@ public class OperationLogic extends AbstractLogic {
if (operationDto.reportType == Constant.ReportType.ReportReply) { if (operationDto.reportType == Constant.ReportType.ReportReply) {
editJson.put(ABookKeys.HAS_AUTHORITY, dto.enableReport); editJson.put(ABookKeys.HAS_AUTHORITY, dto.enableReport);
editJson.put(ABookKeys.LOCAL_SAVE_FLG, dto.localSavedFlg); editJson.put(ABookKeys.LOCAL_SAVE_FLG, dto.localSavedFlg);
// ロックと差戻情報の追加
addLockSendBackInfo(editJson, dto);
taskReportJsonList.add(editJson); taskReportJsonList.add(editJson);
} else { } else {
taskReportJsonList.add(new JSONObject(dto.jsonData)); editJson = new JSONObject(dto.jsonData);
// ロックと差戻情報の追加
addLockSendBackInfo(editJson, dto);
taskReportJsonList.add(editJson);
} }
} else { } else {
JSONObject emptyTaskReportJson = new JSONObject(); JSONObject emptyTaskReportJson = new JSONObject();
...@@ -987,6 +995,8 @@ public class OperationLogic extends AbstractLogic { ...@@ -987,6 +995,8 @@ public class OperationLogic extends AbstractLogic {
emptyTaskReportJson.put(ABookKeys.HAS_AUTHORITY, dto.enableReport); emptyTaskReportJson.put(ABookKeys.HAS_AUTHORITY, dto.enableReport);
emptyTaskReportJson.put(ABookKeys.LOCAL_SAVE_FLG, dto.localSavedFlg); emptyTaskReportJson.put(ABookKeys.LOCAL_SAVE_FLG, dto.localSavedFlg);
} }
// ロックと差戻情報の追加
addLockSendBackInfo(emptyTaskReportJson, dto);
taskReportJsonList.add(emptyTaskReportJson); taskReportJsonList.add(emptyTaskReportJson);
} }
// 最後の時、taskReport_{level}でセット // 最後の時、taskReport_{level}でセット
...@@ -994,7 +1004,8 @@ public class OperationLogic extends AbstractLogic { ...@@ -994,7 +1004,8 @@ public class OperationLogic extends AbstractLogic {
taskReportJson.put(String.format("taskReport_%s", String.valueOf(level)), taskReportJsonList); taskReportJson.put(String.format("taskReport_%s", String.valueOf(level)), taskReportJsonList);
} }
} }
taskReportJson.put(OperationStartDate, DateTimeUtil.toString(operationDto.operationStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen));
taskReportJson.put(OperationEndDate, DateTimeUtil.toString(operationDto.operationEndDate, DateTimeFormat.yyyyMMddHHmmss_hyphen));
// データが存在しない場合、 // データが存在しない場合、
if (taskReportDtoList.size() <= 0 || taskReportJson.length() == 0) { if (taskReportDtoList.size() <= 0 || taskReportJson.length() == 0) {
...@@ -1008,6 +1019,24 @@ public class OperationLogic extends AbstractLogic { ...@@ -1008,6 +1019,24 @@ public class OperationLogic extends AbstractLogic {
} }
/** /**
* ロックと差戻情報の追加
*
* @param json 格納するJSON
* @param dto もとになる報告書
* @return
*/
private void addLockSendBackInfo(JSONObject json, TaskReportDto dto) {
json.put(OperationDataJSON.TaskStatus, dto.taskStatus);
json.put(OperationDataJSON.ReportLockUserId, dto.reportLockUserId);
json.put(OperationDataJSON.ReportLockUserName, dto.reportLockUserName);
json.put(OperationDataJSON.ReportLockTime, dto.reportLockTime);
json.put(OperationDataJSON.SendBackUserId, dto.sendBackUserId);
json.put(OperationDataJSON.SendBackUserName, dto.sendBackUserName);
json.put(OperationDataJSON.SendBackComment, dto.sendBackComment);
}
/**
* 営業日変更時間と報告日時をチェックし、営業日変更時間が過ぎた場合、報告表示しないように処理 * 営業日変更時間と報告日時をチェックし、営業日変更時間が過ぎた場合、報告表示しないように処理
* @param jsonObject 報告回答のJson文字列 * @param jsonObject 報告回答のJson文字列
* @return true: 報告非表示、false:報告表示 * @return true: 報告非表示、false:報告表示
...@@ -1101,9 +1130,15 @@ public class OperationLogic extends AbstractLogic { ...@@ -1101,9 +1130,15 @@ public class OperationLogic extends AbstractLogic {
taskReportInfoList.add(new JSONObject(dto.jsonData)); taskReportInfoList.add(new JSONObject(dto.jsonData));
} }
taskReportJsonRow.put(ABookKeys.TASK_REPORT_INFO, taskReportInfoList); taskReportJsonRow.put(ABookKeys.TASK_REPORT_INFO, taskReportInfoList);
// ロックと差戻の情報を追加
addLockSendBackInfo(taskReportJsonRow, dto);
taskReportJsonList.add(taskReportJsonRow); taskReportJsonList.add(taskReportJsonRow);
} }
taskReportJsonRoot.put(ABookKeys.ENABLE_REPORT_UPDATE, mOperationDao.getOperation(operationId).enableReportUpdate); OperationDto operationDto = mOperationDao.getOperation(operationId);
taskReportJsonRoot.put(ABookKeys.ENABLE_REPORT_UPDATE, operationDto.enableReportUpdate);
taskReportJsonRoot.put(OperationStartDate, DateTimeUtil.toString(operationDto.operationStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen));
taskReportJsonRoot.put(OperationEndDate, DateTimeUtil.toString(operationDto.operationEndDate, DateTimeFormat.yyyyMMddHHmmss_hyphen));
// 最後のtaskReportId // 最後のtaskReportId
TaskReportDto lastRoutineTaskReportDto = mTaskReportDao.getLastRoutineTaskReportData(operationId); TaskReportDto lastRoutineTaskReportDto = mTaskReportDao.getLastRoutineTaskReportData(operationId);
taskReportJsonRoot.put(ABookKeys.TASK_REPORT_ID, lastRoutineTaskReportDto.taskReportId); taskReportJsonRoot.put(ABookKeys.TASK_REPORT_ID, lastRoutineTaskReportDto.taskReportId);
......
Subproject commit 39a8f243e91a4a70143ef6cfe7ba33807de9cdfb Subproject commit 65ba4f84e09897cbf524b7f266bcefb158448b33
...@@ -90,4 +90,8 @@ ...@@ -90,4 +90,8 @@
<color name="operation_bg">#FFFFFF</color> <color name="operation_bg">#FFFFFF</color>
<color name="bottom_toolbar">#F2F2F2</color> <color name="bottom_toolbar">#F2F2F2</color>
<color name="task_count_not_started">#e84c17</color>
<color name="task_count_working">#0080c6</color>
<color name="task_count_completed">#00b18a</color>
</resources> </resources>
\ No newline at end of file
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
android:textColor="@color/basic_white1" android:textColor="@color/basic_white1"
android:textSize="9pt" android:textSize="9pt"
android:gravity="center" android:gravity="center"
android:background="@color/marking_color_9" android:background="@color/task_count_not_started"
/> />
<TextView <TextView
android:id="@+id/report_count_working" android:id="@+id/report_count_working"
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
android:textColor="@color/basic_white1" android:textColor="@color/basic_white1"
android:textSize="9pt" android:textSize="9pt"
android:gravity="center" android:gravity="center"
android:background="@color/app_color" android:background="@color/task_count_working"
/> />
<TextView <TextView
android:id="@+id/report_count_completed" android:id="@+id/report_count_completed"
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
android:textColor="@color/basic_white1" android:textColor="@color/basic_white1"
android:textSize="9pt" android:textSize="9pt"
android:gravity="center" android:gravity="center"
android:background="@color/marking_color_8" android:background="@color/task_count_completed"
/> />
<LinearLayout <LinearLayout
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
android:textColor="@color/basic_white1" android:textColor="@color/basic_white1"
android:textSize="9pt" android:textSize="9pt"
android:gravity="center" android:gravity="center"
android:background="@color/marking_color_9" android:background="@color/task_count_not_started"
/> />
<TextView <TextView
android:id="@+id/report_count_working" android:id="@+id/report_count_working"
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
android:textColor="@color/basic_white1" android:textColor="@color/basic_white1"
android:textSize="9pt" android:textSize="9pt"
android:gravity="center" android:gravity="center"
android:background="@color/app_color" android:background="@color/task_count_working"
/> />
<TextView <TextView
android:id="@+id/report_count_completed" android:id="@+id/report_count_completed"
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
android:textColor="@color/basic_white1" android:textColor="@color/basic_white1"
android:textSize="9pt" android:textSize="9pt"
android:gravity="center" android:gravity="center"
android:background="@color/marking_color_8" android:background="@color/task_count_completed"
/> />
</LinearLayout> </LinearLayout>
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
android:textColor="@color/basic_white1" android:textColor="@color/basic_white1"
android:textSize="8pt" android:textSize="8pt"
android:gravity="center" android:gravity="center"
android:background="@color/marking_color_9" android:background="@color/task_count_not_started"
/> />
<TextView <TextView
android:id="@+id/report_count_working" android:id="@+id/report_count_working"
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
android:textColor="@color/basic_white1" android:textColor="@color/basic_white1"
android:textSize="8pt" android:textSize="8pt"
android:gravity="center" android:gravity="center"
android:background="@color/app_color" android:background="@color/task_count_working"
/> />
<TextView <TextView
android:id="@+id/report_count_completed" android:id="@+id/report_count_completed"
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
android:textColor="@color/basic_white1" android:textColor="@color/basic_white1"
android:textSize="8pt" android:textSize="8pt"
android:gravity="center" android:gravity="center"
android:background="@color/marking_color_8" android:background="@color/task_count_completed"
/> />
</LinearLayout> </LinearLayout>
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
android:textColor="@color/basic_white1" android:textColor="@color/basic_white1"
android:textSize="9pt" android:textSize="9pt"
android:gravity="center" android:gravity="center"
android:background="@color/marking_color_9" android:background="@color/task_count_not_started"
/> />
<TextView <TextView
android:id="@+id/report_count_working" android:id="@+id/report_count_working"
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
android:textColor="@color/basic_white1" android:textColor="@color/basic_white1"
android:textSize="9pt" android:textSize="9pt"
android:gravity="center" android:gravity="center"
android:background="@color/app_color" android:background="@color/task_count_working"
/> />
<TextView <TextView
android:id="@+id/report_count_completed" android:id="@+id/report_count_completed"
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
android:textColor="@color/basic_white1" android:textColor="@color/basic_white1"
android:textSize="9pt" android:textSize="9pt"
android:gravity="center" android:gravity="center"
android:background="@color/marking_color_8" android:background="@color/task_count_completed"
/> />
</LinearLayout> </LinearLayout>
......
...@@ -29,6 +29,7 @@ import org.json.adf.JSONObject; ...@@ -29,6 +29,7 @@ import org.json.adf.JSONObject;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
...@@ -36,7 +37,6 @@ import java.util.Iterator; ...@@ -36,7 +37,6 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.TimeZone;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import jp.agentec.abook.abv.bl.acms.type.OperationType; import jp.agentec.abook.abv.bl.acms.type.OperationType;
...@@ -88,7 +88,6 @@ import jp.agentec.adf.util.FileUtil; ...@@ -88,7 +88,6 @@ import jp.agentec.adf.util.FileUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
import static jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON.Message; import static jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON.Message;
import static jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON.ReportStartDate;
import static jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON.ReportStatus; import static jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON.ReportStatus;
import static jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON.TaskKey; import static jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON.TaskKey;
...@@ -873,7 +872,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -873,7 +872,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
showHelpViewDialog(helpViewType); showHelpViewDialog(helpViewType);
} }
public void commonShouldOverrideUrlLoading (Uri uri, OperationTaskDto operationTaskDto) { public void commonShouldOverrideUrlLoading (Uri uri, final OperationTaskDto operationTaskDto) {
//parent method //parent method
Map<String, String> abookCheckParam = new HashMap<String, String>(); Map<String, String> abookCheckParam = new HashMap<String, String>();
for (String key : uri.getQueryParameterNames()) { for (String key : uri.getQueryParameterNames()) {
...@@ -916,7 +915,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -916,7 +915,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
if (isOperationPdf && operationTaskDto != null && StringUtil.equalsAny(mCmd, if (isOperationPdf && operationTaskDto != null && StringUtil.equalsAny(mCmd,
ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_INSERT_TASK_REPORT,
ABookKeys.CMD_UPDATE_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT,
ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_MOVE_HOT_SPOT,
ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) { ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) {
...@@ -982,6 +981,17 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -982,6 +981,17 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
return null; return null;
} }
if (mCmd.equals(ABookKeys.CMD_INSERT_TASK_REPORT) || mCmd.equals(ABookKeys.CMD_UPDATE_TASK_REPORT)) { if (mCmd.equals(ABookKeys.CMD_INSERT_TASK_REPORT) || mCmd.equals(ABookKeys.CMD_UPDATE_TASK_REPORT)) {
// データを同期する fixme かなり邪道なことをしているので、非同期処理全体を整理する必要がある
ActivityHandlingHelper helper = ActivityHandlingHelper.getInstance();
helper.getPreviousOperationListActivity().syncOperation(operationDto.operationId, operationDto.reportType, false);
ABVEnvironment env = ABVEnvironment.getInstance();
OperationLogic logic = AbstractLogic.getLogic(OperationLogic.class);
try {
logic.createJsonForOperationContent(operationDto.operationId, mContentPath, operationDto.reportType == Constant.ReportType.RoutineTask);
} catch (IOException e) {
e.printStackTrace();
}
// コールバック
ReportStatusLogic.TaskReportExtParam extParam = ReportStatusLogic.TaskReportExtParam.pick(); ReportStatusLogic.TaskReportExtParam extParam = ReportStatusLogic.TaskReportExtParam.pick();
JSONObject extJson = new JSONObject(); JSONObject extJson = new JSONObject();
if (extParam != null) { if (extParam != null) {
......
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