package cn.estsh.i3plus.pojo.mes.model;


import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
import cn.estsh.i3plus.pojo.mes.bean.MesStateMachineStatus;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiParam;
import lombok.Data;

import java.io.Serializable;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description : 工位请求bean
 * @Reference :
 * @Author : jack.jia
 * @CreateDate : 2019-04-19
 * @Modify:
 **/
@Data
public class StationRequestBean implements Serializable {

    private static final long serialVersionUID = -8597212451891803174L;

    @ApiParam("扫描信息")
    private String scanInfo;

    @ApiParam("过程条码")
    private String serialNumber;

    @ApiParam("产品条码")
    private String productSn;

    @ApiParam("物料号")
    private String partNo;

    @ApiParam("生产类型")
    private String pptCode;

    @ApiParam("组织代码")
    private String organizeCode;

    @ApiParam("组织名称")
    private String organizeName;

    @ApiParam("工作中心代码")
    private String workCenterCode;

    @ApiParam("工作单元代码")
    private String workCellCode;

    @ApiParam("工作单元名称")
    private String workCellName;

    @ApiParam("流程代码")
    private String routeCode;

    @ApiParam("工序代码")
    private String processCode;

    @ApiParam("客户端信息")
    private String clientInfo;

    @ApiParam("websocket session连接id")
    private String sessionId;

    @ApiParam("用户信息")
    private String userInfo;

    @ApiParam("按钮编号")
    private String buttonCode;

    @ApiParam("状态代码")
    private String statusCode;

    @ApiParam("工步代码")
    private String stepCode;

    @ApiParam("工步序号")
    private Integer stepSeq;

    @ApiParam("强制执行工步代码")
    private String forceSpecStepCode;

    @ApiParam("强制执行状态点代码")
    private String forceSpecStatusCode;
    /**
     * doScan-扫描，doModule-处理组件,initModule-初始化组件
     */
    @ApiParam("业务类型")
    private String busiType;

    @ApiParam("界面类型")
    private String interfaceType;

    @ApiParam("工位监听类型")
    private String monitorType;

    @ApiParam("工位监听组件")
    private String monitorModule;

    @ApiParam("工位监听消息")
    private String monitorMsg;

    @ApiParam("工单号")
    private String workOrderNo;

    @ApiParam("托盘号")
    private String tray;

    @ApiParam("完成数量")
    private Integer finishCount;

    @ApiParam("工步列表")
    private List<StepModel> stepList;

    @ApiParam("工位参数")
    private Map<String, String> wcpcMap;

    @ApiParam("生产主队列编号")
    private String orderNo;

    @ApiParam("分组队列编号")
    private String queueGroupNo;

    @ApiParam("数据map")
    private Map<String, Object> dataMap = new LinkedHashMap<>();

    @ApiParam("流程状态集合")
    private List<MesStateMachineStatus> fsmStates;

    @ApiParam("当前流程状态")
    private MesStateMachineStatus curFsmState;

    @ApiParam("是否重选进入")
    private boolean isReselect;

    @JsonIgnore
    @ApiParam("展示组件")
    private Object moduleService;

    @ApiParam("客户工厂代码")
    private String customerFactoryCode;

    @ApiParam("工步弹框参数")
    private String stepDialogParam;

    @ApiParam("工步弹框状态")
    private Boolean stepDialogStatus = false;

    @ApiParam("是否按时完成")
    private Integer isOnTimeComplete = 1;

    @ApiParam("是否是调度程序调用")
    private boolean isDispatcherInvoke;

    @ApiParam("工位剩余时间")
    private Long remainWorkTime;

    @ApiParam("停机类型")
    private MesPcnEnumUtil.STOP_MACHINE_TYPE stopMachineType;

    @ApiParam("提醒时间点")
    private Integer remindTime;

    @ApiParam("是否操作超时")
    private Integer isTimeOut = 2;

    @ApiParam("特殊展示数据")
    private Map<String, Object> specialDisplayMap = new HashMap<>();

    @ApiParam("物料名称")
    private String partName;

    @ApiParam("状态机代码")
    private String smCode;

    @ApiParam("区域代码")
    private String areaCode;

    @ApiParam("数量")
    private Integer qty;

    @ApiParam("班次名称")
    private String shiftName;

    @ApiParam("创建时间")
    private String createDatetime;

    @ApiParam("创建时间")
    private String packageNo;

    @ApiParam("密码")
    private String password;

    public StationRequestBean() {
    }

    public StationRequestBean(String organizeCode, String workCenterCode, String workCellCode) {
        this.organizeCode = organizeCode;
        this.workCenterCode = workCenterCode;
        this.workCellCode = workCellCode;
    }

    public StationRequestBean(String organizeCode, String workCenterCode, String workCellCode, String userInfo) {
        this.organizeCode = organizeCode;
        this.workCenterCode = workCenterCode;
        this.workCellCode = workCellCode;
        this.userInfo = userInfo;
    }

    @Override
    public String toString() {
        return "StationRequestBean{" +
                "scanInfo='" + scanInfo + '\'' +
                ", serialNumber='" + serialNumber + '\'' +
                ", partNo='" + partNo + '\'' +
                ", organizeCode='" + organizeCode + '\'' +
                ", organizeName='" + organizeName + '\'' +
                ", workCenterCode='" + workCenterCode + '\'' +
                ", workCellCode='" + workCellCode + '\'' +
                ", routeCode='" + routeCode + '\'' +
                ", processCode='" + processCode + '\'' +
                ", clientInfo='" + clientInfo + '\'' +
                ", userInfo='" + userInfo + '\'' +
                ", buttonCode='" + buttonCode + '\'' +
                ", stepCode='" + stepCode + '\'' +
                ", busiType='" + busiType + '\'' +
                ", workOrderNo='" + workOrderNo + '\'' +
                ", tray='" + tray + '\'' +
                ", finishCount=" + finishCount +
                '}';
    }
}
