package com.steering.pss.ydm.Stuffmanage;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;

import CoreFS.SA06.CoreReturnObject;
import CoreFS.SA08.CoreXmlSqlParsersFactory;
import CoreFS.SC01.CoreConstantData;

import com.ibm.websphere.wim.model.Entity;
import com.steering.comm.db.DBCommon;
import com.steering.comm.tools.EntityTool;
import com.steering.comm.tools.StringTool;
import com.steering.pss.ydm.Stuffmanage.Entity.MatGpMEntity;
import com.steering.pss.ydm.Stuffmanage.Entity.QcmLgProgrrssEntity;
import com.steering.pss.ydm.Stuffmanage.Entity.QcmLgSurfaceCEntity;
import com.steering.pss.ydm.Stuffmanage.Entity.QcmLgSurfaceMEntity;

public class FrmStuffSurfaceInspection extends DBCommon{

	/***
	 * 查询收料主信息
	 * @param parm
	 * @param startTim
	 * @param endTim
	 * @return
	 */
	public CoreReturnObject doQueryMat(ArrayList<String> parm,String startTim,String endTim)
	{
	   String sql = CoreXmlSqlParsersFactory.getSql("FrmStuffSurfaceInspection.doQueryMat");
	   if(!startTim.equals(""))
	   {
		   sql += " AND T.INSTOCK_TIME >= to_date('"+startTim+"','YYYY-MM-DD HH24:MI:SS') AND T.INSTOCK_TIME <= to_date('"+endTim+"','YYYY-MM-DD HH24:MI:SS')";
	   }
	   sql += " GROUP BY T.MEMO,T.PRODUCT_FLAG,T.MAT_STATUS,T.STOVE_NO,T.JUDGE_STOVE_NO,T.BATCH_NO,T.CAST_NO,T.CCMID,T.SAMPLE_FLAG,T.CUTTING_FLAG,T.CUTTING_NUM,T.MATERIAL_NO,";
	   sql += "T.MATERIAL_NAME,T.PRODUCCODE,T.PRODUCNAME,T.JUDGE_GRADECODE,T.JUDGE_GRADENAME,T.JUDGE_STD_CODE,T.JUDGE_STD_NAME,T.PRO_ORDER_NO,T.PRO_ORDER_ID,T.PLINE_CODE,T.GROUD_NO,";
	   sql += "T.PLINE_NAME,T.ACT_DIMATER,T.ACT_LEN_MIN,T.ACT_LEN_MAX,T.ACT_FIX_NUM,T.ACT_FIX_LEN,T.BELONG_CODE,T.BELONG_NAME,T.BUG_NO,T.FACE_RESULT_CODE";
	   return this.getData(sql, parm.toArray());
	}
	/***
	 * 查询表检信息
	 * @param parm
	 * @param startTim
	 * @param endTim
	 * @return
	 */
	public CoreReturnObject doQuerySurFace(ArrayList<String> parm,String startTim,String endTim)
	{
		   String sql = CoreXmlSqlParsersFactory.getSql("FrmStuffSurfaceInspection.doQuerySurFace");
		   if(!startTim.equals(""))
		   {
			   sql += " AND CREATE_TIME >= to_date('"+startTim+"','YYYY-MM-DD HH24:MI:SS') AND CREATE_TIME <= to_date('"+endTim+"','YYYY-MM-DD HH24:MI:SS')";
		   }
		   return this.getData(sql, parm.toArray());
	}
	
	/***
	 * 查询从表信息
	 * @param parm
	 * @param startTim
	 * @param endTim
	 * @return
	 */
	public CoreReturnObject doQueryMatC(ArrayList<String> parm,String startTim,String endTim)
	{
		   String sql = CoreXmlSqlParsersFactory.getSql("FrmStuffSurfaceInspection.doQueryMatC");
		   if(!startTim.equals(""))
		   {
			   sql += " AND T.INSTOCK_TIME >= to_date('"+startTim+"','YYYY-MM-DD HH24:MI:SS') AND T.INSTOCK_TIME <= to_date('"+endTim+"','YYYY-MM-DD HH24:MI:SS')";
		   }
		   return this.getData(sql, parm.toArray());
	}
	
