Răsfoiți Sursa

Merge remote-tracking branch 'origin/V0.0.5' into V0.0.5

jingyuanchao 1 an în urmă
părinte
comite
3dead71acd

+ 4 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/service/impl/MonitorAccessReportServiceImpl.java

@@ -104,6 +104,9 @@ public class MonitorAccessReportServiceImpl implements MonitorAccessReportServic
         //判断机构类型,如果机构类型大于行社,都展示行社数据
         SysOrg sysOrg = remoteOrgService.selectSysOrgById(monitoringAccessDTO.getOrgId(), SecurityConstants.INNER);
         List<SysOrg> sysOrgs;
+        if (null==sysOrg.getType()){
+            return Collections.emptyList();
+        }
         if (sysOrg.getType() < 3 || sysOrg.getShortName().endsWith("地区行社") || sysOrg.getType() == 9) {
             sysOrgs = remoteOrgService.selectSysOrgByPathAndType(sysOrg.getPath(), 3, SecurityConstants.INNER);
         } else if (sysOrg.getType() == 3) {
@@ -129,8 +132,8 @@ public class MonitorAccessReportServiceImpl implements MonitorAccessReportServic
             Long orgId=monitoringAccessDTO.getOrgId();
             monitoringAccessDTO.setOrgId(null);
             MonitoringAccessVO monitoringAccessVO1 = monitorAccessReportMapper.selectAll(monitoringAccessDTO);
-            monitoringAccessDTO.setOrgId(orgId);
             String avg = monitorAccessReportMapper.avg(monitoringAccessDTO);
+            monitoringAccessDTO.setOrgId(orgId);
             if (s.getType() == 4) {
                 integer = 1;
                 monitoringAccessDTO.setOrgId(s.getId());

+ 8 - 5
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/mapper/ResumptionReportMapper.java

@@ -17,7 +17,7 @@ import java.util.Map;
 @Mapper
 public interface ResumptionReportMapper {
 
-    ResumptionDayVO selectReport(@Param("cycle") Integer cycle,@Param("planType") Integer planType, @Param("orgId") Long orgId, @Param("date") String date, @Param("orgPath") String orgPath);
+    ResumptionDayVO selectReport(@Param("cycle") Integer cycle, @Param("planType") Integer planType, @Param("orgId") Long orgId, @Param("date") String date, @Param("orgPath") String orgPath);
 
     /**
      * 已整改数量
@@ -27,18 +27,21 @@ public interface ResumptionReportMapper {
      */
     Integer planRectification(@Param("taskId") Long taskId);
 
-    IntrusionTestReportVO selectIntrusionTestReport(@Param("orgId")Long orgId,@Param("date") String date, @Param("orgPath") String orgPath);
+    IntrusionTestReportVO selectIntrusionTestReport(@Param("orgId") Long orgId, @Param("date") String date, @Param("orgPath") String orgPath);
 
-    IntrusionTestReportVO selectServiceBankReport(@Param("orgId")Long orgId,@Param("date") String date, @Param("orgPath") String orgPath);
+    Map selectIntrusionTestAbnormalNumber(@Param("orgId") Long orgId, @Param("date") String date, @Param("orgPath") String orgPath);
 
-    IntrusionTestReportVO selectStandbyPower(@Param("orgId")Long orgId,@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("orgPath") String orgPath);
+    IntrusionTestReportVO selectServiceBankReport(@Param("orgId") Long orgId, @Param("date") String date, @Param("orgPath") String orgPath);
+
+    IntrusionTestReportVO selectStandbyPower(@Param("orgId") Long orgId, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("orgPath") String orgPath);
 
     /**
      * 隐患
+     *
      * @param startTime
      * @param endTime
      * @param orgPath
      * @return
      */
-    Map selectStandbyPowerAbnormalNumber(@Param("orgId")Long orgId,@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("orgPath") String orgPath);
+    Map selectStandbyPowerAbnormalNumber(@Param("orgId") Long orgId, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("orgPath") String orgPath);
 }

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

@@ -204,11 +204,20 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             }
             IntrusionTestReportVO intrusionTestReportVO1 = resumptionReportMapper.selectIntrusionTestReport(null, resumptionDTO.getSearchTime(), o.getPath());
             Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(o.getPath());
+            //隐患
+            Map map = resumptionReportMapper.selectIntrusionTestAbnormalNumber(null, resumptionDTO.getSearchTime(), o.getPath());
             if (o.getType() == 4) {
                 integer = 1;
                 intrusionTestReportVO1 = resumptionReportMapper.selectIntrusionTestReport(o.getId(), resumptionDTO.getSearchTime(), null);
+                map = resumptionReportMapper.selectIntrusionTestAbnormalNumber(o.getId(), resumptionDTO.getSearchTime(), null);
             }
             BeanUtils.copyProperties(intrusionTestReportVO1, intrusionTestReportVO);
+            Object abnormalNumber = map.get("abnormalNumber");
+            Object realityRectificationNumber = map.get("realityRectificationNumber");
+            Object realityRectificationRate = map.get("realityRectificationRate");
+            intrusionTestReportVO.setAbnormalNumber(Integer.valueOf(abnormalNumber.toString()));
+            intrusionTestReportVO.setRealityRectificationNumber(Integer.valueOf(realityRectificationNumber.toString()));
+            intrusionTestReportVO.setRealityRectificationRate(realityRectificationRate.toString());
             intrusionTestReportVO.setCity(sysOrg1.getShortName().indexOf("地区行社") == -1 ? sysOrg1.getShortName().substring(0, 2) : sysOrg1.getShortName().split("地区行社")[0]);
             intrusionTestReportVO.setOrgName(o.getShortName());
             intrusionTestReportVO.setNetworkNumber(integer);
@@ -268,11 +277,11 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             } else {
                 sysOrg1 = orgService.selectOrgById(orgService.selectOrgById(o.getParentId(), SecurityConstants.INNER).getParentId(), SecurityConstants.INNER);
             }
