Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
tyty 1 year ago
parent
commit
0a36f0d8b4
  1. 52
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/constants/AlarmConstants.java
  2. 14
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/vo/AlarmCountVo.java
  3. 21
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/vo/ChildAlarmCountVo.java
  4. 6
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java
  5. 3
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmConfigDetailMapper.java
  6. 5
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmConfigMapper.java
  7. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/AlarmConfigDetailService.java
  8. 4
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/AlarmConfigService.java
  9. 11
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/impl/AlarmConfigDetailServiceImpl.java
  10. 174
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/impl/AlarmConfigServiceImpl.java
  11. 12
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/AlarmController.java
  12. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmService.java
  13. 111
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java
  14. 11
      hzims-service/hzims-alarm/src/main/resources/mapper/AlarmConfigDetatilMapper.xml
  15. 18
      hzims-service/hzims-alarm/src/main/resources/mapper/AlarmConfigMapper.xml
  16. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceMonitorReportMonthDTO.java
  17. 25
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceMonitorServiceImpl.java
  18. 1
      hzims-service/operational/src/main/resources/db/1.0.1.sql
  19. 42
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java
  20. 4
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java
  21. BIN
      hzims-service/ticket/src/main/resources/template/电气操作票.docx

52
hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/constants/AlarmConstants.java

@ -1,9 +1,59 @@
package com.hnac.hzims.alarm.constants; package com.hnac.hzims.alarm.constants;
import com.sun.org.apache.bcel.internal.generic.NEW;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/** /**
* @author ysj * @author ysj
*/ */
public interface AlarmConstants { public interface AlarmConstants {
public final static String APP_NAME = "hzims-alarm"; String APP_NAME = "hzims-alarm";
// 1-集中监控右侧列表
Integer IS_RIGHT_TABULATION = 1;
// 2-集中监控弹窗
Integer IS_SHOW_ALERT = 2;
// 3-集中监控铃铛
Integer IS_SMALL_BELL = 3;
// 4-集中监控遮罩
Integer IS_MASK = 4;
// 5-语音播报
Integer IS_BROADCAST = 5;
// 6-WEB/APP消息推送
Integer IS_PLATFORM_MESSAGE = 6;
// 7-短信推送
Integer IS_SHORT_MESSAGE = 7;
// 8-微信公众号消息推送
Integer IS_WX_MESSAGE = 8;
// 告警来源 : 0- HZ3000告警 1 -等级告警 2 -条件告警 3-FDP智能预警
Integer HZ3000_ALARM = 0;
Integer LEVEL_ALARM = 1;
Integer CONDITION_ALARM = 2;
Integer EARLY_WARNING = 3;
List<Integer> ALARAM_SOURCES = Arrays.asList(HZ3000_ALARM,LEVEL_ALARM,CONDITION_ALARM,EARLY_WARNING);
// 子类告警
// HZ3000告警 : 2-告警 3-故障 5-遥测越限 13-通讯中断 14-数据异常
// 等级告警 : 21-一级告警 22-二级告警 23-三级告警
// 智能预警 : 30-智能预警
// 条件告警 : 40-条件告警
Integer WARNING = 2;
Integer FAULT = 3;
Integer OFFSIDE = 5;
Integer INTERRUPT = 13;
Integer ABNORMAL = 14;
List<Integer> HZ3000_ALARAM = Arrays.asList(WARNING,FAULT,OFFSIDE,INTERRUPT,ABNORMAL);
Integer ONE_LEVEL = 21;
Integer TWO_LEVEL = 22;
Integer THREE_LEVEL = 23;
List<Integer> LEVEL_ALARAM = Arrays.asList(ONE_LEVEL,TWO_LEVEL,THREE_LEVEL);
Integer EARLY = 30;
Integer CONDITION = 40;
} }

14
hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/vo/AlarmCountVo.java

@ -5,17 +5,23 @@ import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* @author ysj * @author ysj
*/ */
@Data @Data
public class AlarmCountVo { public class AlarmCountVo {
@ApiModelProperty(value = "告警子类") @ApiModelProperty(value = "告警类型")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer type;
@ApiModelProperty(value = "告警条目数量")
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
private Long type; private Long count;
@ApiModelProperty(value = "告警条码数量") @ApiModelProperty(value = "子类告警数量集合")
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
private Integer count; private List<ChildAlarmCountVo> childs;
} }

21
hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/vo/ChildAlarmCountVo.java

@ -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 ChildAlarmCountVo {
@ApiModelProperty(value = "告警子类")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer type;
@ApiModelProperty(value = "告警条目数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long count;
}

6
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java

@ -108,4 +108,10 @@ public class OperMaintenancePlanEntity extends TenantEntity {
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
private Long messageTemplateId; private Long messageTemplateId;
/**
* 站点code
*/
private String stationCode;
} }

