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 List<MesWcCheckRecord> people;
    @ApiParam("人 列")
    private Map<String, String> peopleColumn;

    @ApiParam("机")
    private List<MesWcCheckRecord> equipments;
    @ApiParam("机 列")
    private Map<String, String> equipmentsColumn;

    @ApiParam("物料")
    private List<MesWcCheckRecord> materials;
    @ApiParam("物料 列")
    private Map<String, String> materialsColumn;

    @ApiParam("法")
    private List<MesWcCheckRecord> routes;
    @ApiParam("法 列")
    private Map<String, String> routesColumn;

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

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

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

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

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

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

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

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


    public WcCheckModel initialWcCheckModel() {
        WcCheckModel wcCheckModel = new WcCheckModel();
        wcCheckModel.setPeople(new ArrayList<>());
        wcCheckModel.setEquipments(new ArrayList<>());
        wcCheckModel.setMaterials(new ArrayList<>());
        wcCheckModel.setRoutes(new ArrayList<>());
        wcCheckModel.setPeopleColumn(new HashMap<>());
        wcCheckModel.setEquipmentsColumn(new HashMap<>());
        wcCheckModel.setMaterialsColumn(new HashMap<>());
        wcCheckModel.setRoutesColumn(new HashMap<>());
        wcCheckModel.setOnlineSignal(MesPcnEnumUtil.ONLINE_SIGNAL.NON_CHECK.getValue());
        wcCheckModel.setIsPass(MesPcnEnumUtil.IS_WCCHECK_PASS.NON_PASS.getValue());
        onlineSignalEqu = new MesWcCheckRecord();
        wcCheckModel.setNeed2ShowMap(new HashMap<>());

        Map<String, String> dataColumnRelationMap = new HashMap<>();
        dataColumnRelationMap.put("people", "peopleColumn");
        dataColumnRelationMap.put("equipments", "equipmentsColumn");
        dataColumnRelationMap.put("materials", "materialsColumn");
        dataColumnRelationMap.put("routes", "routesColumn");
        wcCheckModel.setDataColumnRelation(dataColumnRelationMap);
        return wcCheckModel;
    }

}
