whyclxw
2025-06-12 eada8042dfebd2137e3e0ce55702912d7a2a3e05
去除蓄电池组1.2.5,1.2.6右侧图表
2个文件已修改
78 ■■■■■ 已修改文件
src/main/java/com/whyc/controller/StatisticController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BatttestdataInfService.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/StatisticController.java
@@ -74,12 +74,6 @@
        stic.setUid(uinf.getId());
        return battTinfService.getDischr5Statistic(stic);
    }
    @ApiOperation(value = "本年度已放电数量统计右侧图表(1.2.5/6)")
    @PostMapping("getDischr5Chart")
    public Response getDischr5Chart(){
        User uinf= ActionUtil.getUser();
        return battTinfService.getDischr5Chart(uinf.getId());
    }
    @ApiOperation(value = "本年度未放电数量统计(1.2.6)")
    @PostMapping("getDischr6Statistic")
    public Response getDischr6Statistic(@RequestBody DisChargeStic stic){
src/main/java/com/whyc/service/BatttestdataInfService.java
@@ -700,78 +700,6 @@
        }
        PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize());
        return new Response().setIIII(1,reslist.size()>0,pageInfo,bzmap,xnmap,"本年度已放电数量统计");
    }//本年度已放电数量统计右侧图表(1.2.5/6)
    public Response getDischr5Chart(Integer uid) {
        //班组
        Map<String,  Object> bzmap=new HashMap<>();
        //性能
        Map<String,  Integer> xnmap=new HashMap<>();
        xnmap.put("优秀",0);
        xnmap.put("劣化",0);
        xnmap.put("损坏",0);
        xnmap.put("未放电",0);
        //查询出所有的班组并赋予初始值
        setBanZuDefault(bzmap);
        //获取核容优劣,损坏参数
        List<AppParam> paramList=appParamService.getHrParam();
        Float badValue=0f;
        Float damageValue=0f;
        if(paramList!=null){
            for (AppParam param:paramList) {
                if(param.getParamNamePsx().equals("batt_mon_deteriorate_val")){
                    badValue=param.getParamValue();
                }
                if(param.getParamNamePsx().equals("batt_mon_damage_val")){
                    damageValue=param.getParamValue();
                }
            }
        }
        //1查询符合条件的电池组
        List<BattInf> binfList=battInfService.getDischrChart(uid);
        if(binfList==null||binfList.size()==0){
            return new Response().set(1,false,"当前用户未管理满足条件的电池组");
        }
        for (BattInf binf:binfList) {
            //查询电池组所在的班组
            String  groupName=bjService.getGroupName(binf.getPowerId());
            //2.获取电池组在给定时间段的放电记录(指定时间段的标准核容放电)
            BatttestdataInf tinf =getLastStandardTestDataByTime(binf.getBattgroupId(),null,null);
            if(tinf==null){
                int value=xnmap.get(Capperformance.getValue(Capperformance.BATTSTATE_4.getStateId()));
                xnmap.put(Capperformance.getValue(Capperformance.BATTSTATE_4.getStateId()),value+1);
                if(!groupName.equals("none")){
                    BanZu bz= (BanZu) bzmap.get(groupName);
                    int nochargeNum=bz.getNochargeNum();
                    bz.setNochargeNum(nochargeNum+1);
                    bzmap.put(groupName,bz);
                }
                continue;
            }
            if(!groupName.equals("none")){
                BanZu bz= (BanZu) bzmap.get(groupName);
                int dischargeNum=bz.getDischargeNum();
                bz.setDischargeNum(dischargeNum+1);
                bzmap.put(groupName,bz);
            }
            Float moncapStd=binf.getMoncapstd();
            int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr());
            Float grouprealCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real);
            if(grouprealCap>=moncapStd*badValue){
                int value=xnmap.get(Capperformance.getValue(Capperformance.BATTSTATE_1.getStateId()));
                xnmap.put(Capperformance.getValue(Capperformance.BATTSTATE_1.getStateId()),value+1);
            }
            if(grouprealCap<=moncapStd*damageValue){
                int value=xnmap.get(Capperformance.getValue(Capperformance.BATTSTATE_3.getStateId()));
                xnmap.put(Capperformance.getValue(Capperformance.BATTSTATE_3.getStateId()),value+1);
            }
            if((grouprealCap>moncapStd*damageValue)&&(grouprealCap<moncapStd*badValue)){
                int value=xnmap.get(Capperformance.getValue(Capperformance.BATTSTATE_2.getStateId()));
                xnmap.put(Capperformance.getValue(Capperformance.BATTSTATE_2.getStateId()),value+1);
            }
        }
        return new Response().setIII(1,true,bzmap,xnmap,"本年度已放电数量统计");
    }
    //查询出所有的班组并赋予初始值