Sfoglia il codice sorgente

单线路报告更新1

jichaobo 3 anni fa
parent
commit
08c1eacfa7

+ 16 - 0
fiveep-controller/src/main/java/com/bizmatics/controller/web/HtAnalogDataController.java

@@ -3,6 +3,7 @@ package com.bizmatics.controller.web;
 
 import com.bizmatics.common.core.bean.ApiResult;
 import com.bizmatics.model.vo.DataManagementOneVO;
+import com.bizmatics.model.vo.SingleLoopReportOneVo;
 import com.bizmatics.service.HtAnalogDataService;
 import com.bizmatics.service.vo.CommonIcoVO;
 import com.bizmatics.service.vo.HadCountVO;
@@ -193,5 +194,20 @@ public class HtAnalogDataController {
                                                  @RequestParam String endTime) {
         return ApiResult.success(htAnalogDataService.monthlyReportExport(deviceCode, startTime, endTime, cycle));
     }
+
+    /**
+     * 电能质量(单回路报告)
+     *
+     * @param deviceCode 设备编号
+     * @param time       时间 type为1时时间格式 yyyy-MM-dd type为2时时间格式 yyyy-MM
+     * @param type       类型 1:日 2:月
+     * @return
+     */
+    @GetMapping("SingleLoopReportData")
+    public ApiResult<SingleLoopReportOneVo> SingleLoopReportData(@RequestParam String deviceCode,
+                                                                 @RequestParam Date time,
+                                                                 @RequestParam int type) {
+        return ApiResult.success(htAnalogDataService.SingleLoopReportData(deviceCode, time, type));
+    }
 }
 

+ 292 - 0
fiveep-model/src/main/java/com/bizmatics/model/vo/SingleLoopReportOneVo.java