	/***
	 * 查询缺陷信息
	 * @param startTim
	 * @param endTim
	 * @return
	 */
	public CoreReturnObject doQuerySufaceC(String startTim,String endTim)
	{
		  String sql = CoreXmlSqlParsersFactory.getSql("FrmStuffSurfaceInspection.doQuerySufaceC");
		   if(!startTim.equals(""))
		   {
			   sql += " AND CREATE_TIME >= to_date('"+startTim+"','YYYY-MM-DD HH24:MI:SS') AND CREATE_TIME <= to_date('"+endTim+"','YYYY-MM-DD HH24:MI:SS')";
		   }
		   return this.getData(sql);
	}
	/***
	 * 获取缺陷位置
	 * @return
	 */
	public CoreReturnObject getBugLocation()
	{
		return this.getDataBySqlID("FrmStuffSurfaceInspection.getBugLocation");
	}
	/***
	 * 获取所有缺陷
	 * @return
	 */
	public CoreReturnObject getBugName()
	{
		return this.getDataBySqlID("FrmStuffSurfaceInspection.getBugName");
	}
	
	/***
	 * 确认缺陷
	 * @param parm
	 * @param list
	 * @return
	 */
	public CoreReturnObject ensureBug(ArrayList<String> parm,ArrayList<String> list,ArrayList<String> list1,String userName,String plineCode)
	{
		CoreReturnObject cro = new CoreReturnObject();
        Connection connection = this.getDao(CoreConstantData.sysbeanstr)
                .getConnection();
        PreparedStatement psta = null;
        String sql = "";
        ResultSet rs = null;
        String matNo = "";
        Date now = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat(
        "yyyy-MM-dd HH:mm:ss");
        String systime = dateFormat.format(now);
        String[] arr= null;
        String checkNo = "";
        String bugNo = "";
        int m = 0;
        int acount = 0;
        try {
			connection.setAutoCommit(false); // 取消自动提交事务
			String deleteSurFaceSql = CoreXmlSqlParsersFactory.getSql("ensureBug.deleteSurFace");
			PreparedStatement deleteSurFacePsta = connection.prepareStatement(deleteSurFaceSql);
			String insertBugMSql = CoreXmlSqlParsersFactory.getSql("ensureBug.CheckNo");
			PreparedStatement insertBugMPsta = connection.prepareStatement(insertBugMSql);
			String insertBugCSql = CoreXmlSqlParsersFactory.getSql("ensureBug.BugNo");
			PreparedStatement insertBugCPsta = connection.prepareStatement(insertBugCSql);
			String updateMatSql = CoreXmlSqlParsersFactory.getSql("ensureBug.updateMat");
			PreparedStatement updateMatPsta = connection.prepareStatement(updateMatSql);
			String updateMatAllSql = CoreXmlSqlParsersFactory.getSql("ensureBug.updateMatAll");
			PreparedStatement updateMatAllPsta = connection.prepareStatement(updateMatAllSql);
			arr = getCheckNo(connection, plineCode);
			for(String strM:parm)
			{
				ArrayList<String> matNoList = new ArrayList<String>();
				MatGpMEntity matTity = EntityTool.getEntityByJSONStr(strM, MatGpMEntity.class);
				//arr = getCheckNo(connection, matTity.getPlineCode());
				if(list !=null)
				{
					for (String strC : list) {
						QcmLgSurfaceCEntity qcmLgSurfaceTity = EntityTool
								.getEntityByJSONStr(strC,
										QcmLgSurfaceCEntity.class);
						sql = CoreXmlSqlParsersFactory.getSql("ensureBug.SelectSurFace");
						psta = connection.prepareStatement(sql);
						psta.setString(1, qcmLgSurfaceTity.getMatNo());
						rs = psta.executeQuery();
						if(rs.next())
						{
							acount = Integer.parseInt(rs.getString("ACOUNT"));
						}
						rs.close();
						psta.close();
						if(acount>0)
						{
							deleteSurFacePsta.setString(1, qcmLgSurfaceTity.getMatNo());
							deleteSurFacePsta.addBatch();
						}
						insertBugCPsta.setString(1, arr[1].toString().substring(0,arr[1].length()-3)+StringTool.formatDecimal(m, "000"));
						insertBugCPsta.setString(2, qcmLgSurfaceTity.getMatNo());
						insertBugCPsta.setString(3, qcmLgSurfaceTity.getBugCode1());
						insertBugCPsta.setString(4, qcmLgSurfaceTity.getBugName1());
						insertBugCPsta.setString(5, qcmLgSurfaceTity.getBugCode2());
						insertBugCPsta.setString(6, qcmLgSurfaceTity.getBugName2());
						insertBugCPsta.setString(7, qcmLgSurfaceTity.getBugCode3());
						insertBugCPsta.setString(8, qcmLgSurfaceTity.getBugName3());
						insertBugCPsta.setString(9, qcmLgSurfaceTity.getBugCode4());
						insertBugCPsta.setString(10, qcmLgSurfaceTity.getBugName4());
						insertBugCPsta.setString(11, qcmLgSurfaceTity.getBugCode5());
						insertBugCPsta.setString(12, qcmLgSurfaceTity.getBugName5());
						insertBugCPsta.setString(13, qcmLgSurfaceTity.getActCount());
						insertBugCPsta.setString(14, qcmLgSurfaceTity.getActWeight());
						insertBugCPsta.setString(15, userName);
						insertBugCPsta.setString(16, systime);
						insertBugCPsta.setString(17, qcmLgSurfaceTity.getBugPosCode());
						insertBugCPsta.setString(18, qcmLgSurfaceTity.getBugPosName());
						insertBugCPsta.setString(19, qcmLgSurfaceTity.getActDimater());
						insertBugCPsta.setString(20, qcmLgSurfaceTity.getActLen());
						if(qcmLgSurfaceTity.getCheckDimater().equals(""))
						{
							insertBugCPsta.setString(21, qcmLgSurfaceTity.getActDimater());
						}else
						{
							insertBugCPsta.setString(21, qcmLgSurfaceTity.getCheckDimater());
						}
						if(qcmLgSurfaceTity.getCheckLen().equals(""))
						{
							insertBugCPsta.setString(22, qcmLgSurfaceTity.getActLen());
						}else
						{
							insertBugCPsta.setString(22, qcmLgSurfaceTity.getCheckLen());
						}
						insertBugCPsta.addBatch();
						
						updateMatPsta.setString(1, arr[0].toString().substring(0, arr[0].length()-4)+StringTool.formatDecimal(m, "0000"));
						updateMatPsta.setString(2, arr[1].toString().substring(0,arr[1].length()-3)+StringTool.formatDecimal(m, "000"));
						updateMatPsta.setString(3, qcmLgSurfaceTity.getActWeight());
						if(qcmLgSurfaceTity.getCheckDimater().equals(""))
						{
						    updateMatPsta.setString(4, qcmLgSurfaceTity.getActDimater());
						}else
						{
							updateMatPsta.setString(4, qcmLgSurfaceTity.getCheckDimater());
						}
						if(qcmLgSurfaceTity.getCheckLen().equals(""))
						{
							updateMatPsta.setString(5, qcmLgSurfaceTity.getActLen());
						}
						else
						{
							updateMatPsta.setString(5, qcmLgSurfaceTity.getCheckLen());
						}
						updateMatPsta.setString(6, qcmLgSurfaceTity.getMatNo());
						updateMatPsta.addBatch();
					}
				}
				if(list1.size() > 0)
				{
					for (String strC1 : list1) {
						QcmLgSurfaceCEntity qcmLgSurfaceTity = EntityTool
								.getEntityByJSONStr(strC1,
										QcmLgSurfaceCEntity.class);
						updateMatAllPsta.setString(1, arr[0].toString().substring(0, arr[0].length()-4)+StringTool.formatDecimal(m, "0000"));
						updateMatAllPsta.setString(2, qcmLgSurfaceTity.getActWeight());
						if(qcmLgSurfaceTity.getCheckDimater().equals(""))
						{
							updateMatAllPsta.setString(3, qcmLgSurfaceTity.getActDimater());
						}else
						{
							updateMatAllPsta.setString(3, qcmLgSurfaceTity.getCheckDimater());
						}
						if(qcmLgSurfaceTity.getCheckLen().equals(""))
						{
							updateMatAllPsta.setString(4, qcmLgSurfaceTity.getActLen());
						}
						else
						{
							updateMatAllPsta.setString(4, qcmLgSurfaceTity.getCheckLen());
						}
						updateMatAllPsta.setString(5, qcmLgSurfaceTity.getMatNo());						
						updateMatAllPsta.addBatch();
					}
				}
				insertBugMPsta.setString(1, arr[0].toString().substring(0, arr[0].length()-4)+StringTool.formatDecimal(m, "0000"));
				insertBugMPsta.setString(2, matTity.getJudgeStoveNo());
				insertBugMPsta.setString(3, matTity.getGroudNo());
				insertBugMPsta.setString(4, matTity.getStoveNo());
				insertBugMPsta.setString(5, matTity.getJudgeGradecode());
				insertBugMPsta.setString(6, matTity.getJudgeGradename());
				insertBugMPsta.setString(7, matTity.getJudgeStdCode());
				insertBugMPsta.setString(8, matTity.getJudgeStdName());
				insertBugMPsta.setString(9, matTity.getActDimater());
				insertBugMPsta.setString(10, matTity.getActHeight());
				insertBugMPsta.setString(11, matTity.getActLen());
				insertBugMPsta.setString(12, matTity.getActLenMin());
				insertBugMPsta.setString(13, matTity.getActLenMax());
				insertBugMPsta.setString(14, matTity.getActFixNum());
				insertBugMPsta.setString(15, matTity.getActFixLen());
				insertBugMPsta.setString(16, matTity.getActCount());
				insertBugMPsta.setString(17, matTity.getActTheoryWeight());
				insertBugMPsta.setString(18, arr[1].toString().substring(0,arr[1].length()-3)+StringTool.formatDecimal(m, "000"));
				insertBugMPsta.setString(19, matTity.getQuantity());
				insertBugMPsta.setString(20, matTity.getQualifiedCount());
				insertBugMPsta.setString(21, matTity.getProOrderNo());
				insertBugMPsta.setString(22, matTity.getProOrderId());
				insertBugMPsta.setString(23, userName);
				insertBugMPsta.setString(24, systime);
				insertBugMPsta.setString(25, matTity.getPlineCode());
				insertBugMPsta.setString(26, matTity.getPlineName());
				insertBugMPsta.addBatch();
			}
			deleteSurFacePsta.executeBatch();
			insertBugCPsta.executeBatch();
			updateMatPsta.executeBatch();
			insertBugMPsta.executeBatch();
			updateMatAllPsta.executeBatch();
			connection.commit();
			cro.setV_errMsg("确认检验结果成功!");
        }
	   	catch (Exception e) {
            System.out.println(e.getMessage());
            if (connection != null) {
                try {
                	cro.setV_errMsg(e.getMessage());
                    connection.rollback(); // 回滚事务
                }
                catch (Exception e2) {
                }
            }
        }
        finally {
            try {
                if (connection != null && !connection.isClosed()) {
                    connection.close();
                }
            }
            catch (Exception e2) {
            }
        }
        return cro;
	}
	