3
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmConfigDetailMapper.java

@ -2,11 +2,12 @@ package com.hnac.hzims.alarm.config.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.alarm.entity.AlarmConfigDetailEntity; import com.hnac.hzims.alarm.entity.AlarmConfigDetailEntity;
import org.apache.ibatis.annotations.Param;
/** /**
* @author ysj * @author ysj
*/ */
public interface AlarmConfigDetailMapper extends BaseMapper<AlarmConfigDetailEntity> { public interface AlarmConfigDetailMapper extends BaseMapper<AlarmConfigDetailEntity> {
AlarmConfigDetailEntity isSupport(@Param(value = "code") String code, @Param(value = "source") Integer source, @Param(value = "type") Integer type);
} }

5
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmConfigMapper.java

@ -2,11 +2,14 @@ package com.hnac.hzims.alarm.config.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.alarm.entity.AlarmConfigEntity; import com.hnac.hzims.alarm.entity.AlarmConfigEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* @author ysj * @author ysj
*/ */
public interface AlarmConfigMapper extends BaseMapper<AlarmConfigEntity> { public interface AlarmConfigMapper extends BaseMapper<AlarmConfigEntity> {
List<String> exclude(@Param(value = "operate") Integer operate);
} }

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/AlarmConfigDetailService.java

@ -1,6 +1,7 @@
package com.hnac.hzims.alarm.config.service; package com.hnac.hzims.alarm.config.service;
import com.hnac.hzims.alarm.entity.AlarmConfigDetailEntity; import com.hnac.hzims.alarm.entity.AlarmConfigDetailEntity;
import com.hnac.hzims.alarm.entity.AlarmConfigEntity;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
/** /**
@ -8,4 +9,5 @@ import org.springblade.core.mp.base.BaseService;
*/ */
public interface AlarmConfigDetailService extends BaseService<AlarmConfigDetailEntity> { public interface AlarmConfigDetailService extends BaseService<AlarmConfigDetailEntity> {
AlarmConfigDetailEntity isSupport(String code, Integer source, Integer type);
} }

4
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/AlarmConfigService.java

@ -3,10 +3,14 @@ package com.hnac.hzims.alarm.config.service;
import com.hnac.hzims.alarm.entity.AlarmConfigEntity; import com.hnac.hzims.alarm.entity.AlarmConfigEntity;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
import java.util.List;
/** /**
* @author ysj * @author ysj
*/ */
public interface AlarmConfigService extends BaseService<AlarmConfigEntity> { public interface AlarmConfigService extends BaseService<AlarmConfigEntity> {
List<String> exclude(Integer operate);
boolean isSupport(String code,Integer source,Integer type,Integer operate); boolean isSupport(String code,Integer source,Integer type,Integer operate);
} }

11
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/impl/AlarmConfigDetailServiceImpl.java

@ -16,4 +16,15 @@ import org.springframework.stereotype.Service;
@Slf4j @Slf4j
public class AlarmConfigDetailServiceImpl extends BaseServiceImpl<AlarmConfigDetailMapper, AlarmConfigDetailEntity> implements AlarmConfigDetailService { public class AlarmConfigDetailServiceImpl extends BaseServiceImpl<AlarmConfigDetailMapper, AlarmConfigDetailEntity> implements AlarmConfigDetailService {
/**
* 查询告警配置对象
* @param code : 站点编码
* @param source : 告警来源
* @param type : 告警子类
* @return
*/
@Override
public AlarmConfigDetailEntity isSupport(String code, Integer source, Integer type) {
return this.baseMapper.isSupport(code,source,type);
}
} }

174
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/impl/AlarmConfigServiceImpl.java

