package com.steering.pss.sale.order.craftDesign.server;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

import com.steering.pss.sale.order.craftDesign.dao.DeleteLineDao;
import com.steering.pss.sale.order.craftDesign.model.CraftOrdDesignMscPlGxPrlEntity;

/**
 * 删除产线
 * 
 * @author Administrator
 * 
 */
public class DeleteLine {
	public void deleteLine(Connection con, String ordLnPk, String designKey)
			throws SQLException {
		DeleteLineDao deleteLineDao = new DeleteLineDao();
		List<CraftOrdDesignMscPlGxPrlEntity> lines = deleteLineDao
				.getQualityDesignLine(con, ordLnPk);
		if (lines != null && lines.size() > 0) {
			for (CraftOrdDesignMscPlGxPrlEntity line : lines) {
				// 如果质量设计结果中的产线被删除，同时也把工艺评审的产线删除
				if (line.getValidflag().equals("0")) {
					deleteLineDao.deleteCraftLine(con, designKey,
							line.getMscPline(), line.getProcessCode(),
							line.getPlineCode());
				}
			}
		}
	}
}
