From 5b3e6970c6e597dae3f155305d72de569e8c35d8 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Fri, 22 Dec 2023 11:19:49 +0800 Subject: [PATCH] =?UTF-8?q?#=E5=8F=8C=E7=A5=A8=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/alarm/constants/AlarmConstants.java | 9 +++-- .../com/hnac/hzims/alarm/entity/AlarmEntity.java | 2 +- .../ticket/standardTicket/vo/CensParamVo.java | 23 ++++++++++++ .../hzims/ticket/standardTicket/vo/CensVo.java | 26 ++++++++++++++ .../ticket/standardTicket/vo/CensYearParamVo.java | 17 +++++++++ .../hzims/ticket/standardTicket/vo/CensYearVo.java | 25 +++++++++++++ .../alarm/show/service/impl/AlarmServiceImpl.java | 25 +++++++++++++ .../twoTicket/controller/CensController.java | 41 ++++++++++++++++++++++ .../controller/TicketCountController.java | 4 +-- .../ticket/twoTicket/service/CensService.java | 18 ++++++++++ .../twoTicket/service/impl/CensServiceImpl.java | 33 +++++++++++++++++ 11 files changed, 215 insertions(+), 8 deletions(-) create mode 100644 hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensParamVo.java create mode 100644 hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensVo.java create mode 100644 hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensYearParamVo.java create mode 100644 hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensYearVo.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/CensController.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/CensService.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/constants/AlarmConstants.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/constants/AlarmConstants.java index 68bf9c5..2c1c2cc 100644 --- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/constants/AlarmConstants.java +++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/constants/AlarmConstants.java @@ -1,7 +1,5 @@ package com.hnac.hzims.alarm.constants; -import io.swagger.models.auth.In; - import java.util.Arrays; import java.util.List; @@ -37,7 +35,7 @@ public interface AlarmConstants { Integer EARLY_WARNING = 3; Integer VIDEO_WARNING = 4; Integer START_STOP_WARNING = 5; - List ALARAM_SOURCE = Arrays.asList(HZ3000_ALARM,LEVEL_ALARM,CONDITION_ALARM,EARLY_WARNING,START_STOP_WARNING); + List ALARAM_SOURCE = Arrays.asList(HZ3000_ALARM,LEVEL_ALARM,CONDITION_ALARM,EARLY_WARNING,VIDEO_WARNING,START_STOP_WARNING); // 子类告警 // HZ3000告警 : 2-告警 3-故障 5-遥测越限 13-通讯中断 14-数据异常 @@ -57,8 +55,9 @@ public interface AlarmConstants { List LEVEL_ALARAM = Arrays.asList(ONE_LEVEL,TWO_LEVEL,THREE_LEVEL); Integer EARLY = 30; Integer CONDITION = 40; - Integer START = 50; - Integer STOP = 51; + Integer VIDEO = 50; + Integer START = 60; + Integer STOP = 61; List START_STOP_ALARAM = Arrays.asList(START,STOP); String VIDEO_SCHEDULED_TASK= "VideoScheduledTask"; } diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/entity/AlarmEntity.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/entity/AlarmEntity.java index 1a273d8..c3abfbf 100644 --- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/entity/AlarmEntity.java +++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/entity/AlarmEntity.java @@ -37,7 +37,7 @@ public class AlarmEntity extends TenantEntity { @ApiModelProperty(value = "告警ID") private String alarmId; - @ApiModelProperty(value = "告警类型 :0- HZ3000告警 1 -等级告警 2 -条件告警 3-FDP智能预警") + @ApiModelProperty(value = "告警类型 :0- HZ3000告警 1 -等级告警 2 -条件告警 3-FDP智能预警 4-视频预警 5-开关机告警") private Integer alarmSource; @ApiModelProperty(value = "告警子类") diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensParamVo.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensParamVo.java new file mode 100644 index 0000000..43deace --- /dev/null +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensParamVo.java @@ -0,0 +1,23 @@ +package com.hnac.hzims.ticket.standardTicket.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +public class CensParamVo { + + @ApiModelProperty("机构Id") + private Long deptId; + + @ApiModelProperty("开始时间 : yyyy-MM-dd HH:mm:ss") + private String startTime; + + @ApiModelProperty("结束时间: yyyy-MM-dd HH:mm:ss") + private String endTime; + + @ApiModelProperty("状态 : 0-未完成 1-完成") + private Integer state; +} diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensVo.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensVo.java new file mode 100644 index 0000000..040e8d7 --- /dev/null +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensVo.java @@ -0,0 +1,26 @@ +package com.hnac.hzims.ticket.standardTicket.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +public class CensVo { + + @ApiModelProperty("机构ID") + private Long deptId; + + @ApiModelProperty("机构名称") + private String deptName; + + @ApiModelProperty("工作票数量") + private Integer workCount; + + @ApiModelProperty("操作票数量") + private Integer operateCount; + + @ApiModelProperty("工作任务数量") + private Integer workTaskCount; +} diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensYearParamVo.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensYearParamVo.java new file mode 100644 index 0000000..285e251 --- /dev/null +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensYearParamVo.java @@ -0,0 +1,17 @@ +package com.hnac.hzims.ticket.standardTicket.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +public class CensYearParamVo { + + @ApiModelProperty("机构Id") + private Long deptId; + + @ApiModelProperty("年度 : yyyy") + private String year; +} diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensYearVo.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensYearVo.java new file mode 100644 index 0000000..6789d12 --- /dev/null +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensYearVo.java @@ -0,0 +1,25 @@ +package com.hnac.hzims.ticket.standardTicket.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author ysj + */ +@Data +public class CensYearVo { + + @ApiModelProperty("机构ID") + private Long deptId; + + @ApiModelProperty("机构名称") + private String deptName; + + @ApiModelProperty("月份") + private Integer mon; + + @ApiModelProperty("统计数量") + private List censs; +} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java index 18c43d1..4efb20a 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java @@ -65,6 +65,7 @@ public class AlarmServiceImpl extends BaseServiceImpl QueryWrapper wrapper = new QueryWrapper<>(); wrapper.orderByDesc("CREATE_TIME"); wrapper.eq("IS_RIGHT_TABULATION",0); + wrapper.eq("STATUS",0); wrapper.in("STATION_ID",stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); if(!StringUtil.isEmpty(alarm.getStationId())){ wrapper.eq("STATION_ID",alarm.getStationId()); @@ -115,6 +116,7 @@ public class AlarmServiceImpl extends BaseServiceImpl // 参数过滤 :站点、告警来源、告警子类 QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq("IS_RIGHT_TABULATION",0); + wrapper.eq("STATUS",0); wrapper.in("STATION_ID",stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); if(!StringUtil.isEmpty(alarm.getStationId())){ wrapper.eq("STATION_ID",alarm.getStationId()); @@ -186,6 +188,7 @@ public class AlarmServiceImpl extends BaseServiceImpl .in(AlarmEntity::getStationId,effectives) .in(AlarmEntity::getAlarmType, Arrays.asList(AlarmConstants.FAULT,AlarmConstants.EARLY)) .eq(AlarmEntity::getIsShowAlert,0) + .eq(AlarmEntity::getStatus,0) //.ge(AlarmEntity::getAlarmType, DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00") ); if(CollectionUtil.isEmpty(alarms)){ @@ -246,6 +249,28 @@ public class AlarmServiceImpl extends BaseServiceImpl count.setCount((long) collect.size()); } return Collections.singletonList(count); + // 视频告警 + }else if(AlarmConstants.VIDEO_WARNING.equals(source)){ + ChildAlarmCountVo count = new ChildAlarmCountVo(); + count.setType(AlarmConstants.VIDEO); + if(CollectionUtil.isEmpty(collect)){ + count.setCount(0L); + }else{ + count.setCount((long) collect.size()); + } + return Collections.singletonList(count); + // 开关机告警 + }else if(AlarmConstants.START_STOP_WARNING.equals(source)){ + return AlarmConstants.START_STOP_ALARAM.stream().map(type->{ + ChildAlarmCountVo count = new ChildAlarmCountVo(); + count.setType(type); + if(CollectionUtil.isEmpty(collect)){ + count.setCount(0L); + }else{ + count.setCount(collect.stream().filter(o->o.getAlarmType().equals(type)).count()); + } + return count; + }).collect(Collectors.toList()); } return new ArrayList<>(); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/CensController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/CensController.java new file mode 100644 index 0000000..2d38e41 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/CensController.java @@ -0,0 +1,41 @@ +package com.hnac.hzims.ticket.twoTicket.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.ticket.standardTicket.vo.CensParamVo; +import com.hnac.hzims.ticket.standardTicket.vo.CensVo; +import com.hnac.hzims.ticket.standardTicket.vo.CensYearParamVo; +import com.hnac.hzims.ticket.standardTicket.vo.CensYearVo; +import com.hnac.hzims.ticket.twoTicket.service.CensService; +import com.hnac.hzims.ticket.workTicket.vo.WorkTicketInfoVO; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + + +/** + * @author ysj + */ +@RestController +@RequiredArgsConstructor +@RequestMapping("/bill") +public class CensController { + + private final CensService censService; + + @PostMapping("/cens") + @ApiOperation("两票统计") + @ApiOperationSupport(order = 1) + public R> cens(@RequestBody CensParamVo param) { + return R.data(censService.cens(param)); + } + + @PostMapping("/censYear") + @ApiOperation("两票统计") + @ApiOperationSupport(order = 1) + public R> censYear(@RequestBody CensYearParamVo param) { + return R.data(censService.censYear(param)); + } +} \ No newline at end of file diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketCountController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketCountController.java index db4ed6f..bf43302 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketCountController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketCountController.java @@ -2,6 +2,7 @@ package com.hnac.hzims.ticket.twoTicket.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketInfoService; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO; @@ -13,6 +14,7 @@ import com.hnac.hzims.ticket.twoTicket.vo.ticket.TicketCountVo; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService; import com.hnac.hzims.ticket.workTicket.vo.WorkTicketInfoVO; +import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.*; @@ -105,6 +107,4 @@ public class TicketCountController { standardTicketInfoService.listByOperationTicketWithKeyword(entityPage,ticketCountQueryVo); return R.data(ticketInfoEntities); } - - } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/CensService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/CensService.java new file mode 100644 index 0000000..fdc8219 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/CensService.java @@ -0,0 +1,18 @@ +package com.hnac.hzims.ticket.twoTicket.service; + +import com.hnac.hzims.ticket.standardTicket.vo.CensParamVo; +import com.hnac.hzims.ticket.standardTicket.vo.CensVo; +import com.hnac.hzims.ticket.standardTicket.vo.CensYearParamVo; +import com.hnac.hzims.ticket.standardTicket.vo.CensYearVo; + +import java.util.List; + +/** + * @author ysj + */ +public interface CensService { + + List cens(CensParamVo param); + + List censYear(CensYearParamVo param); +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java new file mode 100644 index 0000000..e4d3923 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java @@ -0,0 +1,33 @@ +package com.hnac.hzims.ticket.twoTicket.service.impl; + +import com.hnac.hzims.ticket.standardTicket.vo.CensParamVo; +import com.hnac.hzims.ticket.standardTicket.vo.CensVo; +import com.hnac.hzims.ticket.standardTicket.vo.CensYearParamVo; +import com.hnac.hzims.ticket.standardTicket.vo.CensYearVo; +import com.hnac.hzims.ticket.twoTicket.service.CensService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * @author ysj + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class CensServiceImpl implements CensService { + + @Override + public List cens(CensParamVo param) { + return null; + } + + + @Override + public List censYear(CensYearParamVo param) { + return null; + } +} \ No newline at end of file