package xin.glue.ui.G.G04; import java.sql.CallableStatement; import java.sql.SQLException; 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.PosGenericDao; public class SaveL2Wgt extends PosActivity{ public String runActivity(PosContext context) { PosGenericDao dao = this.getDao("mesdao"); CallableStatement cstm= null; String[] SlabNo = (String[])context.get("SLAB_NO"); String[] User = (String[])context.get("USER"); String[] weightWgt = (String[])context.get("WEIGHT_WGT"); String[] samplingid = (String[])context.get("SAMPLINGID"); String[] CHK = (String[])context.get("CHK"); String[] type = (String[])context.get("TYPE"); if(SlabNo.length == 0){ return PosBizControlConstants.SUCCESS; } StringBuffer slabNOs = new StringBuffer(); for(int i = 0 ; i < SlabNo.length;i++){ if(!CHK[i].equals("Y"))continue; try { cstm = dao.getCallableStatement("UIG050020_01.call"); cstm.setString(1, SlabNo[i]); cstm.setString(2, weightWgt[i]); cstm.setString(3, samplingid[i]); cstm.setString(4, User[0]); cstm.setString(5, type[0]); cstm.registerOutParameter(6, java.sql.Types.VARCHAR); cstm.execute(); } catch(Exception ex) { logger.logDebug(ex.getMessage()); return PosBizControlConstants.SUCCESS; }finally { if (cstm != null) { try { cstm.close(); } catch (SQLException e) { logger.logWarn(e.getMessage(), e); } } } } return PosBizControlConstants.SUCCESS; } }