@@ -0,0 +1,292 @@
+package com.bizmatics.model.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author ya
+ * @since 2021-07-07
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class SingleLoopReportOneVo implements Serializable {
+
+    /**
+     * 伍继电力test_183消费组模拟量数据表ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 设备编号
+     */
+    private String deviceCode;
+
+    /**
+     * 设备名称
+     */
+    private String deviceName;
+
+    /**
+     * 功率因素
+     */
+    private Double cos;
+
+    /**
+     * 频率(平均)
+     */
+    private String avgF;
+
+    /**
+     * 频率(最大)
+     */
+    private String maxF;
+
+    /**
+     * 频率(最小)
+     */
+    private String minF;
+
+    /**
+     * A相电流(平均)
+     */
+    private Double avgIa;
+
+    /**
+     * B相电流(平均)
+     */
+    private Double avgIb;
+
+    /**
+     * C相电流(平均)
+     */
+    private Double avgIc;
+
+    /**
+     * A相电流(最大)
+     */
+    private Double maxIa;
+
+    /**
+     * B相电流(最大)
+     */
+    private Double maxIb;
+
+    /**
+     * C相电流(最大)
+     */
+    private Double maxIc;
+
+    /**
+     * A相电流(最小)
+     */
+    private Double minIa;
+
+    /**
+     * B相电流(最小)
+     */
+    private Double minIb;
+
+    /**
+     * C相电流(最小)
+     */
+    private Double minIc;
+
+
+    /**
+     * A相电压(平均)
+     */
+    private String avgUa;
+
+    /**
+     * B相电压(平均)
+     */
+    private String avgUb;
+
+    /**
+     * C相电压(平均)
+     */
+    private String avgUc;
+
+    /**
+     * A相电压(最大)
+     */
+    private String maxUa;
+
+    /**
+     * B相电压(最大)
+     */
+    private String maxUb;
+
+    /**
+     * C相电压(最大)
+     */
+    private String maxUc;
+
+    /**
+     * A相电压(最小)
+     */
+    private String minUa;
+
+    /**
+     * B相电压(最小)
+     */
+    private String minUb;
+
+    /**
+     * C相电压(最小)
+     */
+    private String minUc;
+
+    /**
+     * 电压等级
+     */
+    private String voltageLevel;
+
+    /**
+     * 额定电流(A)
+     */
+    private Double ratedCurrent;
+
+    /**
+     * 上报总数
+     */
+    private Integer measuringPoints;
+
+
+    /**
+     * 电流不平衡(平均)
+     */
+    private Double avgElBalun;
+    /**
+     * 电压不平衡(平均)
+     */
+    private Double avgVtBalun;
+
+    /**
+     * 电流不平衡(最大)
+     */
+    private Double maxElBalun;
+    /**
+     * 电压不平衡(最大)
+     */
+    private Double maxVtBalun;
+
+    /**
+     * 电流不平衡(最小)
+     */
+    private Double minElBalun;
+    /**
+     * 电压不平衡(最小)
+     */
+    private Double minVtBalun;
+
+    /**
+     * A相电压比例
+     */
+    private String proportionUa;
+
+    /**
+     * A相电压合格率
+     */
+    private Double qrUa;
+
+    /**
+     * B相电压比例
+     */
+    private String proportionUb;
+
+    /**
+     * B相电压合格率
+     */
+    private Double qrUb;
+
+    /**
+     * C相电压比例
+     */
+    private String proportionUc;
+
+    /**
+     * C相电压合格率
+     */
+    private Double qrUc;
+
+    /**
+     * 频率比例
+     */
+    private String proportionF;
+
+    /**
+     * 频率合格率
+     */
+    private Double qrF;
+
+    /**
+     * 电流不平衡度比例
+     */
+    private String proportionElBalun;
+
+    /**
+     * 电流不平衡度合格率
+     */
+    private Double qrElBalun;
+
+    /**
+     * 电压不平衡度比例
+     */
+    private String proportionVtBalun;
+
+    /**
+     * 电压不平衡度合格率
+     */
+    private Double qrVtBalun;
+
+
+    /**
+     * 标称电压上限
+     */
+    private Double voltageLevelToplimit;
+
+    /**
+     * 标称电压下限
+     */
+    private Double voltageLevelLowerLimit;
+
+    /**
+     * 标称频率
+     */
+    private Double mhz;
+
+    /**
+     * 频率上限
+     */
+    private Double fToplimit;
+
+    /**
+     * 频率下限
+     */
+    private Double fLowerLimit;
+
+    /**
+     * 考核限值
+     */
+    private Double appraise;
+    /**
+     * 不平衡度上限
+     */
+    private Double balanceToplimit;
+    /**
+     * 不平衡度下限
+     */
+    private Double balanceLowerLimit;
+}

+ 33 - 0
fiveep-model/src/main/java/com/bizmatics/model/vo/SingleLoopReportVo.java

