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


import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
import cn.estsh.i3plus.pojo.mes.pcn.bean.MesWcCheckRecord;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.*;

/**
 * @Author: Wynne.Lu
 * @CreateDate: 2019/9/23 8:06 PM
 * @Description:
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Api("开线管控model")
public class WcCheckModel {

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

    @ApiParam("工单")
    private String workOrder;

    @ApiParam("产品号")
    private String partNo;

    @ApiParam("是否通过")
    private Integer isPass;

    @ApiParam("开线信号")
    private Integer onlineSignal;

    @ApiParam("开线对象")
    MesWcCheckRecord onlineSignalEqu;

    @ApiParam("需要展示的数据")
    private Map<String, String> titleMap;

    @ApiParam("对象list和列关系")
    private Map<String, Map<String, String>> dataColumnRelation;

    @ApiParam("重构map")
    private Map<String, List<MesWcCheckRecord>> dataMap;

    public WcCheckModel initialWcCheckModel() {
        WcCheckModel wcCheckModel = new WcCheckModel();
        wcCheckModel.setOnlineSignal(MesPcnEnumUtil.ONLINE_SIGNAL.NON_CHECK.getValue());
        wcCheckModel.setIsPass(MesPcnEnumUtil.IS_WCCHECK_PASS.NON_PASS.getValue());
        onlineSignalEqu = new MesWcCheckRecord();
        wcCheckModel.setTitleMap(new LinkedHashMap<>());
        wcCheckModel.setDataMap(new LinkedHashMap<>());
        wcCheckModel.setDataColumnRelation(new LinkedHashMap<>());
        return wcCheckModel;
    }

}
