| | |
| | | import cn.gistack.nky.service.IAlarmGetService; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springframework.amqp.core.Message; |
| | | import org.springframework.amqp.rabbit.annotation.RabbitListener; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | |
| | | public void processMessage(Message message) { |
| | | System.out.println("收到消息"+new String(message.getBody())); |
| | | AlarmGet alarmGet = JSONObject.parseObject(new String(message.getBody()), AlarmGet.class); |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String format = sdf.format(DateUtil.now()); |
| | | alarmGet.setCreateTime(format); |
| | | alarmGetService.save(alarmGet); |
| | | } |
| | | |