Browse Source

#双票统计

zhongwei
yang_shj 11 months ago
parent
commit
5b3e6970c6
  1. 9
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/constants/AlarmConstants.java
  2. 2
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/entity/AlarmEntity.java
  3. 23
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensParamVo.java
  4. 26
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensVo.java
  5. 17
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensYearParamVo.java
  6. 25
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/vo/CensYearVo.java
  7. 25
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java
  8. 41
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/CensController.java
  9. 4
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketCountController.java
  10. 18
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/CensService.java
  11. 33
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java

9
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<Integer> ALARAM_SOURCE = Arrays.asList(HZ3000_ALARM,LEVEL_ALARM,CONDITION_ALARM,EARLY_WARNING,START_STOP_WARNING);
List<Integer> 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<Integer> 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<Integer> START_STOP_ALARAM = Arrays.asList(START,STOP);
String VIDEO_SCHEDULED_TASK= "VideoScheduledTask";
}

2
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 = "告警子类")

23
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;
}

26
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;
}

17
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;
}

25
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<CensVo> censs;
}

25
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<AlarmMapper, AlarmEntity>
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<AlarmMapper, AlarmEntity>
// 参数过滤 :站点、告警来源、告警子类
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<AlarmMapper, AlarmEntity>
.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<AlarmMapper, AlarmEntity>
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<>();
}

41
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<List<CensVo>> cens(@RequestBody CensParamVo param) {
return R.data(censService.cens(param));
}
@PostMapping("/censYear")
@ApiOperation("两票统计")
@ApiOperationSupport(order = 1)
public R<List<CensYearVo>> censYear(@RequestBody CensYearParamVo param) {
return R.data(censService.censYear(param));
}
}

4
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);
}
}

18
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<CensVo> cens(CensParamVo param);
List<CensYearVo> censYear(CensYearParamVo param);
}

33
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<CensVo> cens(CensParamVo param) {
return null;
}
@Override
public List<CensYearVo> censYear(CensYearParamVo param) {
return null;
}
}
Loading…
Cancel
Save