增加判断

This commit is contained in:
zren25
2025-04-03 15:38:44 +08:00
parent 301e261b41
commit 702990f374
2 changed files with 7 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ import com.volvo.ai.analytic.center.dto.req.FourInOneRequestDTO;
import com.volvo.ai.analytic.center.service.AiAnalysisRequestLogsService; import com.volvo.ai.analytic.center.service.AiAnalysisRequestLogsService;
import com.volvo.ai.analytic.center.service.IntelligentCustomerService; import com.volvo.ai.analytic.center.service.IntelligentCustomerService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.rocketmq.common.message.MessageExt; import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener; import org.apache.rocketmq.spring.core.RocketMQListener;
@@ -73,8 +74,10 @@ public class IntelligentCustomerMqConsumer implements RocketMQListener<MessageEx
log.info("intelligentCustomerMqConsumer 当前线程: {}, 线程ID: {}", Thread.currentThread().getName(), Thread.currentThread().getId()); log.info("intelligentCustomerMqConsumer 当前线程: {}, 线程ID: {}", Thread.currentThread().getName(), Thread.currentThread().getId());
log.info("IntelligentCustomerMqConsumer message: " + message); log.info("IntelligentCustomerMqConsumer message: " + message);
FourInOneRequestDTO fourRequestDTO = objectMapper.readValue(message, FourInOneRequestDTO.class); FourInOneRequestDTO fourRequestDTO = objectMapper.readValue(message, FourInOneRequestDTO.class);
if(null != fourRequestDTO && StringUtils.isNotEmpty(fourRequestDTO.getWorkOrderContent()) && StringUtils.isNotEmpty(fourRequestDTO.getWorkOrderSource())){
intelligentCustomerService.fourInOneMqService(fourRequestDTO); intelligentCustomerService.fourInOneMqService(fourRequestDTO);
log.info("FourInOneRequestDTO处理完成耗时{}", System.currentTimeMillis() - startTime); log.info("FourInOneRequestDTO处理完成耗时{}", System.currentTimeMillis() - startTime);
}
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
log.info(" dcc mq 处理失败:{}", e.getMessage()); log.info(" dcc mq 处理失败:{}", e.getMessage());
} }

View File

@@ -89,12 +89,13 @@ public class IntelligentCustomerServiceImpl implements IntelligentCustomerServic
RunMaskingRuleInput runMaskingRuleInput = new RunMaskingRuleInput(); RunMaskingRuleInput runMaskingRuleInput = new RunMaskingRuleInput();
runMaskingRuleInput.setDataMaskingRules(maskingRuleItems); runMaskingRuleInput.setDataMaskingRules(maskingRuleItems);
String yuliao = StringUtils.isNotEmpty(fourInOneRequestDTO.getRelationCorpusContent())?fourInOneRequestDTO.getRelationCorpusContent().concat(" \n ").concat(fourInOneRequestDTO.getWorkOrderContent()):fourInOneRequestDTO.getWorkOrderContent();
Map<String, Object> inputMap = new HashMap(); Map<String, Object> inputMap = new HashMap();
DiFyReq diFyImageReq = new DiFyReq(); DiFyReq diFyImageReq = new DiFyReq();
diFyImageReq.setUser(ConstantStr.INTELLIGENT_CUSTOMER_4IN1); diFyImageReq.setUser(ConstantStr.INTELLIGENT_CUSTOMER_4IN1);
diFyImageReq.setFlowId(fourInOneToken); diFyImageReq.setFlowId(fourInOneToken);
inputMap.put("yuliao", fourInOneRequestDTO.getWorkOrderContent()); inputMap.put("yuliao", yuliao);
inputMap.put("laiyuan",fourInOneRequestDTO.getWorkOrderSource()); inputMap.put("laiyuan",fourInOneRequestDTO.getWorkOrderSource());
diFyImageReq.setInputs(inputMap); diFyImageReq.setInputs(inputMap);