	/***
	 * 生成检验编号、缺陷编号
	 * @param conn
	 * @param plineCode
	 * @return
	 * @throws Exception
	 */
	public String[] getCheckNo(Connection conn,String plineCode)throws Exception
	{
		PreparedStatement psta = null;
		String[] arr = new String[2];
		String sqlLovsqe = CoreXmlSqlParsersFactory
				.getSql("FrmStuffSurfaceInspection.getCheckNo");
		psta = conn.prepareStatement(sqlLovsqe);
		psta.setString(1, plineCode);
		psta.setString(2, plineCode);
		psta.setString(3, plineCode);
		ResultSet rs = psta.executeQuery();
		if(rs.next())
		{
			arr[0] = rs.getString("SURFACE_CHECK_NO");
			arr[1] = rs.getString("BUG_NO");
		}
		rs.close();
		psta.close();
		return arr;
	}
	
	
	/***
	 * 查询炉计划
	 * @return
	 */
	public CoreReturnObject doQueryPlan(String startTim,String endTim,String stoveNo,String nodeStaus)
	{
		String sql = CoreXmlSqlParsersFactory.getSql("FrmStuffSurfaceInspection.doQueryPlan");
		if(!startTim.equals(""))
		{
			sql += " AND T.STARTTIME >=TO_DATE('" + startTim
			+ "', 'YYYY-MM-DD HH24:MI:SS')AND T.STARTTIME <=TO_DATE('"
			+ endTim + "', 'YYYY-MM-DD HH24:MI:SS') ";
		}
		if(!stoveNo.equals(""))
		{
			sql += " AND T.STOVE_NO  = '"+ stoveNo +"'";
		}
		//sql += " AND S.NODE_FUR_FLAG = '"+nodeStaus+"'";
		return this.getData(sql);
	}
	/***
	 * 查询炉计划订单信息
	 * @return
	 */
	public CoreReturnObject doQueryOrders(String funceNo)
	{
		return this.getDataBySqlID("FrmStuffSurfaceInspection.doQueryOrders", new Object[]{funceNo});
	}
	/***
	 * 查询表检实绩
	 * @return
	 */
	public CoreReturnObject doQueryResult(String funceNo)
	{
		return this.getDataBySqlID("FrmStuffSurfaceInspection.doQueryResult", new Object[]{funceNo});
	}
	
