//package cn.estsh.i3plus.ext.mes.apiservice.mq;
//
//import cn.estsh.i3plus.ext.mes.apiservice.controller.base.EmailPushService;
//import cn.estsh.i3plus.pojo.platform.bean.SysMessage;
//import com.alibaba.fastjson.JSON;
//import com.rabbitmq.client.Channel;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.lang3.exception.ExceptionUtils;
//import org.springframework.amqp.AmqpException;
//import org.springframework.amqp.core.Message;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
//import org.springframework.stereotype.Component;
//import org.springframework.transaction.annotation.Transactional;
//
///**
// * @PROJECT_NAME: i3plus-mes-panasonic-dev
// * @DESCRIPTION:
// * @USER: xinwang.yi
// * @DATE: 2023-07-14 14:03
// */
//@Slf4j
//@Component
//@ConditionalOnExpression("${impp.config.rabbitmq:true}")
//public class SxMesSendEamilQueueRecevier {
//
//    @Autowired
//    private RabbitTemplate rabbitTemplate;
//
//    @Autowired
//    private EmailPushService emailPushService;
//
//    @ApiOperation("邮件发送")
//    @Transactional(readOnly = false)
//    @RabbitListener(queues = "SX_MES_SEND_EMAIL", exclusive = true, concurrency = "1")
//    public void doSendEmail(String data, Channel channel, Message message) {
//        try {
//            SysMessage sysMessage = JSON.parseObject(data, SysMessage.class);
//
//            rabbitTemplate.convertAndSend("QUEUE_IMPP_MESSAGE_MAIL", JSON.toJSONString(sysMessage));
//        } catch (AmqpException e) {
//            log.error("邮件发送 执行异常:{} ", ExceptionUtils.getStackTrace(e));
//        } finally {
//            try {
//                channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
//            } catch (Exception e) {
//                log.error("邮件发送 发送Ack回执异常:{} ", ExceptionUtils.getStackTrace(e));
//            }
//        }
//    }
//}