@ -1,13 +1,21 @@
package com.hnac.hzims.alarm.config.service.impl; package com.hnac.hzims.alarm.config.service.impl;
import com.hnac.hzims.alarm.config.mapper.AlarmConfigMapper; import com.hnac.hzims.alarm.config.mapper.AlarmConfigMapper;
import com.hnac.hzims.alarm.config.service.AlarmConfigDetailService;
import com.hnac.hzims.alarm.config.service.AlarmConfigService; import com.hnac.hzims.alarm.config.service.AlarmConfigService;
import com.hnac.hzims.alarm.constants.AlarmConstants;
import com.hnac.hzims.alarm.entity.AlarmConfigDetailEntity;
import com.hnac.hzims.alarm.entity.AlarmConfigEntity; import com.hnac.hzims.alarm.entity.AlarmConfigEntity;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* @author ysj * @author ysj
*/ */
@ -16,6 +24,18 @@ import org.springframework.stereotype.Service;
@Slf4j @Slf4j
public class AlarmConfigServiceImpl extends BaseServiceImpl<AlarmConfigMapper, AlarmConfigEntity> implements AlarmConfigService { public class AlarmConfigServiceImpl extends BaseServiceImpl<AlarmConfigMapper, AlarmConfigEntity> implements AlarmConfigService {
private final AlarmConfigDetailService detailService;
/**
* 排除站点
* @param operate : 操作类型
* @return
*/
@Override
public List<String> exclude(Integer operate) {
return this.baseMapper.exclude(operate);
}
/** /**
* 是否支持操作 * 是否支持操作
* @param code : 站点编码 * @param code : 站点编码
@ -26,11 +46,46 @@ public class AlarmConfigServiceImpl extends BaseServiceImpl<AlarmConfigMapper, A
*/ */
@Override @Override
public boolean isSupport(String code, Integer source, Integer type, Integer operate) { public boolean isSupport(String code, Integer source, Integer type, Integer operate) {
// 查询告警配置 // 参数检查
if(StringUtil.isEmpty(code) || ObjectUtil.isEmpty(source) || ObjectUtil.isEmpty(type) || ObjectUtil.isEmpty(operate)){
return false;
}
// 查询站点告警配置
AlarmConfigDetailEntity entity = this.detailService.isSupport(code,source,type);
// 站点未进行配置返回默认配置 // 站点未进行配置返回默认配置
if(ObjectUtil.isEmpty(entity)){
return this.isDefault(source,type,operate); return this.isDefault(source,type,operate);
} }
// 存在配置,返回配置是否支持标识
switch (operate){
// 右侧列表展示
case 1 :
return entity.getIsRightTabulation() == 0;
// 弹窗
case 2 :
return entity.getIsShowAlert() == 0;
// 铃铛提示
case 3 :
return entity.getIsSmallBell() == 0;
// 遮罩层
case 4 :
return entity.getIsMask() == 0;
// 语音播报
case 5 :
return entity.getIsBroadcast() == 0;
// WEB/APP消息推送
case 6 :
return entity.getIsPlatformMessage() == 0;
// 短信推送
case 7 :
return entity.getIsShortMessage() == 0;
// 微信公众号消息
case 8 :
return entity.getIsWxMessage() == 0;
default:
return false;
}
}
/** /**
* 默认操作支持 * 默认操作支持
@ -40,6 +95,121 @@ public class AlarmConfigServiceImpl extends BaseServiceImpl<AlarmConfigMapper, A
* @return * @return
*/ */
private boolean isDefault(Integer source, Integer type, Integer operate){ private boolean isDefault(Integer source, Integer type, Integer operate){
switch (operate){
// 右侧列表展示
case 1 :
return true;
// 弹窗
case 2 :
return this.showAlert(source,type);
// 铃铛提示
case 3 :
return true;
// 遮罩层
case 4 :
return this.mask(source,type);
// 语音播报
case 5 :
return this.broadcast(source,type);
// WEB/APP消息推送
case 6 :
return this.WebAppMessage(source,type);
// 短信推送
case 7 :
return this.message(source,type);
// 微信公众号消息
case 8 :
return this.wechatMessage(source,type);
default:
return false;
}
}
/**
* 弹窗提示
* @param source : 告警来源
* @param type : 告警子类
* @return
*/
private boolean showAlert(Integer source, Integer type) {
if(AlarmConstants.HZ3000_ALARM.equals(source)){
return AlarmConstants.FAULT.equals(type);
}else if(AlarmConstants.CONDITION_ALARM.equals(source)){
return AlarmConstants.ONE_LEVEL.equals(type);
}
return false;
}
/**
* 遮罩提示
* @param source : 告警来源
* @param type : 告警子类
* @return
*/
private boolean mask(Integer source, Integer type) {
if(AlarmConstants.HZ3000_ALARM.equals(source)){
return AlarmConstants.INTERRUPT.equals(type) || AlarmConstants.ABNORMAL.equals(source);
}
return false;
}
/**
* 语音播报
* @param source : 告警来源
* @param type : 告警子类
* @return
*/
private boolean broadcast(Integer source, Integer type) {
if(AlarmConstants.HZ3000_ALARM.equals(source)){
return AlarmConstants.FAULT.equals(type);
}else if(AlarmConstants.CONDITION_ALARM.equals(source)){
return AlarmConstants.ONE_LEVEL.equals(type);
}
return false;
}
/**
* WEB/APP消息推送
* @param source
* @param type
* @return
*/
private boolean WebAppMessage(Integer source, Integer type) {
if(AlarmConstants.HZ3000_ALARM.equals(source)){
return AlarmConstants.FAULT.equals(type) || AlarmConstants.INTERRUPT.equals(type) || AlarmConstants.ABNORMAL.equals(type);
}else if(AlarmConstants.LEVEL_ALARM.equals(source)){
return AlarmConstants.ONE_LEVEL.equals(type) || AlarmConstants.TWO_LEVEL.equals(type) || AlarmConstants.THREE_LEVEL.equals(type);
}
return AlarmConstants.EARLY_WARNING.equals(source);
}
/**
* 短信推送
* @param source
* @param type
* @return
*/
private boolean message(Integer source, Integer type) {
if(AlarmConstants.HZ3000_ALARM.equals(source)){
return AlarmConstants.FAULT.equals(type) || AlarmConstants.INTERRUPT.equals(type) || AlarmConstants.ABNORMAL.equals(type);
}else if(AlarmConstants.LEVEL_ALARM.equals(source)){
return AlarmConstants.ONE_LEVEL.equals(type);
}
return false; return false;
} }
/**
* 微信公众号消息
* @param source : 告警来源
* @param type : 告警子类
* @return
*/
private boolean wechatMessage(Integer source, Integer type) {
if(AlarmConstants.HZ3000_ALARM.equals(source)){
return AlarmConstants.FAULT.equals(type) || AlarmConstants.INTERRUPT.equals(type) || AlarmConstants.ABNORMAL.equals(type);
}else if(AlarmConstants.LEVEL_ALARM.equals(source)){
return AlarmConstants.ONE_LEVEL.equals(type) || AlarmConstants.TWO_LEVEL.equals(type);
}
return AlarmConstants.EARLY_WARNING.equals(source);
}
} }

