Commit bf21758e5f03a98bda14f8b96772e6a6f87af1d3
1 parent
9f88780a
首页统计接口修改
Showing
2 changed files
with
8 additions
and
8 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/homepage/MaintainSummaryServiceImpl.java
| ... | ... | @@ -47,7 +47,6 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService { |
| 47 | 47 | if(null == companyId || companyId == 0L || companyId == 100L){ |
| 48 | 48 | companyId = null; |
| 49 | 49 | } |
| 50 | - Map<String, Object> respMap = new HashMap<>(); | |
| 51 | 50 | Long finalCompanyId = companyId; |
| 52 | 51 | // 巡查计划、已完成、未完成 |
| 53 | 52 | Map<String, Object> countInspectionPlan = countInspectionPlanByCompanyId(finalCompanyId); |
| ... | ... | @@ -58,7 +57,8 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService { |
| 58 | 57 | // 已完成工单 有效工单、无效工单 |
| 59 | 58 | Map<String, Object> countCompletedWorkOrder = countCompletedWorkOrder(finalCompanyId); |
| 60 | 59 | |
| 61 | - // 等待所有查询完成 | |
| 60 | + | |
| 61 | + Map<String, Object> respMap = new HashMap<>(); | |
| 62 | 62 | respMap.put("inspectionPlan", countInspectionPlan); |
| 63 | 63 | respMap.put("maintainPlan", countMaintainPlan); |
| 64 | 64 | respMap.put("inProgressWorkOrder", countInProgressWorkOrder); |
| ... | ... | @@ -602,17 +602,17 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService { |
| 602 | 602 | // 2. 初始化响应Map并设置默认空字符串 |
| 603 | 603 | Map<String, Object> respMap = new HashMap<>(); |
| 604 | 604 | for (String type : queryTypes) { |
| 605 | - respMap.put(type, "0"); | |
| 605 | + respMap.put(type, 0); | |
| 606 | 606 | } |
| 607 | 607 | Integer sumTotalCount = 0; |
| 608 | 608 | List<Map<String, String>> orderMap = homepageSummaryMapper.countCompletedWorkOrder(companyId); |
| 609 | 609 | if (ObjectUtil.isNotEmpty(orderMap)) { |
| 610 | 610 | for (Map<String, String> mapItem : orderMap) { |
| 611 | - String busiLine = mapItem.get("validOrder"); | |
| 612 | - if (ObjectUtil.isNotEmpty(busiLine) && respMap.containsKey(busiLine)) { | |
| 611 | + String workStatus = mapItem.get("workorder_valid_status"); | |
| 612 | + if (ObjectUtil.isNotEmpty(workStatus) && respMap.containsKey(workStatus)) { | |
| 613 | 613 | String totalCount = String.valueOf(mapItem.get("totalCount")); |
| 614 | 614 | if (ObjectUtil.isNotEmpty(totalCount)) { |
| 615 | - respMap.put(busiLine, totalCount); | |
| 615 | + respMap.put(workStatus, Integer.parseInt(totalCount)); | |
| 616 | 616 | sumTotalCount = sumTotalCount + Integer.parseInt(totalCount); |
| 617 | 617 | } |
| 618 | 618 | } | ... | ... |
urbanops-module-garden/src/main/resources/mapper/homepage/HomepageSummaryMapper.xml
| ... | ... | @@ -14,7 +14,7 @@ |
| 14 | 14 | <where> |
| 15 | 15 | t.deleted = 0 |
| 16 | 16 | <if test="companyId != null"> |
| 17 | - AND t.worker_company_id = #{companyId} | |
| 17 | + AND t.company_id = #{companyId} | |
| 18 | 18 | </if> |
| 19 | 19 | </where> |
| 20 | 20 | </select> |
| ... | ... | @@ -31,7 +31,7 @@ |
| 31 | 31 | <where> |
| 32 | 32 | t.deleted = 0 |
| 33 | 33 | <if test="companyId != null"> |
| 34 | - AND t.worker_company_id = #{companyId} | |
| 34 | + AND t.company_id = #{companyId} | |
| 35 | 35 | </if> |
| 36 | 36 | </where> |
| 37 | 37 | </select> | ... | ... |