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,7 +47,6 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService { | ||
| 47 | if(null == companyId || companyId == 0L || companyId == 100L){ | 47 | if(null == companyId || companyId == 0L || companyId == 100L){ |
| 48 | companyId = null; | 48 | companyId = null; |
| 49 | } | 49 | } |
| 50 | - Map<String, Object> respMap = new HashMap<>(); | ||
| 51 | Long finalCompanyId = companyId; | 50 | Long finalCompanyId = companyId; |
| 52 | // 巡查计划、已完成、未完成 | 51 | // 巡查计划、已完成、未完成 |
| 53 | Map<String, Object> countInspectionPlan = countInspectionPlanByCompanyId(finalCompanyId); | 52 | Map<String, Object> countInspectionPlan = countInspectionPlanByCompanyId(finalCompanyId); |
| @@ -58,7 +57,8 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService { | @@ -58,7 +57,8 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService { | ||
| 58 | // 已完成工单 有效工单、无效工单 | 57 | // 已完成工单 有效工单、无效工单 |
| 59 | Map<String, Object> countCompletedWorkOrder = countCompletedWorkOrder(finalCompanyId); | 58 | Map<String, Object> countCompletedWorkOrder = countCompletedWorkOrder(finalCompanyId); |
| 60 | 59 | ||
| 61 | - // 等待所有查询完成 | 60 | + |
| 61 | + Map<String, Object> respMap = new HashMap<>(); | ||
| 62 | respMap.put("inspectionPlan", countInspectionPlan); | 62 | respMap.put("inspectionPlan", countInspectionPlan); |
| 63 | respMap.put("maintainPlan", countMaintainPlan); | 63 | respMap.put("maintainPlan", countMaintainPlan); |
| 64 | respMap.put("inProgressWorkOrder", countInProgressWorkOrder); | 64 | respMap.put("inProgressWorkOrder", countInProgressWorkOrder); |
| @@ -602,17 +602,17 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService { | @@ -602,17 +602,17 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService { | ||
| 602 | // 2. 初始化响应Map并设置默认空字符串 | 602 | // 2. 初始化响应Map并设置默认空字符串 |
| 603 | Map<String, Object> respMap = new HashMap<>(); | 603 | Map<String, Object> respMap = new HashMap<>(); |
| 604 | for (String type : queryTypes) { | 604 | for (String type : queryTypes) { |
| 605 | - respMap.put(type, "0"); | 605 | + respMap.put(type, 0); |
| 606 | } | 606 | } |
| 607 | Integer sumTotalCount = 0; | 607 | Integer sumTotalCount = 0; |
| 608 | List<Map<String, String>> orderMap = homepageSummaryMapper.countCompletedWorkOrder(companyId); | 608 | List<Map<String, String>> orderMap = homepageSummaryMapper.countCompletedWorkOrder(companyId); |
| 609 | if (ObjectUtil.isNotEmpty(orderMap)) { | 609 | if (ObjectUtil.isNotEmpty(orderMap)) { |
| 610 | for (Map<String, String> mapItem : orderMap) { | 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 | String totalCount = String.valueOf(mapItem.get("totalCount")); | 613 | String totalCount = String.valueOf(mapItem.get("totalCount")); |
| 614 | if (ObjectUtil.isNotEmpty(totalCount)) { | 614 | if (ObjectUtil.isNotEmpty(totalCount)) { |
| 615 | - respMap.put(busiLine, totalCount); | 615 | + respMap.put(workStatus, Integer.parseInt(totalCount)); |
| 616 | sumTotalCount = sumTotalCount + Integer.parseInt(totalCount); | 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,7 +14,7 @@ | ||
| 14 | <where> | 14 | <where> |
| 15 | t.deleted = 0 | 15 | t.deleted = 0 |
| 16 | <if test="companyId != null"> | 16 | <if test="companyId != null"> |
| 17 | - AND t.worker_company_id = #{companyId} | 17 | + AND t.company_id = #{companyId} |
| 18 | </if> | 18 | </if> |
| 19 | </where> | 19 | </where> |
| 20 | </select> | 20 | </select> |
| @@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
| 31 | <where> | 31 | <where> |
| 32 | t.deleted = 0 | 32 | t.deleted = 0 |
| 33 | <if test="companyId != null"> | 33 | <if test="companyId != null"> |
| 34 | - AND t.worker_company_id = #{companyId} | 34 | + AND t.company_id = #{companyId} |
| 35 | </if> | 35 | </if> |
| 36 | </where> | 36 | </where> |
| 37 | </select> | 37 | </select> |