package xin.glue.nui.H.H02; import java.math.BigDecimal; import com.posdata.glue.biz.activity.PosActivity; import com.posdata.glue.biz.constants.PosBizControlConstants; import com.posdata.glue.biz.control.PosBizControlIF; import com.posdata.glue.biz.control.PosBizProvider; import com.posdata.glue.component.PosConstants; 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.PosMESMessageImpl; import com.posdata.glue.msg.PosMessage; import com.posdata.glue.util.log.PosLog; import com.posdata.glue.util.log.PosLogFactory; public class XinSaveSlabRoller extends PosActivity { private final PosLog log = PosLogFactory.getLogger(getClass()); public String runActivity(PosContext context) { PosMessage message = context.getMessage(); String[] A_SLAB = new String[7]; String[] C_SLAB = new String[6]; A_SLAB[0] = (String)message.get("A1_SLAB_NO"); A_SLAB[1] = (String)message.get("A2_SLAB_NO"); A_SLAB[2] = (String)message.get("A3_SLAB_NO"); A_SLAB[3] = (String)message.get("A4_SLAB_NO"); A_SLAB[4] = (String)message.get("A5_SLAB_NO"); A_SLAB[5] = (String)message.get("A6_SLAB_NO"); A_SLAB[6] = (String)message.get("A7_SLAB_NO"); C_SLAB[0] = (String)message.get("C7_SLAB_NO"); C_SLAB[1] = (String)message.get("C8_SLAB_NO"); C_SLAB[2] = (String)message.get("C9_SLAB_NO"); C_SLAB[3] = (String)message.get("C10_SLAB_NO"); C_SLAB[4] = (String)message.get("C11_SLAB_NO"); C_SLAB[5] = (String)message.get("C12_SLAB_NO"); String MSG_DTIME = (String)message.get("MSG_DTIME"); String YardAddr = null; int i = 0; for ( i =0 ; i < 7 ; i++ ) { PosParameter param2 = new PosParameter(); param2.setWhereClauseParameter(0, A_SLAB[i]); PosRowSet YardExistVo = getDao("mesdao").find("NIH020080_SLAB_EXIST.select", param2); if (YardExistVo.hasNext()) { PosRow YardExistROW = YardExistVo.next(); String DupAddr = (String)YardExistROW.getAttribute("YARD_ADDR"); PosParameter param3 = new PosParameter(); param3.setWhereClauseParameter(0, DupAddr); this.getDao("mesdao").update("NIH020080_SLAB_EXIST.update", param3); } PosParameter param = new PosParameter(); YardAddr = "A"+String.valueOf(i+1); param.setWhereClauseParameter(0, A_SLAB[i]); param.setWhereClauseParameter(1, MSG_DTIME); param.setWhereClauseParameter(2, "RHF L2"); param.setWhereClauseParameter(3, YardAddr); this.getDao("mesdao").update("NIH020080_01.update", param); } YardAddr = null; for ( i =0 ; i < 6 ; i++ ) { PosParameter param2 = new PosParameter(); param2.setWhereClauseParameter(0, C_SLAB[i]); PosRowSet YardExistVo = getDao("mesdao").find("NIH020080_SLAB_EXIST.select", param2); if (YardExistVo.hasNext()) { PosRow YardExistROW = YardExistVo.next(); String DupAddr = (String)YardExistROW.getAttribute("YARD_ADDR"); PosParameter param3 = new PosParameter(); param3.setWhereClauseParameter(0, DupAddr); this.getDao("mesdao").update("NIH020080_SLAB_EXIST.update", param3); } PosParameter param1 = new PosParameter(); YardAddr = "C"+String.valueOf(i+7); param1.setWhereClauseParameter(0, C_SLAB[i]); param1.setWhereClauseParameter(1, MSG_DTIME); param1.setWhereClauseParameter(2, "RHF L2"); param1.setWhereClauseParameter(3, YardAddr); this.getDao("mesdao").update("NIH020080_01.update", param1); } /* if ( A_SLAB[6] != null && !A_SLAB[6].equals("")) { PosParameter param5 = new PosParameter(); param5.setWhereClauseParameter(0, A_SLAB[6]); PosRowSet specMillVo = getDao("mesdao").find("NIH020080_SPEC_MILL.select", param5); String CoilNo = null; if (specMillVo.hasNext() ) { PosRow specMillROW = specMillVo.next(); CoilNo = (String)specMillROW.getAttribute("COIL_NO"); } if (CoilNo != null) { PosParameter paramy = new PosParameter(); paramy.setValueParamter(0, "HMFU30"); paramy.setValueParamter(1, "A7" ); paramy.setValueParamter(2, A_SLAB[6] ); paramy.setValueParamter(3, CoilNo ); this.getDao("mesdao").update("UIG040042_L2_TAKEIN.insert",paramy); } } */ return PosBizControlConstants.SUCCESS; } }