| | |
| | | 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()); |
| | |
| | | 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; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | |
| | | @RequestMapping("analysis") |
| | | @RestController |
| | |
| | | |
| | | @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") |
| | |
| | | return almAnalysisParamService.getAlmSummaryParam(); |
| | | } |
| | | |
| | | @PostMapping("updateAlarmAnalysisCycle") |
| | | @ApiOperation("é¢è¦åæç®¡ç-设置æ¶é´é´é") |
| | | public Response updateAlarmAnalysisCycle(@RequestParam Integer intervalTime){ |
| | | return appParamService.updateAlarmAnalysisCycle(intervalTime); |
| | | } |
| | | |
| | | } |
| | |
| | | @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 = "å岿µè¯è®°å½") |
| | |
| | | private Integer battgroupId; |
| | | private Integer powerId; |
| | | private String startTime; |
| | | private Integer intervalTime; |
| | | private String dataName1; |
| | | private Integer dataType1; |
| | | private String dataName2; |
| | |
| | | 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 { |
| | |
| | | |
| | | @ApiModelProperty(value = "ç«ç¹ç±»å[0-éèç¹ç«ï¼1-èç¹ç«]") |
| | | private Integer nodeStation; |
| | | |
| | | private List<StationInfChange> sinfChangeList; |
| | | |
| | | |
| | | @ApiModelProperty(value = "çµæºid") |
| | |
| | | |
| | | @ApiModelProperty(value = "æ è¯æ¯å¦å å
¥çµæ± ç»1:æ·»å ï¼0䏿·»å ") |
| | | private Integer addBinfFlag; |
| | | |
| | | @ApiModelProperty(value = "åæ´åå ") |
| | | private String updateReason; |
| | | } |
| | |
| | | private String country; |
| | | private Integer stationId; |
| | | private Integer powerId; |
| | | private Integer devId; |
| | | private Integer battgroupId; |
| | | private List<Integer> almIdList; |
| | | private Integer uid; |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.db_station.BattInfChange; |
| | | |
| | | public interface BattInfChangeMapper extends CustomMapper<BattInfChange>{ |
| | | } |
| | |
| | | //æ ¹æ®æ¥è¯¢æ¡ä»¶è·åçµæ± ç»éå |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | List<AlarmInspection> getListGreatThan(Long devAlarmId); |
| | | |
| | | List<AlarmDto> getListByUserId(Integer userId, Integer almLevel); |
| | | |
| | | //é¢è¦åæç®¡ç-设å¤åè¦ |
| | | List<DevalarmData> getDevAlmAnalyse(AlmAnalyseDto almDto); |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.db_station.PowerInfChange; |
| | | |
| | | public interface PowerInfChangeMapper extends CustomMapper<PowerInfChange>{ |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.db_param.PowerheartParam; |
| | | |
| | | public interface PowerheartParamMapper extends CustomMapper<PowerheartParam>{ |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.db_station.StationInfChange; |
| | | |
| | | public interface StationInfChangeMapper extends CustomMapper<StationInfChange>{ |
| | | } |
| | |
| | | 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; |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private String country; |
| | | @TableField(exist = false) |
| | | private String fullName; |
| | | @TableField(exist = false) |
| | | private List<BattInf> binfList; |
| | | |
| | | } |
New file |
| | |
| | | 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; |
| | | |
| | | |
| | | } |
| | |
| | | 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; |
| | | } |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "å
æºç»åç§°") |
| | | private String baojiGroupName; |
| | | |
| | | @TableField(exist = false) |
| | | private List<BattInfChange> binfChangeList; |
| | | } |
New file |
| | |
| | | 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; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @TableField(exist = false) |
| | | private String stationType; |
| | | |
| | | @TableField(exist = false) |
| | | private List<PowerInfChange> pinfChangeList; |
| | | |
| | | } |
New file |
| | |
| | | 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; |
| | | |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @ApiModelProperty(value = "ç«ç¹ç±»å[0-éèç¹ç«ï¼1-èç¹ç«]") |
| | | private Integer nodeStation; |
| | | |
| | | @TableField(exist = false) |
| | | private List<StationInfChange> sinfChangeList; |
| | | } |
New file |
| | |
| | | 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; |
| | | |
| | | |
| | | } |
| | |
| | | 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){ |
| | |
| | | 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(); |
| | |
| | | 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,"ä¿®æ¹æå"); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | |
| | | @Autowired(required = false) |
| | | private BaojigroupService bjService; |
| | | |
| | | @Autowired(required = false) |
| | | private InfoChangeService changeService; |
| | | |
| | | /*æ°å»ºçµæ± ç»ï¼æ°çè®¾å¤æ°ççµæ± ç»ï¼ |
| | | * @param binf |
| | |
| | | } |
| | | 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,"ä¿®æ¹ä¿¡æ¯æå"); |
| | | } |
| | | /*//ä¿®æ¹çµæ± ç» |
| | |
| | | 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; |
| | | } |
| | | //彿²¡æå
婿µè¯æ¶åå§å
é»å¼ä¸ºæ ç§°å
é» |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | |
| | | @Autowired(required = false) |
| | | private BattRtstateService rtstateService; |
| | | |
| | | @Autowired |
| | | private PowerheartParamService heartService; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | 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); |
| | |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"è·åçµæ± ç»å®æ¶åè¦ä¿¡æ¯"); |
| | | } |
| | | |
| | | //ç¡®è®¤çµæ± åè¦ |
| | | public Response updateBattConfrim(Integer num) { |
| | | UpdateWrapper wrapper = new UpdateWrapper<>(); |
| | |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"çµæ± åè¦åæ"); |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | public class DevalarmDataService { |
| | | @Autowired(required = false) |
| | | private DevalarmDataMapper mapper; |
| | | |
| | | @Autowired |
| | | private BattInfService battInfService; |
| | | //è·å设å¤å®æ¶åè¦ä¿¡æ¯ |
| | | public Response getDevAlmReal(AlmDto almDto) { |
| | | PageHelper.startPage(almDto.getPageNum(),almDto.getPageSize()); |
| | |
| | | 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,"è·å设å¤å®æ¶åè¦ä¿¡æ¯"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | |
| | | @Autowired(required = false) |
| | | private BaojigroupPowerMapper bjPowerMapper; |
| | | |
| | | @Autowired(required = false) |
| | | private InfoChangeService changeService; |
| | | |
| | | @Autowired |
| | | private PowerheartParamService heartService; |
| | | |
| | | /*æ·»å çµæº |
| | | 1.夿å½åç¨æ·æ¯å¦æ¯å
ç»ç¨æ· |
| | |
| | | //å½å人æå¨çå
æºç»æ·»å çµæºæºæ¿ |
| | | insertInbaoji(stationId,powerId); |
| | | } |
| | | |
| | | //æ·»å å®çµæºéè¦æå
¥é»è®¤å®æ¶é¡µé¢çµæºçå¿è·³æ°æ® |
| | | heartService.insertHeartData(powerId); |
| | | } |
| | | //å½å人æå¨çå
æºç»æ·»å çµæºæºæ¿ |
| | | public void insertInbaoji(Integer stationId,Integer powerId){ |
| | |
| | | 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; |
| | | } |
| | | //çµæºä¿¡æ¯ç»è®¡ |
New file |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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.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; |
| | | } |
| | | } |
| | |
| | | |
| | | 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 { |
| | |
| | | @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); |
| | |
| | | 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; |
| | | |
| | |
| | | @Autowired(required = false) |
| | | private StationInfMapper mapper; |
| | | |
| | | |
| | | @Autowired(required = false) |
| | | private InfoChangeService changeService; |
| | | //è·å左侧å表 |
| | | public Response getLeftStation(int uid) { |
| | | List<Provice> list=mapper.getLeftStation(uid); |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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 |
| | |
| | | } |
| | | 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) { |
| | |
| | | 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) { |
| | |
| | | </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> |
| | |
| | | <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> |
| | |
| | | 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> |
| | |
| | | <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"> |
| | |
| | | <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 |