LotQueryParameterDto.java

// Created on Feb 1, 2015
// $Id$

package com.mycim.valueobject.wip.dto;

import com.mycim.framework.utils.lang.StringUtils;

import java.io.Serializable;
import java.util.List;


public class LotQueryParameterDto implements Serializable {

    private static final long serialVersionUID = 1L;

    private static final String MY_SPECIAL_LOT_Y = "Y";

    private static final String MY_SPECIAL_LOT_N = "N";

    private String startRow;

    private String pageSize = "50";

    private String lotId;

    private String[] lotType;

    private String[] lotStatus;

    private String[] lotCategory;

    private String productId;

    private long productRrn;

    private String productType;

    private String processId;

    private long processRrn;

    private String routeId;

    private String carrierId;

    private long carrierRrn;

    private String stationId;

    private String eqpGroupId;

    private String mfgEqptGroupId;

    private String stageId;

    private String customId;

    private String priority;

    private String workArea;

    private String plocation;

    private String materialLotId;//对应unit表unit_alias_2

    private String referenceNamedSpace;

    private long facilityRrn;

    private String processLocation;

    private String mySpecialLot;

    private String workOrderId;

    private long userRrn;

    private String project;

    private OperatorPanelParam operatorPanelParam;

    public OperatorPanelParam getOperatorPanelParam() {
        return operatorPanelParam;
    }

    public void setOperatorPanelParam(OperatorPanelParam operatorPanelParam) {
        this.operatorPanelParam = operatorPanelParam;
    }

    public String getProject() {
        return project;
    }

    public void setProject(String project) {
        this.project = project;
    }

    public String getProcessLocation() {
        return processLocation;
    }

    public void setProcessLocation(String processLocation) {
        this.processLocation = processLocation;
    }

    public String getLotId() {
        return lotId;
    }

    public void setLotId(String lotId) {
        this.lotId = StringUtils.replace(lotId, "*", "%").toString().trim().toUpperCase();
    }

    public String getWorkOrderId() {
        return workOrderId;
    }

    public void setWorkOrderId(String workOrderId) {
        this.workOrderId = StringUtils.replace(workOrderId, "*", "%").trim().toUpperCase();
    }

    public String[] getLotStatus() {
        return lotStatus;
    }

    public void setLotStatus(String[] lotStatus) {
        if (lotStatus != null && lotStatus.length == 1) {
            if (StringUtils.isNotBlank(lotStatus[0])) {
                this.lotStatus = lotStatus;
            }
        } else {
            this.lotStatus = lotStatus;
        }
    }

    public String getMaterialLotId() {
        return materialLotId;
    }

    public void setMaterialLotId(String materialLotId) {
        this.materialLotId = StringUtils.replace(materialLotId, "*", "%").toString().trim().toUpperCase();
    }

    public String[] getLotCategory() {
        return lotCategory;
    }

    public void setLotCategory(String[] lotCategory) {
        if (lotCategory != null && lotCategory.length == 1) {
            if (StringUtils.isNotBlank(lotCategory[0])) {
                this.lotCategory = lotCategory;
            }
        } else {
            this.lotCategory = lotCategory;
        }
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = StringUtils.replace(productId, "*", "%").toString().trim().toUpperCase();
    }

    public String getProcessId() {
        return processId;
    }

    public void setProcessId(String processId) {
        this.processId = StringUtils.replace(processId, "*", "%").toString().trim().toUpperCase();
    }

    public String getRouteId() {
        return routeId;
    }

    public void setRouteId(String routeId) {
        this.routeId = StringUtils.replace(routeId, "*", "%").toString().trim().toUpperCase();
    }

    public String getCarrierId() {
        return carrierId;
    }

    public void setCarrierId(String carrierId) {
        this.carrierId = StringUtils.replace(carrierId, "*", "%").toString().trim().toUpperCase();
    }

    public String getStationId() {
        return stationId;
    }

    public void setStationId(String stationId) {
        this.stationId = StringUtils.replace(stationId, "*", "%").toString().trim();
    }

    public String getEqpGroupId() {
        return eqpGroupId;
    }

    public void setEqpGroupId(String eqpGroupId) {
        this.eqpGroupId = StringUtils.replace(eqpGroupId, "*", "%").toString().trim().toUpperCase();
    }

    public String getStageId() {
        return stageId;
    }

    public void setStageId(String stageId) {
        this.stageId = StringUtils.replace(stageId, "*", "%").toString().trim().toUpperCase();
    }