12
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/AlarmController.java

@ -2,7 +2,6 @@ package com.hnac.hzims.alarm.show.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.entity.AlarmEntity;
import com.hnac.hzims.alarm.show.service.AlarmService; import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.vo.AlarmCountVo; import com.hnac.hzims.alarm.vo.AlarmCountVo;
@ -13,7 +12,10 @@ import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import java.util.List; import java.util.List;
@ -38,8 +40,8 @@ public class AlarmController extends BladeController {
@PostMapping("/count") @PostMapping("/count")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "分页", notes = "传入告警类型 0- HZ3000告警 1 -等级告警 2 -条件告警 3-FDP智能预警") @ApiOperation(value = "告警分类数量", notes = "不需要传入参数")
public R<List<AlarmCountVo>> counts(@RequestParam Integer type) { public R<List<AlarmCountVo>> counts() {
return R.data(alarmService.counts(type)); return R.data(alarmService.counts());
} }
} }

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmService.java

@ -14,5 +14,5 @@ public interface AlarmService extends BaseService<AlarmEntity> {
IPage<AlarmEntity> alarms(AlarmEntity alarm, IPage<AlarmEntity> page); IPage<AlarmEntity> alarms(AlarmEntity alarm, IPage<AlarmEntity> page);
List<AlarmCountVo> counts(Integer type); List<AlarmCountVo> counts();
} }

111
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java

