2753ad7aee272a5a5a8a0124b1feea5a1e4cc83e..8c635598000e40edfb3edf5934124ad48d60f62d
5 天以前 whyclxw
实时页面修改
8c6355 对比 | 目录
5 天以前 whyclxw
预警分析改为告警开始时间往前推设置时间到告警开始后1小时数据
5b1cf6 对比 | 目录
5 天以前 whyclxw
实时页面时间间隔显示电源心跳包数据修改
210efc 对比 | 目录
5 天以前 whyclxw
预警分析管理修改
bc180b 对比 | 目录
5 天以前 whyclxw
预警分析管理修改
4b3cef 对比 | 目录
5 天以前 whyclxw
添加电源时默认添加实时页面心跳配置
224a07 对比 | 目录
5 天以前 whyclxw
修改实时页面电源前N笔数据心跳包
a87fc3 对比 | 目录
5 天以前 whyclxw
实时界面电源状态修改
35030c 对比 | 目录
5 天以前 whyclxw
实时界面电源状态修改
0ecf59 对比 | 目录
5 天以前 whyclxw
平台文档提交
374a16 对比 | 目录
5 天以前 whyclxw
故障告警改为其他故障告警
b9433d 对比 | 目录
5 天以前 whyclxw
添加用户时校验了用户名,用后台的返回文本
927108 对比 | 目录
5 天以前 whyclxw
1.2.1查询条件修改
11158b 对比 | 目录
5 天以前 whyclxw
实时界面资产信息管理查询所有的变更记录
a7ad42 对比 | 目录
5 天以前 whyclxw
实时界面资产信息管理查询所有的变更记录
58dac8 对比 | 目录
5 天以前 whyclxw
资产管理添加变更记录,查询时需要将最近2次的变更记录查询出来
ea0e6a 对比 | 目录
5 天以前 whyclxw
预警分析添加设备实时告警
bae185 对比 | 目录
31个文件已修改
11个文件已添加
824 ■■■■ 已修改文件
PlateFormFile/6.21审查.docx 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/constant/PowerAlarmEnum.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/AnalysisAlmController.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/RealContoller.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/dto/AnalysisAlm/AnalysisChangeRes.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/dto/InfoDto.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/dto/Param/AlmAnalyseDto.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/BattInfChangeMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/BattInfMapper.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/DevalarmDataMapper.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/PowerInfChangeMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/PowerheartParamMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/StationInfChangeMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/db_alarm/DevalarmData.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/db_param/PowerheartParam.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/db_pwrdev_alarm/PwrdevAlarm.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/db_station/BattInf.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/db_station/BattInfChange.java 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/db_station/PowerInf.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/db_station/PowerInfChange.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/db_station/StationInf.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/db_station/StationInfChange.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/AlmAnalysisParamService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/AppParamService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BattInfService.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BattRealdataIdService.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BattalarmDataService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/DevalarmDataService.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/InfoChangeService.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/PowerInfService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/PowerheartParamService.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/PwrdevAlarmService.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/PwrdevHistorydataIdService.java 95 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/StationInfService.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/SubTablePageInfoService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/UserService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/webSocket/RealTimeSocket.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BattInfMapper.xml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BattalarmDataMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/DevalarmDataMapper.xml 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/PowerInfMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/PwrdevAlarmMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PlateFormFile/6.21Éó²é.docx
Binary files differ
src/main/java/com/whyc/constant/PowerAlarmEnum.java
@@ -204,7 +204,7 @@
        for (PowerAlarmEnum logOpEnum : PowerAlarmEnum.values()) {
            if(logOpEnum.getStateId()/100000==30){
                almmap30.put(logOpEnum.getStateId(),logOpEnum.getStateName());
                map.put("故障告警",almmap30);
                map.put("其他故障告警",almmap30);
            }
            if(logOpEnum.getStateId()/100000==31){
                almmap31.put(logOpEnum.getStateId(),logOpEnum.getStateName());
src/main/java/com/whyc/controller/AnalysisAlmController.java
@@ -1,12 +1,13 @@
package com.whyc.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whyc.constant.BattSingalIdEnum;
import com.whyc.dto.AnalysisAlm.AnalysisChangeRes;
import com.whyc.dto.Param.AlmAnalyseDto;
import com.whyc.dto.Response;
import com.whyc.service.AlmAnalysisParamService;
import com.whyc.service.BattRealdataIdService;
import com.whyc.service.BattalarmDataService;
import com.whyc.service.PwrdevAlarmService;
import com.whyc.pojo.db_alarm.BattalarmData;
import com.whyc.service.*;
import com.whyc.util.ActionUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -14,6 +15,7 @@
import org.springframework.web.bind.annotation.*;
import java.text.ParseException;
import java.util.List;
@RequestMapping("analysis")
@RestController
@@ -27,12 +29,27 @@
    @Autowired
    private AlmAnalysisParamService almAnalysisParamService;
    @Autowired
    private DevalarmDataService  devalarmDataService;
    @Autowired
    private AppParamService appParamService;
    @PostMapping("getBattAlmAnalyse")
    @ApiOperation("预警分析管理-电池告警")
    public Response getBattAlmAnalyse(@RequestBody AlmAnalyseDto dto){
        Integer uid= ActionUtil.getUser().getId();
        dto.setUid(uid);
        return battalarmDataService.getBattAlmAnalyse(dto);
    }
    @PostMapping("getDevAlmAnalyse")
    @ApiOperation("预警分析管理-设备告警")
    public Response getDevAlmAnalyse(@RequestBody AlmAnalyseDto dto){
        Integer uid= ActionUtil.getUser().getId();
        dto.setUid(uid);
        return devalarmDataService.getDevAlmAnalyse(dto);
    }
    @PostMapping("getPwrtAlmAnalyse")
@@ -61,4 +78,10 @@
        return almAnalysisParamService.getAlmSummaryParam();
    }
    @PostMapping("updateAlarmAnalysisCycle")
    @ApiOperation("预警分析管理-设置时间间隔")
    public Response updateAlarmAnalysisCycle(@RequestParam Integer intervalTime){
        return appParamService.updateAlarmAnalysisCycle(intervalTime);
    }
}
src/main/java/com/whyc/controller/RealContoller.java
@@ -31,22 +31,22 @@
    @Autowired
    private BatttestdataIdService tdataIdService;
    @ApiOperation(value = "系统概览获取半小时交流输入统计")
    @GetMapping("getHalfHourPwrHisAcinData")
    public Response getHalfHourPwrHisAcinData(@RequestParam Integer powerId,@RequestParam Integer granularity){
        return pwrdevHistorydataIdService.getHalfHourPwrHisAcinData(powerId,granularity);
    @ApiOperation(value = "系统概览获取前一百比时间间隔数据交流输入统计")
    @GetMapping("getPwrHisAcinData100")
    public Response getPwrHisAcinData100(@RequestParam Integer powerId) throws ParseException, InterruptedException {
        return pwrdevHistorydataIdService.getPwrHisAcinData100(powerId);
    }
    @ApiOperation(value = "系统概览获取半小时直流输出统计")
    @GetMapping("getHalfHourPwrHisDcoutData")
    public Response getHalfHourPwrHisDcoutData(@RequestParam Integer powerId,@RequestParam Integer granularity){
        return pwrdevHistorydataIdService.getHalfHourPwrHisDcoutData(powerId,granularity);
    @ApiOperation(value = "系统概览获取前一百比时间间隔数据直流输出统计")
    @GetMapping("getPwrHisDcoutData100")
    public Response getPwrHisDcoutData100(@RequestParam Integer powerId){
        return pwrdevHistorydataIdService.getHalfHourPwrHisDcoutData(powerId);
    }
    @ApiOperation(value = "系统概览获取半小时核容设备信息")
    @GetMapping("getHalfHourBattDevData")
    public Response getHalfHourBattDevData(@RequestParam Integer battgroupId,@RequestParam Integer granularity){
        return battRealdataIdService.getHalfHourBattDevData(battgroupId,granularity);
    @ApiOperation(value = "系统概览获取前一百比时间间隔数据核容设备信息")
    @GetMapping("getBattDevData100")
    public Response getBattDevData100(@RequestParam Integer powerId,@RequestParam Integer battgroupId){
        return battRealdataIdService.getBattDevData100(powerId,battgroupId);
    }
    @ApiOperation(value = "历史测试记录")
src/main/java/com/whyc/dto/AnalysisAlm/AnalysisChangeRes.java
@@ -7,7 +7,6 @@
    private Integer battgroupId;
    private Integer powerId;
    private String startTime;
    private Integer intervalTime;
    private String dataName1;
    private Integer dataType1;
    private String dataName2;
src/main/java/com/whyc/dto/InfoDto.java
@@ -3,10 +3,15 @@
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.whyc.pojo.db_station.BattInf;
import com.whyc.pojo.db_station.BattInfChange;
import com.whyc.pojo.db_station.PowerInfChange;
import com.whyc.pojo.db_station.StationInfChange;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class InfoDto {
@@ -40,6 +45,8 @@
    @ApiModelProperty(value = "站点类型[0-非节点站,1-节点站]")
    private Integer nodeStation;
    private List<StationInfChange> sinfChangeList;
    @ApiModelProperty(value = "电源id")
@@ -124,4 +131,7 @@
    @ApiModelProperty(value = "标识是否加入电池组1:添加,0不添加")
    private Integer addBinfFlag;
    @ApiModelProperty(value = "变更原因")
    private String updateReason;
}
src/main/java/com/whyc/dto/Param/AlmAnalyseDto.java
@@ -11,6 +11,7 @@
    private String country;
    private Integer stationId;
    private Integer powerId;
    private Integer devId;
    private Integer battgroupId;
    private List<Integer> almIdList;
    private Integer uid;
src/main/java/com/whyc/mapper/BattInfChangeMapper.java
New file
@@ -0,0 +1,6 @@
package com.whyc.mapper;
import com.whyc.pojo.db_station.BattInfChange;
public interface BattInfChangeMapper extends CustomMapper<BattInfChange>{
}
src/main/java/com/whyc/mapper/BattInfMapper.java
@@ -64,5 +64,7 @@
    //根据查询条件获取电池组集合
    BattInf getBattgroupIdInf(@Param("battgroupId") Integer battgroupId);
    //查询电源下所有的电池组id
    List<Integer> getBattgroupIdList(@Param("powerId") Integer powerId);
    List<BattInf> getBattgroupIdListByPowerId(@Param("powerId") Integer powerId);
    //查询设备下所有的电池组id
    List<BattInf> getBattgroupIdListByDevId(@Param("devId") Integer devId);
}
src/main/java/com/whyc/mapper/DevalarmDataMapper.java
@@ -1,9 +1,11 @@
package com.whyc.mapper;
import com.whyc.dto.AlarmDto;
import com.whyc.dto.Param.AlmAnalyseDto;
import com.whyc.dto.Real.AlmDto;
import com.whyc.pojo.db_alarm.DevalarmData;
import com.whyc.pojo.web_site.AlarmInspection;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -14,5 +16,6 @@
    List<AlarmInspection> getListGreatThan(Long devAlarmId);
    List<AlarmDto> getListByUserId(Integer userId, Integer almLevel);
    //预警分析管理-设备告警
    List<DevalarmData> getDevAlmAnalyse(AlmAnalyseDto almDto);
}
src/main/java/com/whyc/mapper/PowerInfChangeMapper.java
New file
@@ -0,0 +1,6 @@
package com.whyc.mapper;
import com.whyc.pojo.db_station.PowerInfChange;
public interface PowerInfChangeMapper extends CustomMapper<PowerInfChange>{
}
src/main/java/com/whyc/mapper/PowerheartParamMapper.java
New file
@@ -0,0 +1,6 @@
package com.whyc.mapper;
import com.whyc.pojo.db_param.PowerheartParam;
public interface PowerheartParamMapper extends CustomMapper<PowerheartParam>{
}
src/main/java/com/whyc/mapper/StationInfChangeMapper.java
New file
@@ -0,0 +1,6 @@
package com.whyc.mapper;
import com.whyc.pojo.db_station.StationInfChange;
public interface StationInfChangeMapper extends CustomMapper<StationInfChange>{
}
src/main/java/com/whyc/pojo/db_alarm/DevalarmData.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.whyc.pojo.db_station.BattInf;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -12,6 +13,7 @@
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
 * <p>
@@ -93,5 +95,7 @@
    private String country;
    @TableField(exist = false)
    private String fullName;
    @TableField(exist = false)
    private List<BattInf> binfList;
}
src/main/java/com/whyc/pojo/db_param/PowerheartParam.java
New file
@@ -0,0 +1,57 @@
package com.whyc.pojo.db_param;
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;
/**
 * <p>
 * ç”µæºå¿ƒè·³é…ç½®å‚数表
 * </p>
 *
 * @author lxw
 * @since 2025-06-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(schema = "db_param",value ="tb_powerheart_param")
@ApiModel(value="PowerheartParam对象", description="电源心跳配置参数表")
public class PowerheartParam implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "自增主键")
    @TableId(value = "num", type = IdType.AUTO)
    private Long num;
    @ApiModelProperty(value = "电源ID")
    private Integer powerId;
    @ApiModelProperty(value = "交流输入曲线数据间隔(分钟)")
    private Integer acinInterverCfg;
    @ApiModelProperty(value = "交流输入展示笔数")
    private Integer acinCountCfg;
    @ApiModelProperty(value = "直流输入间隔配置(分钟)")
    private Integer acoutInterverCfg;
    @ApiModelProperty(value = "直流输入展示笔数")
    private Integer acoutCountCfg;
    @ApiModelProperty(value = "核容设备信息间隔配置(分钟)")
    private Integer hrInterverCfg;
    @ApiModelProperty(value = "核容设备信息展示笔数")
    private Integer hrCountCfg;
}
src/main/java/com/whyc/pojo/db_pwrdev_alarm/PwrdevAlarm.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.whyc.pojo.db_station.BattInf;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -88,5 +89,5 @@
    private String fullName;
    @TableField(exist = false)
    private List<Integer> battgroupIdList;
    private List<BattInf> binfList;
}
src/main/java/com/whyc/pojo/db_station/BattInf.java
@@ -10,6 +10,7 @@
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
 * <p>
@@ -118,4 +119,7 @@
    @TableField(exist = false)
    @ApiModelProperty(value = "包机组名称")
    private String baojiGroupName;
    @TableField(exist = false)
    private List<BattInfChange> binfChangeList;
}
src/main/java/com/whyc/pojo/db_station/BattInfChange.java
New file
@@ -0,0 +1,93 @@
package com.whyc.pojo.db_station;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
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>
 * ç”µæ± ä¿¡æ¯å˜æ›´è®°å½•表
 * </p>
 *
 * @author lxw
 * @since 2025-06-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(schema = "db_station",value = "tb_batt_inf_change")
@ApiModel(value="BattInfChange对象", description="电池信息变更记录表")
public class BattInfChange implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键")
    @TableId(value = "num", type = IdType.AUTO)
    private Integer num;
    @ApiModelProperty(value = "机房Id")
    private Integer stationId;
    @ApiModelProperty(value = "电源id")
    private Integer powerId;
    @ApiModelProperty(value = "设备id")
    private Integer devId;
    @ApiModelProperty(value = "设备ip")
    private String devIp;
    @ApiModelProperty(value = "设备名称")
    private String devName;
    @ApiModelProperty(value = "电池组id")
    private Integer battgroupId;
    @ApiModelProperty(value = "电池组名称")
    private String battgroupName;
    @ApiModelProperty(value = "电池组编号")
    private Integer battgroupNum;
    @ApiModelProperty(value = "标称电压")
    private Float monvolstd;
    @ApiModelProperty(value = "标称容量")
    private Float moncapstd;
    @ApiModelProperty(value = "标称内阻")
    private Float monresstd;
    @ApiModelProperty(value = "品牌")
    private String product;
    @ApiModelProperty(value = "型号")
    private String battModel;
    @ApiModelProperty(value = "一组单体个数")
    private Integer moncount;
    @ApiModelProperty(value = "设备编号")
    private Integer devNum;
    @ApiModelProperty(value = "设备类型")
    private String devType;
    @ApiModelProperty(value = "投入使用时间")
    private Date inuseTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date updateTime;
    @ApiModelProperty(value = "变更原因")
    private String updateReason;
}
src/main/java/com/whyc/pojo/db_station/PowerInf.java
@@ -13,6 +13,7 @@
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
 * <p>
@@ -89,5 +90,7 @@
    @TableField(exist = false)
    private String stationType;
    @TableField(exist = false)
    private List<PowerInfChange> pinfChangeList;
}
src/main/java/com/whyc/pojo/db_station/PowerInfChange.java
New file
@@ -0,0 +1,75 @@
package com.whyc.pojo.db_station;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
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>
 * ç”µæºä¿¡æ¯å˜æ›´è®°å½•表
 * </p>
 *
 * @author lxw
 * @since 2025-06-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(schema = "db_station",value = "tb_power_inf_change")
@ApiModel(value="PowerInfChange对象", description="电源信息变更记录表")
public class PowerInfChange implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键")
    @TableId(value = "num", type = IdType.AUTO)
    private Integer num;
    @ApiModelProperty(value = "机房Id")
    private Integer stationId;
    @ApiModelProperty(value = "电源id")
    private Integer powerId;
    @ApiModelProperty(value = "电源编号")
    private Integer powerNum;
    @ApiModelProperty(value = "电源名称")
    private String powerName;
    @ApiModelProperty(value = "厂家")
    private String company;
    @ApiModelProperty(value = "型号")
    private String powerModel;
    @ApiModelProperty(value = "协议")
    private String protocol;
    @ApiModelProperty(value = "电源ip")
    private String powerIp;
    @ApiModelProperty(value = "1:直流,2:通讯,3配网")
    private Integer powerType;
    @ApiModelProperty(value = "电源投入使用时间")
    private Date powerInuseTime;
    @ApiModelProperty(value = "整流器使能[bit0-模块1 bit15-模块16]【1-在用 0-不在用】")
    private Long modelCfg;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date updateTime;
    @ApiModelProperty(value = "变更原因")
    private String updateReason;
}
src/main/java/com/whyc/pojo/db_station/StationInf.java
@@ -1,6 +1,7 @@
package com.whyc.pojo.db_station;
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;
@@ -10,6 +11,7 @@
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
/**
 * <p>
@@ -65,4 +67,6 @@
    @ApiModelProperty(value = "站点类型[0-非节点站,1-节点站]")
    private Integer nodeStation;
    @TableField(exist = false)
    private List<StationInfChange> sinfChangeList;
}
src/main/java/com/whyc/pojo/db_station/StationInfChange.java
New file
@@ -0,0 +1,75 @@
package com.whyc.pojo.db_station;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
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>
 * æœºæˆ¿ä¿¡æ¯å˜æ›´è®°å½•表
 * </p>
 *
 * @author lxw
 * @since 2025-06-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(schema = "db_station",value = "tb_station_inf_change")
@ApiModel(value="StationInfChange对象", description="机房信息变更记录表")
public class StationInfChange implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键")
    @TableId(value = "num", type = IdType.AUTO)
    private Integer num;
    @ApiModelProperty(value = "机房Id")
    private Integer stationId;
    @ApiModelProperty(value = "站点名称")
    private String stationName;
    @ApiModelProperty(value = "省")
    private String provice;
    @ApiModelProperty(value = "市")
    private String city;
    @ApiModelProperty(value = "区县")
    private String country;
    @ApiModelProperty(value = "站点电压等级[(35kv/110kv/220kv å­—符串类型)]")
    private String stationType;
    @ApiModelProperty(value = "机房名称[拼接后的]")
    private String fullName;
    @ApiModelProperty(value = "经度")
    private Double longitude;
    @ApiModelProperty(value = "纬度")
    private Double latitude;
    @ApiModelProperty(value = "机房详细地址")
    private String stationAddr;
    @ApiModelProperty(value = "站点类型[0-非节点站,1-节点站]")
    private Integer nodeStation;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date updateTime;
    @ApiModelProperty(value = "变更原因")
    private String updateReason;
}
src/main/java/com/whyc/service/AlmAnalysisParamService.java
@@ -59,8 +59,9 @@
        AppParam appParam = appParamService.getAlarmAnalysisCycle();
        Integer cycleTime=appParam.getParamValue().intValue();
        Date cyscleDate=ActionUtil.getDateAdd(ThreadLocalUtil.parse(startTime,1),cycleTime*(-1));
        Date endTime=ActionUtil.getDateAdd(ThreadLocalUtil.parse(startTime,1),60);
        //获取cyscleDate到现在所有的历史实时数据
        List<List<Date>> monthTimeList = DateUtil.getMonthTime(cyscleDate,new Date());
        List<List<Date>> monthTimeList = DateUtil.getMonthTime(cyscleDate,endTime);
        //获取告警almId对应的分析配置属性值
        AlmAnalysisParam almAnalysisParam=getAnalysisParam(almId);
        if(almAnalysisParam==null||almAnalysisParam.getMainFieldType()==null){
@@ -206,16 +207,11 @@
        Integer cycleTime=0;
        //获取预警分析周期阈值
        AppParam appParam = appParamService.getAlarmAnalysisCycle();
        if(res.getIntervalTime()==null){
            cycleTime=appParam.getParamValue().intValue();
        }else{
            //将数据库中时间间隔修改
            appParamService.updateAlarmAnalysisCycle(res.getIntervalTime());
            cycleTime=res.getIntervalTime();
        }
        cycleTime=appParam.getParamValue().intValue();
        Date cyscleDate=ActionUtil.getDateAdd(ThreadLocalUtil.parse(res.getStartTime(),1),cycleTime*(-1));
        Date endTime=ActionUtil.getDateAdd(ThreadLocalUtil.parse(res.getStartTime(),1),60);
        //获取cyscleDate到现在所有的历史实时数据
        List<List<Date>> monthTimeList = DateUtil.getMonthTime(cyscleDate,new Date());
        List<List<Date>> monthTimeList = DateUtil.getMonthTime(cyscleDate,endTime);
        //获取告警almId对应的分析配置属性值
        AlmAnalysisParam almAnalysisParam=new AlmAnalysisParam();
src/main/java/com/whyc/service/AppParamService.java
@@ -63,10 +63,11 @@
        return param;
    }
    //将数据库中时间间隔修改
    public void updateAlarmAnalysisCycle(Integer intervalTime) {
    public Response updateAlarmAnalysisCycle(Integer intervalTime) {
        UpdateWrapper wrapper=new UpdateWrapper();
        wrapper.eq("param_name_psx","alm_analysis_already_time");
        wrapper.set("param_value",intervalTime);
        mapper.update(null,wrapper);
        int flag=mapper.update(null,wrapper);
        return new Response().set(1,flag>0,"修改成功");
    }
}
src/main/java/com/whyc/service/BattInfService.java
@@ -15,9 +15,7 @@
import com.whyc.mapper.BattInfMapper;
import com.whyc.mapper.PowerInfMapper;
import com.whyc.mapper.StationInfMapper;
import com.whyc.pojo.db_station.BattInf;
import com.whyc.pojo.db_station.PowerInf;
import com.whyc.pojo.db_station.StationInf;
import com.whyc.pojo.db_station.*;
import com.whyc.pojo.db_user.User;
import com.whyc.util.ActionUtil;
import org.springframework.beans.factory.annotation.Autowired;
@@ -42,6 +40,9 @@
    @Autowired(required = false)
    private BaojigroupService bjService;
    @Autowired(required = false)
    private InfoChangeService changeService;
    /*新建电池组(新的设备新的电池组)
     * @param binf
@@ -310,6 +311,11 @@
        }
        sinfMapper.update((StationInf) ActionUtil.objeNull,wrapper1);
        pinfMapper.update((PowerInf) ActionUtil.objeNull,wrapper2);
        //存入变更信息记录
        pinf.setStationId(sinf.getStationId());
        binf.setStationId(sinf.getStationId());
        binf.setPowerId(pinf.getPowerId());
        changeService.addInfoChange(sinf,pinf,binf,info.getUpdateReason());
        return new Response().set(1,true,"修改信息成功");
    }
    /*//修改电池组