	/***
	 * 查询管坯队列
	 * @return
	 */
	public CoreReturnObject doQueryRack(String funcNo,String stoveNo)
	{
		return this.getDataBySqlID("FrmStuffSurfaceInspection.doQueryRack", new Object[]{funcNo,stoveNo});
	}
	
	/**
	 * 获取PCODE
	 */
	public CoreReturnObject getPCode(String Department) {
		return this.getDataBySqlID("FrmStuffSurfaceInspection.getPCode",
				new Object[] { Department });
	}
	/***
	 * 查询合格支数
	 * @return
	 */
	public CoreReturnObject doQueryStausSum(String funceNo,String flag)
	{
		if(flag.equals("0"))//全部支数
		{
			return this.getDataBySqlID("FrmStuffSurfaceInspection.doQueryStausSum", new Object[]{funceNo});
		}
		else if(flag.equals("1"))//废品支数
		{
			return this.getDataBySqlID("FrmStuffSurfaceInspection.doQueryStausSum1", new Object[]{funceNo});
		}else if(flag.equals("2"))//待处理支数
		{
			return this.getDataBySqlID("FrmStuffSurfaceInspection.doQueryStausSum2", new Object[]{funceNo});
		}else
		{
			return this.getDataBySqlID("FrmStuffSurfaceInspection.doQueryStausSum3", new Object[]{funceNo});
		}
	}
	/***
	 * 查询当前材料状态
	 * @param matNo
	 * @return
	 */
	public CoreReturnObject doQueryRackStaus(String matNo)
	{
	     return this.getDataBySqlID("FrmStuffSurfaceInspection.doQueryRackStaus",new Object[]{matNo});	
	}
	/***
	 * 修改材料状态
	 * @param matNo
	 * @param staus
	 * @return
	 */
	public CoreReturnObject updateRackStaus(String matNo,String staus,String scrapReason)
	{
		return this.setDataBySqlID("FrmStuffSurfaceInspection.updateRackStaus", new Object[]{staus,scrapReason,matNo});
	}
	
