package org.nl.acs.opc;

import com.baomidou.mybatisplus.annotation.TableField;
import eu.bitwalker.useragentutils.DeviceType;
import lombok.Data;

import java.util.*;

/**
 * @author 20220102CG\noblelift
 */
@Data
public class DeviceManageDto {
    private static final long serialVersionUID = 1L;
    private String device_id;

    @TableField(exist = false)
    private Boolean is_require_task;

    @TableField(exist = false)
    private String location;

    @TableField(exist = false)
    private Integer has_goods = 0;

    private String material_type;
    private String quantity;
    private String material;
    private String remark;
    private String islock;
    private String batch;
    private String region;
    private String address;
    private Integer laneway;
    private Integer x;
    private Integer y;
    private Integer z;
    private UUID image_id;
    private String image_name;
    private String device_code;
    private String device_name;
    private String description;
    private String device_type;
    private DeviceType type;
    private String manufacturer;
    private String manufacturer_phone;
    private String data_access_code;
    private String driver_code;
    private Boolean is_route;
    private String route_loc;
    private Boolean is_opc;
    private String opc_server_id;
    private String opc_server_code;
    private String opc_plc_id;
    private String opc_plc_code;
    private Boolean is_configed;
    private Boolean is_exist;
    private Boolean is_entrance;
    /**
     * 粉桶号
     */
    private String barrels_code;

    /**
     * 配合批号
     */
    private String cooperate_code;

    /**
     * 粉种名称
     */
    private String powder_name;

    /**
     * 粉桶状态
     */
    private String barrels_status;

    private List<DeviceExtraManageDto> extra = new LinkedList();
    private String perfix;
    private Map<String, Object> extra_map = new LinkedHashMap();

    public Map<String, Object> getExtraValue() {
        if (this.extra_map.size() > 0) {
            return this.extra_map;
        } else {
            Map<String, Object> result = new LinkedHashMap();
            Iterator var2 = this.extra.iterator();

            while (var2.hasNext()) {
                DeviceExtraManageDto dto = (DeviceExtraManageDto) var2.next();
                result.put(dto.getExtra_code(), dto.parseName());
            }

            this.extra_map = result;
            return result;
        }
    }

    @Override
    public String toString() {
        return "";
    }

}
