zx 5 месяцев назад
Родитель
Сommit
ec806b1c25

+ 41 - 44
ruoyi-powerdistribution/src/main/java/com/ruoyi/powerdistribution/domain/PdmStopTarge.java

@@ -28,6 +28,7 @@ public class PdmStopTarge extends BaseEntity
     private String reportYear;
 
     /** 单位编码 */
+    @ExcelProperty(index = 1)
     @Excel(name = "单位编码")
     private String companyNo;
 
@@ -37,222 +38,218 @@ public class PdmStopTarge extends BaseEntity
     private String companyName;
 
     /** 平均停电时长目标 */
-    @ExcelProperty(index = 1)
     @Excel(name = "中压用户平均停电时长目标(小时)")
     private BigDecimal stopTimeAvg;
 
     /** 等效总用户数 */
-    @ExcelProperty(index = 2)
     @Excel(name = "等效总用户数")
     private BigDecimal userTotal;
 
     /** 停电总时长目标 */
-    @ExcelProperty(index = 3)
+    @ExcelProperty(index = 2)
     @Excel(name = "停电总时长目标")
     private BigDecimal stopTimeTotal;
 
     /** 3年占比 */
-    @ExcelProperty(index = 4)
     @Excel(name = "3年占比")
     private String threeYearRatio;
 
     /** 预安排停电总时长目标 */
-    @ExcelProperty(index = 5)
+    @ExcelProperty(index = 3)
     @Excel(name = "预安排停电总时长目标")
     private BigDecimal planStopTimeTotal;
 
     /** 预安排平均停电时长目标 */
-    @ExcelProperty(index = 6)
     @Excel(name = "预安排平均停电时长目标")
     private BigDecimal planStopTimeAvg;
 
     /** 故障停电总时长目标 */
-    @ExcelProperty(index = 7)
+    @ExcelProperty(index = 4)
     @Excel(name = "故障停电总时长目标")
     private BigDecimal errorStopTimeTotal;
 
     /** 故障平均停电时长目标 */
-    @ExcelProperty(index = 8)
+
     @Excel(name = "故障平均停电时长目标")
     private BigDecimal errorStopTimeAvg;
 
     /** 停电月度时长-1月 */
-    @ExcelProperty(index = 9)
+    @ExcelProperty(index = 5)
     @Excel(name = "停电月度时长-1月")
     private BigDecimal stopTimeMonth01;
 
     /** 停电月度时长-2月 */
-    @ExcelProperty(index = 10)
+    @ExcelProperty(index = 6)
     @Excel(name = "停电月度时长-2月")
     private BigDecimal stopTimeMonth02;
 
     /** 停电月度时长-3月 */
-    @ExcelProperty(index = 11)
+    @ExcelProperty(index = 7)
     @Excel(name = "停电月度时长-3月")
     private BigDecimal stopTimeMonth03;
 
     /** 停电月度时长-4月 */
-    @ExcelProperty(index = 12)
+    @ExcelProperty(index = 8)
     @Excel(name = "停电月度时长-4月")
     private BigDecimal stopTimeMonth04;
 
     /** 停电月度时长-5月 */
-    @ExcelProperty(index = 13)
+    @ExcelProperty(index = 9)
     @Excel(name = "停电月度时长-5月")
     private BigDecimal stopTimeMonth05;
 
     /** 停电月度时长-6月 */
-    @ExcelProperty(index = 14)
+    @ExcelProperty(index = 10)
     @Excel(name = "停电月度时长-6月")
     private BigDecimal stopTimeMonth06;
 
     /** 停电月度时长-7月 */
-    @ExcelProperty(index = 15)
+    @ExcelProperty(index = 11)
     @Excel(name = "停电月度时长-7月")
     private BigDecimal stopTimeMonth07;
 
     /** 停电月度时长-8月 */
-    @ExcelProperty(index = 16)
+    @ExcelProperty(index = 12)
     @Excel(name = "停电月度时长-8月")
     private BigDecimal stopTimeMonth08;
 
     /** 停电月度时长-9月 */
-    @ExcelProperty(index = 17)
+    @ExcelProperty(index = 13)
     @Excel(name = "停电月度时长-9月")
     private BigDecimal stopTimeMonth09;
 
     /** 停电月度时长-10月 */
-    @ExcelProperty(index = 18)
+    @ExcelProperty(index = 14)
     @Excel(name = "停电月度时长-10月")
     private BigDecimal stopTimeMonth10;
 
     /** 停电月度时长-11月 */
