luowei 1 年之前
父节点
当前提交
641f4416c9

+ 14 - 6
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/controller/ResumptionReportController.java

@@ -60,10 +60,18 @@ public class ResumptionReportController {
         ajaxResult.put("title", "报警测试报表(" + resumptionDTO.getSearchTime() + ")");
         return ajaxResult;
     }
-//    @ApiOperation(value = "备用电源维护报表")
-//    @RequiresPermissions("core:resumptionReport:list")
-//    @GetMapping("/standbyPower")
-//    public AjaxResult standbyPower(ResumptionDTO resumptionDTO) {
-//
-//    }
+    @ApiOperation(value = "备用电源维护报表")
+    @RequiresPermissions("core:resumptionReport:list")
+    @GetMapping("/standbyPower")
+    public AjaxResult standbyPower(ResumptionDTO resumptionDTO) {
+        if (null == resumptionDTO.getSearchTime()) {
+            LocalDate currentDate = LocalDate.now();
+            resumptionDTO.setSearchTime(currentDate.getYear()+"-"+currentDate.getMonthValue());
+        }
+        AjaxResult ajaxResult = AjaxResult.success();
+        List<IntrusionTestReportVO> intrusionTestReportVOList = resumptionReportService.standbyPower(resumptionDTO);
+        ajaxResult.put(AjaxResult.DATA_TAG, intrusionTestReportVOList);
+        ajaxResult.put("title", "备用电源维护报表(" + resumptionDTO.getSearchTime() + ")");
+        return ajaxResult;
+    }
 }

+ 8 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/service/impl/ResumptionReportServiceImpl.java

@@ -164,7 +164,14 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             } else {
                 sysOrg1 = orgService.selectOrgById(orgService.selectOrgById(o.getParentId(), SecurityConstants.INNER).getParentId(), SecurityConstants.INNER);
             }
+            IntrusionTestReportVO intrusionTestReportVO1 = resumptionReportMapper.selectStandbyPower(resumptionDTO.getSearchTime(), o.getPath());
+            BeanUtils.copyProperties(intrusionTestReportVO1, intrusionTestReportVO);
+            intrusionTestReportVO.setCity(sysOrg1.getShortName().split("地区行社")[0]);
+            intrusionTestReportVO.setOrgName(o.getShortName());
+            Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(o.getPath());
+            intrusionTestReportVO.setNetworkNumber(integer);
+            intrusionTestReportVOList.add(intrusionTestReportVO);
         });
-        return null;
+        return intrusionTestReportVOList;
     }
 }

+ 33 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/ResumptionReportMapper.xml

@@ -83,6 +83,38 @@
     </select>
     <select id="selectStandbyPower"
             resultType="com.xunmei.core.reportForms.resumption.vo.IntrusionTestReportVO">
-
+        SELECT
+            IFNULL( a.exception_count, 0 ) AS abnormalNumber,
+            COUNT( a.id ) AS planNumber,
+            IFNULL( SUM( IF ( a.`status` = 3, 1, 0 )), 0 ) AS realityNumber,
+            IF
+                (
+                            IFNULL( SUM( IF ( a.`status` = 3, 1, 0 )), 0 )= 0
+                        OR COUNT( a.id )= 0,
+                            '0%',
+                            CONCAT(
+                                            IFNULL( SUM( IF ( a.`status` = 3, 1, 0 )), 0 )/ COUNT( a.id )* 100,
+                                            '%'
+                                )) AS realityRate,
+            COUNT( c.id ) AS realityRectificationNumber,
+            IF
+                (
+                            COUNT( c.id )= 0
+                        OR IFNULL( a.exception_count, 0 )= 0,
+                            '0%',
+                            CONCAT( COUNT( c.id )/ IFNULL( a.exception_count, 0 )* 100, '%' )) AS realityRectificationRate
+        FROM
+            core_resumption a
+                LEFT JOIN core_resumption_plan b ON a.plan_id = b.id
+                LEFT JOIN core_question c ON c.src_task_id = a.id
+                AND reform_status = 11
+        WHERE
+            b.plan_type =5
+        <if test="date !=null">
+            AND a.ymd_date like concat(#{date},'%')
+        </if>
+        <if test="orgPath !=null">
+            and a.org_path  like concat(#{orgPath},'%')
+        </if>
     </select>
 </mapper>