whyclxw
2025-05-29 b341245d84fb1e4743e8d34bc9a4f742b0fb9a5e
电压上一季度历史实时
3个文件已修改
7个文件已添加
1210 ■■■■■ 已修改文件
src/main/java/com/whyc/controller/HistoryIdController.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/dto/Real/QuarterData.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/BattRtdataMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/db_data_history/BattRealdataId.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/db_data_history/PwrdevHistorydataId.java 899 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BattRealdataIdService.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BattRtdataService.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/SubTablePageInfoService.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/util/ActionUtil.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/webSocket/RealTimeSocket.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/HistoryIdController.java
New file
@@ -0,0 +1,29 @@
package com.whyc.controller;
import com.whyc.dto.Response;
import com.whyc.pojo.db_user.User;
import com.whyc.service.BattRealdataIdService;
import com.whyc.service.StationInfService;
import com.whyc.util.ActionUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Api(tags = "历史实时管理")
@RequestMapping("hisId")
public class HistoryIdController {
    @Autowired
    private BattRealdataIdService battHisIdService;
    @ApiOperation("获取电池组最近一季度的数据")
    @GetMapping("getBattQuarter")
    public Response getBattQuarter(@RequestParam Integer battgroupId) {
        return battHisIdService.getBattQuarter(battgroupId);
    }
}
src/main/java/com/whyc/dto/Real/QuarterData.java
New file
@@ -0,0 +1,15 @@
package com.whyc.dto.Real;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.sql.Timestamp;
import java.util.Date;
@Data
public class QuarterData {
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date recordTime;
    private Integer monNum;
    private Float numValue;
}
src/main/java/com/whyc/mapper/BattRtdataMapper.java
New file
@@ -0,0 +1,6 @@
package com.whyc.mapper;
import com.whyc.pojo.db_ram_db.BattRtdata;
public interface BattRtdataMapper extends CustomMapper<BattRtdata>{
}
src/main/java/com/whyc/pojo/db_data_history/BattRealdataId.java
New file
@@ -0,0 +1,92 @@
package com.whyc.pojo.db_data_history;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
 * <p>
 * 电池组1000288_2025_04历史实时数据表
 * </p>
 *
 * @author lxw
 * @since 2025-05-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="BattRealdataId", description="电池组历史实时数据表")
public class BattRealdataId implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "num", type = IdType.AUTO)
    private Long num;
    @ApiModelProperty(value = "电池组ID")
    private Integer battgroupId;
    @ApiModelProperty(value = "记录时间")
    private Date recrodTime;
    @ApiModelProperty(value = "组端电压")
    private Float groupVol;
    @ApiModelProperty(value = "在线电压")
    private Float onlineVol;
    @ApiModelProperty(value = "电池电流")
    private Float groupCurr;
    @ApiModelProperty(value = "设备温度")
    private Float groupTmp;
    @ApiModelProperty(value = "电池状态")
    private Integer battState;
    @ApiModelProperty(value = "电池测试类型")
    private Integer battTestType;
    @ApiModelProperty(value = "测试开始时间")
    private Date battTestStarttime;
    @ApiModelProperty(value = "测试时长")
    private Integer battTestTlong;
    @ApiModelProperty(value = "测试容量")
    private Float battTestCap;
    @ApiModelProperty(value = "单体编号")
    private Integer monNum;
    @ApiModelProperty(value = "单体电压")
    private Float monVol;
    @ApiModelProperty(value = "单体温度")
    private Float monTmp;
    @ApiModelProperty(value = "单体内阻")
    private Float monRes;
    @ApiModelProperty(value = "单体电导")
    private Float monSer;
    @ApiModelProperty(value = "单体容量")
    private Float monCap;
    @ApiModelProperty(value = "单体均衡电流")
    private Float monJhCurr;
    @ApiModelProperty(value = "备注")
    private String note;
}
src/main/java/com/whyc/pojo/db_data_history/PwrdevHistorydataId.java
New file
@@ -0,0 +1,899 @@
package com.whyc.pojo.db_data_history;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
 * <p>
 * 电源110000005_2024_03历史实时数据表
 * </p>
 *
 * @author lxw
 * @since 2025-05-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="PwrdevHistorydataId", description="电源历史实时数据表")
