package com.ssj.service.task;

import org.apache.commons.lang3.StringUtils;

import com.ssj.bean.sys.fx.domain.Device;
import com.ssj.framework.core.rabbitmq.TopicRabbitConfig;
import com.ssj.framework.core.rabbitmq.producer.BaseRabbitSend;
import com.ssj.taskthread.Task;

public class SyncPushFxDeviceToFX  extends Task {
	
	private Device device;

	public SyncPushFxDeviceToFX(Device device) {
	        super();
	        this.device=device;
	} 
	
	@Override
	public void run() {
		try {
			if(device!=null && StringUtils.isNotEmpty(device.getPosCode())){
				if((device.getPosCode().equals("ssj001") && device.getStatus()==2)//下行分配,下行已确认收货,回推数据
						||(device.getPosCode().equals("aijia001") && device.getStatus()==3)//上行分配，上行待确认收货,回推数据
						)
				BaseRabbitSend.convertAndTopicSend(
						TopicRabbitConfig.exchange_sys,
						TopicRabbitConfig.topic_fx_aijia, 
						device);
			}
		} catch (Exception e) {
			logger.error("推送信息队列异常...");
		}
	}
	

}