-    @ExcelProperty(index = 19)
+    @ExcelProperty(index = 15)
     @Excel(name = "停电月度时长-11月")
     private BigDecimal stopTimeMonth11;
 
     /** 停电月度时长-12月 */
-    @ExcelProperty(index = 20)
+    @ExcelProperty(index = 16)
     @Excel(name = "停电月度时长-12月")
     private BigDecimal stopTimeMonth12;
 
     /** 预安排停电月度时长-1月 */
-    @ExcelProperty(index = 21)
+    @ExcelProperty(index = 17)
     @Excel(name = "预安排停电月度时长-1月")
     private BigDecimal planStopTimeMonth01;
 
     /** 预安排停电月度时长-2月 */
-    @ExcelProperty(index = 22)
+    @ExcelProperty(index = 18)
     @Excel(name = "预安排停电月度时长-2月")
     private BigDecimal planStopTimeMonth02;
 
     /** 预安排停电月度时长-3月 */
-    @ExcelProperty(index = 23)
+    @ExcelProperty(index = 19)
     @Excel(name = "预安排停电月度时长-3月")
     private BigDecimal planStopTimeMonth03;
 
     /** 预安排停电月度时长-4月 */
-    @ExcelProperty(index = 24)
+    @ExcelProperty(index = 20)
     @Excel(name = "预安排停电月度时长-4月")
     private BigDecimal planStopTimeMonth04;
 
     /** 预安排停电月度时长-5月 */
-    @ExcelProperty(index = 25)
+    @ExcelProperty(index = 21)
     @Excel(name = "预安排停电月度时长-5月")
     private BigDecimal planStopTimeMonth05;
 
     /** 预安排停电月度时长-6月 */
-    @ExcelProperty(index = 26)
+    @ExcelProperty(index = 22)
     @Excel(name = "预安排停电月度时长-6月")
     private BigDecimal planStopTimeMonth06;
 
     /** 预安排停电月度时长-7月 */
-    @ExcelProperty(index = 27)
+    @ExcelProperty(index = 23)
     @Excel(name = "预安排停电月度时长-7月")
     private BigDecimal planStopTimeMonth07;
 
     /** 预安排停电月度时长-8月 */
-    @ExcelProperty(index = 28)
+    @ExcelProperty(index = 24)
     @Excel(name = "预安排停电月度时长-8月")
     private BigDecimal planStopTimeMonth08;
 
     /** 预安排停电月度时长-9月 */
-    @ExcelProperty(index = 29)
+    @ExcelProperty(index = 25)
     @Excel(name = "预安排停电月度时长-9月")
     private BigDecimal planStopTimeMonth09;
 
     /** 预安排停电月度时长-10月 */
-    @ExcelProperty(index = 30)
+    @ExcelProperty(index = 26)
     @Excel(name = "预安排停电月度时长-10月")
     private BigDecimal planStopTimeMonth10;
 
     /** 预安排停电月度时长-11月 */
-    @ExcelProperty(index = 31)
+    @ExcelProperty(index = 27)
     @Excel(name = "预安排停电月度时长-11月")
     private BigDecimal planStopTimeMonth11;
 
     /** 预安排停电月度时长-12月 */
-    @ExcelProperty(index = 32)
+    @ExcelProperty(index = 28)
     @Excel(name = "预安排停电月度时长-12月")
     private BigDecimal planStopTimeMonth12;
 
     /** 故障停电月度时长-1月 */
-    @ExcelProperty(index = 33)
+    @ExcelProperty(index = 29)
     @Excel(name = "故障停电月度时长-1月")
     private BigDecimal errorStopTimeMonth01;
 
     /** 故障停电月度时长-2月 */
-    @ExcelProperty(index = 34)
+    @ExcelProperty(index = 30)
     @Excel(name = "故障停电月度时长-2月")
     private BigDecimal errorStopTimeMonth02;
 
     /** 故障停电月度时长-3月 */
-    @ExcelProperty(index = 35)
+    @ExcelProperty(index = 31)
     @Excel(name = "故障停电月度时长-3月")
     private BigDecimal errorStopTimeMonth03;
 
     /** 故障停电月度时长-4月 */
-    @ExcelProperty(index = 36)
+    @ExcelProperty(index = 32)
     @Excel(name = "故障停电月度时长-4月")
     private BigDecimal errorStopTimeMonth04;
 
     /** 故障停电月度时长-5月 */
-    @ExcelProperty(index = 37)
+    @ExcelProperty(index = 33)
     @Excel(name = "故障停电月度时长-5月")
     private BigDecimal errorStopTimeMonth05;
 
     /** 故障停电月度时长-6月 */