    public String getCustomId() {
        return customId;
    }

    public void setCustomId(String customId) {
        this.customId = StringUtils.replace(customId, "*", "%").toString().trim();
    }

    public String getReferenceNamedSpace() {
        return referenceNamedSpace;
    }

    public void setReferenceNamedSpace(String referenceNamedSpace) {
        this.referenceNamedSpace = referenceNamedSpace;
    }

    public String getPlocation() {
        return plocation;
    }

    public void setPlocation(String plocation) {
        this.plocation = StringUtils.replace(plocation, "*", "%").toString().trim().toUpperCase();
    }

    public long getFacilityRrn() {
        return facilityRrn;
    }

    public void setFacilityRrn(long facilityRrn) {
        this.facilityRrn = facilityRrn;
    }

    public String[] getLotType() {
        return lotType;
    }

    public void setLotType(String[] lotType) {
        if (lotType != null && lotType.length == 1) {
            if (StringUtils.isNotBlank(lotType[0])) {
                this.lotType = lotType;
            }
        } else {
            this.lotType = lotType;
        }
    }

    public String getPriority() {
        return priority;
    }

    public void setPriority(String priority) {
        this.priority = StringUtils.replace(priority, "*", "%").toString().trim().toUpperCase();
    }

    public String getProductType() {
        return productType;
    }

    public void setProductType(String productType) {
        this.productType = productType;
    }

    public Long getProcessRrn() {
        if (StringUtils.isBlank(getProcessId())) {
            return null;
        }
        return this.processRrn;
    }

    public void setProcessRrn(Long processRrn) {
        this.processRrn = processRrn;
    }

    public Long getCarrierRrn() {
        if (StringUtils.isBlank(getCarrierId())) {
            return null;
        }
        return this.carrierRrn;
    }

    public void setCarrierRrn(long carrierRrn) {
        this.carrierRrn = carrierRrn;
    }

    public String getMfgEqptGroupId() {
        return mfgEqptGroupId;
    }

    public void setMfgEqptGroupId(String mfgEqptGroupId) {
        this.mfgEqptGroupId = mfgEqptGroupId;
    }

    public String getEndPage() {
        return StringUtils.toString(Integer.valueOf(pageSize) + Integer.valueOf(startRow));
    }

    public String getPageSize() {
        return pageSize;
    }

    public void setPageSize(String pageSize) {
        this.pageSize = pageSize;
    }

    public String getStartRow() {
        return StringUtils.toString(Integer.valueOf(startRow));
    }

    public void setStartRow(String startRow) {
        this.startRow = startRow;
    }

    public String getWorkArea() {
        return workArea;
    }

    public void setWorkArea(String workArea) {
        this.workArea = workArea;
    }

    public String getMySpecialLot() {
        return mySpecialLot;
    }

    public void setMySpecialLot(String mySpecialLot) {
        switch (mySpecialLot) {
            case MY_SPECIAL_LOT_Y:
                this.mySpecialLot = mySpecialLot;
                break;
            case MY_SPECIAL_LOT_N:
                this.mySpecialLot = "";
                break;
        }
    }

    public long getUserRrn() {
        return userRrn;
    }

    public void setUserRrn(long userRrn) {
        this.userRrn = userRrn;
    }


    /**
     * operator panel 优化需要和lot query 查询结果和内容保证统一
     * 差异:
     *     1.operator panel 目前只需要 normal runcard 的lot
     *       而lot query 经过业务需求变更 已经可以查出所有类型lot
     *       这里进行参数过滤
     *     2.operator panel 中的左下角
     *       running的lot 需要根据设备rrn 进行查询
     *     3.若需求发生变更则需要和 operator panel 联测
     *     4.通用参数则已经通过action层的转换函数处理,set至
     *       LotQueryParameterDto 中
     */
    public class OperatorPanelParam {
        private Long eqptRrn; //是否需要经过设备过滤

        private List<Long> eqptGroupRrns; //一个设备在多个组下会使用 放弃LotQueryParameterDto中的eqptGroup单个属性

        public List<Long> getEqptGroupRrns() {
            return eqptGroupRrns;
        }

        public void setEqptGroupRrns(List<Long> eqptGroupRrns) {
            this.eqptGroupRrns = eqptGroupRrns;
        }

        public Long getEqptRrn() {
            return eqptRrn;
        }

        public void setEqptRrn(Long eqptRrn) {
            this.eqptRrn = eqptRrn;
        }

    }

}