yang_shj
1 year ago
96 changed files with 1053 additions and 943 deletions
@ -1,4 +1,4 @@
|
||||
package com.hnac.hzims.alarm.constants; |
||||
package com.hnac.hzims.alarm.config.constants; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
@ -1,4 +1,4 @@
|
||||
package com.hnac.hzims.alarm.entity; |
||||
package com.hnac.hzims.alarm.config.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
@ -1,4 +1,4 @@
|
||||
package com.hnac.hzims.alarm.entity; |
||||
package com.hnac.hzims.alarm.config.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
@ -1,4 +1,4 @@
|
||||
package com.hnac.hzims.alarm.entity; |
||||
package com.hnac.hzims.alarm.config.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
@ -1,4 +1,4 @@
|
||||
package com.hnac.hzims.alarm.entity; |
||||
package com.hnac.hzims.alarm.config.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
@ -1,4 +1,4 @@
|
||||
package com.hnac.hzims.alarm.entity; |
||||
package com.hnac.hzims.alarm.config.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
@ -1,4 +1,4 @@
|
||||
package com.hnac.hzims.alarm.entity; |
||||
package com.hnac.hzims.alarm.config.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
@ -1,8 +1,7 @@
|
||||
package com.hnac.hzims.alarm.vo; |
||||
package com.hnac.hzims.alarm.config.vo; |
||||
|
||||
import com.hnac.hzims.alarm.entity.AlarmConfigDetailEntity; |
||||
import com.hnac.hzims.alarm.config.entity.AlarmConfigDetailEntity; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import io.swagger.models.auth.In; |
||||
import lombok.Data; |
||||
|
||||
/** |
@ -1,4 +1,4 @@
|
||||
package com.hnac.hzims.alarm.vo; |
||||
package com.hnac.hzims.alarm.config.vo; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
@ -1,6 +1,6 @@
|
||||
package com.hnac.hzims.alarm.vo; |
||||
package com.hnac.hzims.alarm.config.vo; |
||||
|
||||
import com.hnac.hzims.alarm.entity.AlarmConfigEntity; |
||||
import com.hnac.hzims.alarm.config.entity.AlarmConfigEntity; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
@ -1,4 +1,4 @@
|
||||
package com.hnac.hzims.alarm.vo; |
||||
package com.hnac.hzims.alarm.config.vo; |
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
@ -1,4 +1,4 @@
|
||||
package com.hnac.hzims.alarm.vo; |
||||
package com.hnac.hzims.alarm.config.vo; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
@ -1,8 +1,8 @@
|
||||
package com.hnac.hzims.alarm.vo; |
||||
package com.hnac.hzims.alarm.config.vo; |
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
||||
import com.hnac.hzims.alarm.entity.AlarmHandleEntity; |
||||
import com.hnac.hzims.alarm.config.entity.AlarmHandleEntity; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
@ -1,4 +1,4 @@
|
||||
package com.hnac.hzims.alarm.vo; |
||||
package com.hnac.hzims.alarm.config.vo; |
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
@ -1,4 +1,4 @@
|
||||
package com.hnac.hzims.alarm.vo; |
||||
package com.hnac.hzims.alarm.config.vo; |
||||
|
||||
import io.swagger.annotations.ApiModel; |
||||
import lombok.Data; |
@ -1,4 +1,4 @@
|
||||
package com.hnac.hzims.alarm.vo; |
||||
package com.hnac.hzims.alarm.config.vo; |
||||
|
||||
import io.swagger.annotations.ApiModel; |
||||
import lombok.Data; |
@ -1,4 +1,4 @@
|
||||
package com.hnac.hzims.alarm.vo; |
||||
package com.hnac.hzims.alarm.config.vo; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
@ -1,4 +1,4 @@
|
||||
package com.hnac.hzims.alarm.vo; |
||||
package com.hnac.hzims.alarm.config.vo; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
@ -1,4 +1,4 @@
|
||||
package com.hnac.hzims.alarm.vo; |
||||
package com.hnac.hzims.alarm.config.vo; |
||||
|
||||
import io.swagger.annotations.ApiModel; |
||||
import lombok.Data; |
@ -0,0 +1,20 @@
|
||||
package com.hnac.hzims.alarm.tabulate.vo; |
||||
|
||||
import com.hnac.hzims.alarm.config.vo.AlarmConfigChildVo; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Data |
||||
public class TabulateEarlyVo { |
||||
|
||||
@ApiModelProperty(value = "开始时间") |
||||
private String startTime; |
||||
|
||||
@ApiModelProperty(value = "结束时间") |
||||
private String endTime; |
||||
} |
@ -0,0 +1,37 @@
|
||||
package com.hnac.hzims.alarm.tabulate.controller; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import com.hnac.hzims.alarm.tabulate.service.AlarmTabulateService; |
||||
import com.hnac.hzims.alarm.tabulate.vo.TabulateEarlyVo; |
||||
import com.hnac.hzinfo.sdk.v5.soe.vo.StbAnalysisVO; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.core.boot.ctrl.BladeController; |
||||
import org.springblade.core.mp.support.Condition; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Api(tags = {"告警历史查询"}) |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/tabulate") |
||||
public class AlarmTabulateController extends BladeController { |
||||
|
||||
private final AlarmTabulateService tabulateService; |
||||
|
||||
@GetMapping("/early") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "智能预警", notes = "传入查询参数") |
||||
public R<IPage<StbAnalysisVO>> early(TabulateEarlyVo param, Query query) { |
||||
return R.data(tabulateService.early(Condition.getPage(query), param)); |
||||
} |
||||
} |
@ -0,0 +1,15 @@
|
||||
package com.hnac.hzims.alarm.tabulate.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.hnac.hzims.alarm.config.vo.AlarmHandleVo; |
||||
import com.hnac.hzims.alarm.tabulate.vo.TabulateEarlyVo; |
||||
import com.hnac.hzinfo.sdk.v5.soe.vo.StbAnalysisVO; |
||||
import org.springblade.core.mp.support.Query; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
public interface AlarmTabulateService { |
||||
|
||||
IPage<StbAnalysisVO> early(IPage<StbAnalysisVO> page, TabulateEarlyVo param); |
||||
} |
@ -0,0 +1,55 @@
|
||||
package com.hnac.hzims.alarm.tabulate.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.hnac.hzims.alarm.config.vo.AlarmHandleVo; |
||||
import com.hnac.hzims.alarm.tabulate.service.AlarmTabulateService; |
||||
import com.hnac.hzims.alarm.tabulate.vo.TabulateEarlyVo; |
||||
import com.hnac.hzinfo.sdk.core.response.HzPage; |
||||
import com.hnac.hzinfo.sdk.core.response.Result; |
||||
import com.hnac.hzinfo.sdk.v5.soe.SoeDataClient; |
||||
import com.hnac.hzinfo.sdk.v5.soe.dto.StbAnalysisDTO; |
||||
import com.hnac.hzinfo.sdk.v5.soe.vo.StbAnalysisVO; |
||||
import lombok.RequiredArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.tool.utils.CollectionUtil; |
||||
import org.springblade.core.tool.utils.DateUtil; |
||||
import org.springblade.core.tool.utils.StringUtil; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.time.LocalDateTime; |
||||
import java.util.ArrayList; |
||||
import java.util.Collections; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Slf4j |
||||
@Service |
||||
@RequiredArgsConstructor |
||||
public class AlarmTabulateServiceImpl implements AlarmTabulateService { |
||||
|
||||
private final SoeDataClient soeDataClient; |
||||
|
||||
@Override |
||||
public IPage<StbAnalysisVO> early(IPage<StbAnalysisVO> page, TabulateEarlyVo tabulateEarly) { |
||||
StbAnalysisDTO param = new StbAnalysisDTO(); |
||||
if(StringUtil.isNotBlank(tabulateEarly.getStartTime())){ |
||||
param.setStartTime(LocalDateTime.parse(tabulateEarly.getStartTime(), DateUtil.DATETIME_FORMATTER)); |
||||
} |
||||
if(StringUtil.isNotBlank(tabulateEarly.getEndTime())){ |
||||
param.setEndTime(LocalDateTime.parse(tabulateEarly.getEndTime(), DateUtil.DATETIME_FORMATTER)); |
||||
} |
||||
param.setPage((int) page.getCurrent()); |
||||
param.setPageSize((int) page.getSize()); |
||||
Result<HzPage<StbAnalysisVO>> result = soeDataClient.pageStbAnalysis(param); |
||||
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData().getRecords())){ |
||||
page.setRecords(new ArrayList<>()); |
||||
page.setTotal(0L); |
||||
return page; |
||||
} |
||||
page.setTotal(result.getData().getTotal()); |
||||
page.setRecords(result.getData().getRecords()); |
||||
return page; |
||||
} |
||||
} |
Loading…
Reference in new issue