From c7be6bcb6927931490e677a4a1eb86fa05e7eada Mon Sep 17 00:00:00 2001 From: liuguijing <123456> Date: Tue, 6 Jun 2023 19:31:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=91=8A=E8=AD=A6=20=20?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E5=9B=BE=E7=89=87bug=E4=BF=AE=E6=94=B9=20=20?= =?UTF-8?q?=20=E5=9B=BE=E7=89=87=E6=9F=A5=E8=AF=A2=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TerminalAlarmController.java | 19 +- .../main/resources/META-INF/spring.factories | 2 +- .../dto/TerminalImgAlarmsDto.java | 44 +++ .../entity/TerminalImgAlarmsDetails.java | 2 + .../model/TerminalAlarmListModel.java | 59 +++- .../vo/TerminalAlarmIdVo.java | 21 ++ .../vo/TerminalAlarmSelectVo.java | 41 +++ .../dao/TerminalImgAlarmsDao.java | 8 + .../dao/TerminalImgAlarmsDetailsDao.java | 3 + .../xymanager_dao/dao/TerminalPhotoDao.java | 2 + .../mappers/TerminalChannelMapperDao.xml | 2 +- .../mappers/TerminalImgAlarmsDao.xml | 49 +++- .../mappers/TerminalImgAlarmsDetailsDao.xml | 251 +++++++++--------- .../resources/mappers/TerminalPhotoDao.xml | 11 + xymanager_framework/pom.xml | 8 +- .../impl/TerminalAlarmServiceImpl.java | 206 +++++++++++++- .../impl/TerminalPhotoServiceImpl.java | 121 +++++---- .../service/TerminalAlarmService.java | 8 +- 18 files changed, 637 insertions(+), 220 deletions(-) create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/dto/TerminalImgAlarmsDto.java create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalAlarmIdVo.java create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalAlarmSelectVo.java diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalAlarmController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalAlarmController.java index d167f3f..204904a 100644 --- a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalAlarmController.java +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalAlarmController.java @@ -8,7 +8,6 @@ import com.shxy.xymanager_common.bean.ServiceStatus; import com.shxy.xymanager_common.model.*; import com.shxy.xymanager_common.vo.*; import com.shxy.xymanager_service.service.TerminalAlarmService; -import com.shxy.xymanager_service.service.TerminalPhotoService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; @@ -20,8 +19,6 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.Date; - @Api(value = "告警接口", tags = "告警接口相关") @RestController @@ -35,7 +32,7 @@ public class TerminalAlarmController extends BaseController { @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @RequestMapping("/getTerminalAlarmList") @Log(title = "获取告警列表", type = "查询") - public ResponseReult getTerminalAlarmList(@RequestBody @Validated TerminalAlarmVo vo) { + public ResponseReult getTerminalAlarmList(@RequestBody @Validated TerminalAlarmSelectVo vo) { ServiceBody serviceBody = terminalAlarmService.getAlarmList(vo); if (serviceBody.getCode() == ServiceStatus.SUCCESS) { return ResponseReult.success(serviceBody.getData()); @@ -44,7 +41,17 @@ public class TerminalAlarmController extends BaseController { } } - - + @ApiOperation(value = "更改告警列表未读状态", notes = "更改告警列表未读状态", httpMethod = "POST") + @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) + @RequestMapping("/readAlarm") + @Log(title = "更改告警列表未读状态", type = "修改") + public ResponseReult readAlarm(@RequestBody @Validated TerminalAlarmIdVo vo) { + ServiceBody serviceBody = terminalAlarmService.readAlarm(vo); + if (serviceBody.getCode() == ServiceStatus.SUCCESS) { + return ResponseReult.success(serviceBody.getData()); + } else { + return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg()); + } + } } diff --git a/xymanager_admin/src/main/resources/META-INF/spring.factories b/xymanager_admin/src/main/resources/META-INF/spring.factories index 5e2059b..8e7c358 100644 --- a/xymanager_admin/src/main/resources/META-INF/spring.factories +++ b/xymanager_admin/src/main/resources/META-INF/spring.factories @@ -1 +1 @@ -org.springframework.boot.env.EnvironmentPostProcessor=com.shxy.xymanager_framework.config.MyEnvironmentPostProcessor +#org.springframework.boot.env.EnvironmentPostProcessor=com.shxy.xymanager_framework.config.MyEnvironmentPostProcessor diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/dto/TerminalImgAlarmsDto.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/dto/TerminalImgAlarmsDto.java new file mode 100644 index 0000000..09433eb --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/dto/TerminalImgAlarmsDto.java @@ -0,0 +1,44 @@ +package com.shxy.xymanager_common.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Date; + +@Data +public class TerminalImgAlarmsDto implements Serializable { + + private BigInteger id; + + private Integer termId; + + private Integer channelId; + + private Integer presetId; + + private BigInteger photoOrgId; + + private BigInteger alarmTime; + + private Integer label; + + private String name; + + private String enname; + + private Float prob; + + private Float x; + + private Float y; + + private Float width; + + private Float height; + + private Integer isread; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalImgAlarmsDetails.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalImgAlarmsDetails.java index 4de9e90..f142d2b 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalImgAlarmsDetails.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalImgAlarmsDetails.java @@ -28,6 +28,8 @@ public class TerminalImgAlarmsDetails implements Serializable { private Double height; + private Integer isread; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalAlarmListModel.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalAlarmListModel.java index deddf12..e46ac0c 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalAlarmListModel.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalAlarmListModel.java @@ -6,13 +6,14 @@ import lombok.Data; import java.io.Serializable; import java.math.BigInteger; +import java.util.Date; import java.util.List; /** - * 通道列表 + * 报警列表 */ @Data -@ApiModel(value = "通道列表", description = "通道列表信息") +@ApiModel(value = "报警列表", description = "报警列表信息") public class TerminalAlarmListModel implements Serializable { @ApiModelProperty(value = "总记录数", example = "120") private long total; @@ -29,22 +30,62 @@ public class TerminalAlarmListModel implements Serializable { public static class AlarmBean { @ApiModelProperty(value = "告警编号", example = "123456") - private Integer id; + private BigInteger id; + @ApiModelProperty(value = "装置编号", example = "123456") + private Integer termId; - @ApiModelProperty(value = "告警时间", example = "123456") - private BigInteger alarmTime; + @ApiModelProperty(value = "装置名称", example = "123456") + private String displayName; - @ApiModelProperty(value = "电压等级", example = "123456") - private String dyLevel; + @ApiModelProperty(value = "线路编号", example = "123456") + private Integer lineId; @ApiModelProperty(value = "线路名称", example = "123456") private String lineName; - @ApiModelProperty(value = "是否已读", example = "123456") - private Short status; + @ApiModelProperty(value = "杆塔编号", example = "123456") + private Integer towerId; @ApiModelProperty(value = "杆塔名称", example = "123456") private String towerName; + @ApiModelProperty(value = "通道编号", example = "123456") + private Integer channelId; + + @ApiModelProperty(value = "通道名称", example = "123456") + private String channnelName; + + @ApiModelProperty(value = "别名", example = "123456") + private String alias; + + @ApiModelProperty(value = "预置位编号", example = "123456") + private Integer presetId; + @ApiModelProperty(value = "图片编号", example = "123456") + private BigInteger photoOrgId; + @ApiModelProperty(value = "图片地址", example = "123456") + private String path; + @ApiModelProperty(value = "告警时间", example = "123456") + private Date alarmTime; + @ApiModelProperty(value = "识别标签编码", example = "123456") + private Integer label; + @ApiModelProperty(value = "告警名称", example = "123456") + private String name; + @ApiModelProperty(value = "告警中文", example = "123456") + private String enname; + @ApiModelProperty(value = "可信度", example = "123456") + private Float prob; + @ApiModelProperty(value = " 识别框横坐标", example = "123456") + private Float x; + @ApiModelProperty(value = " 识别框纵坐标", example = "123456") + private Float y; + @ApiModelProperty(value = "识别框宽度", example = "123456") + private Float width; + @ApiModelProperty(value = "识别框高度", example = "123456") + private Float height; + + @ApiModelProperty(value = "1", example = "0--未读 1--已读") + private Integer isread; + + } } diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalAlarmIdVo.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalAlarmIdVo.java new file mode 100644 index 0000000..720d1e5 --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalAlarmIdVo.java @@ -0,0 +1,21 @@ +package com.shxy.xymanager_common.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.validation.annotation.Validated; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; +import java.math.BigInteger; +import java.util.Date; + +@Data +@Validated +@ApiModel(value = "装置告警编号对象", description = "装置告警编号对象") +public class TerminalAlarmIdVo { + + @ApiModelProperty(value = "告警编号", example = "123455") + private BigInteger id; + +} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalAlarmSelectVo.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalAlarmSelectVo.java new file mode 100644 index 0000000..be1252c --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalAlarmSelectVo.java @@ -0,0 +1,41 @@ +package com.shxy.xymanager_common.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.validation.annotation.Validated; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; +import java.util.Date; + +@Data +@Validated +@ApiModel(value = "装置报警查询对象", description = "装置报警查询对象描述") +public class TerminalAlarmSelectVo { + + @ApiModelProperty(value = "电压编号", example = "123455") + private Integer dyid; + + @ApiModelProperty(value = "装置编号", example = "123455") + private Integer lineid; + + @ApiModelProperty(value = "杆塔编号", example = "123455") + private Integer towerid; + + @NotNull(message = "查询时间不能缺少") + @ApiModelProperty(value = "查询时间", example = "123455") + private Date starttime; + + @NotNull(message = "查询结束时间不能缺少") + @ApiModelProperty(value = "查询结束时间", example = "123455") + private Date endtime; + + @Min(value = 1, message = "分页位置最小从1开始") + @ApiModelProperty(value = "分页位置从1开始", required = true, example = "1") + private int pageindex; + + @Min(value = 1, message = "分页大小最小为1") + @ApiModelProperty(value = "分页大小", required = true, example = "1") + private int pagesize; +} diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalImgAlarmsDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalImgAlarmsDao.java index d222801..06372dc 100644 --- a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalImgAlarmsDao.java +++ b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalImgAlarmsDao.java @@ -1,6 +1,12 @@ package com.shxy.xymanager_dao.dao; +import com.shxy.xymanager_common.dto.TerminalImgAlarmsDto; import com.shxy.xymanager_common.entity.TerminalImgAlarms; +import org.apache.ibatis.annotations.Param; + +import java.math.BigInteger; +import java.util.Date; +import java.util.List; public interface TerminalImgAlarmsDao { int deleteByPrimaryKey(Long id); @@ -11,6 +17,8 @@ public interface TerminalImgAlarmsDao { TerminalImgAlarms selectByPrimaryKey(Long id); + List selectAlarmsDetails(@Param("terminalidlist") List termidlist, @Param("starttime") BigInteger starttime, @Param("endtime") BigInteger endtime); + int updateByPrimaryKeySelective(TerminalImgAlarms record); int updateByPrimaryKeyWithBLOBs(TerminalImgAlarms record); diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalImgAlarmsDetailsDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalImgAlarmsDetailsDao.java index 550e0d3..4c6f238 100644 --- a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalImgAlarmsDetailsDao.java +++ b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalImgAlarmsDetailsDao.java @@ -1,6 +1,7 @@ package com.shxy.xymanager_dao.dao; import com.shxy.xymanager_common.entity.TerminalImgAlarmsDetails; +import org.apache.ibatis.annotations.Param; public interface TerminalImgAlarmsDetailsDao { int deleteByPrimaryKey(Long id); @@ -11,6 +12,8 @@ public interface TerminalImgAlarmsDetailsDao { TerminalImgAlarmsDetails selectByPrimaryKey(Long id); + int updateReadByPrimaryKey(@Param("id") Long id,@Param("status") Integer status); + int updateByPrimaryKeySelective(TerminalImgAlarmsDetails record); int updateByPrimaryKey(TerminalImgAlarmsDetails record); diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalPhotoDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalPhotoDao.java index 2112c3c..17245ad 100644 --- a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalPhotoDao.java +++ b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalPhotoDao.java @@ -15,6 +15,8 @@ public interface TerminalPhotoDao { List selectPhotoList(@Param("terminalid") Integer terminalid, @Param("channelid") List channelid, @Param("starttime") BigInteger starttime, @Param("endtime") BigInteger endtime); + List selectPhotoListByOrginIdList(@Param("orginidlist") List orginidlist); + List selectPhotoListByTermList(@Param("terminalidlist") List terminalid, @Param("channelidlist") List channelid, @Param("starttime") BigInteger starttime, @Param("endtime") BigInteger endtime); int deleteByPrimaryKey(Long id); diff --git a/xymanager_dao/src/main/resources/mappers/TerminalChannelMapperDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalChannelMapperDao.xml index cc00425..c54aea4 100644 --- a/xymanager_dao/src/main/resources/mappers/TerminalChannelMapperDao.xml +++ b/xymanager_dao/src/main/resources/mappers/TerminalChannelMapperDao.xml @@ -10,7 +10,7 @@ - id, term_id, channel_id, create_time, update_time + id, term_id, channel_id,alias, create_time, update_time select - a.term_id as termId, - a.channel_id as channelId, - a.preset_id as presetId, - a.photo_org_id as photoOrgId, - a.alarm_time as alarmTime, - a.term_id as termid, + b.id as id, + a.term_id as term_id, + a.channel_id as channel_id, + a.preset_id as preset_id, + a.photo_org_id as photo_org_id, + a.alarm_time as alarm_time, + b.label as label, + b.name as name, + b.en_name as en_name, + b.prob as prob, + b.x as x, + b.y as y, + b.width as width, + b.height as height, + b.isread as isread from terminal_img_alarms a left join terminal_img_alarm_details b on a.id = b.alarm_id - where id = #{id,jdbcType=BIGINT} + where a.alarm_time between #{starttime} and #{endtime} + + and term_id in + + #{item} + + + order by a.alarm_time desc + + + + diff --git a/xymanager_dao/src/main/resources/mappers/TerminalImgAlarmsDetailsDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalImgAlarmsDetailsDao.xml index 247d991..745eb76 100644 --- a/xymanager_dao/src/main/resources/mappers/TerminalImgAlarmsDetailsDao.xml +++ b/xymanager_dao/src/main/resources/mappers/TerminalImgAlarmsDetailsDao.xml @@ -1,32 +1,33 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + id, alarm_id, label, name, en_name, prob, x, y, width, height - - + + delete from terminal_img_alarm_details where id = #{id,jdbcType=BIGINT} - + insert into terminal_img_alarm_details (id, alarm_id, label, name, en_name, prob, x, y, width, height) @@ -34,107 +35,107 @@ #{name,jdbcType=VARCHAR}, #{enName,jdbcType=VARCHAR}, #{prob,jdbcType=REAL}, #{x,jdbcType=REAL}, #{y,jdbcType=REAL}, #{width,jdbcType=REAL}, #{height,jdbcType=REAL}) - - insert into terminal_img_alarm_details - - - id, - - - alarm_id, - - - label, - - - name, - - - en_name, - - - prob, - - - x, - - - y, - - - width, - - - height, - - - - - #{id,jdbcType=BIGINT}, - - - #{alarmId,jdbcType=BIGINT}, - - - #{label,jdbcType=INTEGER}, - - - #{name,jdbcType=VARCHAR}, - - - #{enName,jdbcType=VARCHAR}, - - - #{prob,jdbcType=REAL}, - - - #{x,jdbcType=REAL}, - - - #{y,jdbcType=REAL}, - - - #{width,jdbcType=REAL}, - - - #{height,jdbcType=REAL}, - - - - - update terminal_img_alarm_details - - - alarm_id = #{alarmId,jdbcType=BIGINT}, - - - label = #{label,jdbcType=INTEGER}, - - - name = #{name,jdbcType=VARCHAR}, - - - en_name = #{enName,jdbcType=VARCHAR}, - - - prob = #{prob,jdbcType=REAL}, - - - x = #{x,jdbcType=REAL}, - - - y = #{y,jdbcType=REAL}, - - - width = #{width,jdbcType=REAL}, - - - height = #{height,jdbcType=REAL}, - - - where id = #{id,jdbcType=BIGINT} - - + + insert into terminal_img_alarm_details + + + id, + + + alarm_id, + + + label, + + + name, + + + en_name, + + + prob, + + + x, + + + y, + + + width, + + + height, + + + + + #{id,jdbcType=BIGINT}, + + + #{alarmId,jdbcType=BIGINT}, + + + #{label,jdbcType=INTEGER}, + + + #{name,jdbcType=VARCHAR}, + + + #{enName,jdbcType=VARCHAR}, + + + #{prob,jdbcType=REAL}, + + + #{x,jdbcType=REAL}, + + + #{y,jdbcType=REAL}, + + + #{width,jdbcType=REAL}, + + + #{height,jdbcType=REAL}, + + + + + update terminal_img_alarm_details + + + alarm_id = #{alarmId,jdbcType=BIGINT}, + + + label = #{label,jdbcType=INTEGER}, + + + name = #{name,jdbcType=VARCHAR}, + + + en_name = #{enName,jdbcType=VARCHAR}, + + + prob = #{prob,jdbcType=REAL}, + + + x = #{x,jdbcType=REAL}, + + + y = #{y,jdbcType=REAL}, + + + width = #{width,jdbcType=REAL}, + + + height = #{height,jdbcType=REAL}, + + + where id = #{id,jdbcType=BIGINT} + + update terminal_img_alarm_details set alarm_id = #{alarmId,jdbcType=BIGINT}, label = #{label,jdbcType=INTEGER}, @@ -147,4 +148,10 @@ height = #{height,jdbcType=REAL} where id = #{id,jdbcType=BIGINT} + + + update terminal_img_alarm_details + set isread = #{status}, + where id = #{id} + \ No newline at end of file diff --git a/xymanager_dao/src/main/resources/mappers/TerminalPhotoDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalPhotoDao.xml index 7a79cfd..9a2e0fb 100644 --- a/xymanager_dao/src/main/resources/mappers/TerminalPhotoDao.xml +++ b/xymanager_dao/src/main/resources/mappers/TerminalPhotoDao.xml @@ -111,6 +111,17 @@ order by photo_time desc +