package org.nl.acs.common;

import com.alibaba.fastjson.JSONObject;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
import org.springframework.stereotype.Service;

/**
 * @author geng by
 * 普通站点
 */
@Service("standard_ordinary_site")
public class StandardOrdinarySiteDevice extends AbstractDriverService {

    @Override
    public JSONObject getDeviceInfo(Device device) {
        StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
        JSONObject jo = new JSONObject();
//        jo.put("move", StageActorUtil.getMove(standardOrdinarySiteDeviceDriver.getHasGoods()));
        jo.put("container", standardOrdinarySiteDeviceDriver.getContainer());
        jo.put("hasGoods", standardOrdinarySiteDeviceDriver.getHasGoods());
        jo.put("isOnline", true);
        //点击弹出
        jo.put("is_click", true);
        jo.put("device_type", device.getDevice_type());
        jo.put("error", standardOrdinarySiteDeviceDriver.getError());
        jo.put("isError", standardOrdinarySiteDeviceDriver.getIserror());
        jo.put("container", standardOrdinarySiteDeviceDriver.getContainer());
        jo.put("message", standardOrdinarySiteDeviceDriver.getMessage());
        jo.put("material", standardOrdinarySiteDeviceDriver.getMaterial());
        jo.put("batch", standardOrdinarySiteDeviceDriver.getBatch());
        return jo;
    }
}