@ -1,16 +1,25 @@
package com.hnac.hzims.alarm.show.service.impl; package com.hnac.hzims.alarm.show.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.alarm.config.service.AlarmConfigService;
import com.hnac.hzims.alarm.constants.AlarmConstants;
import com.hnac.hzims.alarm.entity.AlarmEntity; import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.show.mapper.AlarmMapper; import com.hnac.hzims.alarm.show.mapper.AlarmMapper;
import com.hnac.hzims.alarm.show.service.AlarmService; import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.vo.AlarmCountVo; import com.hnac.hzims.alarm.vo.AlarmCountVo;
import com.hnac.hzims.alarm.vo.ChildAlarmCountVo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author ysj * @author ysj
@ -20,6 +29,8 @@ import java.util.List;
@Slf4j @Slf4j
public class AlarmServiceImpl extends BaseServiceImpl<AlarmMapper, AlarmEntity> implements AlarmService { public class AlarmServiceImpl extends BaseServiceImpl<AlarmMapper, AlarmEntity> implements AlarmService {
private final AlarmConfigService configService;
/** /**
* 查询告警列表 * 查询告警列表
* @param alarm * @param alarm
@ -28,26 +39,110 @@ public class AlarmServiceImpl extends BaseServiceImpl<AlarmMapper, AlarmEntity>
*/ */
@Override @Override
public IPage<AlarmEntity> alarms(AlarmEntity alarm, IPage<AlarmEntity> page) { public IPage<AlarmEntity> alarms(AlarmEntity alarm, IPage<AlarmEntity> page) {
// 参数过滤 :站点、时间、告警来源、告警子类
// 排除站点 // 排除站点
List<String> codes = configService.exclude(AlarmConstants.IS_RIGHT_TABULATION);
// 参数过滤 :站点、告警来源、告警子类
QueryWrapper wrapper = new QueryWrapper<>();
if(!StringUtil.isEmpty(alarm.getStationId())){
wrapper.eq("STATION_ID",alarm.getStationId());
}
if(!StringUtil.isEmpty(alarm.getAlarmSource())){
wrapper.eq("ALARM_SOURCE",alarm.getAlarmSource());
}
if(!StringUtil.isEmpty(alarm.getAlarmType())){
wrapper.eq("ALARM_TYPE",alarm.getAlarmType());
}
if(!CollectionUtil.isEmpty(codes)){
wrapper.notIn("STATION_ID",codes);
}
// 查询数据 // 查询数据
return null; return this.page(page,wrapper);
} }
/** /**
* 查询告警数量 * 查询告警数量
* @param type
* @return * @return
*/ */
@Override @Override
public List<AlarmCountVo> counts(Integer type) { public List<AlarmCountVo> counts() {
// 参数过滤 :站点、时间、告警来源、告警子类
// 排除站点 // 排除站点
List<String> codes = configService.exclude(AlarmConstants.IS_RIGHT_TABULATION);
// 查询告警数据
QueryWrapper wrapper = new QueryWrapper<>();
if(CollectionUtil.isNotEmpty(codes)){
wrapper.notIn("STATION_ID",codes);
}
List<AlarmEntity> alarms = this.list(wrapper);
// 查询数量 // 查询数量
return null; return AlarmConstants.ALARAM_SOURCES.stream().map(source->{
AlarmCountVo count = new AlarmCountVo();
count.setType(source);
if(CollectionUtil.isNotEmpty(alarms)){
count.setCount(0L);
}else{
count.setCount(alarms.stream().filter(o->o.getAlarmSource().equals(source)).count());
}
count.setChilds(this.childs(source,alarms.stream().filter(o->o.getAlarmSource().equals(source)).collect(Collectors.toList())));
return count;
}).collect(Collectors.toList());
}
/**
* 子类型数量集合
* @param source : 源类型
* @param collect : 源类型告警数据
* @return
*/
private List<ChildAlarmCountVo> childs(Integer source, List<AlarmEntity> collect) {
// HZ3000告警
if(AlarmConstants.HZ3000_ALARM.equals(source)){
return AlarmConstants.HZ3000_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());
// 等级告警
}else if(AlarmConstants.LEVEL_ALARM.equals(source)){
return AlarmConstants.LEVEL_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());
// 条件告警
}else if(AlarmConstants.CONDITION_ALARM.equals(source)){
ChildAlarmCountVo count = new ChildAlarmCountVo();
count.setType(AlarmConstants.CONDITION);
if(CollectionUtil.isEmpty(collect)){
count.setCount(0L);
}else{
count.setCount((long) collect.size());
}
return Collections.singletonList(count);
// 智能预警
}else if(AlarmConstants.EARLY_WARNING.equals(source)){
ChildAlarmCountVo count = new ChildAlarmCountVo();
count.setType(AlarmConstants.EARLY);
if(CollectionUtil.isEmpty(collect)){
count.setCount(0L);
}else{
count.setCount((long) collect.size());
}
return Collections.singletonList(count);
}
return new ArrayList<>();
} }
} }

11
hzims-service/hzims-alarm/src/main/resources/mapper/AlarmConfigDetatilMapper.xml

@ -2,4 +2,15 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.alarm.config.mapper.AlarmConfigDetailMapper"> <mapper namespace="com.hnac.hzims.alarm.config.mapper.AlarmConfigDetailMapper">
<select id="isSupport" resultType="com.hnac.hzims.alarm.entity.AlarmConfigDetailEntity">
SELECT detail.* FROM hzims_alarm_config_detail detail
INNER JOIN hzims_alarm_config config
ON detail.STRATEGY_ID = config.ID
WHERE config.IS_ENABLE = 0
AND config.IS_DELETED = 0
AND detail.IS_DELETED = 0
AND config.STATION_ID = #{code}
AND detail.ALARM_TYPE = #{source}
AND detail.ALARM_CHILED_TYPE = #{type}
</select>
</mapper> </mapper>

18
hzims-service/hzims-alarm/src/main/resources/mapper/AlarmConfigMapper.xml

