yang_shj
1 year ago
10 changed files with 143 additions and 8 deletions
@ -0,0 +1,21 @@
|
||||
package com.hnac.hzims.alarm.vo; |
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Data |
||||
public class AlarmCountVo { |
||||
|
||||
@ApiModelProperty(value = "告警子类") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private Long type; |
||||
|
||||
@ApiModelProperty(value = "告警条码数量") |
||||
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||
private Integer count; |
||||
} |
@ -0,0 +1,45 @@
|
||||
package com.hnac.hzims.alarm.show.controller; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import com.hnac.hzims.alarm.config.service.AlarmConfigService; |
||||
import com.hnac.hzims.alarm.entity.AlarmEntity; |
||||
import com.hnac.hzims.alarm.show.service.AlarmService; |
||||
import com.hnac.hzims.alarm.vo.AlarmCountVo; |
||||
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.*; |
||||
import springfox.documentation.annotations.ApiIgnore; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/alarm/show") |
||||
@Api(value = "告警配置", tags = "告警配置") |
||||
public class AlarmController extends BladeController { |
||||
|
||||
private final AlarmService alarmService; |
||||
|
||||
@PostMapping("/alarms") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "告警列表分页", notes = "传入: AlarmConfigEntity对象,分页参数") |
||||
public R<IPage<AlarmEntity>> alarms(@ApiIgnore @RequestParam AlarmEntity alarm, Query query) { |
||||
return R.data(alarmService.alarms(alarm,Condition.getPage(query))); |
||||
} |
||||
|
||||
@PostMapping("/count") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "分页", notes = "传入告警类型 0- HZ3000告警 1 -等级告警 2 -条件告警 3-FDP智能预警") |
||||
public R<List<AlarmCountVo>> counts(@RequestParam Integer type) { |
||||
return R.data(alarmService.counts(type)); |
||||
} |
||||
} |
@ -1,11 +1,18 @@
|
||||
package com.hnac.hzims.alarm.show.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.hnac.hzims.alarm.entity.AlarmEntity; |
||||
import com.hnac.hzims.alarm.vo.AlarmCountVo; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
public interface AlarmService extends BaseService<AlarmEntity> { |
||||
|
||||
IPage<AlarmEntity> alarms(AlarmEntity alarm, IPage<AlarmEntity> page); |
||||
|
||||
List<AlarmCountVo> counts(Integer type); |
||||
} |
Loading…
Reference in new issue