Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
A
abook_check
  • Overview
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • abook_android
  • abook_check
  • Merge Requests
  • !271

Merged
Opened Feb 02, 2023 by Kazuyuki Hida@hida-k 
  • Report abuse
Report abuse

件数表示周りの不具合の修正

本件は、@Formの作業の進捗がわかりやすいように、「未着手」「作業中」「完了」の件数表示を加え、また状況別に分類されたダッシュボードという画面を追加したことが大きなトピックです。

また、CMSに送らずに端末内に保存しておく、一時保存があり、それを加味した件数を表示する必要があります。

Edited Feb 06, 2023 by Kazuyuki Hida
  • Discussion 14
  • Commits 6
  • Changes 8
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Kazuyuki Hida @hida-k

    added 1 commit

    • f2844854 - 設定やメソッド名の修正

    Compare with previous version

    Feb 02, 2023

    added 1 commit

    • f2844854 - 設定やメソッド名の修正

    Compare with previous version

    added 1 commit * f2844854 - 設定やメソッド名の修正 [Compare with previous version](https://gitlab.agentec.jp/abook_android/abook_check/merge_requests/271/diffs?diff_id=10746&start_sha=4d3505cc77df21865eac33c83bf184a6cf455f83)
    Toggle commit list
  • Kazuyuki Hida @hida-k

    changed the description

    Feb 02, 2023

    changed the description

    changed the description
    Toggle commit list
  • Kazuyuki Hida
    @hida-k started a discussion on the diff Feb 02, 2023
    Resolved by Yujin Seo Feb 03, 2023
    ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/OperationDao.java
    594 Logger.e(TAG, e);
    595 }
    596 }
    597
    598 public void coutUpCompletedFromWorking(long operationId) {
    599 beginTransaction();
    600 try {
    601 execSql(decrementCount(operationId, "status_working_count"));
    602 execSql(incrementCount(operationId, "status_completed_count"));
    603 commit();
    604 } catch (Throwable e) {
    605 rollback();
    606 Logger.e(TAG, e);
    607 }
    608 }
    609 }
    • Kazuyuki Hida @hida-k commented Feb 02, 2023
      Developer

      「未着手」「作業中」「完了」の各件数は、t_operationのレコードに保持しているので、その件数を変更すメソッドを作りました。

      Edited Feb 03, 2023
      「未着手」「作業中」「完了」の各件数は、t_operationのレコードに保持しているので、その件数を変更すメソッドを作りました。
    Please register or sign in to reply
  • Kazuyuki Hida
    @hida-k started a discussion on the diff Feb 02, 2023
    Resolved by Yujin Seo Feb 03, 2023
    ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/TaskReportDao.java
    517 int count;
    518 StringBuilder sql = new StringBuilder();
    519 sql.append("SELECT count(*) FROM t_task_report");
    520 sql.append(" WHERE task_report_info_id > 0");
    521 if (reportStartDate == null) {
    522 // 報告
    523 sql.append(" AND task_key=?");
    524 count = rawQueryGetInt(sql.toString(), new String[] { taskKey });
    525 } else {
    526 // 点検
    527 sql.append(" AND task_report_id=?");
    528 sql.append(" AND datetime(report_start_date)=datetime(?, 'utc')");
    529 count = rawQueryGetInt(sql.toString(), new String[] { String.valueOf(taskReportId), reportStartDate });
    530 }
    531 return count > 0;
    532 }
    • Kazuyuki Hida @hida-k commented Feb 02, 2023
      Developer

      元の状態によって、件数の変更を行わないでよい場合(一時保存したものを一時保存するなど)を判別するためのメソッドです。

      Edited Feb 03, 2023
      元の状態によって、件数の変更を行わないでよい場合(一時保存したものを一時保存するなど)を判別するためのメソッドです。
    • Yujin Seo @seo commented Feb 03, 2023
      Developer

      あくまで意見ですけど、 存在だけのチェックならば「SELECT 1 FROM t_task_report ... LIMIT 1」が早いかと思います。

      Edited Feb 03, 2023
      あくまで意見ですけど、 存在だけのチェックならば「SELECT 1 FROM t_task_report ... LIMIT 1」が早いかと思います。
    Please register or sign in to reply
  • Kazuyuki Hida
    @hida-k started a discussion on the diff Feb 02, 2023
    Resolved by Yujin Seo Feb 03, 2023
    ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/WorkingReportDao.java 0 → 100644
    45 sql.append(" GROUP BY t_operation.operation_id");
    46
    47 List<WorkingReportDto> list = rawQueryGetDtoList(sql.toString(), null, WorkingReportDto.class);
    48
    49 Map<Long, Integer> map = new HashMap<Long, Integer>();
    50
    51 for (WorkingReportDto dto : list) {
    52 Long id = dto.getOperationId();
    53 Integer cnt = dto.getCount();
    54 if (id != null && cnt != null) {
    55 map.put(id, cnt);
    56 }
    57 }
    58 return map;
    59 }
    60 }
    • Kazuyuki Hida @hida-k commented Feb 02, 2023
      Developer

      Operation毎のlocal_saved_flgな報告件数を調べるためのDaoです。Logicの方がよいかもと今思いました。

      Edited Feb 03, 2023
      Operation毎のlocal_saved_flgな報告件数を調べるためのDaoです。Logicの方がよいかもと今思いました。
    Please register or sign in to reply
  • Kazuyuki Hida
    @hida-k started a discussion on the diff Feb 02, 2023
    Resolved by Yujin Seo Feb 03, 2023
    ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/WorkingReportDto.java 0 → 100644
    16 return new String[0];
    17 }
    18
    19 @Override
    20 public Object[] getInsertValues() {
    21 return new Object[0];
    22 }
    23
    24 public Long getOperationId() {
    25 return operationId;
    26 }
    27
    28 public Integer getCount() {
    29 return count;
    30 }
    31 }
    • Kazuyuki Hida @hida-k commented Feb 02, 2023
      Developer

      Operation毎のlocal_saved_flgな報告件数を保持するためのDtoです。

      Edited Feb 03, 2023
      Operation毎のlocal_saved_flgな報告件数を保持するためのDtoです。
    • Yujin Seo @seo commented Feb 03, 2023
      Developer

      あくまで意見ですけど、 AbstractDtoの継承は要らないと思います。

      Edited Feb 03, 2023
      あくまで意見ですけど、 `AbstractDto`の継承は要らないと思います。
    Please register or sign in to reply
  • Kazuyuki Hida
    @hida-k started a discussion on the diff Feb 02, 2023
    Resolved by Yujin Seo Feb 03, 2023
    ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
    1190 List<OperationDto> list = mOperationDao.getOperations(searchWord, searchStartDateStr, searchEndDateStr, reportTypeStr);
    1191 WorkingReportDao dao = AbstractDao.getDao(WorkingReportDao.class);
    1192
    1193 // ローカル保存している分を補正する
    1194 Map<Long, Integer> working = dao.getWorkingTaskReportCounts();
    1195 for (OperationDto dto : list) {
    1196 Integer workingCount = working.get(dto.operationId);
    1197 if (workingCount != null) {
    1198 if (dto.reportType == 1) {
    1199 // 定期点検の場合は、先にレポートが作られるので、その分を差し引く
    1200 dto.statusNotStartedCount -= workingCount;
    1201 }
    1202 dto.statusWorkingCount += workingCount;
    1203 }
    1204 }
    1205
    • Kazuyuki Hida @hida-k commented Feb 02, 2023
      Developer

      画面更新時に一時保存してある分の件数を補正しています。

      Edited Feb 03, 2023
      画面更新時に一時保存してある分の件数を補正しています。
    Please register or sign in to reply
  • Kazuyuki Hida
    @hida-k started a discussion on an old version of the diff Feb 02, 2023
    Resolved by Yujin Seo Feb 03, 2023
    ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/DashboardActivity.java
    261 262 try {
    262 263 switch (cmd) {
    263 264 case CMD_GET_REPORT_STATUS_COUNT: {
    265 countInitialized = true;
    264 266 return getReportStatusCount();
    265 267 }
    266 268 case CMD_GET_REPORT_LIST: {
    269 if (! countInitialized) {
    270 getReportStatusCount();
    271 }
    • Kazuyuki Hida @hida-k commented Feb 02, 2023
      Developer

      ダッシュボード画面で呼ばれるはずのコマンドが来ないので、ほかの最初の呼び出し時に実行するようにしました。

      Edited Feb 03, 2023
      ダッシュボード画面で呼ばれるはずのコマンドが来ないので、ほかの最初の呼び出し時に実行するようにしました。
    • Kazuyuki Hida @hida-k

      changed this line in version 4 of the diff

      Feb 06, 2023

      changed this line in version 4 of the diff

      changed this line in [version 4 of the diff](https://gitlab.agentec.jp/abook_android/abook_check/merge_requests/271/diffs?diff_id=10750&start_sha=f6eef9776b7d74441d3173b38135b4ac2f0c6159#45001f89e041784453b14a4a8da5bab8a92882c3_272_282)
      Toggle commit list
    Please register or sign in to reply
  • Kazuyuki Hida @hida-k

    added 1 commit

    • f6eef977 - フラグの切り換えを忘れていた。

    Compare with previous version

    Feb 02, 2023

    added 1 commit

    • f6eef977 - フラグの切り換えを忘れていた。

    Compare with previous version

    added 1 commit * f6eef977 - フラグの切り換えを忘れていた。 [Compare with previous version](https://gitlab.agentec.jp/abook_android/abook_check/merge_requests/271/diffs?diff_id=10747&start_sha=f28448547ff6df0310b0d2dec480c1cd96c698fb)
    Toggle commit list
  • Kazuyuki Hida
    @hida-k started a discussion on an old version of the diff Feb 02, 2023
    Resolved by Yujin Seo Feb 03, 2023
    ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/DashboardActivity.java
    301 307 }
    302 308
    303 309 private boolean getReportStatusCount() {
    304 //todo
    305 return false;
    310 ReportStatusDao dao = AbstractDao.getDao(ReportStatusDao.class);
    311 JSONObject extParam = dao.getReportStatusCountJson();
    312 afterABookCheckApi(CMD_GET_REPORT_STATUS_COUNT, "", 0,"", extParam.toString());
    313 return true;
    • Kazuyuki Hida @hida-k commented Feb 02, 2023
      Developer

      JavaScript側のコールバックを呼び出しています。

      Edited Feb 03, 2023
      JavaScript側のコールバックを呼び出しています。
    • Kazuyuki Hida @hida-k

      changed this line in version 4 of the diff

      Feb 06, 2023

      changed this line in version 4 of the diff

      changed this line in [version 4 of the diff](https://gitlab.agentec.jp/abook_android/abook_check/merge_requests/271/diffs?diff_id=10750&start_sha=f6eef9776b7d74441d3173b38135b4ac2f0c6159#45001f89e041784453b14a4a8da5bab8a92882c3_313_314)
      Toggle commit list
    Please register or sign in to reply
  • Kazuyuki Hida
    @hida-k started a discussion on the diff Feb 02, 2023
    Resolved by Yujin Seo Feb 03, 2023
    ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookCheckWebViewHelper.java
    89 95
    90 96 switch (cmd) {
    91 97 case ABookKeys.CMD_INSERT_TASK_REPORT:
    92 case ABookKeys.CMD_UPDATE_TASK_REPORT:
    98 case ABookKeys.CMD_UPDATE_TASK_REPORT: {
    99 // もとから作業中だったかを調べる
    100 TaskReportDao taskReportDao = AbstractDao.getDao(TaskReportDao.class);
    101 int rportId = Integer.parseInt(String.valueOf(param.getOrDefault(TaskReportId, "0")));
    102 String startDate = param.getOrDefault(ReportStartDate, null);
    103 boolean isLocalSaved = taskReportDao.isLocalSaved(taskKey, rportId, startDate);
    104 boolean isCompleted = taskReportDao.isCompleted(taskKey, rportId, startDate);
    105 // 報告書の更新
    • Kazuyuki Hida @hida-k commented Feb 02, 2023
      Developer

      元の状態を調べています。

      Edited Feb 03, 2023
      元の状態を調べています。
    Please register or sign in to reply
  • Kazuyuki Hida
    @hida-k started a discussion on the diff Feb 02, 2023
    Resolved by Yujin Seo Feb 03, 2023
    ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookCheckWebViewHelper.java
    100 TaskReportDao taskReportDao = AbstractDao.getDao(TaskReportDao.class);
    101 int rportId = Integer.parseInt(String.valueOf(param.getOrDefault(TaskReportId, "0")));
    102 String startDate = param.getOrDefault(ReportStartDate, null);
    103 boolean isLocalSaved = taskReportDao.isLocalSaved(taskKey, rportId, startDate);
    104 boolean isCompleted = taskReportDao.isCompleted(taskKey, rportId, startDate);
    105 // 報告書の更新
    93 106 insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, reportType, taskReportLevel, false);
    94 107 copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
    95 108 sendTaskData(context, operationId, taskKey, taskReportLevel);
    109 // 作業ステータスのカウントを変える
    110 OperationDao operationDao = AbstractDao.getDao(OperationDao.class);
    111 if (isLocalSaved) {
    112 operationDao.coutUpCompletedFromWorking(operationId);
    113 } else if (! isCompleted) {
    114 operationDao.countUpCompleted(operationId);
    115 }
    • Kazuyuki Hida @hida-k commented Feb 02, 2023
      Developer

      状態変化があったら件数を調整しています。

      Edited Feb 03, 2023
      状態変化があったら件数を調整しています。
    Please register or sign in to reply
  • Kazuyuki Hida
    @hida-k started a discussion on the diff Feb 02, 2023
    Resolved by Yujin Seo Feb 03, 2023
    ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookCheckWebViewHelper.java
    129 if (! isLocalSaved) {
    130 OperationDao operationDao = AbstractDao.getDao(OperationDao.class);
    131 operationDao.countUpWorking(operationId);
    132 }
    101 133 mFinishCallback.callback(false);
    102 134 break;
    103 case ABookKeys.CMD_DELETE_TASK_REPORT:
    135 case ABookKeys.CMD_DELETE_TASK_REPORT: {
    104 136 int taskReportId = 0;
    105 137 String reportStartDate = "";
    106 138 boolean sendTaskReportDataFlg = false;
    107 139
    108 140 if (reportType == Constant.ReportType.RoutineTask) {
    109 141 taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID));
    110 reportStartDate = param.get(ABookKeys.REPORT_START_DATE).replace("T", " ");
    142 reportStartDate = param.get(ABookKeys.REPORT_START_DATE);
    • Kazuyuki Hida @hida-k commented Feb 02, 2023
      Developer

      これは、SQLの変更で必要なくなった処理を削除しています。

      Edited Feb 03, 2023
      これは、SQLの変更で必要なくなった処理を削除しています。
    Please register or sign in to reply
  • Kazuyuki Hida @hida-k

    assigned to @seo

    Feb 02, 2023

    assigned to @seo

    assigned to @seo
    Toggle commit list
  • Kazuyuki Hida @hida-k

    unmarked as a Work In Progress

    Feb 02, 2023

    unmarked as a Work In Progress

    unmarked as a **Work In Progress**
    Toggle commit list
  • Yujin Seo
    @seo started a discussion on the diff Feb 03, 2023
    Resolved by Yujin Seo Feb 06, 2023
    ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/OperationDao.java
    554 StringBuilder sql = new StringBuilder();
    555
    556 sql.append("UPDATE t_operation ");
    557 sql.append(" SET ").append(column).append(" = (").append(column).append(" + 1)");
    558 sql.append(" WHERE operation_id = ").append(operationId);
    559
    560 return sql.toString();
    561 }
    562
    563 private String decrementCount(long operationId, String column) {
    564 StringBuilder sql = new StringBuilder();
    565
    566 sql.append("UPDATE t_operation ");
    567 sql.append(" SET ").append(column).append(" = (").append(column).append(" - 1)");
    568 sql.append(" WHERE operation_id = ").append(operationId);
    569 sql.append(" AND ").append(column).append(" > 0");
    • Yujin Seo @seo commented Feb 03, 2023
      Developer

      decrementCountだけに以下を入れた理由はありますか? append(column).append(" > 0")

      Edited Feb 06, 2023
      decrementCountだけに以下を入れた理由はありますか? append(column).append(" > 0")
    • Kazuyuki Hida @hida-k commented Feb 03, 2023
      Developer

      件数が負数になることはありえないので、ガードしています。

      ここで使う報告件数は、同期時に上書きされてしまうということと、ユーザが件数確認を補助する役割で、表示する以外では、ほかの機能に支障がないので、作業中になにか不審な動作をしても支障がないということで、このような方針にしました。

      Edited Feb 06, 2023
      件数が負数になることはありえないので、ガードしています。 ここで使う報告件数は、同期時に上書きされてしまうということと、ユーザが件数確認を補助する役割で、表示する以外では、ほかの機能に支障がないので、作業中になにか不審な動作をしても支障がないということで、このような方針にしました。
    Please register or sign in to reply
  • Kazuyuki Hida @hida-k

    marked as a Work In Progress

    Feb 03, 2023

    marked as a Work In Progress

    marked as a **Work In Progress**
    Toggle commit list
  • Yujin Seo @seo

    assigned to @hida-k

    Feb 03, 2023

    assigned to @hida-k

    assigned to @hida-k
    Toggle commit list
  • Kazuyuki Hida @hida-k

    changed the description

    Feb 03, 2023

    changed the description

    changed the description
    Toggle commit list
  • Kazuyuki Hida @hida-k

    assigned to @seo

    Feb 03, 2023

    assigned to @seo

    assigned to @seo
    Toggle commit list
  • Kazuyuki Hida @hida-k

    added 1 commit

    • f87bac92 - ダッシュボードの件数表示と一覧表示の不具合を修正

    Compare with previous version

    Feb 06, 2023

    added 1 commit

    • f87bac92 - ダッシュボードの件数表示と一覧表示の不具合を修正

    Compare with previous version

    added 1 commit * f87bac92 - ダッシュボードの件数表示と一覧表示の不具合を修正 [Compare with previous version](https://gitlab.agentec.jp/abook_android/abook_check/merge_requests/271/diffs?diff_id=10750&start_sha=f6eef9776b7d74441d3173b38135b4ac2f0c6159)
    Toggle commit list
  • Kazuyuki Hida @hida-k

    unmarked as a Work In Progress

    Feb 06, 2023

    unmarked as a Work In Progress

    unmarked as a **Work In Progress**
    Toggle commit list
  • Kazuyuki Hida @hida-k

    changed the description

    Feb 06, 2023

    changed the description

    changed the description
    Toggle commit list
  • Yujin Seo @seo

    resolved all discussions

    Feb 06, 2023

    resolved all discussions

    resolved all discussions
    Toggle commit list
  • Yujin Seo @seo

    merged

    Feb 06, 2023

    merged

    merged
    Toggle commit list
  • Yujin Seo @seo

    mentioned in commit 5887a91f

    Feb 06, 2023

    mentioned in commit 5887a91f

    mentioned in commit 5887a91fc6c088dafe31e79d36ecbca09f4d7d88
    Toggle commit list
  • Write
  • Preview
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 sign in to comment
Yujin Seo
Assignee
Yujin Seo @seo
Assign to
None
Milestone
None
Assign milestone
Time tracking
2
2 participants
Reference: abook_android/abook_check!271
×

Revert this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.
×

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.