|
@ -2,6 +2,7 @@ package com.epmet.mq; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.epmet.commons.rocketmq.constants.MQUserPropertys; |
|
|
import com.epmet.commons.rocketmq.constants.MQUserPropertys; |
|
|
|
|
|
import com.epmet.commons.rocketmq.messages.DisputeProcessMQMsg; |
|
|
import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg; |
|
|
import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg; |
|
|
import com.epmet.commons.tools.distributedlock.DistributedLock; |
|
|
import com.epmet.commons.tools.distributedlock.DistributedLock; |
|
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
|
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
|
@ -9,9 +10,11 @@ import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.redis.RedisKeys; |
|
|
import com.epmet.commons.tools.redis.RedisKeys; |
|
|
import com.epmet.commons.tools.redis.RedisUtils; |
|
|
import com.epmet.commons.tools.redis.RedisUtils; |
|
|
import com.epmet.commons.tools.utils.SpringContextUtils; |
|
|
import com.epmet.commons.tools.utils.SpringContextUtils; |
|
|
|
|
|
import com.epmet.constant.SystemMessageType; |
|
|
import com.epmet.dto.extract.form.ExtractOriginFormDTO; |
|
|
import com.epmet.dto.extract.form.ExtractOriginFormDTO; |
|
|
import com.epmet.service.evaluationindex.extract.todata.FactOriginExtractService; |
|
|
import com.epmet.service.evaluationindex.extract.todata.FactOriginExtractService; |
|
|
import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService; |
|
|
import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService; |
|
|
|
|
|
import com.epmet.service.evaluationindex.screen.ScreenProjectDataService; |
|
|
import com.epmet.util.DimIdGenerator; |
|
|
import com.epmet.util.DimIdGenerator; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
@ -29,7 +32,6 @@ import java.util.List; |
|
|
import java.util.concurrent.ExecutionException; |
|
|
import java.util.concurrent.ExecutionException; |
|
|
import java.util.concurrent.Future; |
|
|
import java.util.concurrent.Future; |
|
|
import java.util.concurrent.TimeUnit; |
|
|
import java.util.concurrent.TimeUnit; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description 项目变动-监听器 |
|
|
* @Description 项目变动-监听器 |
|
@ -45,6 +47,7 @@ public class ProjectChangedCustomListener implements MessageListenerConcurrently |
|
|
|
|
|
|
|
|
private RedisUtils redisUtils; |
|
|
private RedisUtils redisUtils; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs, ConsumeConcurrentlyContext context) { |
|
|
public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs, ConsumeConcurrentlyContext context) { |
|
|
|
|
|
|
|
@ -149,6 +152,16 @@ public class ProjectChangedCustomListener implements MessageListenerConcurrently |
|
|
SpringContextUtils.getBean(ScreenExtractService.class).extractPartData(customerId,dateId); |
|
|
SpringContextUtils.getBean(ScreenExtractService.class).extractPartData(customerId,dateId); |
|
|
} |
|
|
} |
|
|
logger.info("consumer projectChanged msg success,{}",aBoolean); |
|
|
logger.info("consumer projectChanged msg success,{}",aBoolean); |
|
|
|
|
|
|
|
|
|
|
|
//发送项目数据上报的mq消息
|
|
|
|
|
|
String type; |
|
|
|
|
|
if ("issue_shift_project".equals(msgObj.getOperation()) || "created".equals(msgObj.getOperation())) { |
|
|
|
|
|
type = SystemMessageType.PROJECT_ADD; |
|
|
|
|
|
} else { |
|
|
|
|
|
type = SystemMessageType.PROJECT_EDIT; |
|
|
|
|
|
} |
|
|
|
|
|
DisputeProcessMQMsg msg = new DisputeProcessMQMsg(customerId, msgObj.getProjectId(), type); |
|
|
|
|
|
SpringContextUtils.getBean(ScreenProjectDataService.class).sendProjectChangeMq(msg); |
|
|
} catch (RenException e) { |
|
|
} catch (RenException e) { |
|
|
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
|
|
|
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
|
|
|
logger.error("【RocketMQ】消费项目变动消息失败:",e); |
|
|
logger.error("【RocketMQ】消费项目变动消息失败:",e); |
|
|