	/***
	 * 表检离线
	 * @param qcmProcessTity
	 * @return
	 */
	public CoreReturnObject insertOffine(String qcmProcessTity)
	{
		CoreReturnObject cro = new CoreReturnObject();
        Connection connection = this.getDao(CoreConstantData.sysbeanstr)
                .getConnection();
        PreparedStatement psta = null;
        String sql = "";
        ResultSet rs = null;
        Date now = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat(
        "yyyy-MM-dd HH:mm:ss");
        String systime = dateFormat.format(now);
        try {
			connection.setAutoCommit(false); // 取消自动提交事务
			String insertOffineSql = CoreXmlSqlParsersFactory.getSql("FrmStuffSurfaceInspection.insertOffine");//插入离线表、修改进程表状态
			QcmLgProgrrssEntity  qcmTity = EntityTool.getEntityByJSONStr(qcmProcessTity, QcmLgProgrrssEntity.class);
			insertOffineSql = EntityTool.fillSqlByEntity(insertOffineSql, qcmTity);
			PreparedStatement insertOfflinePsta = connection.prepareStatement(insertOffineSql);
			insertOfflinePsta.addBatch();
			insertOfflinePsta.executeBatch();
			cro.setV_errMsg("离线成功!");
			connection.commit();
        }
	   	catch (Exception e) {
            System.out.println(e.getMessage());
            if (connection != null) {
                try {
                	cro.setV_errMsg(e.getMessage());
                    connection.rollback(); // 回滚事务
                }
                catch (Exception e2) {
                }
            }
        }
        finally {
            try {
                if (connection != null && !connection.isClosed()) {
                    connection.close();
                }
            }
            catch (Exception e2) {
            }
        }
        return cro;
	}
	
	
	/***
	 * 表检离线回退
	 * @param qcmProcessTity
	 * @return
	 */
	public CoreReturnObject insertOffineBack(String qcmProcessTity)
	{
		CoreReturnObject cro = new CoreReturnObject();
        Connection connection = this.getDao(CoreConstantData.sysbeanstr)
                .getConnection();
        PreparedStatement psta = null;
        String sql = "";
        ResultSet rs = null;
        Date now = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat(
        "yyyy-MM-dd HH:mm:ss");
        String systime = dateFormat.format(now);
        try {
			connection.setAutoCommit(false); // 取消自动提交事务
			String insertOffineSql = CoreXmlSqlParsersFactory.getSql("FrmStuffSurfaceInspection.insertOffineBack");//修改离线表、修改进程表状态
			QcmLgProgrrssEntity  qcmTity = EntityTool.getEntityByJSONStr(qcmProcessTity, QcmLgProgrrssEntity.class);
			insertOffineSql = EntityTool.fillSqlByEntity(insertOffineSql, qcmTity);
			PreparedStatement insertOfflinePsta = connection.prepareStatement(insertOffineSql);
			insertOfflinePsta.addBatch();
			insertOfflinePsta.executeBatch();
			cro.setV_errMsg("离线回退成功!");
			connection.commit();
        }
	   	catch (Exception e) {
            System.out.println(e.getMessage());
            if (connection != null) {
                try {
                	cro.setV_errMsg(e.getMessage());
                    connection.rollback(); // 回滚事务
                }
                catch (Exception e2) {
                }
            }
        }
        finally {
            try {
                if (connection != null && !connection.isClosed()) {
                    connection.close();
                }
            }
            catch (Exception e2) {
            }
        }
        return cro;
	}
	