-    @ExcelProperty(index = 38)
+    @ExcelProperty(index = 34)
     @Excel(name = "故障停电月度时长-6月")
     private BigDecimal errorStopTimeMonth06;
 
     /** 故障停电月度时长-7月 */
-    @ExcelProperty(index = 39)
+    @ExcelProperty(index = 35)
     @Excel(name = "故障停电月度时长-7月")
     private BigDecimal errorStopTimeMonth07;
 
     /** 故障停电月度时长-8月 */
-    @ExcelProperty(index = 40)
+    @ExcelProperty(index = 36)
     @Excel(name = "故障停电月度时长-8月")
     private BigDecimal errorStopTimeMonth08;
 
     /** 故障停电月度时长-9月 */
-    @ExcelProperty(index = 41)
+    @ExcelProperty(index = 37)
     @Excel(name = "故障停电月度时长-9月")
     private BigDecimal errorStopTimeMonth09;
 
     /** 故障停电月度时长-10月 */
-    @ExcelProperty(index = 42)
+    @ExcelProperty(index = 38)
     @Excel(name = "故障停电月度时长-10月")
     private BigDecimal errorStopTimeMonth10;
 
     /** 故障停电月度时长-11月 */
-    @ExcelProperty(index = 43)
+    @ExcelProperty(index = 39)
     @Excel(name = "故障停电月度时长-11月")
     private BigDecimal errorStopTimeMonth11;
 
     /** 故障停电月度时长-12月 */
-    @ExcelProperty(index = 44)
+    @ExcelProperty(index = 40)
     @Excel(name = "故障停电月度时长-12月")
     private BigDecimal errorStopTimeMonth12;
 

+ 0 - 10
ruoyi-powerdistribution/src/main/java/com/ruoyi/powerdistribution/service/impl/PdmStopTargeServiceImpl.java

@@ -1,16 +1,11 @@
 package com.ruoyi.powerdistribution.service.impl;
 
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
 
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.common.utils.DateUtils;
-import com.ruoyi.powerdistribution.domain.PdmWorkOrgan;
 import com.ruoyi.powerdistribution.domain.vo.StopTargetAndRecords;
-import com.ruoyi.powerdistribution.service.IPdmWorkOrganService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.powerdistribution.mapper.PdmStopTargeMapper;
@@ -30,8 +25,6 @@ public class PdmStopTargeServiceImpl extends ServiceImpl<PdmStopTargeMapper,PdmS
     @Autowired
     private PdmStopTargeMapper pdmStopTargeMapper;
 
-    @Autowired
-    private IPdmWorkOrganService pdmWorkOrganService;
 
     /**
      * 查询停电预算
@@ -111,11 +104,8 @@ public class PdmStopTargeServiceImpl extends ServiceImpl<PdmStopTargeMapper,PdmS
     @Transactional
     public boolean batchSaveOrUpdate(List<PdmStopTarge> list,String reportYear) {
         this.remove(new LambdaUpdateWrapper<PdmStopTarge>().eq(PdmStopTarge::getReportYear,reportYear));
-        List<PdmWorkOrgan> orgList = pdmWorkOrganService.selectPdmWorkOrganList(new PdmWorkOrgan());
-        Map<String,String> orgMap = orgList.stream().collect(Collectors.toMap(PdmWorkOrgan::getOrganName, PdmWorkOrgan::getOrganNo , (k1, k2) -> k1));
         for(PdmStopTarge target:list){
             target.setReportYear(reportYear);
-            target.setCompanyNo(orgMap.get(target.getCompanyName()));
             pdmStopTargeMapper.insertPdmStopTarge(target);
         }
         return true;

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

@@ -387,7 +387,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         from pdm_stop_targe t1
         LEFT JOIN
         (
-        select std_county_org_no,
+        select substr(duty_dept_no,2,12) org_no ,
         SUM(poweroff_duration_tm) stop_total_actual,
         SUM(IF(poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241'),poweroff_duration_tm,0)) as plan_stop_total_actual,
         SUM(IF(poweroff_nature_cd in('1101','1202'),poweroff_duration_tm,0)) as error_stop_total_actual,
@@ -431,8 +431,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='12'),poweroff_duration_tm,0)) as error_stop_month_12_actual
         from pdm_stop_records
         where SUBSTRING(data_dt,1,4) = #{reportYear}
-        GROUP BY std_county_org_no
-        ) t2 on t1.company_no = t2.std_county_org_no
+        GROUP BY substr(duty_dept_no,2,12)
+        ) t2 on t1.company_no = t2.org_no
         where  report_year = #{reportYear}
 
     </select>