@@ -72,6 +72,35 @@ public class SingleLoopReportVo implements Serializable {
      */
     private Double avgIc;
 
+    /**
+     * A相电流(最大)
+     */
+    private Double maxIa;
+
+    /**
+     * B相电流(最大)
+     */
+    private Double maxIb;
+
+    /**
+     * C相电流(最大)
+     */
+    private Double maxIc;
+
+    /**
+     * A相电流(最小)
+     */
+    private Double minIa;
+
+    /**
+     * B相电流(最小)
+     */
+    private Double minIb;
+
+    /**
+     * C相电流(最小)
+     */
+    private Double minIc;
 
     /**
      * A相电压(平均)
@@ -128,6 +157,10 @@ public class SingleLoopReportVo implements Serializable {
      */
     private Double ratedCurrent;
 
+    /**
+     * 上报总数
+     */
+    private Integer measuringPoints;
 
     /**
      * 电流不平衡(平均)

+ 6 - 0
fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/HtAnalogDataMapper.java

@@ -4,6 +4,7 @@ import com.bizmatics.common.mvc.base.CrudMapper;
 import com.bizmatics.model.HtAnalogData;
 import com.bizmatics.model.vo.HtAnalogDataOneVo;
 import com.bizmatics.model.vo.HtAnalogDataVo;
+import com.bizmatics.model.vo.SingleLoopReportVo;
 import org.apache.ibatis.annotations.MapKey;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
@@ -125,4 +126,9 @@ public interface HtAnalogDataMapper extends CrudMapper<HtAnalogData> {
                                              @Param("size") Integer size,
                                              @Param("startCurrent") Integer startCurrent);
 
+    List<SingleLoopReportVo> SingleLoopReportData(@Param("deviceCode") String deviceCode,
+                                                  @Param("startTime") String startTime,
+                                                  @Param("endTime") String endTime);
+
+
 }

+ 45 - 0
fiveep-persistence/src/main/resources/mapper/mysql/HtAnalogDataMapper.xml

@@ -1134,4 +1134,49 @@
         </where>
         GROUP BY a.dataTime,a.deviceName
     </select>
+
+    <select id="SingleLoopReportData" resultType="com.bizmatics.model.vo.SingleLoopReportVo">
+        SELECT
+        a.device_code,
+        a.device_name,
+        AVG(b.COS) AS COS,
+        AVG(F) AS avgF,
+        MAX(F) AS maxF,
+        min(F) AS minF,
+        AVG(b.Ia) AS avgIa,
+        AVG(b.Ib) AS avgIb,
+        AVG(b.Ic) AS avgIc,
+        max(b.Ia) AS maxIa,
+        max(b.Ib) AS maxIb,
+        max(b.Ic) AS maxIc,
+        min(b.Ia) AS minIa,
+        min(b.Ib) AS minIb,
+        min(b.Ic) AS minIc,
+        AVG(b.Ua) AS avgUa,
+        AVG(b.Ub) AS avgUb,
+        AVG(b.Uc) AS avgUc,
+        max(b.Ua) AS maxUa,
+        max(b.Ub) AS maxUb,
+        max(b.Uc) AS maxUc,
+        min(b.Ua) AS minUa,
+        min(b.Ub) AS minUb,
+        min(b.Uc) AS minUc,
+        c.voltage_level,
+        d.rated_current,
+        COUNT(b.id) AS measuringPoints
+        FROM
+        device AS a
+        LEFT JOIN ht_analog_data AS b ON a.device_code = b.deviceName
+        LEFT JOIN site_dynamic_properties AS c ON a.site_id = c.site_id
+        LEFT JOIN device_attribute AS d ON a.device_code = d.monitor_device_code
+        <where>
+            and a. ENABLE = 1
+            AND a.device_type = 1
+            AND a.device_code = #{deviceCode}
+            AND b.dataTime BETWEEN #{startTime}
+            AND #{endTime}
+        </where>
+        GROUP BY a.device_code
+    </select>
+
 </mapper>

+ 3 - 0
fiveep-service/src/main/java/com/bizmatics/service/HtAnalogDataService.java

@@ -4,6 +4,7 @@ import com.bizmatics.common.mvc.base.CrudService;
 import com.bizmatics.model.HtAnalogData;
 import com.bizmatics.model.vo.DataManagementOneVO;
 import com.bizmatics.model.vo.HtAnalogDataOneVo;
+import com.bizmatics.model.vo.SingleLoopReportOneVo;
 import com.bizmatics.service.vo.CommonIcoVO;
 import com.bizmatics.service.vo.HadCountVO;
 import com.bizmatics.service.vo.RealScoreVO;
@@ -103,5 +104,7 @@ public interface HtAnalogDataService extends CrudService<HtAnalogData> {
 
     List<HtAnalogDataOneVo> monthlyReportlist(String deviceCode, String startTime, String endTime, int cycle, Integer startCurrent);
 
+    SingleLoopReportOneVo SingleLoopReportData(String deviceCode, Date time, int type);
+
 
 }

+ 259 - 4
fiveep-service/src/main/java/com/bizmatics/service/impl/HtAnalogDataServiceImpl.java

@@ -15,10 +15,7 @@ import com.bizmatics.common.mvc.base.AbstractCrudService;
 import com.bizmatics.common.spring.util.GlobalUtils;
 import com.bizmatics.common.spring.util.JsonUtils;
 import com.bizmatics.model.*;
-import com.bizmatics.model.vo.DataManagementOneVO;
-import com.bizmatics.model.vo.DataManagementVO;
-import com.bizmatics.model.vo.HtAnalogDataOneVo;
-import com.bizmatics.model.vo.HtAnalogDataVo;
+import com.bizmatics.model.vo.*;
 import com.bizmatics.persistence.mapper.HtAnalogDataMapper;
 import com.bizmatics.service.*;
 import com.bizmatics.service.util.FieldEscapeUtils;
@@ -33,9 +30,12 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.math.BigDecimal;
+import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
+import static com.bizmatics.service.impl.RtAnalogDataServiceImpl.getLastDayOfMonth;
+
 
 /**
  * @author yq
@@ -656,4 +656,259 @@ public class HtAnalogDataServiceImpl extends AbstractCrudService<HtAnalogDataMap
         return listOne;
     }
 
+    @Override
+    public SingleLoopReportOneVo SingleLoopReportData(String deviceCode, Date time, int type){
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM");
+        String startTime = null;
+        String endtime = null;
+        if (type == 1) {
+            startTime = sdf.format(time) + " 00:00:00";
+            endtime = sdf.format(time) + " 23:59:59";
+        } else {
+            startTime = sdf1.format(time) + "-01 00:00:00";
+            String time1 = sdf1.format(time) + "-01";
+            try {
+                Date yq = getLastDayOfMonth(sdf.parse(time1));
+                endtime = sdf.format(yq) + " 23:59:59";
+            } catch (Exception e) {
+                throw new BusinessException("时间错误");
+            }
+        }
+        List<SingleLoopReportVo> SingleLoopReportList = baseMapper.SingleLoopReportData(deviceCode,startTime,endtime);
+        if (CollectionUtils.isEmpty(SingleLoopReportList)){
+            throw new BusinessException("暂无数据");
+        }
+        LambdaQueryWrapper<HtAnalogData> adQuery = Wrappers.lambdaQuery();
+        adQuery.eq(HtAnalogData::getDeviceName, deviceCode)
+                .between(HtAnalogData::getDataTime, startTime, endtime);
+        List<HtAnalogData> RtAnalogDataList = this.list(adQuery);
+        if (CollectionUtils.isEmpty(RtAnalogDataList)) {
+            throw new BusinessException("da不存在");
+        }
+
+
+        return analysisCalculation(SingleLoopReportList,RtAnalogDataList);
+    }
+
+    public SingleLoopReportOneVo analysisCalculation(List<SingleLoopReportVo> SingleLoopReportList,List<HtAnalogData> RtAnalogDataList){
+        DecimalFormat df   = new DecimalFormat("######0.00");
+        List<Double> checkList = new ArrayList<>();
+        SingleLoopReportOneVo singleLoopReportOneVo = BeanMapperUtils.map(SingleLoopReportList.get(0), SingleLoopReportOneVo.class);
+
+        checkList.add(SingleLoopReportList.get(0).getAvgIa());
+        checkList.add(SingleLoopReportList.get(0).getAvgIb());
+        checkList.add(SingleLoopReportList.get(0).getAvgIc());
+        //电流不平衡(平均)
+        singleLoopReportOneVo.setAvgElBalun(checkBalun(checkList)*100);
+
+        checkList.clear();
+        checkList.add(SingleLoopReportList.get(0).getMaxIa());
+        checkList.add(SingleLoopReportList.get(0).getMaxIb());
+        checkList.add(SingleLoopReportList.get(0).getMaxIc());
+        //电流不平衡(最大)
+        singleLoopReportOneVo.setMaxElBalun(checkBalun(checkList)*100);
+
+        checkList.clear();
+        checkList.add(SingleLoopReportList.get(0).getMinIa());
+        checkList.add(SingleLoopReportList.get(0).getMinIb());
+        checkList.add(SingleLoopReportList.get(0).getMinIc());
+        //电流不平衡(最小)
+        singleLoopReportOneVo.setMinElBalun(checkBalun(checkList)*100);
+
+        checkList.clear();
+        checkList.add(SingleLoopReportList.get(0).getAvgUa());
+        checkList.add(SingleLoopReportList.get(0).getAvgUb());
+        checkList.add(SingleLoopReportList.get(0).getAvgUc());
+        //电压不平衡(平均)
+        singleLoopReportOneVo.setAvgVtBalun(checkBalun(checkList)*100);
+
+        checkList.clear();
+        checkList.add(SingleLoopReportList.get(0).getMaxUa());
+        checkList.add(SingleLoopReportList.get(0).getMaxUb());
+        checkList.add(SingleLoopReportList.get(0).getMaxUc());
+        //电压不平衡(最大)
+        singleLoopReportOneVo.setMaxVtBalun(checkBalun(checkList)*100);
+
+        checkList.clear();
+        checkList.add(SingleLoopReportList.get(0).getMinUa());
+        checkList.add(SingleLoopReportList.get(0).getMinUb());
+        checkList.add(SingleLoopReportList.get(0).getMinUc());
+        //电压不平衡(最小)
+        singleLoopReportOneVo.setMinVtBalun(checkBalun(checkList)*100);
+
+        double voltageLevel = Double.parseDouble(singleLoopReportOneVo.getVoltageLevel());
+        double voltageLevelWanting = voltageLevel / 100 * 7;
+
+        //A相电压合格率(平均)
+        checkList.clear();
+        checkList.add(SingleLoopReportList.get(0).getAvgUa());
+        checkList.add(voltageLevel);
+        Double AvgUaQR = VoltageQr(checkList,voltageLevel);
+        singleLoopReportOneVo.setAvgUa(df.format(SingleLoopReportList.get(0).getAvgUa())+"V("+df.format(AvgUaQR)+"%)");
+        //B相电压合格率(平均)
+        checkList.clear();
+        checkList.add(SingleLoopReportList.get(0).getAvgUb());
+        checkList.add(voltageLevel);
+        Double AvgUbQR = VoltageQr(checkList,voltageLevel);
+        singleLoopReportOneVo.setAvgUb(df.format(SingleLoopReportList.get(0).getAvgUb())+"V("+df.format(AvgUbQR)+"%)");
+        //C相电压合格率(平均)
+        checkList.clear();
+        checkList.add(SingleLoopReportList.get(0).getAvgUc());
+        checkList.add(voltageLevel);
+        Double AvgUcQR = VoltageQr(checkList,voltageLevel);
+        singleLoopReportOneVo.setAvgUc(df.format(SingleLoopReportList.get(0).getAvgUc())+"V("+df.format(AvgUcQR)+"%)");
+        //A相电压合格率(最大)
+        checkList.clear();
+        checkList.add(SingleLoopReportList.get(0).getMaxUa());
+        checkList.add(voltageLevel);
+        Double MaxUaQR = VoltageQr(checkList,voltageLevel);
+        singleLoopReportOneVo.setMaxUa(df.format(SingleLoopReportList.get(0).getMaxUa())+"V("+df.format(MaxUaQR)+"%)");
+        //B相电压合格率(最大)
+        checkList.clear();
+        checkList.add(SingleLoopReportList.get(0).getMaxUb());
+        checkList.add(voltageLevel);
+        Double MaxUbQR = VoltageQr(checkList,voltageLevel);
+        singleLoopReportOneVo.setMaxUb(df.format(SingleLoopReportList.get(0).getMaxUb())+"V("+df.format(MaxUbQR)+"%)");
+        //C相电压合格率(最大)
+        checkList.clear();
+        checkList.add(SingleLoopReportList.get(0).getMaxUc());
+        checkList.add(voltageLevel);
+        Double MaxUcQR = VoltageQr(checkList,voltageLevel);
+        singleLoopReportOneVo.setMaxUc(df.format(SingleLoopReportList.get(0).getMaxUc())+"V("+df.format(MaxUcQR)+"%)");
+        //A相电压合格率(最小)
+        checkList.clear();
+        checkList.add(SingleLoopReportList.get(0).getMinUa());
+        checkList.add(voltageLevel);
+        Double MinUaQR = VoltageQr(checkList,voltageLevel);
+        singleLoopReportOneVo.setMinUa(df.format(SingleLoopReportList.get(0).getMinUa())+"V("+df.format(MinUaQR)+"%)");
+        //B相电压合格率(最小)
+        checkList.clear();
+        checkList.add(SingleLoopReportList.get(0).getMinUb());
+        checkList.add(voltageLevel);
+        Double MinUbQR = VoltageQr(checkList,voltageLevel);
+        singleLoopReportOneVo.setMinUb(df.format(SingleLoopReportList.get(0).getMinUb())+"V("+df.format(MinUbQR)+"%)");
+        //C相电压合格率(最小)
+        checkList.clear();
+        checkList.add(SingleLoopReportList.get(0).getMinUc());
+        checkList.add(voltageLevel);
+        Double MinUcQR = VoltageQr(checkList,voltageLevel);
+        singleLoopReportOneVo.setMinUc(df.format(SingleLoopReportList.get(0).getMinUc())+"V("+df.format(MinUcQR)+"%)");
+
+        //频率(平均)
+        Double cAvgF = 50.00 - SingleLoopReportList.get(0).getAvgF();
+        singleLoopReportOneVo.setAvgF(df.format(SingleLoopReportList.get(0).getAvgF())+"Hz("+df.format(cAvgF)+"Hz)");
+        //频率(最大)
+        Double cMaxF = 50.00 - SingleLoopReportList.get(0).getMaxF();
+        singleLoopReportOneVo.setMaxF(df.format(SingleLoopReportList.get(0).getMaxF())+"Hz("+df.format(cMaxF)+"Hz)");
+        //频率(最小)
+        Double cMinF = 50.00 - SingleLoopReportList.get(0).getMinF();
+        singleLoopReportOneVo.setMinF(df.format(SingleLoopReportList.get(0).getMinF())+"Hz("+df.format(cMinF)+"Hz)");
+
+        int OverrunUa = 0;
+        int OverrunUb = 0;
+        int OverrunUc = 0;
+        int OverrunF = 0;
+        int OverrunElBalun = 0;
+        int OverrunVtBalun = 0;
+        if (RtAnalogDataList.size()>0){
+            for (int i=0;i<RtAnalogDataList.size();i++){
+                checkList.clear();
+                checkList.add(RtAnalogDataList.get(i).getUa());
+                checkList.add(voltageLevel);
+                Double maxUa = checkList.stream().max(Double::compareTo).get();
+                Double minUa = checkList.stream().min(Double::compareTo).get();
+                Double wantingUa = Arith.sub(maxUa, minUa);
+                if (wantingUa<voltageLevelWanting){
+                    OverrunUa += OverrunUa;
+                }
+
+                checkList.clear();
+                checkList.add(RtAnalogDataList.get(i).getUb());
+                checkList.add(voltageLevel);
+                Double maxUb = checkList.stream().max(Double::compareTo).get();
+                Double minUb = checkList.stream().min(Double::compareTo).get();
+                Double wantingUb = Arith.sub(maxUb, minUb);
+                if (wantingUb<voltageLevelWanting){
+                    OverrunUb += OverrunUb;
+                }
+
+                checkList.clear();
+                checkList.add(RtAnalogDataList.get(i).getUc());
+                checkList.add(voltageLevel);
+                Double maxUc = checkList.stream().max(Double::compareTo).get();
+                Double minUc = checkList.stream().min(Double::compareTo).get();
+                Double wantingUc = Arith.sub(maxUc, minUc);
+                if (wantingUc<voltageLevelWanting){
+                    OverrunUc += OverrunUc;
+                }
+
+                if (RtAnalogDataList.get(i).getF()>50.2||RtAnalogDataList.get(i).getF()<49.8){
+                    OverrunF += OverrunF;
+                }
+
+                checkList.clear();
+                checkList.add(RtAnalogDataList.get(i).getIa());
+                checkList.add(RtAnalogDataList.get(i).getIb());
+                checkList.add(RtAnalogDataList.get(i).getIc());
+                //电流不平衡
+                Double ElBalun = checkBalun(checkList);
+                if (ElBalun>0.15){
+                    OverrunElBalun += OverrunElBalun;
+                }
+
+                checkList.clear();
+                checkList.add(RtAnalogDataList.get(i).getUa());
+                checkList.add(RtAnalogDataList.get(i).getUb());
+                checkList.add(RtAnalogDataList.get(i).getUc());
+                //电压不平衡
+                Double VtBalunQ = checkBalun(checkList);
+                if (VtBalunQ>0.15){
+                    OverrunVtBalun += OverrunVtBalun;
+                }
+
+
+            }
+        }
+        singleLoopReportOneVo.setProportionUa(OverrunUa+"/"+singleLoopReportOneVo.getMeasuringPoints());
+        singleLoopReportOneVo.setProportionUb(OverrunUb+"/"+singleLoopReportOneVo.getMeasuringPoints());
+        singleLoopReportOneVo.setProportionUc(OverrunUc+"/"+singleLoopReportOneVo.getMeasuringPoints());
+        singleLoopReportOneVo.setProportionF(OverrunF+"/"+singleLoopReportOneVo.getMeasuringPoints());
+        singleLoopReportOneVo.setProportionElBalun(OverrunElBalun+"/"+singleLoopReportOneVo.getMeasuringPoints());
+        singleLoopReportOneVo.setProportionVtBalun(OverrunVtBalun+"/"+singleLoopReportOneVo.getMeasuringPoints());
+        singleLoopReportOneVo.setQrUa(OverrunUa==0?100.00:Double.valueOf(OverrunUa)/Double.valueOf(singleLoopReportOneVo.getMeasuringPoints())*100);
+        singleLoopReportOneVo.setQrUb(OverrunUb==0?100.00:Double.valueOf(OverrunUb)/Double.valueOf(singleLoopReportOneVo.getMeasuringPoints())*100);
+        singleLoopReportOneVo.setQrUc(OverrunUc==0?100.00:Double.valueOf(OverrunUc)/Double.valueOf(singleLoopReportOneVo.getMeasuringPoints())*100);
+        singleLoopReportOneVo.setQrF(OverrunF==0?100.00:Double.valueOf(OverrunF)/Double.valueOf(singleLoopReportOneVo.getMeasuringPoints())*100);
+        singleLoopReportOneVo.setQrElBalun(OverrunElBalun==0?100.00:Double.valueOf(OverrunElBalun)/Double.valueOf(singleLoopReportOneVo.getMeasuringPoints()));
+        singleLoopReportOneVo.setQrVtBalun(OverrunVtBalun==0?100.00:Double.valueOf(OverrunVtBalun)/Double.valueOf(singleLoopReportOneVo.getMeasuringPoints()));
+        singleLoopReportOneVo.setVoltageLevelToplimit(voltageLevel+voltageLevelWanting);
+        singleLoopReportOneVo.setVoltageLevelLowerLimit(voltageLevel-voltageLevelWanting);
+        singleLoopReportOneVo.setMhz(50.00);
+        singleLoopReportOneVo.setFToplimit(50.2);
+        singleLoopReportOneVo.setFLowerLimit(49.8);
+        singleLoopReportOneVo.setAppraise(15.00);
+        singleLoopReportOneVo.setBalanceToplimit(15.00);
+        singleLoopReportOneVo.setBalanceLowerLimit(15.00);
+        return singleLoopReportOneVo;
+    }
+
+    public Double VoltageQr(List<Double> checkList,Double voltageLevel){
+        Double max = checkList.stream().max(Double::compareTo).get();
+        Double min = checkList.stream().min(Double::compareTo).get();
+        Double wanting = Arith.sub(max, min);
+        Double QR = wanting / voltageLevel * 100;
+        return QR;
+    }
+
+    public Double checkBalun(List<Double> list) {
+        long count = list.stream().filter(code -> 0.00 == code).count();
+        if (3 == count) {
+            return 0.00;
+        }
+        Double max = list.stream().max(Double::compareTo).get();
+        Double min = list.stream().min(Double::compareTo).get();
+        return Arith.div(Arith.sub(max, min), max);
+    }
+
 }