	/***
	 * 保存表检实绩
	 * @return
	 */
	public CoreReturnObject saveSurfaceResult(String surfaceTity)
	{
		CoreReturnObject cro = new CoreReturnObject();
        Connection connection = this.getDao(CoreConstantData.sysbeanstr)
                .getConnection();
        PreparedStatement psta = null;
        String sql = "";
        ResultSet rs = null;
        Date now = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat(
        "yyyy-MM-dd HH:mm:ss");
        String systime = dateFormat.format(now);
        try {
			connection.setAutoCommit(false); // 取消自动提交事务
			String insertSurfaceResultSql = CoreXmlSqlParsersFactory.getSql("FrmStuffSurfaceInspection.saveSurfaceResult");
			QcmLgSurfaceMEntity qcmLgSurfaceTity = EntityTool.getEntityByJSONStr(surfaceTity, QcmLgSurfaceMEntity.class);
			insertSurfaceResultSql = EntityTool.fillSqlByEntity(insertSurfaceResultSql, qcmLgSurfaceTity);
			PreparedStatement saveResultPsta = connection.prepareStatement(insertSurfaceResultSql);
			saveResultPsta.executeUpdate();
			cro.setV_errMsg("保存成功!");
			connection.commit();
        }
	   	catch (Exception e) {
            System.out.println(e.getMessage());
            if (connection != null) {
                try {
                	cro.setV_errMsg(e.getMessage());
                    connection.rollback(); // 回滚事务
                }
                catch (Exception e2) {
                }
            }
        }
        finally {
            try {
                if (connection != null && !connection.isClosed()) {
                    connection.close();
                }
            }
            catch (Exception e2) {
            }
        }
        return cro;
	}
	/***
	 * 查询是否存在离线管未处理的
	 * @param furaceNo
	 * @return
	 */
	public CoreReturnObject doQueryOffline(String furaceNo)
	{
		return this.getDataBySqlID("FrmStuffSurfaceInspection.doQueryOffline", new Object[]{furaceNo});
	}
	/***
	 * 结炉
	 * @return
	 */
	public CoreReturnObject doBaside(String furaceNo)
	{
		return this.setDataBySqlID("FrmStuffSurfaceInspection.doBaside", new Object[]{furaceNo});
	}
	/***
	 * 结炉回退
	 * @param furaceNo
	 * @return
	 */
	public CoreReturnObject doBasideBack(String furaceNo)
	{
		return this.setDataBySqlID("FrmStuffSurfaceInspection.doBasideBack", new Object[]{furaceNo});
	}
}
