whyclxw
2025-06-12 10574a67b78e2578fc10e8fbe83965bf4832c36a
src/main/java/com/whyc/service/BatttestdataInfService.java
@@ -17,6 +17,7 @@
import com.whyc.pojo.db_ram_db.BattRtdata;
import com.whyc.pojo.db_ram_db.BattRtstate;
import com.whyc.pojo.db_station.BattInf;
import com.whyc.pojo.db_station.PowerInf;
import com.whyc.pojo.db_user.Baojigroup;
import com.whyc.util.ActionUtil;
import com.whyc.util.PageInfoUtils;
@@ -49,8 +50,11 @@
    @Autowired(required = false)
    private BaojigroupService bjService;
    @Autowired(required = false)
    private PowerInfService powerInfService;
    @Autowired(required = false)
    private PwrdevHistorydataIdService pwrHisdataIdService;
    //获取最后一次测试数据并计算剩余容量
@@ -875,24 +879,35 @@
    }
   //优良电源数量统计(1.2.7)
    public Response getPwr7Statistic(Pwr7Stic stic) {
        //获取核容优劣,损坏参数
        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();
        //1查询符合条件的电池组
        List<PowerInf> pinfList=powerInfService.getPwr7Statistic(stic);
        if(pinfList==null||pinfList.size()==0){
            return new Response().set(1,false,"当前用户未管理满足条件的电池组");
        }
        List<SticPwr7Res> reslist=new ArrayList<>();
        for (PowerInf pinf:pinfList) {
            SticPwr7Res res=new SticPwr7Res();
            //查询电池组所在的班组
            String groupName = bjService.getGroupName(pinf.getPowerId());
            if(groupName.equals("none")){
                continue;
            }else{
                if(stic.getGroupName()==null||res.getGroupName()==stic.getGroupName()){
                    res.setProvice(pinf.getProvice());
                    res.setCity(pinf.getCity());
                    res.setCountry(pinf.getCountry());
                    res.setStationName(pinf.getStationName());
                    res.setPowerName(pinf.getPowerName());
                    res.setCompany(pinf.getCompany());
                    res.setStationType(pinf.getStationType());
                    res.setGroupName(groupName);
                    res.setInuseTime(pinf.getPowerInuseTime());
                    Map<String,Integer> map=pwrHisdataIdService.getPwrQuarter7(pinf.getPowerId(),null);
                    reslist.add(res);
                }
                if(param.getParamNamePsx().equals("batt_mon_damage_val")){
                    damageValue=param.getParamValue();
                }
            }
        }
        //1查询符合条件的电池组
        List<BattInf> binfList=battInfService.getPwr7Statistic(stic);
        List<PerformanceRes> reslist=new ArrayList<>();
        PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize());
        return new Response().setII(1,reslist.size()>0,pageInfo,"优良电源数量统计(1.2.7)");
    }