package xin.glue.ui.D.D01; 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; public class DesignSlabDnRst extends PosActivity { public String runActivity(PosContext context) { // TODO Auto-generated method stub logger.logInfo("Here is DesignSlabDnRst.java!!!"); String[] rowStatus1 = (String[])context.get("rowStatus1" ); // UID010031.xrw's datagrid : dg1 String[] CHK_FG1 = (String[])context.get("CHK_FG1" ); String[] sDb_OrdNo = (String[])context.get("ORD_NO" ); String[] sDb_OrdSeq = (String[])context.get("ORD_SEQ" ); String[] sDb_SlabThk = (String[])context.get("SLAB_THK" ); String[] sDb_SlabWth = (String[])context.get("SLAB_WTH" ); String[] sDb_SlabLen = (String[])context.get("SLAB_LEN" ); String[] sDb_SlabWgt = (String[])context.get("SLAB_WGT" ); //String[] sDb_SlabTrmthTp = (String[])context.get("SLAB_TRMTH_TP" ); String[] sDb_Gravity = (String[])context.get("GRAVITY" ); //String[] sDb_AutodsnYn = (String[])context.get("AUTODSN_YN" ); //String[] sDb_CoilPackWgtMin = (String[])context.get("COIL_PACK_WGT_MIN" ); String[] sDb_CoilPackWgtMin = (String[])context.get("PROD_WGT_MIN" ); //String[] sDb_CoilPackWgtMax = (String[])context.get("COIL_PACK_WGT_MAX" ); String[] sDb_CoilPackWgtMax = (String[])context.get("PROD_WGT_MAX" ); String[] sDb_FacStlGrd = (String[])context.get("FAC_STL_GRD" ); String[] sDb_CoilThk = (String[])context.get("COIL_THK" ); String[] sDb_CoilWth = (String[])context.get("COIL_WTH" ); String[] sDb_CoilLen = (String[])context.get("COIL_LEN" ); String[] sDb_CoilWgt = (String[])context.get("COIL_WGT" ); String[] sDb_ProcPath = (String[])context.get("PROC_PATH" ); String[] sDb_HcrClf = (String[])context.get("HCR_CLF" ); String[] sDb_EmgmtrYn = (String[])context.get("EMGMTR_YN" ); String[] sDb_FacStlGrp = (String[])context.get("FAC_STL_GRP" ); //String[] sDb_CombYn = (String[])context.get("COMB_YN" ); //String[] sDb_CoilIndia = (String[])context.get("COIL_INDIA" ); String[] sDb_CoilIndia = (String[])context.get("ORD_INDIA" ); //String[] sDb_CoilOutdia = (String[])context.get("COIL_OUTDIA" ); String[] sDb_CoilOutdia = (String[])context.get("ORD_OUTDIA" ); String[] sDb_DsnProcStat = (String[])context.get("DSN_PROC_STAT" ); //DSN_PROC_STAT ¼³°è»óÅÂ('1':¼³°è´ë»ó '2':¼³°è¿Ï·á '3':¼³°èÈ®Á¤) String[] sDb_DsnProcYn = (String[])context.get("DSN_PROC_YN" ); //DSN_PROC_YN ¼³°èÁøÇà¿©ºÎ(Y/N) String[] sDb_SlabCnt = (String[])context.get("SLAB_CNT" ); String[] sDb_KeepwarmYn = (String[])context.get("KEEPWARM_YN" ); String[] sDb_prodLine = (String[])context.get("PROD_LINE"); String[] sDb_C_CoilThk = (String[])context.get("C_COIL_THK"); String[] sDb_C_CoilWth = (String[])context.get("C_COIL_WTH"); int iCnt = 0; if (rowStatus1 != null) { iCnt = rowStatus1.length; } logger.logInfo("rowCount1 = ["+ iCnt +"]"); PosParameter param = null; for(int i=0 ; i < iCnt; i++) { logger.logInfo("CHK_FG["+ i +"] = ["+ CHK_FG1[i] +"] sDb_DsnProcStat = ["+ sDb_DsnProcStat[i] +"] sDb_DsnProcYn = ["+ sDb_DsnProcYn[i] +"]"); if ("1".equals(CHK_FG1[i])) { // update if ("1".equals(sDb_DsnProcStat[i]) && "N".endsWith(sDb_DsnProcYn[i])) { param = new PosParameter(); // update tbd01_slabdn_obj param.setWhereClauseParameter( 0, "Y" ) ; //Pre-View param.setWhereClauseParameter( 1, "1" ) ; //Pre-Save param.setWhereClauseParameter( 2, sDb_OrdNo[i] ) ; param.setWhereClauseParameter( 3, sDb_OrdSeq[i] ) ; getDao("mesdao").update("ModifyTargetRows.update", param); // insert into tbd01_slabdn_rst param = new PosParameter(); param.setValueParamter( 0, sDb_OrdNo[i] ); //, ORD_NO, ORD_SEQ param.setValueParamter( 1, sDb_OrdSeq[i] ); param.setValueParamter( 2, sDb_SlabThk[i] ); //, SLAB_THK, SLAB_WTH, SLAB_LEN, SLAB_WGT param.setValueParamter( 3, sDb_SlabWth[i] ); param.setValueParamter( 4, sDb_SlabLen[i] ); param.setValueParamter( 5, sDb_SlabWgt[i] ); //param.setValueParamter( 6, sDb_SlabTrmthTp[i] ); param.setValueParamter( 6, sDb_Gravity[i] ); //param.setValueParamter( 7, sDb_AutodsnYn[i] ); param.setValueParamter( 7, sDb_CoilPackWgtMin[i] ); //, COIL_PACK_WGT_MIN, COIL_PACK_WGT_MAX param.setValueParamter( 8, sDb_CoilPackWgtMax[i] ); param.setValueParamter( 9, sDb_FacStlGrd[i] ); //, FAC_STL_GRD param.setValueParamter( 10, sDb_CoilThk[i] ); //, COIL_THK, COIL_WTH, COIL_LEN, COIL_WGT param.setValueParamter( 11, sDb_CoilWth[i] ); param.setValueParamter( 12, sDb_CoilLen[i] ); param.setValueParamter( 13, sDb_CoilWgt[i] ); param.setValueParamter( 14, sDb_ProcPath[i] ); param.setValueParamter( 15, sDb_HcrClf[i] ); param.setValueParamter( 16, (sDb_EmgmtrYn[i] == null) ? "N" : sDb_EmgmtrYn[i] ); param.setValueParamter( 17, sDb_FacStlGrp[i] ); param.setValueParamter( 18, "N"); if(sDb_CoilIndia[i] == null) { sDb_CoilIndia[i] = ""; } param.setValueParamter( 19, (sDb_CoilIndia[i]== null) ? "0" : sDb_CoilIndia[i]); param.setValueParamter( 20, sDb_CoilOutdia[i] ); param.setValueParamter( 21, sDb_KeepwarmYn[i] ); param.setValueParamter( 22, sDb_prodLine[i] ); param.setValueParamter( 23, sDb_C_CoilThk[i] ); param.setValueParamter( 24, sDb_C_CoilWth[i] ); param.setValueParamter( 25, sDb_SlabCnt[i] ); getDao("mesdao").update("DesignSlabDnRst.insert", param); } } } return PosBizControlConstants.SUCCESS; } }