whyclxw
2025-03-27 b8d60bd9e26c9505346cfa2374a5fde5cf2697ed
src/main/java/com/whyc/service/ExcelExportService.java
@@ -258,11 +258,13 @@
        HashMap<String, Object> map = Maps.newHashMap();
        //总体评价:内阻/电压/连接条/?容量
        int resGoodCount = 0;
        int serGoodCount = 0;
        int volGoodCount = 0;
        int chainResGoodCount = 0;
        //总体评价:有效的电阻/电压/连接条 数
        int battVolTestCount = 0;
        int battResTestCount = 0;
        int battSerTestCount = 0;
        int battChainResTestCount = 0;
        FileParam param = info.getFileParam();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -296,6 +298,9 @@
        }
        Float resGoodCoeK3 = param2.getResGoodCoeK3();
        Float resBadCoeK4 = param2.getResBadCoeK4();
        Float serGoodCoeK6 = param2.getSerGoodCoeK6();
        Float serBadCoeK7 = param2.getSerBadCoeK7();
        Float chainRes = param.getVersion().toUpperCase().contains("V2.0")?param.getChainRes():param.getConnRes();
        Float finalVolLowCoeK = volLowCoeK1;
        Float finalVolHighCoeK = volHighCoeK2;
@@ -304,6 +309,7 @@
            //计算电压,内阻,连接条数值是否有效,被测试过
            float bv = Float.parseFloat(data.getBv());
            float br = Float.parseFloat(data.getBr());
            float bs = Float.parseFloat(data.getBs());
            float cr = Float.parseFloat(data.getCr());
            //计算容量百分比,并回填到dataList中
            float preCap = MathUtil.getPreCapTest(br, stdRes);
@@ -316,6 +322,9 @@
            if(br!=0.0){
                battResTestCount++;
            }
            if(bs!=0.0){
                battSerTestCount++;
            }
            if (cr!=0.0){
                battChainResTestCount++;
            }
@@ -324,14 +333,6 @@
            if(br==0.0){
                data.setResEvaluation("—");
            }
            /*else if(!data.isHighResFlag1() && !data.isHighResFlag2()){
                resGoodCount +=1;
                data.setResEvaluation("优");
            }else if(data.isHighResFlag1()){
                data.setResEvaluation("良");
            }else{
                data.setResEvaluation("差");
            }*/
            else if(br >= stdRes*resGoodCoeK3/100){
                if(br >= stdRes*resBadCoeK4/100){
                    // data.setHighResFlag2(true);
@@ -356,6 +357,10 @@
                    data.setResEvaluation("excellent");
                }
            }
            //System.out.println(" bs:"+bs+" ;stdRes:"+stdRes+";serGoodCoeK6:"+(1.0/stdRes)*serGoodCoeK6/100);
            if(bs!=0.0&&bs>((1.0/stdRes)*serGoodCoeK6/100)){
                serGoodCount +=1;
            }
            /*if(bv!=0.0 && !data.isLowVolFlag() && !data.isHighVolFlag()){
                volGoodCount +=1;
            }*/
@@ -372,10 +377,13 @@
        info.setResGoodCount(resGoodCount);
        info.setVolGoodCount(volGoodCount);
        info.setChainResGoodCount(chainResGoodCount);
        info.setSerGoodCount(serGoodCount);
        info.setBattVolTestCount(battVolTestCount);
        info.setBattResTestCount(battResTestCount);
        info.setBattSerTestCount(battSerTestCount);
        info.setBattChainResTestCount(battChainResTestCount);
        StationInfo stationInfo = info.getStationInfo();
        if(stationInfo!=null) {
@@ -717,24 +725,30 @@
        map.put("stationInfo",stationInfo);
        //总体评价:内阻/电压/连接条/?容量
        int resGoodCount = 0;
        int serGoodCount = 0;
        int volGoodCount = 0;
        int chainResGoodCount = 0;
        //总体评价:有效的电阻/电压/连接条 数
        int battVolTestCount = 0;
        int battResTestCount = 0;
        int battSerTestCount = 0;
        int battChainResTestCount = 0;
        for(BattgroupData data : dataList2){
            //计算电压,内阻,连接条数值是否有效,被测试过
            float bv = Float.parseFloat(data.getBv());
            float br = Float.parseFloat(data.getBr());
            float bs = Float.parseFloat(data.getBs());
            float cr = Float.parseFloat(data.getCr());
            if (bv!=0.0){
                battVolTestCount++;
            }
            if(br!=0.0){
                battResTestCount++;
            }
            if(bs!=0.0){
                battSerTestCount++;
            }
            if (cr!=0.0){
                battChainResTestCount++;
@@ -764,6 +778,9 @@
                    data.setResEvaluation("bad");
                }
            }
            if(bs!=0.0&& !data.isHighSerFlag1() && !data.isHighSerFlag2()){
                serGoodCount +=1;
            }
            if(bv!=0.0 && !data.isLowVolFlag() && !data.isHighVolFlag()){
                volGoodCount +=1;
            }
@@ -773,10 +790,12 @@
        };
        map.put("resGoodCount",resGoodCount);
        map.put("volGoodCount",volGoodCount);
        map.put("serGoodCount",serGoodCount);
        map.put("chainResGoodCount",chainResGoodCount);
        map.put("battVolTestCount",battVolTestCount);
        map.put("battResTestCount",battResTestCount);
        map.put("battSerTestCount",battSerTestCount);
        map.put("battChainResTestCount",battChainResTestCount);
        map.put("dataList",dataList);