package com.steering.pss.sale.order.qualityDesign.server.iserver;

import com.steering.pss.sale.order.model.DesignMscBiltCPlEntity;
import com.steering.pss.sale.order.model.DesignMscBiltPlEntity;
import com.steering.pss.sale.order.model.DesignMscGzGgPlEntity;
import com.steering.pss.sale.order.model.DesignMscPlGxPrlEntity;
import com.steering.pss.sale.order.qualityDesign.server.imp.CreateSpecLineImp;

/**
 * 生产规格适用产线
 * 
 * @author Administrator
 * 
 */
public class ICreateSpecLine implements CreateSpecLineImp {

	/**
	 * 轧管产线转化为轧管规格-适用产线
	 * 
	 * @param specProLine
	 * @param specCode
	 * @return
	 */
	public DesignMscGzGgPlEntity createSpecLine(DesignMscPlGxPrlEntity line,
			String specCode) {
		if (line == null) {
			return null;
		}
		DesignMscGzGgPlEntity spec = new DesignMscGzGgPlEntity();
		spec.setDesginKey(line.getDesginKey());
		spec.setMscPline(line.getMscPline());
		spec.setPlineCode(line.getPlineCode());
		spec.setPlineName(line.getPlineName());
		spec.setSpecCode(specCode);
		return spec;
	}

	/**
	 * 断面产线
	 * 
	 * @param line
	 * @param specCode
	 * @return
	 */
	public DesignMscBiltPlEntity createBiltLine(DesignMscPlGxPrlEntity line,
			String specCode) {
		if (line == null) {
			return null;
		}
		DesignMscBiltPlEntity spec = new DesignMscBiltPlEntity();
		spec.setDesginKey(line.getDesginKey());
		spec.setBSpecCode(specCode);
		spec.setMscPline(line.getMscPline());
		spec.setPlineCode(line.getPlineCode());
		spec.setPlineName(line.getPlineName());
		return spec;
	}

	/**
	 * 坯料产线
	 * 
	 * @param line
	 * @param specCode
	 * @return
	 */
	public DesignMscBiltCPlEntity createBlank(DesignMscPlGxPrlEntity line,
			String specCode) {
		if (line == null) {
			return null;
		}
		DesignMscBiltCPlEntity spec = new DesignMscBiltCPlEntity();
		spec.setDesginKey(line.getDesginKey());
		spec.setMscPline(line.getMscPline());
		spec.setCSpecCode(specCode);
		spec.setPlineCode(line.getPlineCode());
		spec.setPlineName(line.getPlineName());
		return spec;
	}
}