@ -2,4 +2,22 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.alarm.config.mapper.AlarmConfigMapper"> <mapper namespace="com.hnac.hzims.alarm.config.mapper.AlarmConfigMapper">
<select id="exclude" resultType="java.lang.String">
SELECT distinct config.STATION_ID FROM hzims_alarm_config_detail detail
INNER JOIN hzims_alarm_config config
ON detail.STRATEGY_ID = config.ID
WHERE config.IS_ENABLE = 0
AND config.IS_DELETED = 0
AND detail.IS_DELETED = 0
AND CASE #{operate}
WHEN 1 THEN detail.IS_RIGHT_TABULATION = 0
WHEN 2 THEN detail.IS_SHOW_ALERT = 0
WHEN 3 THEN detail.IS_SMALL_BELL = 0
WHEN 4 THEN detail.IS_MASK = 0
WHEN 5 THEN detail.IS_BROADCAST = 0
WHEN 6 THEN detail.IS_PLATFORM_MESSAGE = 0
WHEN 7 THEN detail.IS_SHORT_MESSAGE = 0
WHEN 8 THEN detail.IS_WX_MESSAGE = 0
END
</select>
</mapper> </mapper>

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceMonitorReportMonthDTO.java

@ -24,4 +24,9 @@ public class OperMaintenanceMonitorReportMonthDTO implements Serializable {
@ApiModelProperty(value = "月", required = true) @ApiModelProperty(value = "月", required = true)
private Integer month; private Integer month;
/**
* 站点code
*/
private String stationCode;
} }

25
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceMonitorServiceImpl.java

