package xin.glue.ui.G.G04; import java.math.BigDecimal; import com.posdata.glue.PosException; 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.context.PosContext; import com.posdata.glue.dao.PosGenericDao; 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; public class SyncTransfWithL2 extends PosActivity { public String runActivity(PosContext context) { String[] hcrClf = (String[])context.get("HCR_CLF"); PosGenericDao mesdao = this.getDao("mesdao"); PosGenericDao zhbdao = (PosGenericDao)getDao("zhbdao"); PosParameter param1 = null; String RECEV_FLAG = null; String RECEV_DTIME = null; String RECEV_REG_ID = null; String RECEV_SLAB_NO = null; String selectTransL3 = "SELECT DSN_SLAB_NO,SLAB_NO,SLAB_WGT FROM TBG04_SLAB_TRANSF WHERE STAT_CD = '0'"; PosRowSet rowSet1 = mesdao.findByQueryStatement(selectTransL3); while(rowSet1.hasNext()){ param1 = new PosParameter(); PosRow row1 = rowSet1.next(); String transSlabNo = (String)row1.getAttribute("SLAB_NO"); String dsnSlabNo = (String)row1.getAttribute("DSN_SLAB_NO"); BigDecimal sbwt = (BigDecimal)row1.getAttribute("SLAB_WGT"); String slabWgt = String.valueOf(sbwt); System.out.println("---------->" + transSlabNo); param1.setWhereClauseParameter(0, transSlabNo); PosRowSet rowSet = zhbdao.find("UIG040090_SYNCHRONIZE.select", param1); if(rowSet.hasNext()){ PosRow row = rowSet.next(); RECEV_FLAG = (String)row.getAttribute("RECEV_FLAG"); RECEV_DTIME = (String)row.getAttribute("RECEV_DTIME"); RECEV_REG_ID = (String)row.getAttribute("RECEV_REG_ID"); RECEV_SLAB_NO = (String)row.getAttribute("SLAB_NO"); param1 = new PosParameter(); param1.setWhereClauseParameter(0, RECEV_FLAG); param1.setWhereClauseParameter(1, RECEV_DTIME); param1.setWhereClauseParameter(2, RECEV_REG_ID); param1.setWhereClauseParameter(3, RECEV_FLAG); param1.setWhereClauseParameter(4, RECEV_SLAB_NO); mesdao.update("UIG040090_SYNCHRONIZE.update",param1); // 中厚板确认接收以后 修改板坯状态 if(RECEV_FLAG.equals("1")){ PosParameter param0 = new PosParameter(); param0.setWhereClauseParameter(0, RECEV_SLAB_NO); getDao("mesdao").update("UIG040090_01.update", param0); PosParameter paramA = new PosParameter(); paramA.setWhereClauseParameter(0, "06"); paramA.setWhereClauseParameter(1, dsnSlabNo); getDao("mesdao").update("NIG020610_TBD01_SLABDN.update", paramA); BigDecimal SlabWgt = new BigDecimal(slabWgt); SendProg_NIE012070(transSlabNo,"","","","","RGF","RGB","TM",SlabWgt); SendProg_NIE012080(); } } } if(hcrClf[0].equals("Y")){ return "rs"; } else{ return "ls"; } } public PosContext SendProg_NIE012070(String MatNo,String sOrdNo,String sOrdSeq,String sBefOrdNo,String sBefOrdSeq,String sProgCd,String BefProcCd,String sKind,BigDecimal nwgt ) { PosContext context = new PosContext(); PosMessage message = new PosMESMessageImpl(); String TcId = "NIE012070"; message.setTCID(TcId); message.setObject("MSG_ID",TcId); message.setObject("BEF_ORD_NO",sBefOrdNo); message.setObject("BEF_ORD_SEQ",sBefOrdSeq); message.setObject("ORD_NO",sOrdNo); message.setObject("ORD_SEQ",sOrdSeq); message.setObject("BEF_PROG_CD",BefProcCd); message.setObject("PROG_CD",sProgCd); message.setObject("MAT_TYPE",sKind); message.setObject("MAT_NO",MatNo); message.setObject("WGT", nwgt ); message.setObject("PGMID","UIG040090"); message.setObject("REG_ID","UIG040090"); message.setTCID(TcId); context.setMessage(message); // this.processComponent(PosConstants.CREATE_MESSAGE, context); // String transactionCode = context.getMessage().getTC(); String SERVICE_POSTFIX = "-service"; context.put(PosBizControlConstants.SERVICE_NAME, TcId + SERVICE_POSTFIX); // context.setMessage(message); PosBizControlIF controller = PosBizProvider.getController(); controller.doSubController(context,false); return null; } public String SendProg_NIE012080() { PosContext context = new PosContext(); PosMessage message = new PosMESMessageImpl(); String TcId = "NIE012080"; message.setTCID(TcId); message.setObject("MSG_ID",TcId); message.setObject("AA",null); context.setMessage(message); message.setTCID(TcId); String SERVICE_POSTFIX = "-service"; context.put(PosBizControlConstants.SERVICE_NAME, TcId + SERVICE_POSTFIX); PosBizProvider.getController().doSubController(context, false); String SERVICE_ERR_MSG = (String) context.get("SERVICE_ERR_MSG"); logger.logInfo("PosSaveSlabCutting SendProg_NIE012080 SERVICE_ERR_MSG:"+SERVICE_ERR_MSG ); if (SERVICE_ERR_MSG != null) { throw new PosException(SERVICE_ERR_MSG); } return null; } }