Эх сурвалжийг харах

1.首页作业统计修改
2.积分统计修改逻辑,多个稽查任务发生违章只扣一次

zx 1 сар өмнө
parent
commit
ada6194687

+ 5 - 0
ruoyi-powerdistribution/src/main/java/com/ruoyi/powerdistribution/domain/vo/WorkNumStatisticsHome.java

@@ -19,6 +19,11 @@ public class WorkNumStatisticsHome {
     private Long planSum;
 
     /**
+     * 作业完成数量
+     */
+    private Long planCompleteSum;
+
+    /**
      * 取消数量
      */
     private Long cancelSum;

+ 36 - 38
ruoyi-powerdistribution/src/main/resources/mapper/powerdistribution/PdmScoreRankManagerMapper.xml

@@ -138,25 +138,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         )t1
         LEFT JOIN
         (
-        select submit_org_nm,work_princip_nm,work_princip_id,sum(violation) violation from (
-        select uuid,submit_org_nm,work_princip_nm,work_princip_id,max(violation) violation from (
-        select uuid,t3.submit_org_nm,work_princip_nm,t3.work_princip_id,
-        case when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025001' and break_rules_nature_cd = '2020001' then 4
-        when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025001' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 12
-        when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025002' and break_rules_nature_cd = '2020001' then 2
-        when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025002' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 6
-        when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025003' and break_rules_nature_cd = '2020001' then 1
-        when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025003' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 3
-        else 0
-        end as violation
-        from ads_cst_hygszdbb_pdmviolationrecords_df t1,ads_cst_hygszdbb_pdminspectionrecords_df t2,ads_cst_hygszdbb_pdmworkplan_df t3
-        where t1.audit_rec_id = t2.audit_rec_id and t1.day_op_info_id = t3.uuid
-        and work_team_nm not like '%公司'
-        and date_format(plan_start_wk_tm,'%Y%m%d')  >= #{startDate}
-        and date_format(plan_start_wk_tm,'%Y%m%d') <= #{endDate}
-        and plan_exec_st_cd !='2029005'
-        ) a GROUP BY uuid,submit_org_nm,work_princip_nm,work_princip_id
-        ) aa GROUP BY submit_org_nm,work_princip_nm,work_princip_id
+            select op_org submit_org_nm,work_princip work_princip_nm,work_princip_id,sum(violation) violation from (
+            select audit_rec_id,op_org,work_princip ,work_princip_id,max(violation) violation from (
+            select t2.audit_rec_id,t2.op_org,work_princip,work_princip_id,
+            case when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025001' and break_rules_nature_cd = '2020001' then 4
+            when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025001' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 12
+            when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025002' and break_rules_nature_cd = '2020001' then 2
+            when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025002' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 6
+            when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025003' and break_rules_nature_cd = '2020001' then 1
+            when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025003' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 3
+            else 0
+            end as violation
+            from ads_cst_hygszdbb_pdmviolationrecords_df t1,ads_cst_hygszdbb_pdminspectionrecords_df t2
+            where t1.audit_rec_id = t2.audit_rec_id
+            and op_team not like '%公司'
+            and date_format(op_plan_start_tm,'%Y%m%d') >= #{startDate}
+            and date_format(op_plan_start_tm,'%Y%m%d') <= #{endDate}
+            ) a GROUP BY audit_rec_id,op_org,work_princip,work_princip_id
+            ) aa GROUP BY op_org,work_princip,work_princip_id
         )t2 on t1.submit_org_nm = t2.submit_org_nm and t1.work_princip_nm = t2.work_princip_nm and t1.work_princip_id = t2.work_princip_id
         LEFT JOIN
         (
@@ -200,25 +199,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         )t1
         LEFT JOIN
         (
-        select work_team_nm,work_princip_nm,work_princip_id,sum(violation) violation from (
-        select uuid,work_team_nm,work_princip_nm,work_princip_id,max(violation) violation from (
-        select uuid,t3.work_team_nm,work_princip_nm,t3.work_princip_id,
-        case when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025001' and break_rules_nature_cd = '2020001' then 4
-        when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025001' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 12
-        when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025002' and break_rules_nature_cd = '2020001' then 2
-        when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025002' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 6
-        when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025003' and break_rules_nature_cd = '2020001' then 1
-        when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025003' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 3
-        else 0
-        end as violation
-        from ads_cst_hygszdbb_pdmviolationrecords_df t1,ads_cst_hygszdbb_pdminspectionrecords_df t2,ads_cst_hygszdbb_pdmworkplan_df t3
-        where t1.audit_rec_id = t2.audit_rec_id and t1.day_op_info_id = t3.uuid
-        and date_format(plan_start_wk_tm,'%Y%m%d')  >= #{startDate}
-        and date_format(plan_start_wk_tm,'%Y%m%d') <= #{endDate}
-        and plan_exec_st_cd !='2029005'
-        and work_team_nm like '%公司' and work_team_nm not like '%雁能%'
-        ) a GROUP BY uuid,work_team_nm,work_princip_nm,work_princip_id
-        ) aa GROUP BY work_team_nm,work_princip_nm,work_princip_id
+            select op_team work_team_nm, work_princip work_princip_nm,work_princip_id,sum(violation) violation from (
+            select audit_rec_id,op_team,work_princip ,work_princip_id,max(violation) violation from (
+            select t2.audit_rec_id,op_team,work_princip ,work_princip_id,
+            case when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025001' and break_rules_nature_cd = '2020001' then 4
+            when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025001' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 12
+            when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025002' and break_rules_nature_cd = '2020001' then 2
+            when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025002' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 6
+            when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025003' and break_rules_nature_cd = '2020001' then 1
+            when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025003' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 3
+            else 0
+            end as violation
+            from ads_cst_hygszdbb_pdmviolationrecords_df t1,ads_cst_hygszdbb_pdminspectionrecords_df t2
+            where t1.audit_rec_id = t2.audit_rec_id
+            and date_format(op_plan_start_tm,'%Y%m%d') >= #{startDate}
+            and date_format(op_plan_start_tm,'%Y%m%d') <= #{endDate}
+            and op_team like '%公司' and op_team not like '%雁能%'
+            ) a GROUP BY audit_rec_id,op_team,work_princip ,work_princip_id
+            ) aa GROUP BY op_team,work_princip ,work_princip_id
         )t2 on t1.work_team_nm = t2.work_team_nm and t1.work_princip_nm = t2.work_princip_nm and t1.work_princip_id = t2.work_princip_id
         LEFT JOIN
         (

+ 28 - 30
ruoyi-powerdistribution/src/main/resources/mapper/powerdistribution/PdmScoreRankTeamMapper.xml

@@ -129,25 +129,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         )t1
         LEFT JOIN
         (
-        select submit_org_nm,work_team_nm,sum(violation) violation from (
-        select uuid,submit_org_nm,work_team_nm,max(violation) violation from (
-        select uuid,submit_org_nm,t3.work_team_nm,
-        case when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025001' and break_rules_nature_cd = '2020001' then 4
-        when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025001' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 12
-        when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025002' and break_rules_nature_cd = '2020001' then 2
-        when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025002' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 6
-        when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025003' and break_rules_nature_cd = '2020001' then 1
-        when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025003' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 3
-        else 0
-        end as violation
-        from ads_cst_hygszdbb_pdmviolationrecords_df t1,ads_cst_hygszdbb_pdminspectionrecords_df t2,ads_cst_hygszdbb_pdmworkplan_df t3
-        where t1.audit_rec_id = t2.audit_rec_id and t1.day_op_info_id = t3.uuid
-        and  date_format(plan_start_wk_tm,'%Y%m%d')  >= #{startDate}
-        and date_format(plan_start_wk_tm,'%Y%m%d') <= #{endDate}
-        and plan_exec_st_cd !='2029005'
-        and work_team_nm not like '%公司'
-        ) a GROUP BY uuid,submit_org_nm,work_team_nm
-        ) aa GROUP BY submit_org_nm,work_team_nm
+            select op_org submit_org_nm,op_team work_team_nm,sum(violation) violation from (
+            select audit_rec_id,op_org,op_team,max(violation) violation from (
+            select t2.audit_rec_id,op_org,op_team,
+            case when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025001' and break_rules_nature_cd = '2020001' then 4
+            when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025001' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 12
+            when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025002' and break_rules_nature_cd = '2020001' then 2
+            when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025002' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 6
+            when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025003' and break_rules_nature_cd = '2020001' then 1
+            when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025003' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 3
+            else 0
+            end as violation
+            from ads_cst_hygszdbb_pdmviolationrecords_df t1,ads_cst_hygszdbb_pdminspectionrecords_df t2
+            where t1.audit_rec_id = t2.audit_rec_id
+            and date_format(op_plan_start_tm,'%Y%m%d') >= #{startDate}
+            and date_format(op_plan_start_tm,'%Y%m%d') <= #{endDate}
+            and op_team not like '%公司'
+            ) a GROUP BY audit_rec_id,op_org,op_team
+            ) aa GROUP BY op_org,op_team
         )t2 on t1.submit_org_nm = t2.submit_org_nm and t1.work_team_nm = t2.work_team_nm
         LEFT JOIN
         (
@@ -191,9 +190,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         )t1
         LEFT JOIN
         (
-        select work_team_nm,sum(violation) violation from (
-        select uuid,work_team_nm,max(violation) violation from (
-        select uuid,t3.work_team_nm,
+        select op_team work_team_nm,sum(violation) violation from (
+        select audit_rec_id,op_team,max(violation) violation from (
+        select t2.audit_rec_id,op_team,
         case when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025001' and break_rules_nature_cd = '2020001' then 4
         when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025001' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 12
         when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025002' and break_rules_nature_cd = '2020001' then 2
@@ -202,14 +201,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         when t2.scene_rating_cd = '2018004' and audit_lvl_cd ='2025003' and break_rules_nature_cd in ('2020002','2020003','2020004','2020005','2020006') then 3
         else 0
         end as violation
-        from ads_cst_hygszdbb_pdmviolationrecords_df t1,ads_cst_hygszdbb_pdminspectionrecords_df t2,ads_cst_hygszdbb_pdmworkplan_df t3
-        where t1.audit_rec_id = t2.audit_rec_id and t1.day_op_info_id = t3.uuid
-        and  date_format(plan_start_wk_tm,'%Y%m%d')  >= #{startDate}
-        and date_format(plan_start_wk_tm,'%Y%m%d') <= #{endDate}
-        and plan_exec_st_cd !='2029005'
-        and work_team_nm like '%公司' and work_team_nm not like '%雁能%'
-        ) a GROUP BY uuid,work_team_nm
-        ) aa GROUP BY work_team_nm
+        from ads_cst_hygszdbb_pdmviolationrecords_df t1,ads_cst_hygszdbb_pdminspectionrecords_df t2
+        where t1.audit_rec_id = t2.audit_rec_id
+        and date_format(op_plan_start_tm,'%Y%m%d') >= #{startDate}
+        and date_format(op_plan_start_tm,'%Y%m%d') <= #{endDate}
+        and op_team like '%公司' and op_team not like '%雁能%'
+        ) a GROUP BY audit_rec_id,op_team
+        ) aa GROUP BY op_team
         )t2 on t1.work_team_nm = t2.work_team_nm
         LEFT JOIN
         (

+ 3 - 1
ruoyi-powerdistribution/src/main/resources/mapper/powerdistribution/PdmWorkPlanMapper.xml

@@ -639,6 +639,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         t1.organ_name submit_org_nm,
         IFNULL(t2.plan_sum,0) plan_sum,
         IFNULL(t2.cancel_sum,0) cancel_sum,
+        IFNULL(t2.plan_complete_sum,0) plan_complete_sum,
         IFNULL(t2.execute_ratio,'0%') execute_ratio,
         IFNULL(t2.risk_sum,0) risk_sum,
         IFNULL(t2.plan_sum_3,0) plan_sum_3,
@@ -650,7 +651,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT
         sum(1) plan_sum,
         sum(if(plan_exec_st_cd = '2029005',1,0)) cancel_sum,
-        CONCAT(ROUND(sum(if(plan_exec_st_cd != '2029005',1,0))/sum(1)*100,2),'%') execute_ratio,
+        sum(if(plan_exec_st_cd = '2029004',1,0)) plan_complete_sum,
+        CONCAT(ROUND(sum(if(plan_exec_st_cd = '2029004',1,0))/sum(1)*100,2),'%') execute_ratio,
         sum(if(risk_type not in ('0,','1'),1,0)) risk_sum,
         sum(if(op_risk_lvl_cd = '2007003',1,0)) plan_sum_3,
         sum(if(op_risk_lvl_cd = '2007004',1,0)) plan_sum_4,