package xin.glue.nui.H.H02; import java.math.BigDecimal; import java.sql.CallableStatement; import java.sql.SQLException; import xin.glue.ui.common.ProduceFactory; import com.posdata.glue.PosException; import com.posdata.glue.biz.activity.PosActivity; import com.posdata.glue.biz.constants.PosBizControlConstants; import com.posdata.glue.context.PosContext; import com.posdata.glue.dao.vo.PosParameter; import com.posdata.glue.dao.vo.PosRow; import com.posdata.glue.dao.vo.PosRowSet; import com.posdata.glue.msg.PosMessage; public class XinInitRhfOut extends PosActivity { public String runActivity(PosContext context) { // 获取从二级接收过来的数据 PosMessage message = context.getMessage(); String coilNo_L2 = (String)message.get("COIL_NO"); String slabNo = (String)message.get("SLAB_NO"); String devno = (String)message.get("DEVNO"); String infurHour = (String)message.get("INFUR_HOUR"); String extractDtime = (String)message.get("EXTRACT_DTIME"); String extractAvgTemp = (String)message.get("EXTRACT_AVG_TEMP"); String rehttemp1 = (String)message.get("RE_HT1_TEMP"); String rehttime1 = (String)message.get("RE_HT1_TIME"); String rehttemp2 = (String)message.get("RE_HT2_TEMP"); String rehttime2 = (String)message.get("RE_HT2_TIME"); String eqHtInfurHour = (String)message.get("EQ_HT_INFUR_HOUR"); String eqHtTemp = (String)message.get("EQ_HT_TEMP"); //这里需要把真实钢卷号转换成生产流水号 // 这里需要进行卷号的转换,发给加热炉二级的变成了实际卷号。所以收到的电文也是实际卷号,转换成计划卷号就可以了。 // 计划钢卷号 String coilNo = null; String returnTran = null; //调用存货异动点存储过程 /* ProduceFactory PD= new ProduceFactory(); PD.ErpDataCover("HSLAB",slabNo,"41A","0","O","加热炉二级","热轧轧制");*/ // 在执行相应的程序,把数据写入表中 PosParameter paramAA = new PosParameter(); paramAA.setWhereClauseParameter(0, coilNo_L2); //这里是实际钢卷号 logger.logDebug("XinInitRhfOut OLD_SAMPL_NO !!! "+coilNo_L2); PosRowSet CoilNoVo = getDao("mesdao").find("NIH020050_06.select", paramAA); // 查询出计划卷号的情况下,处理相应的业务类数据 if(CoilNoVo.hasNext()){ PosRow CoilNoRow = CoilNoVo.next(); coilNo = (String) CoilNoRow.getAttribute("COIL_NO"); //这里是计划钢卷号 logger.logDebug("XinInitRhfOut COIL_NO !!! "+coilNo); context.put("coilNo", coilNo); context.put("slabNo", slabNo); context.put("devno", devno); context.put("infurHour", infurHour); context.put("extractDtime", extractDtime); context.put("extractAvgTemp", extractAvgTemp); context.put("rehttemp1", rehttemp1); context.put("rehttime1", rehttime1); context.put("rehttemp2", rehttemp2); context.put("rehttime2", rehttime2); context.put("eqHtInfurHour", eqHtInfurHour); context.put("eqHtTemp", eqHtTemp); //这里必须判断板坯是否已经出来,没有的话不能执行下面的程序直接结束 PosParameter param6 = new PosParameter(); param6.setWhereClauseParameter(0,slabNo); PosRowSet rowset5 = getDao("mesdao").find("UIH020020_05.select", param6); logger.logDebug("XinInitRhfOut---> "+param6); if(rowset5.hasNext()){ logger.logDebug("XinInitRhfOut---> slab is cutted" ); returnTran = "success"; }else{ logger.logDebug("XinInitRhfOut---> slab is not cutted" ); returnTran = "error"; } /*//调用存货异动点存储过程 ProduceFactory PD= new ProduceFactory(); PD.ErpDataCover("HSLAB",slabNo,"41A","0","O","加热炉二级","热轧轧制");*/ /* CallableStatement PlRtn = getDao("mesdao").getCallableStatement("NIH020050_NIB028040"); try { if(PlRtn != null) { PlRtn.setString(1,slabNo); PlRtn.registerOutParameter(2, java.sql.Types.VARCHAR); PlRtn.registerOutParameter(3, java.sql.Types.VARCHAR); PlRtn.execute(); String sRetCode = PlRtn.getString(2); String sRetMsg = PlRtn.getString(3); } } catch (SQLException e) { throw new PosException(e.getMessage()); }finally { if (PlRtn != null) { try { PlRtn.close(); } catch (SQLException e) { logger.logWarn(e.getMessage(), e); } } } */ }else{ logger.logDebug("XinInitRhfOut OLD_SAMPL_NO 没有获取到 !!! "+coilNo_L2); returnTran = "error"; } return returnTran; } }