src/main/java/com/whyc/controller/AlarmManualClearController.java
@@ -18,8 +18,8 @@ private AlarmManualClearService service; @PostMapping("submit") @ApiOperation("提交告警") public Response addSubmission(@RequestBody AlarmManualClear clear){ @ApiOperation("提交告警消除") public Response addClearSubmission(@RequestBody AlarmManualClear clear){ return service.submit(clear); } src/main/java/com/whyc/controller/AppAlmParamController.java
@@ -34,5 +34,12 @@ return new Response().setII(1,"更新成功"); } @PutMapping("list2") @ApiOperation(value = "更新参数配置") public Response updateList2(@RequestBody List<AppAlmParam> paramList){ service.updateList2(paramList); return new Response().setII(1,"更新成功"); } } src/main/java/com/whyc/controller/HiddenTroubleConfirmationController.java
New file @@ -0,0 +1,21 @@ package com.whyc.controller; import com.whyc.dto.Response; import com.whyc.pojo.HiddenTroubleConfirmation; import com.whyc.service.HiddenTroubleConfirmationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("hiddenTroubleConfirmation") public class HiddenTroubleConfirmationController { @Autowired private HiddenTroubleConfirmationService service; public Response submit(){ return null; } } src/main/java/com/whyc/mapper/AppAlmParamMapper.java
@@ -7,4 +7,6 @@ public interface AppAlmParamMapper extends CustomMapper<AppAlmParam>{ void updateList(List<AppAlmParam> paramList, int operationFlag); void updateList2(List<AppAlmParam> paramList); } src/main/java/com/whyc/pojo/AlarmManualClear.java
@@ -13,6 +13,9 @@ private Integer id; /**告警记录的主键*/ private Integer num; private String stationId; private String stationName1; private String stationName2; @@ -44,6 +47,14 @@ this.id = id; } public Integer getNum() { return num; } public void setNum(Integer num) { this.num = num; } public String getStationId() { return stationId; } src/main/java/com/whyc/pojo/HiddenTroubleApplication.java
New file @@ -0,0 +1,83 @@ package com.whyc.pojo; import com.baomidou.mybatisplus.annotation.TableName; import java.util.Date; @TableName(schema = "web_site",value = "tb_hidden_trouble_confirmation") public class HiddenTroubleApplication { private Integer id; private Integer type; private String description; private Integer uploadUserId; private Integer applyUserId; private Date createTime; private Integer status; private Integer linkId; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getType() { return type; } public void setType(Integer type) { this.type = type; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Integer getUploadUserId() { return uploadUserId; } public void setUploadUserId(Integer uploadUserId) { this.uploadUserId = uploadUserId; } public Integer getApplyUserId() { return applyUserId; } public void setApplyUserId(Integer applyUserId) { this.applyUserId = applyUserId; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public Integer getLinkId() { return linkId; } public void setLinkId(Integer linkId) { this.linkId = linkId; } } src/main/java/com/whyc/pojo/HiddenTroubleConfirmation.java
New file @@ -0,0 +1,75 @@ package com.whyc.pojo; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import java.util.Date; @TableName(schema = "web_site",value = "tb_hidden_trouble_confirmation") public class HiddenTroubleConfirmation { private Integer id; private Integer type; private String description; private Integer uploadUserId; private Date createTime; private Integer status; private Integer linkId; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getType() { return type; } public void setType(Integer type) { this.type = type; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Integer getUploadUserId() { return uploadUserId; } public void setUploadUserId(Integer uploadUserId) { this.uploadUserId = uploadUserId; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public Integer getLinkId() { return linkId; } public void setLinkId(Integer linkId) { this.linkId = linkId; } } src/main/java/com/whyc/service/AlarmManualClearService.java
@@ -8,9 +8,12 @@ import com.whyc.dto.Response; import com.whyc.mapper.AlarmManualClearMapper; import com.whyc.pojo.AlarmManualClear; import com.whyc.pojo.BattalarmData; import com.whyc.pojo.DevalarmData; import com.whyc.util.ActionUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.Date; @@ -29,6 +32,25 @@ @Autowired private PowerInfService powerInfService; @Autowired private BattalarmDataService battAlarmService; @Autowired private BattalarmDataHistoryService battAlarmHistoryService; @Autowired private DevalarmDataService devAlarmService; @Autowired private DevalarmDataHistoryService devAlarmHistoryService; @Autowired private PwrdevAlarmService powerAlarmService; @Autowired private PwrdevAlarmHistoryService powerAlarmHistoryService; @Transactional public Response submit(AlarmManualClear clear) { int userId = ActionUtil.getUser().getUId().intValue(); clear.setDealUserId(userId); @@ -36,11 +58,18 @@ //插入对应的站点id,用于后期用户相关 Integer alarmType = clear.getAlarmType(); String stationId; if(alarmType == 1){ Integer num = clear.getNum(); if(alarmType == 1){ //电池告警 stationId = battInfService.getStationIdByBattGroupId(clear.getBattGroupId()); } else if (alarmType == 2) { //添加到历史告警,移除实时告警 BattalarmData data = battAlarmService.getById(num); battAlarmHistoryService.add(data); battAlarmService.delete(num); } else if (alarmType == 2) { //设备告警 stationId = battInfService.getStationIdByDeviceId(clear.getDeviceId()); }else{ DevalarmData data = devAlarmService.getById(num); }else{ //电源告警 stationId = powerInfService.getStationIdByPowerDeviceId(clear.getPowerDeviceId()); } clear.setStationId(stationId); src/main/java/com/whyc/service/AppAlmParamService.java
@@ -36,7 +36,10 @@ } public void updateList(List<AppAlmParam> paramList, int operationFlag) { //添加 mapper.updateList(paramList,operationFlag); } public void updateList2(List<AppAlmParam> paramList) { mapper.updateList2(paramList); } } src/main/java/com/whyc/service/BattalarmDataHistoryService.java
@@ -119,4 +119,23 @@ update.lt("alm_start_time",retentionTime); mapper.delete(update); } public void add(BattalarmData data) { BattalarmDataHistory dataHistory = new BattalarmDataHistory(); dataHistory.setAlmClearedType(data.getAlmClearedType()); dataHistory.setAlmConfirmedTime(data.getAlmConfirmedTime()); dataHistory.setAlmEndTime(data.getAlmEndTime()); dataHistory.setAlmId(data.getAlmId()); dataHistory.setAlmIsConfirmed(data.getAlmIsConfirmed()); dataHistory.setAlmLevel(data.getAlmLevel()); dataHistory.setAlmSeverity(data.getAlmSeverity()); dataHistory.setAlmSignalId(data.getAlmSignalId()); dataHistory.setAlmStartTime(data.getAlmStartTime()); dataHistory.setAlmValue(data.getAlmValue()); dataHistory.setBattGroupId(data.getBattGroupId()); dataHistory.setMonNum(data.getMonNum()); dataHistory.setRecordId(data.getRecordId()); dataHistory.setUsrId(data.getUsrId()); mapper.insert(dataHistory); } } src/main/java/com/whyc/service/BattalarmDataService.java
@@ -601,4 +601,8 @@ public List<BattalarmData> getListByStationIds(List<String> stationIdList) { return mapper.getListByStationIds(stationIdList); } public BattalarmData getById(Integer num) { return mapper.selectById(num); } } src/main/java/com/whyc/service/DevalarmDataService.java
@@ -169,5 +169,8 @@ return mapper.getListByStationIds(stationIdList); } public DevalarmData getById(Integer num) { return mapper.selectById(num); } } src/main/java/com/whyc/service/HiddenTroubleConfirmationService.java
New file @@ -0,0 +1,7 @@ package com.whyc.service; import org.springframework.stereotype.Service; @Service public class HiddenTroubleConfirmationService { } src/main/resources/mapper/AppAlmParamMapper.xml
@@ -18,4 +18,10 @@ </choose> </update> <update id="updateList2"> <foreach collection="list" item="item" separator=";"> update db_param.tb_appalm_param set alm_auto_clear_en = #{item.almAutoClearEn} where num = #{item.num} </foreach> </update> </mapper>