修改时间格式化
This commit is contained in:
@@ -20,6 +20,7 @@ import org.springframework.kafka.annotation.KafkaListener;
|
|||||||
import org.springframework.kafka.listener.ConsumerSeekAware;
|
import org.springframework.kafka.listener.ConsumerSeekAware;
|
||||||
import org.springframework.messaging.support.MessageBuilder;
|
import org.springframework.messaging.support.MessageBuilder;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -57,6 +58,7 @@ public class CorpusProcessKafkaProducer implements ConsumerSeekAware {
|
|||||||
@Resource
|
@Resource
|
||||||
private RocketMQTemplate rocketMqTemplate;
|
private RocketMQTemplate rocketMqTemplate;
|
||||||
|
|
||||||
|
@PostMapping("corpusProcessKafkaProducer")
|
||||||
@KafkaListener(topics = "${spring.kafka.topic}", groupId = "${spring.kafka.group}")
|
@KafkaListener(topics = "${spring.kafka.topic}", groupId = "${spring.kafka.group}")
|
||||||
public void listen(List<String> recordMessages) {
|
public void listen(List<String> recordMessages) {
|
||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
@@ -76,8 +78,9 @@ public class CorpusProcessKafkaProducer implements ConsumerSeekAware {
|
|||||||
|
|
||||||
String transcribeTimeStr = aicorpusTelephone.getTranscribeTime();
|
String transcribeTimeStr = aicorpusTelephone.getTranscribeTime();
|
||||||
if (transcribeTimeStr != null) {
|
if (transcribeTimeStr != null) {
|
||||||
LocalDateTime transcribeTime = LocalDateTime.parse(transcribeTimeStr, DateTimeFormatter.ISO_LOCAL_DATE_TIME);
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
LocalDateTime kafkaStartTime = LocalDateTime.parse(kafkaTimeLimit, DateTimeFormatter.ISO_LOCAL_DATE_TIME);
|
LocalDateTime transcribeTime = LocalDateTime.parse(transcribeTimeStr, formatter);
|
||||||
|
LocalDateTime kafkaStartTime = LocalDateTime.parse(kafkaTimeLimit, formatter);
|
||||||
if (transcribeTime.isBefore(kafkaStartTime)) {
|
if (transcribeTime.isBefore(kafkaStartTime)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -129,6 +132,5 @@ public class CorpusProcessKafkaProducer implements ConsumerSeekAware {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user