32 changed files with 785 additions and 147 deletions
			
			
		| @ -0,0 +1,104 @@ | |||||||
|  | package com.hnac.hzims.alarm.config.entity; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableField; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableName; | ||||||
|  | import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||||||
|  | import com.fasterxml.jackson.databind.ser.std.NullSerializer; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.EqualsAndHashCode; | ||||||
|  | import org.springblade.core.mp.base.BaseEntity; | ||||||
|  | 
 | ||||||
|  | import java.util.Date; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @author ysj | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @TableName("hzims_alarm_handle_flow") | ||||||
|  | @EqualsAndHashCode(callSuper = true) | ||||||
|  | @ApiModel(value = "告警处理对象") | ||||||
|  | public class AlarmHandleFlowEntity extends BaseEntity { | ||||||
|  | 
 | ||||||
|  | 	@ApiModelProperty("告警Id") | ||||||
|  | 	private String alarmId; | ||||||
|  | 
 | ||||||
|  | 	@ApiModelProperty("站点编码") | ||||||
|  | 	private String stationCode; | ||||||
|  | 
 | ||||||
|  | 	@ApiModelProperty("告警类型") | ||||||
|  | 	private Long alarmType; | ||||||
|  | 
 | ||||||
|  | 	@ApiModelProperty("告警所属类型:0-系统告警 1-智能告警") | ||||||
|  | 	private Integer type; | ||||||
|  | 
 | ||||||
|  | 	@ApiModelProperty("告警时间") | ||||||
|  | 	private Date alarmTime; | ||||||
|  | 
 | ||||||
|  | 	@ApiModelProperty("告警内容") | ||||||
|  | 	private String alarmContent; | ||||||
|  | 
 | ||||||
|  | 	@ApiModelProperty("告警状态  1L,2L,3L,4L,5L  误报 、延后、缺陷 、检修、处理 ") | ||||||
|  | 	private Long handleWay; | ||||||
|  | 
 | ||||||
|  | //	@ApiModelProperty("处理详情ID")
 | ||||||
|  | //	private Long detailId;
 | ||||||
|  | 
 | ||||||
|  | 	@ApiModelProperty("通知处理人") | ||||||
|  | 	private Long handleUser; | ||||||
|  | 
 | ||||||
|  | 	@ApiModelProperty("通知处理人") | ||||||
|  | 	@TableField(exist=false) | ||||||
|  | 	private String handleUserFlow; | ||||||
|  | 
 | ||||||
|  | 	@ApiModelProperty("现象ID") | ||||||
|  | 	private Long phenomenonId; | ||||||
|  | 
 | ||||||
|  | 	@ApiModelProperty("检修ID") | ||||||
|  | 	private Long accessId; | ||||||
|  | 
 | ||||||
|  | 	@ApiModelProperty("延后时间") | ||||||
|  | 	private Date delayTime; | ||||||
|  | 
 | ||||||
|  | 	@ApiModelProperty("延后原因") | ||||||
|  | 	private String delayCause; | ||||||
|  | 
 | ||||||
|  | 	@ApiModelProperty("误报描述") | ||||||
|  | 	private String falseAlarmDesc; | ||||||
|  | 
 | ||||||
|  | 	@ApiModelProperty("附件路径") | ||||||
|  | 	private String filePath; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 	@ApiModelProperty("处理方式") | ||||||
|  | 	private String dealType; | ||||||
|  | 	@ApiModelProperty("处理结果") | ||||||
|  | 	private String dealResult; | ||||||
|  | 	@ApiModelProperty("处理描述") | ||||||
|  | 	private String dealDesc; | ||||||
|  | 	@ApiModelProperty("处理附件") | ||||||
|  | 	private String dealPath; | ||||||
|  | 	@ApiModelProperty("审批结果 0,不通过;1为通过") | ||||||
|  | 	private Integer checkFlag; | ||||||
|  | 	@ApiModelProperty("审批说明") | ||||||
|  | 	private String checkDesc; | ||||||
|  | 	@JsonSerialize(nullsUsing = NullSerializer.class) | ||||||
|  | 	@ApiModelProperty(value = "当前处理环节") | ||||||
|  | 	private String currentOperator; | ||||||
|  | 	@JsonSerialize(nullsUsing = NullSerializer.class) | ||||||
|  | 	@ApiModelProperty(value = "当前环节处理人") | ||||||
|  | 	private String currentLinkHandler; | ||||||
|  | 	@ApiModelProperty(value = "流程实例") | ||||||
|  | 	private String processInstanceId; | ||||||
|  | 	@ApiModelProperty("创建用户姓名") | ||||||
|  | 	private String createUserName; | ||||||
|  | 	@ApiModelProperty("处理人姓名") | ||||||
|  | 	private String handleUserName; | ||||||
|  | 	@ApiModelProperty("审批人") | ||||||
|  | 	private String approvalUser; | ||||||
|  | 	@ApiModelProperty("审批人姓名") | ||||||
|  | 	private String approvalUserName; | ||||||
|  | 	@ApiModelProperty("创建机构名称") | ||||||
|  | 	private String createDeptName; | ||||||
|  | } | ||||||
| @ -0,0 +1,22 @@ | |||||||
|  | package com.hnac.hzims.alarm.config.feign.Fallback; | ||||||
|  | 
 | ||||||
