| | |
| | | /* |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.ReportBattDTO; |
| | |
| | | |
| | | @RestController |
| | | @Api(tags = "电池组充放电记录") |
| | | @RequestMapping("tinf") |
| | | @RequestMapping("battTestInf") |
| | | public class BattTestInfController { |
| | | @Autowired |
| | | private BattTestInfService service; |
| | | @Autowired |
| | | private BattTestInfDataService dataService; |
| | | |
| | | @ApiOperation("查询充放电记录") |
| | | @GetMapping("getTinfHis") |
| | | public Response getTinfHis(@RequestParam int binfId |
| | | @ApiOperation("查询分页-电池组的充放电记录") |
| | | @GetMapping("getPageByBattGroupId") |
| | | public Response getPageByBattGroupId(@RequestParam int battGroupId |
| | | , @RequestParam int pageNum, @RequestParam int pageSize){ |
| | | Response res=service.getTinfHis(binfId,pageNum,pageSize); |
| | | return res; |
| | | return service.getPageByBattGroupId(battGroupId,pageNum,pageSize); |
| | | } |
| | | |
| | | @ApiOperation("根据充放电记录查询单体放电历史详情") |
| | | @GetMapping("getTDataHis") |
| | | public Response getTDataHis(@RequestParam int binfId,@RequestParam int testRecordCount){ |
| | | Response res=dataService.getTDataHis(binfId,testRecordCount); |
| | | //根据充放电记录查询单体放电历史详情 |
| | | @ApiOperation("查询单次放电记录详情") |
| | | @GetMapping("getByBattGroupIdAndTestRecordCount") |
| | | public Response getByBattGroupIdAndTestRecordCount(@RequestParam int battGroupId,@RequestParam int testRecordCount){ |
| | | Response res=dataService.getByBattGroupIdAndTestRecordCount(battGroupId,testRecordCount); |
| | | return res; |
| | | } |
| | | |
| | | |
| | | @PostMapping("searchGroupAssess") |
| | | /*@PostMapping("searchGroupAssess") |
| | | @ApiOperation(value = "蓄电池组后评估") |
| | | public Response searchByCondition(@RequestParam int pageNum,@RequestParam int pageSize, @RequestBody ReportBattDTO tinf) { |
| | | return service.searchGroupAssess(pageNum,pageSize,tinf,1001); |
| | |
| | | @ApiOperation(value = "电池单体性能评估") |
| | | public Response searchMonNumAssess(@RequestParam int binfId,@RequestParam int monNum){ |
| | | return service.searchMonNumAssess(binfId,monNum); |
| | | } |
| | | }*/ |
| | | |
| | | }*/ |
| | | } |
| | |
| | | package com.whyc.pojo.db_alarm; |
| | | |
| | | 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 java.util.Date; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ToString |
| | | @ApiModel(value="告警历史记录", description="") |
| | | public class BattAlarmHistory { |
| | | @TableField("num") |
| | | @TableId("num") |
| | | @ApiModelProperty("主键编号") |
| | | private Integer num; |
| | | |
| | |
| | | @ApiModelProperty("告警值") |
| | | private Integer almValue; |
| | | |
| | | private Integer almConfirm; |
| | | private Date almConfirmTime; |
| | | private Integer almType; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("电池组名称") |
| | |
| | | import com.whyc.pojo.db_alarm.BattAlarm; |
| | | import com.whyc.pojo.db_alarm.BattAlarmHistory; |
| | | import com.whyc.pojo.db_param.BattAlarmCfg; |
| | | import com.whyc.pojo.db_param.BattAlarmParam; |
| | | import com.whyc.util.SubTablePageInfoUtil; |
| | | import com.whyc.util.ThreadLocalUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private SubTablePageInfoUtil util; |
| | | |
| | | @Autowired |
| | | private BattAlarmCfgService cfgService; |
| | | private BattAlarmParamService paramService; |
| | | |
| | | //查询电池组历史时间告警 |
| | | public Response getHistoryPage(Integer almLevel, String startTime, String endTime,int pageNum,int pageSize)throws ParseException, InterruptedException { |
| | |
| | | PageInfo pageInfo=util.getPageInfo(pageNum,pageSize, ThreadLocalUtil.parse(startTime,1),ThreadLocalUtil.parse(endTime,1) |
| | | ,"db_alarm","batt_alarm_history",his); |
| | | List<BattAlarmHistory> list = pageInfo.getList(); |
| | | List<BattAlarmCfg> cfgList = cfgService.getList(); |
| | | List<BattAlarmParam> paramList = paramService.getList(); |
| | | list.stream().forEach(item->{ |
| | | Integer almId = item.getAlmId(); |
| | | for (int i = 0; i < cfgList.size(); i++) { |
| | | if(almId.intValue() == cfgList.get(i).getAlmId()){ |
| | | item.setAlmName(cfgList.get(i).getAlmName()); |
| | | Integer almType = item.getAlmType(); |
| | | for (int i = 0; i < paramList.size(); i++) { |
| | | if(almId.intValue() == paramList.get(i).getAlmId()){ |
| | | if(almType == 1){ |
| | | item.setAlmName(paramList.get(i).getAlmName().replace("告警","高告警")); |
| | | }else { |
| | | item.setAlmName(paramList.get(i).getAlmName().replace("告警","低告警")); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | |
| | | import com.whyc.mapper.BattAlarmMapper; |
| | | import com.whyc.pojo.db_alarm.BattAlarm; |
| | | import com.whyc.pojo.db_param.BattAlarmCfg; |
| | | import com.whyc.pojo.db_param.BattAlarmParam; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.ThreadLocalUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private BattAlarmMapper mapper; |
| | | |
| | | @Autowired |
| | | private BattAlarmCfgService cfgService; |
| | | private BattAlarmParamService paramService; |
| | | |
| | | /* |
| | | 在用电池组实时推送告警信息 |
| | |
| | | public Response getPage(Integer almLevel, String startTime, String endTime ,int pageNum, int pageSize) { |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<BattAlarm> list=mapper.getList(almLevel, ThreadLocalUtil.parse(startTime,1),ThreadLocalUtil.parse(endTime,1)); |
| | | List<BattAlarmCfg> cfgList = cfgService.getList(); |
| | | List<BattAlarmParam> paramList = paramService.getList(); |
| | | list.stream().forEach(item->{ |
| | | Integer almId = item.getAlmId(); |
| | | for (int i = 0; i < cfgList.size(); i++) { |
| | | if(almId.intValue() == cfgList.get(i).getAlmId()){ |
| | | item.setAlmName(cfgList.get(i).getAlmName()); |
| | | Integer almType = item.getAlmType(); |
| | | for (int i = 0; i < paramList.size(); i++) { |
| | | if(almId.intValue() == paramList.get(i).getAlmId()){ |
| | | if(almType == 1){ |
| | | item.setAlmName(paramList.get(i).getAlmName().replace("告警","高告警")); |
| | | }else { |
| | | item.setAlmName(paramList.get(i).getAlmName().replace("告警","低告警")); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | |
| | | private SubTableService service; |
| | | |
| | | //根据充放电记录查询单体放电历史详情 |
| | | public Response getTDataHis(int binfId, int testRecordCount) { |
| | | List<BattTestInfData> list=service.getTDataHis(binfId,testRecordCount); |
| | | return new Response().setII(1,list!=null,list,"根据充放电记录查询单体放电历史详情"); |
| | | public Response getByBattGroupIdAndTestRecordCount(int battGroupId, int testRecordCount) { |
| | | List<BattTestInfData> list=service.getByBattGroupIdAndTestRecordCount(battGroupId,testRecordCount); |
| | | return new Response().set(1,list); |
| | | } |
| | | } |
| | |
| | | /* |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import com.whyc.mapper.BattInfMapper; |
| | | import com.whyc.mapper.BattTestInfMapper; |
| | | import com.whyc.pojo.*; |
| | | import com.whyc.pojo.db_batt.BattInf; |
| | | import com.whyc.pojo.db_dis_batt.BattTestInf; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.PageInfoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | |
| | | //查询充放电记录 |
| | | public Response getTinfHis(int binfId, int pageNum, int pageSize) { |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | QueryWrapper wrapper= Wrappers.query(); |
| | | wrapper.eq("binf_id",binfId); |
| | | List<BattTestInf> list=mapper.selectList(wrapper); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"查询充放电记录"); |
| | | public Response getPageByBattGroupId(int battGroupId, int pageNum, int pageSize) { |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | QueryWrapper wrapper = Wrappers.query(); |
| | | wrapper.eq("binf_id", battGroupId); |
| | | List<BattTestInf> list = mapper.selectList(wrapper); |
| | | PageInfo pageInfo = new PageInfo(list); |
| | | return new Response().set(1, pageInfo); |
| | | } |
| | | |
| | | /* |
| | | //1.4电池性能评估 |
| | | public Response searchGroupAssess(int pageNum, int pageSize, ReportBattDTO tinf, int userId){ |
| | | //List<BattInf> battinfList = binfMapper.searchGroupAssess(tinf, userId); |
| | |
| | | } |
| | | |
| | | */ |
| | | /*劣化:本年度未放电,内阻告警(预告警(重要),告警(紧急)) |
| | | *容量小于劣化阈值,大于损坏阈值,内阻告警(预告警,告警) |
| | | * 容量小于劣化阈值,内阻正常 |
| | | * 容量正常,内阻告警(预告警,告警) |
| | | *//* |
| | | /*劣化:本年度未放电,内阻告警(预告警(重要),告警(紧急)) |
| | | *容量小于劣化阈值,大于损坏阈值,内阻告警(预告警,告警) |
| | | * 容量小于劣化阈值,内阻正常 |
| | | * 容量正常,内阻告警(预告警,告警) |
| | | *//* |
| | | |
| | | if (((disNum==0)&&(listALmRes.size()>0)) |
| | | ||((disNum>0)&&(realCap <= capAlarm * monCapStd && realCap >= capChange * monCapStd)&&(listALmRes.size()>0)) |
| | |
| | | } |
| | | //查询电池告警(2024。4.15修改) |
| | | */ |
| | | /*未放电:本年度未放电 |
| | | /*未放电:本年度未放电 |
| | | *优秀:本年度已放电,且容量健康,无内阻告警(预告警(重要),告警(紧急)) |
| | | *劣化:本年度未放电,内阻告警(预告警(重要),告警(紧急)) |
| | | * 容量小于劣化阈值,大于损坏阈值,内阻告警(预告警,告警) |
| | |
| | | map.put("flag", 1); |
| | | } |
| | | */ |
| | | /*劣化: |
| | | *容量小于劣化阈值,大于损坏阈值 |
| | | *//* |
| | | /*劣化: |
| | | *容量小于劣化阈值,大于损坏阈值 |
| | | *//* |
| | | |
| | | if (((disNum > 0) && (realCap <= capAlarm * monCapStd && realCap >= capChange * monCapStd))) { |
| | | map.put("flag", 2); |
| | |
| | | return new Response().set(1, map, "查询成功"); |
| | | } |
| | | |
| | | }*/ |
| | | }*/ |
| | | } |
| | |
| | | @Autowired |
| | | private MybatisSqlExecuteService sqlExecuteService; |
| | | //根据充放电记录查询单体放电历史详情 |
| | | public List<BattTestInfData> getTDataHis(int binfId, int testRecordCount) { |
| | | String sql="select * from db_dis_batt.batt_test_inf_"+binfId+" " + |
| | | " where binf_id="+binfId+" " + |
| | | public List<BattTestInfData> getByBattGroupIdAndTestRecordCount(int battGroupId, int testRecordCount) { |
| | | String sql="select * from db_dis_batt.batt_test_inf_"+battGroupId+" " + |
| | | " where binf_id="+battGroupId+" " + |
| | | " and test_record_count="+testRecordCount+ |
| | | " order by test_starttime asc "; |
| | | List<BattTestInfData> list=sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | |
| | | data.setAlmId(rs.getInt("alm_id")); |
| | | data.setAlmLevel(rs.getInt("alm_level")); |
| | | data.setAlmValue(rs.getInt("alm_value")); |
| | | data.setAlmConfirm(rs.getInt("alm_confirm")); |
| | | data.setAlmConfirmTime(rs.getTimestamp("alm_confirm_time")); |
| | | data.setAlmType(rs.getInt("alm_type")); |
| | | data.setPowerName(rs.getString("power_name")); |
| | | data.setBattGroupName(rs.getString("battGroupName")); |
| | | list.add(data); |