-            IntrusionTestReportVO intrusionTestReportVO1 = resumptionReportMapper.selectServiceBankReport(null,resumptionDTO.getSearchTime(), o.getPath());
+            IntrusionTestReportVO intrusionTestReportVO1 = resumptionReportMapper.selectServiceBankReport(null, resumptionDTO.getSearchTime(), o.getPath());
             Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(o.getPath());
-            if (o.getType()==4){
-                integer=1;
-                intrusionTestReportVO1 = resumptionReportMapper.selectServiceBankReport(o.getId(),resumptionDTO.getSearchTime(), null);
+            if (o.getType() == 4) {
+                integer = 1;
+                intrusionTestReportVO1 = resumptionReportMapper.selectServiceBankReport(o.getId(), resumptionDTO.getSearchTime(), null);
             }
             BeanUtils.copyProperties(intrusionTestReportVO1, intrusionTestReportVO);
             intrusionTestReportVO.setCity(sysOrg1.getShortName().indexOf("地区行社") == -1 ? sysOrg1.getShortName().substring(0, 2) : sysOrg1.getShortName().split("地区行社")[0]);
@@ -326,14 +335,14 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             } else {
                 sysOrg1 = orgService.selectOrgById(orgService.selectOrgById(o.getParentId(), SecurityConstants.INNER).getParentId(), SecurityConstants.INNER);
             }
-            IntrusionTestReportVO intrusionTestReportVO1 = resumptionReportMapper.selectStandbyPower(null,resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
+            IntrusionTestReportVO intrusionTestReportVO1 = resumptionReportMapper.selectStandbyPower(null, resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
             //隐患
-            Map map = resumptionReportMapper.selectStandbyPowerAbnormalNumber(null,resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
+            Map map = resumptionReportMapper.selectStandbyPowerAbnormalNumber(null, resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
             Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(o.getPath());
-            if (o.getType()==4){
-                integer=1;
-                 map = resumptionReportMapper.selectStandbyPowerAbnormalNumber(o.getId(),resumptionDTO.getStartTime(), resumptionDTO.getEndTime(),null);
-                intrusionTestReportVO1 = resumptionReportMapper.selectStandbyPower(null,resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
+            if (o.getType() == 4) {
+                integer = 1;
+                map = resumptionReportMapper.selectStandbyPowerAbnormalNumber(o.getId(), resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), null);
+                intrusionTestReportVO1 = resumptionReportMapper.selectStandbyPower(null, resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
             }
             BeanUtils.copyProperties(intrusionTestReportVO1, intrusionTestReportVO);
             Object abnormalNumber = map.get("abnormalNumber");

+ 34 - 9
soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/ResumptionReportMapper.xml

@@ -63,7 +63,6 @@
     <select id="selectIntrusionTestReport"
             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
@@ -77,14 +76,7 @@
         2
         ),
         '%'
-        )) AS realityRate,
-        COUNT( c.id ) AS realityRectificationNumber,
-        IF
-        (
-        COUNT( c.id )= 0
-        OR IFNULL( a.exception_count, 0 )= 0,
-        '0%',
-        CONCAT( ROUND( COUNT( c.id )/ IFNULL( a.exception_count, 0 )* 100, 2 ), '%' )) AS realityRectificationRate
+        )) AS realityRate
         FROM
             core_resumption a
                 LEFT JOIN core_resumption_plan b ON a.plan_id = b.id
@@ -242,4 +234,37 @@
             and a.org_path  like concat(#{orgPath},'%')
         </if>
     </select>
+    <select id="selectIntrusionTestAbnormalNumber" resultType="java.util.Map">
+        SELECT
+        IFNULL( SUM( IF ( c.confirm_status >= 2 AND c.reform_status IN ( 10, 11 ), 1, 0 ) ), 0 ) AS abnormalNumber,
+        IFNULL( SUM( IF ( c.reform_status = 11, 1, 0 )), 0 ) AS realityRectificationNumber,
+        IFNULL(
+        CONCAT(
+        ROUND(
+        SUM(
+        IF
+        ( c.reform_status = 11, 1, 0 ))/ IFNULL( SUM( IF ( c.confirm_status >= 2 AND c.reform_status IN ( 10, 11 ), 1, 0 ) ), 0 )* 100,
+        2
+        ),
+        '%'
+        ),
+        '0%'
+        ) 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
+        WHERE
+        c.src_type = 1
+        AND b.plan_type = 4
+        <if test="date !=null">
+            AND a.ymd_date like concat(#{date},'%')
+        </if>
+        <if test="orgId !=null">
+            and a.org_id=#{orgId}
+        </if>
+        <if test="orgPath !=null">
+            and a.org_path  like concat(#{orgPath},'%')
+        </if>
+    </select>
 </mapper>