|  | import com.hnac.hzims.alarm.config.feign.IAlarmHandleClient; | ||||||
|  | import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; | ||||||
|  | import lombok.extern.slf4j.Slf4j; | ||||||
|  | import org.springblade.core.tool.api.R; | ||||||
|  | import org.springframework.stereotype.Component; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @author ty | ||||||
|  |  */ | ||||||
|  | @Slf4j | ||||||
|  | @Component | ||||||
|  | public class IAlarmHandleClientFallback implements IAlarmHandleClient { | ||||||
|  | 
 | ||||||
|  | 	@Override | ||||||
|  | 	public R listenAndUpdateAlarm(ProcessWorkFlowResponse processWorkFlowResponse) { | ||||||
|  | 		log.error("远程调用失败,接口:" + LISTEN_ALARM); | ||||||
|  | 		return null; | ||||||
|  | 	} | ||||||
|  | } | ||||||
| @ -0,0 +1,33 @@ | |||||||
|  | package com.hnac.hzims.alarm.config.feign; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import com.hnac.hzims.alarm.config.constants.AlarmConstants; | ||||||
|  | import com.hnac.hzims.alarm.config.feign.Fallback.IAlarmHandleClientFallback; | ||||||
|  | import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; | ||||||
|  | import org.springblade.core.tool.api.R; | ||||||
|  | import org.springframework.cloud.openfeign.FeignClient; | ||||||
|  | import org.springframework.web.bind.annotation.PostMapping; | ||||||
|  | import org.springframework.web.bind.annotation.RequestBody; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @author xiashandong | ||||||
|  |  * @created 2021/6/10 15:21 | ||||||
|  |  **/ | ||||||
|  | @FeignClient( | ||||||
|  | 	value = AlarmConstants.APP_NAME, | ||||||
|  | 	fallback = IAlarmHandleClientFallback.class | ||||||
|  | ) | ||||||
|  | public interface IAlarmHandleClient { | ||||||
|  | 
 | ||||||
|  | 	String API_PREFIX = "/feign/alarm"; | ||||||
|  | 
 | ||||||
|  | 	String LISTEN_ALARM = API_PREFIX + "/listenAndUpdateAlarm"; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 	@PostMapping(LISTEN_ALARM) | ||||||
|  | 	R listenAndUpdateAlarm(@RequestBody ProcessWorkFlowResponse processWorkFlowResponse); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,17 @@ | |||||||
|  | package com.hnac.hzims.fdp.service; | ||||||
|  | 
 | ||||||
|  | import org.springblade.core.tool.api.R; | ||||||
|  | 
 | ||||||
|  | import java.util.Map; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 服务类 | ||||||
|  |  * | ||||||
|  |  * @author xiashandong | ||||||
|  |  * @created 2021-05-25 17:32 | ||||||
|  |  **/ | ||||||
|  | public interface IFdpFocusSurveillanceService { | ||||||
|  | 
 | ||||||
|  | 	R setFaultStatusInfo( Map<String, Object> map); | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,73 @@ | |||||||
|  | package com.hnac.hzims.fdp.service.impl; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import com.alibaba.fastjson.JSONObject; | ||||||
|  | import com.alibaba.fastjson.TypeReference; | ||||||
|  | import com.hnac.hzims.equipment.service.IEmInfoService; | ||||||
|  | import com.hnac.hzims.fdp.mapper.FdpDeviceMapper; | ||||||
|  | import com.hnac.hzims.fdp.mapper.FdpMonitorNoScopeMapper; | ||||||
|  | import com.hnac.hzims.fdp.proxy.IDiagnoseProxy; | ||||||
|  | import com.hnac.hzims.fdp.service.IFdpFaultService; | ||||||
|  | import com.hnac.hzims.fdp.service.IFdpFocusSurveillanceService; | ||||||
|  | import com.hnac.hzims.fdp.service.IFdpTaskService; | ||||||
|  | import com.hnac.hzims.fdp.util.HttpRequestUtil; | ||||||
|  | import com.hnac.hzims.operational.station.feign.IStationClient; | ||||||
|  | import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient; | ||||||
|  | import com.hnac.hzinfo.datasearch.analyse.IAnalyseInstanceClient; | ||||||
|  | import com.hnac.hzinfo.datasearch.real.IRealDataSearchClient; | ||||||
|  | import lombok.RequiredArgsConstructor; | ||||||
|  | import lombok.extern.slf4j.Slf4j; | ||||||
|  | import org.springblade.core.tool.api.R; | ||||||
|  | import org.springframework.beans.factory.annotation.Value; | ||||||
|  | import org.springframework.data.redis.core.RedisTemplate; | ||||||
|  | import org.springframework.stereotype.Service; | ||||||
|  | 
 | ||||||
|  | import java.util.*; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @author 86187 | ||||||
|  |  */ | ||||||
|  | @Slf4j | ||||||
|  | @Service | ||||||
|  | @RequiredArgsConstructor | ||||||
|  | public class FdpFocusSurveillanceServiceImpl implements IFdpFocusSurveillanceService { | ||||||
|  |     private final FdpDeviceMapper fdpDeviceMapper; | ||||||
|  |     private final IEmInfoService emInfoService; | ||||||
|  |     private final IAnalyseInstanceClient deviceInstanceClient; | ||||||
|  |     private final IAnalyseInstanceClient analyseInstanceClient; | ||||||
|  |     private final IRealDataSearchClient realDataSearchClient; | ||||||
|  |     private final IAnalyseDataSearchClient deviceDataSearchClient; | ||||||
|  |     private final IFdpTaskService fdpTaskService; | ||||||
|  |     private final IDiagnoseProxy diagnoseProxy; | ||||||
|  |     private final FdpMonitorNoScopeMapper fdpMonitorNoScopeMapper; | ||||||
|  |     private final IStationClient stationClient; | ||||||
|  |     private final IFdpFaultService fdpFaultService; | ||||||
|  |     private final RedisTemplate redisTemplate; | ||||||
|  | 
 | ||||||
|  |     @Value("${url.setFaultStatusInfo}") | ||||||
|  |     public String setFaultStatusInfo; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 集中监控智能预警-处理状态推送 | ||||||
|  |      * @param map | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public R setFaultStatusInfo( Map<String, Object>  map) { | ||||||
|  |         String post = HttpRequestUtil.postCallObjectParam(map, setFaultStatusInfo, "POST"); | ||||||
|  |         R r = JSONObject.parseObject(post, new TypeReference<R>() {{}}); | ||||||
|  |         return r; | ||||||
|  | //        if (r.isSuccess()){
 | ||||||
|  | //            return R.success("修改成功");
 | ||||||
|  | //        }else {
 | ||||||
|  | //            return R.fail(r.getMsg());
 | ||||||
|  | //        }
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| @ -0,0 +1,26 @@ | |||||||
|  | package com.hnac.hzims.alarm.show.feign; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import com.hnac.hzims.alarm.config.feign.IAlarmHandleClient; | ||||||
|  | import com.hnac.hzims.alarm.show.service.AlarmHandleFlowService; | ||||||
|  | import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import org.springblade.core.tool.api.R; | ||||||
|  | import org.springframework.web.bind.annotation.PostMapping; | ||||||
|  | import org.springframework.web.bind.annotation.RequestBody; | ||||||
|  | import org.springframework.web.bind.annotation.RestController; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | @RestController | ||||||
|  | @AllArgsConstructor | ||||||
|  | public class AlarmHandleClient implements IAlarmHandleClient { | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 	private final AlarmHandleFlowService alarmHandleFlowService; | ||||||
|  | 
 | ||||||
|  | 	@PostMapping(LISTEN_ALARM) | ||||||
|  | 	@Override | ||||||
|  | 	public R listenAndUpdateAlarm(@RequestBody ProcessWorkFlowResponse processWorkFlowResponse) { | ||||||
|  | 		return alarmHandleFlowService.listenAndUpdate(processWorkFlowResponse); | ||||||
|  | 	} | ||||||
|  | } | ||||||
| @ -0,0 +1,16 @@ | |||||||
|  | package com.hnac.hzims.alarm.show.mapper; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import com.hnac.hzims.alarm.config.entity.AlarmHandleFlowEntity; | ||||||
|  | import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @author ysj | ||||||
|  |  * @date 2023/03/09 09:19:13 | ||||||
|  |  * @version 4.0.0 | ||||||
|  |  */ | ||||||
|  | public interface AlarmHandleFlowMapper extends UserDataScopeBaseMapper<AlarmHandleFlowEntity> { | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,6 @@ | |||||||
|  | <?xml version="1.0" encoding="UTF-8"?> | ||||||
|  | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||||
|  | <mapper namespace="com.hnac.hzims.alarm.show.mapper.AlarmHandleFlowMapper"> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | </mapper> | ||||||
| @ -0,0 +1,18 @@ | |||||||
|  | package com.hnac.hzims.alarm.show.service; | ||||||
|  | 
 | ||||||
|  | import com.hnac.hzims.alarm.config.entity.AlarmHandleFlowEntity; | ||||||
|  | import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; | ||||||
|  | import org.springblade.core.mp.base.BaseService; | ||||||
|  | import org.springblade.core.tool.api.R; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @author ysj | ||||||
|  |  * @date 2023/03/09 09:19:13 | ||||||
|  |  * @version 4.0.0 | ||||||
|  |  */ | ||||||
|  | public interface AlarmHandleFlowService extends BaseService<AlarmHandleFlowEntity> { | ||||||
|  | 
 | ||||||
|  | 	 R listenAndUpdate(ProcessWorkFlowResponse processWorkFlowResponse); | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,137 @@ | |||||||
|  | package com.hnac.hzims.alarm.show.service.impl; | ||||||
|  | 
 | ||||||
|  | import com.alibaba.fastjson.JSONObject; | ||||||
|  | import com.alibaba.fastjson.TypeReference; | ||||||
|  | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||||
|  | import com.hnac.hzims.alarm.config.constants.AlarmHandleConstant; | ||||||
|  | import com.hnac.hzims.alarm.config.entity.AlarmHandleEntity; | ||||||
|  | import com.hnac.hzims.alarm.config.entity.AlarmHandleFlowEntity; | ||||||
|  | import com.hnac.hzims.alarm.show.mapper.AlarmHandleFlowMapper; | ||||||
|  | import com.hnac.hzims.alarm.show.mapper.AlarmHandleMapper; | ||||||
|  | import com.hnac.hzims.alarm.show.service.AlarmHandleFlowService; | ||||||
|  | import com.hnac.hzims.common.logs.utils.StringUtils; | ||||||
|  | import com.hnac.hzims.fdp.feign.IFdpDiagnoseClient; | ||||||
|  | import com.hnac.hzims.message.MessageConstants; | ||||||
|  | import com.hnac.hzims.message.dto.BusinessMessageDTO; | ||||||
|  | import com.hnac.hzims.message.fegin.IMessageClient; | ||||||
|  | import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; | ||||||
|  | import lombok.RequiredArgsConstructor; | ||||||
|  | import lombok.extern.slf4j.Slf4j; | ||||||
|  | import org.springblade.core.log.exception.ServiceException; | ||||||
|  | import org.springblade.core.mp.base.BaseServiceImpl; | ||||||
|  | import org.springblade.core.tool.api.R; | ||||||
|  | import org.springblade.flow.core.feign.IFlowClient; | ||||||
|  | import org.springblade.system.feign.ISysClient; | ||||||
|  | import org.springframework.beans.factory.annotation.Autowired; | ||||||
|  | import org.springframework.stereotype.Service; | ||||||
|  | 
 | ||||||
|  | import java.util.*; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @author ysj | ||||||
|  |  * @version 4.0.0 | ||||||
|  |  * @date 2023/03/09 09:29:34 | ||||||
|  |  */ | ||||||
|  | @Slf4j | ||||||
|  | @Service | ||||||
|  | @RequiredArgsConstructor | ||||||
|  | public class AlarmHandleFlowServiceImpl extends BaseServiceImpl<AlarmHandleFlowMapper, AlarmHandleFlowEntity> implements AlarmHandleFlowService{ | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 	private final IMessageClient messageClient; | ||||||
|  | 
 | ||||||
|  | 	private final ISysClient sysClient; | ||||||
|  | 
 | ||||||
|  | 	private final IFlowClient processClient; | ||||||
|  | 	@Autowired | ||||||
|  | 	private  AlarmHandleMapper alarmHandleMapper; | ||||||
|  | 
 | ||||||
|  | 	private final IFdpDiagnoseClient iFdpDiagnoseClient; | ||||||
|  | 
 | ||||||
|  | 	@Override | ||||||
|  | 	public R listenAndUpdate(ProcessWorkFlowResponse processWorkFlowResponse) { | ||||||
|  | 		long taskId; | ||||||
|  | 		AlarmHandleFlowEntity alarmHandleFlowEntity; | ||||||
|  | 		log.info("消缺消息开始转换"+processWorkFlowResponse); | ||||||
|  | 		try { | ||||||
|  | 			Map<String, Object> variables = (Map<String, Object>) processWorkFlowResponse.getVariables(); | ||||||
|  | 			//现象缺陷全表更新
 | ||||||
|  | 			alarmHandleFlowEntity= JSONObject.parseObject(JSONObject.toJSONString(variables), new TypeReference<AlarmHandleFlowEntity>(){}); | ||||||
|  | 		} catch (Exception e) { | ||||||
|  | 			log.info("消息转换失败:"+e.getMessage()); | ||||||
|  | 			return R.fail("消息转换失败"); | ||||||
|  | 		} | ||||||
|  | 		taskId=alarmHandleFlowEntity.getId(); | ||||||
|  | 		//设置当前环节+当前环节处理人
 | ||||||
|  | 		if (StringUtils.isNotEmpty(processWorkFlowResponse.getNextStepOperator())) { | ||||||
|  | 			alarmHandleFlowEntity.setCurrentOperator(processWorkFlowResponse.getTaskName()); | ||||||
|  | 			alarmHandleFlowEntity.setCurrentLinkHandler(processWorkFlowResponse.getNextStepOperator()); | ||||||
|  | 		}else { | ||||||
|  | 			alarmHandleFlowEntity.setCurrentOperator("流程结束"); | ||||||
|  | 			alarmHandleFlowEntity.setCurrentLinkHandler(""); | ||||||
|  | 			// 预警
 | ||||||
|  | 			if(AlarmHandleConstant.EARLY_WARNING.equals(alarmHandleFlowEntity.getAlarmType())){ | ||||||
|  | 				Map<String, Object> map=new HashMap<>(); | ||||||
|  | 				map.put("uuid",alarmHandleFlowEntity.getAlarmId()); | ||||||
|  | 				map.put("result",alarmHandleFlowEntity.getHandleWay()); | ||||||
|  | 				if (1l==alarmHandleFlowEntity.getHandleWay()){ | ||||||
|  | 					//处理发现误报,修改对应状态
 | ||||||
|  | 					map.put("result_info",alarmHandleFlowEntity.getDealDesc()); | ||||||
|  | 					alarmHandleMapper.update(null,Wrappers.<AlarmHandleEntity>lambdaUpdate() | ||||||
|  | 							.set(AlarmHandleEntity::getHandleWay, alarmHandleFlowEntity.getHandleWay()) | ||||||
|  | 							.set(AlarmHandleEntity::getFalseAlarmDesc, alarmHandleFlowEntity.getDealDesc()) | ||||||
|  | 							.eq(AlarmHandleEntity::getAlarmId, alarmHandleFlowEntity.getAlarmId())); | ||||||
|  | 
 | ||||||
|  | 				}else { | ||||||
|  | 					//设置处理完成
 | ||||||
|  | 					alarmHandleMapper.update(null,Wrappers.<AlarmHandleEntity>lambdaUpdate() | ||||||
|  | 							.set(AlarmHandleEntity::getHandleWay, 6l) | ||||||
|  | 							.set(AlarmHandleEntity::getFalseAlarmDesc, alarmHandleFlowEntity.getDealDesc()) | ||||||
|  | 							.eq(AlarmHandleEntity::getAlarmId, alarmHandleFlowEntity.getAlarmId())); | ||||||
|  | 					map.put("result_info",alarmHandleFlowEntity.getDealDesc()); | ||||||
|  | 				} | ||||||
|  | 				//流程结束后才,调用fdp修改状态的接口
 | ||||||
|  | 				R r = iFdpDiagnoseClient.setFaultStatusInfo(map); | ||||||
|  | 				if (!r.isSuccess()){ | ||||||
|  | 					throw new ServiceException("修改告警状态异常,请稍后重试!"); | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 		this.updateById(alarmHandleFlowEntity); | ||||||
|  | 		//推送消息中心相关消息
 | ||||||
|  | 		sendMessage(processWorkFlowResponse, alarmHandleFlowEntity,taskId); | ||||||
|  | 		log.info("消缺消息转换结束"+processWorkFlowResponse); | ||||||
|  | 		return R.success("消息保存成功"); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 	private void sendMessage(ProcessWorkFlowResponse processWorkFlowResponse, AlarmHandleFlowEntity alarmHandleFlowEntity,Long taskId) { | ||||||
|  | 		//推送消息
 | ||||||
|  | 		if (processWorkFlowResponse.getTaskId() != null) { | ||||||
|  | 			BusinessMessageDTO message = new BusinessMessageDTO(); | ||||||
|  | 			message.setBusinessClassify("system"); | ||||||
|  | 			message.setBusinessKey(MessageConstants.BusinessClassifyEnum.WARNING.getKey()); | ||||||
|  | 			message.setSubject(MessageConstants.BusinessClassifyEnum.WARNING.getDescription()); | ||||||
|  | 			message.setTaskId(Optional.ofNullable(taskId).orElse(System.currentTimeMillis())); | ||||||
|  | 			message.setTenantId("200000"); | ||||||
|  | 			String countent = | ||||||
|  | 					"您的告警处理流程待审批!告警内容:".concat(Optional.ofNullable(alarmHandleFlowEntity.getAlarmContent()).orElse("")) | ||||||
|  | 							.concat(",审批环节:") | ||||||
|  | 							.concat(processWorkFlowResponse.getTaskName()); | ||||||
|  | 			message.setContent(countent); | ||||||
|  | 			message.setDeptId(alarmHandleFlowEntity.getCreateDept()); | ||||||
|  | 			R<String> deptName = sysClient.getDeptName(alarmHandleFlowEntity.getCreateDept()); | ||||||
|  | 			if (deptName.isSuccess()) { | ||||||
|  | 				message.setDeptName(deptName.getData()); | ||||||
|  | 			} | ||||||
|  | 			String userIds = processWorkFlowResponse.getUserId(); | ||||||
|  | 			if (StringUtils.isBlank(userIds)) { | ||||||
|  | 				log.error("推送的消息不能为空哦,{}", userIds); | ||||||
|  | 				return; | ||||||
|  | 			} | ||||||
|  | 			message.setUserIds(userIds); | ||||||
|  | 			message.setCreateUser(alarmHandleFlowEntity.getCreateUser()); | ||||||
|  | 			messageClient.sendAppAndWsMsgByUsers(message); | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | } | ||||||
| @ -1,31 +1,31 @@ | |||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1434847945152356354, 0, 'alarm_source', '-1', '告警来源', 0, '', 0, 0, 1, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1434847945152356354, 0, 'ALARM_SOURCE', '-1', '告警来源', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1434847945152356361, 1434847945152356354, 'alarm_source', '0', 'HZ3000告警', 1, '', 0, 0, 1, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1434847945152356361, 1434847945152356354, 'ALARM_SOURCE', '0', 'HZ3000告警', 1, '', 0, 0, 1, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1434847945152356362, 1434847945152356354, 'alarm_source', '1', '等级告警', 2, '', 0, 0, 1, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1434847945152356362, 1434847945152356354, 'ALARM_SOURCE', '1', '等级告警', 2, '', 0, 0, 1, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1434847945152356363, 1434847945152356354, 'alarm_source', '2', '条件告警', 3, '', 0, 0, 1, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1434847945152356363, 1434847945152356354, 'ALARM_SOURCE', '2', '条件告警', 3, '', 0, 0, 1, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1434847945152356364, 1434847945152356354, 'alarm_source', '3', 'FDP智能预警', 1, '', 0, 0, 1, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1434847945152356364, 1434847945152356354, 'ALARM_SOURCE', '3', 'FDP智能预警', 1, '', 0, 0, 1, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1434847945152356365, 1434847945152356354, 'alarm_source', '4', '视频预警', 2, '', 0, 0, 1, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1434847945152356365, 1434847945152356354, 'ALARM_SOURCE', '4', '视频预警', 2, '', 0, 0, 1, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1434847945152356366, 1434847945152356354, 'alarm_source', '5', '开关机告警', 3, '', 0, 0, 1, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1434847945152356366, 1434847945152356354, 'ALARM_SOURCE', '5', '开关机告警', 3, '', 0, 0, 1, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1451741563297222651, 0, 'level_alarm', '-1', '等级告警', 0, '', 0, 0, 1, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1451741563297222651, 0, 'LEVEL_ALARM', '-1', '等级告警', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1451741563297222652, 1451741563297222651, 'level_alarm', '21', '一级告警', 0, '', 0, 0, 1, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1451741563297222652, 1451741563297222651, 'LEVEL_ALARM', '21', '一级告警', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1451741563297222653, 1451741563297222651, 'level_alarm', '22', '二级告警', 0, '', 0, 0, 1, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1451741563297222653, 1451741563297222651, 'LEVEL_ALARM', '22', '二级告警', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1451741563297222654, 1451741563297222651, 'level_alarm', '23', '三级告警', 0, '', 0, 0, 1, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1451741563297222654, 1451741563297222651, 'LEVEL_ALARM', '23', '三级告警', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1597833496933597001, 0, 'alarm_type', '-1', '告警类型', 0, '', 0, 0, 0, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1597833496933597001, 0, 'ALARM_TYPE', '-1', '告警类型', 0, '', 0, 0, 0, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1597833496933597002, 1597833496933597001, 'alarm_type', '2', '告警', 0, '', 0, 0, 0, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1597833496933597002, 1597833496933597001, 'ALARM_TYPE', '2', '告警', 0, '', 0, 0, 0, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1597833496933597003, 1597833496933597001, 'alarm_type', '3', '故障', 0, '', 0, 0, 0, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1597833496933597003, 1597833496933597001, 'ALARM_TYPE', '3', '故障', 0, '', 0, 0, 0, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1597833496933597004, 1597833496933597001, 'alarm_type', '5', '遥测越限', 0, '', 0, 0, 0, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1597833496933597004, 1597833496933597001, 'ALARM_TYPE', '5', '遥测越限', 0, '', 0, 0, 0, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1597833496933597005, 1597833496933597001, 'alarm_type', '13', '通讯中断', 0, '', 0, 0, 0, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1597833496933597005, 1597833496933597001, 'ALARM_TYPE', '13', '通讯中断', 0, '', 0, 0, 0, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1597833496933597006, 1597833496933597001, 'alarm_type', '14', '数据异常', 0, '', 0, 0, 0, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1597833496933597006, 1597833496933597001, 'ALARM_TYPE', '14', '数据异常', 0, '', 0, 0, 0, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1597833496933597007, 1597833496933597001, 'alarm_type', '21', '一级告警', 0, '', 0, 0, 0, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1597833496933597007, 1597833496933597001, 'ALARM_TYPE', '21', '一级告警', 0, '', 0, 0, 0, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1597833496933597008, 1597833496933597001, 'alarm_type', '22', '二级告警', 0, '', 0, 0, 0, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1597833496933597008, 1597833496933597001, 'ALARM_TYPE', '22', '二级告警', 0, '', 0, 0, 0, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1597833496933597009, 1597833496933597001, 'alarm_type', '23', '三级告警', 0, '', 0, 0, 0, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1597833496933597009, 1597833496933597001, 'ALARM_TYPE', '23', '三级告警', 0, '', 0, 0, 0, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1597833496933597010, 1597833496933597001, 'alarm_type', '30', '智能预警', 0, '', 0, 0, 0, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1597833496933597010, 1597833496933597001, 'ALARM_TYPE', '30', '智能预警', 0, '', 0, 0, 0, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1597833496933597011, 1597833496933597001, 'alarm_type', '40', '条件告警', 0, '', 0, 0, 0, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1597833496933597011, 1597833496933597001, 'ALARM_TYPE', '40', '条件告警', 0, '', 0, 0, 0, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1597833496933597012, 1597833496933597001, 'alarm_type', '50', '视频告警', 0, '', 0, 0, 0, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1597833496933597012, 1597833496933597001, 'ALARM_TYPE', '50', '视频告警', 0, '', 0, 0, 0, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1597833496933597013, 1597833496933597001, 'alarm_type', '60', '开机告警', 0, '', 0, 0, 0, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1597833496933597013, 1597833496933597001, 'ALARM_TYPE', '60', '开机告警', 0, '', 0, 0, 0, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1597833496933597014, 1597833496933597001, 'alarm_type', '61', '关机告警', 0, '', 0, 0, 0, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1597833496933597014, 1597833496933597001, 'ALARM_TYPE', '61', '关机告警', 0, '', 0, 0, 0, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1658763247160922111, 0, 'HZ3000_alarm', '-1', 'HZ3000告警', 0, '', 0, 0, 1, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1658763247160922111, 0, 'HZ3000_ALARM', '-1', 'HZ3000告警', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1658763247160922112, 1658763247160922111, 'HZ3000_alarm', '2', '告警', 0, '', 0, 0, 1, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1658763247160922112, 1658763247160922111, 'HZ3000_ALARM', '2', '告警', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1658763247160922113, 1658763247160922111, 'HZ3000_alarm', '3', '故障', 0, '', 0, 0, 1, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1658763247160922113, 1658763247160922111, 'HZ3000_ALARM', '3', '故障', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1658763247160922114, 1658763247160922111, 'HZ3000_alarm', '5', '遥测越限', 0, '', 0, 0, 1, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1658763247160922114, 1658763247160922111, 'HZ3000_ALARM', '5', '遥测越限', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1658763247160922115, 1658763247160922111, 'HZ3000_alarm', '13', '通讯中断', 0, '', 0, 0, 1, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1658763247160922115, 1658763247160922111, 'HZ3000_ALARM', '13', '通讯中断', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM'); | ||||||
| INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1658763247160922116, 1658763247160922111, 'HZ3000_alarm', '14', '数据异常', 0, '', 0, 0, 1, -1, 'hzims-alarm'); | INSERT INTO `BLADEX`.`BLADE_DICT` (`ID`, `PARENT_ID`, `CODE`, `DICT_KEY`, `DICT_VALUE`, `SORT`, `REMARK`, `IS_SEALED`, `IS_DELETED`, `DICT_TYPE`, `APP_ID`, `APP_CODE`) VALUES (1658763247160922116, 1658763247160922111, 'HZ3000_ALARM', '14', '数据异常', 0, '', 0, 0, 1, -1, 'HZIMS-ALARM'); | ||||||
|  | |||||||
| @ -0,0 +1,68 @@ | |||||||
|  | package com.hnac.hzims.middle.processflow.strategy.serviceimpl; | ||||||
|  | 
 | ||||||
|  | import com.hnac.hzims.alarm.config.feign.IAlarmHandleClient; | ||||||
|  | import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; | ||||||
|  | import com.hnac.hzims.middle.processflow.service.ProcessDictService; | ||||||
|  | import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService; | ||||||
|  | import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue; | ||||||
|  | import lombok.RequiredArgsConstructor; | ||||||
|  | import lombok.extern.slf4j.Slf4j; | ||||||
|  | import org.springblade.core.log.exception.ServiceException; | ||||||
|  | import org.springblade.core.tool.api.R; | ||||||
|  | import org.springframework.stereotype.Service; | ||||||
|  | 
 | ||||||
|  | import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.DEAL_ALARM; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 交接班v4 | ||||||
|  |  * | ||||||
|  |  * @Author WL | ||||||
|  |  * @Version v1.0 | ||||||
|  |  * @Serial 1.0 | ||||||
|  |  * @Date 2023/7/26 9:04 | ||||||
|  |  */ | ||||||
|  | @Slf4j | ||||||
|  | @Service | ||||||
|  | @RequiredArgsConstructor | ||||||
|  | public class AlarmDealFlowServiceImpl extends ProcessAbstractService { | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     private final ProcessDictService processDictService; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     private final IAlarmHandleClient alarmHandleClient; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 设置执行那种实现类 | ||||||
|  |      * | ||||||
|  |      * @param flowQueue | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public Boolean isWorkflowProcess(WorkflowQueue flowQueue) { | ||||||
|  |         String dictValue = processDictService.selectDictValueByKey(DEAL_ALARM); | ||||||
|  |         if (dictValue.equals(flowQueue.getProcessDefinitionKey())) { | ||||||
|  |             log.info("已执行告警处理流程程环节操作~~~~"); | ||||||
|  |             return true; | ||||||
|  |         } | ||||||
|  |         log.error("未执行告警处理流程环节操作,请联系管理员~~~~"); | ||||||
|  |         return false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 交接班v4业务方法 | ||||||
|  |      * | ||||||
|  |      * @param response | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public void calculate(ProcessWorkFlowResponse response) { | ||||||
|  |         log.info("告警处理流程执行中,param"+response); | ||||||
|  |         R r = alarmHandleClient.listenAndUpdateAlarm(response); | ||||||
|  |         if (!r.isSuccess()){ | ||||||
|  |             log.error("消费告警处理失败"+response); | ||||||
|  |             throw  new ServiceException("告警处理流程消费失败"); | ||||||
|  |         } | ||||||
|  |         log.info("告警处理流程结束,param"+response); | ||||||
|  |     } | ||||||
|  | } | ||||||
					Loading…
					
					
				
		Reference in new issue