@@ -401,6 +407,8 @@
        wrapper.eq("battgroup_id",battgroupId);
        wrapper.last("limit 1");
        BattInf binf=mapper.selectOne(wrapper);
        List<BattInfChange> binfChangeList=changeService.getBinfChange(battgroupId);
        binf.setBinfChangeList(binfChangeList);
        return binf;
    }
   //当没有内助测试时初始内阻值为标称内阻
@@ -495,7 +503,11 @@
        return mapper.getBattgroupIdInf(battgroupId);
    }
    //查询电源下所有的电池组id
    public List<Integer> getBattgroupIdList(Integer powerId) {
        return mapper.getBattgroupIdList(powerId);
    public List<BattInf> getBattgroupIdListByPowerId(Integer powerId) {
        return mapper.getBattgroupIdListByPowerId(powerId);
    }
    //查询设备下所有的电池组id
    public List<BattInf> getBattgroupIdListByDevId(Integer devId) {
        return mapper.getBattgroupIdListByDevId(devId);
    }
}
src/main/java/com/whyc/service/BattRealdataIdService.java
@@ -11,6 +11,7 @@
import com.whyc.pojo.db_data_history.BattRealdataId;
import com.whyc.pojo.db_param.AlmAnalysisParam;
import com.whyc.pojo.db_param.AppParam;
import com.whyc.pojo.db_param.PowerheartParam;
import com.whyc.pojo.db_ram_db.BattRtstate;
import com.whyc.pojo.db_station.BattInf;
import com.whyc.util.ActionUtil;
@@ -47,6 +48,9 @@
    @Autowired(required = false)
    private BattRtstateService rtstateService;
    @Autowired
    private PowerheartParamService heartService;
