| | |
| | | @Autowired |
| | | private DevalarmDataService devalarmDataService; |
| | | |
| | | @Autowired |
| | | private AppParamService appParamService; |
| | | |
| | | @PostMapping("getBattAlmAnalyse") |
| | | @ApiOperation("预警分析管理-电池告警") |
| | | public Response getBattAlmAnalyse(@RequestBody AlmAnalyseDto dto){ |
| | |
| | | return almAnalysisParamService.getAlmSummaryParam(); |
| | | } |
| | | |
| | | @PostMapping("updateAlarmAnalysisCycle") |
| | | @ApiOperation("预警分析管理-设置时间间隔") |
| | | public Response updateAlarmAnalysisCycle(@RequestParam Integer intervalTime){ |
| | | return appParamService.updateAlarmAnalysisCycle(intervalTime); |
| | | } |
| | | |
| | | } |
| | |
| | | private Integer battgroupId; |
| | | private Integer powerId; |
| | | private String startTime; |
| | | private Integer intervalTime; |
| | | private String dataName1; |
| | | private Integer dataType1; |
| | | private String dataName2; |
| | |
| | | //根据查询条件获取电池组集合 |
| | | BattInf getBattgroupIdInf(@Param("battgroupId") Integer battgroupId); |
| | | //查询电源下所有的电池组id |
| | | List<Integer> getBattgroupIdListByPowerId(@Param("powerId") Integer powerId); |
| | | List<BattInf> getBattgroupIdListByPowerId(@Param("powerId") Integer powerId); |
| | | //查询设备下所有的电池组id |
| | | List<Integer> getBattgroupIdListByDevId(@Param("devId") Integer devId); |
| | | List<BattInf> getBattgroupIdListByDevId(@Param("devId") Integer devId); |
| | | } |
| | |
| | | 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; |
| | |
| | | @TableField(exist = false) |
| | | private String fullName; |
| | | @TableField(exist = false) |
| | | private List<Integer> battgroupIdList; |
| | | private List<BattInf> binfList; |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | private String fullName; |
| | | |
| | | @TableField(exist = false) |
| | | private List<Integer> battgroupIdList; |
| | | private List<BattInf> binfList; |
| | | } |
| | |
| | | Integer cycleTime=0; |
| | | //获取预警分析周期阈值 |
| | | AppParam appParam = appParamService.getAlarmAnalysisCycle(); |
| | | if(res.getIntervalTime()==null){ |
| | | cycleTime=appParam.getParamValue().intValue(); |
| | | }else{ |
| | | //将数据库中时间间隔修改 |
| | | appParamService.updateAlarmAnalysisCycle(res.getIntervalTime()); |
| | | cycleTime=res.getIntervalTime(); |
| | | } |
| | | Date cyscleDate=ActionUtil.getDateAdd(ThreadLocalUtil.parse(res.getStartTime(),1),cycleTime*(-1)); |
| | | //获取cyscleDate到现在所有的历史实时数据 |
| | | List<List<Date>> monthTimeList = DateUtil.getMonthTime(cyscleDate,new Date()); |
| | |
| | | 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().setII(1,flag>0,flag,"修改成功"); |
| | | } |
| | | } |
| | |
| | | return mapper.getBattgroupIdInf(battgroupId); |
| | | } |
| | | //查询电源下所有的电池组id |
| | | public List<Integer> getBattgroupIdListByPowerId(Integer powerId) { |
| | | public List<BattInf> getBattgroupIdListByPowerId(Integer powerId) { |
| | | return mapper.getBattgroupIdListByPowerId(powerId); |
| | | } |
| | | //查询设备下所有的电池组id |
| | | public List<Integer> getBattgroupIdListByDevId(Integer devId) { |
| | | public List<BattInf> getBattgroupIdListByDevId(Integer devId) { |
| | | return mapper.getBattgroupIdListByDevId(devId); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | list.forEach(data->{ |
| | | data.setAlmName(DevAlarmEnum.getValue(data.getAlmId())); |
| | | //查询设备下所有的电池组id |
| | | List<Integer> battgroupIdList = battInfService.getBattgroupIdListByDevId(data.getDevId()); |
| | | data.setBattgroupIdList(battgroupIdList); |
| | | List<BattInf> binfList = battInfService.getBattgroupIdListByDevId(data.getDevId()); |
| | | data.setBinfList(binfList); |
| | | }); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"获取设备实时告警信息"); |
| | |
| | | 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; |
| | |
| | | for (PwrdevAlarm pwrAlm:list) { |
| | | pwrAlm.setAlmName(PowerAlarmEnum.getValue(pwrAlm.getAlmId())); |
| | | //查询电源下所有的电池组id |
| | | List<Integer> battgroupIdList = battInfService.getBattgroupIdListByPowerId(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,"电源告警分析"); |
| | |
| | | </where> |
| | | limit 1 |
| | | </select> |
| | | <select id="getBattgroupIdListByPowerId" 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="java.lang.Integer"> |
| | | select distinct tb_batt_inf.battgroup_id |
| | | <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} |