diff --git a/business/src/main/java/com/fizz/business/form/LogDataForm.java b/business/src/main/java/com/fizz/business/form/LogDataForm.java index 4250a7f..6847269 100644 --- a/business/src/main/java/com/fizz/business/form/LogDataForm.java +++ b/business/src/main/java/com/fizz/business/form/LogDataForm.java @@ -1,6 +1,7 @@ package com.fizz.business.form; import cn.hutool.core.date.DatePattern; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -17,11 +18,11 @@ public class LogDataForm implements Serializable { * 开始时间 */ @ApiModelProperty(value = "开始时间") - @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime startTime; @ApiModelProperty(value = "结束时间") - @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime endTime; @ApiModelProperty(value = "报警类型") diff --git a/business/src/main/java/com/fizz/business/mq/RabbitMQ/RabbitQueueListener.java b/business/src/main/java/com/fizz/business/mq/RabbitMQ/RabbitQueueListener.java index 9d02389..9e20272 100644 --- a/business/src/main/java/com/fizz/business/mq/RabbitMQ/RabbitQueueListener.java +++ b/business/src/main/java/com/fizz/business/mq/RabbitMQ/RabbitQueueListener.java @@ -1,6 +1,8 @@ package com.fizz.business.mq.RabbitMQ; import cn.hutool.json.JSONUtil; +import com.fizz.business.constants.enums.WsTypeEnum; +import com.fizz.business.utils.WebSocketUtil; import lombok.extern.log4j.Log4j2; import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.amqp.rabbit.annotation.RabbitListener; @@ -15,5 +17,6 @@ public class RabbitQueueListener { log.info("消费端ProcData: " + message); //socket + WebSocketUtil.sendMessage(WsTypeEnum.track_measure,message); } } \ No newline at end of file diff --git a/business/src/main/java/com/fizz/business/service/impl/LogDataServiceImpl.java b/business/src/main/java/com/fizz/business/service/impl/LogDataServiceImpl.java index fdb6211..946cb9d 100644 --- a/business/src/main/java/com/fizz/business/service/impl/LogDataServiceImpl.java +++ b/business/src/main/java/com/fizz/business/service/impl/LogDataServiceImpl.java @@ -41,8 +41,8 @@ public class LogDataServiceImpl extends ServiceImpl impl lambdaQuery.ge(LogData::getTimestamp, start); } if(ObjectUtil.isNotEmpty(logDataForm.getEndTime())){ - LocalDateTime end = LocalDateTime.of(logDataForm.getStartTime().toLocalDate(), LocalTime.MAX); - lambdaQuery.ge(LogData::getTimestamp, end); + LocalDateTime end = LocalDateTime.of(logDataForm.getEndTime().toLocalDate(), LocalTime.MAX); + lambdaQuery.le(LogData::getTimestamp, end); } if (StringUtils.isNotBlank(logDataForm.getLogtype())) { diff --git a/business/src/main/java/com/fizz/business/service/impl/RollDataServiceImpl.java b/business/src/main/java/com/fizz/business/service/impl/RollDataServiceImpl.java index 5497fd5..5887b64 100644 --- a/business/src/main/java/com/fizz/business/service/impl/RollDataServiceImpl.java +++ b/business/src/main/java/com/fizz/business/service/impl/RollDataServiceImpl.java @@ -1,6 +1,7 @@ package com.fizz.business.service.impl; import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fizz.business.constants.CommonConstants; @@ -266,8 +267,10 @@ public class RollDataServiceImpl extends ServiceImpl i .setContentType(MessageProperties.CONTENT_TYPE_TEXT_PLAIN) .setMessageId("ROLL_CHANGE") .build(); - rabbitTemplate.send(CommonConstants.RabbitMQ.SEND_MODEL,new Message("ROLL_CHANGE".getBytes(StandardCharsets.UTF_8),props)); + JSONObject msg = new JSONObject(); + msg.put("data","ROLL_CHANGE"); + rabbitTemplate.send(CommonConstants.RabbitMQ.SEND_MODEL,new Message(JSONObject.toJSONString(msg).getBytes(StandardCharsets.UTF_8),props)); return getOnlineRollList(); }