@@ -170,14 +174,22 @@
        }
        return new Response().setII(1,map.size()>0,map,"获取电池组最近一季度的温度数据");
    }
    //系统概览获取半小时核容设备信息
    public Response getHalfHourBattDevData(Integer battgroupId,Integer granularity) {
    //系统概览获取前N笔核容设备信息
    public Response getBattDevData100(Integer powerId,Integer battgroupId) {
        String dateTime = ActionUtil.sdfwithOutday.format(new Date());
        String tableName ="db_data_history.tb_batt_realdata_"+battgroupId+"_"+dateTime;
        //获取前笔数*时间间隔
        PowerheartParam heartParam=heartService.getHeartParamByPowerId(powerId);
        Integer interverCount=100*10;//默认值
        Integer granularity=10;//默认值
        if(heartParam!=null){
            interverCount=heartParam.getAcinInterverCfg()*heartParam.getAcinCountCfg();
            granularity=heartParam.getAcinInterverCfg();
        }
        //获取前半个小时数据
        LocalDateTime now = LocalDateTime.now();
        // è®¡ç®—半小时前的时间点
        LocalDateTime halfHourAgo = now.minusMinutes(30);
        LocalDateTime halfHourAgo = now.minusMinutes(interverCount);
        // æ ¼å¼åŒ–输出
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String halfHourAgoTime=halfHourAgo.format(formatter);
src/main/java/com/whyc/service/BattalarmDataService.java
@@ -38,6 +38,7 @@
        PageInfo pageInfo=new PageInfo(list);
        return new Response().setII(1,list!=null,pageInfo,"获取电池组实时告警信息");
    }
    //确认电池告警
    public Response updateBattConfrim(Integer num) {
        UpdateWrapper wrapper = new UpdateWrapper<>();
@@ -98,4 +99,5 @@
        PageInfo pageInfo=new PageInfo(list);
        return new Response().setII(1,list!=null,pageInfo,"电池告警分析");
    }
}
src/main/java/com/whyc/service/DevalarmDataService.java
@@ -9,10 +9,13 @@
import com.whyc.constant.BattSingalIdEnum;
import com.whyc.constant.DevAlarmEnum;
import com.whyc.dto.AlarmDto;
import com.whyc.dto.Param.AlmAnalyseDto;
import com.whyc.dto.Real.AlmDto;
import com.whyc.dto.Response;
import com.whyc.mapper.DevalarmDataMapper;
import com.whyc.pojo.db_alarm.BattalarmData;
import com.whyc.pojo.db_alarm.DevalarmData;
import com.whyc.pojo.db_station.BattInf;
import com.whyc.pojo.web_site.AlarmInspection;
import com.whyc.util.ActionUtil;
import org.springframework.beans.factory.annotation.Autowired;
@@ -28,6 +31,9 @@
public class DevalarmDataService {
    @Autowired(required = false)
    private DevalarmDataMapper mapper;
    @Autowired
    private BattInfService battInfService;
    //获取设备实时告警信息
    public Response getDevAlmReal(AlmDto almDto) {
        PageHelper.startPage(almDto.getPageNum(),almDto.getPageSize());
@@ -84,4 +90,18 @@
    public List<AlarmDto> getListByUserId(Integer userId,Integer almLevel) {
        return mapper.getListByUserId(userId,almLevel);
    }
    //预警分析管理-设备告警
    public Response getDevAlmAnalyse(AlmAnalyseDto almDto) {
        PageHelper.startPage(almDto.getPageNum(),almDto.getPageSize());
        List<DevalarmData> list=mapper.getDevAlmAnalyse(almDto);
        list.forEach(data->{
            data.setAlmName(DevAlarmEnum.getValue(data.getAlmId()));
            //查询设备下所有的电池组id
            List<BattInf> binfList = battInfService.getBattgroupIdListByDevId(data.getDevId());
            data.setBinfList(binfList);
        });
        PageInfo pageInfo=new PageInfo(list);
        return new Response().setII(1,list!=null,pageInfo,"获取设备实时告警信息");
    }
}
src/main/java/com/whyc/service/InfoChangeService.java
New file
@@ -0,0 +1,75 @@
package com.whyc.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.whyc.mapper.BattInfChangeMapper;
import com.whyc.mapper.PowerInfChangeMapper;
import com.whyc.mapper.StationInfChangeMapper;
import com.whyc.pojo.db_station.*;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class InfoChangeService {
    @Autowired(required = false)
    private StationInfChangeMapper sinfChangeMapper;
    @Autowired(required = false)
    private PowerInfChangeMapper pinfChangeMapper;
    @Autowired(required = false)
    private BattInfChangeMapper binfChangeMapper;
    //存入变更信息记录
    public void addInfoChange(StationInf sinf, PowerInf pinf, BattInf binf,String updateReason) {
        StationInfChange sinfChange = new StationInfChange();
        PowerInfChange pinfChange = new PowerInfChange();
        BattInfChange binfChange = new BattInfChange();
        Date updateTime = new Date();
        //将信息拷贝至对应的变更信息表
        BeanUtils.copyProperties(sinf,sinfChange);
        String fullName=sinf.getProvice()+"_"+sinf.getCity()+"_"+sinf.getCountry()+"_"+sinf.getStationName();
        sinfChange.setFullName(fullName);
        sinfChange.setUpdateTime(updateTime);
        sinfChange.setUpdateReason(updateReason);
        BeanUtils.copyProperties(pinf,pinfChange);
        pinfChange.setUpdateTime(updateTime);
        pinfChange.setUpdateReason(updateReason);
        BeanUtils.copyProperties(binf,binfChange);
        binfChange.setUpdateTime(updateTime);
        binfChange.setUpdateReason(updateReason);
        //将变更记录存入变更表
        sinfChangeMapper.insert(sinfChange);
        pinfChangeMapper.insert(pinfChange);
        binfChangeMapper.insert(binfChange);
    }
    //获取机房,电源,电池组变更记录
    public List<StationInfChange> getSinfChange(Integer stationId) {
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.eq("station_id",stationId);
        wrapper.orderByDesc("update_time");
        List<StationInfChange> list=sinfChangeMapper.selectList(wrapper);
        return list;
    }
    public List<PowerInfChange> getPinfChange(Integer powerId) {
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.eq("power_id",powerId);
        wrapper.orderByDesc("update_time");
        List<PowerInfChange> list=pinfChangeMapper.selectList(wrapper);
        return list;
    }
    public List<BattInfChange> getBinfChange(Integer battgroupId) {
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.eq("battgroup_id",battgroupId);
        wrapper.orderByDesc("update_time");
        List<BattInfChange> list=binfChangeMapper.selectList(wrapper);
        return list;
    }
}
src/main/java/com/whyc/service/PowerInfService.java
@@ -17,6 +17,7 @@
import com.whyc.mapper.StationInfMapper;
import com.whyc.pojo.db_station.BattInf;
import com.whyc.pojo.db_station.PowerInf;
import com.whyc.pojo.db_station.PowerInfChange;
import com.whyc.pojo.db_station.StationInf;
import com.whyc.pojo.db_user.BaojigroupPower;
import com.whyc.pojo.db_user.BaojigroupUsr;
@@ -44,6 +45,12 @@
    @Autowired(required = false)
    private BaojigroupPowerMapper bjPowerMapper;
    @Autowired(required = false)
    private InfoChangeService changeService;
    @Autowired
    private PowerheartParamService heartService;
    /*添加电源
    1.判断当前用户是否是包组用户
@@ -101,7 +108,8 @@
            //当前人所在的包机组添加电源机房
            insertInbaoji(stationId,powerId);
        }
        //添加完电源需要插入默认实时页面电源的心跳数据
        heartService.insertHeartData(powerId);
    }
    //当前人所在的包机组添加电源机房
    public void insertInbaoji(Integer stationId,Integer powerId){
@@ -144,6 +152,8 @@
        wrapper.eq("power_id",powerId);
        wrapper.last("limit 1");
        PowerInf pinf=mapper.selectOne(wrapper);
        List<PowerInfChange> pinfChangeList=changeService.getPinfChange(powerId);
        pinf.setPinfChangeList(pinfChangeList);
        return pinf;
    }
    //电源信息统计
src/main/java/com/whyc/service/PowerheartParamService.java
New file
@@ -0,0 +1,32 @@
package com.whyc.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.whyc.mapper.PowerheartParamMapper;
import com.whyc.pojo.db_param.PowerheartParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class PowerheartParamService {
    @Autowired(required = false)
    private PowerheartParamMapper mapper;
    //获取前笔数*时间间隔
    public PowerheartParam getHeartParamByPowerId(Integer powerId) {
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.eq("power_id",powerId);
        wrapper.last("limit 1");
        return mapper.selectOne(wrapper);
    }
    //添加完电源需要插入默认实时页面电源的心跳数据
    public void insertHeartData(int powerId) {
        PowerheartParam heartParam=new PowerheartParam();
        heartParam.setPowerId(powerId);
        heartParam.setAcinInterverCfg(5);
        heartParam.setAcinCountCfg(100);
        heartParam.setAcoutInterverCfg(5);
        heartParam.setAcoutCountCfg(100);
        heartParam.setHrInterverCfg(5);
        heartParam.setHrCountCfg(100);
        mapper.insert(heartParam);
    }
}
src/main/java/com/whyc/service/PwrdevAlarmService.java
@@ -21,6 +21,7 @@
import com.whyc.pojo.db_param.AppParam;
import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarm;
import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarmParam;
import com.whyc.pojo.db_station.BattInf;
import com.whyc.pojo.web_site.AlarmInspection;
import com.whyc.util.ActionUtil;
import com.whyc.util.DateUtil;
@@ -114,11 +115,19 @@
        for (PwrdevAlarm pwrAlm:list) {
            pwrAlm.setAlmName(PowerAlarmEnum.getValue(pwrAlm.getAlmId()));
            //查询电源下所有的电池组id
            List<Integer> battgroupIdList = battInfService.getBattgroupIdList(pwrAlm.getPowerId());
            pwrAlm.setBattgroupIdList(battgroupIdList);
            List<BattInf> binfList = battInfService.getBattgroupIdListByPowerId(pwrAlm.getPowerId());
            pwrAlm.setBinfList(binfList);
        }
        PageInfo pageInfo=new PageInfo(list);
        return new Response().setII(1,list!=null,pageInfo,"电源告警分析");
    }
    //查看当前是否存在交流停电告警
    public Integer judge3100014(Integer powerId) {
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.eq("power_id",powerId);
        wrapper.eq("alm_id",PowerAlarmEnum.ALARM_3100014);
        wrapper.last("limit 1");
        PwrdevAlarm alm=mapper.selectOne( wrapper);
        return alm!=null?1:0;
    }
}
src/main/java/com/whyc/service/PwrdevHistorydataIdService.java
@@ -2,32 +2,40 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.whyc.constant.PwrCapperformanceEnum;
import com.whyc.dto.AnalysisAlm.ResAnalysis;
import com.whyc.dto.Real.CompareDto;
import com.whyc.dto.Real.PwrHisRealAcInDto;
import com.whyc.dto.Real.PwrHisRealDcoutInDto;
import com.whyc.dto.Real.QuarterDto;
import com.whyc.dto.Response;
import com.whyc.dto.Statistic.QuarterPwr7Res;
import com.whyc.factory.ThreadPoolExecutorFactory;
import com.whyc.mapper.CommonMapper;
import com.whyc.pojo.db_data_history.BattRealdataId;
import com.whyc.pojo.db_data_history.PwrdevHistorydataId;
import com.whyc.pojo.db_param.AppParam;
import com.whyc.pojo.db_param.ApptimeParam;
import com.whyc.pojo.db_param.PowerPropertyParam;
import com.whyc.pojo.db_param.PowerheartParam;
import com.whyc.pojo.db_station.PowerInf;
import com.whyc.util.ActionUtil;
import com.whyc.util.DateUtil;
import com.whyc.util.ThreadLocalUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.lang.reflect.Field;
import java.text.ParseException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import static java.lang.Thread.sleep;
@Service
public class PwrdevHistorydataIdService {
@@ -48,32 +56,73 @@
    @Autowired
    private PowerPropertyParamService  propertyParamService;
    //系统概览获取半小时交流输入统计
    public Response getHalfHourPwrHisAcinData(Integer powerId,Integer granularity) {
        String dateTime = ActionUtil.sdfwithOutday.format(new Date());
        //获取前半个小时数据
        LocalDateTime now = LocalDateTime.now();
        // è®¡ç®—半小时前的时间点
        LocalDateTime halfHourAgo = now.minusMinutes(30);
        // æ ¼å¼åŒ–输出
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String halfHourAgoTime=halfHourAgo.format(formatter);
        String tableName ="db_data_history.tb_pwrdev_historydata_"+powerId+"_"+dateTime;
        String existTableName = commonMapper.existTable("db_data_history", "tb_pwrdev_historydata_"+powerId+"_"+dateTime);
        if(existTableName == null){
            return new Response().set(1,false,"当前电池组不存在前面小时数据");
    @Autowired
    private PowerheartParamService heartService;
    //系统概览前N笔交流输入统计
    public Response getPwrHisAcinData100(Integer powerId) throws ParseException, InterruptedException {
        //获取前笔数*时间间隔
        PowerheartParam heartParam=heartService.getHeartParamByPowerId(powerId);
        Integer interverCount=100*5;//默认值
        Integer granularity=5;//默认值
        if(heartParam!=null){
            interverCount=heartParam.getAcinInterverCfg()*heartParam.getAcinCountCfg();
            granularity=heartParam.getAcinInterverCfg();
        }
        List<PwrHisRealAcInDto> datalist=subTablePageInfoService.getHalfHourPwrHisAcinData(tableName,granularity,halfHourAgoTime);
        return new Response().setII(1,datalist.size()>0,datalist,"获取半小时内交流输入统计");
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        String dateTime = now.format(formatter);
        Date endTime=ActionUtil.sdf.parse(dateTime);
        // è®¡ç®—笔数*时间间隔的时间点
        LocalDateTime halfHourAgo = now.minusMinutes(interverCount);
        // æ ¼å¼åŒ–输出
        String halfHourAgoTime=halfHourAgo.format(formatter);
        Date startTime=ActionUtil.sdf.parse(halfHourAgoTime);
        //获取两个时间分割多少张表
        List<List<Date>> monthTimeList = DateUtil.getMonthTime(startTime,endTime);
        List<PwrHisRealAcInDto> dataList = new LinkedList<>();
        ThreadPoolExecutor pool = ThreadPoolExecutorFactory.getPoolExecutor();
        CountDownLatch latch = new CountDownLatch(monthTimeList.size());
        for (int i = 0; i < monthTimeList.size(); i++) {
            int finalI = i;
            Integer finalGranularity = granularity;
            pool.execute(() -> {
                int finalII = finalI;
                Date recordDatetime=monthTimeList.get(finalII).get(0);
                Date recordDatetime1=monthTimeList.get(finalII).get(1);
                String table = powerId + "_" + ThreadLocalUtil.format(recordDatetime,2);
                String tableName="db_data_history.tb_pwrdev_historydata_"+table;
                //判断表是否存在
                int tableNum = subTablePageInfoService.judgeTable_pwrhis(table);
                List<PwrHisRealAcInDto> list = new ArrayList();
                if (tableNum > 0) {
                    list=subTablePageInfoService.getHalfHourPwrHisAcinData(tableName, finalGranularity,recordDatetime,recordDatetime1);
                }
                dataList.addAll(list);
                latch.countDown();
            });
            sleep(200);
        }
        latch.await(10, TimeUnit.MINUTES);
        List dataListSorted = dataList.stream().sorted(Comparator.comparing(PwrHisRealAcInDto::getRecordDatetime)).collect(Collectors.toList());
        return new Response().setII(1,dataList.size()>0,dataListSorted,"获取半小时内交流输入统计");
    }
    //系统概览获取半小时直流输出统计
    public Response getHalfHourPwrHisDcoutData(Integer powerId,Integer granularity) {
    //系统概览获取前N笔直流输出统计
    public Response getHalfHourPwrHisDcoutData(Integer powerId) {
        String dateTime = ActionUtil.sdfwithOutday.format(new Date());
        //获取前笔数*时间间隔
        PowerheartParam heartParam=heartService.getHeartParamByPowerId(powerId);
        Integer interverCount=100*5;//默认值
        Integer granularity=5;//默认值
        if(heartParam!=null){
            interverCount=heartParam.getAcinInterverCfg()*heartParam.getAcinCountCfg();
            granularity=heartParam.getAcinInterverCfg();
        }
        //获取前半个小时数据
        LocalDateTime now = LocalDateTime.now();
        // è®¡ç®—半小时前的时间点
        LocalDateTime halfHourAgo = now.minusMinutes(30);
        LocalDateTime halfHourAgo = now.minusMinutes(interverCount);
        // æ ¼å¼åŒ–输出
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String halfHourAgoTime=halfHourAgo.format(formatter);
src/main/java/com/whyc/service/StationInfService.java
@@ -4,12 +4,12 @@
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.InfoDto;
import com.whyc.dto.Response;
import com.whyc.dto.Station.Provice;
import com.whyc.dto.Statistic.StationStic;
import com.whyc.mapper.StationInfMapper;
import com.whyc.pojo.db_station.PowerInf;
import com.whyc.pojo.db_station.StationInf;
import com.whyc.pojo.db_station.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -20,7 +20,8 @@
    @Autowired(required = false)
    private StationInfMapper mapper;
    @Autowired(required = false)
    private InfoChangeService changeService;
    //获取左侧列表
    public Response getLeftStation(int uid) {
        List<Provice> list=mapper.getLeftStation(uid);
@@ -86,6 +87,9 @@
        wrapper.eq("station_id",stationId);
        wrapper.last("limit 1");
        StationInf sinf=mapper.selectOne(wrapper);
        //获取机房,电源,电池组变更记录
        List<StationInfChange> sinfChangeList=changeService.getSinfChange(sinf.getStationId());
        sinf.setSinfChangeList(sinfChangeList);
        return sinf;
    }
src/main/java/com/whyc/service/SubTablePageInfoService.java
@@ -593,14 +593,12 @@
        return list;
    }
    //系统概览获取半小时交流输入统计
    public List<PwrHisRealAcInDto> getHalfHourPwrHisAcinData(String tableName,Integer granularity,String halfHourAgoTime) {
        String sql="select  distinct record_datetime,acin1_vola,acin1_volb,acin1_volc,acin2_vola,acin2_volb,acin2_volc " +
                ",acin1_curra,acin1_currb,acin1_currc,acin2_curra,acin2_currb,acin2_currc  " +
                "from (select a.*, (@i:= @i+1) as number " +
                "     from (select * from "+tableName+" "+
                "                    where record_datetime>='"+halfHourAgoTime+"') a, " +
                "                   (select @i:=0) b) c "+
                " where c.number%"+granularity+"=0 or c.number=1 ";
    public List<PwrHisRealAcInDto> getHalfHourPwrHisAcinData(String tableName,Integer granularity,Date recordDatetime,Date recordDatetime1) {
        String sql=" select  distinct record_datetime,acin1_vola,acin1_volb,acin1_volc,acin2_vola,acin2_volb,acin2_volc " +
                " ,acin1_curra,acin1_currb,acin1_currc,acin2_curra,acin2_currb,acin2_currc  " +
                " from "+tableName+" where record_datetime>='"+ActionUtil.sdf.format(recordDatetime)+"'" +
                "                    and record_datetime<='"+ActionUtil.sdf.format(recordDatetime1)+
                "' and record_num%"+granularity+"=0 or record_num=1 or record_num=100 ";
        sql+=" order by record_datetime asc";
        List<PwrHisRealAcInDto> list = sqlExecuteService.executeQuery_call(sql, new CallBack() {
            @Override
src/main/java/com/whyc/service/UserService.java
@@ -77,7 +77,7 @@
        }
        uinf.setCreateTime(new Date());
        int bl=mapper.insert(uinf);
        return new Response().set(1,bl>0);
        return new Response().set(1,bl>0,bl>0?"用户添加成功":"用户添加失败");
    }
    //修改密码
    public Response changeSnId(String uname,String oldSnId, String newSnId) {
src/main/java/com/whyc/webSocket/RealTimeSocket.java
@@ -261,14 +261,19 @@
                topDto.setPwrALmNum(pwrALmNum);
                //实时获取电源信息(是否存在电源告警信息)
                //PwrdevAcdcdata pwrdevAcdcdata = pwrdevAcdcdataService.getPwrRealInfo(realDto.getPowerId());
                topDto.setPwrState((pwrALmNum > 0 ? 1 : 0));
                topDto.setPwrStateName((pwrALmNum > 0 ? "电源异常" : "电源正常"));
                PwrdevAcdcdata pwrdevAcdcdata = pwrdevAcdcdataService.getPwrRealInfo(realDto.getPowerId());
                topDto.setPwrState(pwrdevAcdcdata.getIsJunCharge());
                //查看当前是否存在交流停电告警(is_jun_charge   ç”µæºæ˜¯å¦å‡å……[1-均充 0-浮充],若当前电源存在交流停电告警则显示停电其他按照状态展示。)
                int stopFalg=pwrdevAlarmService.judge3100014(realDto.getPowerId());
                if(stopFalg==1){
                    topDto.setPwrStateName("停电");
                }else{
                    topDto.setPwrStateName((pwrdevAcdcdata.getIsJunCharge()==1 ? "均充" : "浮充"));
                }
                Integer allALmNum = battALmNum + devALmNum + pwrALmNum;
                topDto.setAllALmNum(allALmNum);
                topDto.setSystemState((allALmNum > 0 ? 1 : 0));
                topDto.setSystemStateName((allALmNum > 0 ? "系统异常" : "系统正常"));
                topDto.setSystemStateName((allALmNum > 0 ? "异常" : "正常"));
            }
            return new Response().setII(1, true, topDto, "实时页面头部数据推送");
        } catch (Exception e) {
src/main/resources/mapper/BattInfMapper.xml
@@ -476,12 +476,20 @@
        </where>
        limit 1
    </select>
    <select id="getBattgroupIdList" resultType="java.lang.Integer">
        select distinct tb_batt_inf.battgroup_id
    <select id="getBattgroupIdListByPowerId" resultType="com.whyc.pojo.db_station.BattInf">
        select distinct tb_batt_inf.*
        from db_station.tb_batt_inf
        <where>
             tb_batt_inf.power_id=#{powerId}
        </where>
        order by battgroup_num asc
    </select>
    <select id="getBattgroupIdListByDevId" resultType="com.whyc.pojo.db_station.BattInf">
        select distinct tb_batt_inf.*
        from db_station.tb_batt_inf
        <where>
            tb_batt_inf.dev_id=#{devId}
        </where>
        order by battgroup_num asc
    </select>
</mapper>
src/main/resources/mapper/BattalarmDataMapper.xml
@@ -93,6 +93,9 @@
            <if test="country!=null">
                and tb_station_inf.country=#{country}
            </if>
            <if test="almLevel!=null">
                and tb_battalarm_data.alm_level=#{almLevel}
            </if>
            <if test="stationId!=null">
                and tb_station_inf.station_id=#{stationId}
            </if>
src/main/resources/mapper/DevalarmDataMapper.xml
@@ -63,4 +63,37 @@
            and bu.uid = #{userId}
        )
    </select>
    <select id="getDevAlmAnalyse" resultType="com.whyc.pojo.db_alarm.DevalarmData">
        select tb_devalarm_data.*,tb_batt_inf.dev_name,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name
        from db_alarm.tb_devalarm_data,db_station.tb_batt_inf,db_station.tb_station_inf
        <where>
            tb_devalarm_data.dev_id=tb_batt_inf.dev_id
            and tb_batt_inf.station_id=tb_station_inf.station_id
            <if test="provice!=null">
                and tb_station_inf.provice=#{provice}
            </if>
            <if test="city!=null">
                and tb_station_inf.city=#{city}
            </if>
            <if test="country!=null">
                and tb_station_inf.country=#{country}
            </if>
            <if test="stationId!=null">
                and tb_station_inf.station_id=#{stationId}
            </if>
            <if test="devId!=null">
                and tb_devalarm_data.dev_id=#{devId}
            </if>
            <if test="almLevel!=null">
                and tb_devalarm_data.alm_level=#{almLevel}
            </if>
            <if test="uid>100">
                and tb_batt_inf.station_id in(
                select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr
                where   tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id
                and tb_baojigroup_usr.uid=#{uid}
                )
            </if>
        </where>
    </select>
</mapper>
src/main/resources/mapper/PowerInfMapper.xml
@@ -98,7 +98,7 @@
            <if test="stic.stationType!=null">
                and tb_station_inf.station_type=#{stic.stationType}
            </if>
            <if test="stic.stationType!=null">
            <if test="stic.company!=null">
                and tb_power_inf.company=#{stic.company}
            </if>
            <if test="stic.uid>100">
src/main/resources/mapper/PwrdevAlarmMapper.xml
@@ -84,6 +84,9 @@
            <if test="powerId!=null">
                and tb_pwrdev_alarm.power_id=#{powerId}
            </if>
            <if test="almLevel!=null">
                and tb_pwrdev_alarm.alm_level=#{almLevel}
            </if>
            <if test="uid>100">
                and tb_pwrdev_alarm.power_id in(
                select distinct power_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr