修改故障类

server_five_liuyunhu
dongxiaodong 2024-04-06 09:06:07 +08:00
parent 9a78e4a2e2
commit 1b88d35574
10 changed files with 68 additions and 53 deletions

View File

@ -46,30 +46,11 @@ public class CoupletTroubleCode {
@Excel(name = "vin")
private String troubleVin;
/**
*
*/
@Excel(name = "故障位")
private String troublePosition;
/**
*
*/
@Excel(name = "故障值")
private String troubleValue;
/**
*
*/
@Excel(name = "故障标签")
private String troubleTag;
/**
* Id
*/
@Excel(name = "故障类型Id")
@NotEmpty(message = "故障类型Id不能为空")
private String troubleType;
private Integer troubleTag;
/**
*

View File

@ -19,34 +19,34 @@ import java.util.Date;
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CoupletTroubleLog {
public class CoupletTroubleFault {
/**
* Id
*/
private Integer troubleLogId;
private Integer troubleFaultId;
/**
*
*/
private String troubleLogCode;
private String troubleFaultCode;
/**
* VIN
*
*/
private String troubleLogVin;
private String troubleFaultType;
/**
*
*
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date troubleLogStart;
private String troubleFaultTag;
/**
*
*
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date troubleLogEnd;
private String troubleFaultPosition;
/**
*
*/
private String troubleFaultValue;
}

View File

@ -3,7 +3,6 @@ package com.couplet.common.system.remote;
import com.couplet.common.core.constant.ServiceNameConstants;
import com.couplet.common.core.domain.Result;
import com.couplet.common.domain.CoupletTroubleCode;
import com.couplet.common.domain.CoupletTroubleLog;
import com.couplet.common.system.remote.factory.RemoteCodeFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;

View File

@ -2,11 +2,8 @@ package com.couplet.common.system.remote.factory;
import com.couplet.common.core.domain.Result;
import com.couplet.common.domain.CoupletTroubleCode;
import com.couplet.common.domain.CoupletTroubleLog;
import com.couplet.common.system.remote.RemoteCodeService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

View File

@ -4,15 +4,12 @@ import com.couplet.analyze.msg.domain.CoupletMsgData;
import com.couplet.analyze.msg.service.IncidentService;
import com.couplet.common.core.exception.analyze.AnalyzeException;
import com.couplet.common.core.utils.SpringUtils;
import com.couplet.common.core.utils.uuid.IdUtils;
import com.couplet.common.domain.CoupletTroubleCode;
import com.couplet.common.domain.CoupletTroubleLog;
import com.couplet.common.system.remote.RemoteCodeService;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.*;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@ -20,12 +17,9 @@ import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static com.couplet.analyze.msg.contents.MsgContent.BROKER_URL;
import static com.couplet.analyze.msg.contents.MsgContent.CLIENT_ID;
import static io.lettuce.core.pubsub.PubSubOutput.Type.message;
/**

View File

@ -6,7 +6,6 @@ import com.couplet.common.core.domain.Result;
import com.couplet.common.core.web.controller.BaseController;
import com.couplet.common.domain.CoupletTroubleCode;
import com.couplet.common.domain.CoupletTroubleGrade;
import com.couplet.common.domain.CoupletTroubleLog;
import com.couplet.common.domain.request.TroubleResp;
import com.couplet.common.log.annotation.Log;
import com.couplet.common.log.enums.BusinessType;

View File

@ -1,10 +1,8 @@
package com.couplet.business.server.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.couplet.analyze.msg.domain.CoupletMsgData;
import com.couplet.common.domain.CoupletTroubleCode;
import com.couplet.common.domain.CoupletTroubleGrade;
import com.couplet.common.domain.CoupletTroubleLog;
import com.couplet.common.domain.request.TroubleResp;
import org.apache.ibatis.annotations.Mapper;

View File

@ -1,13 +1,10 @@
package com.couplet.business.server.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.couplet.analyze.msg.domain.CoupletMsgData;
import com.couplet.common.core.domain.PageResult;
import com.couplet.common.domain.CoupletTroubleCode;
import com.couplet.common.domain.CoupletTroubleGrade;
import com.couplet.common.domain.CoupletTroubleLog;
import com.couplet.common.domain.request.TroubleResp;
import io.swagger.models.auth.In;
import java.util.List;

View File

@ -1,22 +1,18 @@
package com.couplet.business.server.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.couplet.analyze.msg.domain.CoupletMsgData;
import com.couplet.business.server.mapper.SysTroubleMapper;
import com.couplet.business.server.service.SysTroubleService;
import com.couplet.common.core.domain.PageResult;
import com.couplet.common.domain.CoupletTroubleCode;
import com.couplet.common.domain.CoupletTroubleGrade;
import com.couplet.common.domain.CoupletTroubleLog;
import com.couplet.common.domain.request.TroubleResp;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Random;
/**
* @author DongXiaoDong

View File

@ -0,0 +1,54 @@
package com.couplet.mq.controller;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import java.time.Duration;
import java.util.Collections;
import java.util.Properties;
/**
* @author DongXiaoDong
* @version 1.0
* @date 2024/4/5 21:38
* @description
*/
public class Aaa {
private static final String TOPIC_NAME = "online";
private static final String BOOTSTRAP_SERVERS = "39.103.133.136:9092";
public static void main(String[] args) {
aaa();
}
private static void aaa() {
Properties props = new Properties();
props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, BOOTSTRAP_SERVERS);
props.put(ConsumerConfig.GROUP_ID_CONFIG, "my-consumer-group");
props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");
props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");
//创建消费者
KafkaConsumer<String, String> consumer = new KafkaConsumer<>(props);
try {
//订阅主题
consumer.subscribe(Collections.singletonList("online"));
//持续消费消息
while (true) {
ConsumerRecords<String, String> records = consumer.poll(Duration.ofMillis(100));
records.forEach(record -> {
System.out.println("消费者接受到的消息值:" + record.value());
});
}
} catch (Exception e) {
e.printStackTrace();
} finally {
consumer.close();
}
}
}