public class PwrdevHistorydataId implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "num", type = IdType.AUTO)
    private Long num;
    @ApiModelProperty(value = "电源ID")
    private Long powerId;
    @ApiModelProperty(value = "更新时间")
    private Date recordDatetime;
    @ApiModelProperty(value = "1路交流输入A相电压")
    private Float acin1Vola;
    @ApiModelProperty(value = "1路交流输入B相电压")
    private Float acin1Volb;
    @ApiModelProperty(value = "交流1路输入C相电压")
    private Float acin1Volc;
    @ApiModelProperty(value = "2路交流输入A相电压")
    private Float acin2Vola;
    @ApiModelProperty(value = "2路交流输入B相电压")
    private Float acin2Volb;
    @ApiModelProperty(value = "2路交流输入C相电压")
    private Float acin2Volc;
    @ApiModelProperty(value = "交流A相输出电压")
    private Float acoutVola;
    @ApiModelProperty(value = "交流B相输出电压")
    private Float acoutVolb;
    @ApiModelProperty(value = "交流C相输出电压")
    private Float acoutVolc;
    @ApiModelProperty(value = "交流A相输出电流")
    private Float acoutCurra;
    @ApiModelProperty(value = "交流B相输出电流")
    private Float acoutCurrb;
    @ApiModelProperty(value = "交流C相输出电流")
    private Float acoutCurrc;
    @ApiModelProperty(value = "直流输出电压")
    private Float dcoutVol;
    @ApiModelProperty(value = "直流输出电流")
    private Float dcoutCurr;
    @ApiModelProperty(value = "电池组1组端电压")
    private Float battgroup1Vol;
    @ApiModelProperty(value = "电池组1电流")
    private Float battgroup1Curr;
    @ApiModelProperty(value = "电池组2组端电压")
    private Float battgroup2Vol;
    @ApiModelProperty(value = "电池组2电流")
    private Float battgroup2Curr;
    @ApiModelProperty(value = "环境温度")
    private Float temprature;
    @ApiModelProperty(value = "整流模块总输出电压")
    private Float mOutputvol;
    @ApiModelProperty(value = "模块1输出电流")
    private Float m1Outcurr;
    @ApiModelProperty(value = "模块2输出电流")
    private Float m2Outcurr;
    @ApiModelProperty(value = "模块3输出电流")
    private Float m3Outcurr;
    @ApiModelProperty(value = "模块4输出电流")
    private Float m4Outcurr;
    @ApiModelProperty(value = "模块5输出电流")
    private Float m5Outcurr;
    @ApiModelProperty(value = "模块6输出电流")
    private Float m6Outcurr;
    @ApiModelProperty(value = "模块7输出电流")
    private Float m7Outcurr;
    @ApiModelProperty(value = "模块8输出电流")
    private Float m8Outcurr;
    @ApiModelProperty(value = "模块9输出电流")
    private Float m9Outcurr;
    @ApiModelProperty(value = "模块10输出电流")
    private Float m10Outcurr;
    @ApiModelProperty(value = "模块11输出电流")
    private Float m11Outcurr;
    @ApiModelProperty(value = "模块12输出电流")
    private Float m12Outcurr;
    @ApiModelProperty(value = "模块13输出电流")
    private Float m13Outcurr;
    @ApiModelProperty(value = "模块14输出电流")
    private Float m14Outcurr;
    @ApiModelProperty(value = "模块15输出电流")
    private Float m15Outcurr;
    @ApiModelProperty(value = "模块16输出电流")
    private Float m16Outcurr;
    @ApiModelProperty(value = "第一路交流A相输入过压")
    private Integer isAcin1OverVola;
    @ApiModelProperty(value = "第一路交流A相输入欠压")
    private Integer isAcin1UnderVola;
    @ApiModelProperty(value = "第一路交流A相输入缺相")
    private Integer isAcin1LessA;
    @ApiModelProperty(value = "第一路交流B相输入过压")
    private Integer isAcin1OverVolb;
    @ApiModelProperty(value = "第一路交流B相输入欠压")
    private Integer isAcin1UnderVolb;
    @ApiModelProperty(value = "第一路交流B相输入缺相")
    private Integer isAcin1LessB;
    @ApiModelProperty(value = "第一路交流C相输入过压")
    private Integer isAcin1OverVolc;
    @ApiModelProperty(value = "第一路交流C相输入欠压")
    private Integer isAcin1UnderVolc;
    @ApiModelProperty(value = "第一路交流C相输入缺相")
    private Integer isAcin1LessC;
    @ApiModelProperty(value = "交流输入1防雷器故障")
    private Integer isAcin1ThunderErr;
    @ApiModelProperty(value = "交流输入1停电")
    private Integer isAcin1Powerdown;
    @ApiModelProperty(value = "第二路交流A相输入过压")
    private Integer isAcin2OverVola;
    @ApiModelProperty(value = "第二路交流A相输入欠压")
    private Integer isAcin2UnderVola;
    @ApiModelProperty(value = "第二路交流A相输入缺相")
    private Integer isAcin2LessA;
    @ApiModelProperty(value = "第二路交流B相输入过压")
    private Integer isAcin2OverVolb;
    @ApiModelProperty(value = "第二路交流B相输入欠压")
    private Integer isAcin2UnderVolb;
    @ApiModelProperty(value = "第二路交流B相输入缺相")
    private Integer isAcin2LessB;
    @ApiModelProperty(value = "第二路交流C相输入过压")
    private Integer isAcin2OverVolc;
    @ApiModelProperty(value = "第二路交流C相输入欠压")
    private Integer isAcin2UnderVolc;
    @ApiModelProperty(value = "第二路交流C相输入缺相")
    private Integer isAcin2LessC;
    @ApiModelProperty(value = "交流输入1防雷器故障")
    private Integer isAcin2ThunderErr;
    @ApiModelProperty(value = "交流输入2停电")
    private Integer isAcin2Powerdown;
    @ApiModelProperty(value = "监控器故障")
    private Integer isAcinMonitorerr;
    @ApiModelProperty(value = "直流输出过压")
    private Integer isDcoutOverVol;
    @ApiModelProperty(value = "直流输出欠压")
    private Integer isDcoutUnderVol;
    @ApiModelProperty(value = "电池组1下电告警")
    private Integer isBattgroup1Down;
    @ApiModelProperty(value = "电源均充")
    private Integer isJunCharge;
    @ApiModelProperty(value = "整流模块1故障")
    private Float isAcdcmod1Err;
    @ApiModelProperty(value = "整流模块1关机")
    private Float isAcdcmod1Off;
    @ApiModelProperty(value = "整流模块2故障")
    private Float isAcdcmod2Err;
    @ApiModelProperty(value = "整流模块2关机")
    private Float isAcdcmod2Off;
    @ApiModelProperty(value = "整流模块3故障")
    private Float isAcdcmod3Err;
    @ApiModelProperty(value = "整流模块3关机")
    private Float isAcdcmod3Off;
    @ApiModelProperty(value = "整流模块4故障")
    private Float isAcdcmod4Err;
    @ApiModelProperty(value = "整流模块4关机")
    private Float isAcdcmod4Off;
    @ApiModelProperty(value = "整流模块5故障")
    private Float isAcdcmod5Err;
    @ApiModelProperty(value = "整流模块5关机")
    private Float isAcdcmod5Off;
    @ApiModelProperty(value = "整流模块6故障")
    private Float isAcdcmod6Err;
    @ApiModelProperty(value = "整流模块6关机")
    private Float isAcdcmod6Off;
    @ApiModelProperty(value = "整流模块7故障")
    private Float isAcdcmod7Err;
    @ApiModelProperty(value = "整流模块7关机")
    private Float isAcdcmod7Off;
    @ApiModelProperty(value = "整流模块8故障")
    private Float isAcdcmod8Err;
    @ApiModelProperty(value = "整流模块8关机")
    private Float isAcdcmod8Off;
    @ApiModelProperty(value = "整流模块9故障")
    private Float isAcdcmod9Err;
    @ApiModelProperty(value = "整流模块9关机")
    private Float isAcdcmod9Off;
    @ApiModelProperty(value = "整流模块10故障")
    private Float isAcdcmod10Err;
    @ApiModelProperty(value = "整流模块10关机")
    private Float isAcdcmod10Off;
    @ApiModelProperty(value = "整流模块11故障")
    private Float isAcdcmod11Err;
    @ApiModelProperty(value = "整流模块11关机")
    private Float isAcdcmod11Off;
    @ApiModelProperty(value = "整流模块12故障")
    private Float isAcdcmod12Err;
    @ApiModelProperty(value = "整流模块12关机")
    private Float isAcdcmod12Off;
    @ApiModelProperty(value = "整流模块13故障")
    private Float isAcdcmod13Err;
    @ApiModelProperty(value = "整流模块13关机")
    private Float isAcdcmod13Off;
    @ApiModelProperty(value = "整流模块14故障")
    private Float isAcdcmod14Err;
    @ApiModelProperty(value = "整流模块14关机")
    private Float isAcdcmod14Off;
    @ApiModelProperty(value = "整流模块15故障")
    private Float isAcdcmod15Err;
    @ApiModelProperty(value = "整流模块15关机")
    private Float isAcdcmod15Off;
    @ApiModelProperty(value = "整流模块16故障")
    private Float isAcdcmod16Err;
    @ApiModelProperty(value = "整流模块16关机")
    private Float isAcdcmod16Off;
    @ApiModelProperty(value = "交流输入1跳闸")
    private Integer isAcin1Trip;
    @ApiModelProperty(value = "交流输入2跳闸")
    private Integer isAcin2Trip;
    @ApiModelProperty(value = "负载熔断")
    private Integer isLoaderFuse;
    @ApiModelProperty(value = "电池组1熔断")
    private Integer isBattgroup1Fuse;
    @ApiModelProperty(value = "电池组2熔断")
    private Integer isBattgroup2Fuse;
    @ApiModelProperty(value = "电源总告警")
    private Integer isTotalAlarm;
    @ApiModelProperty(value = "交流1路输入A相电流")
    private Float acin1Curra;
    @ApiModelProperty(value = "交流1路输入B相电流")
    private Float acin1Currb;
    @ApiModelProperty(value = "交流1路输入C相电流")
    private Float acin1Currc;
    @ApiModelProperty(value = "负载电流")
    private Float loaderCurr;
    @ApiModelProperty(value = "电池组1容量")
    private Float battgroup1Ah;
    @ApiModelProperty(value = "电池组1温度")
    private Float battgroup1Temp;
    @ApiModelProperty(value = "电池组2容量")
    private Float battgroup2Ah;
    @ApiModelProperty(value = "电池组2温度")
    private Float battgroup2Temp;
    @ApiModelProperty(value = "ACDC开关柜温度")
    private Float acdcmTemp;
    @ApiModelProperty(value = "模块1输出电压")
    private Float m1OutVol;
    @ApiModelProperty(value = "模块2输出电压")
    private Float m2OutVol;
    @ApiModelProperty(value = "模块3输出电压")
    private Float m3OutVol;
    @ApiModelProperty(value = "模块4输出电压")
    private Float m4OutVol;
    @ApiModelProperty(value = "模块5输出电压")
    private Float m5OutVol;
    @ApiModelProperty(value = "模块6输出电压")
    private Float m6OutVol;
    @ApiModelProperty(value = "模块7输出电压")
    private Float m7OutVol;
    @ApiModelProperty(value = "模块8输出电压")
    private Float m8OutVol;
    @ApiModelProperty(value = "模块9输出电压")
    private Float m9OutVol;
    @ApiModelProperty(value = "模块10输出电压")
    private Float m10OutVol;
    @ApiModelProperty(value = "模块11输出电压")
    private Float m11OutVol;
    @ApiModelProperty(value = "模块12输出电压")
    private Float m12OutVol;
    @ApiModelProperty(value = "模块13输出电压")
    private Float m13OutVol;
    @ApiModelProperty(value = "模块14输出电压")
    private Float m14OutVol;
    @ApiModelProperty(value = "模块15输出电压")
    private Float m15OutVol;
    @ApiModelProperty(value = "模块16输出电压")
    private Float m16OutVol;
    @ApiModelProperty(value = "交流A相过流")
    private Integer isAcb1OverCurra;
    @ApiModelProperty(value = "交流B相过流")
    private Integer isAcb1OverCurrb;
    @ApiModelProperty(value = "交流C相过流")
    private Integer isAcb1OverCurrc;
    @ApiModelProperty(value = "交流1路有电")
    private Integer isAcin1Poweron;
    @ApiModelProperty(value = "交流2路有电")
    private Integer isAcin2Poweron;
    @ApiModelProperty(value = "直流输出过流告警")
    private Integer isDcoutOverCurr;
    @ApiModelProperty(value = "电池组1充放电指示[1-充  0-放]")
    private Integer isBattgroup1State;
    @ApiModelProperty(value = "电池组2充放电指示[1-充  0-放]")
    private Integer isBattgroup2State;
    @ApiModelProperty(value = "电池组2下电告警")
    private Integer isBattgroup2Down;
    @ApiModelProperty(value = "电池组1充电过流")
    private Integer isBattgroup1Overchgcurr;
    @ApiModelProperty(value = "电池组2充电过流")
    private Integer isBattgroup2Overchgcurr;
    @ApiModelProperty(value = "模块1过压")
    private Integer isAcdcmod1Overvol;
    @ApiModelProperty(value = "模块1欠压")
    private Integer isAcdcmod1Undervol;
    @ApiModelProperty(value = "模块1过流")
    private Integer isAcdcmod1Overcurr;
    @ApiModelProperty(value = "模块1交流异常")
    private Integer isAcdcmod1Acerr;
    @ApiModelProperty(value = "模块1限流")
    private Integer isAcdcmod1Limitcurr;
    @ApiModelProperty(value = "模块2过压")
    private Integer isAcdcmod2Overvol;
    @ApiModelProperty(value = "模块2欠压")
    private Integer isAcdcmod2Undervol;
    @ApiModelProperty(value = "模块2过流")
    private Integer isAcdcmod2Overcurr;
    @ApiModelProperty(value = "模块2交流异常")
    private Integer isAcdcmod2Acerr;
    @ApiModelProperty(value = "模块2限流")
    private Integer isAcdcmod2Limitcurr;
    @ApiModelProperty(value = "模块3过压")
    private Integer isAcdcmod3Overvol;
    @ApiModelProperty(value = "模块3欠压")
    private Integer isAcdcmod3Undervol;
    @ApiModelProperty(value = "模块3过流")
    private Integer isAcdcmod3Overcurr;
    @ApiModelProperty(value = "模块3交流异常")
    private Integer isAcdcmod3Acerr;
    @ApiModelProperty(value = "模块3限流")
    private Integer isAcdcmod3Limitcurr;
    @ApiModelProperty(value = "模块4过压")
    private Integer isAcdcmod4Overvol;
    @ApiModelProperty(value = "模块4欠压")
    private Integer isAcdcmod4Undervol;
    @ApiModelProperty(value = "模块4过流")
    private Integer isAcdcmod4Overcurr;
    @ApiModelProperty(value = "模块4交流异常")
    private Integer isAcdcmod4Acerr;
    @ApiModelProperty(value = "模块4限流")
    private Integer isAcdcmod4Limitcurr;
    @ApiModelProperty(value = "模块5过压")
    private Integer isAcdcmod5Overvol;
    @ApiModelProperty(value = "模块5欠压")
    private Integer isAcdcmod5Undervol;
    @ApiModelProperty(value = "模块5过流")
    private Integer isAcdcmod5Overcurr;
    @ApiModelProperty(value = "模块5交流异常")
    private Integer isAcdcmod5Acerr;
    @ApiModelProperty(value = "模块5限流")
    private Integer isAcdcmod5Limitcurr;
    @ApiModelProperty(value = "模块6过压")
    private Integer isAcdcmod6Overvol;
    @ApiModelProperty(value = "模块6欠压")
    private Integer isAcdcmod6Undervol;
    @ApiModelProperty(value = "模块6过流")
    private Integer isAcdcmod6Overcurr;
    @ApiModelProperty(value = "模块6交流异常")
    private Integer isAcdcmod6Acerr;
    @ApiModelProperty(value = "模块6限流")
    private Integer isAcdcmod6Limitcurr;
    @ApiModelProperty(value = "模块7过压")
    private Integer isAcdcmod7Overvol;
    @ApiModelProperty(value = "模块7欠压")
    private Integer isAcdcmod7Undervol;
    @ApiModelProperty(value = "模块7过流")
    private Integer isAcdcmod7Overcurr;
    @ApiModelProperty(value = "模块7交流异常")
    private Integer isAcdcmod7Acerr;
    @ApiModelProperty(value = "模块7限流")
    private Integer isAcdcmod7Limitcurr;
    @ApiModelProperty(value = "模块8过压")
    private Integer isAcdcmod8Overvol;
    @ApiModelProperty(value = "模块8欠压")
    private Integer isAcdcmod8Undervol;
    @ApiModelProperty(value = "模块8过流")
    private Integer isAcdcmod8Overcurr;
    @ApiModelProperty(value = "模块8交流异常")
    private Integer isAcdcmod8Acerr;
    @ApiModelProperty(value = "模块8限流")
    private Integer isAcdcmod8Limitcurr;
    @ApiModelProperty(value = "模块9过压")
    private Integer isAcdcmod9Overvol;
    @ApiModelProperty(value = "模块9欠压")
    private Integer isAcdcmod9Undervol;
    @ApiModelProperty(value = "模块9过流")
    private Integer isAcdcmod9Overcurr;
    @ApiModelProperty(value = "模块9交流异常")
    private Integer isAcdcmod9Acerr;
    @ApiModelProperty(value = "模块9限流")
    private Integer isAcdcmod9Limitcurr;
    @ApiModelProperty(value = "模块10过压")
    private Integer isAcdcmod10Overvol;
    @ApiModelProperty(value = "模块10欠压")
    private Integer isAcdcmod10Undervol;
    @ApiModelProperty(value = "模块10过流")
    private Integer isAcdcmod10Overcurr;
    @ApiModelProperty(value = "模块10交流异常")
    private Integer isAcdcmod10Acerr;
    @ApiModelProperty(value = "模块10限流")
    private Integer isAcdcmod10Limitcurr;
    @ApiModelProperty(value = "模块11过压")
    private Integer isAcdcmod11Overvol;
    @ApiModelProperty(value = "模块11欠压")
    private Integer isAcdcmod11Undervol;
    @ApiModelProperty(value = "模块11过流")
    private Integer isAcdcmod11Overcurr;
    @ApiModelProperty(value = "模块11交流异常")
    private Integer isAcdcmod11Acerr;
    @ApiModelProperty(value = "模块11限流")
    private Integer isAcdcmod11Limitcurr;
    @ApiModelProperty(value = "模块12过压")
    private Integer isAcdcmod12Overvol;
    @ApiModelProperty(value = "模块12欠压")
    private Integer isAcdcmod12Undervol;
    @ApiModelProperty(value = "模块12过流")
    private Integer isAcdcmod12Overcurr;
    @ApiModelProperty(value = "模块12交流异常")
    private Integer isAcdcmod12Acerr;
    @ApiModelProperty(value = "模块12限流")
    private Integer isAcdcmod12Limitcurr;
    @ApiModelProperty(value = "模块13过压")
    private Integer isAcdcmod13Overvol;
    @ApiModelProperty(value = "模块13欠压")
    private Integer isAcdcmod13Undervol;
    @ApiModelProperty(value = "模块13过流")
    private Integer isAcdcmod13Overcurr;
    @ApiModelProperty(value = "模块13交流异常")
    private Integer isAcdcmod13Acerr;
    @ApiModelProperty(value = "模块13限流")
    private Integer isAcdcmod13Limitcurr;
    @ApiModelProperty(value = "模块14过压")
    private Integer isAcdcmod14Overvol;
    @ApiModelProperty(value = "模块14欠压")
    private Integer isAcdcmod14Undervol;
    @ApiModelProperty(value = "模块14过流")
    private Integer isAcdcmod14Overcurr;
    @ApiModelProperty(value = ".模块14交流异常")
    private Integer isAcdcmod14Acerr;
    @ApiModelProperty(value = "模块14限流")
    private Integer isAcdcmod14Limitcurr;
    @ApiModelProperty(value = "模块15过压")
    private Integer isAcdcmod15Overvol;
    @ApiModelProperty(value = "模块15欠压")
    private Integer isAcdcmod15Undervol;
    @ApiModelProperty(value = "模块15过流")
    private Integer isAcdcmod15Overcurr;
    @ApiModelProperty(value = "模块15交流异常")
    private Integer isAcdcmod15Acerr;
    @ApiModelProperty(value = "模块15限流")
    private Integer isAcdcmod15Limitcurr;
    @ApiModelProperty(value = "模块16过压")
    private Integer isAcdcmod16Overvol;
    @ApiModelProperty(value = "模块16欠压")
    private Integer isAcdcmod16Undervol;
    @ApiModelProperty(value = "模块16过流")
    private Integer isAcdcmod16Overcurr;
    @ApiModelProperty(value = "模块16交流异常")
    private Integer isAcdcmod16Acerr;
    @ApiModelProperty(value = "模块16限流")
    private Integer isAcdcmod16Limitcurr;
    @ApiModelProperty(value = "交流输入1熔断")
    private Integer isAcin1Fuse;
    @ApiModelProperty(value = "交流输入2熔断")
    private Integer isAcin2Fuse;
    @ApiModelProperty(value = "交流输入1三相不平衡")
    private Integer isAcin1Unbanlance;
    @ApiModelProperty(value = "交流输入2三相不平衡")
    private Integer isAcin2Unbanlance;
    @ApiModelProperty(value = "交流输入1频率异常")
    private Integer isAcin1Freqerr;
    @ApiModelProperty(value = "交流输入2频率异常")
    private Integer isAcin2Freqerr;
    @ApiModelProperty(value = "电池组1电压低")
    @TableField("is_battgroup1_volLow")
    private Integer isBattgroup1Vollow;
    @ApiModelProperty(value = "电池组2电压低")
    @TableField("is_battgroup2_volLow")
    private Integer isBattgroup2Vollow;
    @ApiModelProperty(value = "直流总故障")
    private Integer isDcoutTotalAlarm;
    @ApiModelProperty(value = "交流总故障")
    private Integer isAcinTotalAlarm;
    @ApiModelProperty(value = "模块1均充")
    private Integer isAcdcmod1Junchg;
    @ApiModelProperty(value = "模块2均充")
    private Integer isAcdcmod2Junchg;
    @ApiModelProperty(value = "模块3均充")
    private Integer isAcdcmod3Junchg;
    @ApiModelProperty(value = "模块4均充")
    private Integer isAcdcmod4Junchg;
    @ApiModelProperty(value = "模块5均充")
    private Integer isAcdcmod5Junchg;
    @ApiModelProperty(value = "模块6均充")
    private Integer isAcdcmod6Junchg;
    @ApiModelProperty(value = "模块7均充")
    private Integer isAcdcmod7Junchg;
    @ApiModelProperty(value = "模块8均充")
    private Integer isAcdcmod8Junchg;
    @ApiModelProperty(value = "模块9均充")
    private Integer isAcdcmod9Junchg;
    @ApiModelProperty(value = "模块10均充")
    private Integer isAcdcmod10Junchg;
    @ApiModelProperty(value = "模块11均充")
    private Integer isAcdcmod11Junchg;
    @ApiModelProperty(value = "模块12均充")
    private Integer isAcdcmod12Junchg;
    @ApiModelProperty(value = "模块13均充")
    private Integer isAcdcmod13Junchg;
    @ApiModelProperty(value = "模块14均充")
    private Integer isAcdcmod14Junchg;
    @ApiModelProperty(value = "模块15均充")
    private Integer isAcdcmod15Junchg;
    @ApiModelProperty(value = "模块16均充")
    private Integer isAcdcmod16Junchg;
    @ApiModelProperty(value = "协转与电源通信故障")
    private Integer isPowerdevCommerr;
    @ApiModelProperty(value = "交流1路输入A相电压-电表")
    private Float useracin1Vola;
    @ApiModelProperty(value = "交流1路输入B相电压-电表")
    private Float useracin1Volb;
    @ApiModelProperty(value = "交流1路输入C相电压-电表")
    private Float useracin1Volc;
    @ApiModelProperty(value = "交流1路输入A相电流-电表")
    private Float useracin1Curra;
    @ApiModelProperty(value = "交流1路输入B相电流-电表")
    private Float useracin1Currb;
    @ApiModelProperty(value = "交流1路输入C相电流-电表")
    private Float useracin1Currc;
    @ApiModelProperty(value = "交流1路频率-电表")
    private Float useracin1Freq;
    @ApiModelProperty(value = "交流2路输入A相电压-电表")
    private Float useracin2Vola;
    @ApiModelProperty(value = "交流2路输入B相电压-电表")
    private Float useracin2Volb;
    @ApiModelProperty(value = "交流2路输入C相电压-电表")
    private Float useracin2Volc;
    @ApiModelProperty(value = "交流2路输入A相电流-电表")
    private Float useracin2Curra;
    @ApiModelProperty(value = "交流2路输入B相电流-电表")
    private Float useracin2Currb;
    @ApiModelProperty(value = "交流2路输入C相电流-电表")
    private Float useracin2Currc;
    @ApiModelProperty(value = "交流2路频率-电表")
    private Float useracin2Freq;
    @ApiModelProperty(value = "温度1-电表")
    private Float mTemper1;
    @ApiModelProperty(value = "温度2-电表")
    private Float mTemper2;
    @ApiModelProperty(value = "温度3-电表")
    private Float mTemper3;
    @ApiModelProperty(value = "湿度1-电表")
    private Float mHumidity1;
    @ApiModelProperty(value = "湿度2-电表")
    private Float mHumidity2;
    @ApiModelProperty(value = "湿度3-电表")
    private Float mHumidity3;
    @ApiModelProperty(value = "交流1路停电-电表")
    private Integer useracin1Powerdown;
    @ApiModelProperty(value = "交流1路电表通信故障-电表")
    private Integer useracin1Commerr;
    @ApiModelProperty(value = "交流2路停电-电表")
    private Integer useracin2Powerdown;
    @ApiModelProperty(value = "交流2路电表通信故障-电表")
    private Integer useracin2Commerr;
    @ApiModelProperty(value = "温度传感器1通信故障-电表")
    private Integer isTempCommerr1;
    @ApiModelProperty(value = "温度传感器2通信故障-电表")
    private Integer isTempCommerr2;
    @ApiModelProperty(value = "温度传感器3通信故障-电表")
    private Integer isTempCommerr3;
    @ApiModelProperty(value = "湿度传感器1通信故障-电表")
    private Integer isHumiCommerr1;
    @ApiModelProperty(value = "湿度传感器2通信故障-电表")
    private Integer isHumiCommerr2;
    @ApiModelProperty(value = "湿度传感器3通信故障-电表")
    private Integer isHumiCommerr3;
    @ApiModelProperty(value = "烟雾1告警-电表")
    private Integer isSmokeAlarm1;
    @ApiModelProperty(value = "烟雾1传感器通信故障-电表")
    private Integer isSmokeCommerr1;
    @ApiModelProperty(value = "烟雾2告警-电表")
    private Integer isSmokeAlarm2;
    @ApiModelProperty(value = "烟雾2传感器通信故障-电表")
    private Integer isSmokeCommerr2;
    @ApiModelProperty(value = "烟雾3告警-电表")
    private Integer isSmokeAlarm3;
    @ApiModelProperty(value = "烟雾3传感器通信故障-电表")
    private Integer isSmokeCommerr3;
    @ApiModelProperty(value = "交流2路输入A相电流")
    private Float acin2Curra;
    @ApiModelProperty(value = "交流2路输入B相电流")
    private Float acin2Currb;
    @ApiModelProperty(value = "交流2路输入C相电流")
    private Float acin2Currc;
    @ApiModelProperty(value = "交流输入1分合闸状态:0---未知(用于兼容以前的),1-分闸,2-合闸,3-脱扣")
    private Integer acin1SwitchSt;
    @ApiModelProperty(value = "交流输入2分合闸状态    :0---未知(用于兼容以前的),1-分闸,2-合闸,3-脱扣")
    private Integer acin2SwitchSt;
}
src/main/java/com/whyc/service/BattRealdataIdService.java
New file
@@ -0,0 +1,39 @@
package com.whyc.service;
import com.whyc.dto.Real.QuarterData;
import com.whyc.dto.Response;
import com.whyc.mapper.CommonMapper;
import com.whyc.pojo.db_data_history.BattRealdataId;
import com.whyc.util.ActionUtil;
import com.whyc.util.SubTablePageInfoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
@Service
public class BattRealdataIdService {
    @Autowired
    private SubTablePageInfoService subTablePageInfoService;
    @Resource
    private CommonMapper commonMapper;
    //获取电池组最近一季度的单体数据
    public Response getBattQuarter(Integer battgroupId) {
        HashMap<String,Object> map = new HashMap<>();
        List<String> datelist = ActionUtil.getLastQuarterYearMonths();
        for (String date:datelist) {
            String tableName ="db_data_history.tb_batt_realdata_"+battgroupId+"_"+date;
            String existTableName = commonMapper.existTable("db_data_history", "tb_batt_realdata_"+battgroupId+"_"+date);
            if(existTableName == null){
                continue;
            }
            //判断表是否存在
            List<QuarterData> list=subTablePageInfoService.getBattRealHis(tableName,"mon_vol");
            map.put(date,list);
        }
        return new Response().setII(1,map.size()>0,map,"获取电池组最近一季度的数据");
    }
}
src/main/java/com/whyc/service/BattRtdataService.java
New file
@@ -0,0 +1,23 @@
package com.whyc.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.whyc.mapper.BattRtdataMapper;
import com.whyc.pojo.db_ram_db.BattRtdata;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class BattRtdataService {
    @Autowired(required = false)
    private BattRtdataMapper mapper;
    //实时获取单体信息
    public List<BattRtdata> getRtdataRealInfo(Integer battgroupId) {
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.eq("battgroup_id",battgroupId);
        wrapper.orderByAsc("mon_num");
        List<BattRtdata> list=mapper.selectList(wrapper);
        return list;
    }
}
src/main/java/com/whyc/service/SubTablePageInfoService.java
@@ -4,9 +4,11 @@
import com.whyc.dto.AlmHis.BattAlmPar;
import com.whyc.dto.AlmHis.DevAlmPar;
import com.whyc.dto.AlmHis.PwrAlmPar;
import com.whyc.dto.Real.QuarterData;
import com.whyc.mapper.CallBack;
import com.whyc.pojo.db_alarm.BattalarmDataHistory;
import com.whyc.pojo.db_alarm.DevalarmDataHistory;
import com.whyc.pojo.db_data_history.BattRealdataId;
import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarmHistory;
import com.whyc.util.ThreadLocalUtil;
import org.springframework.beans.factory.annotation.Autowired;
@@ -465,5 +467,23 @@
        });
        return  list;
    }
    //获取电池组某一年月的数据
    public List<QuarterData> getBattRealHis(String tableName,String columnName) {
        String sql="select  distinct mon_num,record_time,"+columnName+"  from "+tableName+" order by record_time asc";
        List<QuarterData> list = sqlExecuteService.executeQuery_call(sql, new CallBack() {
            @Override
            public List getResults(ResultSet rs) throws SQLException {
                List<QuarterData> list=new ArrayList<>();
                while (rs.next()){
                    QuarterData data=new QuarterData();
                    data.setRecordTime(rs.getTimestamp("record_time"));
                    data.setNumValue(rs.getFloat(columnName));
                    data.setMonNum(rs.getInt("mon_num"));
                    list.add(data);
                }
                return list;
            }
        });
        return list;
    }
}
src/main/java/com/whyc/util/ActionUtil.java
@@ -17,9 +17,8 @@
import java.lang.reflect.Type;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.time.LocalDate;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.whyc.pojo.db_user.User;
@@ -418,6 +417,32 @@
            return 0;
        }
        }
    //计算当前月的上一个季度年_月份集合
    public static List<String> getLastQuarterYearMonths() {
        LocalDate currentDate = LocalDate.now();
        int currentYear = currentDate.getYear();
        int currentMonth = currentDate.getMonthValue();
        int quarter = (currentMonth - 1) / 3 + 1; // 计算当前季度
        int lastQuarter = quarter - 1; // 上一季度
        if (lastQuarter == 0) {
            lastQuarter = 4; // 如果当前是第一季度,则上一季度为第四季度
        }
        List<String> yearMonths = new ArrayList<>();
        for (int i = 1; i <= 3; i++) {
            int month = (lastQuarter - 1) * 3 + i;
            int year = currentYear;
            // 如果上一季度是第四季度,则年份需要减一年
            if (lastQuarter == 4) {
                year = currentYear - 1;
            }
            yearMonths.add(year + "_" + (month < 10 ? "0" + month : month)); // 保证月份为两位格式
        }
        return yearMonths;
    }
    /**
     * @Description: 根据图片地址转换为base64编码字符串
     * @Author: 
src/main/java/com/whyc/webSocket/RealTimeSocket.java
@@ -6,6 +6,7 @@
import com.whyc.dto.Response;
import com.whyc.factory.BattCapFactory;
import com.whyc.pojo.db_batt_testdata.BatttestdataInf;
import com.whyc.pojo.db_ram_db.BattRtdata;
import com.whyc.pojo.db_ram_db.BattRtstate;
import com.whyc.pojo.db_ram_db.DeviceState;
import com.whyc.pojo.db_ram_db.PwrdevAcdcdata;
@@ -23,6 +24,7 @@
import javax.websocket.*;
import javax.websocket.server.ServerEndpoint;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Component
@@ -56,6 +58,9 @@
    //电源信息
    private static PowerInfService powerInfService;
    //单体信息
    private static BattRtdataService rtdataService;
    private volatile boolean runFlag = true;
@@ -114,6 +119,11 @@
    @Autowired
    public void setPowerInfService(PowerInfService powerInfService) {
        RealTimeSocket.powerInfService = powerInfService;
    }
    @Autowired
    public void setBattRtdataService(BattRtdataService rtdataService) {
        RealTimeSocket.rtdataService = rtdataService;
    }
@@ -286,11 +296,45 @@
    }
    //获取内阻界面信息
    private Response getResPage(RealTimeDto realDto) {
        return new Response().set(1);
        Map<String, Object> map=new HashMap<>();
        try {
            //实时获取单体信息
            List<BattRtdata> rtdataList = rtdataService.getRtdataRealInfo(realDto.getBattgroupId());
            map.put("rtdataList",rtdataList);
            return new Response().setII(1,true,map,"电压界面信息推送");
        }catch (Exception e){
            return new Response().set(1,false,"电压界面信息推送");
        }
    }
    //获取电压界面信息
    private Response getVolPage(RealTimeDto realDto) {
        return new Response().set(1);
        Map<String, Object> map=new HashMap<>();
        Float maxVol=0f;
        Float minVol=0f;
        Float avgVol=0f;
        try {
            //实时获取单体信息
            List<BattRtdata> rtdataList = rtdataService.getRtdataRealInfo(realDto.getBattgroupId());
            if(rtdataList!=null&&rtdataList.size()>0){
                for(BattRtdata battRtdata:rtdataList) {
                    if (battRtdata.getMonVol() > maxVol) {
                        maxVol = battRtdata.getMonVol();
                    }
                    if (battRtdata.getMonVol() < minVol) {
                        minVol = battRtdata.getMonVol();
                    }
                    avgVol += battRtdata.getMonVol();
                }
                avgVol=avgVol/rtdataList.size();
            }
            map.put("rtdataList",rtdataList);
            map.put("maxVol",maxVol);
            map.put("minVol",minVol);
            map.put("avgVol",avgVol);
            return new Response().setII(1,true,map,"电压界面信息推送");
        }catch (Exception e){
            return new Response().set(1,false,"电压界面信息推送");
        }
    }
    //获取电源界面信息
    private Response getPowerPage(RealTimeDto realDto) {
@@ -317,9 +361,9 @@
            //获取上一次标准核容信息
            BatttestdataInf tinfData= batttestdataInfService.getLastStandardTestData(realDto.getBattgroupId());
            map.put("tinfData",tinfData);
            //获取近半小时电源数据
            //获取近半小时整流器数据
            //获取近半小时核容设备数据
            //获取近半小时电源数据,整流器数据,核容设备数据(推送实时,接口查询最近半小时数据)
            PwrdevAcdcdata pwrdevAcdcdata = pwrdevAcdcdataService.getPwrRealInfo(realDto.getPowerId());
            map.put("pwrdevAcdcdata",pwrdevAcdcdata);
            return new Response().setII(1,true,map,"系统概述推送");
        }catch (Exception e) {
            e.printStackTrace();