whyclxw
7 天以前 f729f1cf24e08eba181e685f0a091e7522581242
未放电统计不要统计方式(放电停止原因)
3个文件已修改
21 ■■■■ 已修改文件
src/main/java/com/whyc/controller/StatisticController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/dto/Statistic/DisChargeStic.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BatttestdataInfService.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/StatisticController.java
@@ -81,11 +81,11 @@
    public Response getDischr6Statistic(@RequestBody DisChargeStic stic){
        User uinf= ActionUtil.getUser();
        stic.setUid(uinf.getId());
        if(stic.getTypeList()==null||stic.getTypeList().size()==0){
        /*if(stic.getTypeList()==null||stic.getTypeList().size()==0){
            stic.setStopReasonType(0);
        }else{
            stic.setStopReasonType(1);
        }
        }*/
        return battTinfService.getDischr6Statistic(stic);
    }
    @ApiOperation(value = "优良电源数量统计(1.2.7)")
src/main/java/com/whyc/dto/Statistic/DisChargeStic.java
@@ -20,6 +20,6 @@
    private Date testEndTime;//结束时间
    private Integer pageNum;
    private Integer pageSize;
    private List<Integer> typeList;  //停止原因集合
    private Integer stopReasonType;   //0全部,1符合筛选条件的放电记录
    private List<Integer> typeList;  //停止原因集合 《条件弃之》
    private Integer stopReasonType;   //0全部,1符合筛选条件的放电记录《条件弃之》
}
src/main/java/com/whyc/service/BatttestdataInfService.java
@@ -760,14 +760,15 @@
            res.setBattgroupId(binf.getBattgroupId());
            res.setDevId(binf.getDevId());
            //获取电池组未放电记录(指定时间段的标准核容放电)
            getNoDischargeData(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime(),stic.getTypeList(),res);
            if(stic.getStopReasonType()==0){
            getNoDischargeData(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime(),null,res);
            /*if(stic.getStopReasonType()==0){
                reslist.add(res);
            }else {
                if(res.getStopReasonType()==stic.getStopReasonType()){
                    reslist.add(res);
                }
            }
            }*/
            reslist.add(res);
            if(!groupName.equals("none")){
                BanZu bz= (BanZu) bzmap.get(groupName);
                int nochargeNum=bz.getNochargeNum();
@@ -780,11 +781,11 @@
    }
    //2.获取电池组未放电记录(指定时间段的标准核容放电)
    private void getNoDischargeData(Integer battgroupId, Date testStartTime, Date testEndTime, List<Integer> typeList, SticDischarge6Res res) {
        List<BatttestdataInf> tinfList=mapper.getNoDischargeData(battgroupId,testStartTime,testEndTime,typeList);
        List<BatttestdataInf> tinfList=mapper.getNoDischargeData(battgroupId,testStartTime,testEndTime,null);
        List<String> stopList=new ArrayList<>();
        if(tinfList!=null&&tinfList.size()>0){
            res.setErrorNum(tinfList.size());
            res.setStopReasonType(1);
            //res.setStopReasonType(1);
            for (int i=0;i<tinfList.size();i++) {
                BatttestdataInf tinf=tinfList.get(i);
                if(i==0){
@@ -807,7 +808,7 @@
        }else {
            res.setErrorNum(0);
            res.setStopList(new ArrayList<>());
            res.setStopReasonType(0);
            //res.setStopReasonType(0);
        }
    }
    //获取核容停止原因类型(下拉)