@ -12,6 +12,7 @@ import com.hnac.hzims.operational.maintenance.mapper.OperMaintenanceTaskMapper;
import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceMonitorService; import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceMonitorService;
import com.hnac.hzims.operational.maintenance.vo.OperMaintenancePlanVO; import com.hnac.hzims.operational.maintenance.vo.OperMaintenancePlanVO;
import com.hnac.hzims.operational.maintenance.wrapper.OperMaintenancePlanWrapper; import com.hnac.hzims.operational.maintenance.wrapper.OperMaintenancePlanWrapper;
import org.apache.commons.lang3.StringUtils;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.*; import org.springblade.core.tool.utils.*;
import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.cache.UserCache;
@ -44,23 +45,24 @@ public class OperMaintenanceMonitorServiceImpl implements IOperMaintenanceMonito
@Override @Override
public R<Map<String, List<OperMaintenancePlanVO>>> reportMonth(OperMaintenanceMonitorReportMonthDTO req) { public R<Map<String, List<OperMaintenancePlanVO>>> reportMonth(OperMaintenanceMonitorReportMonthDTO req) {
List<OperMaintenancePlanEntity> planEntities = planMapper.selectList(new LambdaQueryWrapper<OperMaintenancePlanEntity>() {{ List<OperMaintenancePlanEntity> planEntities = planMapper.selectList(new LambdaQueryWrapper<OperMaintenancePlanEntity>() {{
LocalDate startDate = LocalDate.of(req.getYear(), req.getMonth(),1); LocalDate startDate = LocalDate.of(req.getYear(), req.getMonth(), 1);
// Date startTime = DateUtil.parse(DateUtil.format(DateUtil.now(), "yyyy-MM") + "-01", DateUtil.PATTERN_DATE); // Date startTime = DateUtil.parse(DateUtil.format(DateUtil.now(), "yyyy-MM") + "-01", DateUtil.PATTERN_DATE);
eq(OperMaintenancePlanEntity::getIsDeleted, 0L); eq(OperMaintenancePlanEntity::getIsDeleted, 0L);
ge(OperMaintenancePlanEntity::getDisposeTime, startDate); ge(OperMaintenancePlanEntity::getDisposeTime, startDate);
lt(OperMaintenancePlanEntity::getDisposeTime, startDate.with(TemporalAdjusters.lastDayOfMonth())); lt(OperMaintenancePlanEntity::getDisposeTime, startDate.with(TemporalAdjusters.lastDayOfMonth()))
.eq(StringUtils.isNoneBlank(req.getStationCode()), OperMaintenancePlanEntity::getStationCode, req.getStationCode());
}}); }});
//获取列表班次ID集合 //获取列表班次ID集合
List<Long> classIdList = planEntities.stream().filter(planEntity -> ObjectUtil.isNotEmpty(planEntity.getImsDutyClassId())) List<Long> classIdList = planEntities.stream().filter(planEntity -> ObjectUtil.isNotEmpty(planEntity.getImsDutyClassId()))
.map(OperMaintenancePlanEntity::getImsDutyClassId).collect(Collectors.toList()); .map(OperMaintenancePlanEntity::getImsDutyClassId).collect(Collectors.toList());
IImsDutyClassService imsDutyClassService = SpringUtil.getBean(IImsDutyClassService.class); IImsDutyClassService imsDutyClassService = SpringUtil.getBean(IImsDutyClassService.class);
Map<Long,List<ImsDutyClassEntity>> classMap = null; Map<Long, List<ImsDutyClassEntity>> classMap = null;
if(CollectionUtil.isNotEmpty(classIdList)) { if (CollectionUtil.isNotEmpty(classIdList)) {
List<ImsDutyClassEntity> classEntityList = imsDutyClassService.list(new LambdaQueryWrapper<ImsDutyClassEntity>(){{ List<ImsDutyClassEntity> classEntityList = imsDutyClassService.list(new LambdaQueryWrapper<ImsDutyClassEntity>() {{
in(ImsDutyClassEntity::getId,classIdList); in(ImsDutyClassEntity::getId, classIdList);
}}); }});
if(CollectionUtil.isNotEmpty(classEntityList)) { if (CollectionUtil.isNotEmpty(classEntityList)) {
classMap = classEntityList.stream().collect(Collectors.groupingBy(ImsDutyClassEntity::getId)); classMap = classEntityList.stream().collect(Collectors.groupingBy(ImsDutyClassEntity::getId));
} }
} }
@ -69,18 +71,17 @@ public class OperMaintenanceMonitorServiceImpl implements IOperMaintenanceMonito
List<OperMaintenancePlanVO> operMaintenancePlanVOS = new ArrayList<>(); List<OperMaintenancePlanVO> operMaintenancePlanVOS = new ArrayList<>();
Map<Long, List<ImsDutyClassEntity>> finalClassMap = classMap; Map<Long, List<ImsDutyClassEntity>> finalClassMap = classMap;
planEntities.forEach(planEntity -> { planEntities.forEach(planEntity -> {
OperMaintenancePlanVO planVO = BeanUtil.copy(planEntity,OperMaintenancePlanVO.class); OperMaintenancePlanVO planVO = BeanUtil.copy(planEntity, OperMaintenancePlanVO.class);
if(ObjectUtil.isNotEmpty(planEntity.getImsDutyClassId())) { if (ObjectUtil.isNotEmpty(planEntity.getImsDutyClassId())) {
//类型为班次时 获取班次名称 //类型为班次时 获取班次名称
planVO.setDutyClassName(finalClassMap.get(planEntity.getImsDutyClassId()).get(0).getClassName()); planVO.setDutyClassName(finalClassMap.get(planEntity.getImsDutyClassId()).get(0).getClassName());
} } else if (ObjectUtil.isNotEmpty(planEntity.getDisposer())) {
else if(ObjectUtil.isNotEmpty(planEntity.getDisposer())) {
//类型为人员类型时 获取执行人名称 //类型为人员类型时 获取执行人名称
planVO.setDisposerName(Optional.ofNullable(UserCache.getUser(planEntity.getDisposer())).map(User::getName).orElse(null)); planVO.setDisposerName(Optional.ofNullable(UserCache.getUser(planEntity.getDisposer())).map(User::getName).orElse(null));
} }
//当月是否生成任务 默认是false //当月是否生成任务 默认是false
LocalDateTime createTaskTime = com.hnac.hzims.common.utils.DateUtil.DateToLocalDateTime(planEntity.getCreateTaskTime()); LocalDateTime createTaskTime = com.hnac.hzims.common.utils.DateUtil.DateToLocalDateTime(planEntity.getCreateTaskTime());
if(ObjectUtil.isNotEmpty(createTaskTime) && com.hnac.hzims.common.utils.DateUtil.judgeSameDay(createTaskTime, LocalDate.now())) { if (ObjectUtil.isNotEmpty(createTaskTime) && com.hnac.hzims.common.utils.DateUtil.judgeSameDay(createTaskTime, LocalDate.now())) {
planVO.setGenerateSign(true); planVO.setGenerateSign(true);
} }
operMaintenancePlanVOS.add(planVO); operMaintenancePlanVOS.add(planVO);

1
hzims-service/operational/src/main/resources/db/1.0.1.sql

@ -0,0 +1 @@
alter table hzims_oper_maintenance_plan add station_code varchar(60) comment '站点编码'

42
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java

@ -118,10 +118,10 @@ public class OperationTicketServiceImpl implements OperationTicketService {
//获取站点编号 //获取站点编号
String signage = station.getSignage(); String signage = station.getSignage();
if (StringUtils.isBlank(signage) || signage.length() < 2) { if (StringUtils.isBlank(signage)) {
throw new ServiceException("票据抬头未配置,请您到站点管理配置"); throw new ServiceException("票据抬头未配置,请您到站点管理配置");
} }
signage = signage.length() == 2 ? station.getSignage() : station.getSignage().substring(0, 2); //signage = signage.length() == 2 ? station.getSignage() : station.getSignage().substring(0, 2);
standardTicketInfoVo.setSignage(signage); standardTicketInfoVo.setSignage(signage);
standardTicketInfoVo.setSignageCode(station.getCode()); standardTicketInfoVo.setSignageCode(station.getCode());
@ -169,7 +169,8 @@ public class OperationTicketServiceImpl implements OperationTicketService {
JSONObject jsonObject = JSONObject.parseObject(formData); JSONObject jsonObject = JSONObject.parseObject(formData);
// standardTicketInfoVo = JSONObject.toJavaObject(jsonObject, StandardTicketInfoVo.class); // standardTicketInfoVo = JSONObject.toJavaObject(jsonObject, StandardTicketInfoVo.class);
standardTicketInfoVo = JSONObject.parseObject(jsonObject.getString("standardTicketInfoVo"), standardTicketInfoVo = JSONObject.parseObject(jsonObject.getString("standardTicketInfoVo"),
new TypeReference<StandardTicketInfoVo>(){}); new TypeReference<StandardTicketInfoVo>() {
});
} catch (Exception e) { } catch (Exception e) {
log.error("获取表单出现异常了~~~~"); log.error("获取表单出现异常了~~~~");
e.printStackTrace(); e.printStackTrace();
@ -401,10 +402,10 @@ public class OperationTicketServiceImpl implements OperationTicketService {
result = "DZ"; result = "DZ";
break; break;
case "4": case "4":
result = type; result = "KJ";
break; break;
case "5": case "5":
result = type; result = "TJ";
break; break;
default: default:
result = "DZ"; result = "DZ";
@ -433,6 +434,11 @@ public class OperationTicketServiceImpl implements OperationTicketService {
Map<String, Object> workTicketInfoMap = this.convertMap(standardTicketInfoVo); Map<String, Object> workTicketInfoMap = this.convertMap(standardTicketInfoVo);
//导入下在word //导入下在word
Map<String, Object> resultMap = OperationWordHelper.resultMap(workTicketInfoMap); Map<String, Object> resultMap = OperationWordHelper.resultMap(workTicketInfoMap);
String name = getBuilder(standardTicketInfoVo.getTicketType());
resultMap.put("headTitle", name);
String workTicketStatus = OperationWordHelper.getWorkTicketStatus(status); String workTicketStatus = OperationWordHelper.getWorkTicketStatus(status);
String os = TicketConstant.OS_NAME; String os = TicketConstant.OS_NAME;
//Windows操作系统 //Windows操作系统
@ -453,6 +459,32 @@ public class OperationTicketServiceImpl implements OperationTicketService {
/** /**
* 获取操作票的名称
*
* @param ticketType
* @return
*/
private String getBuilder(String ticketType) {
String result = null;
switch (ticketType) {
case "3":
result = "倒闸";
break;
case "4":
result = "开机";
break;
case "5":
result = "停机";
break;
default:
result = "倒闸";
break;
}
return result;
}
/**
* 将查询的数据转换为map * 将查询的数据转换为map
* *
* @param standardTicketInfoVo * @param standardTicketInfoVo

4
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java

@ -188,10 +188,10 @@ public class TicketProcessServiceImpl implements TicketProcessService {
//获取站点编号 //获取站点编号
String signage = station.getSignage(); String signage = station.getSignage();
if (StringUtils.isBlank(signage) || signage.length() < 2) { if (StringUtils.isBlank(signage)) {
throw new ServiceException("票据抬头未配置,请您到站点管理配置"); throw new ServiceException("票据抬头未配置,请您到站点管理配置");
} }
signage = signage.length() == 2 ? station.getSignage() : station.getSignage().substring(0, 2); //signage = signage.length() == 2 ? station.getSignage() : station.getSignage().substring(0, 2);
workTicketVo.getWorkTicket().setSignage(station.getSignage()); workTicketVo.getWorkTicket().setSignage(station.getSignage());
workTicketVo.getWorkTicket().setSignageCode(station.getCode()); workTicketVo.getWorkTicket().setSignageCode(station.getCode());

BIN
hzims-service/ticket/src/main/resources/template/电气操作票.docx

Binary file not shown.
Loading…
Cancel
Save